diff --git a/CHANGELOG.md b/CHANGELOG.md index 08c047f..875493b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Bidirectional sync between the frontend and live backend COMPAS objects: gizmo drags/rotations (`object_transform`), toolbar-added geometry (`create_geometry`), and material edits (`material_edit`) now mutate the same live objects a running script sees, instead of only flowing updates one way. See `src/compas_threejs/viewer/BIDIRECTIONAL_SYNC.md`. + ### Changed ### Removed diff --git a/src/compas_threejs/viewer/BIDIRECTIONAL_SYNC.md b/src/compas_threejs/viewer/BIDIRECTIONAL_SYNC.md new file mode 100644 index 0000000..8c56ffd --- /dev/null +++ b/src/compas_threejs/viewer/BIDIRECTIONAL_SYNC.md @@ -0,0 +1,162 @@ +# Bidirectional sync — context for a future agent + +This documents the frontend → backend half of the viewer's sync model: edits made in the +browser (drag an object, add a new one, change its material) get applied to the live +Python objects on the backend, not just displayed. Before this work, the wire was +effectively one-directional — the backend pushed geometry/UI to the frontend, and the +only things that came back were UI callbacks (button clicks, object picks). See +`CONTEXTE.md` in this same directory for the general module layout (`App`/`Workspace`/ +`Inbox`/`Outbox`/`AppServer`/`Remote`) this builds on top of. + +The paired frontend implementation lives in the sibling `compas_threejs_ts` repo, at +`src/viewer/BIDIRECTIONAL_SYNC.md` — read that alongside this file for the full picture. +Both repos carry this work on a branch called `feature/bidirectional-sync`, branched off +`main` in each. + +## The three message types + +All three are frontend → backend JSON dispatches, routed through `Inbox.handle()` → +`Inbox._handlers` (`inbox.py`), the same table `ui_callback`/`object_picked`/etc. already +used. Each new handler resolves the *live* Python object via `Inbox.geometry_registry` +(guid → object, populated by `Workspace.add_geometry`/`register_geometry`) and mutates it +**in place**, then reuses an existing `Workspace` method to re-serialize and broadcast — +no new outbound message types were needed; the frontend receives the result through the +exact same `add_geometry`/`material` paths every script already uses. + +### `object_transform` — dragging the transform gizmo + +Handler: `Inbox._handle_object_transform`. Payload: `{guid, matrix}` where `matrix` is a +**4x4 nested list, row-major**, and — this is the important, non-obvious part — it is a +**delta**, not an absolute placement. The frontend computes it as +`(matrix after drag) * (matrix before drag)^-1`. Applying it via +`compas.geometry.Transformation.from_matrix(matrix)` + `geometry.transform(T)` works +generically across every COMPAS geometry/datastructure type (frame-based primitives, +meshes, breps) with no per-type special-casing, because `.transform()` is defined +generically on all of them. + +Why a delta and not an absolute matrix: the frontend's mesh conversion +(`Object3D.applyMatrix4`, see the frontend doc) decomposes each object's world frame +directly into its `position`/`quaternion`/`scale`, so a freshly-built `Object3D` already +sits at its real placement, not identity. Sending its post-drag matrix as if it were a +delta (an early bug in this feature) caused the backend to compose it *on top of* the +object's current state, landing it somewhere else entirely — looked like the object +"jumped" or "reverted." Fixed by having the frontend track the object's matrix as of +drag-start and diff against that. + +Because the mutation is applied **in place** to the exact object instance stored in +`geometry_registry` — not a replacement — anything else concurrently mutating that same +Python object continues from the new state automatically. This is what makes "drag a +spinning torus to a new spot and it keeps spinning from there" work: `examples/lights.py`'s +`viz.loop` callback holds the same `torus` reference the registry holds; nothing needs to +tell it "the object moved." + +**Concurrency caveat (not fully solved):** `_handle_object_transform` runs off the +server's asyncio event loop via `asyncio.to_thread` (see `server.py`'s +`_websocket_endpoint`), i.e. on a thread-pool thread, while an `App.loop` callback runs on +the main thread. Both can mutate the same object concurrently. `Inbox.lock` (a plain +`threading.Lock`) guards only the handler's own `geometry.transform()` call — it does +**not** make arbitrary user `loop` callbacks thread-safe. Given the default +`loop_interval` (10ms) and that dragging is a human-timescale event, real corruption is +unlikely but possible. If you're asked to harden this further, that's the seam. + +Re-broadcast via `Workspace.update_geometry(geometry)` (existing method — handles the +Brep→viewmesh case too, so nothing new was needed there). + +### `create_geometry` — "Add Box/Sphere/Point" from the toolbar + +Handler: `Inbox._handle_create_geometry`. Payload: `{type, point: [x,y,z], params: {...}}`. +`type` is looked up in the module-level `_CREATABLE_TYPES` registry (top of `inbox.py`), +which maps a type name to its COMPAS constructor and the whitelist of numeric kwargs a +message is allowed to set: + +```python +_CREATABLE_TYPES = { + "box": (Box, ("xsize", "ysize", "zsize")), + "sphere": (Sphere, ("radius",)), + "point": (Point, ()), +} +``` + +Frame-based shapes (everything except `point`) get a world-aligned `Frame` built from +`point` — orienting them is what the gizmo's rotate mode is for, not this message. +Missing params default to `1.0`. The constructed object is hand off to +`Workspace.add_geometry(geometry, Material())` — the **same** method every example script +calls, so registration, broadcast, and replay-on-reconnect all come for free; the +frontend needs zero special-casing to render a frontend-created object. + +**Extending the type set**: add an entry to `_CREATABLE_TYPES` and, if it needs a frame, +it'll pick up the same `Frame(Point(*point), [1,0,0], [0,1,0])` construction +automatically (see the `if type_name == "point": ... else: ...` branch). Non-frame types +(anything like `Point`) need their own branch the way `point` has one. + +**Deliberately deferred, not forgotten**: scale is not exposed via the create UI or the +gizmo for created (or any) objects — COMPAS shapes store size as explicit dimensions +(`box.xsize`, `sphere.radius`, ...) separate from their frame, so a generic +matrix-transform approach (like `object_transform` uses) doesn't resize them correctly. A +"click and drag in 3D space to draw a shape" placement UX was also explicitly scoped out +in favor of "spawn near camera, then drag into place with the existing gizmo" — see the +frontend doc for why that made this a small feature instead of a large one. + +### `material_edit` — toolbar color/metalness/roughness + +Handler: `Inbox._handle_material_edit`. Payload: `{guid, color?, metalness?, roughness?}` +(`guid` is the **geometry's** guid, not a material guid — the handler looks the material +up via a new `Inbox.material_registry: dict[geometry_guid, Material]`). + +`material_registry` is populated automatically inside `Workspace.add_geometry`, right +where `material._geometry_guid` is already set — so this covers every object added with +a material by any script, and `create_geometry` objects too, with one hook point and zero +extra plumbing. + +If a geometry was added with no material at all (`add_geometry(geometry)`, no `material=` +arg), `material_registry` has no entry for it — the handler lazily creates a default +`Material()` on first edit rather than failing. + +**Validation is atomic on purpose.** `Material`'s property setters raise `ValueError` on +out-of-range values (metalness/roughness must be in `[0, 1]`). The handler builds a dict +of pending updates, snapshots the current values of only the fields being touched, and +rolls back to that snapshot if *any* field fails to apply — so a single bad value from a +malformed message can't leave the material half-updated while also skipping the +broadcast (which would silently desync the backend's true state from what's rendered). +This was found and fixed via a self-authored test during implementation — worth keeping +if this handler grows more fields. + +**Scope is deliberately narrow**: only `compas_threejs.materials.Material` +("standard_material") objects are editable this way. `PointMaterial`/`LineMaterial`/ +`PhysicalMaterial` have different property sets entirely (e.g. a point's material has +`size`, not `metalness`/`roughness`) and aren't wired up — the frontend gates this itself +(see its doc) rather than the backend rejecting it. + +**Why this reuses `Workspace.update_material` specifically**: it's the exact method +`examples/objects_action.py`'s "Make it blue"/"Make it red" per-object action buttons +already call on the same `Material` instance. Because `material_registry` holds a +reference to that *same* instance (not a copy), a toolbar edit and a script-authored +action button edit can't drift out of sync — verified during implementation by editing a +material via the simulated `material_edit` path, then triggering the object's existing +"Make it blue" action and confirming it saw the toolbar edit's changes. + +## Wiring notes + +- `Inbox.__init__` now takes an optional `app=None` back-reference (`App.__init__` passes + `Inbox(self)`), needed so handlers can reach `self.app.get_workspace(workspace_id)` to + call `update_geometry`/`add_geometry`/`update_material`. `Remote`'s own `Inbox()` in + `remote.py` still uses the `app=None` default — `Remote` never routes inbound frontend + messages today, so this is a no-op there, not a gap. +- No changes were needed in `Outbox`, `AppServer`, or the websocket plumbing — all three + new handlers ride the existing inbound JSON-text-frame path + (`AppServer._websocket_endpoint` → `App.on_message` → `Inbox.handle`) and existing + outbound broadcast/persist machinery. + +## Verifying changes here + +No test suite exists in this repo (see `CONTEXTE.md`). Verification during this work was +ad hoc: start a real `App`, call `app.inbox._handle_object_transform(...)` / +`_handle_create_geometry(...)` / `_handle_material_edit(...)` directly with a +hand-built message dict (exactly what `App.on_message` would decode), and assert on the +resulting Python object state directly. For end-to-end confidence, also spin up a real +`AppServer` and confirm the served `frontend/assets/index.js` bundle actually contains +the new dispatch string names — the frontend build must be rebuilt and synced into +`src/compas_threejs/viewer/frontend/` (see `FRONTEND_WORKFLOW.md`; note +`scripts/sync-frontend.py` currently fails on Windows console encoding for its emoji +`print()` — a separate, pre-existing, unrelated issue — so copy `dist/` manually if +needed) before any of this is reachable from a real browser session. diff --git a/src/compas_threejs/viewer/app.py b/src/compas_threejs/viewer/app.py index d7e95c6..1c3b1a3 100644 --- a/src/compas_threejs/viewer/app.py +++ b/src/compas_threejs/viewer/app.py @@ -99,7 +99,7 @@ def __init__(self, host: str = "127.0.0.1", websocket_port: int = 9001, frontend self.server = AppServer(frontend_dir=frontend_dir) self.outbox = Outbox(self.server) - self.inbox = Inbox() + self.inbox = Inbox(self) # Setter Attributes self._loop_interval = 0.01 diff --git a/src/compas_threejs/viewer/frontend/assets/InterVariable.woff2 b/src/compas_threejs/viewer/frontend/assets/InterVariable.woff2 new file mode 100644 index 0000000..5a8d3e7 Binary files /dev/null and b/src/compas_threejs/viewer/frontend/assets/InterVariable.woff2 differ diff --git a/src/compas_threejs/viewer/frontend/assets/index.css b/src/compas_threejs/viewer/frontend/assets/index.css index af16ca7..d9c606d 100644 --- a/src/compas_threejs/viewer/frontend/assets/index.css +++ b/src/compas_threejs/viewer/frontend/assets/index.css @@ -1,2 +1,2 @@ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-sm:calc(var(--radius) - 4px);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}html,body{margin:0;padding:0;overflow:hidden}body{background-color:var(--background);color:var(--foreground);font-family:Inter,sans-serif}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-1\/2{top:50%}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.left-0{left:0}.z-50{z-index:50}.z-1000{z-index:1000}.z-\[4000\]{z-index:4000}.z-\[4100\]{z-index:4100}.z-\[5000\]{z-index:5000}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-\(--reka-select-trigger-height\){height:var(--reka-select-trigger-height)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:calc(var(--spacing) * 96)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-72{width:calc(var(--spacing) * 72)}.w-84{width:calc(var(--spacing) * 84)}.w-\[80\%\]{width:80%}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\(--reka-select-trigger-width\){min-width:var(--reka-select-trigger-width)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-32{min-width:calc(var(--spacing) * 32)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.cursor-default{cursor:default}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.place-content-center{place-content:center}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.bg-background{background-color:var(--background)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-secondary-foreground{background-color:var(--secondary-foreground)}.bg-transparent{background-color:#0000}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-start{text-align:start}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.text-current{color:currentColor}.text-foreground{color:var(--foreground)}.text-input{color:var(--input)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing) * 1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\\\'size-\\\'\]\)\]\:size-3 svg:not([class*="'size-'"]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=decrement\]\]\:pl-5>[data-slot=input]:has([data-slot=decrement]){padding-left:calc(var(--spacing) * 5)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=increment\]\]\:pr-5>[data-slot=input]:has([data-slot=increment]){padding-right:calc(var(--spacing) * 5)}.\[\&\>span\]\:truncate>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:color-mix(in oklab, var(--background) 20%, transparent)}}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:text-background{color:var(--background)}[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:color-mix(in oklab, var(--background) 10%, transparent)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0/.88);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0/.92);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0/.72);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--button-hover:oklch(100% 0 0/0);--toolbar-button-hover-shadow:3px 3px 10px 0px var(--foreground)}@supports (color:color-mix(in lab, red, red)){:root{--toolbar-button-hover-shadow:3px 3px 10px 0px color-mix(in oklab, var(--foreground) 30%, transparent)}}:root{--toolbar-button-active-shadow:3px 3px 2px 1px var(--foreground) inset, -3px -3px 2px 2px var(--background) inset}@supports (color:color-mix(in lab, red, red)){:root{--toolbar-button-active-shadow:3px 3px 2px 1px color-mix(in oklab, var(--foreground) 55%, transparent) inset, -3px -3px 2px 2px color-mix(in oklab, var(--background) 70%, transparent) inset}}:root{font-feature-settings:"liga" 1, "calt" 1;--theme-bg-start:#ffffff1f;--theme-bg-end:#ffffff24;--theme-border-color:#ffffff24;--theme-box-shadow:0 6px 20px #0000001f, inset 2px 2px 6px #fff9, inset -2px -2px 6px #0000000a;--theme-inset-highlight:#fff9;--theme-inset-shadow:#0000000a;font-family:Inter,sans-serif}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0/.88);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0/.92);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0/.72);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--theme-bg-start:#1118271f;--theme-bg-end:#1118272e;--theme-border-color:#ffffff1f;--theme-box-shadow:0 6px 22px 0 #00000047, inset 0 0 8px #ffffff0f;--toolbar-button-hover-shadow:3px 3px 10px 0px var(--foreground)}@supports (color:color-mix(in lab, red, red)){.dark{--toolbar-button-hover-shadow:3px 3px 10px 0px color-mix(in oklab, var(--foreground) 40%, transparent)}}.dark{--toolbar-button-active-shadow:3px 3px 2px 1px var(--foreground) inset, -2px -2px 2px 1px var(--background) inset}@supports (color:color-mix(in lab, red, red)){.dark{--toolbar-button-active-shadow:3px 3px 2px 1px color-mix(in oklab, var(--foreground) 70%, transparent) inset, -2px -2px 2px 1px color-mix(in oklab, var(--background) 40%, transparent) inset}}@supports (font-variation-settings:normal){:root{font-family:InterVariable,sans-serif}}div#app{margin:0;padding:0}.theme{background:linear-gradient(135deg, var(--theme-bg-start) 0%, var(--theme-bg-end) 100%);-webkit-backdrop-filter:blur(25px)saturate(180%);backdrop-filter:blur(25px)saturate(180%);border:1px solid var(--theme-border-color);box-shadow:var(--theme-box-shadow)}*{scrollbar-width:thin;scrollbar-color:#888 transparent}.text-tag{color:var(--popover-foreground);background:var(--popover);border:1px solid var(--border);border-radius:var(--radius-sm);white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none;padding:2px 6px;font-family:Inter,sans-serif;font-size:12px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}div.right-bar[data-v-2390ba1f]{pointer-events:none;flex-direction:column;width:30vw;min-width:250px;max-width:300px;height:100%;padding:20px;display:flex;position:absolute;top:0;right:0}div.object-info[data-v-2390ba1f]{z-index:1000;max-width:400px;height:100%;color:var(--foreground);pointer-events:auto;border-radius:10px;flex-direction:column;margin:0;padding:20px;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;right:0%}div.is-hidden[data-v-2390ba1f]{pointer-events:none;transform:translate(150%)}div#data-container[data-v-2390ba1f]{flex-direction:column;gap:30px;display:flex;position:relative;overflow-y:auto}div.item[data-v-2390ba1f]{align-items:left;flex-direction:column;display:flex}h1.section-title[data-v-2390ba1f]{color:var(--foreground);background:color-mix(in oklab, var(--background) 25%, transparent);-webkit-backdrop-filter:blur(10px);box-shadow:1px 1px 3px 0px color-mix(in oklab, var(--foreground) 35%, transparent) inset, -1px -1px 3px 0px color-mix(in oklab, var(--background) 70%, transparent) inset;border-radius:10px;margin-bottom:10px;padding:5px 5px 5px 10px}div.data-entry[data-v-2390ba1f]{margin-bottom:8px;padding:0 0 0 10px}Button#closeObjectBar[data-v-2390ba1f]{align-self:flex-end;margin-top:auto;position:relative}Button#openObjectBar[data-v-2390ba1f]{z-index:1;visibility:hidden;pointer-events:auto;transition:visibility 1s;display:flex;position:absolute;bottom:40px;right:40px}Button#openObjectBar.is-hidden[data-v-2390ba1f]{opacity:1;visibility:visible}.save-view-icon[data-v-c0eebdad]{justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex;position:relative}.save-view-overlay[data-v-c0eebdad]{background:color-mix(in srgb, var(--secondary-foreground) 92%, white);width:11px;height:11px;color:var(--secondary);border:1px solid color-mix(in srgb, var(--secondary) 65%, white);border-radius:999px;justify-content:center;align-items:center;display:inline-flex;position:absolute;bottom:-2px;right:-4px;overflow:hidden}.save-view-overlay-icon[data-v-c0eebdad]{stroke-width:5px;width:5px;min-width:5px;height:5px;min-height:5px;display:inline-flex;transform:translateY(-.1px)}.saved-view-delete-pressed[data-v-1562f39a]{color:#fff;background:color-mix(in srgb, var(--destructive) 85%, black);box-shadow:inset 2px 2px 2px #00000059,inset -1px -1px 1px #fff3}select option[data-v-1562f39a]{background:var(--secondary);color:var(--secondary-foreground)}.error-pill[data-v-ed1ef026]{width:16px;height:16px;color:var(--destructive-foreground,#fff);background:color-mix(in srgb, var(--destructive) 80%, transparent);cursor:default;-webkit-user-select:none;user-select:none;border-radius:9999px;justify-content:center;align-items:center;font-size:11px;font-weight:700;line-height:1;display:inline-flex}.themed-number[data-v-ed1ef026]{color:var(--foreground);caret-color:var(--foreground);accent-color:var(--foreground);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}.dark .themed-number[data-v-ed1ef026]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.themed-number[data-v-ed1ef026]::-webkit-inner-spin-button{color:inherit}.themed-number[data-v-ed1ef026]::-webkit-outer-spin-button{color:inherit}.toolbar[data-v-7f20b0a6]{z-index:1001;pointer-events:auto;border-radius:10px;flex-direction:column;gap:12px;width:100%;height:auto;margin:0;padding:12px;display:flex;position:relative}[data-v-7f20b0a6] .toolbar-group{grid-auto-columns:max-content;grid-auto-flow:column;gap:6px;padding-right:6px;display:grid}[data-v-7f20b0a6] .button-icon{transform-origin:50%;justify-content:center;align-items:center;line-height:1;display:inline-flex}[data-v-7f20b0a6] .button-icon.front-icon{transform:scale(.75)}[data-v-7f20b0a6] .display-tools-wrapper{display:contents}[data-v-7f20b0a6] Button:hover{box-shadow:var(--toolbar-button-hover-shadow)}[data-v-7f20b0a6] Button.active{box-shadow:var(--toolbar-button-active-shadow)}h1[data-v-7f20b0a6]{color:var(--foreground)}div#openbar[data-v-a83066fb]{z-index:1000;gap:15px;align-items:left;pointer-events:auto;will-change:transform;border-radius:10px;flex-direction:column;width:100%;height:100%;margin:0;padding:20px;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;position:relative;overflow-y:auto}div#openbar.is-hidden[data-v-a83066fb]{pointer-events:none;transform:translate(-150%)}.slider-container[data-v-a83066fb]{align-items:center;gap:10px;display:flex}.dynamic-item[data-v-a83066fb]{align-items:left;flex-direction:column;gap:8px;width:100%;display:flex}.dynamic-label[data-v-a83066fb]{color:var(--foreground);padding:0;font-size:15px;font-weight:500}.slider-value[data-v-a83066fb]{color:var(--foreground)}.checkbox-ui-component[data-v-a83066fb]{align-items:center;gap:8px;display:flex}.select-container[data-v-a83066fb]{align-items:center;width:100%;display:flex}Button.mb-4[data-v-a83066fb]{margin:auto 0 0;position:relative}Button.mb-5[data-v-a83066fb]{z-index:1;opacity:0;visibility:hidden;margin:0;transition:visibility 1s;display:flex;position:absolute;bottom:40px;left:40px}Button.mb-5.is-hidden[data-v-a83066fb]{opacity:1;visibility:visible}div#sidebar[data-v-1cbddba3]{z-index:1000;pointer-events:none;flex-direction:column;row-gap:30px;width:30vw;min-width:250px;max-width:300px;height:100%;padding:20px;display:flex;position:absolute;top:0;left:0}[data-v-1cbddba3] .toolbar,[data-v-1cbddba3] #openbar{pointer-events:auto}.theme-indicator[data-v-ebb8d4d4]{z-index:1105;pointer-events:none;background:color-mix(in oklab, var(--background) 78%, transparent);border:1px solid color-mix(in oklab, var(--foreground) 14%, transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:9999px;justify-content:center;align-items:center;width:44px;height:44px;transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .4s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:18px;right:18px;box-shadow:0 10px 28px #0000002e}.dark .theme-indicator[data-v-ebb8d4d4]{border-color:color-mix(in oklab, var(--foreground) 14%, transparent);background:oklch(26.9% 0 0);box-shadow:0 8px 24px #00000080,inset 0 0 10px #ffffff0f}.theme-indicator-icon[data-v-ebb8d4d4]{width:20px;height:20px;color:var(--foreground)}.theme-indicator-enter-active[data-v-ebb8d4d4],.theme-indicator-leave-active[data-v-ebb8d4d4]{transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .4s cubic-bezier(.4,0,.2,1)}.theme-indicator-enter-from[data-v-ebb8d4d4],.theme-indicator-leave-to[data-v-ebb8d4d4]{opacity:0;transform:translate(150%)}.theme-indicator-enter-to[data-v-ebb8d4d4],.theme-indicator-leave-from[data-v-ebb8d4d4]{opacity:1;transform:translate(0)}div.app-container[data-v-dc8ca966]{width:100%;height:100%;margin:0;padding:0;display:inline-flex;position:relative;overflow:hidden}div.three-container[data-v-dc8ca966]{flex:1;position:relative;overflow:hidden} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-sm:calc(var(--radius) - 4px);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}html,body{margin:0;padding:0;overflow:hidden}body{background-color:var(--background);color:var(--foreground);font-family:Inter,sans-serif}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.top-1\/2{top:50%}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.left-0{left:0}.z-50{z-index:50}.z-1000{z-index:1000}.z-\[4000\]{z-index:4000}.z-\[4100\]{z-index:4100}.z-\[5000\]{z-index:5000}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-\(--reka-select-trigger-height\){height:var(--reka-select-trigger-height)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:calc(var(--spacing) * 96)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-84{width:calc(var(--spacing) * 84)}.w-\[80\%\]{width:80%}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\(--reka-select-trigger-width\){min-width:var(--reka-select-trigger-width)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-32{min-width:calc(var(--spacing) * 32)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.cursor-default{cursor:default}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.place-content-center{place-content:center}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.bg-background{background-color:var(--background)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-secondary-foreground{background-color:var(--secondary-foreground)}.bg-transparent{background-color:#0000}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-start{text-align:start}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.text-current{color:currentColor}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing) * 1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\\\'size-\\\'\]\)\]\:size-3 svg:not([class*="'size-'"]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=decrement\]\]\:pl-5>[data-slot=input]:has([data-slot=decrement]){padding-left:calc(var(--spacing) * 5)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=increment\]\]\:pr-5>[data-slot=input]:has([data-slot=increment]){padding-right:calc(var(--spacing) * 5)}.\[\&\>span\]\:truncate>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:color-mix(in oklab, var(--background) 20%, transparent)}}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:text-background{color:var(--background)}[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:color-mix(in oklab, var(--background) 10%, transparent)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/InterVariable.woff2)format("woff2-variations")}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0/.88);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0/.92);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0/.72);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--button-hover:oklch(100% 0 0/0);--toolbar-button-hover-shadow:3px 3px 10px 0px var(--foreground)}@supports (color:color-mix(in lab, red, red)){:root{--toolbar-button-hover-shadow:3px 3px 10px 0px color-mix(in oklab, var(--foreground) 30%, transparent)}}:root{--toolbar-button-active-shadow:3px 3px 2px 1px var(--foreground) inset, -3px -3px 2px 2px var(--background) inset}@supports (color:color-mix(in lab, red, red)){:root{--toolbar-button-active-shadow:3px 3px 2px 1px color-mix(in oklab, var(--foreground) 55%, transparent) inset, -3px -3px 2px 2px color-mix(in oklab, var(--background) 70%, transparent) inset}}:root{font-feature-settings:"liga" 1, "calt" 1;--theme-bg-start:#ffffff1f;--theme-bg-end:#ffffff24;--theme-border-color:#ffffff24;--theme-box-shadow:0 6px 20px #0000001f, inset 2px 2px 6px #fff9, inset -2px -2px 6px #0000000a;--theme-inset-highlight:#fff9;--theme-inset-shadow:#0000000a;font-family:Inter,sans-serif}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0/.88);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0/.92);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0/.72);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--theme-bg-start:#1118271f;--theme-bg-end:#1118272e;--theme-border-color:#ffffff1f;--theme-box-shadow:0 6px 22px 0 #00000047, inset 0 0 8px #ffffff0f;--toolbar-button-hover-shadow:3px 3px 10px 0px var(--foreground)}@supports (color:color-mix(in lab, red, red)){.dark{--toolbar-button-hover-shadow:3px 3px 10px 0px color-mix(in oklab, var(--foreground) 40%, transparent)}}.dark{--toolbar-button-active-shadow:3px 3px 2px 1px var(--foreground) inset, -2px -2px 2px 1px var(--background) inset}@supports (color:color-mix(in lab, red, red)){.dark{--toolbar-button-active-shadow:3px 3px 2px 1px color-mix(in oklab, var(--foreground) 70%, transparent) inset, -2px -2px 2px 1px color-mix(in oklab, var(--background) 40%, transparent) inset}}div#app{margin:0;padding:0}.theme{background:linear-gradient(135deg, var(--theme-bg-start) 0%, var(--theme-bg-end) 100%);-webkit-backdrop-filter:blur(25px)saturate(180%);backdrop-filter:blur(25px)saturate(180%);border:1px solid var(--theme-border-color);box-shadow:var(--theme-box-shadow)}*{scrollbar-width:thin;scrollbar-color:#888 transparent}.text-tag{color:var(--popover-foreground);background:var(--popover);border:1px solid var(--border);border-radius:var(--radius-sm);white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none;padding:2px 6px;font-family:Inter,sans-serif;font-size:12px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}div.right-bar[data-v-2390ba1f]{pointer-events:none;flex-direction:column;width:30vw;min-width:250px;max-width:300px;height:100%;padding:20px;display:flex;position:absolute;top:0;right:0}div.object-info[data-v-2390ba1f]{z-index:1000;max-width:400px;height:100%;color:var(--foreground);pointer-events:auto;border-radius:10px;flex-direction:column;margin:0;padding:20px;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;right:0%}div.is-hidden[data-v-2390ba1f]{pointer-events:none;transform:translate(150%)}div#data-container[data-v-2390ba1f]{flex-direction:column;gap:30px;display:flex;position:relative;overflow-y:auto}div.item[data-v-2390ba1f]{align-items:left;flex-direction:column;display:flex}h1.section-title[data-v-2390ba1f]{color:var(--foreground);background:color-mix(in oklab, var(--background) 25%, transparent);-webkit-backdrop-filter:blur(10px);box-shadow:1px 1px 3px 0px color-mix(in oklab, var(--foreground) 35%, transparent) inset, -1px -1px 3px 0px color-mix(in oklab, var(--background) 70%, transparent) inset;border-radius:10px;margin-bottom:10px;padding:5px 5px 5px 10px}div.data-entry[data-v-2390ba1f]{margin-bottom:8px;padding:0 0 0 10px}Button#closeObjectBar[data-v-2390ba1f]{align-self:flex-end;margin-top:auto;position:relative}Button#openObjectBar[data-v-2390ba1f]{z-index:1;visibility:hidden;pointer-events:auto;transition:visibility 1s;display:flex;position:absolute;bottom:40px;right:40px}Button#openObjectBar.is-hidden[data-v-2390ba1f]{opacity:1;visibility:visible}.add-object-form[data-v-faffd903]{flex-direction:column;gap:10px;display:flex}.param-grid[data-v-faffd903]{flex-direction:column;gap:6px;display:flex}.param-label[data-v-faffd903]{flex-direction:column;gap:4px;font-size:.8rem;display:flex}.material-form[data-v-062ecf41]{flex-direction:column;gap:12px;display:flex}.param-label[data-v-062ecf41]{flex-direction:column;gap:6px;font-size:.8rem;display:flex}.color-input[data-v-062ecf41]{cursor:pointer;background:0 0;border:none;border-radius:6px;width:100%;height:28px;padding:0}.slider-row[data-v-062ecf41]{align-items:center;gap:8px;display:flex}.slider-value[data-v-062ecf41]{text-align:right;font-variant-numeric:tabular-nums;min-width:2.5em}.save-view-icon[data-v-c0eebdad]{justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex;position:relative}.save-view-overlay[data-v-c0eebdad]{background:color-mix(in srgb, var(--secondary-foreground) 92%, white);width:11px;height:11px;color:var(--secondary);border:1px solid color-mix(in srgb, var(--secondary) 65%, white);border-radius:999px;justify-content:center;align-items:center;display:inline-flex;position:absolute;bottom:-2px;right:-4px;overflow:hidden}.save-view-overlay-icon[data-v-c0eebdad]{stroke-width:5px;width:5px;min-width:5px;height:5px;min-height:5px;display:inline-flex;transform:translateY(-.1px)}.saved-view-delete-pressed[data-v-1562f39a]{color:#fff;background:color-mix(in srgb, var(--destructive) 85%, black);box-shadow:inset 2px 2px 2px #00000059,inset -1px -1px 1px #fff3}select option[data-v-1562f39a]{background:var(--secondary);color:var(--secondary-foreground)}.error-pill[data-v-ed1ef026]{width:16px;height:16px;color:var(--destructive-foreground,#fff);background:color-mix(in srgb, var(--destructive) 80%, transparent);cursor:default;-webkit-user-select:none;user-select:none;border-radius:9999px;justify-content:center;align-items:center;font-size:11px;font-weight:700;line-height:1;display:inline-flex}.themed-number[data-v-ed1ef026]{color:var(--foreground);caret-color:var(--foreground);accent-color:var(--foreground);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}.dark .themed-number[data-v-ed1ef026]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.themed-number[data-v-ed1ef026]::-webkit-inner-spin-button{color:inherit}.themed-number[data-v-ed1ef026]::-webkit-outer-spin-button{color:inherit}.toolbar[data-v-e2902cdd]{z-index:1001;pointer-events:auto;border-radius:10px;flex-direction:column;gap:12px;width:100%;height:auto;margin:0;padding:12px;display:flex;position:relative}[data-v-e2902cdd] .toolbar-group{grid-auto-columns:max-content;grid-auto-flow:column;gap:6px;padding-right:6px;display:grid}[data-v-e2902cdd] .button-icon{transform-origin:50%;justify-content:center;align-items:center;line-height:1;display:inline-flex}[data-v-e2902cdd] .button-icon.front-icon{transform:scale(.75)}[data-v-e2902cdd] .display-tools-wrapper{display:contents}[data-v-e2902cdd] Button:hover{box-shadow:var(--toolbar-button-hover-shadow)}[data-v-e2902cdd] Button.active{box-shadow:var(--toolbar-button-active-shadow)}h1[data-v-e2902cdd]{color:var(--foreground)}div#openbar[data-v-a83066fb]{z-index:1000;gap:15px;align-items:left;pointer-events:auto;will-change:transform;border-radius:10px;flex-direction:column;width:100%;height:100%;margin:0;padding:20px;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;position:relative;overflow-y:auto}div#openbar.is-hidden[data-v-a83066fb]{pointer-events:none;transform:translate(-150%)}.slider-container[data-v-a83066fb]{align-items:center;gap:10px;display:flex}.dynamic-item[data-v-a83066fb]{align-items:left;flex-direction:column;gap:8px;width:100%;display:flex}.dynamic-label[data-v-a83066fb]{color:var(--foreground);padding:0;font-size:15px;font-weight:500}.slider-value[data-v-a83066fb]{color:var(--foreground)}.checkbox-ui-component[data-v-a83066fb]{align-items:center;gap:8px;display:flex}.select-container[data-v-a83066fb]{align-items:center;width:100%;display:flex}Button.mb-4[data-v-a83066fb]{margin:auto 0 0;position:relative}Button.mb-5[data-v-a83066fb]{z-index:1;opacity:0;visibility:hidden;margin:0;transition:visibility 1s;display:flex;position:absolute;bottom:40px;left:40px}Button.mb-5.is-hidden[data-v-a83066fb]{opacity:1;visibility:visible}div#sidebar[data-v-1cbddba3]{z-index:1000;pointer-events:none;flex-direction:column;row-gap:30px;width:30vw;min-width:250px;max-width:300px;height:100%;padding:20px;display:flex;position:absolute;top:0;left:0}[data-v-1cbddba3] .toolbar,[data-v-1cbddba3] #openbar{pointer-events:auto}.theme-indicator[data-v-ebb8d4d4]{z-index:1105;pointer-events:none;background:color-mix(in oklab, var(--background) 78%, transparent);border:1px solid color-mix(in oklab, var(--foreground) 14%, transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:9999px;justify-content:center;align-items:center;width:44px;height:44px;transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .4s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:18px;right:18px;box-shadow:0 10px 28px #0000002e}.dark .theme-indicator[data-v-ebb8d4d4]{border-color:color-mix(in oklab, var(--foreground) 14%, transparent);background:oklch(26.9% 0 0);box-shadow:0 8px 24px #00000080,inset 0 0 10px #ffffff0f}.theme-indicator-icon[data-v-ebb8d4d4]{width:20px;height:20px;color:var(--foreground)}.theme-indicator-enter-active[data-v-ebb8d4d4],.theme-indicator-leave-active[data-v-ebb8d4d4]{transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .4s cubic-bezier(.4,0,.2,1)}.theme-indicator-enter-from[data-v-ebb8d4d4],.theme-indicator-leave-to[data-v-ebb8d4d4]{opacity:0;transform:translate(150%)}.theme-indicator-enter-to[data-v-ebb8d4d4],.theme-indicator-leave-from[data-v-ebb8d4d4]{opacity:1;transform:translate(0)}.global-spinner-overlay[data-v-1f2a3347]{z-index:9999;background:color-mix(in srgb, var(--background) 25%, transparent);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:all;flex-direction:column;justify-content:center;align-items:center;gap:12px;display:flex;position:fixed;inset:0}.global-spinner-icon[data-v-1f2a3347]{color:var(--foreground);animation:1s linear infinite global-spinner-spin-1f2a3347}.global-spinner-official-text[data-v-1f2a3347]{color:var(--foreground);opacity:.7;text-align:center;margin:0;padding:0 24px;font-size:.9rem;font-weight:500}.global-spinner-funny-text[data-v-1f2a3347]{color:var(--foreground);text-align:center;margin:0;padding:0 24px;font-size:2rem;font-weight:700}@keyframes global-spinner-spin-1f2a3347{0%{transform:rotate(0)}to{transform:rotate(360deg)}}div.app-container[data-v-8d82b7cc]{width:100%;height:100%;margin:0;padding:0;display:inline-flex;position:relative;overflow:hidden}div.three-container[data-v-8d82b7cc]{flex:1;position:relative;overflow:hidden} diff --git a/src/compas_threejs/viewer/frontend/assets/index.js b/src/compas_threejs/viewer/frontend/assets/index.js index 4080d78..ac11964 100644 --- a/src/compas_threejs/viewer/frontend/assets/index.js +++ b/src/compas_threejs/viewer/frontend/assets/index.js @@ -3,11 +3,11 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en `)&&(bi(e,0)||ui(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(_i(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Zt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&As(x,n,t),h&&mr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ts(()=>{x&&As(x,n,t),l&&g.enter(e),h&&mr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&mi(f)&&f.data===`]`?a(t.anchor=f):(ui(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Si(e,t)||ui(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,pi(d),s),r&&(r.vnode.el=t.el,mo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&mi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var gi=new Set([`src`,`srcset`,`href`,`poster`]);function _i(e,t,n){return gi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var vi=`data-allow-mismatch`,yi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function bi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(vi);)e=e.parentElement;return xi(e&&e.getAttribute(vi),t)}function xi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(yi[t])}}function Si(e,t){return bi(e.parentElement,1)||Ci(e)||wi(t)}function Ci(e){return e.nodeType===1&&xi(e.getAttribute(vi),1)}function wi({props:e}){let t=e&&e[vi];return typeof t==`string`&&xi(t,1)}var Ti=ce().requestIdleCallback||(e=>setTimeout(e,1)),Ei=ce().cancelIdleCallback||(e=>clearTimeout(e)),Di=(e=1e4)=>t=>{let n=Ti(t,{timeout:e});return()=>Ei(n)};function Oi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t0&&r0&&n0&&i(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Oi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ai=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},ji=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Mi(e,t){if(mi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(mi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ni=e=>!!e.type.__asyncLoader;function Pi(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return R({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Mi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ps;if(ri(e),u)return()=>Fi(u,e);let t=t=>{l=null,Bn(t,e,13,!r)};if(s&&e.suspense||Vs)return p().then(t=>()=>Fi(t,e)).catch(e=>(t(e),()=>r?U(r,{error:e}):null));let a=F(!1),c=F(),d=F(!!i),f,m;return Qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ii(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Fi(u,e);if(c.value&&r)return U(r,{error:c.value});if(n&&!d.value)return Fi(n,e)}}})}function Fi(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=U(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var Ii=e=>e.type.__isKeepAlive,Li={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Fs(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),No(()=>{a.isDeactivated=!1,a.a&&re(a.a);let t=e.props&&e.props.onVnodeMounted;t&&As(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;Uo(t.m),Uo(t.a),l(e,f,null,1,s),No(()=>{t.da&&re(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&As(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Ui(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=$s(Ni(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!gs(t,o))?p(t):o&&Ui(o),i.delete(e),a.delete(e)}Cr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Ri(e,t)),t&&m(e=>!Ri(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(Go(n.subTree.type)?No(()=>{i.set(g,Wi(n.subTree))},n.subTree.suspense):i.set(g,Wi(n.subTree)))};return Ji(_),Xi(_),Zi(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Wi(t);if(e.type===i.type&&e.key===i.key){Ui(i);let e=i.component.da;e&&No(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!hs(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Wi(r);if(s.type===os)return o=null,s;let c=s.type,l=$s(Ni(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Ri(u,l))||d&&l&&Ri(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Ss(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&ei(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,Go(r.type)?r:s}}};function Ri(e,t){return p(e)?e.some(e=>Ri(e,t)):y(e)?e.split(`,`).includes(t):_(e)?(e.lastIndex=0,e.test(t)):!1}function zi(e,t){Vi(e,`a`,t)}function Bi(e,t){Vi(e,`da`,t)}function Vi(e,t,n=Ps){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Gi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ii(e.parent.vnode)&&Hi(r,t,n,e),e=e.parent}}function Hi(e,t,n,r){let i=Gi(t,e,r,!0);Qi(()=>{u(r[t],i)},n)}function Ui(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Wi(e){return e.shapeFlag&128?e.ssContent:e}function Gi(e,t,n=Ps,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ze();let i=Rs(n),a=zn(t,n,e,r);return i(),Qe(),a};return r?i.unshift(a):i.push(a),a}}var Ki=e=>(t,n=Ps)=>{(!Vs||e===`sp`)&&Gi(e,(...e)=>t(...e),n)},qi=Ki(`bm`),Ji=Ki(`m`),Yi=Ki(`bu`),Xi=Ki(`u`),Zi=Ki(`bum`),Qi=Ki(`um`),$i=Ki(`sp`),ea=Ki(`rtg`),ta=Ki(`rtc`);function na(e,t=Ps){Gi(`ec`,e,t)}var ra=`components`,ia=`directives`;function aa(e,t){return la(ra,e,!0,t)||e}var oa=Symbol.for(`v-ndc`);function sa(e){return y(e)?la(ra,e,!1)||e:e||oa}function ca(e){return la(ia,e)}function la(e,t,n=!0,r=!1){let i=sr||Ps;if(i){let n=i.type;if(e===ra){let e=$s(n,!1);if(e&&(e===t||e===A(t)||e===ne(A(t))))return n}let a=ua(i[e]||n[e],t)||ua(i.appContext[e],t);return!a&&r?n:a}}function ua(e,t){return e&&(e[t]||e[A(t)]||e[ne(A(t))])}function da(e,t,n,r){let i,a=n&&n[r],o=p(e);if(o||y(e)){let n=o&&Zt(e),r=!1,s=!1;n&&(r=!$t(e),s=Qt(e),e=ft(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function z(e,t,n,r,i,a){if(n??={},sr.ce||sr.parent&&Ni(sr.parent)&&sr.parent.ce){let e=a!=null&&n.key==null?l({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),B(),V(is,null,[U(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=cs.length;B();let c;try{let i=o&&pa(o(n)),s=n.key||a||i&&i.key;c=V(is,{key:(s&&!b(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=cs.length;e>s;e--)us();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function pa(e){return e.some(e=>!hs(e)||!(e.type===os||e.type===is&&!pa(e.children)))?e:null}function ma(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:M(r)]=e[r];return n}var ha=e=>e?Bs(e)?Qs(e):ha(e.parent):null,ga=l(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ha(e.parent),$root:e=>ha(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ba(e),$forceUpdate:e=>e.f||=()=>{Zn(e.update)},$nextTick:e=>e.n||=Yn.bind(e.proxy),$watch:e=>Tr.bind(e)}),_a=(e,t)=>e!==r&&!e.__isScriptSetup&&f(e,t),va={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return i[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else if(_a(i,t))return s[t]=1,i[t];else if(a!==r&&f(a,t))return s[t]=2,a[t];else if(f(o,t))return s[t]=3,o[t];else if(n!==r&&f(n,t))return s[t]=4,n[t];else Fa&&(s[t]=0)}let u=ga[t],d,p;if(u)return t===`$attrs`&&ct(e.attrs,`get`,``),u(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==r&&f(n,t))return s[t]=4,n[t];if(p=l.config.globalProperties,f(p,t))return p[t]},set({_:e},t,n){let{data:i,setupState:a,ctx:o}=e;return _a(a,t)?(a[t]=n,!0):i!==r&&f(i,t)?(i[t]=n,!0):f(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(n[c]||e!==r&&c[0]!==`$`&&f(e,c)||_a(t,c)||f(o,c)||f(i,c)||f(ga,c)||f(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?f(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},ya=l({},va,{get(e,t){if(t!==Symbol.unscopables)return va.get(e,t,e)},has(e,t){return t[0]!==`_`&&!le(t)}});function ba(){return null}function xa(){return null}function Sa(e){}function Ca(e){}function wa(){return null}function Ta(){}function Ea(e,t){return null}function Da(){return ka(`useSlots`).slots}function Oa(){return ka(`useAttrs`).attrs}function ka(e){let t=Fs();return t.setupContext||=Zs(t)}function Aa(e){return p(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ja(e,t){let n=Aa(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?p(r)||v(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Ma(e,t){return!e||!t?e||t:p(e)&&p(t)?e.concat(t):l({},Aa(e),Aa(t))}function Na(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function Pa(e){let t=Fs(),n=Vs,r=e();zs(),n&&Ls(!1);let i=()=>{Rs(t),n&&Ls(!0)},a=()=>{Fs()!==t&&t.scope.off(),zs(),n&&Ls(!1)};return S(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Fa=!0;function Ia(e){let t=Ba(e),n=e.proxy,r=e.ctx;Fa=!1,t.beforeCreate&&Ra(t.beforeCreate,e,`bc`);let{data:i,computed:o,methods:s,watch:c,provide:l,inject:u,created:d,beforeMount:f,mounted:m,beforeUpdate:h,updated:g,activated:_,deactivated:y,beforeDestroy:b,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:E,renderTriggered:D,errorCaptured:O,serverPrefetch:ee,expose:k,inheritAttrs:A,components:te,directives:j,filters:ne}=t;if(u&&La(u,r,null),s)for(let e in s){let t=s[e];v(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);x(t)&&(e.data=Kt(t))}if(Fa=!0,o)for(let e in o){let t=o[e],i=W({get:v(t)?t.bind(n,n):v(t.get)?t.get.bind(n,n):a,set:!v(t)&&v(t.set)?t.set.bind(n):a});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(c)for(let e in c)za(c[e],r,n,e);if(l){let e=v(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{hr(t,e[t])})}d&&Ra(d,e,`c`);function M(e,t){p(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(M(qi,f),M(Ji,m),M(Yi,h),M(Xi,g),M(zi,_),M(Bi,y),M(na,O),M(ta,E),M(ea,D),M(Zi,S),M(Qi,w),M($i,ee),p(k)){if(k.length){let t=e.exposed||={};k.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}T&&e.render===a&&(e.render=T),A!=null&&(e.inheritAttrs=A),te&&(e.components=te),j&&(e.directives=j),ee&&ri(e)}function La(e,t,n=a){p(e)&&(e=Ga(e));for(let n in e){let r=e[n],i;i=x(r)?`default`in r?gr(r.from||n,r.default,!0):gr(r.from||n):gr(r),on(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Ra(e,t,n){zn(p(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function za(e,t,n,r){let i=r.includes(`.`)?Er(n,r):()=>n[r];if(y(e)){let n=t[e];v(n)&&Cr(i,n)}else if(v(e))Cr(i,e.bind(n));else if(x(e)){if(p(e))e.forEach(e=>za(e,t,n,r));else{let r=v(e.handler)?e.handler.bind(n):t[e.handler];v(r)&&Cr(i,r,e)}}}function Ba(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Va(c,e,o,!0)),Va(c,t,o)),x(t)&&a.set(t,c),c}function Va(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Va(e,a,n,!0),i&&i.forEach(t=>Va(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Ha[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Ha={data:Ua,props:Ja,emits:Ja,methods:qa,computed:qa,beforeCreate:Ka,created:Ka,beforeMount:Ka,mounted:Ka,beforeUpdate:Ka,updated:Ka,beforeDestroy:Ka,beforeUnmount:Ka,destroyed:Ka,unmounted:Ka,activated:Ka,deactivated:Ka,errorCaptured:Ka,serverPrefetch:Ka,components:qa,directives:qa,watch:Ya,provide:Ua,inject:Wa};function Ua(e,t){return t?e?function(){return l(v(e)?e.call(this,this):e,v(t)?t.call(this,this):t)}:t:e}function Wa(e,t){return qa(Ga(e),Ga(t))}function Ga(e){if(p(e)){let t={};for(let n=0;n{let l,u=r,d;return Sr(()=>{let t=e[a];N(l,t)&&(l=t,c())}),{get(){return s(),n.get?n.get(l):l},set(e){let s=n.set?n.set(e):e;if(!N(s,l)&&!(u!==r&&N(e,u)))return;let f=i.vnode.props,p=!!(f&&(t in f||a in f||o in f)&&(`onUpdate:${t}`in f||`onUpdate:${a}`in f||`onUpdate:${o}`in f));p||(l=e,c()),i.emit(`update:${t}`,s),N(e,u)&&(N(e,s)&&!N(s,d)||p&&u!==r&&!N(s,l))&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||r:c,done:!1}:{done:!0}}}},c}var to=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${A(t)}Modifiers`]||e[`${j(t)}Modifiers`];function no(e,t,...n){if(e.isUnmounted)return;let i=e.vnode.props||r,a=n,o=t.startsWith(`update:`),s=o&&to(i,t.slice(7));s&&(s.trim&&(a=n.map(e=>y(e)?e.trim():e)),s.number&&(a=n.map(ae)));let c,l=i[c=M(t)]||i[c=M(A(t))];!l&&o&&(l=i[c=M(j(t))]),l&&zn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,zn(u,e,6,a)}}var ro=new WeakMap;function io(e,t,n=!1){let r=n?ro:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!v(e)){let r=e=>{let n=io(e,t,!0);n&&(s=!0,l(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(x(e)&&r.set(e,null),null):(p(a)?a.forEach(e=>o[e]=null):l(o,a),x(e)&&r.set(e,o),o)}function ao(e,t){return!e||!s(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),f(e,t[0].toLowerCase()+t.slice(1))||f(e,j(t))||f(e,t))}function oo(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=lr(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Es(u.call(t,e,d,f,m,p,h)),y=s}else{let e=t;v=Es(e.length>1?e(f,{attrs:s,slots:o,emit:l}):e(f,null)),y=t.props?s:co(s)}}catch(t){cs.length=0,Bn(t,e,1),v=U(os)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(c)&&(y=lo(y,a)),b=Ss(b,y,!1,!0))}return n.dirs&&(b=Ss(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ei(kr(b.type)&&$r(b)||b,n.transition),v=b,lr(_),v}function so(e,t=!0){let n;for(let t=0;t{let t;for(let n in e)(n===`class`||n===`style`||s(n))&&((t||={})[n]=e[n]);return t},lo=(e,t)=>{let n={};for(let r in e)(!c(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function uo(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?fo(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(ho),_o=e=>Object.getPrototypeOf(e)===ho;function vo(e,t,n,r=!1){let i={},a=go();e.propsDefaults=Object.create(null),bo(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:qt(i):e.type.props?i:a,e.attrs=a}function yo(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=tn(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{d=!0;let[n,r]=Co(e,t,!0);l(c,n),r&&u.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!s&&!d)return x(e)&&a.set(e,i),i;if(p(s))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Eo=e=>p(e)?e.map(Es):[Es(e)],Do=(e,t,n)=>{if(t._n)return t;let r=L((...e)=>Eo(t(...e)),n);return r._c=!1,r},Oo=(e,t,n)=>{let r=e._ctx;for(let n in e){if(To(n))continue;let i=e[n];if(v(i))t[n]=Do(n,i,r);else if(i!=null){let e=Eo(i);t[n]=()=>e}}},ko=(e,t)=>{let n=Eo(t);e.slots.default=()=>n},Ao=(e,t,n)=>{for(let r in t)(n||!To(r))&&(e[r]=t[r])},jo=(e,t,n)=>{let r=e.slots=go();if(e.vnode.shapeFlag&32){let e=t._;e?(Ao(r,t,n),n&&ie(r,`_`,e,!0)):Oo(t,r)}else t&&ko(e,t)},Mo=(e,t,n)=>{let{vnode:i,slots:a}=e,o=!0,s=r;if(i.shapeFlag&32){let e=t._;e?n&&e===1?o=!1:Ao(a,t,n):(o=!t.$stable,Oo(t,a)),s=t}else t&&(ko(e,t),s={default:1});if(o)for(let e in a)!To(e)&&s[e]==null&&delete a[e]},No=ts;function Po(e){return Io(e)}function Fo(e){return Io(e,hi)}function Io(e,t){let n=ce();n.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=a,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!gs(e,t)&&(r=he(e),ue(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case as:y(e,t,n,r);break;case os:b(e,t,n,r);break;case ss:e??x(t,n,r,o);break;case is:te(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?j(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,ve)}u!=null&&i?si(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&si(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ee(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&D(e.children,d,null,r,i,Lo(e,a),s,u),_&&mr(e,null,r,`created`),E(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!O(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&As(f,r,e)}_&&mr(e,null,r,`beforeMount`);let v=zo(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&No(()=>{try{f&&As(f,r,e),v&&g.enter(d),_&&mr(e,null,r,`mounted`)}finally{}},i)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||r,h=t.props||r,g;if(n&&Ro(n,!1),(g=h.onVnodeBeforeUpdate)&&As(g,n,t,e),f&&mr(t,e,n,`beforeUpdate`),n&&Ro(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?k(e.dynamicChildren,d,l,n,i,Lo(t,a),o):s||ae(e,t,l,null,n,i,Lo(t,a),o,!1),u>0){if(u&16)A(l,m,h,n,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=t.dynamicProps;for(let t=0;t{g&&As(g,n,t,e),f&&mr(t,e,n,`updated`)},i)},k=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(t!==n){if(t!==r)for(let r in t)!O(r)&&!(r in n)&&c(e,r,t[r],null,a,i);for(let r in n){if(O(r))continue;let o=n[r],s=t[r];o!==s&&r!==`value`&&c(e,r,s,o,a,i)}`value`in n&&c(e,`value`,t.value,n.value,a)}},te=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),D(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(k(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&Bo(e,t,!0)):ae(e,t,n,f,i,a,s,c,l)},j=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ne(t,n,r,i,a,o,c):M(e,t,c)},ne=(e,t,n,r,i,a,o)=>{let s=e.component=Ns(e,r,i);if(Ii(e)&&(s.ctx.renderer=ve),Hs(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,N,o),!e.el){let r=s.subTree=U(os);b(null,r,t,n),e.placeholder=r.el}}else N(s,e,t,n,i,a,o)},M=(e,t,n)=>{let r=t.component=e.component;if(uo(e,t,n)){if(r.asyncDep&&!r.asyncResolved){ie(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},N=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Ho(e);if(n){t&&(t.el=c.el,ie(e,t,o)),n.asyncDep.then(()=>{No(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Ro(e,!1),t?(t.el=c.el,ie(e,t,o)):t=c,n&&re(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&As(d,s,t,c),Ro(e,!0);let f=oo(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),he(p),e,i,a),t.el=f.el,u===null&&mo(e,f.el),r&&No(r,i),(d=t.props&&t.props.onVnodeUpdated)&&No(()=>As(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ni(t);if(Ro(e,!1),l&&re(l),!m&&(o=c&&c.onVnodeBeforeMount)&&As(o,d,t),Ro(e,!0),s&&ye){let t=()=>{e.subTree=oo(e),ye(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=oo(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&No(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;No(()=>As(o,d,e),i)}(t.shapeFlag&256||d&&Ni(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&No(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Pe(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Zn(u),Ro(e,!0),l()},ie=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,yo(e,t.props,r,n),Mo(e,t.children,n),Ze(),er(e),Qe()},ae=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){se(l,d,n,r,i,a,o,s,c);return}if(f&256){oe(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&me(l,i,a),d!==l&&p(n,d)):u&16?m&16?se(l,d,n,r,i,a,o,s,c):me(l,i,a,!0):(u&8&&p(n,``),m&16&&D(d,n,r,i,a,o,s,c))},oe=(e,t,n,r,a,o,s,c,l)=>{e||=i,t||=i;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?me(e,a,o,!0,!1,f):D(t,n,r,a,o,s,c,l,f)},se=(e,t,n,r,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],i=t[u]=l?Ds(t[u]):Es(t[u]);if(gs(r,i))v(r,i,n,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],i=t[p]=l?Ds(t[p]):Es(t[p]);if(gs(r,i))v(r,i,n,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,i=ep)for(;u<=f;)ue(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Ds(t[u]):Es(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){ue(r,a,o,!0);continue}let i;if(r.key!=null)i=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&gs(r,t[_])){i=_;break}i===void 0?ue(r,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(r,t[i],n,null,a,o,s,c,l),y++)}let w=x?Vo(C):i;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,i=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){le(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,ve);return}if(c===is){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Vr];a._isLeaving&&a[Vr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},ue=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Ze(),si(s,null,n,e,!0),Qe()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Ni(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&As(_,t,e),u&6)pe(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&mr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,ve,r):l&&!l.hasOnce&&(a!==is||d>0&&d&64)?me(l,t,n,!1,!0):(a===is&&d&384||!i&&u&16)&&me(c,t,n),r&&de(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&No(()=>{_&&As(_,t,e),h&&mr(e,null,t,`unmounted`),v&&(e.el=null)},n)},de=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===is){fe(n,r);return}if(t===ss){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},fe=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},pe=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Uo(c),Uo(l),r&&re(r),i.stop(),a&&(a.flags|=8,ue(o,e,t,n)),s&&No(s,t),No(()=>{e.isUnmounted=!0},t)},me=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return he(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Or];return n?h(n):t},ge=!1,_e=(e,t,n)=>{let r;e==null?t._vnode&&(ue(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ge||=(ge=!0,er(r),tr(),!1)},ve={p:v,um:ue,m:le,r:de,mt:ne,mc:D,pc:ae,pbc:k,n:he,o:e},P,ye;return t&&([P,ye]=t(ve)),{render:_e,hydrate:P,createApp:Qa(_e,P)}}function Lo({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ro({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function zo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Bo(e,t,n=!1){let r=e.children,i=t.children;if(p(r)&&p(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Ho(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ho(t)}function Uo(e){if(e)for(let t=0;te.__isSuspense,Ko=0,qo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Yo(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Xo(e,t,n,r,i,o,s,c,l)}},hydrate:Qo,normalize:$o};function Jo(e,t){let n=e.props&&e.props[t];v(n)&&n()}function Yo(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=Zo(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Jo(e,`onPending`),Jo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),ns(f,e.ssFallback)):f.resolve(!1,!0)}function Xo(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,gs(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),ns(d,p)))):(d.pendingId=Ko++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),ns(d,p))):m&&gs(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&gs(m,f))c(m,f,n,r,i,d,a,o,s),ns(d,f);else if(Jo(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Ko++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function Zo(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=rs(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?oe(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Ko++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),$n(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&No(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,ns(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){for(let e=0;e{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),ns(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Bn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;zs(),e.asyncResolved=!0;let{vnode:s}=e;Ws(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),mo(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function Qo(e,t,n,r,i,a,o,s,c){let l=t.suspense=Zo(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function $o(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=es(r?n.default:n),e.ssFallback=r?es(n.fallback):U(os)}function es(e){let t;if(v(e)){let n=ds&&e._c;n&&(e._d=!1,B()),e=e(),n&&(e._d=!0,t=ls,us())}return p(e)&&(e=so(e)),e=Es(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function ts(e,t){t&&t.pendingBranch?p(e)?t.effects.push(...e):t.effects.push(e):$n(e)}function ns(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,mo(r,i))}function rs(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var is=Symbol.for(`v-fgt`),as=Symbol.for(`v-txt`),os=Symbol.for(`v-cmt`),ss=Symbol.for(`v-stc`),cs=[],ls=null;function B(e=!1){cs.push(ls=e?null:[])}function us(){cs.pop(),ls=cs[cs.length-1]||null}var ds=1;function fs(e,t=!1){ds+=e,e<0&&ls&&t&&(ls.hasOnce=!0)}function ps(e){return e.dynamicChildren=ds>0?ls||i:null,us(),ds>0&&ls&&ls.push(e),e}function ms(e,t,n,r,i,a){return ps(H(e,t,n,r,i,a,!0))}function V(e,t,n,r,i){return ps(U(e,t,n,r,i,!0))}function hs(e){return e?e.__v_isVNode===!0:!1}function gs(e,t){return e.type===t.type&&e.key===t.key}function _s(e){}var vs=({key:e})=>e??null,ys=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:y(e)||on(e)||v(e)?{i:sr,r:e,k:t,f:!!n}:e);function H(e,t=null,n=null,r=0,i=null,a=e===is?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vs(t),ref:t&&ys(t),scopeId:cr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:sr};return s?(Os(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=y(n)?8:16),ds>0&&!o&&ls&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&ls.push(c),c}var U=bs;function bs(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===oa)&&(e=os),hs(e)){let r=Ss(e,t,!0);return n&&Os(r,n),ds>0&&!a&&ls&&(r.shapeFlag&6?ls[ls.indexOf(e)]=r:ls.push(r)),r.patchFlag=-2,r}if(ec(e)&&(e=e.__vccOpts),t){t=xs(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=he(e)),x(n)&&(en(n)&&!p(n)&&(n=l({},n)),t.style=ue(n))}let o=y(e)?1:Go(e)?128:kr(e)?64:x(e)?4:v(e)?2:0;return H(e,t,n,r,i,o,a,!0)}function xs(e){return e?en(e)||_o(e)?l({},e):e:null}function Ss(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?ks(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&vs(l),ref:t&&t.ref?n&&a?p(a)?a.concat(ys(t)):[a,ys(t)]:ys(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==is?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ss(e.ssContent),ssFallback:e.ssFallback&&Ss(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&ei(u,c.clone(u)),u}function Cs(e=` `,t=0){return U(as,null,e,t)}function ws(e,t){let n=U(ss,null,e);return n.staticCount=t,n}function Ts(e=``,t=!1){return t?(B(),V(os,null,e)):U(os,null,e)}function Es(e){return e==null||typeof e==`boolean`?U(os):p(e)?U(is,null,e.slice()):hs(e)?Ds(e):U(as,null,String(e))}function Ds(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ss(e)}function Os(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(p(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Os(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!_o(t)?t._ctx=sr:r===3&&sr&&(sr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(v(t)){if(r&65){Os(e,{default:t});return}t={default:t,_ctx:sr},n=32}else t=String(t),r&64?(n=16,t=[Cs(t)]):n=8;e.children=t,e.shapeFlag|=n}function ks(...e){let t={};for(let n=0;nPs||sr,Is,Ls;{let e=ce(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Is=t(`__VUE_INSTANCE_SETTERS__`,e=>Ps=e),Ls=t(`__VUE_SSR_SETTERS__`,e=>Vs=e)}var Rs=e=>{let t=Ps;return Is(e),e.scope.on(),()=>{e.scope.off(),Is(t)}},zs=()=>{Ps&&Ps.scope.off(),Is(null)};function Bs(e){return e.vnode.shapeFlag&4}var Vs=!1;function Hs(e,t=!1,n=!1){t&&Ls(t);let{props:r,children:i}=e.vnode,a=Bs(e);vo(e,r,a,t),jo(e,i,n||t);let o=a?Us(e,t):void 0;return t&&Ls(!1),o}function Us(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,va);let{setup:r}=n;if(r){Ze();let n=e.setupContext=r.length>1?Zs(e):null,i=Rs(e),a=Rn(r,e,0,[e.props,n]),o=S(a);if(Qe(),i(),(o||e.sp)&&!Ni(e)&&ri(e),o){if(a.then(zs,zs),t)return a.then(n=>{Ls(!0);try{Ws(e,n,t)}finally{Ls(!1)}}).catch(t=>{Bn(t,e,0)});e.asyncDep=a}else Ws(e,a,t)}else Ys(e,t)}function Ws(e,t,n){v(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:x(t)&&(e.setupState=pn(t)),Ys(e,n)}var Gs,Ks;function qs(e){Gs=e,Ks=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,ya))}}var Js=()=>!Gs;function Ys(e,t,n){let r=e.type;if(!e.render){if(!t&&Gs&&!r.render){let t=r.template||Ba(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=l(l({isCustomElement:n,delimiters:a},i),o);r.render=Gs(t,s)}}e.render=r.render||a,Ks&&Ks(e)}{let t=Rs(e);Ze();try{Ia(e)}finally{Qe(),t()}}}var Xs={get(e,t){return ct(e,`get`,``),e[t]}};function Zs(e){return{attrs:new Proxy(e.attrs,Xs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Qs(e){return e.exposed?e.exposeProxy||=new Proxy(pn(nn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ga)return ga[n](e)},has(e,t){return t in e||t in ga}}):e.proxy}function $s(e,t=!0){return v(e)?e.displayName||e.name:e.name||t&&e.__name}function ec(e){return v(e)&&`__vccOpts`in e}var W=(e,t)=>Sn(e,t,Vs);function tc(e,t,n){try{fs(-1);let r=arguments.length;return r===2?x(t)&&!p(t)?hs(t)?U(e,null,[t]):U(e,t):U(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&hs(n)&&(n=[n]),U(e,t,n))}finally{fs(1)}}function nc(){}function rc(e,t,n,r){let i=n[r];if(i&&ic(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function ic(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&ls&&ls.push(e),!0}var ac=`3.5.41`,oc=a,sc=Ln,cc=ir,lc=or,uc={createComponentInstance:Ns,setupComponent:Hs,renderComponentRoot:oo,setCurrentRenderingInstance:lr,isVNode:hs,normalizeVNode:Es,getComponentPublicInstance:Qs,ensureValidVNode:pa,pushWarningContext:Nn,popWarningContext:Pn},dc=void 0,fc=typeof window<`u`&&window.trustedTypes;if(fc)try{dc=fc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var pc=dc?e=>dc.createHTML(e):e=>e,mc=`http://www.w3.org/2000/svg`,hc=`http://www.w3.org/1998/Math/MathML`,gc=typeof document<`u`?document:null,_c=gc&&gc.createElement(`template`),vc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?gc.createElementNS(mc,e):t===`mathml`?gc.createElementNS(hc,e):n?gc.createElement(e,{is:n}):gc.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>gc.createTextNode(e),createComment:e=>gc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>gc.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{_c.innerHTML=pc(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=_c.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},yc=`transition`,bc=`animation`,xc=Symbol(`_vtc`),Sc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Cc=l({},Gr,Sc),wc=(e=>(e.displayName=`Transition`,e.props=Cc,e))((e,{slots:t})=>tc(Yr,Dc(e),t)),Tc=(e,t=[])=>{p(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ec=e=>e?p(e)?e.some(e=>e.length>1):e.length>1:!1;function Dc(e){let t={};for(let n in e)n in Sc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:u=o,appearToClass:d=s,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=Oc(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,jc(e,t?d:s),jc(e,t?u:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,jc(e,f),jc(e,m),jc(e,p),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);Tc(i,[t,o]),Mc(()=>{jc(t,e?c:a),Ac(t,e?d:s),Ec(i)||Pc(t,r,g,o)})};return l(t,{onBeforeEnter(e){Tc(v,[e]),Ac(e,a),Ac(e,o)},onBeforeAppear(e){Tc(C,[e]),Ac(e,c),Ac(e,u)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);Ac(e,f),e._enterCancelled?(Ac(e,p),Rc(e)):(Rc(e),Ac(e,p)),Mc(()=>{e._isLeaving&&(jc(e,f),Ac(e,m),Ec(x)||Pc(e,r,_,n))}),Tc(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),Tc(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),Tc(T,[e])},onLeaveCancelled(e){D(e),Tc(S,[e])}})}function Oc(e){if(e==null)return null;if(x(e))return[kc(e.enter),kc(e.leave)];{let t=kc(e);return[t,t]}}function kc(e){return oe(e)}function Ac(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[xc]||(e[xc]=new Set)).add(t)}function jc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[xc];n&&(n.delete(t),n.size||(e[xc]=void 0))}function Mc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Nc=0;function Pc(e,t,n,r){let i=e._endId=++Nc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Fc(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${yc}Delay`),a=r(`${yc}Duration`),o=Ic(i,a),s=r(`${bc}Delay`),c=r(`${bc}Duration`),l=Ic(s,c),u=null,d=0,f=0;t===yc?o>0&&(u=yc,d=o,f=a.length):t===bc?l>0&&(u=bc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?yc:bc:null,f=u?u===yc?a.length:c.length:0);let p=u===yc&&/\b(?:transform|all)(?:,|$)/.test(r(`${yc}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Ic(e,t){for(;e.lengthLc(t)+Lc(e[n])))}function Lc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Rc(e){return(e?e.ownerDocument:document).body.offsetHeight}function zc(e,t,n){let r=e[xc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Bc=Symbol(`_vod`),Vc=Symbol(`_vsh`),Hc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Bc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Uc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Uc(e,!0),r.enter(e)):r.leave(e,()=>{Uc(e,!1)}):Uc(e,t))},beforeUnmount(e,{value:t}){Uc(e,t)}};function Uc(e,t){e.style.display=t?e[Bc]:`none`,e[Vc]=!t}function Wc(){Hc.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Gc=Symbol(``);function Kc(e){let t=Fs();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Jc(e,n))},r=()=>{let r=e(t.proxy);t.ce?Jc(t.ce,r):qc(t.subTree,r),n(r)};Yi(()=>{$n(r)}),Ji(()=>{Cr(r,a,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),Qi(()=>e.disconnect())})}function qc(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{qc(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Jc(e.el,t);else if(e.type===is)e.children.forEach(e=>qc(e,t));else if(e.type===ss){let{el:n,anchor:r}=e;for(;n&&(Jc(n,t),n!==r);)n=n.nextSibling}}function Jc(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=Ee(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Gc]=r}}var Yc=/(?:^|;)\s*display\s*:/;function Xc(e,t,n){let r=e.style,i=y(n),a=!1;if(n&&!i){if(t){if(y(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Qc(r,t,``)}else for(let e in t)n[e]??Qc(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Qc(r,i,``):nl(e,i,!y(t)&&t?t[i]:void 0,o)||Qc(r,i,o)}}else if(i){if(t!==n){let e=r[Gc];e&&(n+=`;`+e),r.cssText=n,a=Yc.test(n)}}else t&&e.removeAttribute(`style`);Bc in e&&(e[Bc]=a?r.display:``,e[Vc]&&(r.display=`none`))}var Zc=/\s*!important$/;function Qc(e,t,n){if(p(n))n.forEach(n=>Qc(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=tl(e,t);Zc.test(n)?e.setProperty(j(r),n.replace(Zc,``),`important`):e[r]=n}}var $c=[`Webkit`,`Moz`,`ms`],el={};function tl(e,t){let n=el[t];if(n)return n;let r=A(t);if(r!==`filter`&&r in e)return el[t]=r;r=ne(r);for(let n=0;n<$c.length;n++){let i=$c[n]+r;if(i in e)return el[t]=i}return t}function nl(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&y(r)&&n===r}var rl=`http://www.w3.org/1999/xlink`;function il(e,t,n,r,i,a=ve(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(rl,t.slice(6,t.length)):e.setAttributeNS(rl,t,n):n==null||a&&!P(n)?e.removeAttribute(t):e.setAttribute(t,a?``:b(n)?String(n):n)}function al(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?pc(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=P(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function ol(e,t,n,r){e.addEventListener(t,n,r)}function sl(e,t,n,r){e.removeEventListener(t,n,r)}var cl=Symbol(`_vei`);function ll(e,t,n,r,i=null){let a=e[cl]||(e[cl]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=fl(t);r?ol(e,n,a[t]=gl(r,i),s):o&&(sl(e,n,o,s),a[t]=void 0)}}var ul=/(Once|Passive|Capture)$/,dl=/^on:?(?:Once|Passive|Capture)$/;function fl(e){let t,n;for(;(n=e.match(ul))&&!dl.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):j(e.slice(2)),t]}var pl=0,ml=Promise.resolve(),hl=()=>pl||=(ml.then(()=>pl=0),Date.now());function gl(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(p(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,vl=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?zc(e,r,o):t===`style`?Xc(e,n,r):s(t)?c(t)||ll(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):yl(e,t,r,o))?(al(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&il(e,t,r,o,a,t!==`value`)):e._isVueCE&&(bl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y(r)))?al(e,A(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),il(e,t,r,o))};function yl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&_l(t)&&v(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return _l(t)&&y(n)?!1:t in e}function bl(e,t){let n=e._def.props;if(!n)return!1;let r=A(t);return Array.isArray(n)?n.some(e=>A(e)===r):Object.keys(n).some(e=>A(e)===r)}var xl={};function Sl(e,t,n){let r=R(e,t);E(r)&&(r=l({},r,t));class i extends Tl{constructor(e){super(r,e,n)}}return i.def=r,i}var Cl=((e,t)=>Sl(e,t,gu)),wl=typeof HTMLElement<`u`?HTMLElement:class{},Tl=class e extends wl{constructor(e,t={},n=hu){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==hu?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(l({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,Yn(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!p(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=oe(this._props[e])),(i||=Object.create(null))[A(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)f(this,e)||Object.defineProperty(this,e,{get:()=>I(t[e])})}_resolveProps(e){let{props:t}=e,n=p(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(A))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):xl,r=A(e);t&&this._numberProps&&this._numberProps[r]&&(n=oe(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===xl?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(j(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(j(e),t+``):t||this.removeAttribute(j(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),pu(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=U(this._def,l(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,E(t[0])?l({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),j(e)!==e&&t(j(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t(delete e.props.mode,e))({name:`TransitionGroup`,props:l({},Cc,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Fs(),r=Ur(),i,a;return Xi(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!Rl(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Pl),i.forEach(Fl);let r=i.filter(Il);Rc(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;Ac(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[jl]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[jl]=null,jc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=tn(e),s=Dc(o),c=o.tag||is;if(i=[],a)for(let e=0;e{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Fc(r);return a.removeChild(r),o}var zl=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return p(t)?e=>re(t,e):t};function Bl(e){e.target.composing=!0}function Vl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Hl=Symbol(`_assign`),Ul=Symbol(`_initialValue`);function Wl(e,t,n){return t&&(e=e.trim()),n&&(e=ae(e)),e}var Gl={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Ul]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Ul]=e.defaultValue.replace(/\r\n?/g,` `))),e[Hl]=zl(i);let a=r||i.props&&i.props.type===`number`;ol(e,t?`change`:`input`,t=>{t.target.composing||e[Hl](Wl(e.value,n,a))}),(n||a)&&ol(e,`change`,()=>{e.value=Wl(e.value,n,a)}),t||(ol(e,`compositionstart`,Bl),ol(e,`compositionend`,Vl),ol(e,`change`,Vl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ul];delete e[Ul],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Hl](Wl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Hl]=zl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ae(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Kl={deep:!0,created(e,t,n){e[Hl]=zl(n),ol(e,`change`,()=>{let t=e._modelValue,n=Zl(e),r=e.checked,i=e[Hl];if(p(t)){let e=xe(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ql(e,r))})},mounted:ql,beforeUpdate(e,t,n){e[Hl]=zl(n),ql(e,t,n)}};function ql(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=xe(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=be(t,Ql(e,!0))}e.checked!==i&&(e.checked=i)}var Jl={created(e,{value:t},n){e.checked=be(t,n.props.value),e[Hl]=zl(n),ol(e,`change`,()=>{e[Hl](Zl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Hl]=zl(r),t!==n&&(e.checked=be(t,r.props.value))}},Yl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ol(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ae(Zl(e)):Zl(e));e[Hl](e.multiple?h(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Yn(()=>{e._assigning=!1})}),e[Hl]=zl(r)},mounted(e,{value:t}){Xl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Hl]=zl(n)},updated(e,{value:t}){e._assigning||Xl(e,t)}};function Xl(e,t){let n=e.multiple,r=p(t);if(!(n&&!r&&!h(t))){for(let i=0,a=e.options.length;iString(e)===String(o)):xe(t,o)>-1}else a.selected=t.has(o)}else if(be(Zl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zl(e){return`_value`in e?e._value:e.value}function Ql(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var $l={created(e,t,n){tu(e,t,n,null,`created`)},mounted(e,t,n){tu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){tu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){tu(e,t,n,r,`updated`)}};function eu(e,t){switch(e){case`SELECT`:return Yl;case`TEXTAREA`:return Gl;default:switch(t){case`checkbox`:return Kl;case`radio`:return Jl;default:return Gl}}}function tu(e,t,n,r,i){let a=eu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function nu(){Gl.getSSRProps=({value:e})=>({value:e}),Jl.getSSRProps=({value:e},t)=>{if(t.props&&be(t.props.value,e))return{checked:!0}},Kl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&xe(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},$l.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=eu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var ru=[`ctrl`,`shift`,`alt`,`meta`],iu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>ru.some(n=>e[`${n}Key`]&&!t.includes(n))},au=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=j(n.key);if(t.some(e=>e===r||ou[e]===r))return e(n)}))},cu=l({patchProp:vl},vc),lu,uu=!1;function du(){return lu||=Po(cu)}function fu(){return lu=uu?lu:Fo(cu),uu=!0,lu}var pu=((...e)=>{du().render(...e)}),mu=((...e)=>{fu().hydrate(...e)}),hu=((...e)=>{let t=du().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=vu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,_u(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),gu=((...e)=>{let t=fu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=vu(e);if(t)return n(t,!0,_u(t))},t});function _u(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function vu(e){return y(e)?document.querySelector(e):e}var yu=!1,bu=()=>{yu||(yu=!0,nu(),Wc())},xu=t({BaseTransition:()=>Yr,BaseTransitionPropsValidators:()=>Gr,Comment:()=>os,DeprecationTypes:()=>null,EffectScope:()=>Oe,ErrorCodes:()=>In,ErrorTypeStrings:()=>sc,Fragment:()=>is,KeepAlive:()=>Li,ReactiveEffect:()=>Pe,Static:()=>ss,Suspense:()=>qo,Teleport:()=>Rr,Text:()=>as,TrackOpTypes:()=>Cn,Transition:()=>wc,TransitionGroup:()=>Nl,TriggerOpTypes:()=>wn,VueElement:()=>Tl,assertNumber:()=>Fn,callWithAsyncErrorHandling:()=>zn,callWithErrorHandling:()=>Rn,camelize:()=>A,capitalize:()=>ne,cloneVNode:()=>Ss,compatUtils:()=>null,compile:()=>Su,computed:()=>W,createApp:()=>hu,createBlock:()=>V,createCommentVNode:()=>Ts,createElementBlock:()=>ms,createElementVNode:()=>H,createHydrationRenderer:()=>Fo,createPropsRestProxy:()=>Na,createRenderer:()=>Po,createSSRApp:()=>gu,createSlots:()=>fa,createStaticVNode:()=>ws,createTextVNode:()=>Cs,createVNode:()=>U,customRef:()=>hn,defineAsyncComponent:()=>Pi,defineComponent:()=>R,defineCustomElement:()=>Sl,defineEmits:()=>xa,defineExpose:()=>Sa,defineModel:()=>Ta,defineOptions:()=>Ca,defineProps:()=>ba,defineSSRCustomElement:()=>Cl,defineSlots:()=>wa,devtools:()=>cc,effect:()=>qe,effectScope:()=>ke,getCurrentInstance:()=>Fs,getCurrentScope:()=>Ae,getCurrentWatcher:()=>On,getTransitionRawChildren:()=>ti,guardReactiveProps:()=>xs,h:()=>tc,handleError:()=>Bn,hasInjectionContext:()=>_r,hydrate:()=>mu,hydrateOnIdle:()=>Di,hydrateOnInteraction:()=>ji,hydrateOnMediaQuery:()=>Ai,hydrateOnVisible:()=>ki,initCustomFormatter:()=>nc,initDirectivesForSSR:()=>bu,inject:()=>gr,isMemoSame:()=>ic,isProxy:()=>en,isReactive:()=>Zt,isReadonly:()=>Qt,isRef:()=>on,isRuntimeOnly:()=>Js,isShallow:()=>$t,isVNode:()=>hs,markRaw:()=>nn,mergeDefaults:()=>ja,mergeModels:()=>Ma,mergeProps:()=>ks,nextTick:()=>Yn,nodeOps:()=>vc,normalizeClass:()=>he,normalizeProps:()=>ge,normalizeStyle:()=>ue,onActivated:()=>zi,onBeforeMount:()=>qi,onBeforeUnmount:()=>Zi,onBeforeUpdate:()=>Yi,onDeactivated:()=>Bi,onErrorCaptured:()=>na,onMounted:()=>Ji,onRenderTracked:()=>ta,onRenderTriggered:()=>ea,onScopeDispose:()=>je,onServerPrefetch:()=>$i,onUnmounted:()=>Qi,onUpdated:()=>Xi,onWatcherCleanup:()=>kn,openBlock:()=>B,patchProp:()=>vl,popScopeId:()=>dr,provide:()=>hr,proxyRefs:()=>pn,pushScopeId:()=>ur,queuePostFlushCb:()=>$n,reactive:()=>Kt,readonly:()=>Jt,ref:()=>F,registerRuntimeCompiler:()=>qs,render:()=>pu,renderList:()=>da,renderSlot:()=>z,resolveComponent:()=>aa,resolveDirective:()=>ca,resolveDynamicComponent:()=>sa,resolveFilter:()=>null,resolveTransitionHooks:()=>Zr,setBlockTracking:()=>fs,setDevtoolsHook:()=>lc,setTransitionHooks:()=>ei,shallowReactive:()=>qt,shallowReadonly:()=>Yt,shallowRef:()=>sn,ssrContextKey:()=>vr,ssrUtils:()=>uc,stop:()=>Je,toDisplayString:()=>Ce,toHandlerKey:()=>M,toHandlers:()=>ma,toRaw:()=>tn,toRef:()=>yn,toRefs:()=>gn,toValue:()=>dn,transformVNodeArgs:()=>_s,triggerRef:()=>un,unref:()=>I,useAttrs:()=>Oa,useCssModule:()=>Ol,useCssVars:()=>Kc,useHost:()=>El,useId:()=>ni,useModel:()=>eo,useSSRContext:()=>yr,useShadowRoot:()=>Dl,useSlots:()=>Da,useTemplateRef:()=>ii,useTransitionState:()=>Ur,vModelCheckbox:()=>Kl,vModelDynamic:()=>$l,vModelRadio:()=>Jl,vModelSelect:()=>Yl,vModelText:()=>Gl,vShow:()=>Hc,version:()=>ac,warn:()=>oc,watch:()=>Cr,watchEffect:()=>br,watchPostEffect:()=>xr,watchSyncEffect:()=>Sr,withAsyncContext:()=>Pa,withCtx:()=>L,withDefaults:()=>Ea,withDirectives:()=>pr,withKeys:()=>su,withMemo:()=>rc,withModifiers:()=>au,withScopeId:()=>fr}),Su=()=>{};function Cu(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,Eu=wu,Du=(e,t)=>n=>{if(t?.variants==null)return Eu(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Tu(t)||Tu(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Eu(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Ou(e){return typeof e==`string`?`'${e}'`:new ku().serialize(e)}var ku=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;ethis.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function Au(e,t){return e===t||Ou(e)===Ou(t)}function ju(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function Mu(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function Nu(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=Mu(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(Mu(n/r,r))*r):an&&(a=t+Math.floor(Mu((n-t)/r,r))*r),a=Mu(a,r),a}function Pu(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=gr(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(hr(r,e),e)]}function Fu(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Iu(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function Lu(e){return e==null}function Ru(e,t){return Lu(e)?!1:Array.isArray(e)?e.some(e=>Au(e,t)):Au(e,t)}function zu(e,t){return Ae()?(je(e,t),!0):!1}function Bu(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return zu(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function Vu(e){let t=!1,n,r=ke(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var Hu=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Uu=e=>e!==void 0,Wu=Object.prototype.toString,Gu=e=>Wu.call(e)===`[object Object]`,Ku=qu();function qu(){var e,t;return Hu&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Ju(e){return Array.isArray(e)?e:[e]}function Yu(e){return e||Fs()}function Xu(e){if(!Hu)return e;let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return((...a)=>(t+=1,r||(r=ke(!0),n=r.run(()=>e(...a))),zu(i),n))}function Zu(e){return Kt(on(e)?new Proxy({},{get(t,n,r){return I(Reflect.get(e.value,n,r))},set(t,n,r){return on(e.value[n])&&!on(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function Qu(e){return Zu(W(e))}function $u(e,...t){let n=t.flat(),r=n[0];return Qu(()=>Object.fromEntries(typeof r==`function`?Object.entries(gn(e)).filter(([e,t])=>!r(dn(t),e)):Object.entries(gn(e)).filter(e=>!n.includes(e[0]))))}function ed(e,t=1e4){return hn((n,r)=>{let i=dn(e),a,o=()=>setTimeout(()=>{i=dn(e),r()},dn(t));return zu(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function td(e,t){Yu(t)&&Zi(e,t)}function nd(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=sn(!1),o;function s(){o&&=(clearTimeout(o),void 0)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=void 0,e(...n)},dn(t))}return r&&(a.value=!0,Hu&&l()),zu(c),{isPending:Yt(a),start:l,stop:c}}function rd(e,t,n){return Cr(e,t,{...n,immediate:!0})}var id=Hu?window:void 0;Hu&&window.document,Hu&&window.navigator,Hu&&window.location;function ad(e){let t=dn(e);return t?.$el??t}function od(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=W(()=>{let t=Ju(dn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return rd(()=>[n.value?.map(e=>ad(e))??[id].filter(e=>e!=null),Ju(dn(n.value?e[1]:e[0])),Ju(I(n.value?e[2]:e[1])),dn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Gu(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function sd(){let e=sn(!1),t=Fs();return t&&Ji(()=>{e.value=!0},t),e}function cd(e){let t=sd();return W(()=>(t.value,!!e()))}function ld(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ud(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=id,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=ld(t);return od(i,a,e=>{e.repeat&&dn(s)||c(e)&&n(e)},o)}function dd(e){return JSON.parse(JSON.stringify(e))}function fd(e,t,n={}){let{window:r=id,...i}=n,a,o=cd(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=Cr(W(()=>{let t=dn(e);return Array.isArray(t)?t.map(e=>ad(e)):[ad(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return zu(l),{isSupported:o,stop:l}}function pd(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Fs(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):dd(e):e,g=()=>Uu(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=F(g()),r=!1;return Cr(()=>e[t],e=>{r||(r=!0,n.value=h(e),Yn(()=>r=!1))}),Cr(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return W({get(){return g()},set(e){_(e)}})}function md(e){return e?e.flatMap(e=>e.type===is?md(e.children):[e]):[]}var[hd,gd]=Pu(`ConfigProvider`),_d=Kt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});function vd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function yd(e,t,n=`.`,r){if(!vd(t))return yd(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:vd(a)&&vd(i[t])?yd(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function bd(e){return(...t)=>t.reduce((t,n)=>yd(t,n,``,e),{})}var xd=bd(),Sd=Xu(()=>{let e=F(new Map),t=F(),n=W(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=hd({scrollBody:F(!0)}),i=null,a=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,_d.layersWithOutsidePointerEventsDisabled.size===0&&(document.body.style.pointerEvents=``),document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,Ku&&i?.(),t.value=void 0};return Cr(n,(e,o)=>{if(!Hu)return;if(!e){o&&a();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=r.scrollBody?.value?typeof r.scrollBody.value==`object`?xd({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),Ku&&(i=od(document,`touchmove`,e=>Td(e),{passive:!1})),Yn(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function Cd(e){let t=Math.random().toString(36).substring(2,7),n=Sd();n.value.set(t,e??!1);let r=W({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return td(()=>{n.value.delete(t)}),r}function wd(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth1||(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}var Ed=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u,Dd=/android/i;function Od(){return typeof navigator<`u`&&Dd.test(navigator.userAgent)}function kd(e){let t=F(!1),n=F(!0),r=F(!1),i=W(()=>t.value&&n.value);function a(){t.value=!0,n.value=!0,r.value=!1}function o(e){e.data&&(Ed.test(e.data)?(n.value=!0,r.value=!0):Od()&&!r.value&&(n.value=!1))}function s(n){Yn(()=>{t.value=!1,e?.(n)})}return{isComposing:t,shouldDeferInput:i,handleCompositionStart:a,handleCompositionUpdate:o,handleCompositionEnd:s}}function Ad(e){let t=hd({dir:F(`ltr`)});return W(()=>e?.value||t.dir?.value||`ltr`)}function jd(e){let t=Fs(),n=t?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{r[M(A(t))]=(...n)=>e(t,...n)}),r}var Md=0;function Nd(){br(e=>{if(!Hu)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??Pd()),document.body.insertAdjacentElement(`beforeend`,t[1]??Pd()),Md++,e(()=>{Md===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),Md--})})}function Pd(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function Fd(e){return W(()=>!dn(e)||!!ad(e)?.closest(`form`))}function Id(){let e=Fs(),t=F(),n=W(()=>r());Xi(()=>{n.value!==r()&&un(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:ad(t)}let i=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(i).length>0)for(let e in i)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>i[e]});Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){if(t.value=n,n&&(Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),!(n instanceof Element)&&!Object.hasOwn(n,`$el`))){let t=n.$.exposed,r=Object.assign({},a);for(let e in t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>t[e]});e.exposed=r}}return{forwardRef:o,currentRef:t,currentElement:n}}function Ld(e){let t=Fs(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),r=yn(e);return W(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[A(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function Rd(e,t){let n=Ld(e),r=t?jd(t):{};return W(()=>({...n.value,...r}))}function zd(){let e=Fs()?.vnode?.scopeId;return e?{[e]:``}:{}}function Bd(e,t){let n=ed(!1,300);zu(()=>{n.value=!1});let r=F(null),i=Bu();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Hd(a,Vd(a,i.getBoundingClientRect()),1),s=Ud(t.getBoundingClientRect()),c=Gd([...o,...s]);r.value=c,n.value=!0}return br(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),br(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!Wd(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function Vd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Hd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function Ud(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Wd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Gd(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),Kd(t)}function Kd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var qd=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Jd=new WeakMap,Yd=new WeakMap,Xd={},Zd=0,Qd=function(e){return e&&(e.host||Qd(e.parentNode))},$d=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Qd(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ef=function(e,t,n,r){var i=$d(t,Array.isArray(e)?e:[e]);Xd[n]||(Xd[n]=new WeakMap);var a=Xd[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Jd.get(e)||0)+1,l=(a.get(e)||0)+1;Jd.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Yd.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Zd++,function(){o.forEach(function(e){var t=Jd.get(e)-1,i=a.get(e)-1;Jd.set(e,t),a.set(e,i),t||(Yd.has(e)||e.removeAttribute(r),Yd.delete(e)),i||e.removeAttribute(n)}),Zd--,Zd||(Jd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd={})}},tf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||qd(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ef(r,i,n,`aria-hidden`)):function(){return null}};function nf(e){let t;Cr(()=>ad(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=tf(e):t&&t()}),Qi(()=>{t&&t()})}var rf=0;function af(e,t=`reka`){if(e)return e;let n,r=hd({useId:void 0});return n=r.useId?r.useId():`useId`in xu?ni?.():`${++rf}`,t?`${t}-${n}`:n}function of(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}function sf(e){let t=hd({locale:F(`en`)});return W(()=>e?.value||t.locale?.value||`en`)}function cf(e){let t=F(),n=W(()=>t.value?.width??0),r=W(()=>t.value?.height??0),i;return Ji(()=>{let n=ad(e);n?(t.value={width:n.offsetWidth,height:n.offsetHeight},i=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}}),i.observe(n,{box:`border-box`})):t.value=void 0}),Qi(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function lf(e,t){let n=F(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function uf(e){let t=ed(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=Fu(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=ff(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function df(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ff(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=df(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function pf(e,t){let n=F({}),r=F(`none`),i=F(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??id,{state:c,dispatch:l}=lf(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(Hu){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};Cr(e,async(e,i)=>{let a=i!==e;if(await Yn(),a){let a=r.value,o=mf(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{if(e.target!==t.value)return;let n=mf(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=mf(t.value))},p=Cr(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=Cr(c,()=>{let e=mf(t.value);r.value=c.value===`mounted`?e:`none`});return Qi(()=>{p(),m(),t.value&&(t.value.removeEventListener(`animationstart`,f),t.value.removeEventListener(`animationcancel`,d),t.value.removeEventListener(`animationend`,d)),o!==void 0&&s?.clearTimeout(o)}),{isPresent:W(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function mf(e){return e&&getComputedStyle(e).animationName||`none`}var hf=R({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=gn(e),a=F(),{isPresent:o}=pf(r,a);n({present:o});let s=t.default({present:o.value});s=md(s||[]);let c=Fs();if(s&&s?.length>1){let e=c?.parent?.type.name?`<${c.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(` `)].join(` -`))}return()=>i.value||r.value||o.value?tc(t.default({present:o.value})[0],{ref:e=>{let t=ad(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),gf=R({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=md(n.default()),r=e.findIndex(e=>e.type!==os);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?ks(t,i.props):t,o=Ss({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),_f=[`area`,`img`,`input`],vf=R({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&_f.includes(r)?()=>tc(r,t):r===`template`?()=>tc(gf,t,{default:n.default}):()=>tc(e.as,t,{default:n.default})}});function yf(){let e=F();return{primitiveElement:e,currentElement:W(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ad(e))}}var bf=`dismissableLayer.pointerDownOutside`,xf=`dismissableLayer.focusOutside`;function Sf(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r){});return br(o=>{if(!Hu||!dn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(Sf(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Iu(bf,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{dn(n)&&(i.value=!0)}}}function wf(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=F(!1);return br(a=>{if(!Hu||!dn(n))return;let o=async n=>{if(!t?.value)return;await Yn(),await Yn();let r=n.target;!t.value||!r||Sf(t.value,r)||n.target&&!i.value&&Iu(xf,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{dn(n)&&(i.value=!0)},onBlurCapture:()=>{dn(n)&&(i.value=!1)}}}var Tf=R({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Id(),o=W(()=>a.value?.ownerDocument??globalThis.document),s=W(()=>_d.layersRoot),c=W(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=W(()=>_d.layersWithOutsidePointerEventsDisabled.size>0),u=W(()=>{let e=Array.from(s.value),[t]=[..._d.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Cf(async e=>{let t=[..._d.branches].some(t=>t?.contains(e.target));!n.present||!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Yn(),e.defaultPrevented||r(`dismiss`))},a),f=wf(e=>{let t=[..._d.branches].some(t=>t?.contains(e.target));!n.present||t||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ud(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Cr([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{!e||!n||t&&(_d.layersWithOutsidePointerEventsDisabled.size===0&&(_d.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),_d.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{_d.layersWithOutsidePointerEventsDisabled.delete(e),_d.layersWithOutsidePointerEventsDisabled.size===0&&!Lu(_d.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=_d.originalBodyPointerEvents)}))},{immediate:!0}),Cr([a,()=>n.present],([e,t],n,r)=>{!e||!t||(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),br(e=>{e(()=>{a.value&&(s.value.delete(a.value),_d.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(B(),V(I(vf),{ref:I(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:ue({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:I(f).onFocusCapture,onBlurCapture:I(f).onBlurCapture,onPointerdownCapture:I(d).onPointerDownCapture},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),Ef=Vu(()=>F([]));function Df(){let e=Ef();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Of(e.value,t),e.value.unshift(t)},remove(t){e.value=Of(e.value,t),e.value[0]?.resume()}}}function Of(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var kf=`focusScope.autoFocusOnMount`,Af=`focusScope.autoFocusOnUnmount`,jf={bubbles:!1,cancelable:!0};function Mf(e,{select:t=!1}={}){let n=Fu();for(let r of e)if(Rf(r,{select:t}),Fu()!==n)return!0}function Nf(e){let t=Pf(e);return[Ff(t,e),Ff(t.reverse(),e)]}function Pf(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ff(e,t){for(let n of e)if(!If(n,{upTo:t}))return n}function If(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Lf(e){return e instanceof HTMLInputElement&&`select`in e}function Rf(e,{select:t=!1}={}){if(e&&e.focus){let n=Fu();e.focus({preventScroll:!0}),e!==n&&Lf(e)&&t&&e.select()}}var zf=R({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},present:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=Id(),o=F(null),s=Df(),c=Kt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});br(e=>{if(!Hu)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Rf(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Rf(o.value,{select:!0}))}function s(e){let n=o.value;n!==null&&e.some(e=>e.removedNodes.length>0)&&(t.contains(n)||Rf(t))}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})});function l(e,t){let n=new CustomEvent(kf,jf),i=e=>r(`mountAutoFocus`,e);e.addEventListener(kf,i),e.dispatchEvent(n),e.removeEventListener(kf,i),n.defaultPrevented||(Mf(Pf(e),{select:!0}),Fu()===t&&Rf(e))}br(async e=>{let t=a.value;if(await Yn(),!t)return;n.present!==!1&&s.add(c);let i=Fu();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(Af,jf),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(Af,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||Rf(i??document.body,{select:!0}),t.removeEventListener(Af,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),Cr(()=>n.present,async(e,t)=>{if(!Hu)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await Yn();let n=a.value;if(!n)return;let r=Fu();n.contains(r)||l(n,r)});function u(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=Fu();if(t&&r){let t=e.currentTarget,[i,a]=Nf(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Rf(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Rf(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(B(),V(I(vf),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Bf=[`Enter`,` `],Vf=[`ArrowDown`,`PageUp`,`Home`],Hf=[`ArrowUp`,`PageDown`,`End`];[...Vf,...Hf],[...Bf],[...Bf];function Uf(e){let t=Fu();for(let n of e)if(n===t||(n.focus(),Fu()!==t))return}var Wf=R({__name:`Teleport`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e,n=hd({}),r=W(()=>t.to??n.teleportTo?.value??`body`),i=sd();return(e,t)=>I(i)||e.forceMount?(B(),V(Rr,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[z(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):Ts(`v-if`,!0)}}),Gf=`data-reka-collection-item`;function Kf(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:F(),itemMap:F(new Map)},hr(r,i)):i=gr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${Gf}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},o=R({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=yf();return Cr(a,()=>{i.collectionRef.value=a.value}),()=>tc(gf,{ref:r,...n},t)}}),s=R({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=yf();return br(t=>{if(a.value){let n=nn(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>tc(gf,{...n,[Gf]:``,ref:r},t)}});return{getItems:a,reactiveItems:W(()=>Array.from(i.itemMap.value.values())),itemMapSize:W(()=>i.itemMap.value.size),CollectionSlot:o,CollectionItem:s}}var qf=R({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),V(I(vf),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),Jf=R({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=yf();return Cr(W(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(B(),V(qf,ks({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),Yf=R({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=W(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=W(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(B(),ms(is,null,[Ts(` We render single input if it's required `),n.value?(B(),V(Jf,ks({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(B(!0),ms(is,{key:1},da(r.value,n=>(B(),V(Jf,ks({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),Xf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Zf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Qf(e,t,n){let r=Zf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Xf[r]}function $f(e,t=!1){let n=Fu();for(let r of e)if(r===n||(r.focus({preventScroll:t}),Fu()!==n))return}function ep(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[tp,np]=Pu(`PopperRoot`),rp=R({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=F();return np({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>z(e.$slots,`default`)}}),ip=R({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Id(),i=tp();return xr(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(B(),V(I(vf),{ref:I(n),as:e.as,"as-child":e.asChild},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function ap(e){return e!==null}function op(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=sp(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function sp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var cp=[`top`,`right`,`bottom`,`left`],lp=Math.min,up=Math.max,dp=Math.round,fp=Math.floor,pp=e=>({x:e,y:e}),mp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function hp(e,t,n){return up(e,lp(t,n))}function gp(e,t){return typeof e==`function`?e(t):e}function _p(e){return e.split(`-`)[0]}function vp(e){return e.split(`-`)[1]}function yp(e){return e===`x`?`y`:`x`}function bp(e){return e===`y`?`height`:`width`}function xp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Sp(e){return yp(xp(e))}function Cp(e,t,n){n===void 0&&(n=!1);let r=vp(e),i=Sp(e),a=bp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Mp(o)),[o,Mp(o)]}function wp(e){let t=Mp(e);return[Tp(e),t,Tp(t)]}function Tp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ep=[`left`,`right`],Dp=[`right`,`left`],Op=[`top`,`bottom`],kp=[`bottom`,`top`];function Ap(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Dp:Ep:t?Ep:Dp;case`left`:case`right`:return t?Op:kp;default:return[]}}function jp(e,t,n,r){let i=vp(e),a=Ap(_p(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Tp)))),a}function Mp(e){let t=_p(e);return mp[t]+e.slice(t.length)}function Np(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Np(e)}function Fp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ip(e,t,n){let{reference:r,floating:i}=e,a=xp(t),o=Sp(t),s=bp(o),c=_p(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(vp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function Lp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=gp(t,e),p=Pp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Fp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Fp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Rp=50,zp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Lp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ip(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=gp(e,t)||{};if(l==null)return{};let d=Pp(u),f={x:n,y:r},p=Sp(i),m=bp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=lp(d[_],T),D=lp(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=hp(O,k,ee),te=!c.arrow&&vp(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===xp(t)||T.every(e=>xp(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=xp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Hp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Up(e){return cp.some(t=>e[t]>=0)}var Wp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=gp(e,t);switch(i){case`referenceHidden`:{let e=Hp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Up(e)}}}case`escaped`:{let e=Hp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Up(e)}}}default:return{}}}}},Gp=new Set([`left`,`top`]);async function Kp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_p(n),s=vp(n),c=xp(n)===`y`,l=Gp.has(o)?-1:1,u=a&&c?-1:1,d=gp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var qp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Kp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Jp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=gp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=xp(_p(i)),p=yp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=hp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=hp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Yp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=gp(e,t),u={x:n,y:r},d=xp(i),f=yp(d),p=u[f],m=u[d],h=gp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Gp.has(_p(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},Xp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=gp(e,t),u=await o.detectOverflow(t,l),d=_p(i),f=vp(i),p=xp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=lp(h-u[g],v),x=lp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=up(u.left,0),t=up(u.right,0),n=up(u.top,0),r=up(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:up(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:up(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Zp(){return typeof window<`u`}function Qp(e){return tm(e)?(e.nodeName||``).toLowerCase():`#document`}function $p(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function em(e){return((tm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tm(e){return Zp()?e instanceof Node||e instanceof $p(e).Node:!1}function nm(e){return Zp()?e instanceof Element||e instanceof $p(e).Element:!1}function rm(e){return Zp()?e instanceof HTMLElement||e instanceof $p(e).HTMLElement:!1}function im(e){return!Zp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $p(e).ShadowRoot}function am(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=gm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function om(e){return/^(table|td|th)$/.test(Qp(e))}function sm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var cm=/transform|translate|scale|rotate|perspective|filter/,lm=/paint|layout|strict|content/,um=e=>!!e&&e!==`none`,dm;function fm(e){let t=nm(e)?gm(e):e;return um(t.transform)||um(t.translate)||um(t.scale)||um(t.rotate)||um(t.perspective)||!mm()&&(um(t.backdropFilter)||um(t.filter))||cm.test(t.willChange||``)||lm.test(t.contain||``)}function pm(e){let t=vm(e);for(;rm(t)&&!hm(t);){if(fm(t))return t;if(sm(t))return null;t=vm(t)}return null}function mm(){return dm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dm}function hm(e){return/^(html|body|#document)$/.test(Qp(e))}function gm(e){return $p(e).getComputedStyle(e)}function _m(e){return nm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vm(e){if(Qp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||im(e)&&e.host||em(e);return im(t)?t.host:t}function ym(e){let t=vm(e);return hm(t)?e.ownerDocument?e.ownerDocument.body:e.body:rm(t)&&am(t)?t:ym(t)}function bm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ym(e),i=r===e.ownerDocument?.body,a=$p(r);if(i){let e=xm(a);return t.concat(a,a.visualViewport||[],am(r)?r:[],e&&n?bm(e):[])}return t.concat(r,bm(r,[],n))}function xm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sm(e){let t=gm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=dp(n)!==a||dp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Cm(e){return nm(e)?e:e.contextElement}function wm(e){let t=Cm(e);if(!rm(t))return pp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Sm(t),o=(a?dp(n.width):n.width)/r,s=(a?dp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Tm=pp(0);function Em(e){let t=$p(e);return!mm()||!t.visualViewport?Tm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$p(e)?!1:t}function Om(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Cm(e),o=pp(1);t&&(r?nm(r)&&(o=wm(r)):o=wm(e));let s=Dm(a,n,r)?Em(a):pp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=$p(a),t=r&&nm(r)?$p(r):r,n=e,i=xm(n);for(;i&&r&&t!==n;){let e=wm(i),t=i.getBoundingClientRect(),r=gm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=$p(i),i=xm(n)}}return Fp({width:u,height:d,x:c,y:l})}function km(e,t){let n=_m(e).scrollLeft;return t?t.left+n:Om(em(e)).left+n}function Am(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-km(e,n),y:n.top+t.scrollTop}}function jm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=em(r),s=t?sm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=pp(1),u=pp(0),d=rm(r);if((d||!d&&!a)&&((Qp(r)!==`body`||am(o))&&(c=_m(r)),d)){let e=Om(r);l=wm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Am(o,c):pp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Mm(e){return Array.from(e.getClientRects())}function Nm(e){let t=em(e),n=_m(e),r=e.ownerDocument.body,i=up(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=up(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+km(e),s=-n.scrollTop;return gm(r).direction===`rtl`&&(o+=up(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Pm=25;function Fm(e,t){let n=$p(e),r=em(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=mm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=km(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Pm&&(a-=o)}else l<=Pm&&(a+=l);return{width:a,height:o,x:s,y:c}}function Im(e,t){let n=Om(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rm(e)?wm(e):pp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Lm(e,t,n){let r;if(t===`viewport`)r=Fm(e,n);else if(t===`document`)r=Nm(em(e));else if(nm(t))r=Im(t,n);else{let n=Em(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fp(r)}function Rm(e,t){let n=vm(e);return n===t||!nm(n)||hm(n)?!1:gm(n).position===`fixed`||Rm(n,t)}function zm(e,t){let n=t.get(e);if(n)return n;let r=bm(e,[],!1).filter(e=>nm(e)&&Qp(e)!==`body`),i=null,a=gm(e).position===`fixed`,o=a?vm(e):e;for(;nm(o)&&!hm(o);){let t=gm(o),n=fm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||am(o)&&!n&&Rm(e,o))?r=r.filter(e=>e!==o):i=t,o=vm(o)}return t.set(e,r),r}function Bm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?sm(t)?[]:zm(t,this._c):[].concat(n),r],o=Lm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{o(!1,1e-7)},1e3)}n===1&&!Ym(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Zm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Cm(e),u=i||a?[...l?bm(l):[],...t?bm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Xm(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Om(e):null;c&&g();function g(){let t=Om(e);h&&!Ym(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Qm=qp,$m=Jp,eh=Vp,th=Xp,nh=Wp,rh=Bp,ih=Yp,ah=(e,t,n)=>{let r=new Map,i={platform:Jm,...n},a={...i.platform,_c:r};return zp(e,t,{...i,platform:a})};function oh(e){return typeof e==`object`&&!!e&&`$el`in e}function sh(e){if(oh(e)){let t=e.$el;return tm(t)&&Qp(t)===`#comment`?null:t}return e}function ch(e){return typeof e==`function`?e():I(e)}function lh(e){return{name:`arrow`,options:e,fn(t){let n=sh(ch(e.element));return n==null?{}:rh({element:n,padding:e.padding}).fn(t)}}}function uh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dh(e,t){let n=uh(e);return Math.round(t*n)/n}function fh(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=W(()=>ch(n.open)??!0),a=W(()=>ch(n.middleware)),o=W(()=>ch(n.placement)??`bottom`),s=W(()=>ch(n.strategy)??`absolute`),c=W(()=>ch(n.transform)??!0),l=W(()=>sh(e.value)),u=W(()=>sh(t.value)),d=F(0),f=F(0),p=F(s.value),m=F(o.value),h=sn({}),g=F(!1),_=W(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=dh(u.value,d.value),n=dh(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...uh(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;ah(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return Cr([a,o,s,i],y,{flush:`sync`}),Cr([l,u],x,{flush:`sync`}),Cr(i,S,{flush:`sync`}),Ae()&&je(b),{x:Yt(d),y:Yt(f),strategy:Yt(p),placement:Yt(m),middlewareData:Yt(h),isPositioned:Yt(g),floatingStyles:_,update:y}}var ph=[`dir`],mh={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[hh,gh]=Pu(`PopperContent`),_h=R({inheritAttrs:!1,__name:`PopperContent`,props:ja({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...mh}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=tp(),{forwardRef:a,currentElement:o}=Id(),s=Ad(W(()=>n.dir)),c=F(),l=F(),{width:u,height:d}=cf(l),f=W(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=W(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=W(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=W(()=>({padding:p.value,boundary:m.value.filter(ap),altBoundary:m.value.length>0})),g=W(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=W(()=>[Qm({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&eh({...h.value,...g.value}),n.avoidCollisions&&$m({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?ih():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&eh({...h.value,...g.value}),th({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&lh({element:l.value,padding:n.arrowPadding}),op({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&nh({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=fh(W(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>Zm(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=W(()=>sp(y.value)[0]),w=W(()=>sp(y.value)[1]);xr(()=>{b.value&&r(`placed`)});let T=W(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),E=F(``);return br(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)}),gh({placedSide:C,onArrowChange:e=>l.value=e,arrowX:W(()=>x.value.arrow?.x??0),arrowY:W(()=>x.value.arrow?.y??0),shouldHideArrow:T}),(e,t)=>(B(),ms(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:I(s),style:ue({...I(v),transform:I(b)?I(v).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:E.value,"--reka-popper-transform-origin":[I(x).transformOrigin?.x,I(x).transformOrigin?.y].join(` `),...I(x).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?rc([n.asChild,n.as,C.value,w.value,I(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(B(),V(I(vf),ks({key:0,ref:I(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,style:{animation:I(b)?void 0:`none`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(B(),V(I(vf),ks({key:1,ref:I(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,dir:I(s),style:{animation:I(b)?void 0:`none`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,ph))}});function vh(e){let t=hd({nonce:F()});return W(()=>e?.value||t.nonce?.value)}var[yh,bh]=Pu(`RovingFocusGroup`),xh=R({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=yh(),r=af(),i=W(()=>t.tabStopId||r),a=W(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=Kf();Ji(()=>{t.focusable&&n.onFocusableItemAdd()}),Qi(()=>{t.focusable&&n.onFocusableItemRemove()}),Cr(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=Qf(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?ep(i,t+1):i.slice(t+1)}Yn(()=>$f(i))}}return(e,t)=>(B(),V(I(s),null,{default:L(()=>[U(I(vf),{tabindex:a.value?0:-1,"data-orientation":I(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?I(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>I(n).onItemFocus(i.value),onKeydown:c},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[Sh,Ch]=Pu(`CheckboxGroupRoot`);function wh(e){return e===`indeterminate`}function Th(e){return wh(e)?`indeterminate`:e?`checked`:`unchecked`}var[Eh,Dh]=Pu(`CheckboxRoot`),Oh=R({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Id(),o=Sh(null),s=pd(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=W(()=>o?.disabled.value||n.disabled),l=W(()=>Au(s.value,n.trueValue)),u=W(()=>Lu(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:Ru(o.modelValue.value,n.value));function d(){if(Lu(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(Ru(e,n.value)){let t=e.findIndex(e=>Au(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=Fd(a),p=zd(),m=Oa(),h=W(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return Dh({disabled:c,state:u}),(e,t)=>(B(),ms(is,null,[(B(),V(sa(I(o)?.rovingFocus.value?I(xh):I(vf)),ks({...e.$attrs,...I(p)},{id:e.id,ref:I(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":I(wh)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":I(Th)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:I(o)?.rovingFocus.value?!c.value:void 0,onKeydown:su(au(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),I(f)&&e.name&&!I(o)?(B(),V(I(Yf),ks({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},I(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):Ts(`v-if`,!0)],64))}}),kh=R({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=Id(),n=Eh();return(e,r)=>(B(),V(I(hf),{present:e.forceMount||I(wh)(I(n).state.value)||I(n).state.value===!0},{default:L(()=>[U(I(vf),ks({ref:I(t),"data-state":I(Th)(I(n).state.value),"data-disabled":I(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}});function Ah(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function jh(e,t,n){return ju(100/(n-t)*(e-t),0,100)}function Mh(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Nh(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Ph(e,t,n){let r=e/2;return(r-Lh([0,50],[0,r])(t)*n)*n}function Fh(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Ih(e,t){if(t>0){let n=Fh(e);return Math.min(...n)>=t}return!0}function Lh(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rh(e){return(String(e).split(`.`)[1]||``).length}function zh(e,t){let n=10**t;return Math.round(e*n)/n}var Bh=[`PageUp`,`PageDown`],Vh=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Hh={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageUp`,`ArrowUp`,`ArrowLeft`]},[Uh,Wh]=Pu([`SliderVertical`,`SliderHorizontal`]),Gh=R({__name:`SliderHorizontal`,props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:a,dir:o,inverted:s}=gn(n),{forwardRef:c,currentElement:l}=Id(),u=qh(),d=F(),f=F(),p=W(()=>o?.value!==`rtl`&&!s.value||o?.value!==`ltr`&&s.value);function m(e,t){let n=f.value||l.value.getBoundingClientRect(),r=[...u.thumbElements.value][u.valueIndexToChangeRef.value],o=u.thumbAlignment.value===`contain`?r.clientWidth:0;!d.value&&!t&&u.thumbAlignment.value===`contain`&&(d.value=e.clientX-r.getBoundingClientRect().left);let s=Lh([0,n.width-o],p.value?[a.value,i.value]:[i.value,a.value]);return f.value=n,s(t?e.clientX-n.left-o/2:e.clientX-n.left-(d.value??0))}return Wh({startEdge:W(()=>p.value?`left`:`right`),endEdge:W(()=>p.value?`right`:`left`),direction:W(()=>p.value?1:-1),size:`width`}),(e,t)=>(B(),V(Xh,{ref:I(c),dir:I(o),"data-orientation":`horizontal`,style:ue({"--reka-slider-thumb-transform":!p.value&&I(u).thumbAlignment.value===`overflow`?`translateX(50%)`:`translateX(-50%)`}),onSlideStart:t[0]||=e=>{let t=m(e,!0);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=m(e);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{f.value=void 0,d.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=p.value?`from-left`:`from-right`,n=I(Hh)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`dir`,`style`]))}}),Kh=R({__name:`SliderVertical`,props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:a,inverted:o}=gn(n),s=qh(),{forwardRef:c,currentElement:l}=Id(),u=F(),d=F(),f=W(()=>!o.value);function p(e,t){let n=d.value||l.value.getBoundingClientRect(),r=[...s.thumbElements.value][s.valueIndexToChangeRef.value],o=s.thumbAlignment.value===`contain`?r.clientHeight:0;!u.value&&!t&&s.thumbAlignment.value===`contain`&&(u.value=e.clientY-r.getBoundingClientRect().top);let c=Lh([0,n.height-o],f.value?[i.value,a.value]:[a.value,i.value]),p=t?e.clientY-n.top-o/2:e.clientY-n.top-(u.value??0);return d.value=n,c(p)}return Wh({startEdge:W(()=>f.value?`bottom`:`top`),endEdge:W(()=>f.value?`top`:`bottom`),direction:W(()=>f.value?1:-1),size:`height`}),(e,t)=>(B(),V(Xh,{ref:I(c),"data-orientation":`vertical`,style:ue({"--reka-slider-thumb-transform":!f.value&&I(s).thumbAlignment.value===`overflow`?`translateY(-50%)`:`translateY(50%)`}),onSlideStart:t[0]||=e=>{let t=p(e,!0);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=p(e);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{d.value=void 0,u.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=f.value?`from-bottom`:`from-top`,n=I(Hh)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`style`]))}}),[qh,Jh]=Pu(`SliderRoot`),Yh=R({inheritAttrs:!1,__name:`SliderRoot`,props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:`contain`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:t}){let n=e,r=t,{min:i,max:a,step:o,minStepsBetweenThumbs:s,orientation:c,disabled:l,thumbAlignment:u,dir:d}=gn(n),f=Ad(d),{forwardRef:p,currentElement:m}=Id(),h=Fd(m),{CollectionSlot:g}=Kf({isProvider:!0}),_=pd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),v=W(()=>Array.isArray(_.value)?[..._.value]:[]),y=F(0),b=F(v.value);function x(e){w(e,Nh(v.value,e))}function S(e){w(e,y.value)}function C(){let e=b.value[y.value];v.value[y.value]!==e&&r(`valueCommit`,tn(v.value))}function w(e,t,{commit:n}={commit:!1}){let c=Rh(o.value),l=ju(zh(Math.round((e-i.value)/o.value)*o.value+i.value,c),i.value,a.value),u=Ah(v.value,l,t);if(Ih(u,s.value*o.value)){y.value=u.indexOf(l);let e=String(u)!==String(_.value);e&&n&&r(`valueCommit`,u),e&&(T.value[y.value]?.focus(),_.value=u)}}let T=F([]);return Jh({modelValue:_,currentModelValue:v,valueIndexToChangeRef:y,thumbElements:T,orientation:c,min:i,max:a,disabled:l,thumbAlignment:u}),(e,t)=>(B(),V(I(g),null,{default:L(()=>[(B(),V(sa(I(c)===`horizontal`?Gh:Kh),ks(e.$attrs,{ref:I(p),"as-child":e.asChild,as:e.as,min:I(i),max:I(a),dir:I(f),inverted:e.inverted,"aria-disabled":I(l),"data-disabled":I(l)?``:void 0,onPointerdown:t[0]||=()=>{I(l)||(b.value=v.value)},onSlideStart:t[1]||=e=>!I(l)&&x(e),onSlideMove:t[2]||=e=>!I(l)&&S(e),onSlideEnd:t[3]||=e=>!I(l)&&C(),onHomeKeyDown:t[4]||=e=>!I(l)&&w(I(i),0,{commit:!0}),onEndKeyDown:t[5]||=e=>!I(l)&&w(I(a),v.value.length-1,{commit:!0}),onStepKeyDown:t[6]||=(e,t)=>{if(!I(l)){let n=I(Bh).includes(e.key)||e.shiftKey&&I(Vh).includes(e.key)?10:1,r=y.value,i=v.value[r];w(i+I(o)*n*t,r,{commit:!0})}}}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(_)}),I(h)&&e.name?(B(),V(I(Yf),{key:0,type:`number`,value:I(_),name:e.name,required:e.required,disabled:I(l),step:I(o)},null,8,[`value`,`name`,`required`,`disabled`,`step`])):Ts(`v-if`,!0)]),_:3},16,[`as-child`,`as`,`min`,`max`,`dir`,`inverted`,`aria-disabled`,`data-disabled`]))]),_:3}))}}),Xh=R({__name:`SliderImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},emits:[`slideStart`,`slideMove`,`slideEnd`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,i=qh();return(e,t)=>(B(),V(I(vf),ks({"data-slider-impl":``},n,{onKeydown:t[0]||=e=>{e.key===`Home`?(r(`homeKeyDown`,e),e.preventDefault()):e.key===`End`?(r(`endKeyDown`,e),e.preventDefault()):I(Bh).concat(I(Vh)).includes(e.key)&&(r(`stepKeyDown`,e),e.preventDefault())},onPointerdown:t[1]||=e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),I(i).thumbElements.value.includes(t)?t.focus():r(`slideStart`,e)},onPointermove:t[2]||=e=>{e.target.hasPointerCapture(e.pointerId)&&r(`slideMove`,e)},onPointerup:t[3]||=e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(`slideEnd`,e))}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Zh=R({__name:`SliderRange`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qh(),n=Uh();Id();let r=W(()=>t.currentModelValue.value.map(e=>jh(e,t.min.value,t.max.value))),i=W(()=>t.currentModelValue.value.length>1?Math.min(...r.value):0),a=W(()=>100-Math.max(...r.value,0));return(e,r)=>(B(),V(I(vf),{"data-disabled":I(t).disabled.value?``:void 0,"data-orientation":I(t).orientation.value,"as-child":e.asChild,as:e.as,style:ue({[I(n).startEdge.value]:`${i.value}%`,[I(n).endEdge.value]:`${a.value}%`})},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`data-disabled`,`data-orientation`,`as-child`,`as`,`style`]))}}),Qh=R({inheritAttrs:!1,__name:`SliderThumbImpl`,props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=qh(),r=Uh(),{forwardRef:i,currentElement:a}=Id(),{CollectionItem:o}=Kf(),s=W(()=>n.modelValue?.value?.[t.index]),c=W(()=>s.value===void 0?0:jh(s.value,n.min.value??0,n.max.value??100)),l=W(()=>Mh(t.index,n.modelValue?.value?.length??0)),u=cf(a),d=W(()=>u[r.size].value),f=W(()=>n.thumbAlignment.value===`overflow`||!d.value?0:Ph(d.value,c.value,r.direction.value)),p=sd();return Ji(()=>{n.thumbElements.value.push(a.value)}),Qi(()=>{let e=n.thumbElements.value.findIndex(e=>e===a.value)??-1;n.thumbElements.value.splice(e,1)}),(e,t)=>(B(),V(I(o),null,{default:L(()=>[U(I(vf),ks(e.$attrs,{ref:I(i),role:`slider`,tabindex:I(n).disabled.value?void 0:0,"aria-label":e.$attrs[`aria-label`]||l.value,"data-disabled":I(n).disabled.value?``:void 0,"data-orientation":I(n).orientation.value,"aria-valuenow":s.value,"aria-valuemin":I(n).min.value,"aria-valuemax":I(n).max.value,"aria-orientation":I(n).orientation.value,"as-child":e.asChild,as:e.as,style:{transform:`var(--reka-slider-thumb-transform)`,position:`absolute`,[I(r).startEdge.value]:`calc(${c.value}% + ${f.value}px)`,display:!I(p)&&s.value===void 0?`none`:void 0},onFocus:t[0]||=()=>{I(n).valueIndexToChangeRef.value=e.index}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`tabindex`,`aria-label`,`data-disabled`,`data-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-orientation`,`as-child`,`as`,`style`])]),_:3}))}}),$h=R({__name:`SliderThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{getItems:n}=Kf(),{forwardRef:r,currentElement:i}=Id(),a=W(()=>i.value?n(!0).findIndex(e=>e.ref===i.value):-1);return(e,n)=>(B(),V(Qh,ks({ref:I(r)},t,{index:a.value}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`index`]))}}),eg=R({__name:`SliderTrack`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qh();return Id(),(e,n)=>(B(),V(I(vf),{"as-child":e.asChild,as:e.as,"data-disabled":I(t).disabled.value?``:void 0,"data-orientation":I(t).orientation.value},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`data-disabled`,`data-orientation`]))}}),[tg,ng]=Pu(`PopoverRoot`),rg=R({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=gn(n),a=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return ng({contentId:``,triggerId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:F(),hasCustomAnchor:F(!1)}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{open:I(a),close:()=>a.value=!1})]),_:3}))}}),ig=R({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Ld($u(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=Id(),o=tg();return Nd(),(e,t)=>(B(),V(I(zf),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:L(()=>[U(I(Tf),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>I(o).onOpenChange(!1)},{default:L(()=>[U(I(_h),ks(I(i),{id:I(o).contentId,ref:I(a),"data-state":I(o).open.value?`open`:`closed`,"aria-labelledby":I(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),ag=R({__name:`PopoverContentModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=F(!1);Cd(!0);let o=Rd(n,r),{forwardRef:s,currentElement:c}=Id();return nf(c),(e,t)=>(B(),V(ig,ks(I(o),{ref:I(s),"trap-focus":I(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=au(e=>{r(`closeAutoFocus`,e),a.value||I(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,i=t.button===2||n;a.value=i},onFocusOutside:t[2]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),og=R({__name:`PopoverContentNonModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=F(!1),o=F(!1),s=Rd(n,r);return(e,t)=>(B(),V(ig,ks(I(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||I(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;I(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),sg=R({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=Rd(n,r),{forwardRef:o}=Id();return i.contentId||=af(void 0,`reka-popover-content`),(e,t)=>(B(),V(I(hf),{present:e.forceMount||I(i).open.value},{default:L(()=>[I(i).modal.value?(B(),V(ag,ks({key:0},I(a),{ref:I(o)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)):(B(),V(og,ks({key:1},I(a),{ref:I(o)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),cg=R({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),lg=R({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=tg(),{forwardRef:r,currentElement:i}=Id();return n.triggerId||=af(void 0,`reka-popover-trigger`),Ji(()=>{n.triggerElement.value=i.value}),(e,i)=>(B(),V(sa(I(n).hasCustomAnchor.value?I(vf):I(ip)),{"as-child":``},{default:L(()=>[U(I(vf),{id:I(n).triggerId,ref:I(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":I(n).open.value,"aria-controls":I(n).contentId,"data-state":I(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:I(n).onOpenToggle},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),ug=new Map,dg=!1;try{dg=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}var fg=!1;try{fg=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}var pg={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}},mg=class{format(e){let t=``;if(t=!dg&&this.options.signDisplay!=null?gg(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!fg){let{unit:e,unitDisplay:n=`short`,locale:r}=this.resolvedOptions();if(!e)return t;let i=pg[e]?.[n];t+=i[r]||i.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!dg&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!fg&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=hg(e,t),this.options=t}};function hg(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!fg){let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!pg[e]?.[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let r=e+(t?Object.entries(t).sort((e,t)=>e[0]0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);return[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`),t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r)}return e.format(n)}}var _g=RegExp(`^.*\\(.*\\).*$`),vg=[`latn`,`arab`,`hanidec`,`deva`,`beng`,`fullwide`],yg=class{parse(e){return xg(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return xg(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return xg(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}},bg=new Map;function xg(e,t,n){let r=Sg(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of vg)if(i!==r.options.numberingSystem){let r=Sg(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function Sg(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]-1&&(t=`-${t}`)}let n=t?+t:NaN;if(isNaN(n))return NaN;if(this.options.style===`percent`){let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new yg(this.locale,e).parse(new mg(this.locale,e).format(n))}return this.options.currencySign===`accounting`&&_g.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=e.replace(`,`,this.symbols.decimal),e=e.replace(`،`,this.symbols.decimal)),this.symbols.group&&(e=Dg(e,`.`,this.symbols.group))),this.symbols.group===`’`&&e.includes(`'`)&&(e=Dg(e,`'`,this.symbols.group)),this.options.locale===`fr-FR`&&this.symbols.group&&(e=Dg(e,` `,this.symbols.group),e=Dg(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,t=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Dg(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits??=t.maximumFractionDigits),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=Eg(e,this.formatter,this.options,t),this.options.style===`percent`&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}},wg=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),Tg=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function Eg(e,t,n,r){let i=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`}),a=i.formatToParts(-10000.111),o=i.formatToParts(10000.111),s=Tg.map(e=>i.formatToParts(e)),c=a.find(e=>e.type===`minusSign`)?.value??`-`,l=o.find(e=>e.type===`plusSign`)?.value;!l&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(l=`+`);let u=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(e=>e.type===`decimal`)?.value,d=a.find(e=>e.type===`group`)?.value,f=a.filter(e=>!wg.has(e.type)).map(e=>Og(e.value)),p=s.flatMap(e=>e.filter(e=>!wg.has(e.type)).map(e=>Og(e.value))),m=[...new Set([...f,...p])].sort((e,t)=>t.length-e.length),h=m.length===0?RegExp(`[\\p{White_Space}]`,`gu`):RegExp(`${m.join(`|`)}|[\\p{White_Space}]`,`gu`),g=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),_=new Map(g.map((e,t)=>[e,t])),v=RegExp(`[${g.join(``)}]`,`g`);return{minusSign:c,plusSign:l,decimal:u,group:d,literals:h,numeral:v,index:e=>String(_.get(e))}}function Dg(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function Og(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function kg(e){let{disabled:t}=e,n=F(),r=Bu(),i=()=>window.clearTimeout(n.value),a=e=>{i(),!t.value&&(r.trigger(),n.value=window.setTimeout(()=>{a(60)},e))},o=()=>{a(400)},s=()=>{i()},c=F(!1),l=W(()=>ad(e.target)),u=e=>{e.button!==0||c.value||(e.preventDefault(),c.value=!0,o())},d=()=>{c.value=!1,s()};return Hu&&(od(l||window,`pointerdown`,u),od(window,`pointerup`,d),od(window,`pointercancel`,d)),{isPressed:c,onTrigger:r.on}}function Ag(e,t=F({})){return Qu(()=>new mg(e.value,t.value))}function jg(e,t=F({})){return Qu(()=>new yg(e.value,t.value))}function Mg(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var[Ng,Pg]=Pu(`NumberFieldRoot`),Fg=R({inheritAttrs:!1,__name:`NumberFieldRoot`,props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i,readonly:a,disableWheelChange:o,invertWheelChange:s,min:c,max:l,step:u,stepSnapping:d,formatOptions:f,id:p,locale:m}=gn(n),h=pd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:g,currentElement:_}=yf(),v=sf(m),y=Fd(_),b=F(),x=W(()=>Lu(h.value)||isNaN(h.value)?!1:C(`decrease`,h.value)>=h.value),S=W(()=>Lu(h.value)||isNaN(h.value)?!1:C(`increase`,h.value)<=h.value);function C(e,t,n=1){let r=u.value??1,i=e===`increase`?`+`:`-`,a;if(d.value&&!isNaN(r)){let o=Nu(t,c.value,l.value,r);if(o===t)a=Mg(i,t,r*n);else{let s=e===`increase`?o>t?o:Mg(`+`,o,r):o1?Mg(i,s,r*(n-1)):s}}else a=Mg(i,t,r*n);return M(a)}function w(e,t=1){if(n.focusOnChange&&b.value?.focus(),n.disabled||n.readonly)return;let r=ee.parse(b.value?.value??``);if(isNaN(r)){h.value=M(c.value??0);return}h.value=C(e,r,t)}function T(e=1){w(`increase`,e)}function E(e=1){w(`decrease`,e)}function D(e){e===`min`&&c.value!==void 0?h.value=M(c.value):e===`max`&&l.value!==void 0&&(h.value=M(l.value))}let O=Ag(v,f),ee=jg(v,f),k=W(()=>O.resolvedOptions().maximumFractionDigits>0?`decimal`:`numeric`),A=Ag(v,f),te=W(()=>Lu(h.value)||isNaN(h.value)?``:A.format(h.value));function j(e){return ee.isValidPartialNumber(e,c.value,l.value)}function ne(e){b.value&&(b.value.value=e)}function M(e){let t;return t=u.value===void 0||isNaN(u.value)||!d.value?ju(e,c.value,l.value):Nu(e,c.value,l.value,u.value),t=ee.parse(O.format(t)),t}function N(e){let t=ee.parse(e);return h.value=isNaN(t)?void 0:M(t),e.length?ne(te.value):ne(e)}return Pg({modelValue:h,handleDecrease:E,handleIncrease:T,handleMinMaxValue:D,inputMode:k,inputEl:b,onInputElement:e=>b.value=e,textValue:te,readonly:a,validate:j,applyInputValue:N,disabled:i,disableWheelChange:o,invertWheelChange:s,max:l,min:c,isDecreaseDisabled:x,isIncreaseDisabled:S,id:p}),(e,t)=>(B(),V(I(vf),ks(e.$attrs,{ref_key:`primitiveElement`,ref:g,role:`group`,as:e.as,"as-child":e.asChild,"data-disabled":I(i)?``:void 0,"data-readonly":I(a)?``:void 0}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(h),textValue:te.value,readonly:I(a)}),I(y)&&e.name?(B(),V(I(Yf),{key:0,type:`text`,value:I(h),name:e.name,disabled:I(i),readonly:I(a),required:e.required},null,8,[`value`,`name`,`disabled`,`readonly`,`required`])):Ts(`v-if`,!0)]),_:3},16,[`as`,`as-child`,`data-disabled`,`data-readonly`]))}}),Ig=R({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Ng(),r=W(()=>n.disabled?.value||n.readonly.value||t.disabled||n.isDecreaseDisabled.value),{primitiveElement:i,currentElement:a}=yf(),{isPressed:o,onTrigger:s}=kg({target:a,disabled:r});return s(()=>{n.handleDecrease()}),(e,n)=>(B(),V(I(vf),ks(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Decrease`,type:e.as===`button`?`button`:void 0,style:{userSelect:I(o)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":I(o)?`true`:void 0,onContextmenu:n[0]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Lg=R({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Ng(),r=W(()=>n.disabled?.value||n.readonly.value||t.disabled||n.isIncreaseDisabled.value),{primitiveElement:i,currentElement:a}=yf(),{isPressed:o,onTrigger:s}=kg({target:a,disabled:r});return s(()=>{n.handleIncrease()}),(e,n)=>(B(),V(I(vf),ks(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Increase`,type:e.as===`button`?`button`:void 0,style:{userSelect:I(o)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":I(o)?`true`:void 0,onContextmenu:n[0]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Rg=R({__name:`NumberFieldInput`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=yf(),i=Ng(),a=of(),{isComposing:o,handleCompositionStart:s,handleCompositionEnd:c}=kd();function l(e){if(!(o.value||e.isComposing))switch(e.key){case a.ARROW_UP:e.preventDefault(),i.handleIncrease();break;case a.ARROW_DOWN:e.preventDefault(),i.handleDecrease();break;case a.PAGE_UP:e.preventDefault(),i.handleIncrease(10);break;case a.PAGE_DOWN:e.preventDefault(),i.handleDecrease(10);break;case a.HOME:e.preventDefault(),i.handleMinMaxValue(`min`);break;case a.END:e.preventDefault(),i.handleMinMaxValue(`max`);break;case a.ENTER:i.applyInputValue(e.target?.value)}}function u(e){i.disableWheelChange.value||e.target===Fu()&&(Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),e.deltaY>0?i.invertWheelChange.value?i.handleDecrease():i.handleIncrease():e.deltaY<0&&(i.invertWheelChange.value?i.handleIncrease():i.handleDecrease())))}Ji(()=>{i.onInputElement(r.value)});let d=F(i.textValue.value);Cr(()=>i.textValue.value,()=>{d.value=i.textValue.value},{immediate:!0,deep:!0});function f(){requestAnimationFrame(()=>{d.value=i.textValue.value})}return(e,r)=>(B(),V(I(vf),ks(t,{id:I(i).id.value,ref_key:`primitiveElement`,ref:n,value:d.value,role:`spinbutton`,type:`text`,tabindex:`0`,inputmode:I(i).inputMode.value,disabled:I(i).disabled.value?``:void 0,"data-disabled":I(i).disabled.value?``:void 0,readonly:I(i).readonly.value?``:void 0,"data-readonly":I(i).readonly.value?``:void 0,autocomplete:`off`,autocorrect:`off`,spellcheck:`false`,"aria-roledescription":`Number field`,"aria-valuenow":I(i).modelValue.value,"aria-valuemin":I(i).min.value,"aria-valuemax":I(i).max.value,onKeydown:l,onWheel:u,onBeforeinput:r[0]||=e=>{if(e.isComposing||e.inputType.startsWith(`delete`)||e.inputType.startsWith(`history`))return;let t=e.target,n=t.value.slice(0,t.selectionStart??void 0)+(e.data??``)+t.value.slice(t.selectionEnd??void 0);I(i).validate(n)||e.preventDefault()},onInput:r[1]||=e=>{let t=e.target;d.value=t.value},onChange:f,onBlur:r[2]||=e=>I(i).applyInputValue(e.target?.value),onCompositionstart:I(s),onCompositionend:I(c)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`value`,`inputmode`,`disabled`,`data-disabled`,`readonly`,`data-readonly`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`onCompositionstart`,`onCompositionend`]))}}),zg=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Bg=[` `,`Enter`];function Vg(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>Hg(e,t,n)):Hg(e,t,n)}function Hg(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Au(e,t)}function Ug(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var Wg=[`value`],[Gg,Kg]=Pu(`SelectRoot`),qg=R({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=gn(n),c=pd(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=F(),d=F(),f=F({x:0,y:0}),p=W(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:Lu(c.value));Kf({isProvider:!0});let m=Ad(s),h=Fd(u),g=F(new Set),_=W(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>Hg(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>Vg(e,t.value,n.by))}return Kg({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{modelValue:I(c),open:I(l)}),I(h)&&e.name?(B(),V(Jg,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:I(o),required:I(i),name:e.name,autocomplete:e.autocomplete,disabled:I(a),value:I(c)},{default:L(()=>[I(Lu)(I(c))?(B(),ms(`option`,{key:0,value:e.nullableValue},null,8,Wg)):Ts(`v-if`,!0),(B(!0),ms(is,null,da(Array.from(g.value),e=>(B(),ms(`option`,ks({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):Ts(`v-if`,!0)]),_:3}))}}),Jg=R({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=F(),r=Gg();Cr(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(B(),V(I(qf),{"as-child":``},{default:L(()=>[H(`select`,ks({ref_key:`selectElement`,ref:n},t,{onInput:i}),[z(e.$slots,`default`)],16)]),_:3}))}}),Yg=R({__name:`SelectPopperPosition`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Ld(e);return(e,n)=>(B(),V(I(_h),ks(I(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Xg={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[Zg,Qg]=Pu(`SelectContent`),$g=R({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Gg();Nd(),Cd(n.bodyLock);let{CollectionSlot:a,getItems:o}=Kf(),s=F();nf(s);let{search:c,handleTypeaheadSearch:l}=uf(),u=F(),d=F(),f=F(),p=F(!1),m=F(!1),h=F(!1);function g(){d.value&&s.value&&Uf([d.value,s.value])}Cr(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;br(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>Uf(t)),e.preventDefault()}}let b=Ld(W(()=>n.position===`popper`?n:{}).value);return Qg({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=Vg(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else(a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(Vg(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(B(),V(I(a),null,{default:L(()=>[U(I(zf),{"as-child":``,onMountAutoFocus:t[6]||=au(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(I(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:L(()=>[U(I(Tf),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=au(()=>{},[`prevent`]),onDismiss:t[3]||=e=>I(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:L(()=>[(B(),V(sa(e.position===`popper`?Yg:n_),ks({...e.$attrs,...I(b)},{id:I(i).contentId,ref:e=>{if(!e)return;let t=I(ad)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":I(i).open.value?`open`:`closed`,dir:I(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=au(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[e_,t_]=Pu(`SelectItemAlignedPosition`),n_=R({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=Kf(),a=Gg(),o=Zg(),s=F(!1),c=F(!0),l=F(),{forwardRef:u,currentElement:d}=Id(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=ju(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=ju(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),E=e.top+e.height/2-10,D=u-E,O=p.value.offsetHeight/2,ee=p.value.offsetTop+O,k=_+v+ee,A=x-k;if(k<=E){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=k+Math.max(D,O+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(E,_+f.value.offsetTop+(e?w:0)+O)+A;l.value.style.height=`${t}px`,f.value.scrollTop=k-E+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=F(``);Ji(async()=>{await Yn(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return fd(a.triggerElement,()=>{g()}),t_({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(B(),ms(`div`,{ref_key:`contentWrapperElement`,ref:l,style:ue({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[U(I(vf),ks({ref:I(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)],4))}}),r_=R({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return Kg(e.context),Qg(Xg),(e,t)=>z(e.$slots,`default`)}}),i_={key:1},a_=R({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Rd(n,t),i=Gg(),a=F();Ji(()=>{a.value=new DocumentFragment});let o=F(),s=W(()=>n.forceMount||i.open.value),c=F(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return Cr(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),Qi(u),(e,t)=>s.value||c.value||o.value?.present?(B(),V(I(hf),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:L(()=>[U($g,ge(xs({...I(r),...e.$attrs})),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(B(),ms(`div`,i_,[(B(),V(Rr,{to:a.value},[U(r_,{context:I(i)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):Ts(`v-if`,!0)}}),o_=R({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),V(I(vf),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:L(()=>[z(e.$slots,`default`,{},()=>[t[0]||=Cs(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[s_,c_]=Pu(`SelectItem`),l_=R({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=gn(n),a=Gg(),o=Zg(),{forwardRef:s,currentElement:c}=Id(),{CollectionItem:l}=Kf(),u=W(()=>Vg(a.modelValue?.value,n.value,a.by)),d=F(!1),f=F(n.textValue??``),p=af(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||Iu(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await Yn(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await Yn(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await Yn(),!e.defaultPrevented&&e.currentTarget===Fu()&&o.onItemLeave?.()}async function v(e){await Yn(),!e.defaultPrevented&&(o.searchRef?.value===``||e.key!==` `)&&(Bg.includes(e.key)&&m(e),e.key===` `&&e.preventDefault())}if(n.value===``)throw Error(`A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Ji(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),c_({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(B(),V(I(l),{value:{textValue:f.value}},{default:L(()=>[U(I(vf),{ref:I(s),role:`option`,"aria-labelledby":I(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":I(i)||void 0,"data-disabled":I(i)?``:void 0,tabindex:I(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=au(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),u_=R({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=s_();return(e,r)=>I(n).isSelected.value?(B(),V(I(vf),ks({key:0,"aria-hidden":`true`},t),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)):Ts(`v-if`,!0)}}),d_=R({inheritAttrs:!1,__name:`SelectItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Gg(),r=Zg(),i=s_(),{forwardRef:a,currentElement:o}=Id(),s=W(()=>({value:i.value,disabled:i.disabled.value,textContent:o.value?.textContent??i.value?.toString()??``}));return Ji(()=>{o.value&&(i.onItemTextChange(o.value),r.itemTextRefCallback(o.value,i.value,i.disabled.value),n.onOptionAdd(s.value))}),Qi(()=>{n.onOptionRemove(s.value)}),(e,n)=>(B(),V(I(vf),ks({id:I(i).textId,ref:I(a)},{...t,...e.$attrs}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`]))}}),f_=R({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),p_=R({__name:`SelectScrollButtonImpl`,emits:[`autoScroll`],setup(e,{emit:t}){let n=t,{getItems:r}=Kf(),i=Zg(),a=F(null);function o(){a.value!==null&&(window.clearInterval(a.value),a.value=null)}br(()=>{r().map(e=>e.ref).find(e=>e===Fu())?.scrollIntoView({block:`nearest`})});function s(){a.value===null&&(a.value=window.setInterval(()=>{n(`autoScroll`)},50))}function c(){i.onItemLeave?.(),a.value===null&&(a.value=window.setInterval(()=>{n(`autoScroll`)},50))}return Zi(()=>o()),(e,t)=>(B(),V(I(vf),ks({"aria-hidden":`true`,style:{flexShrink:0}},e.$parent?.$props,{onPointerdown:s,onPointermove:c,onPointerleave:t[0]||=()=>{o()}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),m_=R({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Zg(),n=t.position===`item-aligned`?e_():void 0,{forwardRef:r,currentElement:i}=Id(),a=F(!1);return br(e=>{if(t.viewport?.value&&t.isPositioned?.value){let n=t.viewport.value;function r(){let e=n.scrollHeight-n.clientHeight;a.value=Math.ceil(n.scrollTop)n.removeEventListener(`scroll`,r))}}),Cr(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(B(),V(p_,{key:0,ref:I(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=I(t);e?.value&&n?.value&&(e.value.scrollTop=e.value.scrollTop+n.value.offsetHeight)}},{default:L(()=>[z(e.$slots,`default`)]),_:3},512)):Ts(`v-if`,!0)}}),h_=R({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Zg(),n=t.position===`item-aligned`?e_():void 0,{forwardRef:r,currentElement:i}=Id(),a=F(!1);return br(e=>{if(t.viewport?.value&&t.isPositioned?.value){let n=t.viewport.value;function r(){a.value=n.scrollTop>0}r(),n.addEventListener(`scroll`,r),e(()=>n.removeEventListener(`scroll`,r))}}),Cr(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(B(),V(p_,{key:0,ref:I(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=I(t);e?.value&&n?.value&&(e.value.scrollTop=e.value.scrollTop-n.value.offsetHeight)}},{default:L(()=>[z(e.$slots,`default`)]),_:3},512)):Ts(`v-if`,!0)}}),g_=R({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Gg(),{forwardRef:r,currentElement:i}=Id(),a=W(()=>n.disabled?.value||t.disabled);n.contentId||=af(void 0,`reka-select-content`),Ji(()=>{n.onTriggerChange(i.value)});let{getItems:o}=Kf(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=uf();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}function f(e){return e.button===0&&e.ctrlKey===!1}let p=!1;function m(e){if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),f(e)&&(d(e),p=!0)}function h(e){f(e)&&e.preventDefault()}function g(e){p||e.currentTarget?.focus(),p=!1}return(e,t)=>(B(),V(I(ip),{"as-child":``,reference:e.reference},{default:L(()=>[U(I(vf),{ref:I(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":I(n).contentId,"aria-expanded":I(n).open.value||!1,"aria-required":I(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:I(n)?.dir.value,"data-state":I(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":I(Ug)(I(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:g,onPointerdown:m,onMousedown:h,onPointerup:t[0]||=au(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[1]||=e=>{let t=I(s)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(I(c)(e.key,I(o)()),I(zg).includes(e.key)&&(u(),e.preventDefault()))}},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),__=R({__name:`SelectValue`,props:{placeholder:{type:String,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Id(),i=Gg();Ji(()=>{i.valueElement=r});let a=W(()=>{let e=[],t=Array.from(i.optionsSet.value),n=e=>t.find(t=>Vg(e,t.value,i.by));return e=Array.isArray(i.modelValue.value)?i.modelValue.value.map(e=>n(e)?.textContent??``):[n(i.modelValue.value)?.textContent??``],e.filter(Boolean)}),o=W(()=>a.value.length?a.value.join(`, `):t.placeholder);return(e,r)=>(B(),V(I(vf),{ref:I(n),as:e.as,"as-child":e.asChild,style:{pointerEvents:`none`},"data-placeholder":a.value.length?void 0:t.placeholder},{default:L(()=>[z(e.$slots,`default`,{selectedLabel:a.value,modelValue:I(i).modelValue.value},()=>[Cs(Ce(o.value),1)])]),_:3},8,[`as`,`as-child`,`data-placeholder`]))}}),v_=R({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=gn(t),r=vh(n),i=Zg(),a=i.position===`item-aligned`?e_():void 0,{forwardRef:o,currentElement:s}=Id();Ji(()=>{i?.onViewportChange(s.value)});let c=F(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(B(),ms(is,null,[U(I(vf),ks({ref:I(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16),U(I(vf),{as:`style`,nonce:I(r)},{default:L(()=>n[0]||=[Cs(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[y_,b_]=Pu(`TooltipProvider`),x_=R({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=gn(e);Id();let c=F(!0),l=F(!1),{start:u,stop:d}=nd(()=>{c.value=!0},n,{immediate:!1});return b_({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>z(e.$slots,`default`)}}),S_=`tooltip.open`,[C_,w_]=Pu(`TooltipRoot`),T_=R({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Id();let i=y_(),a=W(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=W(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=W(()=>n.disabled??i.disabled.value),c=W(()=>n.delayDuration??i.delayDuration.value),l=W(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});Cr(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(S_))):i.onClose())});let d=F(!1),f=F(),p=W(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:m,stop:h}=nd(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function g(){h(),d.value=!1,u.value=!0}function _(){h(),u.value=!1}function v(){m()}return w_({contentId:``,open:u,stateAttribute:p,trigger:f,onTriggerChange(e){f.value=e},onTriggerEnter(){i.isOpenDelayed.value?v():g()},onTriggerLeave(){a.value?_():h()},onOpen:g,onClose:_,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{open:I(u)})]),_:3}))}}),E_=R({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=C_(),a=y_(),{forwardRef:o,currentElement:s}=Id(),c=W(()=>n.ariaLabel||s.value?.textContent),l=W(()=>{let{ariaLabel:e,...t}=n;return xd(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return Ji(()=>{od(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),od(window,S_,i.onClose)}),(e,t)=>(B(),V(I(Tf),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{I(i).disableClosingTrigger.value&&I(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=au(()=>{},[`prevent`]),onDismiss:t[3]||=e=>I(i).onClose()},{default:L(()=>[U(I(_h),ks({ref:I(o),"data-state":I(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:L(()=>[z(e.$slots,`default`),U(I(qf),{id:I(i).contentId,role:`tooltip`},{default:L(()=>[Cs(Ce(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),D_=R({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=Ld(e),{forwardRef:n,currentElement:r}=Id(),{trigger:i,onClose:a}=C_(),o=y_(),{isPointerInTransit:s,onPointerExit:c}=Bd(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(B(),V(E_,ks({ref:I(n)},I(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),O_=R({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=C_(),a=Rd(n,r),{forwardRef:o}=Id();return(e,t)=>(B(),V(I(hf),{present:e.forceMount||I(i).open.value},{default:L(()=>[(B(),V(sa(I(i).disableHoverableContent.value?E_:D_),ks({ref:I(o)},I(a)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),k_=R({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),A_=R({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=C_(),r=y_();n.contentId||=af(void 0,`reka-tooltip-content`);let{forwardRef:i,currentElement:a}=Id(),o=F(!1),s=F(!1),c=W(()=>n.disabled.value?{}:{click:h,focus:p,pointermove:d,pointerleave:f,pointerdown:u,blur:m});Ji(()=>{n.onTriggerChange(a.value)});function l(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener(`pointerup`,l,{once:!0})}function d(e){e.pointerType!==`touch`&&!s.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function f(){n.onTriggerLeave(),s.value=!1}function p(e){o.value||n.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||n.onOpen()}function m(){n.onClose()}function h(){n.disableClosingTrigger.value||n.onClose()}return(e,r)=>(B(),V(I(ip),{"as-child":``,reference:e.reference},{default:L(()=>[U(I(vf),ks({ref:I(i),"aria-describedby":I(n).open.value?I(n).contentId:void 0,"data-state":I(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},ma(c.value)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),j_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),N_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),P_=`-`,F_=[],I_=`arbitrary..`,L_=e=>{let t=B_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return z_(e);let n=e.split(P_);return R_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?j_(i,t):t:i||F_}return n[e]||F_}}},R_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=R_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(P_):e.slice(t).join(P_),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?I_+r:void 0})(),B_=e=>{let{theme:t,classGroups:n}=e;return V_(n,t)},V_=(e,t)=>{let n=N_();for(let r in e){let i=e[r];H_(i,n,r,t)}return n},H_=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){W_(e,t,n);return}if(typeof e==`function`){G_(e,t,n,r);return}K_(e,t,n,r)},W_=(e,t,n)=>{let r=e===``?t:q_(t,e);r.classGroupId=n},G_=(e,t,n,r)=>{if(J_(e)){H_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(M_(n,e))},K_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(P_),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Y_=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},X_=`!`,Z_=`:`,Q_=[],$_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ev=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return $_(t,l,c,u)};if(t){let e=t+Z_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):$_(Q_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},tv=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},nv=e=>({cache:Y_(e.cacheSize),parseClassName:ev(e),sortModifiers:tv(e),postfixLookupClassGroupIds:rv(e),...L_(e)}),rv=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(iv),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+X_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},ov=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=nv(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=av(e,n);return i(e,a),a};return a=o,(...e)=>a(ov(...e))},lv=[],uv=e=>{let t=t=>t[e]||lv;return t.isThemeGetter=!0,t},dv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pv=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,mv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_v=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yv=e=>pv.test(e),bv=e=>!!e&&!Number.isNaN(Number(e)),xv=e=>!!e&&Number.isInteger(Number(e)),Sv=e=>e.endsWith(`%`)&&bv(e.slice(0,-1)),Cv=e=>mv.test(e),wv=()=>!0,Tv=e=>hv.test(e)&&!gv.test(e),Ev=()=>!1,Dv=e=>_v.test(e),Ov=e=>vv.test(e),kv=e=>!G(e)&&!K(e),Av=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),jv=e=>Kv(e,Xv,Ev),G=e=>dv.test(e),Mv=e=>Kv(e,Zv,Tv),Nv=e=>Kv(e,Qv,bv),Pv=e=>Kv(e,ey,wv),Fv=e=>Kv(e,$v,Ev),Iv=e=>Kv(e,Jv,Ev),Lv=e=>Kv(e,Yv,Ov),Rv=e=>Kv(e,ty,Dv),K=e=>fv.test(e),zv=e=>qv(e,Zv),Bv=e=>qv(e,$v),Vv=e=>qv(e,Jv),Hv=e=>qv(e,Xv),Uv=e=>qv(e,Yv),Wv=e=>qv(e,ty,!0),Gv=e=>qv(e,ey,!0),Kv=(e,t,n)=>{let r=dv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qv=(e,t,n=!1)=>{let r=fv.exec(e);return r?r[1]?t(r[1]):n:!1},Jv=e=>e===`position`||e===`percentage`,Yv=e=>e===`image`||e===`url`,Xv=e=>e===`length`||e===`size`||e===`bg-size`,Zv=e=>e===`length`,Qv=e=>e===`number`,$v=e=>e===`family-name`,ey=e=>e===`number`||e===`weight`,ty=e=>e===`shadow`,ny=cv(()=>{let e=uv(`color`),t=uv(`font`),n=uv(`text`),r=uv(`font-weight`),i=uv(`tracking`),a=uv(`leading`),o=uv(`breakpoint`),s=uv(`container`),c=uv(`spacing`),l=uv(`radius`),u=uv(`shadow`),d=uv(`inset-shadow`),f=uv(`text-shadow`),p=uv(`drop-shadow`),m=uv(`blur`),h=uv(`perspective`),g=uv(`aspect`),_=uv(`ease`),v=uv(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[yv,`full`,`auto`,...w()],E=()=>[xv,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,xv,K,G]},xv,K,G],O=()=>[xv,`auto`,K,G],ee=()=>[`auto`,`min`,`max`,`fr`,K,G],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],te=()=>[`auto`,...w()],j=()=>[yv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[yv,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[yv,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,K,G],re=()=>[...b(),Vv,Iv,{position:[K,G]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Hv,jv,{size:[K,G]}],oe=()=>[Sv,zv,Mv],se=()=>[``,`none`,`full`,l,K,G],ce=()=>[``,bv,zv,Mv],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[bv,Sv,Vv,Iv],fe=()=>[``,`none`,m,K,G],pe=()=>[`none`,bv,K,G],me=()=>[`none`,bv,K,G],he=()=>[bv,K,G],ge=()=>[yv,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Cv],breakpoint:[Cv],color:[wv],container:[Cv],"drop-shadow":[Cv],ease:[`in`,`out`,`in-out`],font:[kv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Cv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Cv],shadow:[Cv],spacing:[`px`,bv],text:[Cv],"text-shadow":[Cv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,yv,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[Av],columns:[{columns:[bv,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[xv,`auto`,K,G]}],basis:[{basis:[yv,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[bv,yv,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,bv,K,G]}],shrink:[{shrink:[``,bv,K,G]}],order:[{order:[xv,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,zv,Mv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gv,Pv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Sv,G]}],"font-family":[{font:[Bv,Fv,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[bv,`none`,K,Nv]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[bv,`from-font`,`auto`,K,Mv]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[bv,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[xv,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},xv,K,G],radial:[``,K,G],conic:[xv,K,G]},Uv,Lv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[bv,K,G]}],"outline-w":[{outline:[``,bv,zv,Mv]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Wv,Rv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Wv,Rv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[bv,Mv]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Wv,Rv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[bv,K,G]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[bv]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[bv]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:fe()}],brightness:[{brightness:[bv,K,G]}],contrast:[{contrast:[bv,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Wv,Rv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,bv,K,G]}],"hue-rotate":[{"hue-rotate":[bv,K,G]}],invert:[{invert:[``,bv,K,G]}],saturate:[{saturate:[bv,K,G]}],sepia:[{sepia:[``,bv,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[bv,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[bv,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,bv,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bv,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,bv,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[bv,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[bv,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,bv,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[bv,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[bv,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[xv,K,G]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[bv,zv,Mv,Nv]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ry(...e){return ny(wu(e))}var iy=Symbol(`compas-viewer-runtime`);function ay(){let e=gr(iy);if(!e)throw Error(`COMPAS viewer runtime is not available in this component`);return e}var oy=R({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,{theme:n}=ay().store;return(r,i)=>(B(),V(I(vf),{"data-slot":`button`,as:e.as,"as-child":e.asChild,class:he(I(ry)(I(sy)({variant:e.variant,size:e.size}),t.class,{dark:I(n).value===`dark`}))},{default:L(()=>[z(r.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),sy=Du(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),cy=R({__name:`Select`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},nullableValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(qg),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),ly=R({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{default:`popper`},bodyLock:{type:Boolean},memoDependencies:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(t,r)=>(B(),V(I(f_),null,{default:L(()=>[U(I(a_),ks({...I(i),...t.$attrs},{class:I(ry)(`relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e.position===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,n.class)}),{default:L(()=>[U(I(Wy)),U(I(v_),{class:he(I(ry)(`p-1`,e.position===`popper`&&`h-(--reka-select-trigger-height) w-full min-w-(--reka-select-trigger-width)`))},{default:L(()=>[z(t.$slots,`default`)]),_:3},8,[`class`]),U(I(Uy))]),_:3},16,[`class`])]),_:3}))}}),uy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},dy=e=>e===``,fy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),py=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),my=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),hy=e=>{let t=my(e);return t.charAt(0).toUpperCase()+t.slice(1)},gy={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},_y=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o=gy.width,color:s=gy.stroke,...c},{slots:l})=>tc(`svg`,{...gy,...c,width:o,height:o,stroke:s,"stroke-width":dy(n)||dy(r)||n===!0||r===!0?Number(i||a||gy[`stroke-width`])*24/Number(o):i||a||gy[`stroke-width`],class:fy(`lucide`,c.class,...e?[`lucide-${py(hy(e))}-icon`,`lucide-${py(e)}`]:[`lucide-icon`]),...!l.default&&!uy(c)&&{"aria-hidden":`true`}},[...t.map(e=>tc(...e)),...l.default?[l.default()]:[]]),vy=(e,t)=>(n,{slots:r,attrs:i})=>tc(_y,{...i,...n,iconNode:t,name:e},r),yy=vy(`arrow-big-left-dash`,[[`path`,{d:`M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z`,key:`p8w4w5`}],[`path`,{d:`M20 9v6`,key:`14roy0`}]]),by=vy(`arrow-big-right-dash`,[[`path`,{d:`M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z`,key:`67vhrh`}],[`path`,{d:`M4 9v6`,key:`bns7oa`}]]),xy=vy(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Sy=vy(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Cy=vy(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wy=vy(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ty=vy(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ey=vy(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Dy=vy(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Oy=vy(`image-down`,[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),ky=vy(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Ay=vy(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),jy=vy(`move-3d`,[[`path`,{d:`M5 3v16h16`,key:`1mqmf9`}],[`path`,{d:`m5 19 6-6`,key:`jh6hbb`}],[`path`,{d:`m2 6 3-3 3 3`,key:`tkyvxa`}],[`path`,{d:`m18 16 3 3-3 3`,key:`1d4glt`}]]),My=vy(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Ny=vy(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Py=vy(`pointer-off`,[[`path`,{d:`M10 4.5V4a2 2 0 0 0-2.41-1.957`,key:`jsi14n`}],[`path`,{d:`M13.9 8.4a2 2 0 0 0-1.26-1.295`,key:`hirc7f`}],[`path`,{d:`M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158`,key:`1jxb2e`}],[`path`,{d:`m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343`,key:`10r7hm`}],[`path`,{d:`M6 6v8`,key:`tv5xkp`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Fy=vy(`pointer`,[[`path`,{d:`M22 14a8 8 0 0 1-8 8`,key:`56vcr3`}],[`path`,{d:`M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1agjmk`}],[`path`,{d:`M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1`,key:`wdbh2u`}],[`path`,{d:`M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10`,key:`1ibuk9`}],[`path`,{d:`M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`g6ys72`}]]),Iy=vy(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),Ly=vy(`rotate-3d`,[[`path`,{d:`M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2`,key:`10n0gc`}],[`path`,{d:`m15.194 13.707 3.814 1.86-1.86 3.814`,key:`16shm9`}],[`path`,{d:`M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4`,key:`1lxi77`}]]),Ry=vy(`scale-3d`,[[`path`,{d:`M5 7v11a1 1 0 0 0 1 1h11`,key:`13dt1j`}],[`path`,{d:`M5.293 18.707 11 13`,key:`ezgbsx`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,key:`1gwv83`}]]),zy=vy(`sun-medium`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 3v1`,key:`1asbbs`}],[`path`,{d:`M12 20v1`,key:`1wcdkc`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M20 12h1`,key:`1vloll`}],[`path`,{d:`m18.364 5.636-.707.707`,key:`1hakh0`}],[`path`,{d:`m6.343 17.657-.707.707`,key:`18m9nf`}],[`path`,{d:`m5.636 5.636.707.707`,key:`1xv1c5`}],[`path`,{d:`m17.657 17.657.707.707`,key:`vl76zb`}]]),By=vy(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Vy={class:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`},Hy=R({__name:`SelectItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(l_),ks(I(n),{class:I(ry)(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t.class)}),{default:L(()=>[H(`span`,Vy,[U(I(u_),null,{default:L(()=>[U(I(Cy),{class:`h-4 w-4`})]),_:1})]),U(I(d_),null,{default:L(()=>[z(e.$slots,`default`)]),_:3})]),_:3},16,[`class`]))}}),Uy=R({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(m_),ks(I(n),{class:I(ry)(`flex cursor-default items-center justify-center py-1`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(wy))])]),_:3},16,[`class`]))}}),Wy=R({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(h_),ks(I(n),{class:I(ry)(`flex cursor-default items-center justify-center py-1`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Ty))])]),_:3},16,[`class`]))}}),Gy=R({__name:`SelectTrigger`,props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(g_),ks(I(n),{class:I(ry)(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start`,t.class)}),{default:L(()=>[z(e.$slots,`default`),U(I(o_),{"as-child":``},{default:L(()=>[U(I(wy),{class:`w-4 h-4 opacity-50 shrink-0`})]),_:1})]),_:3},16,[`class`]))}}),Ky=R({__name:`SelectValue`,props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(__),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}});function qy(e){let t=F(!1);function n(n){let r=e.value;t.value=r!==null&&r.matches(`:hover`)}return Ji(()=>{window.addEventListener(`mousemove`,n)}),Qi(()=>{window.removeEventListener(`mousemove`,n)}),{isHovered:t}}var Jy={class:`right-bar`},Yy={id:`data-container`},Xy={class:`metadata item`},Zy={class:`data-container`},Qy=R({__name:`ObjectInfo`,setup(e){let t=ay(),{objectActionsState:n,objectBarData:r,blockPicker:i,theme:a}=t.store,o=(e,n)=>t.handleObjectAction({...e},n),s=F(null),{isHovered:c}=qy(s);br(()=>{i.value=c.value&&r.isVisible});let l=()=>{r.isVisible=!r.isVisible};return(e,t)=>(B(),ms(`div`,Jy,[H(`div`,{class:he([`theme object-info`,{"is-hidden":!I(r).isVisible}]),id:`info-panel`,ref_key:`infoPanel`,ref:s},[H(`div`,Yy,[H(`div`,Xy,[H(`h1`,{class:he([`text-lg font-bold section-title`,{dark:I(a).value===`dark`}])},` METADATA `,2),(B(!0),ms(is,null,da(I(r).data,(e,t)=>(B(),ms(`div`,{key:t,class:`data-entry`},[H(`p`,null,[H(`strong`,null,Ce(t)+`:`,1),Cs(` `+Ce(e),1)])]))),128))])]),H(`div`,Zy,[H(`h1`,{class:he([`text-lg font-bold section-title`,{dark:I(a).value===`dark`}])},` FUNCTIONS `,2),(B(!0),ms(is,null,da(I(n),e=>(B(),ms(`div`,{key:e.guid,class:`single_data`},[e.type===`button`?(B(),V(I(oy),{key:0,variant:`outline`,onClick:t=>o(e),class:`w-full`},{default:L(()=>[Cs(Ce(e.text),1)]),_:2},1032,[`onClick`])):e.type===`select`?(B(),V(I(cy),{key:1,"model-value":typeof e.defaultValue==`string`?e.defaultValue:``,"onUpdate:modelValue":t=>{e.defaultValue=typeof t==`string`?t:``,o(e,t)}},{default:L(()=>[U(I(Gy),{class:`w-full`},{default:L(()=>[U(I(Ky),{placeholder:e.placeholder??`Select an option`},null,8,[`placeholder`])]),_:2},1024),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(!0),ms(is,null,da(e.options,e=>(B(),V(I(Hy),{key:e,value:e},{default:L(()=>[Cs(Ce(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])):Ts(``,!0)]))),128))]),U(I(oy),{variant:`secondary`,size:`icon`,id:`closeObjectBar`,onClick:t[0]||=e=>l()},{default:L(()=>[U(I(by))]),_:1})],2),U(I(oy),{variant:`secondary`,size:`icon`,id:`openObjectBar`,class:he({"is-hidden":!I(r).isVisible}),onClick:t[1]||=e=>l()},{default:L(()=>[U(I(yy))]),_:1},8,[`class`])]))}}),$y=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},eb=$y(Qy,[[`__scopeId`,`data-v-2390ba1f`]]);function tb(e){if(e.ctrlKey||e.metaKey||e.altKey)return!0;let t=e.target;if(!t)return!1;let n=t.tagName;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable}function nb(e){let{root:t}=ay(),n=t=>{if(tb(t))return;let n=e[t.key.toLowerCase()];n&&(t.preventDefault(),n(t))};Ji(()=>{t.addEventListener(`keydown`,n)}),Zi(()=>{t.removeEventListener(`keydown`,n)})}var rb=R({__name:`Kbd`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),ms(`kbd`,{class:he(I(ry)(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,t.class))},[z(e.$slots,`default`)],2))}}),ib=R({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(T_),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),ab=R({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r),{theme:a}=ay().store;return(e,t)=>(B(),V(I(k_),null,{default:L(()=>[U(I(O_),ks({...I(i),...e.$attrs},{class:I(ry)(`z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n.class,{dark:I(a).value===`dark`})}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),ob=R({__name:`TooltipProvider`,props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(x_),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),sb=R({__name:`TooltipTrigger`,props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(A_),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),cb=R({__name:`MoveButton`,setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`translate`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he({active:I(r).value==`translate`,disabled:!I(n).value}),onClick:i,disabled:!I(n).value},{default:L(()=>[U(I(jy))]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Move mode `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`W`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),lb=R({__name:`RotateButton`,setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`rotate`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he({active:I(r).value==`rotate`,disabled:!I(n).value}),onClick:i,disabled:!I(n).value},{default:L(()=>[U(I(Ly),{size:16,"stroke-width":2,"aria-hidden":`true`})]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Rotate mode `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`E`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ub={class:`button-icon`},db=R({__name:`ScaleButton`,props:{active:{type:Boolean}},emits:[`activated`],setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`scale`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he([`toolbar-button`,{active:I(r).value==`scale`,disabled:!I(n).value}]),onClick:i,disabled:!I(n).value},{default:L(()=>[H(`span`,ub,[U(I(Ry),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Rotate mode `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`R`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),fb={key:0},pb={key:1},mb=R({__name:`EnablePicker`,setup(e){let{pickerEnabled:t}=ay().store;function n(){t.value=!t.value}return(e,r)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:n,class:he({active:!I(t).value})},{default:L(()=>[I(t).value?(B(),ms(`span`,fb,[U(I(Fy))])):(B(),ms(`span`,pb,[U(I(Py))]))]),_:1},8,[`class`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[r[1]||=Cs(`Enable/Disable object selection `,-1),U(I(rb),null,{default:L(()=>[...r[0]||=[Cs(`P`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),hb={class:`toolbar-group`},gb=R({__name:`TransformGroup`,setup(e){let t=F(null),n=ay();function r(e){t.value=e}return nb({w:()=>{n.setTransformMode(`translate`),r(`move`)},e:()=>{n.setTransformMode(`rotate`),r(`rotate`)},r:()=>{n.setTransformMode(`scale`),r(`scale`)}}),(e,n)=>(B(),ms(`div`,hb,[U(I(mb),{active:t.value===`move`,onActivated:n[0]||=e=>r(`move`)},null,8,[`active`]),U(I(cb),{active:t.value===`move`,onActivated:n[1]||=e=>r(`move`)},null,8,[`active`]),U(I(lb),{active:t.value===`rotate`,onActivated:n[2]||=e=>r(`rotate`)},null,8,[`active`]),U(I(db),{active:t.value===`scale`,onActivated:n[3]||=e=>r(`scale`)},null,8,[`active`])]))}}),_b=R({__name:`TopViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`top`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[U(I(My))]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Top view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`5`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),vb=R({__name:`FrontViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`front`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:n},{default:L(()=>[U(I(Dy))]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Front view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`2`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),yb={class:`button-icon`},bb=R({__name:`RightViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`right`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[H(`span`,yb,[U(I(Iy),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Right view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`6`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),xb={class:`button-icon`},Sb=R({__name:`PerspectiveViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`front_right`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[H(`span`,xb,[U(I(xy),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Perspective view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`3`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),Cb={class:`toolbar-group`},wb=R({__name:`ViewGroup`,setup(e){let t=ay();return nb({2:()=>{t.setCameraViewPreset(`front`)},3:()=>{t.setCameraViewPreset(`front_right`)},5:()=>{t.setCameraViewPreset(`top`)},6:()=>{t.setCameraViewPreset(`right`)}}),(e,t)=>(B(),ms(`div`,Cb,[U(I(_b)),U(I(vb)),U(I(bb)),U(I(Sb))]))}}),Tb={class:`button-icon save-view-icon`},Eb={class:`save-view-overlay`,"aria-hidden":`true`},Db=$y(R({__name:`SaveViewButton`,props:{defaultName:{}},emits:[`saved`],setup(e,{emit:t}){let n=e,r=ay(),i=t;function a(){let e=window.prompt(`Name for saved view`,n.defaultName);if(e===null)return;let t=e.trim()||n.defaultName,a=r.captureCurrentView(t);i(`saved`,a)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:a},{default:L(()=>[H(`span`,Tb,[U(I(Sy),{size:15,"stroke-width":2,"aria-hidden":`true`}),H(`span`,Eb,[U(I(Ny),{class:`save-view-overlay-icon`})])])]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Save Current View `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`S`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),[[`__scopeId`,`data-v-c0eebdad`]]),Ob=R({__name:`Popover`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(rg),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),kb=R({__name:`PopoverTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(lg),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Ab=R({inheritAttrs:!1,__name:`PopoverContent`,props:{forceMount:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r),{theme:a}=ay().store;return(e,t)=>(B(),V(I(cg),null,{default:L(()=>[U(I(sg),ks({...I(i),...e.$attrs},{class:I(ry)(`z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n.class,{dark:I(a).value===`dark`})}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),jb={class:`inline-flex h-full w-full items-center justify-center`},Mb={class:`flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary`},Nb={key:0,disabled:``,value:``},Pb=[`value`],Fb=$y(R({__name:`SavedViewsButton`,props:{views:{},selectedViewId:{}},emits:[`select`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=F(!1),a=F(``),o=F(!1),s=null;Cr(()=>[n.selectedViewId,n.views],([e,t])=>{if(t.length===0){a.value=``;return}let n=t.some(t=>t.id===e);a.value=n?e:t[0]?.id??``},{immediate:!0});function c(){a.value&&r(`select`,a.value)}function l(){a.value&&(o.value=!0,s&&clearTimeout(s),s=setTimeout(()=>{o.value=!1,s=null},160),r(`delete`,a.value))}return Zi(()=>{s&&clearTimeout(s)}),(t,n)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(Ob),{open:i.value,"onUpdate:open":n[1]||=e=>i.value=e,modal:!0},{default:L(()=>[U(I(kb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[H(`span`,jb,[U(I(Ey))])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[...n[2]||=[H(`p`,null,`Saved views`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Ab),{class:`theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,Mb,[pr(H(`select`,{"onUpdate:modelValue":n[0]||=e=>a.value=e,class:`h-full min-w-0 flex-1 truncate border-0 bg-secondary px-3 py-1 text-sm text-secondary-foreground outline-none`,onChange:c},[e.views.length===0?(B(),ms(`option`,Nb,` No saved views `)):Ts(``,!0),(B(!0),ms(is,null,da(e.views,e=>(B(),ms(`option`,{key:e.id,value:e.id},Ce(e.name),9,Pb))),128))],544),[[Yl,a.value]]),U(I(ib),null,{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon-sm`,class:he([`h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]`,{"saved-view-delete-pressed":o.value}]),disabled:!a.value,onClick:au(l,[`stop`])},{default:L(()=>[U(I(By),{class:`h-3 w-3`})]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-[4100]`,side:`bottom`},{default:L(()=>[...n[3]||=[H(`p`,null,`Delete saved view`,-1)]]),_:1})]),_:1})])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-1562f39a`]]),Ib={class:`inline-flex h-full w-full items-center justify-center`},Lb={class:`grid gap-5`},Rb={class:`grid gap-3`},zb={class:`grid grid-cols-3 items-center gap-4`},Bb={class:`flex items-center gap-2`},Vb={class:`grid grid-cols-3 items-center gap-4`},Hb={class:`flex items-center gap-2`},Ub={class:`grid grid-cols-3 items-center gap-4`},Wb={class:`flex justify-end gap-2`},Gb=64,Kb=8192,qb=$y(R({__name:`SaveScreenshotButton`,setup(e){let t=F(!1),n=F(1920),r=F(1080),i=F(`png`),a=F(!1),o=ay(),s=W(()=>Number.isFinite(n.value)?n.valueKb?`Width must be between ${Gb} and ${Kb} px.`:``:`Width must be a number.`),c=W(()=>Number.isFinite(r.value)?r.valueKb?`Height must be between ${Gb} and ${Kb} px.`:``:`Height must be a number.`);function l(e,t){return Number.isFinite(e)?Math.min(Kb,Math.max(Gb,Math.round(e))):t}function u(){a.value=!0}function d(){n.value=l(n.value,1920)}function f(){r.value=l(r.value,1080)}function p(){let e=o.renderer.domElement;if(!e)return;let t=e.getBoundingClientRect(),i=Math.round(t.width)||e.clientWidth||e.width,a=Math.round(t.height)||e.clientHeight||e.height;n.value=l(i,n.value),r.value=l(a,r.value)}function m(){d(),f(),!(s.value||c.value)&&(o.saveCurrentCanvasImage({width:n.value,height:r.value,format:i.value}),t.value=!1)}return Cr(t,e=>{e&&!a.value&&p()}),(e,a)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(Ob),{open:t.value,"onUpdate:open":a[4]||=e=>t.value=e,modal:!0},{default:L(()=>[U(I(kb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[H(`span`,Ib,[U(I(Oy))])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[a[6]||=Cs(`Save screenshot `,-1),U(I(rb),null,{default:L(()=>[...a[5]||=[Cs(`F`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Ab),{class:`theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,Lb,[a[15]||=H(`div`,{class:`space-y-2`},[H(`h4`,{class:`font-medium leading-none`},`Export Screenshot`),H(`p`,{class:`text-sm text-muted-foreground`},` Set width, height, and image format. `)],-1),H(`div`,Rb,[H(`div`,zb,[H(`div`,Bb,[a[8]||=H(`label`,{for:`screenshot-width`,class:`text-sm`},`Width`,-1),s.value?(B(),V(I(ib),{key:0},{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[...a[7]||=[H(`span`,{class:`error-pill`,"aria-label":`Width error`},`!`,-1)]]),_:1}),U(I(ab),{class:`z-[5000]`,side:`top`},{default:L(()=>[H(`p`,null,Ce(s.value),1)]),_:1})]),_:1})):Ts(``,!0)]),pr(H(`input`,{id:`screenshot-width`,"onUpdate:modelValue":a[0]||=e=>n.value=e,type:`number`,onInput:u,onBlur:d,class:`themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},null,544),[[Gl,n.value,void 0,{number:!0}]])]),H(`div`,Vb,[H(`div`,Hb,[a[10]||=H(`label`,{for:`screenshot-height`,class:`text-sm`},`Height`,-1),c.value?(B(),V(I(ib),{key:0},{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[...a[9]||=[H(`span`,{class:`error-pill`,"aria-label":`Height error`},`!`,-1)]]),_:1}),U(I(ab),{class:`z-[5000]`,side:`top`},{default:L(()=>[H(`p`,null,Ce(c.value),1)]),_:1})]),_:1})):Ts(``,!0)]),pr(H(`input`,{id:`screenshot-height`,"onUpdate:modelValue":a[1]||=e=>r.value=e,type:`number`,onInput:u,onBlur:f,class:`themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},null,544),[[Gl,r.value,void 0,{number:!0}]])]),H(`div`,Ub,[a[12]||=H(`label`,{for:`screenshot-format`,class:`text-sm`},`Format`,-1),pr(H(`select`,{id:`screenshot-format`,"onUpdate:modelValue":a[2]||=e=>i.value=e,class:`col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},[...a[11]||=[H(`option`,{value:`png`},`PNG`,-1),H(`option`,{value:`jpg`},`JPG`,-1),H(`option`,{value:`webp`},`WEBP`,-1)]],512),[[Yl,i.value]])])]),H(`div`,Wb,[U(I(oy),{variant:`secondary`,size:`sm`,onClick:a[3]||=e=>t.value=!1},{default:L(()=>[...a[13]||=[Cs(`Cancel`,-1)]]),_:1}),U(I(oy),{variant:`secondary`,size:`sm`,onClick:m},{default:L(()=>[...a[14]||=[Cs(`Save`,-1)]]),_:1})])])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-ed1ef026`]]),Jb={class:`display-tools-wrapper`},Yb={class:`toolbar-group`},Xb=`compas_threejs_saved_views`,Zb=R({__name:`DisplayGroup`,setup(e){let t=ay(),n=F([]),r=F(``);function i(){localStorage.setItem(Xb,JSON.stringify(n.value))}function a(){let e=localStorage.getItem(Xb);if(e)try{let t=JSON.parse(e);Array.isArray(t)&&(n.value=t)}catch{n.value=[]}}function o(e){n.value=[...n.value,e],r.value=e.id,i()}function s(){let e=`View ${n.value.length+1}`,r=window.prompt(`Name for saved view`,e);if(r===null)return;let i=r.trim()||e;o(t.captureCurrentView(i))}function c(e){r.value=e;let i=n.value.find(t=>t.id===e);i&&t.applySavedView(i)}function l(e){let t=n.value.filter(t=>t.id!==e);n.value=t,r.value===e&&(r.value=t[0]?.id??``),i()}return Ji(()=>{a()}),nb({s:()=>{s()},f:()=>{t.saveCurrentCanvasImage({format:`png`})},d:()=>{t.toggleTheme()}}),(e,t)=>(B(),ms(`div`,Jb,[H(`div`,Yb,[U(I(Db),{"default-name":`View ${n.value.length+1}`,onSaved:o},null,8,[`default-name`]),U(I(Fb),{views:n.value,"selected-view-id":r.value,onSelect:c,onDelete:l},null,8,[`views`,`selected-view-id`]),U(I(qb))])]))}}),Qb=$y(R({__name:`Toolbar`,setup(e){let t=F(null),{isHovered:n}=qy(t),{theme:r,blockPicker:i}=ay().store;return br(()=>{i.value=n.value}),(e,n)=>(B(),ms(`div`,{ref_key:`toolbarElement`,ref:t,class:`toolbar theme`,id:`toolbar`},[H(`h1`,{class:he([`text-lg font-bold`,{dark:I(r).value===`dark`}])},` COMPAS ThreeJs `,2),U(gb),U(wb),U(Zb)],512))}}),[[`__scopeId`,`data-v-7f20b0a6`]]),$b=R({__name:`Slider`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Yh),ks({"data-slot":`slider`,class:I(ry)(`relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,n.class)},I(i)),{default:L(({modelValue:e})=>[U(I(eg),{"data-slot":`slider-track`,class:`bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`},{default:L(()=>[U(I(Zh),{"data-slot":`slider-range`,class:`bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full`})]),_:1}),(B(!0),ms(is,null,da(e,(e,t)=>(B(),V(I($h),{key:t,"data-slot":`slider-thumb`,class:`bg-secondary-foreground border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50`}))),128))]),_:1},16,[`class`]))}}),ex=R({__name:`NumberField`,props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Fg),ks(I(i),{class:I(ry)(`grid gap-1.5`,n.class)}),{default:L(t=>[z(e.$slots,`default`,ge(xs(t)))]),_:3},16,[`class`]))}}),tx=R({__name:`NumberFieldContent`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),ms(`div`,{class:he(I(ry)(`relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5`,t.class))},[z(e.$slots,`default`)],2))}}),nx=R({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(Ig),ks({"data-slot":`decrement`},I(n),{class:I(ry)(`absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(ky),{class:`h-4 w-4`})])]),_:3},16,[`class`]))}}),rx=R({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(Lg),ks({"data-slot":`increment`},I(n),{class:I(ry)(`absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Ny),{class:`h-4 w-4`})])]),_:3},16,[`class`]))}}),ix=R({__name:`NumberFieldInput`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(I(Rg),{"data-slot":`input`,class:he(I(ry)(`flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,t.class))},null,8,[`class`]))}}),ax=R({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Oh),ks(I(i),{class:I(ry)(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,n.class)}),{default:L(()=>[U(I(kh),{class:`grid place-content-center text-current`},{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Cy),{class:`h-4 w-4`})])]),_:3})]),_:3},16,[`class`]))}}),ox={class:`load-json-button-container inline-block`},sx=R({__name:`LoadJsonButton`,props:{text:{},action:{}},setup(e){let t=e,n=ay(),r=F(null),i=()=>{r.value?.click()},a=e=>{let r=e.target,i=r.files?.[0];if(i){let e=new FileReader;e.onload=e=>{try{let r=e.target?.result,i=JSON.parse(r);console.log(`Preparing to send JSON payload via WS for action: ${t.action}`);let a={dispatch:`loaded_json`,action:t.action,json_data:i};n.sendData(a)&&console.log(`Successfully sent JSON payload via WS for action: ${t.action}`)}catch(e){console.error(`Failed to parse or send uploaded JSON file:`,e)}},e.readAsText(i),r.value=``}};return(t,n)=>(B(),ms(`div`,ox,[H(`input`,{ref_key:`fileInput`,ref:r,type:`file`,class:`hidden`,accept:`.json`,onChange:a},null,544),U(I(oy),{type:`button`,onClick:i,variant:`secondary`},{default:L(()=>[Cs(Ce(e.text),1)]),_:1})]))}}),cx={key:1,class:`button-container`},lx={key:2,class:`slider-container`},ux={key:0,class:`slider-value`},dx={key:3,class:`number-field-container`},fx={key:4,class:`load-json-button-container`},px={key:5,class:`checkbox-ui-component`},mx={key:0},hx={key:6,class:`select-container`},gx=$y(R({__name:`Openbar`,setup(e){let t=F(!0),n=F(null),r=ay(),{sidebarComponents:i,theme:a,blockPicker:o}=r.store,s=(e,t)=>r.handleUiAction(e,t);function c(){t.value=!t.value}nb({q:c});let{isHovered:l}=qy(n),u=W(()=>t.value);return br(()=>{o.value=l.value&&u.value}),(e,r)=>(B(),ms(is,null,[H(`div`,{ref_key:`openbarElement`,ref:n,id:`openbar`,class:he([`fixed-openbar theme`,{"is-hidden":!t.value}])},[(B(!0),ms(is,null,da(I(i),e=>(B(),ms(`div`,{key:e.id,class:`dynamic-item`},[e.label?(B(),ms(`label`,{key:0,class:he([`dynamic-label`,{dark:I(a).value===`dark`}])},Ce(e.label),3)):Ts(``,!0),e.component===`Button`?(B(),ms(`div`,cx,[U(I(oy),{variant:`secondary`,onClick:t=>s(e.action)},{default:L(()=>[Cs(Ce(e.props.text),1)]),_:2},1032,[`onClick`])])):e.component===`Slider`?(B(),ms(`div`,lx,[U(I($b),{min:e.props.min,max:e.props.max,step:e.props.step,"default-value":e.props.defaultValue,modelValue:e.props.defaultValue,"onUpdate:modelValue":[t=>e.props.defaultValue=t,t=>s(e.action,t?.[0])],class:`w-[80%]`},null,8,[`min`,`max`,`step`,`default-value`,`modelValue`,`onUpdate:modelValue`]),e.props.defaultValue?(B(),ms(`span`,ux,Ce(e.props.defaultValue[0]),1)):Ts(``,!0)])):e.component===`NumberField`?(B(),ms(`div`,dx,[U(I(ex),{min:e.props.min,max:e.props.max,step:e.props.step,"default-value":e.props.value,modelValue:e.props.value,"onUpdate:modelValue":[t=>e.props.value=t,t=>s(e.action,t)],class:`w-full`},{default:L(()=>[U(I(tx),null,{default:L(()=>[U(I(nx)),U(I(ix)),U(I(rx))]),_:1})]),_:1},8,[`min`,`max`,`step`,`default-value`,`modelValue`,`onUpdate:modelValue`])])):e.component===`LoadJsonButton`?(B(),ms(`div`,fx,[U(sx,{text:e.props.text,action:e.action},null,8,[`text`,`action`])])):e.component===`Checkbox`?(B(),ms(`div`,px,[U(I(ax),{id:`checkbox-${e.id}`,"model-value":!!e.props.defaultValue,"onUpdate:modelValue":t=>{e.props.defaultValue=!!t,s(e.action,t)}},null,8,[`id`,`model-value`,`onUpdate:modelValue`]),e.props.text?(B(),ms(`span`,mx,Ce(e.props.text),1)):Ts(``,!0)])):e.component===`Select`?(B(),ms(`div`,hx,[U(I(cy),{"model-value":e.props.defaultValue??``,"onUpdate:modelValue":t=>{e.props.defaultValue=typeof t==`string`?t:``,s(e.action,t)}},{default:L(()=>[U(I(Gy),{class:`w-full`},{default:L(()=>[U(I(Ky),{placeholder:e.props.placeholder??`Select an option`},null,8,[`placeholder`])]),_:2},1024),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(!0),ms(is,null,da(e.props.options,e=>(B(),V(I(Hy),{key:e,value:e},{default:L(()=>[Cs(Ce(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])])):Ts(``,!0)]))),128)),U(I(oy),{variant:`secondary`,size:`icon`,class:`mb-4`,onClick:r[0]||=e=>c()},{default:L(()=>[U(I(yy))]),_:1})],2),U(I(oy),{variant:`secondary`,size:`icon`,class:he([`mb-5`,{"is-hidden":!t.value}]),onClick:r[1]||=e=>c()},{default:L(()=>[U(I(by))]),_:1},8,[`class`])],64))}}),[[`__scopeId`,`data-v-a83066fb`]]),_x={id:`sidebar`},vx=$y(R({__name:`Sidebar`,props:{showToolbar:{type:Boolean,default:!0}},setup(e){let{sideBarInfoState:t}=ay().store;return(n,r)=>(B(),ms(`div`,_x,[e.showToolbar?(B(),V(Qb,{key:0})):Ts(``,!0),I(t).isVisible?(B(),V(gx,{key:1})):Ts(``,!0)]))}}),[[`__scopeId`,`data-v-1cbddba3`]]),yx={key:0,class:`theme-indicator`,"aria-hidden":`true`},bx=$y(R({__name:`ThemeIndicator`,setup(e){let{theme:t}=ay().store,n=F(!1),r=F(t.value),i=null,a=!0;function o(e){r.value=e,n.value=!0,i&&window.clearTimeout(i),i=window.setTimeout(()=>{n.value=!1,i=null},900)}let s=Cr(()=>t.value,e=>{if(a){r.value=e,a=!1;return}e!==r.value&&o(e)},{immediate:!0});return Zi(()=>{i&&=(window.clearTimeout(i),null),s()}),Ji(()=>{}),(e,t)=>(B(),V(wc,{name:`theme-indicator`},{default:L(()=>[n.value?(B(),ms(`div`,yx,[r.value===`dark`?(B(),V(I(Ay),{key:0,class:`theme-indicator-icon`})):(B(),V(I(zy),{key:1,class:`theme-indicator-icon`}))])):Ts(``,!0)]),_:1}))}}),[[`__scopeId`,`data-v-ebb8d4d4`]]),xx=$y(R({__name:`App`,props:{runtime:{},showToolbar:{type:Boolean,default:!0}},setup(e){let t=F(null),n=e,{theme:r}=n.runtime.store;return Ji(()=>{t.value&&n.runtime.attach(t.value)}),(e,i)=>(B(),ms(`div`,{class:he([`app-container`,{dark:I(r).value===`dark`}])},[U(vx,{"show-toolbar":n.showToolbar},null,8,[`show-toolbar`]),H(`div`,{ref_key:`threeContainer`,ref:t,class:`three-container`},null,512),U(bx),U(eb)],2))}}),[[`__scopeId`,`data-v-dc8ca966`]]);function Sx(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}var wx=4294967296;function Tx(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=wx&&(i+=r/wx|0,r%=wx)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Ax(r,i):kx(r,i)}function Ex(e,t){let n=kx(e,t),r=n.hi&2147483648;r&&(n=Ax(n.lo,n.hi));let i=Dx(n.lo,n.hi);return r?`-`+i:i}function Dx(e,t){if({lo:e,hi:t}=Ox(e,t),t<=2097151)return String(wx*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+jx(o)+jx(a)}function Ox(e,t){return{lo:e>>>0,hi:t>>>0}}function kx(e,t){return{lo:e|0,hi:t|0}}function Ax(e,t){return t=~t,e?e=~e+1:t+=1,kx(e,t)}var jx=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function Mx(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function Nx(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var Px=Fx();function Fx(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Ux(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return Hx(e),Mx(e,this.buf),this}bool(e){return this.buf.push(+!!e),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Wx(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Ux(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Hx(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Hx(e),e=(e<<1^e>>31)>>>0,Mx(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=Px.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=Px.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=Px.enc(e);return Cx(t.lo,t.hi,this.buf),this}sint64(e){let t=Px.enc(e),n=t.hi>>31;return Cx(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=Px.uEnc(e);return Cx(t.lo,t.hi,this.buf),this}},q=class{constructor(e,t=zx().decodeUtf8){this.decodeUtf8=t,this.varint64=Sx,this.uint32=Nx,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case Bx.Varint:for(;this.buf[this.pos++]&128;);break;case Bx.Bit64:this.pos+=4;case Bx.Bit32:this.pos+=4;break;case Bx.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Bx.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===Bx.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Px.dec(...this.varint64())}uint64(){return Px.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,Px.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Px.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Px.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){return this.decodeUtf8(this.bytes(),e)}};function Hx(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function Ux(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function Wx(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}function Gx(){return{typeUrl:``,value:new Uint8Array}}var Kx={encode(e,t=new Vx){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=Gx();for(;n.pos>>3){case 1:if(e!==10)break;i.typeUrl=n.string();continue;case 2:if(e!==18)break;i.value=n.bytes();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{typeUrl:Yx(e.typeUrl)?globalThis.String(e.typeUrl):Yx(e.type_url)?globalThis.String(e.type_url):``,value:Yx(e.value)?qx(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==``&&(t.typeUrl=e.typeUrl),e.value.length!==0&&(t.value=Jx(e.value)),t},create(e){return Kx.fromPartial(e??{})},fromPartial(e){let t=Gx();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};function qx(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,`base64`));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let e=0;e{t.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(t.join(``))}}function Yx(e){return e!=null}var Xx=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Zx(e){switch(e){case 0:case`NULL_VALUE`:return Xx.NULL_VALUE;default:return Xx.UNRECOGNIZED}}function Qx(e){switch(e){case Xx.NULL_VALUE:return`NULL_VALUE`;case Xx.UNRECOGNIZED:default:return`UNRECOGNIZED`}}function $x(){return{fields:{}}}var eS={encode(e,t=new Vx){return globalThis.Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&nS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$x();for(;n.pos>>3){case 1:{if(e!==10)break;let t=nS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{fields:sS(e.fields)?globalThis.Object.entries(e.fields).reduce((e,[t,n])=>(e[t]=n,e),{}):{}}},toJSON(e){let t={};if(e.fields){let n=globalThis.Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([e,n])=>{t.fields[e]=n}))}return t},create(e){return eS.fromPartial(e??{})},fromPartial(e){let t=$x();return t.fields=globalThis.Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=$x();if(e!==void 0)for(let n of globalThis.Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of globalThis.Object.keys(e.fields))t[n]=e.fields[n];return t}};function tS(){return{key:``,value:void 0}}var nS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&iS.encode(iS.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=iS.unwrap(iS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:cS(e.key)?globalThis.String(e.key):``,value:cS(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return nS.fromPartial(e??{})},fromPartial(e){let t=tS();return t.key=e.key??``,t.value=e.value??void 0,t}};function rS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var iS={encode(e,t=new Vx){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&eS.encode(eS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&oS.encode(oS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=rS();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=eS.unwrap(eS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=oS.unwrap(oS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{nullValue:cS(e.nullValue)?Zx(e.nullValue):cS(e.null_value)?Zx(e.null_value):void 0,numberValue:cS(e.numberValue)?globalThis.Number(e.numberValue):cS(e.number_value)?globalThis.Number(e.number_value):void 0,stringValue:cS(e.stringValue)?globalThis.String(e.stringValue):cS(e.string_value)?globalThis.String(e.string_value):void 0,boolValue:cS(e.boolValue)?globalThis.Boolean(e.boolValue):cS(e.bool_value)?globalThis.Boolean(e.bool_value):void 0,structValue:sS(e.structValue)?e.structValue:sS(e.struct_value)?e.struct_value:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:globalThis.Array.isArray(e.list_value)?[...e.list_value]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=Qx(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return iS.fromPartial(e??{})},fromPartial(e){let t=rS();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=rS();if(e===null)t.nullValue=Xx.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function aS(){return{values:[]}}var oS={encode(e,t=new Vx){for(let n of e.values)iS.encode(iS.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=aS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(iS.unwrap(iS.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return oS.fromPartial(e??{})},fromPartial(e){let t=aS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=aS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}};function sS(e){return typeof e==`object`&&!!e}function cS(e){return e!=null}function lS(){return{message:void 0,value:void 0,fallback:void 0,intValue:void 0,doubleValue:void 0,dictValue:void 0,listValue:void 0}}var J={encode(e,t=new Vx){return e.message!==void 0&&Kx.encode(e.message,t.uint32(10).fork()).join(),e.value!==void 0&&iS.encode(iS.wrap(e.value),t.uint32(18).fork()).join(),e.fallback!==void 0&&dS.encode(e.fallback,t.uint32(26).fork()).join(),e.intValue!==void 0&&t.uint32(32).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(41).double(e.doubleValue),e.dictValue!==void 0&&hS.encode(e.dictValue,t.uint32(50).fork()).join(),e.listValue!==void 0&&pS.encode(e.listValue,t.uint32(58).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=lS();for(;n.pos>>3){case 1:if(e!==10)break;i.message=Kx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.value=iS.unwrap(iS.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.fallback=dS.decode(n,n.uint32());continue;case 4:if(e!==32)break;i.intValue=bS(n.int64());continue;case 5:if(e!==41)break;i.doubleValue=n.double();continue;case 6:if(e!==50)break;i.dictValue=hS.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.listValue=pS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{message:SS(e.message)?Kx.fromJSON(e.message):void 0,value:SS(e?.value)?e.value:void 0,fallback:SS(e.fallback)?dS.fromJSON(e.fallback):void 0,intValue:SS(e.intValue)?globalThis.Number(e.intValue):SS(e.int_value)?globalThis.Number(e.int_value):void 0,doubleValue:SS(e.doubleValue)?globalThis.Number(e.doubleValue):SS(e.double_value)?globalThis.Number(e.double_value):void 0,dictValue:SS(e.dictValue)?hS.fromJSON(e.dictValue):SS(e.dict_value)?hS.fromJSON(e.dict_value):void 0,listValue:SS(e.listValue)?pS.fromJSON(e.listValue):SS(e.list_value)?pS.fromJSON(e.list_value):void 0}},toJSON(e){let t={};return e.message!==void 0&&(t.message=Kx.toJSON(e.message)),e.value!==void 0&&(t.value=e.value),e.fallback!==void 0&&(t.fallback=dS.toJSON(e.fallback)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.dictValue!==void 0&&(t.dictValue=hS.toJSON(e.dictValue)),e.listValue!==void 0&&(t.listValue=pS.toJSON(e.listValue)),t},create(e){return J.fromPartial(e??{})},fromPartial(e){let t=lS();return t.message=e.message!==void 0&&e.message!==null?Kx.fromPartial(e.message):void 0,t.value=e.value??void 0,t.fallback=e.fallback!==void 0&&e.fallback!==null?dS.fromPartial(e.fallback):void 0,t.intValue=e.intValue??void 0,t.doubleValue=e.doubleValue??void 0,t.dictValue=e.dictValue!==void 0&&e.dictValue!==null?hS.fromPartial(e.dictValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?pS.fromPartial(e.listValue):void 0,t}};function uS(){return{data:void 0}}var dS={encode(e,t=new Vx){return e.data!==void 0&&hS.encode(e.data,t.uint32(10).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=hS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{data:SS(e.data)?hS.fromJSON(e.data):void 0}},toJSON(e){let t={};return e.data!==void 0&&(t.data=hS.toJSON(e.data)),t},create(e){return dS.fromPartial(e??{})},fromPartial(e){let t=uS();return t.data=e.data!==void 0&&e.data!==null?hS.fromPartial(e.data):void 0,t}};function fS(){return{items:[]}}var pS={encode(e,t=new Vx){for(let n of e.items)J.encode(n,t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=fS();for(;n.pos>>3){case 1:if(e!==10)break;i.items.push(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{items:globalThis.Array.isArray(e?.items)?e.items.map(e=>J.fromJSON(e)):[]}},toJSON(e){let t={};return e.items?.length&&(t.items=e.items.map(e=>J.toJSON(e))),t},create(e){return pS.fromPartial(e??{})},fromPartial(e){let t=fS();return t.items=e.items?.map(e=>J.fromPartial(e))||[],t}};function mS(){return{items:{}}}var hS={encode(e,t=new Vx){return globalThis.Object.entries(e.items).forEach(([e,n])=>{_S.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=mS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=_S.decode(n,n.uint32());t.value!==void 0&&(i.items[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{items:xS(e.items)?globalThis.Object.entries(e.items).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{}}},toJSON(e){let t={};if(e.items){let n=globalThis.Object.entries(e.items);n.length>0&&(t.items={},n.forEach(([e,n])=>{t.items[e]=J.toJSON(n)}))}return t},create(e){return hS.fromPartial(e??{})},fromPartial(e){let t=mS();return t.items=globalThis.Object.entries(e.items??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t}};function gS(){return{key:``,value:void 0}}var _S={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=gS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:SS(e.key)?globalThis.String(e.key):``,value:SS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return _S.fromPartial(e??{})},fromPartial(e){let t=gS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function vS(){return{data:void 0,version:void 0}}var yS={encode(e,t=new Vx){return e.data!==void 0&&J.encode(e.data,t.uint32(10).fork()).join(),e.version!==void 0&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=vS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=J.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{data:SS(e.data)?J.fromJSON(e.data):void 0,version:SS(e.version)?globalThis.String(e.version):void 0}},toJSON(e){let t={};return e.data!==void 0&&(t.data=J.toJSON(e.data)),e.version!==void 0&&(t.version=e.version),t},create(e){return yS.fromPartial(e??{})},fromPartial(e){let t=vS();return t.data=e.data!==void 0&&e.data!==null?J.fromPartial(e.data):void 0,t.version=e.version??void 0,t}};function bS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e===16){i.indices.push(n.uint32());continue}if(e===18){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],kind:YS(e.kind)?globalThis.Number(e.kind):0,doubles:globalThis.Array.isArray(e?.doubles)?e.doubles.map(e=>globalThis.Number(e)):[],ints:globalThis.Array.isArray(e?.ints)?e.ints.map(e=>globalThis.Number(e)):[],bools:globalThis.Array.isArray(e?.bools)?e.bools.map(e=>globalThis.Boolean(e)):[],values:globalThis.Array.isArray(e?.values)?e.values.map(e=>J.fromJSON(e)):[]}},toJSON(e){let t={};return e.name!==``&&(t.name=e.name),e.indices?.length&&(t.indices=e.indices.map(e=>Math.round(e))),e.kind!==0&&(t.kind=Math.round(e.kind)),e.doubles?.length&&(t.doubles=e.doubles),e.ints?.length&&(t.ints=e.ints.map(e=>Math.round(e))),e.bools?.length&&(t.bools=e.bools),e.values?.length&&(t.values=e.values.map(e=>J.toJSON(e))),t},create(e){return wS.fromPartial(e??{})},fromPartial(e){let t=CS();return t.name=e.name??``,t.indices=e.indices?.map(e=>e)||[],t.kind=e.kind??0,t.doubles=e.doubles?.map(e=>e)||[],t.ints=e.ints?.map(e=>e)||[],t.bools=e.bools?.map(e=>e)||[],t.values=e.values?.map(e=>J.fromPartial(e))||[],t}};function TS(){return{guid:void 0,name:void 0,vertices:[],faceVertices:[],faceSizes:[],attributes:{},vertexAttributeColumns:[],faceAttributeColumns:[],edgeAttributeColumns:[],edgeKeys:[],defaultVertexAttributes:{},defaultFaceAttributes:{},defaultEdgeAttributes:{}}}var ES={encode(e,t=new Vx){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.vertices)t.double(n);t.join(),t.uint32(34).fork();for(let n of e.faceVertices)t.uint32(n);t.join(),t.uint32(98).fork();for(let n of e.faceSizes)t.uint32(n);t.join(),globalThis.Object.entries(e.attributes).forEach(([e,n])=>{OS.encode({key:e,value:n},t.uint32(42).fork()).join()});for(let n of e.vertexAttributeColumns)wS.encode(n,t.uint32(50).fork()).join();for(let n of e.faceAttributeColumns)wS.encode(n,t.uint32(58).fork()).join();for(let n of e.edgeAttributeColumns)wS.encode(n,t.uint32(66).fork()).join();for(let n of e.edgeKeys)J.encode(n,t.uint32(106).fork()).join();return globalThis.Object.entries(e.defaultVertexAttributes).forEach(([e,n])=>{AS.encode({key:e,value:n},t.uint32(74).fork()).join()}),globalThis.Object.entries(e.defaultFaceAttributes).forEach(([e,n])=>{MS.encode({key:e,value:n},t.uint32(82).fork()).join()}),globalThis.Object.entries(e.defaultEdgeAttributes).forEach(([e,n])=>{PS.encode({key:e,value:n},t.uint32(90).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=TS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.vertices.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],faceVertices:globalThis.Array.isArray(e?.faceVertices)?e.faceVertices.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.face_vertices)?e.face_vertices.map(e=>globalThis.Number(e)):[],faceSizes:globalThis.Array.isArray(e?.faceSizes)?e.faceSizes.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.face_sizes)?e.face_sizes.map(e=>globalThis.Number(e)):[],attributes:JS(e.attributes)?globalThis.Object.entries(e.attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},vertexAttributeColumns:globalThis.Array.isArray(e?.vertexAttributeColumns)?e.vertexAttributeColumns.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.vertex_attribute_columns)?e.vertex_attribute_columns.map(e=>wS.fromJSON(e)):[],faceAttributeColumns:globalThis.Array.isArray(e?.faceAttributeColumns)?e.faceAttributeColumns.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.face_attribute_columns)?e.face_attribute_columns.map(e=>wS.fromJSON(e)):[],edgeAttributeColumns:globalThis.Array.isArray(e?.edgeAttributeColumns)?e.edgeAttributeColumns.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.edge_attribute_columns)?e.edge_attribute_columns.map(e=>wS.fromJSON(e)):[],edgeKeys:globalThis.Array.isArray(e?.edgeKeys)?e.edgeKeys.map(e=>J.fromJSON(e)):globalThis.Array.isArray(e?.edge_keys)?e.edge_keys.map(e=>J.fromJSON(e)):[],defaultVertexAttributes:JS(e.defaultVertexAttributes)?globalThis.Object.entries(e.defaultVertexAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_vertex_attributes)?globalThis.Object.entries(e.default_vertex_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultFaceAttributes:JS(e.defaultFaceAttributes)?globalThis.Object.entries(e.defaultFaceAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_face_attributes)?globalThis.Object.entries(e.default_face_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultEdgeAttributes:JS(e.defaultEdgeAttributes)?globalThis.Object.entries(e.defaultEdgeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_edge_attributes)?globalThis.Object.entries(e.default_edge_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{}}},toJSON(e){let t={};if(e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices),e.faceVertices?.length&&(t.faceVertices=e.faceVertices.map(e=>Math.round(e))),e.faceSizes?.length&&(t.faceSizes=e.faceSizes.map(e=>Math.round(e))),e.attributes){let n=globalThis.Object.entries(e.attributes);n.length>0&&(t.attributes={},n.forEach(([e,n])=>{t.attributes[e]=J.toJSON(n)}))}if(e.vertexAttributeColumns?.length&&(t.vertexAttributeColumns=e.vertexAttributeColumns.map(e=>wS.toJSON(e))),e.faceAttributeColumns?.length&&(t.faceAttributeColumns=e.faceAttributeColumns.map(e=>wS.toJSON(e))),e.edgeAttributeColumns?.length&&(t.edgeAttributeColumns=e.edgeAttributeColumns.map(e=>wS.toJSON(e))),e.edgeKeys?.length&&(t.edgeKeys=e.edgeKeys.map(e=>J.toJSON(e))),e.defaultVertexAttributes){let n=globalThis.Object.entries(e.defaultVertexAttributes);n.length>0&&(t.defaultVertexAttributes={},n.forEach(([e,n])=>{t.defaultVertexAttributes[e]=J.toJSON(n)}))}if(e.defaultFaceAttributes){let n=globalThis.Object.entries(e.defaultFaceAttributes);n.length>0&&(t.defaultFaceAttributes={},n.forEach(([e,n])=>{t.defaultFaceAttributes[e]=J.toJSON(n)}))}if(e.defaultEdgeAttributes){let n=globalThis.Object.entries(e.defaultEdgeAttributes);n.length>0&&(t.defaultEdgeAttributes={},n.forEach(([e,n])=>{t.defaultEdgeAttributes[e]=J.toJSON(n)}))}return t},create(e){return ES.fromPartial(e??{})},fromPartial(e){let t=TS();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(e=>e)||[],t.faceVertices=e.faceVertices?.map(e=>e)||[],t.faceSizes=e.faceSizes?.map(e=>e)||[],t.attributes=globalThis.Object.entries(e.attributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.vertexAttributeColumns=e.vertexAttributeColumns?.map(e=>wS.fromPartial(e))||[],t.faceAttributeColumns=e.faceAttributeColumns?.map(e=>wS.fromPartial(e))||[],t.edgeAttributeColumns=e.edgeAttributeColumns?.map(e=>wS.fromPartial(e))||[],t.edgeKeys=e.edgeKeys?.map(e=>J.fromPartial(e))||[],t.defaultVertexAttributes=globalThis.Object.entries(e.defaultVertexAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultFaceAttributes=globalThis.Object.entries(e.defaultFaceAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultEdgeAttributes=globalThis.Object.entries(e.defaultEdgeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t}};function DS(){return{key:``,value:void 0}}var OS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function kS(){return{key:``,value:void 0}}var AS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return AS.fromPartial(e??{})},fromPartial(e){let t=kS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function jS(){return{key:``,value:void 0}}var MS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return MS.fromPartial(e??{})},fromPartial(e){let t=jS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function NS(){return{key:``,value:void 0}}var PS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=NS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return PS.fromPartial(e??{})},fromPartial(e){let t=NS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function FS(){return{vertexIndices:[]}}var IS={encode(e,t=new Vx){t.uint32(10).fork();for(let n of e.vertexIndices)t.int32(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3==1){if(e===8){i.vertexIndices.push(n.int32());continue}if(e===10){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(e?.vertex_indices)?e.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(e){let t={};return e.vertexIndices?.length&&(t.vertexIndices=e.vertexIndices.map(e=>Math.round(e))),t},create(e){return IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.vertexIndices=e.vertexIndices?.map(e=>e)||[],t}};function LS(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}var RS={encode(e,t=new Vx){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.vertices)t.double(n);t.join();for(let n of e.faces)IS.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.vertices.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(e=>IS.fromJSON(e)):[]}},toJSON(e){let t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices),e.faces?.length&&(t.faces=e.faces.map(e=>IS.toJSON(e))),t},create(e){return RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(e=>e)||[],t.faces=e.faces?.map(e=>IS.fromPartial(e))||[],t}};function zS(){return{guid:void 0,name:void 0,nodeKeys:[],nodeAttributes:[],attributes:{},defaultNodeAttributes:{},defaultEdgeAttributes:{},edgeU:[],edgeV:[],edgeAttributes:[]}}var BS={encode(e,t=new Vx){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(let n of e.nodeKeys)J.encode(n,t.uint32(26).fork()).join();for(let n of e.nodeAttributes)wS.encode(n,t.uint32(34).fork()).join();globalThis.Object.entries(e.attributes).forEach(([e,n])=>{HS.encode({key:e,value:n},t.uint32(42).fork()).join()}),globalThis.Object.entries(e.defaultNodeAttributes).forEach(([e,n])=>{WS.encode({key:e,value:n},t.uint32(50).fork()).join()}),globalThis.Object.entries(e.defaultEdgeAttributes).forEach(([e,n])=>{KS.encode({key:e,value:n},t.uint32(58).fork()).join()}),t.uint32(66).fork();for(let n of e.edgeU)t.uint32(n);t.join(),t.uint32(74).fork();for(let n of e.edgeV)t.uint32(n);t.join();for(let n of e.edgeAttributes)wS.encode(n,t.uint32(82).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.nodeKeys.push(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.nodeAttributes.push(wS.decode(n,n.uint32()));continue;case 5:{if(e!==42)break;let t=HS.decode(n,n.uint32());t.value!==void 0&&(i.attributes[t.key]=t.value);continue}case 6:{if(e!==50)break;let t=WS.decode(n,n.uint32());t.value!==void 0&&(i.defaultNodeAttributes[t.key]=t.value);continue}case 7:{if(e!==58)break;let t=KS.decode(n,n.uint32());t.value!==void 0&&(i.defaultEdgeAttributes[t.key]=t.value);continue}case 8:if(e===64){i.edgeU.push(n.uint32());continue}if(e===66){let e=n.uint32()+n.pos;for(;n.posJ.fromJSON(e)):globalThis.Array.isArray(e?.node_keys)?e.node_keys.map(e=>J.fromJSON(e)):[],nodeAttributes:globalThis.Array.isArray(e?.nodeAttributes)?e.nodeAttributes.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.node_attributes)?e.node_attributes.map(e=>wS.fromJSON(e)):[],attributes:JS(e.attributes)?globalThis.Object.entries(e.attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultNodeAttributes:JS(e.defaultNodeAttributes)?globalThis.Object.entries(e.defaultNodeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_node_attributes)?globalThis.Object.entries(e.default_node_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultEdgeAttributes:JS(e.defaultEdgeAttributes)?globalThis.Object.entries(e.defaultEdgeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_edge_attributes)?globalThis.Object.entries(e.default_edge_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},edgeU:globalThis.Array.isArray(e?.edgeU)?e.edgeU.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.edge_u)?e.edge_u.map(e=>globalThis.Number(e)):[],edgeV:globalThis.Array.isArray(e?.edgeV)?e.edgeV.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.edge_v)?e.edge_v.map(e=>globalThis.Number(e)):[],edgeAttributes:globalThis.Array.isArray(e?.edgeAttributes)?e.edgeAttributes.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.edge_attributes)?e.edge_attributes.map(e=>wS.fromJSON(e)):[]}},toJSON(e){let t={};if(e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.nodeKeys?.length&&(t.nodeKeys=e.nodeKeys.map(e=>J.toJSON(e))),e.nodeAttributes?.length&&(t.nodeAttributes=e.nodeAttributes.map(e=>wS.toJSON(e))),e.attributes){let n=globalThis.Object.entries(e.attributes);n.length>0&&(t.attributes={},n.forEach(([e,n])=>{t.attributes[e]=J.toJSON(n)}))}if(e.defaultNodeAttributes){let n=globalThis.Object.entries(e.defaultNodeAttributes);n.length>0&&(t.defaultNodeAttributes={},n.forEach(([e,n])=>{t.defaultNodeAttributes[e]=J.toJSON(n)}))}if(e.defaultEdgeAttributes){let n=globalThis.Object.entries(e.defaultEdgeAttributes);n.length>0&&(t.defaultEdgeAttributes={},n.forEach(([e,n])=>{t.defaultEdgeAttributes[e]=J.toJSON(n)}))}return e.edgeU?.length&&(t.edgeU=e.edgeU.map(e=>Math.round(e))),e.edgeV?.length&&(t.edgeV=e.edgeV.map(e=>Math.round(e))),e.edgeAttributes?.length&&(t.edgeAttributes=e.edgeAttributes.map(e=>wS.toJSON(e))),t},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.nodeKeys=e.nodeKeys?.map(e=>J.fromPartial(e))||[],t.nodeAttributes=e.nodeAttributes?.map(e=>wS.fromPartial(e))||[],t.attributes=globalThis.Object.entries(e.attributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultNodeAttributes=globalThis.Object.entries(e.defaultNodeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultEdgeAttributes=globalThis.Object.entries(e.defaultEdgeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.edgeU=e.edgeU?.map(e=>e)||[],t.edgeV=e.edgeV?.map(e=>e)||[],t.edgeAttributes=e.edgeAttributes?.map(e=>wS.fromPartial(e))||[],t}};function VS(){return{key:``,value:void 0}}var HS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function US(){return{key:``,value:void 0}}var WS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function GS(){return{key:``,value:void 0}}var KS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function qS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.x=n.double();continue;case 4:if(e!==33)break;i.y=n.double();continue;case 5:if(e!==41)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return ZS.fromPartial(e??{})},fromPartial(e){let t=XS();return t.guid=e.guid??``,t.name=e.name??``,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function QS(){return{guid:``,name:``,x:0,y:0,z:0}}var $S={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(25).double(e.x),e.y!==0&&t.uint32(33).double(e.y),e.z!==0&&t.uint32(41).double(e.z),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=QS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.x=n.double();continue;case 4:if(e!==33)break;i.y=n.double();continue;case 5:if(e!==41)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return $S.fromPartial(e??{})},fromPartial(e){let t=QS();return t.guid=e.guid??``,t.name=e.name??``,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function eC(){return{guid:``,name:``,point:void 0,xaxis:void 0,yaxis:void 0}}var tC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.point!==void 0&&ZS.encode(e.point,t.uint32(26).fork()).join(),e.xaxis!==void 0&&$S.encode(e.xaxis,t.uint32(34).fork()).join(),e.yaxis!==void 0&&$S.encode(e.yaxis,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=eC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.point=ZS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.xaxis=$S.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.yaxis=$S.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,point:Y(e.point)?ZS.fromJSON(e.point):void 0,xaxis:Y(e.xaxis)?$S.fromJSON(e.xaxis):void 0,yaxis:Y(e.yaxis)?$S.fromJSON(e.yaxis):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.point!==void 0&&(t.point=ZS.toJSON(e.point)),e.xaxis!==void 0&&(t.xaxis=$S.toJSON(e.xaxis)),e.yaxis!==void 0&&(t.yaxis=$S.toJSON(e.yaxis)),t},create(e){return tC.fromPartial(e??{})},fromPartial(e){let t=eC();return t.guid=e.guid??``,t.name=e.name??``,t.point=e.point!==void 0&&e.point!==null?ZS.fromPartial(e.point):void 0,t.xaxis=e.xaxis!==void 0&&e.xaxis!==null?$S.fromPartial(e.xaxis):void 0,t.yaxis=e.yaxis!==void 0&&e.yaxis!==null?$S.fromPartial(e.yaxis):void 0,t}};function nC(){return{guid:``,name:``,point:void 0,normal:void 0}}var rC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.point!==void 0&&ZS.encode(e.point,t.uint32(26).fork()).join(),e.normal!==void 0&&$S.encode(e.normal,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=nC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.point=ZS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.normal=$S.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,point:Y(e.point)?ZS.fromJSON(e.point):void 0,normal:Y(e.normal)?$S.fromJSON(e.normal):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.point!==void 0&&(t.point=ZS.toJSON(e.point)),e.normal!==void 0&&(t.normal=$S.toJSON(e.normal)),t},create(e){return rC.fromPartial(e??{})},fromPartial(e){let t=nC();return t.guid=e.guid??``,t.name=e.name??``,t.point=e.point!==void 0&&e.point!==null?ZS.fromPartial(e.point):void 0,t.normal=e.normal!==void 0&&e.normal!==null?$S.fromPartial(e.normal):void 0,t}};function iC(){return{guid:``,name:``,w:0,x:0,y:0,z:0}}var aC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.w!==0&&t.uint32(25).double(e.w),e.x!==0&&t.uint32(33).double(e.x),e.y!==0&&t.uint32(41).double(e.y),e.z!==0&&t.uint32(49).double(e.z),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=iC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.w=n.double();continue;case 4:if(e!==33)break;i.x=n.double();continue;case 5:if(e!==41)break;i.y=n.double();continue;case 6:if(e!==49)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,w:Y(e.w)?globalThis.Number(e.w):0,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.w!==0&&(t.w=e.w),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return aC.fromPartial(e??{})},fromPartial(e){let t=iC();return t.guid=e.guid??``,t.name=e.name??``,t.w=e.w??0,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function oC(){return{guid:``,name:``,start:void 0,end:void 0}}var sC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.start!==void 0&&ZS.encode(e.start,t.uint32(26).fork()).join(),e.end!==void 0&&ZS.encode(e.end,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=oC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.start=ZS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.end=ZS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,start:Y(e.start)?ZS.fromJSON(e.start):void 0,end:Y(e.end)?ZS.fromJSON(e.end):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.start!==void 0&&(t.start=ZS.toJSON(e.start)),e.end!==void 0&&(t.end=ZS.toJSON(e.end)),t},create(e){return sC.fromPartial(e??{})},fromPartial(e){let t=oC();return t.guid=e.guid??``,t.name=e.name??``,t.start=e.start!==void 0&&e.start!==null?ZS.fromPartial(e.start):void 0,t.end=e.end!==void 0&&e.end!==null?ZS.fromPartial(e.end):void 0,t}};function cC(){return{guid:``,name:``,radius:0,frame:void 0}}var lC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.frame!==void 0&&tC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=cC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==34)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return lC.fromPartial(e??{})},fromPartial(e){let t=cC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function uC(){return{guid:``,name:``,circle:void 0,startAngle:0,endAngle:0}}var dC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.circle!==void 0&&lC.encode(e.circle,t.uint32(26).fork()).join(),e.startAngle!==0&&t.uint32(33).double(e.startAngle),e.endAngle!==0&&t.uint32(41).double(e.endAngle),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.circle=lC.decode(n,n.uint32());continue;case 4:if(e!==33)break;i.startAngle=n.double();continue;case 5:if(e!==41)break;i.endAngle=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,circle:Y(e.circle)?lC.fromJSON(e.circle):void 0,startAngle:Y(e.startAngle)?globalThis.Number(e.startAngle):Y(e.start_angle)?globalThis.Number(e.start_angle):0,endAngle:Y(e.endAngle)?globalThis.Number(e.endAngle):Y(e.end_angle)?globalThis.Number(e.end_angle):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.circle!==void 0&&(t.circle=lC.toJSON(e.circle)),e.startAngle!==0&&(t.startAngle=e.startAngle),e.endAngle!==0&&(t.endAngle=e.endAngle),t},create(e){return dC.fromPartial(e??{})},fromPartial(e){let t=uC();return t.guid=e.guid??``,t.name=e.name??``,t.circle=e.circle!==void 0&&e.circle!==null?lC.fromPartial(e.circle):void 0,t.startAngle=e.startAngle??0,t.endAngle=e.endAngle??0,t}};function fC(){return{guid:``,name:``,major:0,minor:0,frame:void 0}}var pC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(25).double(e.major),e.minor!==0&&t.uint32(33).double(e.minor),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=fC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.major=n.double();continue;case 4:if(e!==33)break;i.minor=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,major:Y(e.major)?globalThis.Number(e.major):0,minor:Y(e.minor)?globalThis.Number(e.minor):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return pC.fromPartial(e??{})},fromPartial(e){let t=fC();return t.guid=e.guid??``,t.name=e.name??``,t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function mC(){return{guid:``,name:``,focal:0,frame:void 0}}var hC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.focal!==0&&t.uint32(25).double(e.focal),e.frame!==void 0&&tC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=mC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.focal=n.double();continue;case 4:if(e!==34)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,focal:Y(e.focal)?globalThis.Number(e.focal):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.focal!==0&&(t.focal=e.focal),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return hC.fromPartial(e??{})},fromPartial(e){let t=mC();return t.guid=e.guid??``,t.name=e.name??``,t.focal=e.focal??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function gC(){return{guid:``,name:``,major:0,minor:0,frame:void 0}}var _C={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(25).double(e.major),e.minor!==0&&t.uint32(33).double(e.minor),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=gC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.major=n.double();continue;case 4:if(e!==33)break;i.minor=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,major:Y(e.major)?globalThis.Number(e.major):0,minor:Y(e.minor)?globalThis.Number(e.minor):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return _C.fromPartial(e??{})},fromPartial(e){let t=gC();return t.guid=e.guid??``,t.name=e.name??``,t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function vC(){return{guid:``,name:``,points:[],degree:0}}var yC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),e.degree!==0&&t.uint32(32).int32(e.degree),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=vC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],degree:Y(e.degree)?globalThis.Number(e.degree):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),e.degree!==0&&(t.degree=Math.round(e.degree)),t},create(e){return yC.fromPartial(e??{})},fromPartial(e){let t=vC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t.degree=e.degree??0,t}};function bC(){return{guid:``,name:``,points:[]}}var xC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=bC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return xC.fromPartial(e??{})},fromPartial(e){let t=bC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function SC(){return{guid:``,name:``,points:[]}}var CC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=SC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return CC.fromPartial(e??{})},fromPartial(e){let t=SC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function wC(){return{guid:``,name:``,frame:void 0,xsize:0,ysize:0,zsize:0}}var TC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.frame!==void 0&&tC.encode(e.frame,t.uint32(26).fork()).join(),e.xsize!==0&&t.uint32(33).double(e.xsize),e.ysize!==0&&t.uint32(41).double(e.ysize),e.zsize!==0&&t.uint32(49).double(e.zsize),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=wC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.frame=tC.decode(n,n.uint32());continue;case 4:if(e!==33)break;i.xsize=n.double();continue;case 5:if(e!==41)break;i.ysize=n.double();continue;case 6:if(e!==49)break;i.zsize=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0,xsize:Y(e.xsize)?globalThis.Number(e.xsize):0,ysize:Y(e.ysize)?globalThis.Number(e.ysize):0,zsize:Y(e.zsize)?globalThis.Number(e.zsize):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),e.xsize!==0&&(t.xsize=e.xsize),e.ysize!==0&&(t.ysize=e.ysize),e.zsize!==0&&(t.zsize=e.zsize),t},create(e){return TC.fromPartial(e??{})},fromPartial(e){let t=wC();return t.guid=e.guid??``,t.name=e.name??``,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t.xsize=e.xsize??0,t.ysize=e.ysize??0,t.zsize=e.zsize??0,t}};function EC(){return{guid:``,name:``,radius:0,frame:void 0}}var DC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.frame!==void 0&&tC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=EC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==34)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return DC.fromPartial(e??{})},fromPartial(e){let t=EC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function OC(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var kC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=OC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return kC.fromPartial(e??{})},fromPartial(e){let t=OC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function AC(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var jC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=AC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return jC.fromPartial(e??{})},fromPartial(e){let t=AC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function MC(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var NC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=MC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return NC.fromPartial(e??{})},fromPartial(e){let t=MC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function PC(){return{guid:``,name:``,radiusAxis:0,radiusPipe:0,frame:void 0}}var FC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radiusAxis!==0&&t.uint32(25).double(e.radiusAxis),e.radiusPipe!==0&&t.uint32(33).double(e.radiusPipe),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=PC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radiusAxis=n.double();continue;case 4:if(e!==33)break;i.radiusPipe=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radiusAxis:Y(e.radiusAxis)?globalThis.Number(e.radiusAxis):Y(e.radius_axis)?globalThis.Number(e.radius_axis):0,radiusPipe:Y(e.radiusPipe)?globalThis.Number(e.radiusPipe):Y(e.radius_pipe)?globalThis.Number(e.radius_pipe):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radiusAxis!==0&&(t.radiusAxis=e.radiusAxis),e.radiusPipe!==0&&(t.radiusPipe=e.radiusPipe),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return FC.fromPartial(e??{})},fromPartial(e){let t=PC();return t.guid=e.guid??``,t.name=e.name??``,t.radiusAxis=e.radiusAxis??0,t.radiusPipe=e.radiusPipe??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function IC(){return{guid:``,name:``,points:[]}}var LC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=IC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return LC.fromPartial(e??{})},fromPartial(e){let t=IC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function RC(){return{guid:``,name:``,matrix:[]}}var zC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=RC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return zC.fromPartial(e??{})},fromPartial(e){let t=RC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function BC(){return{guid:``,name:``,translationVector:void 0}}var VC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.translationVector!==void 0&&$S.encode(e.translationVector,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=BC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.translationVector=$S.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,translationVector:Y(e.translationVector)?$S.fromJSON(e.translationVector):Y(e.translation_vector)?$S.fromJSON(e.translation_vector):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.translationVector!==void 0&&(t.translationVector=$S.toJSON(e.translationVector)),t},create(e){return VC.fromPartial(e??{})},fromPartial(e){let t=BC();return t.guid=e.guid??``,t.name=e.name??``,t.translationVector=e.translationVector!==void 0&&e.translationVector!==null?$S.fromPartial(e.translationVector):void 0,t}};function HC(){return{guid:``,name:``,matrix:[]}}var UC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=HC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return UC.fromPartial(e??{})},fromPartial(e){let t=HC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function WC(){return{guid:``,name:``,matrix:[]}}var GC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=WC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return GC.fromPartial(e??{})},fromPartial(e){let t=WC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function KC(){return{guid:``,name:``,matrix:[]}}var qC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=KC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return qC.fromPartial(e??{})},fromPartial(e){let t=KC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function JC(){return{guid:``,name:``,matrix:[]}}var YC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=JC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return YC.fromPartial(e??{})},fromPartial(e){let t=JC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function XC(){return{guid:``,name:``,matrix:[]}}var ZC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=XC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return ZC.fromPartial(e??{})},fromPartial(e){let t=XC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function Y(e){return e!=null}var QC=class{data;constructor(e){let t;if(t=`bytes`in e?$C(e.bytes):e.data,t.x===void 0||t.y===void 0||t.z===void 0)throw Error(`Invalid PointData: Missing required properties (x, y, or z).`);this.data=t}get bytes(){return ew(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function $C(e){return ZS.decode(e)}function ew(e){return ZS.encode(e).finish()}function tw(e){if(e.length%3!=0)throw Error(`Invalid coordinate array: expected x, y, z triplets.`);let t=[];for(let n=0;ne+t,0);if(t.vertices.length%3!=0||n!==t.faceVertices.length)throw Error(`Invalid MeshData: malformed vertices or face arrays.`);this.data=t}get bytes(){return pw(this.data)}get guid(){return this.data.guid?this.data.guid:``}get name(){return this.data.name?this.data.name:``}get vertices(){return this._vertices||=tw(this.data.vertices),this._vertices}get faces(){let e=[],t=0;for(let n of this.data.faceSizes){let r=this.data.faceVertices.slice(t,t+n);e.push(new cw({data:{indices:r}})),t+=n}return e}};function fw(e){return ES.decode(e)}function pw(e){return ES.encode(e).finish()}var mw=class{data;constructor(e){this.data=`bytes`in e?hw(e.bytes):e.data}get bytes(){return gw(this.data)}get guid(){return this.data.guid||``}get name(){return this.data.name||``}get nodeKeys(){return this.data.nodeKeys.map(nE)}};function hw(e){return BS.decode(e)}function gw(e){return BS.encode(e).finish()}var _w=class{data;constructor(e){let t;if(t=`bytes`in e?vw(e.bytes):e.data,t.x===void 0||t.y===void 0||t.z===void 0)throw Error(`Invalid VectorData: Missing required properties (x, y, or z).`);this.data=t}get bytes(){return yw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function vw(e){return $S.decode(e)}function yw(e){return $S.encode(e).finish()}var bw=class{data;_point;_xaxis;_yaxis;constructor(e){let t;if(t=`bytes`in e?xw(e.bytes):e.data,!t.point||!t.xaxis||!t.yaxis)throw Error(`Invalid FrameData: Missing required properties (point, xaxis, or yaxis).`);this.data=t}get bytes(){return Sw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||=new QC({data:this.data.point}),this._point}get xaxis(){return this._xaxis||=new _w({data:this.data.xaxis}),this._xaxis}get yaxis(){return this._yaxis||=new _w({data:this.data.yaxis}),this._yaxis}};function xw(e){return tC.decode(e)}function Sw(e){return tC.encode(e).finish()}var Cw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?ww(e.bytes):e.data,!t.radius||!t.frame)throw Error(`Invalid CircleData: Missing required properties (radius or frame).`);this.data=t}get bytes(){return Tw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function ww(e){return lC.decode(e)}function Tw(e){return lC.encode(e).finish()}var Ew=class{data;_circle;constructor(e){let t;if(t=`bytes`in e?Dw(e.bytes):e.data,!t.startAngle||!t.endAngle||!t.circle)throw Error(`Invalid ArcData: Missing required properties (startAngle, endAngle, or circle).`);this.data=t}get bytes(){return Ow(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get startAngle(){return this.data.startAngle}get endAngle(){return this.data.endAngle}get circle(){return this._circle||=new Cw({data:this.data.circle}),this._circle}};function Dw(e){return dC.decode(e)}function Ow(e){return dC.encode(e).finish()}var kw=class{data;_points;constructor(e){let t;if(t=`bytes`in e?Aw(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid BezierData: Missing required property points.`);this.data=t}get bytes(){return jw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function Aw(e){return yC.decode(e)}function jw(e){return yC.encode(e).finish()}var Mw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Nw(e.bytes):e.data,!t.xsize||!t.ysize||!t.zsize||!t.frame)throw Error(`Invalid BoxData: Missing required properties (xsize, ysize, zsize, or frame).`);this.data=t}get bytes(){return Pw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get xsize(){return this.data.xsize}get ysize(){return this.data.ysize}get zsize(){return this.data.zsize}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Nw(e){return TC.decode(e)}function Pw(e){return TC.encode(e).finish()}var Fw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Iw(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid CapsuleData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return Lw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Iw(e){return NC.decode(e)}function Lw(e){return NC.encode(e).finish()}var Rw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?zw(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid ConeData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return Bw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function zw(e){return jC.decode(e)}function Bw(e){return jC.encode(e).finish()}var Vw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Hw(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid CylinderData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return Uw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Hw(e){return kC.decode(e)}function Uw(e){return kC.encode(e).finish()}var Ww=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Gw(e.bytes):e.data,!t.major||!t.minor||!t.frame)throw Error(`Invalid EllipseData: Missing required properties (major, minor, or frame).`);this.data=t}get bytes(){return Kw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Gw(e){return pC.decode(e)}function Kw(e){return pC.encode(e).finish()}var qw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Jw(e.bytes):e.data,!t.major||!t.minor||!t.frame)throw Error(`Invalid HyperbolaData: Missing required properties (a, b, or frame).`);this.data=t}get bytes(){return Yw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Jw(e){return _C.decode(e)}function Yw(e){return _C.encode(e).finish()}var Xw=class{data;_start;_end;constructor(e){let t;if(t=`bytes`in e?Zw(e.bytes):e.data,!t.start||!t.end)throw Error(`Invalid LineData: Missing required properties (start or end).`);this.data=t}get bytes(){return Qw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get start(){return this._start||=new QC({data:this.data.start}),this._start}get end(){return this._end||=new QC({data:this.data.end}),this._end}};function Zw(e){return sC.decode(e)}function Qw(e){return sC.encode(e).finish()}var $w=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?eT(e.bytes):e.data,!t.focal||!t.frame)throw Error(`Invalid ParabolaData: Missing required properties (focal_length or frame).`);this.data=t}get bytes(){return tT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get focal(){return this.data.focal}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function eT(e){return hC.decode(e)}function tT(e){return hC.encode(e).finish()}var nT=class{data;_point;_normal;constructor(e){let t;if(t=`bytes`in e?rT(e.bytes):e.data,!t.point||!t.normal)throw Error(`Invalid PlaneData: Missing required properties (point or normal).`);this.data=t}get bytes(){return iT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||=new QC({data:this.data.point}),this._point}get normal(){return this._normal||=new _w({data:this.data.normal}),this._normal}};function rT(e){return rC.decode(e)}function iT(e){return rC.encode(e).finish()}var aT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?oT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PointcloudData: Missing required property points.`);this.data=t}get bytes(){return sT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function oT(e){return LC.decode(e)}function sT(e){return LC.encode(e).finish()}var cT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?lT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PolygonData: Missing required property points.`);this.data=t}get bytes(){return uT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function lT(e){return CC.decode(e)}function uT(e){return CC.encode(e).finish()}var dT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?fT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PolylineData: Missing required property points.`);this.data=t}get bytes(){return pT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function fT(e){return xC.decode(e)}function pT(e){return xC.encode(e).finish()}var mT=class{data;constructor(e){let t;if(t=`bytes`in e?hT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ProjectionData: Missing required properties (direction).`);this.data=t}get bytes(){return gT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function hT(e){return ZC.decode(e)}function gT(e){return ZC.encode(e).finish()}var _T=class{data;constructor(e){let t;if(t=`bytes`in e?vT(e.bytes):e.data,!t.w||!t.x||!t.y||!t.z)throw Error(`Invalid QuaternionData: Missing required properties (w, x, y, or z).`);this.data=t}get bytes(){return yT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get w(){return this.data.w}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function vT(e){return aC.decode(e)}function yT(e){return aC.encode(e).finish()}var bT=class{data;constructor(e){let t;if(t=`bytes`in e?xT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ReflectionData: Missing required properties (frame).`);this.data=t}get bytes(){return ST(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function xT(e){return qC.decode(e)}function ST(e){return qC.encode(e).finish()}var CT=class{data;constructor(e){let t;if(t=`bytes`in e?wT(e.bytes):e.data,t.matrix.length!==16)throw Error(`Invalid RotationData: matrix must contain 16 values.`);this.data=t}get bytes(){return TT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function wT(e){return UC.decode(e)}function TT(e){return UC.encode(e).finish()}var ET=class{data;constructor(e){let t;if(t=`bytes`in e?DT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ScaleData: Missing required properties (factor or frame).`);this.data=t}get bytes(){return OT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function DT(e){return GC.decode(e)}function OT(e){return GC.encode(e).finish()}var kT=class{data;constructor(e){let t;if(t=`bytes`in e?AT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ShearData: Missing required properties (matrix).`);this.data=t}get bytes(){return jT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function AT(e){return YC.decode(e)}function jT(e){return YC.encode(e).finish()}var MT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?NT(e.bytes):e.data,!t.radius||!t.frame)throw Error(`Invalid SphereData: Missing required properties (radius or frame).`);this.data=t}get bytes(){return PT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function NT(e){return DC.decode(e)}function PT(e){return DC.encode(e).finish()}var FT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?IT(e.bytes):e.data,!t.radiusAxis||!t.radiusPipe||!t.frame)throw Error(`Invalid TorusData: Missing required properties (major, minor, or frame).`);this.data=t}get bytes(){return LT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radiusAxis(){return this.data.radiusAxis}get radiusPipe(){return this.data.radiusPipe}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function IT(e){return FC.decode(e)}function LT(e){return FC.encode(e).finish()}var RT=class{data;constructor(e){let t;t=`bytes`in e?zT(e.bytes):e.data,this.data=t}get bytes(){return BT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function zT(e){return zC.decode(e)}function BT(e){return zC.encode(e).finish()}var VT=class{data;_translationVector;constructor(e){let t;if(t=`bytes`in e?HT(e.bytes):e.data,!t.translationVector)throw Error(`Invalid TranslationData: Missing required properties (vector or frame).`);this.data=t}get bytes(){return UT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get translationVector(){return this._translationVector||=new _w({data:this.data.translationVector}),this._translationVector}};function HT(e){return VC.decode(e)}function UT(e){return VC.encode(e).finish()}var WT=class{data;constructor(e){let t;t=`bytes`in e?GT(e.bytes):e.data,this.data=t}get bytes(){return KT(this.data)}get asDict(){return oE(this.data)}};function GT(e){return hS.decode(e)}function KT(e){return hS.encode(e).finish()}var qT=class{data;constructor(e){let t;t=`bytes`in e?JT(e.bytes):e.data,this.data=t}get bytes(){return YT(this.data)}get asList(){return aE(this.data)}};function JT(e){return pS.decode(e)}function YT(e){return pS.encode(e).finish()}var XT=new Map([[`ArcData`,Ew],[`BezierData`,kw],[`BoxData`,Mw],[`CapsuleData`,Fw],[`CircleData`,Cw],[`ConeData`,Rw],[`CylinderData`,Vw],[`EllipseData`,Ww],[`FrameData`,bw],[`HyperbolaData`,qw],[`LineData`,Xw],[`ParabolaData`,$w],[`PlaneData`,nT],[`PointData`,QC],[`PointcloudData`,aT],[`PolygonData`,cT],[`PolylineData`,dT],[`ProjectionData`,mT],[`QuaternionData`,_T],[`ReflectionData`,bT],[`RotationData`,CT],[`ScaleData`,ET],[`ShearData`,kT],[`SphereData`,MT],[`TorusData`,FT],[`TransformationData`,RT],[`TranslationData`,VT],[`VectorData`,_w],[`MeshData`,dw],[`PolyhedronData`,aw],[`GraphData`,mw],[`DictData`,WT],[`ListData`,qT]]),ZT=`1.0.0`;function QT(e){return nE($T(e))}function $T(e){if(e.length===0)throw Error(`Binary data is empty.`);let t=yS.decode(e);if(tE(t.version),!t.data)throw Error(`Message contains no data.`);return t.data}function eE(e){let t=e.split(`.`);return t[0]===`0`&&t.length>=2?`${t[0]}.${t[1]}`:t[0]}function tE(e){if(!e)throw Error(`No version tag in the message; cannot verify compas_pb wire-format compatibility (reader is ${ZT}).`);if(eE(e)!==eE(`1.0.0`))throw Error(`Incompatible compas_pb wire format: message was written by version ${e} but this reader is ${ZT}.`)}function nE(e){if(e.value!==void 0)return rE(e.value);if(e.intValue!==void 0)return e.intValue;if(e.doubleValue!==void 0)return e.doubleValue;if(e.dictValue!==void 0)return oE(e.dictValue);if(e.listValue!==void 0)return aE(e.listValue);if(e.message!==void 0)return iE(e.message);if(e.fallback?.data!==void 0)return oE(e.fallback.data)}function rE(e){if(typeof e!=`string`||!e.startsWith(`base64:`))return e;let t=globalThis.atob(e.slice(7));return Uint8Array.from(t,e=>e.charCodeAt(0))}function iE(e){let t=e.typeUrl.split(`.`).slice(-1)[0];if(t===`ListData`)return aE(pS.decode(e.value));if(t===`DictData`)return oE(hS.decode(e.value));let n=XT.get(t);return n?new n({bytes:e.value}):null}function aE(e){return e.items.map(nE)}function oE(e){let t={};for(let n of Object.keys(e.items))t[n]=nE(e.items[n]);return t}function sE(e){return QT(e)}var cE=class{options;socket=null;retryTimer=null;stopped=!0;constructor(e){this.options=e}start(){this.stopped&&(this.stopped=!1,this.connect())}send(e){return this.socket?.readyState===WebSocket.OPEN?(this.socket.send(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`string`?e:JSON.stringify(e)),!0):this.options.send?.(e)!==!1&&this.options.send!==void 0}dispose(){this.stopped=!0,this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null);let e=this.socket;this.socket=null,e&&(e.onclose=null,e.close())}connect(){if(this.stopped)return;let e=new WebSocket(this.buildUrl());this.socket=e,e.binaryType=`arraybuffer`,e.onmessage=e=>{e.data instanceof ArrayBuffer&&this.options.dispatch(new Uint8Array(e.data))},e.onerror=()=>{this.options.onError(Error(`WebSocket connection failed: ${this.buildUrl()}`))},e.onclose=()=>{this.stopped||(this.retryTimer=setTimeout(()=>this.connect(),1e3))}}buildUrl(){let e=new URLSearchParams(window.location.search),t=this.options.host??e.get(`ws_host`)??`127.0.0.1`,n=this.options.port??Number(e.get(`ws_port`)??9001),r=this.options.workspace??e.get(`workspace`)??`main`;return`${this.options.secure??window.location.protocol===`https:`?`wss`:`ws`}://${t}:${n}/ws?workspace=${encodeURIComponent(r)}`}},lE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},uE={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},dE=1e3,fE=1001,pE=1002,mE=1003,hE=1004,gE=1005,_E=1006,vE=1007,yE=1008,bE=1009,xE=1010,SE=1011,CE=1012,wE=1013,TE=1014,EE=1015,DE=1016,OE=1017,kE=1018,AE=1020,jE=35902,ME=35899,NE=1021,PE=1022,FE=1023,IE=1026,LE=1027,RE=1028,zE=1029,BE=1030,VE=1031,HE=1033,UE=33776,WE=33777,GE=33778,KE=33779,qE=35840,JE=35841,YE=35842,XE=35843,ZE=36196,QE=37492,$E=37496,eD=37488,tD=37489,nD=37490,rD=37491,iD=37808,aD=37809,oD=37810,sD=37811,cD=37812,lD=37813,uD=37814,dD=37815,fD=37816,pD=37817,mD=37818,hD=37819,gD=37820,_D=37821,vD=36492,yD=36494,bD=36495,xD=36283,SD=36284,CD=36285,wD=36286,TD=2300,ED=2301,DD=2302,OD=2400,kD=2401,AD=2402,jD=3200,MD=`srgb`,ND=`srgb-linear`,PD=`linear`,FD=`srgb`,ID=7680,LD=35044,RD=2e3;function zD(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function BD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function VD(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function HD(){let e=VD(`canvas`);return e.style.display=`block`,e}var UD={};function WD(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function GD(...e){let t=`THREE.`+e.shift();console.warn(t,...e)}function KD(...e){let t=`THREE.`+e.shift();console.error(t,...e)}function qD(...e){let t=e.join(` `);t in UD||(UD[t]=!0,GD(...e))}function JD(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var YD=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+XD[e>>16&255]+XD[e>>24&255]+`-`+XD[t&255]+XD[t>>8&255]+`-`+XD[t>>16&15|64]+XD[t>>24&255]+`-`+XD[n&63|128]+XD[n>>8&255]+`-`+XD[n>>16&255]+XD[n>>24&255]+XD[r&255]+XD[r>>8&255]+XD[r>>16&255]+XD[r>>24&255]).toLowerCase()}function tO(e,t,n){return Math.max(t,Math.min(n,e))}function nO(e,t){return(e%t+t)%t}function rO(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function iO(e,t,n){return e===t?0:(n-e)/(t-e)}function aO(e,t,n){return(1-n)*e+n*t}function oO(e,t,n,r){return aO(e,t,1-Math.exp(-n*r))}function sO(e,t=1){return t-Math.abs(nO(e,t*2)-t)}function cO(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function lO(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function uO(e,t){return e+Math.floor(Math.random()*(t-e+1))}function dO(e,t){return e+Math.random()*(t-e)}function fO(e){return e*(.5-Math.random())}function pO(e){e!==void 0&&(ZD=e);let t=ZD+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function mO(e){return e*QD}function hO(e){return e*$D}function gO(e){return!(e&e-1)&&e!==0}function _O(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function vO(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function yO(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:GD(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function bO(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function xO(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var SO={DEG2RAD:QD,RAD2DEG:$D,generateUUID:eO,clamp:tO,euclideanModulo:nO,mapLinear:rO,inverseLerp:iO,lerp:aO,damp:oO,pingpong:sO,smoothstep:cO,smootherstep:lO,randInt:uO,randFloat:dO,randFloatSpread:fO,seededRandom:pO,degToRad:mO,radToDeg:hO,isPowerOfTwo:gO,ceilPowerOfTwo:_O,floorPowerOfTwo:vO,setQuaternionFromProperEuler:yO,normalize:xO,denormalize:bO},X=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=tO(this.x,e.x,t.x),this.y=tO(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=tO(this.x,e,t),this.y=tO(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(tO(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(tO(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},CO=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:GD(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tO(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},Z=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(TO.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(TO.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=tO(this.x,e.x,t.x),this.y=tO(this.y,e.y,t.y),this.z=tO(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=tO(this.x,e,t),this.y=tO(this.y,e,t),this.z=tO(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(tO(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return wO.copy(this).projectOnVector(e),this.sub(wO)}reflect(e){return this.sub(wO.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(tO(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},wO=new Z,TO=new CO,EO=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(DO.makeScale(e,t)),this}rotate(e){return this.premultiply(DO.makeRotation(-e)),this}translate(e,t){return this.premultiply(DO.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},DO=new EO,OO=new EO().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),kO=new EO().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function AO(){let e={enabled:!0,workingColorSpace:ND,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=MO(e.r),e.g=MO(e.g),e.b=MO(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=NO(e.r),e.g=NO(e.g),e.b=NO(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?PD:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return qD(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return qD(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[ND]:{primaries:t,whitePoint:r,transfer:PD,toXYZ:OO,fromXYZ:kO,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:MD},outputColorSpaceConfig:{drawingBufferColorSpace:MD}},[MD]:{primaries:t,whitePoint:r,transfer:FD,toXYZ:OO,fromXYZ:kO,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:MD}}}),e}var jO=AO();function MO(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function NO(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var PO,FO=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{PO===void 0&&(PO=VD(`canvas`)),PO.width=e.width,PO.height=e.height;let t=PO.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=PO}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=VD(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(BO).x}get height(){return this.source.getSize(BO).y}get depth(){return this.source.getSize(BO).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){GD(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){GD(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case dE:e.x-=Math.floor(e.x);break;case fE:e.x=e.x<0?0:1;break;case pE:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case dE:e.y-=Math.floor(e.y);break;case fE:e.y=e.y<0?0:1;break;case pE:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};VO.DEFAULT_IMAGE=null,VO.DEFAULT_MAPPING=300,VO.DEFAULT_ANISOTROPY=1;var HO=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,YO),YO.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(rk),ik.subVectors(this.max,rk),ZO.subVectors(e.a,rk),QO.subVectors(e.b,rk),$O.subVectors(e.c,rk),ek.subVectors(QO,ZO),tk.subVectors($O,QO),nk.subVectors(ZO,$O);let t=[0,-ek.z,ek.y,0,-tk.z,tk.y,0,-nk.z,nk.y,ek.z,0,-ek.x,tk.z,0,-tk.x,nk.z,0,-nk.x,-ek.y,ek.x,0,-tk.y,tk.x,0,-nk.y,nk.x,0];return!sk(t,ZO,QO,$O,ik)||(t=[1,0,0,0,1,0,0,0,1],!sk(t,ZO,QO,$O,ik))?!1:(ak.crossVectors(ek,tk),t=[ak.x,ak.y,ak.z],sk(t,ZO,QO,$O,ik))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,YO).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(YO).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(JO[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),JO[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),JO[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),JO[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),JO[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),JO[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),JO[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),JO[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(JO),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},JO=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],YO=new Z,XO=new qO,ZO=new Z,QO=new Z,$O=new Z,ek=new Z,tk=new Z,nk=new Z,rk=new Z,ik=new Z,ak=new Z,ok=new Z;function sk(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){ok.fromArray(e,a);let o=i.x*Math.abs(ok.x)+i.y*Math.abs(ok.y)+i.z*Math.abs(ok.z),s=t.dot(ok),c=n.dot(ok),l=r.dot(ok);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var ck=new qO,lk=new Z,uk=new Z,dk=class{constructor(e=new Z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?ck.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;lk.subVectors(e,this.center);let t=lk.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(lk,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(uk.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lk.copy(e.center).add(uk)),this.expandByPoint(lk.copy(e.center).sub(uk))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},fk=new Z,pk=new Z,mk=new Z,hk=new Z,gk=new Z,_k=new Z,vk=new Z,yk=class{constructor(e=new Z,t=new Z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fk)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=fk.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fk.copy(this.origin).addScaledVector(this.direction,t),fk.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){pk.copy(e).add(t).multiplyScalar(.5),mk.copy(t).sub(e).normalize(),hk.copy(this.origin).sub(pk);let i=e.distanceTo(t)*.5,a=-this.direction.dot(mk),o=hk.dot(this.direction),s=-hk.dot(mk),c=hk.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0){if(u=a*s-o,d=a*o-s,p=i*l,u>=0){if(d>=-p){if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c)}else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(pk).addScaledVector(mk,d),f}intersectSphere(e,t){fk.subVectors(e.center,this.origin);let n=fk.dot(this.direction),r=fk.dot(fk)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,fk)!==null}intersectTriangle(e,t,n,r,i){gk.subVectors(t,e),_k.subVectors(n,e),vk.crossVectors(gk,_k);let a=this.direction.dot(vk),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;hk.subVectors(this.origin,e);let s=o*this.direction.dot(_k.crossVectors(hk,_k));if(s<0)return null;let c=o*this.direction.dot(gk.cross(hk));if(c<0||s+c>a)return null;let l=-o*hk.dot(vk);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},bk=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();let t=this.elements,n=e.elements,r=1/xk.setFromMatrixColumn(e,0).length(),i=1/xk.setFromMatrixColumn(e,1).length(),a=1/xk.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ck,e,wk)}lookAt(e,t,n){let r=this.elements;return Dk.subVectors(e,t),Dk.lengthSq()===0&&(Dk.z=1),Dk.normalize(),Tk.crossVectors(n,Dk),Tk.lengthSq()===0&&(Math.abs(n.z)===1?Dk.x+=1e-4:Dk.z+=1e-4,Dk.normalize(),Tk.crossVectors(n,Dk)),Tk.normalize(),Ek.crossVectors(Dk,Tk),r[0]=Tk.x,r[4]=Ek.x,r[8]=Dk.x,r[1]=Tk.y,r[5]=Ek.y,r[9]=Dk.y,r[2]=Tk.z,r[6]=Ek.z,r[10]=Dk.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],ee=r[2],k=r[6],A=r[10],te=r[14],j=r[3],ne=r[7],M=r[11],N=r[15];return i[0]=a*x+o*T+s*ee+c*j,i[4]=a*S+o*E+s*k+c*ne,i[8]=a*C+o*D+s*A+c*M,i[12]=a*w+o*O+s*te+c*N,i[1]=l*x+u*T+d*ee+f*j,i[5]=l*S+u*E+d*k+f*ne,i[9]=l*C+u*D+d*A+f*M,i[13]=l*w+u*O+d*te+f*N,i[2]=p*x+m*T+h*ee+g*j,i[6]=p*S+m*E+h*k+g*ne,i[10]=p*C+m*D+h*A+g*M,i[14]=p*w+m*O+h*te+g*N,i[3]=_*x+v*T+y*ee+b*j,i[7]=_*S+v*E+y*k+b*ne,i[11]=_*C+v*D+y*A+b*M,i[15]=_*w+v*O+y*te+b*N,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let i=xk.set(r[0],r[1],r[2]).length(),a=xk.set(r[4],r[5],r[6]).length(),o=xk.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),Sk.copy(this);let s=1/i,c=1/a,l=1/o;return Sk.elements[0]*=s,Sk.elements[1]*=s,Sk.elements[2]*=s,Sk.elements[4]*=c,Sk.elements[5]*=c,Sk.elements[6]*=c,Sk.elements[8]*=l,Sk.elements[9]*=l,Sk.elements[10]*=l,t.setFromRotationMatrix(Sk),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=RD,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=RD,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},xk=new Z,Sk=new bk,Ck=new Z(0,0,0),wk=new Z(1,1,1),Tk=new Z,Ek=new Z,Dk=new Z,Ok=new bk,kk=new CO,Ak=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(tO(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-tO(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(tO(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-tO(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(tO(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-tO(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:GD(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ok.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ok,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return kk.setFromEuler(this),this.setFromQuaternion(kk,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Ak.DEFAULT_ORDER=`XYZ`;var jk=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Jk.subVectors(r,t),Yk.subVectors(n,t),Xk.subVectors(e,t);let a=Jk.dot(Jk),o=Jk.dot(Yk),s=Jk.dot(Xk),c=Yk.dot(Yk),l=Yk.dot(Xk),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Zk)!==null&&Zk.x>=0&&Zk.y>=0&&Zk.x+Zk.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Zk)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Zk.x),s.addScaledVector(a,Zk.y),s.addScaledVector(o,Zk.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return iA.setScalar(0),aA.setScalar(0),oA.setScalar(0),iA.fromBufferAttribute(e,t),aA.fromBufferAttribute(e,n),oA.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(iA,i.x),a.addScaledVector(aA,i.y),a.addScaledVector(oA,i.z),a}static isFrontFacing(e,t,n,r){return Jk.subVectors(n,t),Yk.subVectors(e,t),Jk.cross(Yk).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Jk.subVectors(this.c,this.b),Yk.subVectors(this.a,this.b),Jk.cross(Yk).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Qk.subVectors(r,n),$k.subVectors(i,n),tA.subVectors(e,n);let s=Qk.dot(tA),c=$k.dot(tA);if(s<=0&&c<=0)return t.copy(n);nA.subVectors(e,r);let l=Qk.dot(nA),u=$k.dot(nA);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Qk,a);rA.subVectors(e,i);let f=Qk.dot(rA),p=$k.dot(rA);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector($k,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return eA.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(eA,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Qk,a).addScaledVector($k,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},cA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},lA={h:0,s:0,l:0},uA={h:0,s:0,l:0};function dA(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var fA=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=MD){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,jO.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=jO.workingColorSpace){return this.r=e,this.g=t,this.b=n,jO.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=jO.workingColorSpace){if(e=nO(e,1),t=tO(t,0,1),n=tO(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=dA(i,r,e+1/3),this.g=dA(i,r,e),this.b=dA(i,r,e-1/3)}return jO.colorSpaceToWorking(this,r),this}setStyle(e,t=MD){function n(t){t!==void 0&&parseFloat(t)<1&&GD(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:GD(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);GD(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=MD){let n=cA[e.toLowerCase()];return n===void 0?GD(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=MO(e.r),this.g=MO(e.g),this.b=MO(e.b),this}copyLinearToSRGB(e){return this.r=NO(e.r),this.g=NO(e.g),this.b=NO(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=MD){return jO.workingToColorSpace(pA.copy(this),e),Math.round(tO(pA.r*255,0,255))*65536+Math.round(tO(pA.g*255,0,255))*256+Math.round(tO(pA.b*255,0,255))}getHexString(e=MD){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=jO.workingColorSpace){jO.workingToColorSpace(pA.copy(this),t);let n=pA.r,r=pA.g,i=pA.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){GD(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){GD(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},gA=class extends hA{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new fA(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ak,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},_A=new Z,vA=new X,yA=0,bA=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:yA++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=LD,this.updateRanges=[],this.gpuType=EE,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&GD(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qO);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){KD(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(MA.copy(i).invert(),NA.copy(e.ray).applyMatrix4(MA),(n.boundingBox===null||NA.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,NA)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null){if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:HA.clone(),object:e}}function WA(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,IA),e.getVertexPosition(c,LA),e.getVertexPosition(l,RA);let u=UA(e,t,n,r,IA,LA,RA,VA);if(u){let e=new Z;sA.getBarycoord(VA,IA,LA,RA,e),i&&(u.uv=sA.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=sA.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=sA.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};sA.getNormal(IA,LA,RA,t.normal),u.face=t,u.barycoord=e}return u}var GA=class e extends jA{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new CA(c,3)),this.setAttribute(`normal`,new CA(l,3)),this.setAttribute(`uv`,new CA(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;ei.value||r.value||o.value?tc(t.default({present:o.value})[0],{ref:e=>{let t=ad(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),gf=R({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=md(n.default()),r=e.findIndex(e=>e.type!==os);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?ks(t,i.props):t,o=Ss({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),_f=[`area`,`img`,`input`],vf=R({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&_f.includes(r)?()=>tc(r,t):r===`template`?()=>tc(gf,t,{default:n.default}):()=>tc(e.as,t,{default:n.default})}});function yf(){let e=F();return{primitiveElement:e,currentElement:W(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ad(e))}}var bf=`dismissableLayer.pointerDownOutside`,xf=`dismissableLayer.focusOutside`;function Sf(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r){});return br(o=>{if(!Hu||!dn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(Sf(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Iu(bf,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{dn(n)&&(i.value=!0)}}}function wf(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=F(!1);return br(a=>{if(!Hu||!dn(n))return;let o=async n=>{if(!t?.value)return;await Yn(),await Yn();let r=n.target;!t.value||!r||Sf(t.value,r)||n.target&&!i.value&&Iu(xf,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{dn(n)&&(i.value=!0)},onBlurCapture:()=>{dn(n)&&(i.value=!1)}}}var Tf=R({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Id(),o=W(()=>a.value?.ownerDocument??globalThis.document),s=W(()=>_d.layersRoot),c=W(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=W(()=>_d.layersWithOutsidePointerEventsDisabled.size>0),u=W(()=>{let e=Array.from(s.value),[t]=[..._d.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Cf(async e=>{let t=[..._d.branches].some(t=>t?.contains(e.target));!n.present||!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Yn(),e.defaultPrevented||r(`dismiss`))},a),f=wf(e=>{let t=[..._d.branches].some(t=>t?.contains(e.target));!n.present||t||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ud(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Cr([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{!e||!n||t&&(_d.layersWithOutsidePointerEventsDisabled.size===0&&(_d.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),_d.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{_d.layersWithOutsidePointerEventsDisabled.delete(e),_d.layersWithOutsidePointerEventsDisabled.size===0&&!Lu(_d.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=_d.originalBodyPointerEvents)}))},{immediate:!0}),Cr([a,()=>n.present],([e,t],n,r)=>{!e||!t||(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),br(e=>{e(()=>{a.value&&(s.value.delete(a.value),_d.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(B(),V(I(vf),{ref:I(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:ue({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:I(f).onFocusCapture,onBlurCapture:I(f).onBlurCapture,onPointerdownCapture:I(d).onPointerDownCapture},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),Ef=Vu(()=>F([]));function Df(){let e=Ef();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Of(e.value,t),e.value.unshift(t)},remove(t){e.value=Of(e.value,t),e.value[0]?.resume()}}}function Of(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var kf=`focusScope.autoFocusOnMount`,Af=`focusScope.autoFocusOnUnmount`,jf={bubbles:!1,cancelable:!0};function Mf(e,{select:t=!1}={}){let n=Fu();for(let r of e)if(Rf(r,{select:t}),Fu()!==n)return!0}function Nf(e){let t=Pf(e);return[Ff(t,e),Ff(t.reverse(),e)]}function Pf(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ff(e,t){for(let n of e)if(!If(n,{upTo:t}))return n}function If(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Lf(e){return e instanceof HTMLInputElement&&`select`in e}function Rf(e,{select:t=!1}={}){if(e&&e.focus){let n=Fu();e.focus({preventScroll:!0}),e!==n&&Lf(e)&&t&&e.select()}}var zf=R({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},present:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=Id(),o=F(null),s=Df(),c=Kt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});br(e=>{if(!Hu)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Rf(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Rf(o.value,{select:!0}))}function s(e){let n=o.value;n!==null&&e.some(e=>e.removedNodes.length>0)&&(t.contains(n)||Rf(t))}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})});function l(e,t){let n=new CustomEvent(kf,jf),i=e=>r(`mountAutoFocus`,e);e.addEventListener(kf,i),e.dispatchEvent(n),e.removeEventListener(kf,i),n.defaultPrevented||(Mf(Pf(e),{select:!0}),Fu()===t&&Rf(e))}br(async e=>{let t=a.value;if(await Yn(),!t)return;n.present!==!1&&s.add(c);let i=Fu();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(Af,jf),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(Af,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||Rf(i??document.body,{select:!0}),t.removeEventListener(Af,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),Cr(()=>n.present,async(e,t)=>{if(!Hu)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await Yn();let n=a.value;if(!n)return;let r=Fu();n.contains(r)||l(n,r)});function u(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=Fu();if(t&&r){let t=e.currentTarget,[i,a]=Nf(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Rf(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Rf(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(B(),V(I(vf),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Bf=[`Enter`,` `],Vf=[`ArrowDown`,`PageUp`,`Home`],Hf=[`ArrowUp`,`PageDown`,`End`];[...Vf,...Hf],[...Bf],[...Bf];function Uf(e){let t=Fu();for(let n of e)if(n===t||(n.focus(),Fu()!==t))return}var Wf=R({__name:`Teleport`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e,n=hd({}),r=W(()=>t.to??n.teleportTo?.value??`body`),i=sd();return(e,t)=>I(i)||e.forceMount?(B(),V(Rr,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[z(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):Ts(`v-if`,!0)}}),Gf=`data-reka-collection-item`;function Kf(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:F(),itemMap:F(new Map)},hr(r,i)):i=gr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${Gf}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},o=R({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=yf();return Cr(a,()=>{i.collectionRef.value=a.value}),()=>tc(gf,{ref:r,...n},t)}}),s=R({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=yf();return br(t=>{if(a.value){let n=nn(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>tc(gf,{...n,[Gf]:``,ref:r},t)}});return{getItems:a,reactiveItems:W(()=>Array.from(i.itemMap.value.values())),itemMapSize:W(()=>i.itemMap.value.size),CollectionSlot:o,CollectionItem:s}}var qf=R({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),V(I(vf),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),Jf=R({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=yf();return Cr(W(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(B(),V(qf,ks({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),Yf=R({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=W(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=W(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(B(),ms(is,null,[Ts(` We render single input if it's required `),n.value?(B(),V(Jf,ks({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(B(!0),ms(is,{key:1},da(r.value,n=>(B(),V(Jf,ks({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),Xf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Zf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Qf(e,t,n){let r=Zf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Xf[r]}function $f(e,t=!1){let n=Fu();for(let r of e)if(r===n||(r.focus({preventScroll:t}),Fu()!==n))return}function ep(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[tp,np]=Pu(`PopperRoot`),rp=R({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=F();return np({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>z(e.$slots,`default`)}}),ip=R({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Id(),i=tp();return xr(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(B(),V(I(vf),{ref:I(n),as:e.as,"as-child":e.asChild},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function ap(e){return e!==null}function op(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=sp(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function sp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var cp=[`top`,`right`,`bottom`,`left`],lp=Math.min,up=Math.max,dp=Math.round,fp=Math.floor,pp=e=>({x:e,y:e}),mp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function hp(e,t,n){return up(e,lp(t,n))}function gp(e,t){return typeof e==`function`?e(t):e}function _p(e){return e.split(`-`)[0]}function vp(e){return e.split(`-`)[1]}function yp(e){return e===`x`?`y`:`x`}function bp(e){return e===`y`?`height`:`width`}function xp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Sp(e){return yp(xp(e))}function Cp(e,t,n){n===void 0&&(n=!1);let r=vp(e),i=Sp(e),a=bp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Mp(o)),[o,Mp(o)]}function wp(e){let t=Mp(e);return[Tp(e),t,Tp(t)]}function Tp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ep=[`left`,`right`],Dp=[`right`,`left`],Op=[`top`,`bottom`],kp=[`bottom`,`top`];function Ap(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Dp:Ep:t?Ep:Dp;case`left`:case`right`:return t?Op:kp;default:return[]}}function jp(e,t,n,r){let i=vp(e),a=Ap(_p(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Tp)))),a}function Mp(e){let t=_p(e);return mp[t]+e.slice(t.length)}function Np(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Np(e)}function Fp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ip(e,t,n){let{reference:r,floating:i}=e,a=xp(t),o=Sp(t),s=bp(o),c=_p(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(vp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function Lp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=gp(t,e),p=Pp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Fp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Fp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Rp=50,zp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Lp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ip(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=gp(e,t)||{};if(l==null)return{};let d=Pp(u),f={x:n,y:r},p=Sp(i),m=bp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=lp(d[_],T),D=lp(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=hp(O,k,ee),te=!c.arrow&&vp(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===xp(t)||T.every(e=>xp(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=xp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Hp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Up(e){return cp.some(t=>e[t]>=0)}var Wp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=gp(e,t);switch(i){case`referenceHidden`:{let e=Hp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Up(e)}}}case`escaped`:{let e=Hp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Up(e)}}}default:return{}}}}},Gp=new Set([`left`,`top`]);async function Kp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_p(n),s=vp(n),c=xp(n)===`y`,l=Gp.has(o)?-1:1,u=a&&c?-1:1,d=gp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var qp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Kp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Jp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=gp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=xp(_p(i)),p=yp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=hp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=hp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Yp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=gp(e,t),u={x:n,y:r},d=xp(i),f=yp(d),p=u[f],m=u[d],h=gp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Gp.has(_p(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},Xp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=gp(e,t),u=await o.detectOverflow(t,l),d=_p(i),f=vp(i),p=xp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=lp(h-u[g],v),x=lp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=up(u.left,0),t=up(u.right,0),n=up(u.top,0),r=up(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:up(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:up(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Zp(){return typeof window<`u`}function Qp(e){return tm(e)?(e.nodeName||``).toLowerCase():`#document`}function $p(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function em(e){return((tm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tm(e){return Zp()?e instanceof Node||e instanceof $p(e).Node:!1}function nm(e){return Zp()?e instanceof Element||e instanceof $p(e).Element:!1}function rm(e){return Zp()?e instanceof HTMLElement||e instanceof $p(e).HTMLElement:!1}function im(e){return!Zp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $p(e).ShadowRoot}function am(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=gm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function om(e){return/^(table|td|th)$/.test(Qp(e))}function sm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var cm=/transform|translate|scale|rotate|perspective|filter/,lm=/paint|layout|strict|content/,um=e=>!!e&&e!==`none`,dm;function fm(e){let t=nm(e)?gm(e):e;return um(t.transform)||um(t.translate)||um(t.scale)||um(t.rotate)||um(t.perspective)||!mm()&&(um(t.backdropFilter)||um(t.filter))||cm.test(t.willChange||``)||lm.test(t.contain||``)}function pm(e){let t=vm(e);for(;rm(t)&&!hm(t);){if(fm(t))return t;if(sm(t))return null;t=vm(t)}return null}function mm(){return dm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dm}function hm(e){return/^(html|body|#document)$/.test(Qp(e))}function gm(e){return $p(e).getComputedStyle(e)}function _m(e){return nm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vm(e){if(Qp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||im(e)&&e.host||em(e);return im(t)?t.host:t}function ym(e){let t=vm(e);return hm(t)?e.ownerDocument?e.ownerDocument.body:e.body:rm(t)&&am(t)?t:ym(t)}function bm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ym(e),i=r===e.ownerDocument?.body,a=$p(r);if(i){let e=xm(a);return t.concat(a,a.visualViewport||[],am(r)?r:[],e&&n?bm(e):[])}return t.concat(r,bm(r,[],n))}function xm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sm(e){let t=gm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=dp(n)!==a||dp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Cm(e){return nm(e)?e:e.contextElement}function wm(e){let t=Cm(e);if(!rm(t))return pp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Sm(t),o=(a?dp(n.width):n.width)/r,s=(a?dp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Tm=pp(0);function Em(e){let t=$p(e);return!mm()||!t.visualViewport?Tm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$p(e)?!1:t}function Om(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Cm(e),o=pp(1);t&&(r?nm(r)&&(o=wm(r)):o=wm(e));let s=Dm(a,n,r)?Em(a):pp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=$p(a),t=r&&nm(r)?$p(r):r,n=e,i=xm(n);for(;i&&r&&t!==n;){let e=wm(i),t=i.getBoundingClientRect(),r=gm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=$p(i),i=xm(n)}}return Fp({width:u,height:d,x:c,y:l})}function km(e,t){let n=_m(e).scrollLeft;return t?t.left+n:Om(em(e)).left+n}function Am(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-km(e,n),y:n.top+t.scrollTop}}function jm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=em(r),s=t?sm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=pp(1),u=pp(0),d=rm(r);if((d||!d&&!a)&&((Qp(r)!==`body`||am(o))&&(c=_m(r)),d)){let e=Om(r);l=wm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Am(o,c):pp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Mm(e){return Array.from(e.getClientRects())}function Nm(e){let t=em(e),n=_m(e),r=e.ownerDocument.body,i=up(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=up(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+km(e),s=-n.scrollTop;return gm(r).direction===`rtl`&&(o+=up(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Pm=25;function Fm(e,t){let n=$p(e),r=em(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=mm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=km(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Pm&&(a-=o)}else l<=Pm&&(a+=l);return{width:a,height:o,x:s,y:c}}function Im(e,t){let n=Om(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rm(e)?wm(e):pp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Lm(e,t,n){let r;if(t===`viewport`)r=Fm(e,n);else if(t===`document`)r=Nm(em(e));else if(nm(t))r=Im(t,n);else{let n=Em(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fp(r)}function Rm(e,t){let n=vm(e);return n===t||!nm(n)||hm(n)?!1:gm(n).position===`fixed`||Rm(n,t)}function zm(e,t){let n=t.get(e);if(n)return n;let r=bm(e,[],!1).filter(e=>nm(e)&&Qp(e)!==`body`),i=null,a=gm(e).position===`fixed`,o=a?vm(e):e;for(;nm(o)&&!hm(o);){let t=gm(o),n=fm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||am(o)&&!n&&Rm(e,o))?r=r.filter(e=>e!==o):i=t,o=vm(o)}return t.set(e,r),r}function Bm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?sm(t)?[]:zm(t,this._c):[].concat(n),r],o=Lm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{o(!1,1e-7)},1e3)}n===1&&!Ym(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Zm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Cm(e),u=i||a?[...l?bm(l):[],...t?bm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Xm(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Om(e):null;c&&g();function g(){let t=Om(e);h&&!Ym(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Qm=qp,$m=Jp,eh=Vp,th=Xp,nh=Wp,rh=Bp,ih=Yp,ah=(e,t,n)=>{let r=new Map,i={platform:Jm,...n},a={...i.platform,_c:r};return zp(e,t,{...i,platform:a})};function oh(e){return typeof e==`object`&&!!e&&`$el`in e}function sh(e){if(oh(e)){let t=e.$el;return tm(t)&&Qp(t)===`#comment`?null:t}return e}function ch(e){return typeof e==`function`?e():I(e)}function lh(e){return{name:`arrow`,options:e,fn(t){let n=sh(ch(e.element));return n==null?{}:rh({element:n,padding:e.padding}).fn(t)}}}function uh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dh(e,t){let n=uh(e);return Math.round(t*n)/n}function fh(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=W(()=>ch(n.open)??!0),a=W(()=>ch(n.middleware)),o=W(()=>ch(n.placement)??`bottom`),s=W(()=>ch(n.strategy)??`absolute`),c=W(()=>ch(n.transform)??!0),l=W(()=>sh(e.value)),u=W(()=>sh(t.value)),d=F(0),f=F(0),p=F(s.value),m=F(o.value),h=sn({}),g=F(!1),_=W(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=dh(u.value,d.value),n=dh(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...uh(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;ah(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return Cr([a,o,s,i],y,{flush:`sync`}),Cr([l,u],x,{flush:`sync`}),Cr(i,S,{flush:`sync`}),Ae()&&je(b),{x:Yt(d),y:Yt(f),strategy:Yt(p),placement:Yt(m),middlewareData:Yt(h),isPositioned:Yt(g),floatingStyles:_,update:y}}var ph=[`dir`],mh={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[hh,gh]=Pu(`PopperContent`),_h=R({inheritAttrs:!1,__name:`PopperContent`,props:ja({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...mh}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=tp(),{forwardRef:a,currentElement:o}=Id(),s=Ad(W(()=>n.dir)),c=F(),l=F(),{width:u,height:d}=cf(l),f=W(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=W(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=W(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=W(()=>({padding:p.value,boundary:m.value.filter(ap),altBoundary:m.value.length>0})),g=W(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=W(()=>[Qm({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&eh({...h.value,...g.value}),n.avoidCollisions&&$m({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?ih():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&eh({...h.value,...g.value}),th({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&lh({element:l.value,padding:n.arrowPadding}),op({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&nh({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=fh(W(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>Zm(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=W(()=>sp(y.value)[0]),w=W(()=>sp(y.value)[1]);xr(()=>{b.value&&r(`placed`)});let T=W(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),E=F(``);return br(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)}),gh({placedSide:C,onArrowChange:e=>l.value=e,arrowX:W(()=>x.value.arrow?.x??0),arrowY:W(()=>x.value.arrow?.y??0),shouldHideArrow:T}),(e,t)=>(B(),ms(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:I(s),style:ue({...I(v),transform:I(b)?I(v).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:E.value,"--reka-popper-transform-origin":[I(x).transformOrigin?.x,I(x).transformOrigin?.y].join(` `),...I(x).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?rc([n.asChild,n.as,C.value,w.value,I(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(B(),V(I(vf),ks({key:0,ref:I(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,style:{animation:I(b)?void 0:`none`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(B(),V(I(vf),ks({key:1,ref:I(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,dir:I(s),style:{animation:I(b)?void 0:`none`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,ph))}});function vh(e){let t=hd({nonce:F()});return W(()=>e?.value||t.nonce?.value)}var[yh,bh]=Pu(`RovingFocusGroup`),xh=R({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=yh(),r=af(),i=W(()=>t.tabStopId||r),a=W(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=Kf();Ji(()=>{t.focusable&&n.onFocusableItemAdd()}),Qi(()=>{t.focusable&&n.onFocusableItemRemove()}),Cr(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=Qf(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?ep(i,t+1):i.slice(t+1)}Yn(()=>$f(i))}}return(e,t)=>(B(),V(I(s),null,{default:L(()=>[U(I(vf),{tabindex:a.value?0:-1,"data-orientation":I(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?I(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>I(n).onItemFocus(i.value),onKeydown:c},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[Sh,Ch]=Pu(`CheckboxGroupRoot`);function wh(e){return e===`indeterminate`}function Th(e){return wh(e)?`indeterminate`:e?`checked`:`unchecked`}var[Eh,Dh]=Pu(`CheckboxRoot`),Oh=R({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Id(),o=Sh(null),s=pd(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=W(()=>o?.disabled.value||n.disabled),l=W(()=>Au(s.value,n.trueValue)),u=W(()=>Lu(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:Ru(o.modelValue.value,n.value));function d(){if(Lu(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(Ru(e,n.value)){let t=e.findIndex(e=>Au(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=Fd(a),p=zd(),m=Oa(),h=W(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return Dh({disabled:c,state:u}),(e,t)=>(B(),ms(is,null,[(B(),V(sa(I(o)?.rovingFocus.value?I(xh):I(vf)),ks({...e.$attrs,...I(p)},{id:e.id,ref:I(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":I(wh)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":I(Th)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:I(o)?.rovingFocus.value?!c.value:void 0,onKeydown:su(au(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),I(f)&&e.name&&!I(o)?(B(),V(I(Yf),ks({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},I(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):Ts(`v-if`,!0)],64))}}),kh=R({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=Id(),n=Eh();return(e,r)=>(B(),V(I(hf),{present:e.forceMount||I(wh)(I(n).state.value)||I(n).state.value===!0},{default:L(()=>[U(I(vf),ks({ref:I(t),"data-state":I(Th)(I(n).state.value),"data-disabled":I(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}});function Ah(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function jh(e,t,n){return ju(100/(n-t)*(e-t),0,100)}function Mh(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Nh(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Ph(e,t,n){let r=e/2;return(r-Lh([0,50],[0,r])(t)*n)*n}function Fh(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Ih(e,t){if(t>0){let n=Fh(e);return Math.min(...n)>=t}return!0}function Lh(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rh(e){return(String(e).split(`.`)[1]||``).length}function zh(e,t){let n=10**t;return Math.round(e*n)/n}var Bh=[`PageUp`,`PageDown`],Vh=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Hh={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageUp`,`ArrowUp`,`ArrowLeft`]},[Uh,Wh]=Pu([`SliderVertical`,`SliderHorizontal`]),Gh=R({__name:`SliderHorizontal`,props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:a,dir:o,inverted:s}=gn(n),{forwardRef:c,currentElement:l}=Id(),u=qh(),d=F(),f=F(),p=W(()=>o?.value!==`rtl`&&!s.value||o?.value!==`ltr`&&s.value);function m(e,t){let n=f.value||l.value.getBoundingClientRect(),r=[...u.thumbElements.value][u.valueIndexToChangeRef.value],o=u.thumbAlignment.value===`contain`?r.clientWidth:0;!d.value&&!t&&u.thumbAlignment.value===`contain`&&(d.value=e.clientX-r.getBoundingClientRect().left);let s=Lh([0,n.width-o],p.value?[a.value,i.value]:[i.value,a.value]);return f.value=n,s(t?e.clientX-n.left-o/2:e.clientX-n.left-(d.value??0))}return Wh({startEdge:W(()=>p.value?`left`:`right`),endEdge:W(()=>p.value?`right`:`left`),direction:W(()=>p.value?1:-1),size:`width`}),(e,t)=>(B(),V(Xh,{ref:I(c),dir:I(o),"data-orientation":`horizontal`,style:ue({"--reka-slider-thumb-transform":!p.value&&I(u).thumbAlignment.value===`overflow`?`translateX(50%)`:`translateX(-50%)`}),onSlideStart:t[0]||=e=>{let t=m(e,!0);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=m(e);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{f.value=void 0,d.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=p.value?`from-left`:`from-right`,n=I(Hh)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`dir`,`style`]))}}),Kh=R({__name:`SliderVertical`,props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:a,inverted:o}=gn(n),s=qh(),{forwardRef:c,currentElement:l}=Id(),u=F(),d=F(),f=W(()=>!o.value);function p(e,t){let n=d.value||l.value.getBoundingClientRect(),r=[...s.thumbElements.value][s.valueIndexToChangeRef.value],o=s.thumbAlignment.value===`contain`?r.clientHeight:0;!u.value&&!t&&s.thumbAlignment.value===`contain`&&(u.value=e.clientY-r.getBoundingClientRect().top);let c=Lh([0,n.height-o],f.value?[i.value,a.value]:[a.value,i.value]),p=t?e.clientY-n.top-o/2:e.clientY-n.top-(u.value??0);return d.value=n,c(p)}return Wh({startEdge:W(()=>f.value?`bottom`:`top`),endEdge:W(()=>f.value?`top`:`bottom`),direction:W(()=>f.value?1:-1),size:`height`}),(e,t)=>(B(),V(Xh,{ref:I(c),"data-orientation":`vertical`,style:ue({"--reka-slider-thumb-transform":!f.value&&I(s).thumbAlignment.value===`overflow`?`translateY(-50%)`:`translateY(50%)`}),onSlideStart:t[0]||=e=>{let t=p(e,!0);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=p(e);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{d.value=void 0,u.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=f.value?`from-bottom`:`from-top`,n=I(Hh)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`style`]))}}),[qh,Jh]=Pu(`SliderRoot`),Yh=R({inheritAttrs:!1,__name:`SliderRoot`,props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:`contain`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:t}){let n=e,r=t,{min:i,max:a,step:o,minStepsBetweenThumbs:s,orientation:c,disabled:l,thumbAlignment:u,dir:d}=gn(n),f=Ad(d),{forwardRef:p,currentElement:m}=Id(),h=Fd(m),{CollectionSlot:g}=Kf({isProvider:!0}),_=pd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),v=W(()=>Array.isArray(_.value)?[..._.value]:[]),y=F(0),b=F(v.value);function x(e){w(e,Nh(v.value,e))}function S(e){w(e,y.value)}function C(){let e=b.value[y.value];v.value[y.value]!==e&&r(`valueCommit`,tn(v.value))}function w(e,t,{commit:n}={commit:!1}){let c=Rh(o.value),l=ju(zh(Math.round((e-i.value)/o.value)*o.value+i.value,c),i.value,a.value),u=Ah(v.value,l,t);if(Ih(u,s.value*o.value)){y.value=u.indexOf(l);let e=String(u)!==String(_.value);e&&n&&r(`valueCommit`,u),e&&(T.value[y.value]?.focus(),_.value=u)}}let T=F([]);return Jh({modelValue:_,currentModelValue:v,valueIndexToChangeRef:y,thumbElements:T,orientation:c,min:i,max:a,disabled:l,thumbAlignment:u}),(e,t)=>(B(),V(I(g),null,{default:L(()=>[(B(),V(sa(I(c)===`horizontal`?Gh:Kh),ks(e.$attrs,{ref:I(p),"as-child":e.asChild,as:e.as,min:I(i),max:I(a),dir:I(f),inverted:e.inverted,"aria-disabled":I(l),"data-disabled":I(l)?``:void 0,onPointerdown:t[0]||=()=>{I(l)||(b.value=v.value)},onSlideStart:t[1]||=e=>!I(l)&&x(e),onSlideMove:t[2]||=e=>!I(l)&&S(e),onSlideEnd:t[3]||=e=>!I(l)&&C(),onHomeKeyDown:t[4]||=e=>!I(l)&&w(I(i),0,{commit:!0}),onEndKeyDown:t[5]||=e=>!I(l)&&w(I(a),v.value.length-1,{commit:!0}),onStepKeyDown:t[6]||=(e,t)=>{if(!I(l)){let n=I(Bh).includes(e.key)||e.shiftKey&&I(Vh).includes(e.key)?10:1,r=y.value,i=v.value[r];w(i+I(o)*n*t,r,{commit:!0})}}}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(_)}),I(h)&&e.name?(B(),V(I(Yf),{key:0,type:`number`,value:I(_),name:e.name,required:e.required,disabled:I(l),step:I(o)},null,8,[`value`,`name`,`required`,`disabled`,`step`])):Ts(`v-if`,!0)]),_:3},16,[`as-child`,`as`,`min`,`max`,`dir`,`inverted`,`aria-disabled`,`data-disabled`]))]),_:3}))}}),Xh=R({__name:`SliderImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},emits:[`slideStart`,`slideMove`,`slideEnd`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,i=qh();return(e,t)=>(B(),V(I(vf),ks({"data-slider-impl":``},n,{onKeydown:t[0]||=e=>{e.key===`Home`?(r(`homeKeyDown`,e),e.preventDefault()):e.key===`End`?(r(`endKeyDown`,e),e.preventDefault()):I(Bh).concat(I(Vh)).includes(e.key)&&(r(`stepKeyDown`,e),e.preventDefault())},onPointerdown:t[1]||=e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),I(i).thumbElements.value.includes(t)?t.focus():r(`slideStart`,e)},onPointermove:t[2]||=e=>{e.target.hasPointerCapture(e.pointerId)&&r(`slideMove`,e)},onPointerup:t[3]||=e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(`slideEnd`,e))}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Zh=R({__name:`SliderRange`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qh(),n=Uh();Id();let r=W(()=>t.currentModelValue.value.map(e=>jh(e,t.min.value,t.max.value))),i=W(()=>t.currentModelValue.value.length>1?Math.min(...r.value):0),a=W(()=>100-Math.max(...r.value,0));return(e,r)=>(B(),V(I(vf),{"data-disabled":I(t).disabled.value?``:void 0,"data-orientation":I(t).orientation.value,"as-child":e.asChild,as:e.as,style:ue({[I(n).startEdge.value]:`${i.value}%`,[I(n).endEdge.value]:`${a.value}%`})},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`data-disabled`,`data-orientation`,`as-child`,`as`,`style`]))}}),Qh=R({inheritAttrs:!1,__name:`SliderThumbImpl`,props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=qh(),r=Uh(),{forwardRef:i,currentElement:a}=Id(),{CollectionItem:o}=Kf(),s=W(()=>n.modelValue?.value?.[t.index]),c=W(()=>s.value===void 0?0:jh(s.value,n.min.value??0,n.max.value??100)),l=W(()=>Mh(t.index,n.modelValue?.value?.length??0)),u=cf(a),d=W(()=>u[r.size].value),f=W(()=>n.thumbAlignment.value===`overflow`||!d.value?0:Ph(d.value,c.value,r.direction.value)),p=sd();return Ji(()=>{n.thumbElements.value.push(a.value)}),Qi(()=>{let e=n.thumbElements.value.findIndex(e=>e===a.value)??-1;n.thumbElements.value.splice(e,1)}),(e,t)=>(B(),V(I(o),null,{default:L(()=>[U(I(vf),ks(e.$attrs,{ref:I(i),role:`slider`,tabindex:I(n).disabled.value?void 0:0,"aria-label":e.$attrs[`aria-label`]||l.value,"data-disabled":I(n).disabled.value?``:void 0,"data-orientation":I(n).orientation.value,"aria-valuenow":s.value,"aria-valuemin":I(n).min.value,"aria-valuemax":I(n).max.value,"aria-orientation":I(n).orientation.value,"as-child":e.asChild,as:e.as,style:{transform:`var(--reka-slider-thumb-transform)`,position:`absolute`,[I(r).startEdge.value]:`calc(${c.value}% + ${f.value}px)`,display:!I(p)&&s.value===void 0?`none`:void 0},onFocus:t[0]||=()=>{I(n).valueIndexToChangeRef.value=e.index}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`tabindex`,`aria-label`,`data-disabled`,`data-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-orientation`,`as-child`,`as`,`style`])]),_:3}))}}),$h=R({__name:`SliderThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{getItems:n}=Kf(),{forwardRef:r,currentElement:i}=Id(),a=W(()=>i.value?n(!0).findIndex(e=>e.ref===i.value):-1);return(e,n)=>(B(),V(Qh,ks({ref:I(r)},t,{index:a.value}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`index`]))}}),eg=R({__name:`SliderTrack`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qh();return Id(),(e,n)=>(B(),V(I(vf),{"as-child":e.asChild,as:e.as,"data-disabled":I(t).disabled.value?``:void 0,"data-orientation":I(t).orientation.value},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`data-disabled`,`data-orientation`]))}}),[tg,ng]=Pu(`PopoverRoot`),rg=R({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=gn(n),a=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return ng({contentId:``,triggerId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:F(),hasCustomAnchor:F(!1)}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{open:I(a),close:()=>a.value=!1})]),_:3}))}}),ig=R({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Ld($u(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=Id(),o=tg();return Nd(),(e,t)=>(B(),V(I(zf),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:L(()=>[U(I(Tf),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>I(o).onOpenChange(!1)},{default:L(()=>[U(I(_h),ks(I(i),{id:I(o).contentId,ref:I(a),"data-state":I(o).open.value?`open`:`closed`,"aria-labelledby":I(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),ag=R({__name:`PopoverContentModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=F(!1);Cd(!0);let o=Rd(n,r),{forwardRef:s,currentElement:c}=Id();return nf(c),(e,t)=>(B(),V(ig,ks(I(o),{ref:I(s),"trap-focus":I(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=au(e=>{r(`closeAutoFocus`,e),a.value||I(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,i=t.button===2||n;a.value=i},onFocusOutside:t[2]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),og=R({__name:`PopoverContentNonModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=F(!1),o=F(!1),s=Rd(n,r);return(e,t)=>(B(),V(ig,ks(I(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||I(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;I(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),sg=R({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=Rd(n,r),{forwardRef:o}=Id();return i.contentId||=af(void 0,`reka-popover-content`),(e,t)=>(B(),V(I(hf),{present:e.forceMount||I(i).open.value},{default:L(()=>[I(i).modal.value?(B(),V(ag,ks({key:0},I(a),{ref:I(o)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)):(B(),V(og,ks({key:1},I(a),{ref:I(o)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),cg=R({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),lg=R({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=tg(),{forwardRef:r,currentElement:i}=Id();return n.triggerId||=af(void 0,`reka-popover-trigger`),Ji(()=>{n.triggerElement.value=i.value}),(e,i)=>(B(),V(sa(I(n).hasCustomAnchor.value?I(vf):I(ip)),{"as-child":``},{default:L(()=>[U(I(vf),{id:I(n).triggerId,ref:I(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":I(n).open.value,"aria-controls":I(n).contentId,"data-state":I(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:I(n).onOpenToggle},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),ug=new Map,dg=!1;try{dg=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}var fg=!1;try{fg=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}var pg={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}},mg=class{format(e){let t=``;if(t=!dg&&this.options.signDisplay!=null?gg(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!fg){let{unit:e,unitDisplay:n=`short`,locale:r}=this.resolvedOptions();if(!e)return t;let i=pg[e]?.[n];t+=i[r]||i.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!dg&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!fg&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=hg(e,t),this.options=t}};function hg(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!fg){let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!pg[e]?.[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let r=e+(t?Object.entries(t).sort((e,t)=>e[0]0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);return[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`),t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r)}return e.format(n)}}var _g=RegExp(`^.*\\(.*\\).*$`),vg=[`latn`,`arab`,`hanidec`,`deva`,`beng`,`fullwide`],yg=class{parse(e){return xg(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return xg(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return xg(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}},bg=new Map;function xg(e,t,n){let r=Sg(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of vg)if(i!==r.options.numberingSystem){let r=Sg(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function Sg(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]-1&&(t=`-${t}`)}let n=t?+t:NaN;if(isNaN(n))return NaN;if(this.options.style===`percent`){let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new yg(this.locale,e).parse(new mg(this.locale,e).format(n))}return this.options.currencySign===`accounting`&&_g.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=e.replace(`,`,this.symbols.decimal),e=e.replace(`،`,this.symbols.decimal)),this.symbols.group&&(e=Dg(e,`.`,this.symbols.group))),this.symbols.group===`’`&&e.includes(`'`)&&(e=Dg(e,`'`,this.symbols.group)),this.options.locale===`fr-FR`&&this.symbols.group&&(e=Dg(e,` `,this.symbols.group),e=Dg(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,t=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Dg(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits??=t.maximumFractionDigits),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=Eg(e,this.formatter,this.options,t),this.options.style===`percent`&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}},wg=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),Tg=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function Eg(e,t,n,r){let i=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`}),a=i.formatToParts(-10000.111),o=i.formatToParts(10000.111),s=Tg.map(e=>i.formatToParts(e)),c=a.find(e=>e.type===`minusSign`)?.value??`-`,l=o.find(e=>e.type===`plusSign`)?.value;!l&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(l=`+`);let u=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(e=>e.type===`decimal`)?.value,d=a.find(e=>e.type===`group`)?.value,f=a.filter(e=>!wg.has(e.type)).map(e=>Og(e.value)),p=s.flatMap(e=>e.filter(e=>!wg.has(e.type)).map(e=>Og(e.value))),m=[...new Set([...f,...p])].sort((e,t)=>t.length-e.length),h=m.length===0?RegExp(`[\\p{White_Space}]`,`gu`):RegExp(`${m.join(`|`)}|[\\p{White_Space}]`,`gu`),g=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),_=new Map(g.map((e,t)=>[e,t])),v=RegExp(`[${g.join(``)}]`,`g`);return{minusSign:c,plusSign:l,decimal:u,group:d,literals:h,numeral:v,index:e=>String(_.get(e))}}function Dg(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function Og(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function kg(e){let{disabled:t}=e,n=F(),r=Bu(),i=()=>window.clearTimeout(n.value),a=e=>{i(),!t.value&&(r.trigger(),n.value=window.setTimeout(()=>{a(60)},e))},o=()=>{a(400)},s=()=>{i()},c=F(!1),l=W(()=>ad(e.target)),u=e=>{e.button!==0||c.value||(e.preventDefault(),c.value=!0,o())},d=()=>{c.value=!1,s()};return Hu&&(od(l||window,`pointerdown`,u),od(window,`pointerup`,d),od(window,`pointercancel`,d)),{isPressed:c,onTrigger:r.on}}function Ag(e,t=F({})){return Qu(()=>new mg(e.value,t.value))}function jg(e,t=F({})){return Qu(()=>new yg(e.value,t.value))}function Mg(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var[Ng,Pg]=Pu(`NumberFieldRoot`),Fg=R({inheritAttrs:!1,__name:`NumberFieldRoot`,props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i,readonly:a,disableWheelChange:o,invertWheelChange:s,min:c,max:l,step:u,stepSnapping:d,formatOptions:f,id:p,locale:m}=gn(n),h=pd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:g,currentElement:_}=yf(),v=sf(m),y=Fd(_),b=F(),x=W(()=>Lu(h.value)||isNaN(h.value)?!1:C(`decrease`,h.value)>=h.value),S=W(()=>Lu(h.value)||isNaN(h.value)?!1:C(`increase`,h.value)<=h.value);function C(e,t,n=1){let r=u.value??1,i=e===`increase`?`+`:`-`,a;if(d.value&&!isNaN(r)){let o=Nu(t,c.value,l.value,r);if(o===t)a=Mg(i,t,r*n);else{let s=e===`increase`?o>t?o:Mg(`+`,o,r):o1?Mg(i,s,r*(n-1)):s}}else a=Mg(i,t,r*n);return M(a)}function w(e,t=1){if(n.focusOnChange&&b.value?.focus(),n.disabled||n.readonly)return;let r=ee.parse(b.value?.value??``);if(isNaN(r)){h.value=M(c.value??0);return}h.value=C(e,r,t)}function T(e=1){w(`increase`,e)}function E(e=1){w(`decrease`,e)}function D(e){e===`min`&&c.value!==void 0?h.value=M(c.value):e===`max`&&l.value!==void 0&&(h.value=M(l.value))}let O=Ag(v,f),ee=jg(v,f),k=W(()=>O.resolvedOptions().maximumFractionDigits>0?`decimal`:`numeric`),A=Ag(v,f),te=W(()=>Lu(h.value)||isNaN(h.value)?``:A.format(h.value));function j(e){return ee.isValidPartialNumber(e,c.value,l.value)}function ne(e){b.value&&(b.value.value=e)}function M(e){let t;return t=u.value===void 0||isNaN(u.value)||!d.value?ju(e,c.value,l.value):Nu(e,c.value,l.value,u.value),t=ee.parse(O.format(t)),t}function N(e){let t=ee.parse(e);return h.value=isNaN(t)?void 0:M(t),e.length?ne(te.value):ne(e)}return Pg({modelValue:h,handleDecrease:E,handleIncrease:T,handleMinMaxValue:D,inputMode:k,inputEl:b,onInputElement:e=>b.value=e,textValue:te,readonly:a,validate:j,applyInputValue:N,disabled:i,disableWheelChange:o,invertWheelChange:s,max:l,min:c,isDecreaseDisabled:x,isIncreaseDisabled:S,id:p}),(e,t)=>(B(),V(I(vf),ks(e.$attrs,{ref_key:`primitiveElement`,ref:g,role:`group`,as:e.as,"as-child":e.asChild,"data-disabled":I(i)?``:void 0,"data-readonly":I(a)?``:void 0}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(h),textValue:te.value,readonly:I(a)}),I(y)&&e.name?(B(),V(I(Yf),{key:0,type:`text`,value:I(h),name:e.name,disabled:I(i),readonly:I(a),required:e.required},null,8,[`value`,`name`,`disabled`,`readonly`,`required`])):Ts(`v-if`,!0)]),_:3},16,[`as`,`as-child`,`data-disabled`,`data-readonly`]))}}),Ig=R({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Ng(),r=W(()=>n.disabled?.value||n.readonly.value||t.disabled||n.isDecreaseDisabled.value),{primitiveElement:i,currentElement:a}=yf(),{isPressed:o,onTrigger:s}=kg({target:a,disabled:r});return s(()=>{n.handleDecrease()}),(e,n)=>(B(),V(I(vf),ks(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Decrease`,type:e.as===`button`?`button`:void 0,style:{userSelect:I(o)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":I(o)?`true`:void 0,onContextmenu:n[0]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Lg=R({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Ng(),r=W(()=>n.disabled?.value||n.readonly.value||t.disabled||n.isIncreaseDisabled.value),{primitiveElement:i,currentElement:a}=yf(),{isPressed:o,onTrigger:s}=kg({target:a,disabled:r});return s(()=>{n.handleIncrease()}),(e,n)=>(B(),V(I(vf),ks(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Increase`,type:e.as===`button`?`button`:void 0,style:{userSelect:I(o)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":I(o)?`true`:void 0,onContextmenu:n[0]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Rg=R({__name:`NumberFieldInput`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=yf(),i=Ng(),a=of(),{isComposing:o,handleCompositionStart:s,handleCompositionEnd:c}=kd();function l(e){if(!(o.value||e.isComposing))switch(e.key){case a.ARROW_UP:e.preventDefault(),i.handleIncrease();break;case a.ARROW_DOWN:e.preventDefault(),i.handleDecrease();break;case a.PAGE_UP:e.preventDefault(),i.handleIncrease(10);break;case a.PAGE_DOWN:e.preventDefault(),i.handleDecrease(10);break;case a.HOME:e.preventDefault(),i.handleMinMaxValue(`min`);break;case a.END:e.preventDefault(),i.handleMinMaxValue(`max`);break;case a.ENTER:i.applyInputValue(e.target?.value)}}function u(e){i.disableWheelChange.value||e.target===Fu()&&(Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),e.deltaY>0?i.invertWheelChange.value?i.handleDecrease():i.handleIncrease():e.deltaY<0&&(i.invertWheelChange.value?i.handleIncrease():i.handleDecrease())))}Ji(()=>{i.onInputElement(r.value)});let d=F(i.textValue.value);Cr(()=>i.textValue.value,()=>{d.value=i.textValue.value},{immediate:!0,deep:!0});function f(){requestAnimationFrame(()=>{d.value=i.textValue.value})}return(e,r)=>(B(),V(I(vf),ks(t,{id:I(i).id.value,ref_key:`primitiveElement`,ref:n,value:d.value,role:`spinbutton`,type:`text`,tabindex:`0`,inputmode:I(i).inputMode.value,disabled:I(i).disabled.value?``:void 0,"data-disabled":I(i).disabled.value?``:void 0,readonly:I(i).readonly.value?``:void 0,"data-readonly":I(i).readonly.value?``:void 0,autocomplete:`off`,autocorrect:`off`,spellcheck:`false`,"aria-roledescription":`Number field`,"aria-valuenow":I(i).modelValue.value,"aria-valuemin":I(i).min.value,"aria-valuemax":I(i).max.value,onKeydown:l,onWheel:u,onBeforeinput:r[0]||=e=>{if(e.isComposing||e.inputType.startsWith(`delete`)||e.inputType.startsWith(`history`))return;let t=e.target,n=t.value.slice(0,t.selectionStart??void 0)+(e.data??``)+t.value.slice(t.selectionEnd??void 0);I(i).validate(n)||e.preventDefault()},onInput:r[1]||=e=>{let t=e.target;d.value=t.value},onChange:f,onBlur:r[2]||=e=>I(i).applyInputValue(e.target?.value),onCompositionstart:I(s),onCompositionend:I(c)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`value`,`inputmode`,`disabled`,`data-disabled`,`readonly`,`data-readonly`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`onCompositionstart`,`onCompositionend`]))}}),zg=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Bg=[` `,`Enter`];function Vg(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>Hg(e,t,n)):Hg(e,t,n)}function Hg(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Au(e,t)}function Ug(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var Wg=[`value`],[Gg,Kg]=Pu(`SelectRoot`),qg=R({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=gn(n),c=pd(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=F(),d=F(),f=F({x:0,y:0}),p=W(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:Lu(c.value));Kf({isProvider:!0});let m=Ad(s),h=Fd(u),g=F(new Set),_=W(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>Hg(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>Vg(e,t.value,n.by))}return Kg({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{modelValue:I(c),open:I(l)}),I(h)&&e.name?(B(),V(Jg,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:I(o),required:I(i),name:e.name,autocomplete:e.autocomplete,disabled:I(a),value:I(c)},{default:L(()=>[I(Lu)(I(c))?(B(),ms(`option`,{key:0,value:e.nullableValue},null,8,Wg)):Ts(`v-if`,!0),(B(!0),ms(is,null,da(Array.from(g.value),e=>(B(),ms(`option`,ks({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):Ts(`v-if`,!0)]),_:3}))}}),Jg=R({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=F(),r=Gg();Cr(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(B(),V(I(qf),{"as-child":``},{default:L(()=>[H(`select`,ks({ref_key:`selectElement`,ref:n},t,{onInput:i}),[z(e.$slots,`default`)],16)]),_:3}))}}),Yg=R({__name:`SelectPopperPosition`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Ld(e);return(e,n)=>(B(),V(I(_h),ks(I(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Xg={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[Zg,Qg]=Pu(`SelectContent`),$g=R({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Gg();Nd(),Cd(n.bodyLock);let{CollectionSlot:a,getItems:o}=Kf(),s=F();nf(s);let{search:c,handleTypeaheadSearch:l}=uf(),u=F(),d=F(),f=F(),p=F(!1),m=F(!1),h=F(!1);function g(){d.value&&s.value&&Uf([d.value,s.value])}Cr(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;br(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>Uf(t)),e.preventDefault()}}let b=Ld(W(()=>n.position===`popper`?n:{}).value);return Qg({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=Vg(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else(a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(Vg(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(B(),V(I(a),null,{default:L(()=>[U(I(zf),{"as-child":``,onMountAutoFocus:t[6]||=au(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(I(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:L(()=>[U(I(Tf),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=au(()=>{},[`prevent`]),onDismiss:t[3]||=e=>I(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:L(()=>[(B(),V(sa(e.position===`popper`?Yg:n_),ks({...e.$attrs,...I(b)},{id:I(i).contentId,ref:e=>{if(!e)return;let t=I(ad)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":I(i).open.value?`open`:`closed`,dir:I(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=au(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[e_,t_]=Pu(`SelectItemAlignedPosition`),n_=R({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=Kf(),a=Gg(),o=Zg(),s=F(!1),c=F(!0),l=F(),{forwardRef:u,currentElement:d}=Id(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=ju(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=ju(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),E=e.top+e.height/2-10,D=u-E,O=p.value.offsetHeight/2,ee=p.value.offsetTop+O,k=_+v+ee,A=x-k;if(k<=E){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=k+Math.max(D,O+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(E,_+f.value.offsetTop+(e?w:0)+O)+A;l.value.style.height=`${t}px`,f.value.scrollTop=k-E+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=F(``);Ji(async()=>{await Yn(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return fd(a.triggerElement,()=>{g()}),t_({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(B(),ms(`div`,{ref_key:`contentWrapperElement`,ref:l,style:ue({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[U(I(vf),ks({ref:I(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)],4))}}),r_=R({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return Kg(e.context),Qg(Xg),(e,t)=>z(e.$slots,`default`)}}),i_={key:1},a_=R({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Rd(n,t),i=Gg(),a=F();Ji(()=>{a.value=new DocumentFragment});let o=F(),s=W(()=>n.forceMount||i.open.value),c=F(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return Cr(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),Qi(u),(e,t)=>s.value||c.value||o.value?.present?(B(),V(I(hf),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:L(()=>[U($g,ge(xs({...I(r),...e.$attrs})),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(B(),ms(`div`,i_,[(B(),V(Rr,{to:a.value},[U(r_,{context:I(i)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):Ts(`v-if`,!0)}}),o_=R({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),V(I(vf),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:L(()=>[z(e.$slots,`default`,{},()=>[t[0]||=Cs(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[s_,c_]=Pu(`SelectItem`),l_=R({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=gn(n),a=Gg(),o=Zg(),{forwardRef:s,currentElement:c}=Id(),{CollectionItem:l}=Kf(),u=W(()=>Vg(a.modelValue?.value,n.value,a.by)),d=F(!1),f=F(n.textValue??``),p=af(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||Iu(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await Yn(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await Yn(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await Yn(),!e.defaultPrevented&&e.currentTarget===Fu()&&o.onItemLeave?.()}async function v(e){await Yn(),!e.defaultPrevented&&(o.searchRef?.value===``||e.key!==` `)&&(Bg.includes(e.key)&&m(e),e.key===` `&&e.preventDefault())}if(n.value===``)throw Error(`A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Ji(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),c_({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(B(),V(I(l),{value:{textValue:f.value}},{default:L(()=>[U(I(vf),{ref:I(s),role:`option`,"aria-labelledby":I(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":I(i)||void 0,"data-disabled":I(i)?``:void 0,tabindex:I(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=au(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),u_=R({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=s_();return(e,r)=>I(n).isSelected.value?(B(),V(I(vf),ks({key:0,"aria-hidden":`true`},t),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)):Ts(`v-if`,!0)}}),d_=R({inheritAttrs:!1,__name:`SelectItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Gg(),r=Zg(),i=s_(),{forwardRef:a,currentElement:o}=Id(),s=W(()=>({value:i.value,disabled:i.disabled.value,textContent:o.value?.textContent??i.value?.toString()??``}));return Ji(()=>{o.value&&(i.onItemTextChange(o.value),r.itemTextRefCallback(o.value,i.value,i.disabled.value),n.onOptionAdd(s.value))}),Qi(()=>{n.onOptionRemove(s.value)}),(e,n)=>(B(),V(I(vf),ks({id:I(i).textId,ref:I(a)},{...t,...e.$attrs}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`]))}}),f_=R({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),p_=R({__name:`SelectScrollButtonImpl`,emits:[`autoScroll`],setup(e,{emit:t}){let n=t,{getItems:r}=Kf(),i=Zg(),a=F(null);function o(){a.value!==null&&(window.clearInterval(a.value),a.value=null)}br(()=>{r().map(e=>e.ref).find(e=>e===Fu())?.scrollIntoView({block:`nearest`})});function s(){a.value===null&&(a.value=window.setInterval(()=>{n(`autoScroll`)},50))}function c(){i.onItemLeave?.(),a.value===null&&(a.value=window.setInterval(()=>{n(`autoScroll`)},50))}return Zi(()=>o()),(e,t)=>(B(),V(I(vf),ks({"aria-hidden":`true`,style:{flexShrink:0}},e.$parent?.$props,{onPointerdown:s,onPointermove:c,onPointerleave:t[0]||=()=>{o()}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),m_=R({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Zg(),n=t.position===`item-aligned`?e_():void 0,{forwardRef:r,currentElement:i}=Id(),a=F(!1);return br(e=>{if(t.viewport?.value&&t.isPositioned?.value){let n=t.viewport.value;function r(){let e=n.scrollHeight-n.clientHeight;a.value=Math.ceil(n.scrollTop)n.removeEventListener(`scroll`,r))}}),Cr(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(B(),V(p_,{key:0,ref:I(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=I(t);e?.value&&n?.value&&(e.value.scrollTop=e.value.scrollTop+n.value.offsetHeight)}},{default:L(()=>[z(e.$slots,`default`)]),_:3},512)):Ts(`v-if`,!0)}}),h_=R({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Zg(),n=t.position===`item-aligned`?e_():void 0,{forwardRef:r,currentElement:i}=Id(),a=F(!1);return br(e=>{if(t.viewport?.value&&t.isPositioned?.value){let n=t.viewport.value;function r(){a.value=n.scrollTop>0}r(),n.addEventListener(`scroll`,r),e(()=>n.removeEventListener(`scroll`,r))}}),Cr(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(B(),V(p_,{key:0,ref:I(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=I(t);e?.value&&n?.value&&(e.value.scrollTop=e.value.scrollTop-n.value.offsetHeight)}},{default:L(()=>[z(e.$slots,`default`)]),_:3},512)):Ts(`v-if`,!0)}}),g_=R({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Gg(),{forwardRef:r,currentElement:i}=Id(),a=W(()=>n.disabled?.value||t.disabled);n.contentId||=af(void 0,`reka-select-content`),Ji(()=>{n.onTriggerChange(i.value)});let{getItems:o}=Kf(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=uf();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}function f(e){return e.button===0&&e.ctrlKey===!1}let p=!1;function m(e){if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),f(e)&&(d(e),p=!0)}function h(e){f(e)&&e.preventDefault()}function g(e){p||e.currentTarget?.focus(),p=!1}return(e,t)=>(B(),V(I(ip),{"as-child":``,reference:e.reference},{default:L(()=>[U(I(vf),{ref:I(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":I(n).contentId,"aria-expanded":I(n).open.value||!1,"aria-required":I(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:I(n)?.dir.value,"data-state":I(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":I(Ug)(I(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:g,onPointerdown:m,onMousedown:h,onPointerup:t[0]||=au(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[1]||=e=>{let t=I(s)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(I(c)(e.key,I(o)()),I(zg).includes(e.key)&&(u(),e.preventDefault()))}},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),__=R({__name:`SelectValue`,props:{placeholder:{type:String,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Id(),i=Gg();Ji(()=>{i.valueElement=r});let a=W(()=>{let e=[],t=Array.from(i.optionsSet.value),n=e=>t.find(t=>Vg(e,t.value,i.by));return e=Array.isArray(i.modelValue.value)?i.modelValue.value.map(e=>n(e)?.textContent??``):[n(i.modelValue.value)?.textContent??``],e.filter(Boolean)}),o=W(()=>a.value.length?a.value.join(`, `):t.placeholder);return(e,r)=>(B(),V(I(vf),{ref:I(n),as:e.as,"as-child":e.asChild,style:{pointerEvents:`none`},"data-placeholder":a.value.length?void 0:t.placeholder},{default:L(()=>[z(e.$slots,`default`,{selectedLabel:a.value,modelValue:I(i).modelValue.value},()=>[Cs(Ce(o.value),1)])]),_:3},8,[`as`,`as-child`,`data-placeholder`]))}}),v_=R({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=gn(t),r=vh(n),i=Zg(),a=i.position===`item-aligned`?e_():void 0,{forwardRef:o,currentElement:s}=Id();Ji(()=>{i?.onViewportChange(s.value)});let c=F(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(B(),ms(is,null,[U(I(vf),ks({ref:I(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16),U(I(vf),{as:`style`,nonce:I(r)},{default:L(()=>n[0]||=[Cs(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[y_,b_]=Pu(`TooltipProvider`),x_=R({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=gn(e);Id();let c=F(!0),l=F(!1),{start:u,stop:d}=nd(()=>{c.value=!0},n,{immediate:!1});return b_({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>z(e.$slots,`default`)}}),S_=`tooltip.open`,[C_,w_]=Pu(`TooltipRoot`),T_=R({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Id();let i=y_(),a=W(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=W(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=W(()=>n.disabled??i.disabled.value),c=W(()=>n.delayDuration??i.delayDuration.value),l=W(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});Cr(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(S_))):i.onClose())});let d=F(!1),f=F(),p=W(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:m,stop:h}=nd(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function g(){h(),d.value=!1,u.value=!0}function _(){h(),u.value=!1}function v(){m()}return w_({contentId:``,open:u,stateAttribute:p,trigger:f,onTriggerChange(e){f.value=e},onTriggerEnter(){i.isOpenDelayed.value?v():g()},onTriggerLeave(){a.value?_():h()},onOpen:g,onClose:_,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{open:I(u)})]),_:3}))}}),E_=R({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=C_(),a=y_(),{forwardRef:o,currentElement:s}=Id(),c=W(()=>n.ariaLabel||s.value?.textContent),l=W(()=>{let{ariaLabel:e,...t}=n;return xd(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return Ji(()=>{od(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),od(window,S_,i.onClose)}),(e,t)=>(B(),V(I(Tf),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{I(i).disableClosingTrigger.value&&I(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=au(()=>{},[`prevent`]),onDismiss:t[3]||=e=>I(i).onClose()},{default:L(()=>[U(I(_h),ks({ref:I(o),"data-state":I(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:L(()=>[z(e.$slots,`default`),U(I(qf),{id:I(i).contentId,role:`tooltip`},{default:L(()=>[Cs(Ce(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),D_=R({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=Ld(e),{forwardRef:n,currentElement:r}=Id(),{trigger:i,onClose:a}=C_(),o=y_(),{isPointerInTransit:s,onPointerExit:c}=Bd(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(B(),V(E_,ks({ref:I(n)},I(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),O_=R({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=C_(),a=Rd(n,r),{forwardRef:o}=Id();return(e,t)=>(B(),V(I(hf),{present:e.forceMount||I(i).open.value},{default:L(()=>[(B(),V(sa(I(i).disableHoverableContent.value?E_:D_),ks({ref:I(o)},I(a)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),k_=R({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),A_=R({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=C_(),r=y_();n.contentId||=af(void 0,`reka-tooltip-content`);let{forwardRef:i,currentElement:a}=Id(),o=F(!1),s=F(!1),c=W(()=>n.disabled.value?{}:{click:h,focus:p,pointermove:d,pointerleave:f,pointerdown:u,blur:m});Ji(()=>{n.onTriggerChange(a.value)});function l(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener(`pointerup`,l,{once:!0})}function d(e){e.pointerType!==`touch`&&!s.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function f(){n.onTriggerLeave(),s.value=!1}function p(e){o.value||n.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||n.onOpen()}function m(){n.onClose()}function h(){n.disableClosingTrigger.value||n.onClose()}return(e,r)=>(B(),V(I(ip),{"as-child":``,reference:e.reference},{default:L(()=>[U(I(vf),ks({ref:I(i),"aria-describedby":I(n).open.value?I(n).contentId:void 0,"data-state":I(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},ma(c.value)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),j_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),N_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),P_=`-`,F_=[],I_=`arbitrary..`,L_=e=>{let t=B_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return z_(e);let n=e.split(P_);return R_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?j_(i,t):t:i||F_}return n[e]||F_}}},R_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=R_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(P_):e.slice(t).join(P_),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?I_+r:void 0})(),B_=e=>{let{theme:t,classGroups:n}=e;return V_(n,t)},V_=(e,t)=>{let n=N_();for(let r in e){let i=e[r];H_(i,n,r,t)}return n},H_=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){W_(e,t,n);return}if(typeof e==`function`){G_(e,t,n,r);return}K_(e,t,n,r)},W_=(e,t,n)=>{let r=e===``?t:q_(t,e);r.classGroupId=n},G_=(e,t,n,r)=>{if(J_(e)){H_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(M_(n,e))},K_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(P_),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Y_=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},X_=`!`,Z_=`:`,Q_=[],$_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ev=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return $_(t,l,c,u)};if(t){let e=t+Z_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):$_(Q_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},tv=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},nv=e=>({cache:Y_(e.cacheSize),parseClassName:ev(e),sortModifiers:tv(e),postfixLookupClassGroupIds:rv(e),...L_(e)}),rv=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(iv),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+X_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},ov=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=nv(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=av(e,n);return i(e,a),a};return a=o,(...e)=>a(ov(...e))},lv=[],uv=e=>{let t=t=>t[e]||lv;return t.isThemeGetter=!0,t},dv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pv=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,mv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_v=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yv=e=>pv.test(e),bv=e=>!!e&&!Number.isNaN(Number(e)),xv=e=>!!e&&Number.isInteger(Number(e)),Sv=e=>e.endsWith(`%`)&&bv(e.slice(0,-1)),Cv=e=>mv.test(e),wv=()=>!0,Tv=e=>hv.test(e)&&!gv.test(e),Ev=()=>!1,Dv=e=>_v.test(e),Ov=e=>vv.test(e),kv=e=>!G(e)&&!K(e),Av=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),jv=e=>Kv(e,Xv,Ev),G=e=>dv.test(e),Mv=e=>Kv(e,Zv,Tv),Nv=e=>Kv(e,Qv,bv),Pv=e=>Kv(e,ey,wv),Fv=e=>Kv(e,$v,Ev),Iv=e=>Kv(e,Jv,Ev),Lv=e=>Kv(e,Yv,Ov),Rv=e=>Kv(e,ty,Dv),K=e=>fv.test(e),zv=e=>qv(e,Zv),Bv=e=>qv(e,$v),Vv=e=>qv(e,Jv),Hv=e=>qv(e,Xv),Uv=e=>qv(e,Yv),Wv=e=>qv(e,ty,!0),Gv=e=>qv(e,ey,!0),Kv=(e,t,n)=>{let r=dv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qv=(e,t,n=!1)=>{let r=fv.exec(e);return r?r[1]?t(r[1]):n:!1},Jv=e=>e===`position`||e===`percentage`,Yv=e=>e===`image`||e===`url`,Xv=e=>e===`length`||e===`size`||e===`bg-size`,Zv=e=>e===`length`,Qv=e=>e===`number`,$v=e=>e===`family-name`,ey=e=>e===`number`||e===`weight`,ty=e=>e===`shadow`,ny=cv(()=>{let e=uv(`color`),t=uv(`font`),n=uv(`text`),r=uv(`font-weight`),i=uv(`tracking`),a=uv(`leading`),o=uv(`breakpoint`),s=uv(`container`),c=uv(`spacing`),l=uv(`radius`),u=uv(`shadow`),d=uv(`inset-shadow`),f=uv(`text-shadow`),p=uv(`drop-shadow`),m=uv(`blur`),h=uv(`perspective`),g=uv(`aspect`),_=uv(`ease`),v=uv(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[yv,`full`,`auto`,...w()],E=()=>[xv,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,xv,K,G]},xv,K,G],O=()=>[xv,`auto`,K,G],ee=()=>[`auto`,`min`,`max`,`fr`,K,G],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],te=()=>[`auto`,...w()],j=()=>[yv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[yv,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[yv,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,K,G],re=()=>[...b(),Vv,Iv,{position:[K,G]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Hv,jv,{size:[K,G]}],oe=()=>[Sv,zv,Mv],se=()=>[``,`none`,`full`,l,K,G],ce=()=>[``,bv,zv,Mv],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[bv,Sv,Vv,Iv],fe=()=>[``,`none`,m,K,G],pe=()=>[`none`,bv,K,G],me=()=>[`none`,bv,K,G],he=()=>[bv,K,G],ge=()=>[yv,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Cv],breakpoint:[Cv],color:[wv],container:[Cv],"drop-shadow":[Cv],ease:[`in`,`out`,`in-out`],font:[kv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Cv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Cv],shadow:[Cv],spacing:[`px`,bv],text:[Cv],"text-shadow":[Cv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,yv,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[Av],columns:[{columns:[bv,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[xv,`auto`,K,G]}],basis:[{basis:[yv,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[bv,yv,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,bv,K,G]}],shrink:[{shrink:[``,bv,K,G]}],order:[{order:[xv,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,zv,Mv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gv,Pv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Sv,G]}],"font-family":[{font:[Bv,Fv,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[bv,`none`,K,Nv]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[bv,`from-font`,`auto`,K,Mv]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[bv,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[xv,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},xv,K,G],radial:[``,K,G],conic:[xv,K,G]},Uv,Lv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[bv,K,G]}],"outline-w":[{outline:[``,bv,zv,Mv]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Wv,Rv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Wv,Rv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[bv,Mv]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Wv,Rv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[bv,K,G]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[bv]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[bv]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:fe()}],brightness:[{brightness:[bv,K,G]}],contrast:[{contrast:[bv,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Wv,Rv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,bv,K,G]}],"hue-rotate":[{"hue-rotate":[bv,K,G]}],invert:[{invert:[``,bv,K,G]}],saturate:[{saturate:[bv,K,G]}],sepia:[{sepia:[``,bv,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[bv,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[bv,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,bv,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bv,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,bv,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[bv,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[bv,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,bv,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[bv,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[bv,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[xv,K,G]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[bv,zv,Mv,Nv]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ry(...e){return ny(wu(e))}var iy=Symbol(`compas-viewer-runtime`);function ay(){let e=gr(iy);if(!e)throw Error(`COMPAS viewer runtime is not available in this component`);return e}var oy=R({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,{theme:n}=ay().store;return(r,i)=>(B(),V(I(vf),{"data-slot":`button`,as:e.as,"as-child":e.asChild,class:he(I(ry)(I(sy)({variant:e.variant,size:e.size}),t.class,{dark:I(n).value===`dark`}))},{default:L(()=>[z(r.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),sy=Du(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),cy=R({__name:`Select`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},nullableValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(qg),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),ly=R({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{default:`popper`},bodyLock:{type:Boolean},memoDependencies:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(t,r)=>(B(),V(I(f_),null,{default:L(()=>[U(I(a_),ks({...I(i),...t.$attrs},{class:I(ry)(`relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e.position===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,n.class)}),{default:L(()=>[U(I(qy)),U(I(v_),{class:he(I(ry)(`p-1`,e.position===`popper`&&`h-(--reka-select-trigger-height) w-full min-w-(--reka-select-trigger-width)`))},{default:L(()=>[z(t.$slots,`default`)]),_:3},8,[`class`]),U(I(Ky))]),_:3},16,[`class`])]),_:3}))}}),uy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},dy=e=>e===``,fy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),py=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),my=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),hy=e=>{let t=my(e);return t.charAt(0).toUpperCase()+t.slice(1)},gy={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},_y=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o=gy.width,color:s=gy.stroke,...c},{slots:l})=>tc(`svg`,{...gy,...c,width:o,height:o,stroke:s,"stroke-width":dy(n)||dy(r)||n===!0||r===!0?Number(i||a||gy[`stroke-width`])*24/Number(o):i||a||gy[`stroke-width`],class:fy(`lucide`,c.class,...e?[`lucide-${py(hy(e))}-icon`,`lucide-${py(e)}`]:[`lucide-icon`]),...!l.default&&!uy(c)&&{"aria-hidden":`true`}},[...t.map(e=>tc(...e)),...l.default?[l.default()]:[]]),vy=(e,t)=>(n,{slots:r,attrs:i})=>tc(_y,{...i,...n,iconNode:t,name:e},r),yy=vy(`arrow-big-left-dash`,[[`path`,{d:`M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z`,key:`p8w4w5`}],[`path`,{d:`M20 9v6`,key:`14roy0`}]]),by=vy(`arrow-big-right-dash`,[[`path`,{d:`M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z`,key:`67vhrh`}],[`path`,{d:`M4 9v6`,key:`bns7oa`}]]),xy=vy(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Sy=vy(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Cy=vy(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wy=vy(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ty=vy(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ey=vy(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Dy=vy(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Oy=vy(`image-down`,[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),ky=vy(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ay=vy(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),jy=vy(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),My=vy(`move-3d`,[[`path`,{d:`M5 3v16h16`,key:`1mqmf9`}],[`path`,{d:`m5 19 6-6`,key:`jh6hbb`}],[`path`,{d:`m2 6 3-3 3 3`,key:`tkyvxa`}],[`path`,{d:`m18 16 3 3-3 3`,key:`1d4glt`}]]),Ny=vy(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Py=vy(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Fy=vy(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Iy=vy(`pointer-off`,[[`path`,{d:`M10 4.5V4a2 2 0 0 0-2.41-1.957`,key:`jsi14n`}],[`path`,{d:`M13.9 8.4a2 2 0 0 0-1.26-1.295`,key:`hirc7f`}],[`path`,{d:`M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158`,key:`1jxb2e`}],[`path`,{d:`m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343`,key:`10r7hm`}],[`path`,{d:`M6 6v8`,key:`tv5xkp`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ly=vy(`pointer`,[[`path`,{d:`M22 14a8 8 0 0 1-8 8`,key:`56vcr3`}],[`path`,{d:`M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1agjmk`}],[`path`,{d:`M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1`,key:`wdbh2u`}],[`path`,{d:`M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10`,key:`1ibuk9`}],[`path`,{d:`M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`g6ys72`}]]),Ry=vy(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),zy=vy(`rotate-3d`,[[`path`,{d:`M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2`,key:`10n0gc`}],[`path`,{d:`m15.194 13.707 3.814 1.86-1.86 3.814`,key:`16shm9`}],[`path`,{d:`M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4`,key:`1lxi77`}]]),By=vy(`scale-3d`,[[`path`,{d:`M5 7v11a1 1 0 0 0 1 1h11`,key:`13dt1j`}],[`path`,{d:`M5.293 18.707 11 13`,key:`ezgbsx`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,key:`1gwv83`}]]),Vy=vy(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Hy=vy(`sun-medium`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 3v1`,key:`1asbbs`}],[`path`,{d:`M12 20v1`,key:`1wcdkc`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M20 12h1`,key:`1vloll`}],[`path`,{d:`m18.364 5.636-.707.707`,key:`1hakh0`}],[`path`,{d:`m6.343 17.657-.707.707`,key:`18m9nf`}],[`path`,{d:`m5.636 5.636.707.707`,key:`1xv1c5`}],[`path`,{d:`m17.657 17.657.707.707`,key:`vl76zb`}]]),Uy=vy(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Wy={class:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`},Gy=R({__name:`SelectItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(l_),ks(I(n),{class:I(ry)(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t.class)}),{default:L(()=>[H(`span`,Wy,[U(I(u_),null,{default:L(()=>[U(I(Cy),{class:`h-4 w-4`})]),_:1})]),U(I(d_),null,{default:L(()=>[z(e.$slots,`default`)]),_:3})]),_:3},16,[`class`]))}}),Ky=R({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(m_),ks(I(n),{class:I(ry)(`flex cursor-default items-center justify-center py-1`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(wy))])]),_:3},16,[`class`]))}}),qy=R({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(h_),ks(I(n),{class:I(ry)(`flex cursor-default items-center justify-center py-1`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Ty))])]),_:3},16,[`class`]))}}),Jy=R({__name:`SelectTrigger`,props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(g_),ks(I(n),{class:I(ry)(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start`,t.class)}),{default:L(()=>[z(e.$slots,`default`),U(I(o_),{"as-child":``},{default:L(()=>[U(I(wy),{class:`w-4 h-4 opacity-50 shrink-0`})]),_:1})]),_:3},16,[`class`]))}}),Yy=R({__name:`SelectValue`,props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(__),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}});function Xy(e){let t=F(!1);function n(n){let r=e.value;t.value=r!==null&&r.matches(`:hover`)}return Ji(()=>{window.addEventListener(`mousemove`,n)}),Qi(()=>{window.removeEventListener(`mousemove`,n)}),{isHovered:t}}var Zy={class:`right-bar`},Qy={id:`data-container`},$y={class:`metadata item`},eb={class:`data-container`},tb=R({__name:`ObjectInfo`,setup(e){let t=ay(),{objectActionsState:n,objectBarData:r,blockPicker:i,theme:a}=t.store,o=(e,n)=>t.handleObjectAction({...e},n),s=F(null),{isHovered:c}=Xy(s);br(()=>{i.value=c.value&&r.isVisible});let l=()=>{r.isVisible=!r.isVisible};return(e,t)=>(B(),ms(`div`,Zy,[H(`div`,{class:he([`theme object-info`,{"is-hidden":!I(r).isVisible}]),id:`info-panel`,ref_key:`infoPanel`,ref:s},[H(`div`,Qy,[H(`div`,$y,[H(`h1`,{class:he([`text-lg font-bold section-title`,{dark:I(a).value===`dark`}])},` METADATA `,2),(B(!0),ms(is,null,da(I(r).data,(e,t)=>(B(),ms(`div`,{key:t,class:`data-entry`},[H(`p`,null,[H(`strong`,null,Ce(t)+`:`,1),Cs(` `+Ce(e),1)])]))),128))])]),H(`div`,eb,[H(`h1`,{class:he([`text-lg font-bold section-title`,{dark:I(a).value===`dark`}])},` FUNCTIONS `,2),(B(!0),ms(is,null,da(I(n),e=>(B(),ms(`div`,{key:e.guid,class:`single_data`},[e.type===`button`?(B(),V(I(oy),{key:0,variant:`outline`,onClick:t=>o(e),class:`w-full`},{default:L(()=>[Cs(Ce(e.text),1)]),_:2},1032,[`onClick`])):e.type===`select`?(B(),V(I(cy),{key:1,"model-value":typeof e.defaultValue==`string`?e.defaultValue:``,"onUpdate:modelValue":t=>{e.defaultValue=typeof t==`string`?t:``,o(e,t)}},{default:L(()=>[U(I(Jy),{class:`w-full`},{default:L(()=>[U(I(Yy),{placeholder:e.placeholder??`Select an option`},null,8,[`placeholder`])]),_:2},1024),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(!0),ms(is,null,da(e.options,e=>(B(),V(I(Gy),{key:e,value:e},{default:L(()=>[Cs(Ce(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])):Ts(``,!0)]))),128))]),U(I(oy),{variant:`secondary`,size:`icon`,id:`closeObjectBar`,onClick:t[0]||=e=>l()},{default:L(()=>[U(I(by))]),_:1})],2),U(I(oy),{variant:`secondary`,size:`icon`,id:`openObjectBar`,class:he({"is-hidden":!I(r).isVisible}),onClick:t[1]||=e=>l()},{default:L(()=>[U(I(yy))]),_:1},8,[`class`])]))}}),nb=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},rb=nb(tb,[[`__scopeId`,`data-v-2390ba1f`]]);function ib(e){if(e.ctrlKey||e.metaKey||e.altKey)return!0;let t=e.target;if(!t)return!1;let n=t.tagName;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable}function ab(e){let{root:t}=ay(),n=t=>{if(ib(t))return;let n=e[t.key.toLowerCase()];n&&(t.preventDefault(),n(t))};Ji(()=>{t.addEventListener(`keydown`,n)}),Zi(()=>{t.removeEventListener(`keydown`,n)})}var ob=R({__name:`Kbd`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),ms(`kbd`,{class:he(I(ry)(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,t.class))},[z(e.$slots,`default`)],2))}}),sb=R({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(T_),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),cb=R({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r),{theme:a}=ay().store;return(e,t)=>(B(),V(I(k_),null,{default:L(()=>[U(I(O_),ks({...I(i),...e.$attrs},{class:I(ry)(`z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n.class,{dark:I(a).value===`dark`})}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),lb=R({__name:`TooltipProvider`,props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(x_),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),ub=R({__name:`TooltipTrigger`,props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(A_),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),db=R({__name:`MoveButton`,setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`translate`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he({active:I(r).value==`translate`,disabled:!I(n).value}),onClick:i,disabled:!I(n).value},{default:L(()=>[U(I(My))]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Move mode `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`W`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),fb=R({__name:`RotateButton`,setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`rotate`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he({active:I(r).value==`rotate`,disabled:!I(n).value}),onClick:i,disabled:!I(n).value},{default:L(()=>[U(I(zy),{size:16,"stroke-width":2,"aria-hidden":`true`})]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Rotate mode `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`E`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),pb={class:`button-icon`},mb=R({__name:`ScaleButton`,props:{active:{type:Boolean}},emits:[`activated`],setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`scale`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he([`toolbar-button`,{active:I(r).value==`scale`,disabled:!I(n).value}]),onClick:i,disabled:!I(n).value},{default:L(()=>[H(`span`,pb,[U(I(By),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Rotate mode `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`R`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),hb={key:0},gb={key:1},_b=R({__name:`EnablePicker`,setup(e){let{pickerEnabled:t}=ay().store;function n(){t.value=!t.value}return(e,r)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:n,class:he({active:!I(t).value})},{default:L(()=>[I(t).value?(B(),ms(`span`,hb,[U(I(Ly))])):(B(),ms(`span`,gb,[U(I(Iy))]))]),_:1},8,[`class`])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[r[1]||=Cs(`Enable/Disable object selection `,-1),U(I(ob),null,{default:L(()=>[...r[0]||=[Cs(`P`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),vb={class:`toolbar-group`},yb=R({__name:`TransformGroup`,setup(e){let t=F(null),n=ay();function r(e){t.value=e}return ab({w:()=>{n.setTransformMode(`translate`),r(`move`)},e:()=>{n.setTransformMode(`rotate`),r(`rotate`)},r:()=>{n.setTransformMode(`scale`),r(`scale`)}}),(e,n)=>(B(),ms(`div`,vb,[U(I(_b),{active:t.value===`move`,onActivated:n[0]||=e=>r(`move`)},null,8,[`active`]),U(I(db),{active:t.value===`move`,onActivated:n[1]||=e=>r(`move`)},null,8,[`active`]),U(I(fb),{active:t.value===`rotate`,onActivated:n[2]||=e=>r(`rotate`)},null,8,[`active`]),U(I(mb),{active:t.value===`scale`,onActivated:n[3]||=e=>r(`scale`)},null,8,[`active`])]))}}),bb=R({__name:`Popover`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(rg),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),xb=R({__name:`PopoverTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(lg),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Sb=R({inheritAttrs:!1,__name:`PopoverContent`,props:{forceMount:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r),{theme:a}=ay().store;return(e,t)=>(B(),V(I(cg),null,{default:L(()=>[U(I(sg),ks({...I(i),...e.$attrs},{class:I(ry)(`z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n.class,{dark:I(a).value===`dark`})}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Cb=R({__name:`NumberField`,props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Fg),ks(I(i),{class:I(ry)(`grid gap-1.5`,n.class)}),{default:L(t=>[z(e.$slots,`default`,ge(xs(t)))]),_:3},16,[`class`]))}}),wb=R({__name:`NumberFieldContent`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),ms(`div`,{class:he(I(ry)(`relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5`,t.class))},[z(e.$slots,`default`)],2))}}),Tb=R({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(Ig),ks({"data-slot":`decrement`},I(n),{class:I(ry)(`absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Ay),{class:`h-4 w-4`})])]),_:3},16,[`class`]))}}),Eb=R({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(Lg),ks({"data-slot":`increment`},I(n),{class:I(ry)(`absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Fy),{class:`h-4 w-4`})])]),_:3},16,[`class`]))}}),Db=R({__name:`NumberFieldInput`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(I(Rg),{"data-slot":`input`,class:he(I(ry)(`flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,t.class))},null,8,[`class`]))}}),Ob={class:`inline-flex h-full w-full items-center justify-center`},kb={class:`add-object-form`},Ab={key:0,class:`param-grid`},jb={class:`param-label`},Mb={class:`param-label`},Nb={class:`param-label`},Pb={key:1,class:`param-grid`},Fb={class:`param-label`},Ib=nb(R({__name:`AddObjectButton`,setup(e){let t=[{value:`box`,label:`Box`},{value:`sphere`,label:`Sphere`},{value:`point`,label:`Point`}],n=ay(),r=F(!1),i=F(`box`),a=F({xsize:1,ysize:1,zsize:1}),o=F(1);function s(){let e=i.value===`box`?{...a.value}:i.value===`sphere`?{radius:o.value}:{};n.createGeometry(i.value,e),r.value=!1}return(e,n)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(bb),{open:r.value,"onUpdate:open":n[5]||=e=>r.value=e,modal:!0},{default:L(()=>[U(I(xb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[H(`span`,Ob,[U(I(Vy))])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[...n[6]||=[H(`p`,null,`Add object`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Sb),{class:`theme z-[4000] w-64 rounded-xl p-3 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,kb,[U(I(cy),{modelValue:i.value,"onUpdate:modelValue":n[0]||=e=>i.value=e},{default:L(()=>[U(I(Jy),{class:`w-full`},{default:L(()=>[U(I(Yy))]),_:1}),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(),ms(is,null,da(t,e=>U(I(Gy),{key:e.value,value:e.value},{default:L(()=>[Cs(Ce(e.label),1)]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`modelValue`]),i.value===`box`?(B(),ms(`div`,Ab,[H(`label`,jb,[n[7]||=Cs(` Size X `,-1),U(I(Cb),{modelValue:a.value.xsize,"onUpdate:modelValue":n[1]||=e=>a.value.xsize=e,min:.01,step:.1},{default:L(()=>[U(I(wb),null,{default:L(()=>[U(I(Tb)),U(I(Db)),U(I(Eb))]),_:1})]),_:1},8,[`modelValue`])]),H(`label`,Mb,[n[8]||=Cs(` Size Y `,-1),U(I(Cb),{modelValue:a.value.ysize,"onUpdate:modelValue":n[2]||=e=>a.value.ysize=e,min:.01,step:.1},{default:L(()=>[U(I(wb),null,{default:L(()=>[U(I(Tb)),U(I(Db)),U(I(Eb))]),_:1})]),_:1},8,[`modelValue`])]),H(`label`,Nb,[n[9]||=Cs(` Size Z `,-1),U(I(Cb),{modelValue:a.value.zsize,"onUpdate:modelValue":n[3]||=e=>a.value.zsize=e,min:.01,step:.1},{default:L(()=>[U(I(wb),null,{default:L(()=>[U(I(Tb)),U(I(Db)),U(I(Eb))]),_:1})]),_:1},8,[`modelValue`])])])):i.value===`sphere`?(B(),ms(`div`,Pb,[H(`label`,Fb,[n[10]||=Cs(` Radius `,-1),U(I(Cb),{modelValue:o.value,"onUpdate:modelValue":n[4]||=e=>o.value=e,min:.01,step:.1},{default:L(()=>[U(I(wb),null,{default:L(()=>[U(I(Tb)),U(I(Db)),U(I(Eb))]),_:1})]),_:1},8,[`modelValue`])])])):Ts(``,!0),U(I(oy),{variant:`secondary`,class:`w-full`,onClick:s},{default:L(()=>[...n[11]||=[Cs(` Add `,-1)]]),_:1})])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-faffd903`]]),Lb=R({__name:`Slider`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Yh),ks({"data-slot":`slider`,class:I(ry)(`relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,n.class)},I(i)),{default:L(({modelValue:e})=>[U(I(eg),{"data-slot":`slider-track`,class:`bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`},{default:L(()=>[U(I(Zh),{"data-slot":`slider-range`,class:`bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full`})]),_:1}),(B(!0),ms(is,null,da(e,(e,t)=>(B(),V(I($h),{key:t,"data-slot":`slider-thumb`,class:`bg-secondary-foreground border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50`}))),128))]),_:1},16,[`class`]))}}),Rb={class:`inline-flex h-full w-full items-center justify-center`},zb={class:`material-form`},Bb={class:`param-label`},Vb=[`value`],Hb={class:`param-label`},Ub={class:`slider-row`},Wb={class:`slider-value`},Gb={class:`param-label`},Kb={class:`slider-row`},qb={class:`slider-value`},Jb=nb(R({__name:`MaterialButton`,setup(e){let t=ay(),{pickedObjectGuid:n}=t.store,r=F(!1),i=F(`#ffffff`),a=F(0),o=F(1);function s(){let e=n.value,r=e?t.getMaterialSnapshot(e):null;i.value=r?.color??`#ffffff`,a.value=r?.metalness??0,o.value=r?.roughness??1}Cr(r,e=>{e&&s()}),Cr(()=>n.value,e=>{if(!e){r.value=!1;return}r.value&&s()});function c(e){let r=e.target.value;i.value=r;let a=n.value;a&&t.setMaterial(a,{color:r})}function l(e){if(e===void 0)return;a.value=e;let r=n.value;r&&t.setMaterial(r,{metalness:e})}function u(e){if(e===void 0)return;o.value=e;let r=n.value;r&&t.setMaterial(r,{roughness:e})}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(bb),{open:r.value,"onUpdate:open":t[2]||=e=>r.value=e,modal:!0},{default:L(()=>[U(I(xb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,disabled:!I(n).value},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[H(`span`,Rb,[U(I(Ny))])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[...t[3]||=[H(`p`,null,`Material`,-1)]]),_:1})]),_:1})]),_:1},8,[`disabled`])]),_:1}),U(I(Sb),{class:`theme z-[4000] w-64 rounded-xl p-3 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,zb,[H(`label`,Bb,[t[4]||=Cs(` Color `,-1),H(`input`,{type:`color`,value:i.value,class:`color-input`,onInput:c},null,40,Vb)]),H(`label`,Hb,[t[5]||=Cs(` Metalness `,-1),H(`div`,Ub,[U(I(Lb),{"model-value":[a.value],min:0,max:1,step:.05,"onUpdate:modelValue":t[0]||=e=>l(e?.[0])},null,8,[`model-value`]),H(`span`,Wb,Ce(a.value.toFixed(2)),1)])]),H(`label`,Gb,[t[6]||=Cs(` Roughness `,-1),H(`div`,Kb,[U(I(Lb),{"model-value":[o.value],min:0,max:1,step:.05,"onUpdate:modelValue":t[1]||=e=>u(e?.[0])},null,8,[`model-value`]),H(`span`,qb,Ce(o.value.toFixed(2)),1)])])])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-062ecf41`]]),Yb={class:`toolbar-group`},Xb=R({__name:`AddObjectGroup`,setup(e){return(e,t)=>(B(),ms(`div`,Yb,[U(I(Ib)),U(I(Jb))]))}}),Zb=R({__name:`TopViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`top`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[U(I(Py))]),_:1})]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Top view `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`5`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),Qb=R({__name:`FrontViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`front`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:n},{default:L(()=>[U(I(Dy))]),_:1})]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Front view `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`2`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),$b={class:`button-icon`},ex=R({__name:`RightViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`right`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[H(`span`,$b,[U(I(Ry),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1})]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Right view `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`6`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),tx={class:`button-icon`},nx=R({__name:`PerspectiveViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`front_right`)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[H(`span`,tx,[U(I(xy),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1})]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Perspective view `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`3`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),rx={class:`toolbar-group`},ix=R({__name:`ViewGroup`,setup(e){let t=ay();return ab({2:()=>{t.setCameraViewPreset(`front`)},3:()=>{t.setCameraViewPreset(`front_right`)},5:()=>{t.setCameraViewPreset(`top`)},6:()=>{t.setCameraViewPreset(`right`)}}),(e,t)=>(B(),ms(`div`,rx,[U(I(Zb)),U(I(Qb)),U(I(ex)),U(I(nx))]))}}),ax={class:`button-icon save-view-icon`},ox={class:`save-view-overlay`,"aria-hidden":`true`},sx=nb(R({__name:`SaveViewButton`,props:{defaultName:{}},emits:[`saved`],setup(e,{emit:t}){let n=e,r=ay(),i=t;function a(){let e=window.prompt(`Name for saved view`,n.defaultName);if(e===null)return;let t=e.trim()||n.defaultName,a=r.captureCurrentView(t);i(`saved`,a)}return(e,t)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:a},{default:L(()=>[H(`span`,ax,[U(I(Sy),{size:15,"stroke-width":2,"aria-hidden":`true`}),H(`span`,ox,[U(I(Fy),{class:`save-view-overlay-icon`})])])]),_:1})]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Save Current View `,-1),U(I(ob),null,{default:L(()=>[...t[0]||=[Cs(`S`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),[[`__scopeId`,`data-v-c0eebdad`]]),cx={class:`inline-flex h-full w-full items-center justify-center`},lx={class:`flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary`},ux={key:0,disabled:``,value:``},dx=[`value`],fx=nb(R({__name:`SavedViewsButton`,props:{views:{},selectedViewId:{}},emits:[`select`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=F(!1),a=F(``),o=F(!1),s=null;Cr(()=>[n.selectedViewId,n.views],([e,t])=>{if(t.length===0){a.value=``;return}let n=t.some(t=>t.id===e);a.value=n?e:t[0]?.id??``},{immediate:!0});function c(){a.value&&r(`select`,a.value)}function l(){a.value&&(o.value=!0,s&&clearTimeout(s),s=setTimeout(()=>{o.value=!1,s=null},160),r(`delete`,a.value))}return Zi(()=>{s&&clearTimeout(s)}),(t,n)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(bb),{open:i.value,"onUpdate:open":n[1]||=e=>i.value=e,modal:!0},{default:L(()=>[U(I(xb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[H(`span`,cx,[U(I(Ey))])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[...n[2]||=[H(`p`,null,`Saved views`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Sb),{class:`theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,lx,[pr(H(`select`,{"onUpdate:modelValue":n[0]||=e=>a.value=e,class:`h-full min-w-0 flex-1 truncate border-0 bg-secondary px-3 py-1 text-sm text-secondary-foreground outline-none`,onChange:c},[e.views.length===0?(B(),ms(`option`,ux,` No saved views `)):Ts(``,!0),(B(!0),ms(is,null,da(e.views,e=>(B(),ms(`option`,{key:e.id,value:e.id},Ce(e.name),9,dx))),128))],544),[[Yl,a.value]]),U(I(sb),null,{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon-sm`,class:he([`h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]`,{"saved-view-delete-pressed":o.value}]),disabled:!a.value,onClick:au(l,[`stop`])},{default:L(()=>[U(I(Uy),{class:`h-3 w-3`})]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(cb),{class:`z-[4100]`,side:`bottom`},{default:L(()=>[...n[3]||=[H(`p`,null,`Delete saved view`,-1)]]),_:1})]),_:1})])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-1562f39a`]]),px={class:`inline-flex h-full w-full items-center justify-center`},mx={class:`grid gap-5`},hx={class:`grid gap-3`},gx={class:`grid grid-cols-3 items-center gap-4`},_x={class:`flex items-center gap-2`},vx={class:`grid grid-cols-3 items-center gap-4`},yx={class:`flex items-center gap-2`},bx={class:`grid grid-cols-3 items-center gap-4`},xx={class:`flex justify-end gap-2`},Sx=64,Cx=8192,wx=nb(R({__name:`SaveScreenshotButton`,setup(e){let t=F(!1),n=F(1920),r=F(1080),i=F(`png`),a=F(!1),o=ay(),s=W(()=>Number.isFinite(n.value)?n.valueCx?`Width must be between ${Sx} and ${Cx} px.`:``:`Width must be a number.`),c=W(()=>Number.isFinite(r.value)?r.valueCx?`Height must be between ${Sx} and ${Cx} px.`:``:`Height must be a number.`);function l(e,t){return Number.isFinite(e)?Math.min(Cx,Math.max(Sx,Math.round(e))):t}function u(){a.value=!0}function d(){n.value=l(n.value,1920)}function f(){r.value=l(r.value,1080)}function p(){let e=o.renderer.domElement;if(!e)return;let t=e.getBoundingClientRect(),i=Math.round(t.width)||e.clientWidth||e.width,a=Math.round(t.height)||e.clientHeight||e.height;n.value=l(i,n.value),r.value=l(a,r.value)}function m(){d(),f(),!(s.value||c.value)&&(o.saveCurrentCanvasImage({width:n.value,height:r.value,format:i.value}),t.value=!1)}return Cr(t,e=>{e&&!a.value&&p()}),(e,a)=>(B(),V(I(lb),{"delay-duration":600},{default:L(()=>[U(I(bb),{open:t.value,"onUpdate:open":a[4]||=e=>t.value=e,modal:!0},{default:L(()=>[U(I(xb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[H(`span`,px,[U(I(Oy))])]),_:1}),U(I(cb),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[a[6]||=Cs(`Save screenshot `,-1),U(I(ob),null,{default:L(()=>[...a[5]||=[Cs(`F`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Sb),{class:`theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,mx,[a[15]||=H(`div`,{class:`space-y-2`},[H(`h4`,{class:`font-medium leading-none`},`Export Screenshot`),H(`p`,{class:`text-sm text-muted-foreground`},` Set width, height, and image format. `)],-1),H(`div`,hx,[H(`div`,gx,[H(`div`,_x,[a[8]||=H(`label`,{for:`screenshot-width`,class:`text-sm`},`Width`,-1),s.value?(B(),V(I(sb),{key:0},{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[...a[7]||=[H(`span`,{class:`error-pill`,"aria-label":`Width error`},`!`,-1)]]),_:1}),U(I(cb),{class:`z-[5000]`,side:`top`},{default:L(()=>[H(`p`,null,Ce(s.value),1)]),_:1})]),_:1})):Ts(``,!0)]),pr(H(`input`,{id:`screenshot-width`,"onUpdate:modelValue":a[0]||=e=>n.value=e,type:`number`,onInput:u,onBlur:d,class:`themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},null,544),[[Gl,n.value,void 0,{number:!0}]])]),H(`div`,vx,[H(`div`,yx,[a[10]||=H(`label`,{for:`screenshot-height`,class:`text-sm`},`Height`,-1),c.value?(B(),V(I(sb),{key:0},{default:L(()=>[U(I(ub),{"as-child":``},{default:L(()=>[...a[9]||=[H(`span`,{class:`error-pill`,"aria-label":`Height error`},`!`,-1)]]),_:1}),U(I(cb),{class:`z-[5000]`,side:`top`},{default:L(()=>[H(`p`,null,Ce(c.value),1)]),_:1})]),_:1})):Ts(``,!0)]),pr(H(`input`,{id:`screenshot-height`,"onUpdate:modelValue":a[1]||=e=>r.value=e,type:`number`,onInput:u,onBlur:f,class:`themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},null,544),[[Gl,r.value,void 0,{number:!0}]])]),H(`div`,bx,[a[12]||=H(`label`,{for:`screenshot-format`,class:`text-sm`},`Format`,-1),pr(H(`select`,{id:`screenshot-format`,"onUpdate:modelValue":a[2]||=e=>i.value=e,class:`col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},[...a[11]||=[H(`option`,{value:`png`},`PNG`,-1),H(`option`,{value:`jpg`},`JPG`,-1),H(`option`,{value:`webp`},`WEBP`,-1)]],512),[[Yl,i.value]])])]),H(`div`,xx,[U(I(oy),{variant:`secondary`,size:`sm`,onClick:a[3]||=e=>t.value=!1},{default:L(()=>[...a[13]||=[Cs(`Cancel`,-1)]]),_:1}),U(I(oy),{variant:`secondary`,size:`sm`,onClick:m},{default:L(()=>[...a[14]||=[Cs(`Save`,-1)]]),_:1})])])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-ed1ef026`]]),Tx={class:`display-tools-wrapper`},Ex={class:`toolbar-group`},Dx=`compas_threejs_saved_views`,Ox=R({__name:`DisplayGroup`,setup(e){let t=ay(),n=F([]),r=F(``);function i(){localStorage.setItem(Dx,JSON.stringify(n.value))}function a(){let e=localStorage.getItem(Dx);if(e)try{let t=JSON.parse(e);Array.isArray(t)&&(n.value=t)}catch{n.value=[]}}function o(e){n.value=[...n.value,e],r.value=e.id,i()}function s(){let e=`View ${n.value.length+1}`,r=window.prompt(`Name for saved view`,e);if(r===null)return;let i=r.trim()||e;o(t.captureCurrentView(i))}function c(e){r.value=e;let i=n.value.find(t=>t.id===e);i&&t.applySavedView(i)}function l(e){let t=n.value.filter(t=>t.id!==e);n.value=t,r.value===e&&(r.value=t[0]?.id??``),i()}return Ji(()=>{a()}),ab({s:()=>{s()},f:()=>{t.saveCurrentCanvasImage({format:`png`})},d:()=>{t.toggleTheme()}}),(e,t)=>(B(),ms(`div`,Tx,[H(`div`,Ex,[U(I(sx),{"default-name":`View ${n.value.length+1}`,onSaved:o},null,8,[`default-name`]),U(I(fx),{views:n.value,"selected-view-id":r.value,onSelect:c,onDelete:l},null,8,[`views`,`selected-view-id`]),U(I(wx))])]))}}),kx=nb(R({__name:`Toolbar`,setup(e){let t=F(null),{isHovered:n}=Xy(t),{theme:r,blockPicker:i}=ay().store;return br(()=>{i.value=n.value}),(e,n)=>(B(),ms(`div`,{ref_key:`toolbarElement`,ref:t,class:`toolbar theme`,id:`toolbar`},[H(`h1`,{class:he([`text-lg font-bold`,{dark:I(r).value===`dark`}])},` COMPAS ThreeJs `,2),U(yb),U(Xb),U(ix),U(Ox)],512))}}),[[`__scopeId`,`data-v-e2902cdd`]]),Ax=R({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Oh),ks(I(i),{class:I(ry)(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,n.class)}),{default:L(()=>[U(I(kh),{class:`grid place-content-center text-current`},{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Cy),{class:`h-4 w-4`})])]),_:3})]),_:3},16,[`class`]))}}),jx={class:`load-json-button-container inline-block`},Mx=R({__name:`LoadJsonButton`,props:{text:{},action:{}},setup(e){let t=e,n=ay(),r=F(null),i=()=>{r.value?.click()},a=e=>{let r=e.target,i=r.files?.[0];if(i){let e=new FileReader;e.onload=e=>{try{let r=e.target?.result,i=JSON.parse(r);console.log(`Preparing to send JSON payload via WS for action: ${t.action}`);let a={dispatch:`loaded_json`,action:t.action,json_data:i};n.sendData(a)&&console.log(`Successfully sent JSON payload via WS for action: ${t.action}`)}catch(e){console.error(`Failed to parse or send uploaded JSON file:`,e)}},e.readAsText(i),r.value=``}};return(t,n)=>(B(),ms(`div`,jx,[H(`input`,{ref_key:`fileInput`,ref:r,type:`file`,class:`hidden`,accept:`.json`,onChange:a},null,544),U(I(oy),{type:`button`,onClick:i,variant:`secondary`},{default:L(()=>[Cs(Ce(e.text),1)]),_:1})]))}}),Nx={key:1,class:`button-container`},Px={key:2,class:`slider-container`},Fx={key:0,class:`slider-value`},Ix={key:3,class:`number-field-container`},Lx={key:4,class:`load-json-button-container`},Rx={key:5,class:`checkbox-ui-component`},zx={key:0},Bx={key:6,class:`select-container`},Vx=nb(R({__name:`Openbar`,setup(e){let t=F(!0),n=F(null),r=ay(),{sidebarComponents:i,theme:a,blockPicker:o}=r.store,s=(e,t)=>r.handleUiAction(e,t);function c(){t.value=!t.value}ab({q:c});let{isHovered:l}=Xy(n),u=W(()=>t.value);return br(()=>{o.value=l.value&&u.value}),(e,r)=>(B(),ms(is,null,[H(`div`,{ref_key:`openbarElement`,ref:n,id:`openbar`,class:he([`fixed-openbar theme`,{"is-hidden":!t.value}])},[(B(!0),ms(is,null,da(I(i),e=>(B(),ms(`div`,{key:e.id,class:`dynamic-item`},[e.label?(B(),ms(`label`,{key:0,class:he([`dynamic-label`,{dark:I(a).value===`dark`}])},Ce(e.label),3)):Ts(``,!0),e.component===`Button`?(B(),ms(`div`,Nx,[U(I(oy),{variant:`secondary`,onClick:t=>s(e.action)},{default:L(()=>[Cs(Ce(e.props.text),1)]),_:2},1032,[`onClick`])])):e.component===`Slider`?(B(),ms(`div`,Px,[U(I(Lb),{min:e.props.min,max:e.props.max,step:e.props.step,"default-value":e.props.defaultValue,modelValue:e.props.defaultValue,"onUpdate:modelValue":[t=>e.props.defaultValue=t,t=>s(e.action,t?.[0])],class:`w-[80%]`},null,8,[`min`,`max`,`step`,`default-value`,`modelValue`,`onUpdate:modelValue`]),e.props.defaultValue?(B(),ms(`span`,Fx,Ce(e.props.defaultValue[0]),1)):Ts(``,!0)])):e.component===`NumberField`?(B(),ms(`div`,Ix,[U(I(Cb),{min:e.props.min,max:e.props.max,step:e.props.step,"default-value":e.props.value,modelValue:e.props.value,"onUpdate:modelValue":[t=>e.props.value=t,t=>s(e.action,t)],class:`w-full`},{default:L(()=>[U(I(wb),null,{default:L(()=>[U(I(Tb)),U(I(Db)),U(I(Eb))]),_:1})]),_:1},8,[`min`,`max`,`step`,`default-value`,`modelValue`,`onUpdate:modelValue`])])):e.component===`LoadJsonButton`?(B(),ms(`div`,Lx,[U(Mx,{text:e.props.text,action:e.action},null,8,[`text`,`action`])])):e.component===`Checkbox`?(B(),ms(`div`,Rx,[U(I(Ax),{id:`checkbox-${e.id}`,"model-value":!!e.props.defaultValue,"onUpdate:modelValue":t=>{e.props.defaultValue=!!t,s(e.action,t)}},null,8,[`id`,`model-value`,`onUpdate:modelValue`]),e.props.text?(B(),ms(`span`,zx,Ce(e.props.text),1)):Ts(``,!0)])):e.component===`Select`?(B(),ms(`div`,Bx,[U(I(cy),{"model-value":e.props.defaultValue??``,"onUpdate:modelValue":t=>{e.props.defaultValue=typeof t==`string`?t:``,s(e.action,t)}},{default:L(()=>[U(I(Jy),{class:`w-full`},{default:L(()=>[U(I(Yy),{placeholder:e.props.placeholder??`Select an option`},null,8,[`placeholder`])]),_:2},1024),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(!0),ms(is,null,da(e.props.options,e=>(B(),V(I(Gy),{key:e,value:e},{default:L(()=>[Cs(Ce(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])])):Ts(``,!0)]))),128)),U(I(oy),{variant:`secondary`,size:`icon`,class:`mb-4`,onClick:r[0]||=e=>c()},{default:L(()=>[U(I(yy))]),_:1})],2),U(I(oy),{variant:`secondary`,size:`icon`,class:he([`mb-5`,{"is-hidden":!t.value}]),onClick:r[1]||=e=>c()},{default:L(()=>[U(I(by))]),_:1},8,[`class`])],64))}}),[[`__scopeId`,`data-v-a83066fb`]]),Hx={id:`sidebar`},Ux=nb(R({__name:`Sidebar`,props:{showToolbar:{type:Boolean,default:!0}},setup(e){let{sideBarInfoState:t}=ay().store;return(n,r)=>(B(),ms(`div`,Hx,[e.showToolbar?(B(),V(kx,{key:0})):Ts(``,!0),I(t).isVisible?(B(),V(Vx,{key:1})):Ts(``,!0)]))}}),[[`__scopeId`,`data-v-1cbddba3`]]),Wx={key:0,class:`theme-indicator`,"aria-hidden":`true`},Gx=nb(R({__name:`ThemeIndicator`,setup(e){let{theme:t}=ay().store,n=F(!1),r=F(t.value),i=null,a=!0;function o(e){r.value=e,n.value=!0,i&&window.clearTimeout(i),i=window.setTimeout(()=>{n.value=!1,i=null},900)}let s=Cr(()=>t.value,e=>{if(a){r.value=e,a=!1;return}e!==r.value&&o(e)},{immediate:!0});return Zi(()=>{i&&=(window.clearTimeout(i),null),s()}),Ji(()=>{}),(e,t)=>(B(),V(wc,{name:`theme-indicator`},{default:L(()=>[n.value?(B(),ms(`div`,Wx,[r.value===`dark`?(B(),V(I(jy),{key:0,class:`theme-indicator-icon`})):(B(),V(I(Hy),{key:1,class:`theme-indicator-icon`}))])):Ts(``,!0)]),_:1}))}}),[[`__scopeId`,`data-v-ebb8d4d4`]]),Kx={key:0,class:`global-spinner-overlay theme`},qx={key:0,class:`global-spinner-official-text`},Jx={key:1,class:`global-spinner-funny-text`},Yx=nb(R({__name:`GlobalSpinner`,setup(e){let{spinnerState:t}=ay().store,n=`Consulting the geometry gods...(Asking the algorithm to calm down...(Convincing the computer this is intentional...(Counting things that probably don't need counting...(Making the polygons behave...(Untangling the spaghetti geometry...(Teaching vectors where to go...(Rotating things until they look right...(Checking if reality is still running...(Loading an unreasonable amount of geometry...(Negotiating with the CPU...(Blaming the mesh...(Adding more RAM, spiritually...(Making the triangles feel useful...(Convincing the vertices to cooperate...(Searching for the missing dimension...(Performing computational wizardry...(Sacrificing a GPU to the algorithm...(Asking the mesh nicely to be manifold...(Counting polygons instead of sheep...(Turning mathematics into architecture...(Turning architecture back into mathematics...(Making the computer question its life choices...(Checking whether this is actually a good idea...(Running several questionable calculations...(Applying advanced computational nonsense...(Removing unnecessary complexity by adding complexity...(Optimizing absolutely everything...(Optimizing something that was already fast...(Adding one more iteration...(Just one more iteration...(Okay, definitely the last iteration...(Pretending this will converge...(Waiting for convergence...(Negotiating with infinity...(Rounding numbers until they behave...(Arguing with floating-point arithmetic...(Trying to remember where we put zero...(Locating the origin...(Checking which way is up...(Verifying that 3D is still 3D...(Flattening things that should not be flattened...(Unflattening things that definitely should be flattened...(Making topology someone else's problem...(Searching for non-manifold nonsense...(Resolving existential intersections...(Making surfaces understand boundaries...(Asking the normals to face the right way...(Flipping normals and pretending nothing happened...(Meshing reality...(Remeshing reality...(Discretizing the universe...(Approximating perfection...(Generating controlled chaos...(Adding a little more randomness...(Removing suspicious randomness...(Randomizing the deterministic process...(Making deterministic randomness...(Running the forbidden loop...(Entering the computational abyss...(Checking what broke this time...(Finding the bug we introduced 20 minutes ago...(Looking for a missing comma...(Blaming JavaScript...(Blaming Python...(Blaming the GPU...(Blaming the user...(The computer knows what it did...(Have you tried turning the geometry off and on again?(Clearing the cache and our conscience...(Compiling some questionable decisions...(Waiting for the algorithm to have an idea...(Giving the CPU a moment to think...(Making the fans spin faster...(Converting electricity into polygons...(Converting polygons into more polygons...(Generating geometry nobody asked for...(Making unnecessary things parametric...(Parametrizing the obvious...(Overengineering a perfectly simple problem...(Adding another slider...(Adding sliders until it works...(Searching for the optimal number of sliders...(Making everything adjustable...(Making nothing adjustable...(Pretending the constraints are reasonable...(Negotiating with the constraints...(Relaxing the constraints...(Tightening the constraints...(Breaking the constraints...(Calling it a feature...(Calling it emergent behavior...(Calling it computational design...(Calling it architecture...(Generating plausible geometry...(Generating implausible geometry...(Making beautiful mistakes...(Turning mistakes into features...(Turning features into bugs...(Turning bugs into research...(Turning research into more bugs...(Approaching enlightenment...(Approaching the solution...(Approaching the deadline...(Running at 99% confidence...(Calculating with questionable precision...(Measuring things very precisely for no reason...(Checking if 90° is still 90°...(Making sure left is still left...(Making sure up is still up...(Checking whether the dimensions agree...(Synchronizing the coordinate systems...(Convincing coordinate systems to get along...(Finding the center of everything...(Locating the important point...(Calculating the least important point...(Interpolating between bad decisions...(Extrapolating beyond our expertise...(Projecting our problems onto a surface...(Solving problems in higher dimensions...(Bringing everything back to 3D...(Reducing dimensional existential dread...(Applying unnecessary mathematics...(Applying necessary mathematics reluctantly...(Doing linear algebra so you don't have to...(Multiplying matrices aggressively...(Taking the dot product personally...(Crossing our fingers and our vectors...(Normalizing everything...(Checking the normals...(Uniting the vectors...(Dividing by something suspicious...(Avoiding division by zero...(Negotiating with NaN...(Convincing infinity to come back down...(Removing NaNs from polite society...(Hunting floating-point errors...(Rounding things irresponsibly...(Preserving numerical dignity...(Running finite coffee analysis...(Calculating the optimal coffee break...(Optimizing caffeine throughput...(Loading structural optimism...(Generating computational optimism...(Waiting for inspiration to compile...(Compiling inspiration...(Downloading more geometry...(Downloading additional dimensions...(Searching the internet for more RAM...(Consulting the documentation we should have read earlier...(Reading error messages very carefully...(Ignoring the error message...(Re-reading the error message...(Accepting our fate...(Almost there...(Definitely almost there...(Probably almost there...(This is taking longer than expected...(Doing something extremely important...(Doing something extremely computational...(Please remain geometrically calm...(Please do not touch anything...(Everything is under control...(Everything was under control...(Nothing to see here...(This is completely normal...(Trusting the process...(Trusting the algorithm...(Questioning the process...(Questioning the algorithm...(Reconsidering our life choices...(Adding more computational violence...(Brute-forcing elegance...(Searching for elegance...(Giving up on elegance...(Embracing chaos...(Rendering the consequences...(Calculating the consequences...(Preparing the consequences...(Generating something probably useful...(Turning pixels into problems...(Turning problems into pixels...(Making computers do architecture...(Making architecture do mathematics...(Making mathematics do the heavy lifting...(Almost done. Probably.`.split(`(`),r=F(null),i=null;function a(){return n[Math.floor(Math.random()*n.length)]}function o(){r.value=a(),i=setInterval(()=>{r.value=a()},3600)}function s(){i!==null&&(clearInterval(i),i=null),r.value=null}return Cr(()=>t.visible,e=>{e?o():s()},{immediate:!0}),Qi(s),(e,n)=>(B(),V(Rr,{to:`body`},[I(t).visible?(B(),ms(`div`,Kx,[U(I(ky),{class:`global-spinner-icon`,size:96,"stroke-width":1.5}),I(t).message?(B(),ms(`p`,qx,Ce(I(t).message),1)):Ts(``,!0),r.value?(B(),ms(`p`,Jx,Ce(r.value),1)):Ts(``,!0)])):Ts(``,!0)]))}}),[[`__scopeId`,`data-v-1f2a3347`]]),Xx=nb(R({__name:`App`,props:{runtime:{},showToolbar:{type:Boolean,default:!0}},setup(e){let t=F(null),n=e,{theme:r}=n.runtime.store;return Ji(()=>{t.value&&n.runtime.attach(t.value)}),(e,i)=>(B(),ms(`div`,{class:he([`app-container`,{dark:I(r).value===`dark`}])},[U(Ux,{"show-toolbar":n.showToolbar},null,8,[`show-toolbar`]),H(`div`,{ref_key:`threeContainer`,ref:t,class:`three-container`},null,512),U(Gx),U(rb),U(Yx)],2))}}),[[`__scopeId`,`data-v-8d82b7cc`]]);function Zx(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}var $x=4294967296;function eS(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=$x&&(i+=r/$x|0,r%=$x)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?aS(r,i):iS(r,i)}function tS(e,t){let n=iS(e,t),r=n.hi&2147483648;r&&(n=aS(n.lo,n.hi));let i=nS(n.lo,n.hi);return r?`-`+i:i}function nS(e,t){if({lo:e,hi:t}=rS(e,t),t<=2097151)return String($x*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+oS(o)+oS(a)}function rS(e,t){return{lo:e>>>0,hi:t>>>0}}function iS(e,t){return{lo:e|0,hi:t|0}}function aS(e,t){return t=~t,e?e=~e+1:t+=1,iS(e,t)}var oS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function sS(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function cS(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var lS=uS();function uS(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(vS(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return _S(e),sS(e,this.buf),this}bool(e){return this.buf.push(+!!e),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){yS(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){vS(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){_S(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return _S(e),e=(e<<1^e>>31)>>>0,sS(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=lS.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=lS.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=lS.enc(e);return Qx(t.lo,t.hi,this.buf),this}sint64(e){let t=lS.enc(e),n=t.hi>>31;return Qx(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=lS.uEnc(e);return Qx(t.lo,t.hi,this.buf),this}},q=class{constructor(e,t=mS().decodeUtf8){this.decodeUtf8=t,this.varint64=Zx,this.uint32=cS,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case hS.Varint:for(;this.buf[this.pos++]&128;);break;case hS.Bit64:this.pos+=4;case hS.Bit32:this.pos+=4;break;case hS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case hS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===hS.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return lS.dec(...this.varint64())}uint64(){return lS.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,lS.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return lS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return lS.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){return this.decodeUtf8(this.bytes(),e)}};function _S(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function vS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function yS(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}function bS(){return{typeUrl:``,value:new Uint8Array}}var xS={encode(e,t=new gS){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=bS();for(;n.pos>>3){case 1:if(e!==10)break;i.typeUrl=n.string();continue;case 2:if(e!==18)break;i.value=n.bytes();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{typeUrl:wS(e.typeUrl)?globalThis.String(e.typeUrl):wS(e.type_url)?globalThis.String(e.type_url):``,value:wS(e.value)?SS(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==``&&(t.typeUrl=e.typeUrl),e.value.length!==0&&(t.value=CS(e.value)),t},create(e){return xS.fromPartial(e??{})},fromPartial(e){let t=bS();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};function SS(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,`base64`));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let e=0;e{t.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(t.join(``))}}function wS(e){return e!=null}var TS=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function ES(e){switch(e){case 0:case`NULL_VALUE`:return TS.NULL_VALUE;default:return TS.UNRECOGNIZED}}function DS(e){switch(e){case TS.NULL_VALUE:return`NULL_VALUE`;case TS.UNRECOGNIZED:default:return`UNRECOGNIZED`}}function OS(){return{fields:{}}}var kS={encode(e,t=new gS){return globalThis.Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&jS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=OS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=jS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{fields:IS(e.fields)?globalThis.Object.entries(e.fields).reduce((e,[t,n])=>(e[t]=n,e),{}):{}}},toJSON(e){let t={};if(e.fields){let n=globalThis.Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([e,n])=>{t.fields[e]=n}))}return t},create(e){return kS.fromPartial(e??{})},fromPartial(e){let t=OS();return t.fields=globalThis.Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=OS();if(e!==void 0)for(let n of globalThis.Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of globalThis.Object.keys(e.fields))t[n]=e.fields[n];return t}};function AS(){return{key:``,value:void 0}}var jS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&NS.encode(NS.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=AS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=NS.unwrap(NS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:LS(e.key)?globalThis.String(e.key):``,value:LS(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return jS.fromPartial(e??{})},fromPartial(e){let t=AS();return t.key=e.key??``,t.value=e.value??void 0,t}};function MS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var NS={encode(e,t=new gS){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&kS.encode(kS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&FS.encode(FS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=kS.unwrap(kS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=FS.unwrap(FS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{nullValue:LS(e.nullValue)?ES(e.nullValue):LS(e.null_value)?ES(e.null_value):void 0,numberValue:LS(e.numberValue)?globalThis.Number(e.numberValue):LS(e.number_value)?globalThis.Number(e.number_value):void 0,stringValue:LS(e.stringValue)?globalThis.String(e.stringValue):LS(e.string_value)?globalThis.String(e.string_value):void 0,boolValue:LS(e.boolValue)?globalThis.Boolean(e.boolValue):LS(e.bool_value)?globalThis.Boolean(e.bool_value):void 0,structValue:IS(e.structValue)?e.structValue:IS(e.struct_value)?e.struct_value:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:globalThis.Array.isArray(e.list_value)?[...e.list_value]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=DS(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return NS.fromPartial(e??{})},fromPartial(e){let t=MS();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=MS();if(e===null)t.nullValue=TS.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function PS(){return{values:[]}}var FS={encode(e,t=new gS){for(let n of e.values)NS.encode(NS.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=PS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(NS.unwrap(NS.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return FS.fromPartial(e??{})},fromPartial(e){let t=PS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=PS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}};function IS(e){return typeof e==`object`&&!!e}function LS(e){return e!=null}function RS(){return{message:void 0,value:void 0,fallback:void 0,intValue:void 0,doubleValue:void 0,dictValue:void 0,listValue:void 0}}var J={encode(e,t=new gS){return e.message!==void 0&&xS.encode(e.message,t.uint32(10).fork()).join(),e.value!==void 0&&NS.encode(NS.wrap(e.value),t.uint32(18).fork()).join(),e.fallback!==void 0&&BS.encode(e.fallback,t.uint32(26).fork()).join(),e.intValue!==void 0&&t.uint32(32).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(41).double(e.doubleValue),e.dictValue!==void 0&&WS.encode(e.dictValue,t.uint32(50).fork()).join(),e.listValue!==void 0&&HS.encode(e.listValue,t.uint32(58).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=RS();for(;n.pos>>3){case 1:if(e!==10)break;i.message=xS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.value=NS.unwrap(NS.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.fallback=BS.decode(n,n.uint32());continue;case 4:if(e!==32)break;i.intValue=YS(n.int64());continue;case 5:if(e!==41)break;i.doubleValue=n.double();continue;case 6:if(e!==50)break;i.dictValue=WS.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.listValue=HS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{message:ZS(e.message)?xS.fromJSON(e.message):void 0,value:ZS(e?.value)?e.value:void 0,fallback:ZS(e.fallback)?BS.fromJSON(e.fallback):void 0,intValue:ZS(e.intValue)?globalThis.Number(e.intValue):ZS(e.int_value)?globalThis.Number(e.int_value):void 0,doubleValue:ZS(e.doubleValue)?globalThis.Number(e.doubleValue):ZS(e.double_value)?globalThis.Number(e.double_value):void 0,dictValue:ZS(e.dictValue)?WS.fromJSON(e.dictValue):ZS(e.dict_value)?WS.fromJSON(e.dict_value):void 0,listValue:ZS(e.listValue)?HS.fromJSON(e.listValue):ZS(e.list_value)?HS.fromJSON(e.list_value):void 0}},toJSON(e){let t={};return e.message!==void 0&&(t.message=xS.toJSON(e.message)),e.value!==void 0&&(t.value=e.value),e.fallback!==void 0&&(t.fallback=BS.toJSON(e.fallback)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.dictValue!==void 0&&(t.dictValue=WS.toJSON(e.dictValue)),e.listValue!==void 0&&(t.listValue=HS.toJSON(e.listValue)),t},create(e){return J.fromPartial(e??{})},fromPartial(e){let t=RS();return t.message=e.message!==void 0&&e.message!==null?xS.fromPartial(e.message):void 0,t.value=e.value??void 0,t.fallback=e.fallback!==void 0&&e.fallback!==null?BS.fromPartial(e.fallback):void 0,t.intValue=e.intValue??void 0,t.doubleValue=e.doubleValue??void 0,t.dictValue=e.dictValue!==void 0&&e.dictValue!==null?WS.fromPartial(e.dictValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?HS.fromPartial(e.listValue):void 0,t}};function zS(){return{data:void 0}}var BS={encode(e,t=new gS){return e.data!==void 0&&WS.encode(e.data,t.uint32(10).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=WS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{data:ZS(e.data)?WS.fromJSON(e.data):void 0}},toJSON(e){let t={};return e.data!==void 0&&(t.data=WS.toJSON(e.data)),t},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.data=e.data!==void 0&&e.data!==null?WS.fromPartial(e.data):void 0,t}};function VS(){return{items:[]}}var HS={encode(e,t=new gS){for(let n of e.items)J.encode(n,t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.items.push(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{items:globalThis.Array.isArray(e?.items)?e.items.map(e=>J.fromJSON(e)):[]}},toJSON(e){let t={};return e.items?.length&&(t.items=e.items.map(e=>J.toJSON(e))),t},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.items=e.items?.map(e=>J.fromPartial(e))||[],t}};function US(){return{items:{}}}var WS={encode(e,t=new gS){return globalThis.Object.entries(e.items).forEach(([e,n])=>{KS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:{if(e!==10)break;let t=KS.decode(n,n.uint32());t.value!==void 0&&(i.items[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{items:XS(e.items)?globalThis.Object.entries(e.items).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{}}},toJSON(e){let t={};if(e.items){let n=globalThis.Object.entries(e.items);n.length>0&&(t.items={},n.forEach(([e,n])=>{t.items[e]=J.toJSON(n)}))}return t},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.items=globalThis.Object.entries(e.items??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t}};function GS(){return{key:``,value:void 0}}var KS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:ZS(e.key)?globalThis.String(e.key):``,value:ZS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function qS(){return{data:void 0,version:void 0}}var JS={encode(e,t=new gS){return e.data!==void 0&&J.encode(e.data,t.uint32(10).fork()).join(),e.version!==void 0&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=J.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{data:ZS(e.data)?J.fromJSON(e.data):void 0,version:ZS(e.version)?globalThis.String(e.version):void 0}},toJSON(e){let t={};return e.data!==void 0&&(t.data=J.toJSON(e.data)),e.version!==void 0&&(t.version=e.version),t},create(e){return JS.fromPartial(e??{})},fromPartial(e){let t=qS();return t.data=e.data!==void 0&&e.data!==null?J.fromPartial(e.data):void 0,t.version=e.version??void 0,t}};function YS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e===16){i.indices.push(n.uint32());continue}if(e===18){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],kind:wC(e.kind)?globalThis.Number(e.kind):0,doubles:globalThis.Array.isArray(e?.doubles)?e.doubles.map(e=>globalThis.Number(e)):[],ints:globalThis.Array.isArray(e?.ints)?e.ints.map(e=>globalThis.Number(e)):[],bools:globalThis.Array.isArray(e?.bools)?e.bools.map(e=>globalThis.Boolean(e)):[],values:globalThis.Array.isArray(e?.values)?e.values.map(e=>J.fromJSON(e)):[]}},toJSON(e){let t={};return e.name!==``&&(t.name=e.name),e.indices?.length&&(t.indices=e.indices.map(e=>Math.round(e))),e.kind!==0&&(t.kind=Math.round(e.kind)),e.doubles?.length&&(t.doubles=e.doubles),e.ints?.length&&(t.ints=e.ints.map(e=>Math.round(e))),e.bools?.length&&(t.bools=e.bools),e.values?.length&&(t.values=e.values.map(e=>J.toJSON(e))),t},create(e){return $S.fromPartial(e??{})},fromPartial(e){let t=QS();return t.name=e.name??``,t.indices=e.indices?.map(e=>e)||[],t.kind=e.kind??0,t.doubles=e.doubles?.map(e=>e)||[],t.ints=e.ints?.map(e=>e)||[],t.bools=e.bools?.map(e=>e)||[],t.values=e.values?.map(e=>J.fromPartial(e))||[],t}};function eC(){return{guid:void 0,name:void 0,vertices:[],faceVertices:[],faceSizes:[],attributes:{},vertexAttributeColumns:[],faceAttributeColumns:[],edgeAttributeColumns:[],edgeKeys:[],defaultVertexAttributes:{},defaultFaceAttributes:{},defaultEdgeAttributes:{}}}var tC={encode(e,t=new gS){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.vertices)t.double(n);t.join(),t.uint32(34).fork();for(let n of e.faceVertices)t.uint32(n);t.join(),t.uint32(98).fork();for(let n of e.faceSizes)t.uint32(n);t.join(),globalThis.Object.entries(e.attributes).forEach(([e,n])=>{rC.encode({key:e,value:n},t.uint32(42).fork()).join()});for(let n of e.vertexAttributeColumns)$S.encode(n,t.uint32(50).fork()).join();for(let n of e.faceAttributeColumns)$S.encode(n,t.uint32(58).fork()).join();for(let n of e.edgeAttributeColumns)$S.encode(n,t.uint32(66).fork()).join();for(let n of e.edgeKeys)J.encode(n,t.uint32(106).fork()).join();return globalThis.Object.entries(e.defaultVertexAttributes).forEach(([e,n])=>{aC.encode({key:e,value:n},t.uint32(74).fork()).join()}),globalThis.Object.entries(e.defaultFaceAttributes).forEach(([e,n])=>{sC.encode({key:e,value:n},t.uint32(82).fork()).join()}),globalThis.Object.entries(e.defaultEdgeAttributes).forEach(([e,n])=>{lC.encode({key:e,value:n},t.uint32(90).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=eC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.vertices.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],faceVertices:globalThis.Array.isArray(e?.faceVertices)?e.faceVertices.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.face_vertices)?e.face_vertices.map(e=>globalThis.Number(e)):[],faceSizes:globalThis.Array.isArray(e?.faceSizes)?e.faceSizes.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.face_sizes)?e.face_sizes.map(e=>globalThis.Number(e)):[],attributes:CC(e.attributes)?globalThis.Object.entries(e.attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},vertexAttributeColumns:globalThis.Array.isArray(e?.vertexAttributeColumns)?e.vertexAttributeColumns.map(e=>$S.fromJSON(e)):globalThis.Array.isArray(e?.vertex_attribute_columns)?e.vertex_attribute_columns.map(e=>$S.fromJSON(e)):[],faceAttributeColumns:globalThis.Array.isArray(e?.faceAttributeColumns)?e.faceAttributeColumns.map(e=>$S.fromJSON(e)):globalThis.Array.isArray(e?.face_attribute_columns)?e.face_attribute_columns.map(e=>$S.fromJSON(e)):[],edgeAttributeColumns:globalThis.Array.isArray(e?.edgeAttributeColumns)?e.edgeAttributeColumns.map(e=>$S.fromJSON(e)):globalThis.Array.isArray(e?.edge_attribute_columns)?e.edge_attribute_columns.map(e=>$S.fromJSON(e)):[],edgeKeys:globalThis.Array.isArray(e?.edgeKeys)?e.edgeKeys.map(e=>J.fromJSON(e)):globalThis.Array.isArray(e?.edge_keys)?e.edge_keys.map(e=>J.fromJSON(e)):[],defaultVertexAttributes:CC(e.defaultVertexAttributes)?globalThis.Object.entries(e.defaultVertexAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):CC(e.default_vertex_attributes)?globalThis.Object.entries(e.default_vertex_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultFaceAttributes:CC(e.defaultFaceAttributes)?globalThis.Object.entries(e.defaultFaceAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):CC(e.default_face_attributes)?globalThis.Object.entries(e.default_face_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultEdgeAttributes:CC(e.defaultEdgeAttributes)?globalThis.Object.entries(e.defaultEdgeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):CC(e.default_edge_attributes)?globalThis.Object.entries(e.default_edge_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{}}},toJSON(e){let t={};if(e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices),e.faceVertices?.length&&(t.faceVertices=e.faceVertices.map(e=>Math.round(e))),e.faceSizes?.length&&(t.faceSizes=e.faceSizes.map(e=>Math.round(e))),e.attributes){let n=globalThis.Object.entries(e.attributes);n.length>0&&(t.attributes={},n.forEach(([e,n])=>{t.attributes[e]=J.toJSON(n)}))}if(e.vertexAttributeColumns?.length&&(t.vertexAttributeColumns=e.vertexAttributeColumns.map(e=>$S.toJSON(e))),e.faceAttributeColumns?.length&&(t.faceAttributeColumns=e.faceAttributeColumns.map(e=>$S.toJSON(e))),e.edgeAttributeColumns?.length&&(t.edgeAttributeColumns=e.edgeAttributeColumns.map(e=>$S.toJSON(e))),e.edgeKeys?.length&&(t.edgeKeys=e.edgeKeys.map(e=>J.toJSON(e))),e.defaultVertexAttributes){let n=globalThis.Object.entries(e.defaultVertexAttributes);n.length>0&&(t.defaultVertexAttributes={},n.forEach(([e,n])=>{t.defaultVertexAttributes[e]=J.toJSON(n)}))}if(e.defaultFaceAttributes){let n=globalThis.Object.entries(e.defaultFaceAttributes);n.length>0&&(t.defaultFaceAttributes={},n.forEach(([e,n])=>{t.defaultFaceAttributes[e]=J.toJSON(n)}))}if(e.defaultEdgeAttributes){let n=globalThis.Object.entries(e.defaultEdgeAttributes);n.length>0&&(t.defaultEdgeAttributes={},n.forEach(([e,n])=>{t.defaultEdgeAttributes[e]=J.toJSON(n)}))}return t},create(e){return tC.fromPartial(e??{})},fromPartial(e){let t=eC();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(e=>e)||[],t.faceVertices=e.faceVertices?.map(e=>e)||[],t.faceSizes=e.faceSizes?.map(e=>e)||[],t.attributes=globalThis.Object.entries(e.attributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.vertexAttributeColumns=e.vertexAttributeColumns?.map(e=>$S.fromPartial(e))||[],t.faceAttributeColumns=e.faceAttributeColumns?.map(e=>$S.fromPartial(e))||[],t.edgeAttributeColumns=e.edgeAttributeColumns?.map(e=>$S.fromPartial(e))||[],t.edgeKeys=e.edgeKeys?.map(e=>J.fromPartial(e))||[],t.defaultVertexAttributes=globalThis.Object.entries(e.defaultVertexAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultFaceAttributes=globalThis.Object.entries(e.defaultFaceAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultEdgeAttributes=globalThis.Object.entries(e.defaultEdgeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t}};function nC(){return{key:``,value:void 0}}var rC={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=nC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return rC.fromPartial(e??{})},fromPartial(e){let t=nC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function iC(){return{key:``,value:void 0}}var aC={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=iC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return aC.fromPartial(e??{})},fromPartial(e){let t=iC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function oC(){return{key:``,value:void 0}}var sC={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=oC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return sC.fromPartial(e??{})},fromPartial(e){let t=oC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function cC(){return{key:``,value:void 0}}var lC={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=cC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return lC.fromPartial(e??{})},fromPartial(e){let t=cC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function uC(){return{vertexIndices:[]}}var dC={encode(e,t=new gS){t.uint32(10).fork();for(let n of e.vertexIndices)t.int32(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3==1){if(e===8){i.vertexIndices.push(n.int32());continue}if(e===10){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(e?.vertex_indices)?e.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(e){let t={};return e.vertexIndices?.length&&(t.vertexIndices=e.vertexIndices.map(e=>Math.round(e))),t},create(e){return dC.fromPartial(e??{})},fromPartial(e){let t=uC();return t.vertexIndices=e.vertexIndices?.map(e=>e)||[],t}};function fC(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}var pC={encode(e,t=new gS){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.vertices)t.double(n);t.join();for(let n of e.faces)dC.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=fC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.vertices.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(e=>dC.fromJSON(e)):[]}},toJSON(e){let t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices),e.faces?.length&&(t.faces=e.faces.map(e=>dC.toJSON(e))),t},create(e){return pC.fromPartial(e??{})},fromPartial(e){let t=fC();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(e=>e)||[],t.faces=e.faces?.map(e=>dC.fromPartial(e))||[],t}};function mC(){return{guid:void 0,name:void 0,nodeKeys:[],nodeAttributes:[],attributes:{},defaultNodeAttributes:{},defaultEdgeAttributes:{},edgeU:[],edgeV:[],edgeAttributes:[]}}var hC={encode(e,t=new gS){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(let n of e.nodeKeys)J.encode(n,t.uint32(26).fork()).join();for(let n of e.nodeAttributes)$S.encode(n,t.uint32(34).fork()).join();globalThis.Object.entries(e.attributes).forEach(([e,n])=>{_C.encode({key:e,value:n},t.uint32(42).fork()).join()}),globalThis.Object.entries(e.defaultNodeAttributes).forEach(([e,n])=>{yC.encode({key:e,value:n},t.uint32(50).fork()).join()}),globalThis.Object.entries(e.defaultEdgeAttributes).forEach(([e,n])=>{xC.encode({key:e,value:n},t.uint32(58).fork()).join()}),t.uint32(66).fork();for(let n of e.edgeU)t.uint32(n);t.join(),t.uint32(74).fork();for(let n of e.edgeV)t.uint32(n);t.join();for(let n of e.edgeAttributes)$S.encode(n,t.uint32(82).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=mC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.nodeKeys.push(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.nodeAttributes.push($S.decode(n,n.uint32()));continue;case 5:{if(e!==42)break;let t=_C.decode(n,n.uint32());t.value!==void 0&&(i.attributes[t.key]=t.value);continue}case 6:{if(e!==50)break;let t=yC.decode(n,n.uint32());t.value!==void 0&&(i.defaultNodeAttributes[t.key]=t.value);continue}case 7:{if(e!==58)break;let t=xC.decode(n,n.uint32());t.value!==void 0&&(i.defaultEdgeAttributes[t.key]=t.value);continue}case 8:if(e===64){i.edgeU.push(n.uint32());continue}if(e===66){let e=n.uint32()+n.pos;for(;n.posJ.fromJSON(e)):globalThis.Array.isArray(e?.node_keys)?e.node_keys.map(e=>J.fromJSON(e)):[],nodeAttributes:globalThis.Array.isArray(e?.nodeAttributes)?e.nodeAttributes.map(e=>$S.fromJSON(e)):globalThis.Array.isArray(e?.node_attributes)?e.node_attributes.map(e=>$S.fromJSON(e)):[],attributes:CC(e.attributes)?globalThis.Object.entries(e.attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultNodeAttributes:CC(e.defaultNodeAttributes)?globalThis.Object.entries(e.defaultNodeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):CC(e.default_node_attributes)?globalThis.Object.entries(e.default_node_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultEdgeAttributes:CC(e.defaultEdgeAttributes)?globalThis.Object.entries(e.defaultEdgeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):CC(e.default_edge_attributes)?globalThis.Object.entries(e.default_edge_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},edgeU:globalThis.Array.isArray(e?.edgeU)?e.edgeU.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.edge_u)?e.edge_u.map(e=>globalThis.Number(e)):[],edgeV:globalThis.Array.isArray(e?.edgeV)?e.edgeV.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.edge_v)?e.edge_v.map(e=>globalThis.Number(e)):[],edgeAttributes:globalThis.Array.isArray(e?.edgeAttributes)?e.edgeAttributes.map(e=>$S.fromJSON(e)):globalThis.Array.isArray(e?.edge_attributes)?e.edge_attributes.map(e=>$S.fromJSON(e)):[]}},toJSON(e){let t={};if(e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.nodeKeys?.length&&(t.nodeKeys=e.nodeKeys.map(e=>J.toJSON(e))),e.nodeAttributes?.length&&(t.nodeAttributes=e.nodeAttributes.map(e=>$S.toJSON(e))),e.attributes){let n=globalThis.Object.entries(e.attributes);n.length>0&&(t.attributes={},n.forEach(([e,n])=>{t.attributes[e]=J.toJSON(n)}))}if(e.defaultNodeAttributes){let n=globalThis.Object.entries(e.defaultNodeAttributes);n.length>0&&(t.defaultNodeAttributes={},n.forEach(([e,n])=>{t.defaultNodeAttributes[e]=J.toJSON(n)}))}if(e.defaultEdgeAttributes){let n=globalThis.Object.entries(e.defaultEdgeAttributes);n.length>0&&(t.defaultEdgeAttributes={},n.forEach(([e,n])=>{t.defaultEdgeAttributes[e]=J.toJSON(n)}))}return e.edgeU?.length&&(t.edgeU=e.edgeU.map(e=>Math.round(e))),e.edgeV?.length&&(t.edgeV=e.edgeV.map(e=>Math.round(e))),e.edgeAttributes?.length&&(t.edgeAttributes=e.edgeAttributes.map(e=>$S.toJSON(e))),t},create(e){return hC.fromPartial(e??{})},fromPartial(e){let t=mC();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.nodeKeys=e.nodeKeys?.map(e=>J.fromPartial(e))||[],t.nodeAttributes=e.nodeAttributes?.map(e=>$S.fromPartial(e))||[],t.attributes=globalThis.Object.entries(e.attributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultNodeAttributes=globalThis.Object.entries(e.defaultNodeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultEdgeAttributes=globalThis.Object.entries(e.defaultEdgeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.edgeU=e.edgeU?.map(e=>e)||[],t.edgeV=e.edgeV?.map(e=>e)||[],t.edgeAttributes=e.edgeAttributes?.map(e=>$S.fromPartial(e))||[],t}};function gC(){return{key:``,value:void 0}}var _C={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=gC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return _C.fromPartial(e??{})},fromPartial(e){let t=gC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function vC(){return{key:``,value:void 0}}var yC={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=vC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return yC.fromPartial(e??{})},fromPartial(e){let t=vC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function bC(){return{key:``,value:void 0}}var xC={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=bC();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:wC(e.key)?globalThis.String(e.key):``,value:wC(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return xC.fromPartial(e??{})},fromPartial(e){let t=bC();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function SC(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.x=n.double();continue;case 4:if(e!==33)break;i.y=n.double();continue;case 5:if(e!==41)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return EC.fromPartial(e??{})},fromPartial(e){let t=TC();return t.guid=e.guid??``,t.name=e.name??``,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function DC(){return{guid:``,name:``,x:0,y:0,z:0}}var OC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(25).double(e.x),e.y!==0&&t.uint32(33).double(e.y),e.z!==0&&t.uint32(41).double(e.z),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.x=n.double();continue;case 4:if(e!==33)break;i.y=n.double();continue;case 5:if(e!==41)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return OC.fromPartial(e??{})},fromPartial(e){let t=DC();return t.guid=e.guid??``,t.name=e.name??``,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function kC(){return{guid:``,name:``,point:void 0,xaxis:void 0,yaxis:void 0}}var AC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.point!==void 0&&EC.encode(e.point,t.uint32(26).fork()).join(),e.xaxis!==void 0&&OC.encode(e.xaxis,t.uint32(34).fork()).join(),e.yaxis!==void 0&&OC.encode(e.yaxis,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.point=EC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.xaxis=OC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.yaxis=OC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,point:Y(e.point)?EC.fromJSON(e.point):void 0,xaxis:Y(e.xaxis)?OC.fromJSON(e.xaxis):void 0,yaxis:Y(e.yaxis)?OC.fromJSON(e.yaxis):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.point!==void 0&&(t.point=EC.toJSON(e.point)),e.xaxis!==void 0&&(t.xaxis=OC.toJSON(e.xaxis)),e.yaxis!==void 0&&(t.yaxis=OC.toJSON(e.yaxis)),t},create(e){return AC.fromPartial(e??{})},fromPartial(e){let t=kC();return t.guid=e.guid??``,t.name=e.name??``,t.point=e.point!==void 0&&e.point!==null?EC.fromPartial(e.point):void 0,t.xaxis=e.xaxis!==void 0&&e.xaxis!==null?OC.fromPartial(e.xaxis):void 0,t.yaxis=e.yaxis!==void 0&&e.yaxis!==null?OC.fromPartial(e.yaxis):void 0,t}};function jC(){return{guid:``,name:``,point:void 0,normal:void 0}}var MC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.point!==void 0&&EC.encode(e.point,t.uint32(26).fork()).join(),e.normal!==void 0&&OC.encode(e.normal,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.point=EC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.normal=OC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,point:Y(e.point)?EC.fromJSON(e.point):void 0,normal:Y(e.normal)?OC.fromJSON(e.normal):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.point!==void 0&&(t.point=EC.toJSON(e.point)),e.normal!==void 0&&(t.normal=OC.toJSON(e.normal)),t},create(e){return MC.fromPartial(e??{})},fromPartial(e){let t=jC();return t.guid=e.guid??``,t.name=e.name??``,t.point=e.point!==void 0&&e.point!==null?EC.fromPartial(e.point):void 0,t.normal=e.normal!==void 0&&e.normal!==null?OC.fromPartial(e.normal):void 0,t}};function NC(){return{guid:``,name:``,w:0,x:0,y:0,z:0}}var PC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.w!==0&&t.uint32(25).double(e.w),e.x!==0&&t.uint32(33).double(e.x),e.y!==0&&t.uint32(41).double(e.y),e.z!==0&&t.uint32(49).double(e.z),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.w=n.double();continue;case 4:if(e!==33)break;i.x=n.double();continue;case 5:if(e!==41)break;i.y=n.double();continue;case 6:if(e!==49)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,w:Y(e.w)?globalThis.Number(e.w):0,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.w!==0&&(t.w=e.w),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return PC.fromPartial(e??{})},fromPartial(e){let t=NC();return t.guid=e.guid??``,t.name=e.name??``,t.w=e.w??0,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function FC(){return{guid:``,name:``,start:void 0,end:void 0}}var IC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.start!==void 0&&EC.encode(e.start,t.uint32(26).fork()).join(),e.end!==void 0&&EC.encode(e.end,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.start=EC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.end=EC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,start:Y(e.start)?EC.fromJSON(e.start):void 0,end:Y(e.end)?EC.fromJSON(e.end):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.start!==void 0&&(t.start=EC.toJSON(e.start)),e.end!==void 0&&(t.end=EC.toJSON(e.end)),t},create(e){return IC.fromPartial(e??{})},fromPartial(e){let t=FC();return t.guid=e.guid??``,t.name=e.name??``,t.start=e.start!==void 0&&e.start!==null?EC.fromPartial(e.start):void 0,t.end=e.end!==void 0&&e.end!==null?EC.fromPartial(e.end):void 0,t}};function LC(){return{guid:``,name:``,radius:0,frame:void 0}}var RC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.frame!==void 0&&AC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==34)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return RC.fromPartial(e??{})},fromPartial(e){let t=LC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function zC(){return{guid:``,name:``,circle:void 0,startAngle:0,endAngle:0}}var BC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.circle!==void 0&&RC.encode(e.circle,t.uint32(26).fork()).join(),e.startAngle!==0&&t.uint32(33).double(e.startAngle),e.endAngle!==0&&t.uint32(41).double(e.endAngle),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.circle=RC.decode(n,n.uint32());continue;case 4:if(e!==33)break;i.startAngle=n.double();continue;case 5:if(e!==41)break;i.endAngle=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,circle:Y(e.circle)?RC.fromJSON(e.circle):void 0,startAngle:Y(e.startAngle)?globalThis.Number(e.startAngle):Y(e.start_angle)?globalThis.Number(e.start_angle):0,endAngle:Y(e.endAngle)?globalThis.Number(e.endAngle):Y(e.end_angle)?globalThis.Number(e.end_angle):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.circle!==void 0&&(t.circle=RC.toJSON(e.circle)),e.startAngle!==0&&(t.startAngle=e.startAngle),e.endAngle!==0&&(t.endAngle=e.endAngle),t},create(e){return BC.fromPartial(e??{})},fromPartial(e){let t=zC();return t.guid=e.guid??``,t.name=e.name??``,t.circle=e.circle!==void 0&&e.circle!==null?RC.fromPartial(e.circle):void 0,t.startAngle=e.startAngle??0,t.endAngle=e.endAngle??0,t}};function VC(){return{guid:``,name:``,major:0,minor:0,frame:void 0}}var HC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(25).double(e.major),e.minor!==0&&t.uint32(33).double(e.minor),e.frame!==void 0&&AC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.major=n.double();continue;case 4:if(e!==33)break;i.minor=n.double();continue;case 5:if(e!==42)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,major:Y(e.major)?globalThis.Number(e.major):0,minor:Y(e.minor)?globalThis.Number(e.minor):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return HC.fromPartial(e??{})},fromPartial(e){let t=VC();return t.guid=e.guid??``,t.name=e.name??``,t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function UC(){return{guid:``,name:``,focal:0,frame:void 0}}var WC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.focal!==0&&t.uint32(25).double(e.focal),e.frame!==void 0&&AC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.focal=n.double();continue;case 4:if(e!==34)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,focal:Y(e.focal)?globalThis.Number(e.focal):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.focal!==0&&(t.focal=e.focal),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return WC.fromPartial(e??{})},fromPartial(e){let t=UC();return t.guid=e.guid??``,t.name=e.name??``,t.focal=e.focal??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function GC(){return{guid:``,name:``,major:0,minor:0,frame:void 0}}var KC={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(25).double(e.major),e.minor!==0&&t.uint32(33).double(e.minor),e.frame!==void 0&&AC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.major=n.double();continue;case 4:if(e!==33)break;i.minor=n.double();continue;case 5:if(e!==42)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,major:Y(e.major)?globalThis.Number(e.major):0,minor:Y(e.minor)?globalThis.Number(e.minor):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return KC.fromPartial(e??{})},fromPartial(e){let t=GC();return t.guid=e.guid??``,t.name=e.name??``,t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function qC(){return{guid:``,name:``,points:[],degree:0}}var JC={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),e.degree!==0&&t.uint32(32).int32(e.degree),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],degree:Y(e.degree)?globalThis.Number(e.degree):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),e.degree!==0&&(t.degree=Math.round(e.degree)),t},create(e){return JC.fromPartial(e??{})},fromPartial(e){let t=qC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t.degree=e.degree??0,t}};function YC(){return{guid:``,name:``,points:[]}}var XC={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return XC.fromPartial(e??{})},fromPartial(e){let t=YC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function ZC(){return{guid:``,name:``,points:[]}}var QC={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return QC.fromPartial(e??{})},fromPartial(e){let t=ZC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function $C(){return{guid:``,name:``,frame:void 0,xsize:0,ysize:0,zsize:0}}var ew={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.frame!==void 0&&AC.encode(e.frame,t.uint32(26).fork()).join(),e.xsize!==0&&t.uint32(33).double(e.xsize),e.ysize!==0&&t.uint32(41).double(e.ysize),e.zsize!==0&&t.uint32(49).double(e.zsize),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$C();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.frame=AC.decode(n,n.uint32());continue;case 4:if(e!==33)break;i.xsize=n.double();continue;case 5:if(e!==41)break;i.ysize=n.double();continue;case 6:if(e!==49)break;i.zsize=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0,xsize:Y(e.xsize)?globalThis.Number(e.xsize):0,ysize:Y(e.ysize)?globalThis.Number(e.ysize):0,zsize:Y(e.zsize)?globalThis.Number(e.zsize):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),e.xsize!==0&&(t.xsize=e.xsize),e.ysize!==0&&(t.ysize=e.ysize),e.zsize!==0&&(t.zsize=e.zsize),t},create(e){return ew.fromPartial(e??{})},fromPartial(e){let t=$C();return t.guid=e.guid??``,t.name=e.name??``,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t.xsize=e.xsize??0,t.ysize=e.ysize??0,t.zsize=e.zsize??0,t}};function tw(){return{guid:``,name:``,radius:0,frame:void 0}}var nw={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.frame!==void 0&&AC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==34)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return nw.fromPartial(e??{})},fromPartial(e){let t=tw();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function rw(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var iw={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&AC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=rw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return iw.fromPartial(e??{})},fromPartial(e){let t=rw();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function aw(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var ow={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&AC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=aw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return ow.fromPartial(e??{})},fromPartial(e){let t=aw();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function sw(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var cw={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&AC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=sw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return cw.fromPartial(e??{})},fromPartial(e){let t=sw();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function lw(){return{guid:``,name:``,radiusAxis:0,radiusPipe:0,frame:void 0}}var uw={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radiusAxis!==0&&t.uint32(25).double(e.radiusAxis),e.radiusPipe!==0&&t.uint32(33).double(e.radiusPipe),e.frame!==void 0&&AC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=lw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radiusAxis=n.double();continue;case 4:if(e!==33)break;i.radiusPipe=n.double();continue;case 5:if(e!==42)break;i.frame=AC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radiusAxis:Y(e.radiusAxis)?globalThis.Number(e.radiusAxis):Y(e.radius_axis)?globalThis.Number(e.radius_axis):0,radiusPipe:Y(e.radiusPipe)?globalThis.Number(e.radiusPipe):Y(e.radius_pipe)?globalThis.Number(e.radius_pipe):0,frame:Y(e.frame)?AC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radiusAxis!==0&&(t.radiusAxis=e.radiusAxis),e.radiusPipe!==0&&(t.radiusPipe=e.radiusPipe),e.frame!==void 0&&(t.frame=AC.toJSON(e.frame)),t},create(e){return uw.fromPartial(e??{})},fromPartial(e){let t=lw();return t.guid=e.guid??``,t.name=e.name??``,t.radiusAxis=e.radiusAxis??0,t.radiusPipe=e.radiusPipe??0,t.frame=e.frame!==void 0&&e.frame!==null?AC.fromPartial(e.frame):void 0,t}};function dw(){return{guid:``,name:``,points:[]}}var fw={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=dw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return fw.fromPartial(e??{})},fromPartial(e){let t=dw();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function pw(){return{guid:``,name:``,matrix:[]}}var mw={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=pw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return mw.fromPartial(e??{})},fromPartial(e){let t=pw();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function hw(){return{guid:``,name:``,translationVector:void 0}}var gw={encode(e,t=new gS){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.translationVector!==void 0&&OC.encode(e.translationVector,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=hw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.translationVector=OC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,translationVector:Y(e.translationVector)?OC.fromJSON(e.translationVector):Y(e.translation_vector)?OC.fromJSON(e.translation_vector):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.translationVector!==void 0&&(t.translationVector=OC.toJSON(e.translationVector)),t},create(e){return gw.fromPartial(e??{})},fromPartial(e){let t=hw();return t.guid=e.guid??``,t.name=e.name??``,t.translationVector=e.translationVector!==void 0&&e.translationVector!==null?OC.fromPartial(e.translationVector):void 0,t}};function _w(){return{guid:``,name:``,matrix:[]}}var vw={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=_w();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return vw.fromPartial(e??{})},fromPartial(e){let t=_w();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function yw(){return{guid:``,name:``,matrix:[]}}var bw={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=yw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return bw.fromPartial(e??{})},fromPartial(e){let t=yw();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function xw(){return{guid:``,name:``,matrix:[]}}var Sw={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=xw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return Sw.fromPartial(e??{})},fromPartial(e){let t=xw();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function Cw(){return{guid:``,name:``,matrix:[]}}var ww={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=Cw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return ww.fromPartial(e??{})},fromPartial(e){let t=Cw();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function Tw(){return{guid:``,name:``,matrix:[]}}var Ew={encode(e,t=new gS){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=Tw();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return Ew.fromPartial(e??{})},fromPartial(e){let t=Tw();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function Y(e){return e!=null}var Dw=class{data;constructor(e){let t;if(t=`bytes`in e?Ow(e.bytes):e.data,t.x===void 0||t.y===void 0||t.z===void 0)throw Error(`Invalid PointData: Missing required properties (x, y, or z).`);this.data=t}get bytes(){return kw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function Ow(e){return EC.decode(e)}function kw(e){return EC.encode(e).finish()}function Aw(e){if(e.length%3!=0)throw Error(`Invalid coordinate array: expected x, y, z triplets.`);let t=[];for(let n=0;ne+t,0);if(t.vertices.length%3!=0||n!==t.faceVertices.length)throw Error(`Invalid MeshData: malformed vertices or face arrays.`);this.data=t}get bytes(){return Hw(this.data)}get guid(){return this.data.guid?this.data.guid:``}get name(){return this.data.name?this.data.name:``}get vertices(){return this._vertices||=Aw(this.data.vertices),this._vertices}get faces(){let e=[],t=0;for(let n of this.data.faceSizes){let r=this.data.faceVertices.slice(t,t+n);e.push(new Lw({data:{indices:r}})),t+=n}return e}};function Vw(e){return tC.decode(e)}function Hw(e){return tC.encode(e).finish()}var Uw=class{data;constructor(e){this.data=`bytes`in e?Ww(e.bytes):e.data}get bytes(){return Gw(this.data)}get guid(){return this.data.guid||``}get name(){return this.data.name||``}get nodeKeys(){return this.data.nodeKeys.map(jE)}};function Ww(e){return hC.decode(e)}function Gw(e){return hC.encode(e).finish()}var Kw=class{data;constructor(e){let t;if(t=`bytes`in e?qw(e.bytes):e.data,t.x===void 0||t.y===void 0||t.z===void 0)throw Error(`Invalid VectorData: Missing required properties (x, y, or z).`);this.data=t}get bytes(){return Jw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function qw(e){return OC.decode(e)}function Jw(e){return OC.encode(e).finish()}var Yw=class{data;_point;_xaxis;_yaxis;constructor(e){let t;if(t=`bytes`in e?Xw(e.bytes):e.data,!t.point||!t.xaxis||!t.yaxis)throw Error(`Invalid FrameData: Missing required properties (point, xaxis, or yaxis).`);this.data=t}get bytes(){return Zw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||=new Dw({data:this.data.point}),this._point}get xaxis(){return this._xaxis||=new Kw({data:this.data.xaxis}),this._xaxis}get yaxis(){return this._yaxis||=new Kw({data:this.data.yaxis}),this._yaxis}};function Xw(e){return AC.decode(e)}function Zw(e){return AC.encode(e).finish()}var Qw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?$w(e.bytes):e.data,!t.radius||!t.frame)throw Error(`Invalid CircleData: Missing required properties (radius or frame).`);this.data=t}get bytes(){return eT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function $w(e){return RC.decode(e)}function eT(e){return RC.encode(e).finish()}var tT=class{data;_circle;constructor(e){let t;if(t=`bytes`in e?nT(e.bytes):e.data,!t.startAngle||!t.endAngle||!t.circle)throw Error(`Invalid ArcData: Missing required properties (startAngle, endAngle, or circle).`);this.data=t}get bytes(){return rT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get startAngle(){return this.data.startAngle}get endAngle(){return this.data.endAngle}get circle(){return this._circle||=new Qw({data:this.data.circle}),this._circle}};function nT(e){return BC.decode(e)}function rT(e){return BC.encode(e).finish()}var iT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?aT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid BezierData: Missing required property points.`);this.data=t}get bytes(){return oT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=Aw(this.data.points),this._points}};function aT(e){return JC.decode(e)}function oT(e){return JC.encode(e).finish()}var sT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?cT(e.bytes):e.data,!t.xsize||!t.ysize||!t.zsize||!t.frame)throw Error(`Invalid BoxData: Missing required properties (xsize, ysize, zsize, or frame).`);this.data=t}get bytes(){return lT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get xsize(){return this.data.xsize}get ysize(){return this.data.ysize}get zsize(){return this.data.zsize}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function cT(e){return ew.decode(e)}function lT(e){return ew.encode(e).finish()}var uT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?dT(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid CapsuleData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return fT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function dT(e){return cw.decode(e)}function fT(e){return cw.encode(e).finish()}var pT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?mT(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid ConeData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return hT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function mT(e){return ow.decode(e)}function hT(e){return ow.encode(e).finish()}var gT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?_T(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid CylinderData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return vT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function _T(e){return iw.decode(e)}function vT(e){return iw.encode(e).finish()}var yT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?bT(e.bytes):e.data,!t.major||!t.minor||!t.frame)throw Error(`Invalid EllipseData: Missing required properties (major, minor, or frame).`);this.data=t}get bytes(){return xT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function bT(e){return HC.decode(e)}function xT(e){return HC.encode(e).finish()}var ST=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?CT(e.bytes):e.data,!t.major||!t.minor||!t.frame)throw Error(`Invalid HyperbolaData: Missing required properties (a, b, or frame).`);this.data=t}get bytes(){return wT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function CT(e){return KC.decode(e)}function wT(e){return KC.encode(e).finish()}var TT=class{data;_start;_end;constructor(e){let t;if(t=`bytes`in e?ET(e.bytes):e.data,!t.start||!t.end)throw Error(`Invalid LineData: Missing required properties (start or end).`);this.data=t}get bytes(){return DT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get start(){return this._start||=new Dw({data:this.data.start}),this._start}get end(){return this._end||=new Dw({data:this.data.end}),this._end}};function ET(e){return IC.decode(e)}function DT(e){return IC.encode(e).finish()}var OT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?kT(e.bytes):e.data,!t.focal||!t.frame)throw Error(`Invalid ParabolaData: Missing required properties (focal_length or frame).`);this.data=t}get bytes(){return AT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get focal(){return this.data.focal}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function kT(e){return WC.decode(e)}function AT(e){return WC.encode(e).finish()}var jT=class{data;_point;_normal;constructor(e){let t;if(t=`bytes`in e?MT(e.bytes):e.data,!t.point||!t.normal)throw Error(`Invalid PlaneData: Missing required properties (point or normal).`);this.data=t}get bytes(){return NT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||=new Dw({data:this.data.point}),this._point}get normal(){return this._normal||=new Kw({data:this.data.normal}),this._normal}};function MT(e){return MC.decode(e)}function NT(e){return MC.encode(e).finish()}var PT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?FT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PointcloudData: Missing required property points.`);this.data=t}get bytes(){return IT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=Aw(this.data.points),this._points}};function FT(e){return fw.decode(e)}function IT(e){return fw.encode(e).finish()}var LT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?RT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PolygonData: Missing required property points.`);this.data=t}get bytes(){return zT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=Aw(this.data.points),this._points}};function RT(e){return QC.decode(e)}function zT(e){return QC.encode(e).finish()}var BT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?VT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PolylineData: Missing required property points.`);this.data=t}get bytes(){return HT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=Aw(this.data.points),this._points}};function VT(e){return XC.decode(e)}function HT(e){return XC.encode(e).finish()}var UT=class{data;constructor(e){let t;if(t=`bytes`in e?WT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ProjectionData: Missing required properties (direction).`);this.data=t}get bytes(){return GT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function WT(e){return Ew.decode(e)}function GT(e){return Ew.encode(e).finish()}var KT=class{data;constructor(e){let t;if(t=`bytes`in e?qT(e.bytes):e.data,!t.w||!t.x||!t.y||!t.z)throw Error(`Invalid QuaternionData: Missing required properties (w, x, y, or z).`);this.data=t}get bytes(){return JT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get w(){return this.data.w}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function qT(e){return PC.decode(e)}function JT(e){return PC.encode(e).finish()}var YT=class{data;constructor(e){let t;if(t=`bytes`in e?XT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ReflectionData: Missing required properties (frame).`);this.data=t}get bytes(){return ZT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function XT(e){return Sw.decode(e)}function ZT(e){return Sw.encode(e).finish()}var QT=class{data;constructor(e){let t;if(t=`bytes`in e?$T(e.bytes):e.data,t.matrix.length!==16)throw Error(`Invalid RotationData: matrix must contain 16 values.`);this.data=t}get bytes(){return eE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function $T(e){return vw.decode(e)}function eE(e){return vw.encode(e).finish()}var tE=class{data;constructor(e){let t;if(t=`bytes`in e?nE(e.bytes):e.data,!t.matrix)throw Error(`Invalid ScaleData: Missing required properties (factor or frame).`);this.data=t}get bytes(){return rE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function nE(e){return bw.decode(e)}function rE(e){return bw.encode(e).finish()}var iE=class{data;constructor(e){let t;if(t=`bytes`in e?aE(e.bytes):e.data,!t.matrix)throw Error(`Invalid ShearData: Missing required properties (matrix).`);this.data=t}get bytes(){return oE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function aE(e){return ww.decode(e)}function oE(e){return ww.encode(e).finish()}var sE=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?cE(e.bytes):e.data,!t.radius||!t.frame)throw Error(`Invalid SphereData: Missing required properties (radius or frame).`);this.data=t}get bytes(){return lE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function cE(e){return nw.decode(e)}function lE(e){return nw.encode(e).finish()}var uE=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?dE(e.bytes):e.data,!t.radiusAxis||!t.radiusPipe||!t.frame)throw Error(`Invalid TorusData: Missing required properties (major, minor, or frame).`);this.data=t}get bytes(){return fE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radiusAxis(){return this.data.radiusAxis}get radiusPipe(){return this.data.radiusPipe}get frame(){return this._frame||=new Yw({data:this.data.frame}),this._frame}};function dE(e){return uw.decode(e)}function fE(e){return uw.encode(e).finish()}var pE=class{data;constructor(e){let t;t=`bytes`in e?mE(e.bytes):e.data,this.data=t}get bytes(){return hE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function mE(e){return mw.decode(e)}function hE(e){return mw.encode(e).finish()}var gE=class{data;_translationVector;constructor(e){let t;if(t=`bytes`in e?_E(e.bytes):e.data,!t.translationVector)throw Error(`Invalid TranslationData: Missing required properties (vector or frame).`);this.data=t}get bytes(){return vE(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get translationVector(){return this._translationVector||=new Kw({data:this.data.translationVector}),this._translationVector}};function _E(e){return gw.decode(e)}function vE(e){return gw.encode(e).finish()}var yE=class{data;constructor(e){let t;t=`bytes`in e?bE(e.bytes):e.data,this.data=t}get bytes(){return xE(this.data)}get asDict(){return FE(this.data)}};function bE(e){return WS.decode(e)}function xE(e){return WS.encode(e).finish()}var SE=class{data;constructor(e){let t;t=`bytes`in e?CE(e.bytes):e.data,this.data=t}get bytes(){return wE(this.data)}get asList(){return PE(this.data)}};function CE(e){return HS.decode(e)}function wE(e){return HS.encode(e).finish()}var TE=new Map([[`ArcData`,tT],[`BezierData`,iT],[`BoxData`,sT],[`CapsuleData`,uT],[`CircleData`,Qw],[`ConeData`,pT],[`CylinderData`,gT],[`EllipseData`,yT],[`FrameData`,Yw],[`HyperbolaData`,ST],[`LineData`,TT],[`ParabolaData`,OT],[`PlaneData`,jT],[`PointData`,Dw],[`PointcloudData`,PT],[`PolygonData`,LT],[`PolylineData`,BT],[`ProjectionData`,UT],[`QuaternionData`,KT],[`ReflectionData`,YT],[`RotationData`,QT],[`ScaleData`,tE],[`ShearData`,iE],[`SphereData`,sE],[`TorusData`,uE],[`TransformationData`,pE],[`TranslationData`,gE],[`VectorData`,Kw],[`MeshData`,Bw],[`PolyhedronData`,Pw],[`GraphData`,Uw],[`DictData`,yE],[`ListData`,SE]]),EE=`1.0.0`;function DE(e){return jE(OE(e))}function OE(e){if(e.length===0)throw Error(`Binary data is empty.`);let t=JS.decode(e);if(AE(t.version),!t.data)throw Error(`Message contains no data.`);return t.data}function kE(e){let t=e.split(`.`);return t[0]===`0`&&t.length>=2?`${t[0]}.${t[1]}`:t[0]}function AE(e){if(!e)throw Error(`No version tag in the message; cannot verify compas_pb wire-format compatibility (reader is ${EE}).`);if(kE(e)!==kE(`1.0.0`))throw Error(`Incompatible compas_pb wire format: message was written by version ${e} but this reader is ${EE}.`)}function jE(e){if(e.value!==void 0)return ME(e.value);if(e.intValue!==void 0)return e.intValue;if(e.doubleValue!==void 0)return e.doubleValue;if(e.dictValue!==void 0)return FE(e.dictValue);if(e.listValue!==void 0)return PE(e.listValue);if(e.message!==void 0)return NE(e.message);if(e.fallback?.data!==void 0)return FE(e.fallback.data)}function ME(e){if(typeof e!=`string`||!e.startsWith(`base64:`))return e;let t=globalThis.atob(e.slice(7));return Uint8Array.from(t,e=>e.charCodeAt(0))}function NE(e){let t=e.typeUrl.split(`.`).slice(-1)[0];if(t===`ListData`)return PE(HS.decode(e.value));if(t===`DictData`)return FE(WS.decode(e.value));let n=TE.get(t);return n?new n({bytes:e.value}):null}function PE(e){return e.items.map(jE)}function FE(e){let t={};for(let n of Object.keys(e.items))t[n]=jE(e.items[n]);return t}function IE(e){return DE(e)}var LE=class{options;socket=null;retryTimer=null;stopped=!0;constructor(e){this.options=e}start(){this.stopped&&(this.stopped=!1,this.connect())}send(e){return this.socket?.readyState===WebSocket.OPEN?(this.socket.send(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`string`?e:JSON.stringify(e)),!0):this.options.send?.(e)!==!1&&this.options.send!==void 0}dispose(){this.stopped=!0,this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null);let e=this.socket;this.socket=null,e&&(e.onclose=null,e.close())}connect(){if(this.stopped)return;let e=new WebSocket(this.buildUrl());this.socket=e,e.binaryType=`arraybuffer`,e.onmessage=e=>{e.data instanceof ArrayBuffer&&this.options.dispatch(new Uint8Array(e.data))},e.onerror=()=>{this.options.onError(Error(`WebSocket connection failed: ${this.buildUrl()}`))},e.onclose=()=>{this.stopped||(this.retryTimer=setTimeout(()=>this.connect(),1e3))}}buildUrl(){let e=new URLSearchParams(window.location.search),t=this.options.host??e.get(`ws_host`)??`127.0.0.1`,n=this.options.port??Number(e.get(`ws_port`)??9001),r=this.options.workspace??e.get(`workspace`)??`main`;return`${this.options.secure??window.location.protocol===`https:`?`wss`:`ws`}://${t}:${n}/ws?workspace=${encodeURIComponent(r)}`}},RE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},zE={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},BE=1e3,VE=1001,HE=1002,UE=1003,WE=1004,GE=1005,KE=1006,qE=1007,JE=1008,YE=1009,XE=1010,ZE=1011,QE=1012,$E=1013,eD=1014,tD=1015,nD=1016,rD=1017,iD=1018,aD=1020,oD=35902,sD=35899,cD=1021,lD=1022,uD=1023,dD=1026,fD=1027,pD=1028,mD=1029,hD=1030,gD=1031,_D=1033,vD=33776,yD=33777,bD=33778,xD=33779,SD=35840,CD=35841,wD=35842,TD=35843,ED=36196,DD=37492,OD=37496,kD=37488,AD=37489,jD=37490,MD=37491,ND=37808,PD=37809,FD=37810,ID=37811,LD=37812,RD=37813,zD=37814,BD=37815,VD=37816,HD=37817,UD=37818,WD=37819,GD=37820,KD=37821,qD=36492,JD=36494,YD=36495,XD=36283,ZD=36284,QD=36285,$D=36286,eO=2300,tO=2301,nO=2302,rO=2400,iO=2401,aO=2402,oO=3200,sO=`srgb`,cO=`srgb-linear`,lO=`linear`,uO=`srgb`,dO=7680,fO=35044,pO=2e3;function mO(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function hO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gO(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function _O(){let e=gO(`canvas`);return e.style.display=`block`,e}var vO={};function yO(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function bO(...e){let t=`THREE.`+e.shift();console.warn(t,...e)}function xO(...e){let t=`THREE.`+e.shift();console.error(t,...e)}function SO(...e){let t=e.join(` `);t in vO||(vO[t]=!0,bO(...e))}function CO(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var wO=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+TO[e>>16&255]+TO[e>>24&255]+`-`+TO[t&255]+TO[t>>8&255]+`-`+TO[t>>16&15|64]+TO[t>>24&255]+`-`+TO[n&63|128]+TO[n>>8&255]+`-`+TO[n>>16&255]+TO[n>>24&255]+TO[r&255]+TO[r>>8&255]+TO[r>>16&255]+TO[r>>24&255]).toLowerCase()}function AO(e,t,n){return Math.max(t,Math.min(n,e))}function jO(e,t){return(e%t+t)%t}function MO(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function NO(e,t,n){return e===t?0:(n-e)/(t-e)}function PO(e,t,n){return(1-n)*e+n*t}function FO(e,t,n,r){return PO(e,t,1-Math.exp(-n*r))}function IO(e,t=1){return t-Math.abs(jO(e,t*2)-t)}function LO(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function RO(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function zO(e,t){return e+Math.floor(Math.random()*(t-e+1))}function BO(e,t){return e+Math.random()*(t-e)}function VO(e){return e*(.5-Math.random())}function HO(e){e!==void 0&&(EO=e);let t=EO+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function UO(e){return e*DO}function WO(e){return e*OO}function GO(e){return!(e&e-1)&&e!==0}function KO(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function qO(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function JO(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:bO(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function YO(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function XO(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var ZO={DEG2RAD:DO,RAD2DEG:OO,generateUUID:kO,clamp:AO,euclideanModulo:jO,mapLinear:MO,inverseLerp:NO,lerp:PO,damp:FO,pingpong:IO,smoothstep:LO,smootherstep:RO,randInt:zO,randFloat:BO,randFloatSpread:VO,seededRandom:HO,degToRad:UO,radToDeg:WO,isPowerOfTwo:GO,ceilPowerOfTwo:KO,floorPowerOfTwo:qO,setQuaternionFromProperEuler:JO,normalize:XO,denormalize:YO},X=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=AO(this.x,e.x,t.x),this.y=AO(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=AO(this.x,e,t),this.y=AO(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(AO(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(AO(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},QO=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:bO(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(AO(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},Z=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ek.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ek.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=AO(this.x,e.x,t.x),this.y=AO(this.y,e.y,t.y),this.z=AO(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=AO(this.x,e,t),this.y=AO(this.y,e,t),this.z=AO(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(AO(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return $O.copy(this).projectOnVector(e),this.sub($O)}reflect(e){return this.sub($O.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(AO(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},$O=new Z,ek=new QO,tk=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(nk.makeScale(e,t)),this}rotate(e){return this.premultiply(nk.makeRotation(-e)),this}translate(e,t){return this.premultiply(nk.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},nk=new tk,rk=new tk().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ik=new tk().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ak(){let e={enabled:!0,workingColorSpace:cO,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=sk(e.r),e.g=sk(e.g),e.b=sk(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=ck(e.r),e.g=ck(e.g),e.b=ck(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?lO:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return SO(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return SO(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[cO]:{primaries:t,whitePoint:r,transfer:lO,toXYZ:rk,fromXYZ:ik,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:sO},outputColorSpaceConfig:{drawingBufferColorSpace:sO}},[sO]:{primaries:t,whitePoint:r,transfer:uO,toXYZ:rk,fromXYZ:ik,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:sO}}}),e}var ok=ak();function sk(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function ck(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var lk,uk=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{lk===void 0&&(lk=gO(`canvas`)),lk.width=e.width,lk.height=e.height;let t=lk.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=lk}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=gO(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(hk).x}get height(){return this.source.getSize(hk).y}get depth(){return this.source.getSize(hk).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){bO(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){bO(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case BE:e.x-=Math.floor(e.x);break;case VE:e.x=e.x<0?0:1;break;case HE:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case BE:e.y-=Math.floor(e.y);break;case VE:e.y=e.y<0?0:1;break;case HE:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};gk.DEFAULT_IMAGE=null,gk.DEFAULT_MAPPING=300,gk.DEFAULT_ANISOTROPY=1;var _k=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,wk),wk.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Mk),Nk.subVectors(this.max,Mk),Ek.subVectors(e.a,Mk),Dk.subVectors(e.b,Mk),Ok.subVectors(e.c,Mk),kk.subVectors(Dk,Ek),Ak.subVectors(Ok,Dk),jk.subVectors(Ek,Ok);let t=[0,-kk.z,kk.y,0,-Ak.z,Ak.y,0,-jk.z,jk.y,kk.z,0,-kk.x,Ak.z,0,-Ak.x,jk.z,0,-jk.x,-kk.y,kk.x,0,-Ak.y,Ak.x,0,-jk.y,jk.x,0];return!Ik(t,Ek,Dk,Ok,Nk)||(t=[1,0,0,0,1,0,0,0,1],!Ik(t,Ek,Dk,Ok,Nk))?!1:(Pk.crossVectors(kk,Ak),t=[Pk.x,Pk.y,Pk.z],Ik(t,Ek,Dk,Ok,Nk))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wk).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wk).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ck[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ck[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ck[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ck[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ck[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ck[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ck[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ck[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ck),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Ck=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],wk=new Z,Tk=new Sk,Ek=new Z,Dk=new Z,Ok=new Z,kk=new Z,Ak=new Z,jk=new Z,Mk=new Z,Nk=new Z,Pk=new Z,Fk=new Z;function Ik(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Fk.fromArray(e,a);let o=i.x*Math.abs(Fk.x)+i.y*Math.abs(Fk.y)+i.z*Math.abs(Fk.z),s=t.dot(Fk),c=n.dot(Fk),l=r.dot(Fk);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Lk=new Sk,Rk=new Z,zk=new Z,Bk=class{constructor(e=new Z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Lk.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Rk.subVectors(e,this.center);let t=Rk.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Rk,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(zk.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Rk.copy(e.center).add(zk)),this.expandByPoint(Rk.copy(e.center).sub(zk))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},Vk=new Z,Hk=new Z,Uk=new Z,Wk=new Z,Gk=new Z,Kk=new Z,qk=new Z,Jk=class{constructor(e=new Z,t=new Z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Vk)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Vk.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Vk.copy(this.origin).addScaledVector(this.direction,t),Vk.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Hk.copy(e).add(t).multiplyScalar(.5),Uk.copy(t).sub(e).normalize(),Wk.copy(this.origin).sub(Hk);let i=e.distanceTo(t)*.5,a=-this.direction.dot(Uk),o=Wk.dot(this.direction),s=-Wk.dot(Uk),c=Wk.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0){if(u=a*s-o,d=a*o-s,p=i*l,u>=0){if(d>=-p){if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c)}else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Hk).addScaledVector(Uk,d),f}intersectSphere(e,t){Vk.subVectors(e.center,this.origin);let n=Vk.dot(this.direction),r=Vk.dot(Vk)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Vk)!==null}intersectTriangle(e,t,n,r,i){Gk.subVectors(t,e),Kk.subVectors(n,e),qk.crossVectors(Gk,Kk);let a=this.direction.dot(qk),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Wk.subVectors(this.origin,e);let s=o*this.direction.dot(Kk.crossVectors(Wk,Kk));if(s<0)return null;let c=o*this.direction.dot(Gk.cross(Wk));if(c<0||s+c>a)return null;let l=-o*Wk.dot(qk);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Yk=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();let t=this.elements,n=e.elements,r=1/Xk.setFromMatrixColumn(e,0).length(),i=1/Xk.setFromMatrixColumn(e,1).length(),a=1/Xk.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Qk,e,$k)}lookAt(e,t,n){let r=this.elements;return nA.subVectors(e,t),nA.lengthSq()===0&&(nA.z=1),nA.normalize(),eA.crossVectors(n,nA),eA.lengthSq()===0&&(Math.abs(n.z)===1?nA.x+=1e-4:nA.z+=1e-4,nA.normalize(),eA.crossVectors(n,nA)),eA.normalize(),tA.crossVectors(nA,eA),r[0]=eA.x,r[4]=tA.x,r[8]=nA.x,r[1]=eA.y,r[5]=tA.y,r[9]=nA.y,r[2]=eA.z,r[6]=tA.z,r[10]=nA.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],ee=r[2],k=r[6],A=r[10],te=r[14],j=r[3],ne=r[7],M=r[11],N=r[15];return i[0]=a*x+o*T+s*ee+c*j,i[4]=a*S+o*E+s*k+c*ne,i[8]=a*C+o*D+s*A+c*M,i[12]=a*w+o*O+s*te+c*N,i[1]=l*x+u*T+d*ee+f*j,i[5]=l*S+u*E+d*k+f*ne,i[9]=l*C+u*D+d*A+f*M,i[13]=l*w+u*O+d*te+f*N,i[2]=p*x+m*T+h*ee+g*j,i[6]=p*S+m*E+h*k+g*ne,i[10]=p*C+m*D+h*A+g*M,i[14]=p*w+m*O+h*te+g*N,i[3]=_*x+v*T+y*ee+b*j,i[7]=_*S+v*E+y*k+b*ne,i[11]=_*C+v*D+y*A+b*M,i[15]=_*w+v*O+y*te+b*N,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let i=Xk.set(r[0],r[1],r[2]).length(),a=Xk.set(r[4],r[5],r[6]).length(),o=Xk.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),Zk.copy(this);let s=1/i,c=1/a,l=1/o;return Zk.elements[0]*=s,Zk.elements[1]*=s,Zk.elements[2]*=s,Zk.elements[4]*=c,Zk.elements[5]*=c,Zk.elements[6]*=c,Zk.elements[8]*=l,Zk.elements[9]*=l,Zk.elements[10]*=l,t.setFromRotationMatrix(Zk),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=pO,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=pO,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Xk=new Z,Zk=new Yk,Qk=new Z(0,0,0),$k=new Z(1,1,1),eA=new Z,tA=new Z,nA=new Z,rA=new Yk,iA=new QO,aA=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(AO(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-AO(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(AO(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-AO(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(AO(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-AO(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:bO(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return rA.makeRotationFromQuaternion(e),this.setFromRotationMatrix(rA,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return iA.setFromEuler(this),this.setFromQuaternion(iA,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};aA.DEFAULT_ORDER=`XYZ`;var oA=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){CA.subVectors(r,t),wA.subVectors(n,t),TA.subVectors(e,t);let a=CA.dot(CA),o=CA.dot(wA),s=CA.dot(TA),c=wA.dot(wA),l=wA.dot(TA),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,EA)!==null&&EA.x>=0&&EA.y>=0&&EA.x+EA.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,EA)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,EA.x),s.addScaledVector(a,EA.y),s.addScaledVector(o,EA.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return NA.setScalar(0),PA.setScalar(0),FA.setScalar(0),NA.fromBufferAttribute(e,t),PA.fromBufferAttribute(e,n),FA.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(NA,i.x),a.addScaledVector(PA,i.y),a.addScaledVector(FA,i.z),a}static isFrontFacing(e,t,n,r){return CA.subVectors(n,t),wA.subVectors(e,t),CA.cross(wA).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return CA.subVectors(this.c,this.b),wA.subVectors(this.a,this.b),CA.cross(wA).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;DA.subVectors(r,n),OA.subVectors(i,n),AA.subVectors(e,n);let s=DA.dot(AA),c=OA.dot(AA);if(s<=0&&c<=0)return t.copy(n);jA.subVectors(e,r);let l=DA.dot(jA),u=OA.dot(jA);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(DA,a);MA.subVectors(e,i);let f=DA.dot(MA),p=OA.dot(MA);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(OA,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return kA.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(kA,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(DA,a).addScaledVector(OA,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},LA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},RA={h:0,s:0,l:0},zA={h:0,s:0,l:0};function BA(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var VA=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=sO){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ok.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=ok.workingColorSpace){return this.r=e,this.g=t,this.b=n,ok.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=ok.workingColorSpace){if(e=jO(e,1),t=AO(t,0,1),n=AO(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=BA(i,r,e+1/3),this.g=BA(i,r,e),this.b=BA(i,r,e-1/3)}return ok.colorSpaceToWorking(this,r),this}setStyle(e,t=sO){function n(t){t!==void 0&&parseFloat(t)<1&&bO(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:bO(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);bO(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=sO){let n=LA[e.toLowerCase()];return n===void 0?bO(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=sk(e.r),this.g=sk(e.g),this.b=sk(e.b),this}copyLinearToSRGB(e){return this.r=ck(e.r),this.g=ck(e.g),this.b=ck(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=sO){return ok.workingToColorSpace(HA.copy(this),e),Math.round(AO(HA.r*255,0,255))*65536+Math.round(AO(HA.g*255,0,255))*256+Math.round(AO(HA.b*255,0,255))}getHexString(e=sO){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ok.workingColorSpace){ok.workingToColorSpace(HA.copy(this),t);let n=HA.r,r=HA.g,i=HA.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){bO(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){bO(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},GA=class extends WA{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new VA(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aA,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},KA=new Z,qA=new X,JA=0,YA=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:JA++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=fO,this.updateRanges=[],this.gpuType=tD,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&bO(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Sk);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){xO(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(sj.copy(i).invert(),cj.copy(e.ray).applyMatrix4(sj),(n.boundingBox===null||cj.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,cj)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null){if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:_j.clone(),object:e}}function yj(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,dj),e.getVertexPosition(c,fj),e.getVertexPosition(l,pj);let u=vj(e,t,n,r,dj,fj,pj,gj);if(u){let e=new Z;IA.getBarycoord(gj,dj,fj,pj,e),i&&(u.uv=IA.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=IA.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=IA.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};IA.getNormal(dj,fj,pj,t.normal),u.face=t,u.barycoord=e}return u}var bj=class e extends oj{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new QA(c,3)),this.setAttribute(`normal`,new QA(l,3)),this.setAttribute(`uv`,new QA(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},ej=class extends qk{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new bk,this.projectionMatrix=new bk,this.projectionMatrixInverse=new bk,this.coordinateSystem=RD,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},tj=new Z,nj=new X,rj=new X,ij=class extends ej{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=$D*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(QD*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $D*2*Math.atan(Math.tan(QD*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){tj.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(tj.x,tj.y).multiplyScalar(-e/tj.z),tj.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(tj.x,tj.y).multiplyScalar(-e/tj.z)}getViewSize(e,t){return this.getViewBounds(e,nj,rj),t.subVectors(rj,nj)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(QD*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},aj=-90,oj=1,sj=class extends qk{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new ij(aj,oj,e,t);r.layers=this.layers,this.add(r);let i=new ij(aj,oj,e,t);i.layers=this.layers,this.add(i);let a=new ij(aj,oj,e,t);a.layers=this.layers,this.add(a);let o=new ij(aj,oj,e,t);o.layers=this.layers,this.add(o);let s=new ij(aj,oj,e,t);s.layers=this.layers,this.add(s);let c=new ij(aj,oj,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},cj=class extends VO{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},lj=class extends WO{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new cj(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` +}`,Oj=class extends WA{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Ej,this.fragmentShader=Dj,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=xj(e.uniforms),this.uniformsGroups=Cj(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},kj=class extends SA{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new Yk,this.projectionMatrix=new Yk,this.projectionMatrixInverse=new Yk,this.coordinateSystem=pO,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Aj=new Z,jj=new X,Mj=new X,Nj=class extends kj{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=OO*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(DO*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return OO*2*Math.atan(Math.tan(DO*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Aj.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Aj.x,Aj.y).multiplyScalar(-e/Aj.z),Aj.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Aj.x,Aj.y).multiplyScalar(-e/Aj.z)}getViewSize(e,t){return this.getViewBounds(e,jj,Mj),t.subVectors(Mj,jj)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(DO*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Pj=-90,Fj=1,Ij=class extends SA{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new Nj(Pj,Fj,e,t);r.layers=this.layers,this.add(r);let i=new Nj(Pj,Fj,e,t);i.layers=this.layers,this.add(i);let a=new Nj(Pj,Fj,e,t);a.layers=this.layers,this.add(a);let o=new Nj(Pj,Fj,e,t);o.layers=this.layers,this.add(o);let s=new Nj(Pj,Fj,e,t);s.layers=this.layers,this.add(s);let c=new Nj(Pj,Fj,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},Lj=class extends gk{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},Rj=class extends yk{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new Lj(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -42,7 +42,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new GA(5,5,5),i=new $A({name:`CubemapFromEquirect`,uniforms:KA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Q(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=_E),new sj(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},uj=class extends qk{constructor(){super(),this.isGroup=!0,this.type=`Group`}},dj={type:`move`},fj=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new uj,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new uj,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new uj,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(dj)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new uj;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},pj=class extends qk{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ak,this.environmentIntensity=1,this.environmentRotation=new Ak,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},mj=class extends VO{constructor(e=null,t=1,n=1,r,i,a,o,s,c=mE,l=mE,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},hj=new Z,gj=new Z,_j=new EO,vj=class{constructor(e=new Z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=hj.subVectors(n,t).cross(gj.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(hj),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||_j.getNormalMatrix(e),r=this.coplanarPoint(hj).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},yj=new dk,bj=new X(.5,.5),xj=new Z,Sj=class{constructor(e=new vj,t=new vj,n=new vj,r=new vj,i=new vj,a=new vj){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=RD,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),yj.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),yj.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(yj)}intersectsSprite(e){return yj.center.set(0,0,0),yj.radius=.7071067811865476+bj.distanceTo(e.center),yj.applyMatrix4(e.matrixWorld),this.intersectsSphere(yj)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,xj.y=r.normal.y>0?e.max.y:e.min.y,xj.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(xj)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},Cj=class extends hA{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new fA(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},wj=new Z,Tj=new Z,Ej=new bk,Dj=new yk,Oj=new dk,kj=new Z,Aj=new Z,jj=class extends qk{constructor(e=new jA,t=new Cj){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;kj.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(kj);if(!(ct.far))return{distance:c,point:Aj.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var Nj=new Z,Pj=new Z,Fj=class extends jj{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var Uj=class extends VO{constructor(e,t,n=TE,r,i,a,o=mE,s=mE,c,l=IE,u=1){if(l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new LO(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Wj=class extends Uj{constructor(e,t=TE,n=301,r,i,a=mE,o=mE,s,c=IE){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},Gj=class extends VO{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},Kj=class e extends jA{constructor(e=1,t=1,n=4,r=8,i=1){super(),this.type=`CapsuleGeometry`,this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:i},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),i=Math.max(1,Math.floor(i));let a=[],o=[],s=[],c=[],l=t/2,u=Math.PI/2*e,d=t,f=2*u+d,p=n*2+i,m=r+1,h=new Z,g=new Z;for(let _=0;_<=p;_++){let v=0,y=0,b=0,x=0;if(_<=n){let t=_/n,r=t*Math.PI/2;y=-l-e*Math.cos(r),b=e*Math.sin(r),x=-e*Math.cos(r),v=t*u}else if(_<=n+i){let r=(_-n)/i;y=-l+r*t,b=e,x=0,v=u+r*d}else{let t=(_-n-i)/n,r=t*Math.PI/2;y=l+e*Math.sin(r),b=e*Math.cos(r),x=e*Math.sin(r),v=u+d+t*u}let S=Math.max(0,Math.min(1,v/f)),C=0;_===0?C=.5/r:_===p&&(C=-.5/r);for(let e=0;e<=r;e++){let t=e/r,n=t*Math.PI*2,i=Math.sin(n),a=Math.cos(n);g.x=-b*a,g.y=y,g.z=b*i,o.push(g.x,g.y,g.z),h.set(-b*a,x,b*i),h.normalize(),s.push(h.x,h.y,h.z),c.push(t+C,S)}if(_>0){let e=(_-1)*m;for(let t=0;t0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new CA(u,3)),this.setAttribute(`normal`,new CA(d,3)),this.setAttribute(`uv`,new CA(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new Z,t=new Z,n=new Z,r=new Z,o=new X,s=new X,c=new X;for(let l=0,u=0;l0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new X:new Z);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new Z,r=[],i=[],a=[],o=new Z,s=new bk;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new Z)}i[0]=new Z,a[0]=new Z;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(tO(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(tO(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},rM=class extends nM{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new X){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},iM=class extends rM{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function aM(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var oM=new Z,sM=new aM,cM=new aM,lM=new aM,uM=class extends nM{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new Z){let n=t,r=this.points,i=r.length,a=(i-+!this.closed)*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(oM.subVectors(r[0],r[1]).add(r[0]),c=oM);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(dM(o,s.x,c.x,l.x,u.x),dM(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},jM=class extends AM{constructor(e){super(e),this.uuid=eO(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;at&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return FM(a,o,n,s,c,l,0),o}function NM(e,t,n,r,i){let a;if(i===uN(e,t,n,r)>0)for(let i=t;i=t;i-=r)a=sN(i/r|0,e[i],e[i+1],a);return a&&$M(a,a.next)&&(cN(a),a=a.next),a}function PM(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&($M(n,n.next)||QM(n.prev,n,n.next)===0)){if(cN(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function FM(e,t,n,r,i,a,o){if(!e)return;!o&&a&&GM(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?LM(e,r,i,a):IM(e)){t.push(c.i,e.i,l.i),cN(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=RM(PM(e),t),FM(e,t,n,r,i,a,2)):o===2&&zM(e,t,n,r,i,a):FM(PM(e),t,n,r,i,a,1);break}}}function IM(e){let t=e.prev,n=e,r=e.next;if(QM(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&XM(i,s,a,c,o,l,m.x,m.y)&&QM(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function LM(e,t,n,r){let i=e.prev,a=e,o=e.next;if(QM(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=qM(p,m,t,n,r),v=qM(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&XM(s,u,c,d,l,f,y.x,y.y)&&QM(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&XM(s,u,c,d,l,f,b.x,b.y)&&QM(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&XM(s,u,c,d,l,f,y.x,y.y)&&QM(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&XM(s,u,c,d,l,f,b.x,b.y)&&QM(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function RM(e,t){let n=e;do{let r=n.prev,i=n.next.next;!$M(r,i)&&eN(r,n,n.next,i)&&iN(r,i)&&iN(i,r)&&(t.push(r.i,n.i,i.i),cN(n),cN(n.next),n=e=i),n=n.next}while(n!==e);return PM(n)}function zM(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ZM(o,e)){let s=oN(o,e);o=PM(o,o.next),s=PM(s,s.next),FM(o,t,n,r,i,a,0),FM(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function BM(e,t,n,r){let i=[];for(let n=0,a=t.length;n=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=c&&r!==n.x&&YM(io.x||n.x===o.x&&WM(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function WM(e,t){return QM(e.prev,e,t.prev)<0&&QM(t.next,e,e.next)<0}function GM(e,t,n,r){let i=e;do i.z===0&&(i.z=qM(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,KM(i)}function KM(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function qM(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function JM(e){let t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function XM(e,t,n,r,i,a,o,s){return(e!==o||t!==s)&&YM(e,t,n,r,i,a,o,s)}function ZM(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!rN(e,t)&&(iN(e,t)&&iN(t,e)&&aN(e,t)&&(QM(e.prev,e,t.prev)||QM(e,t.prev,t))||$M(e,t)&&QM(e.prev,e,e.next)>0&&QM(t.prev,t,t.next)>0)}function QM(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function $M(e,t){return e.x===t.x&&e.y===t.y}function eN(e,t,n,r){let i=nN(QM(e,t,n)),a=nN(QM(e,t,r)),o=nN(QM(n,r,e)),s=nN(QM(n,r,t));return!!(i!==a&&o!==s||i===0&&tN(e,n,t)||a===0&&tN(e,r,t)||o===0&&tN(n,e,r)||s===0&&tN(n,t,r))}function tN(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function nN(e){return e>0?1:e<0?-1:0}function rN(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&eN(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function iN(e,t){return QM(e.prev,e,e.next)<0?QM(e,t,e.next)>=0&&QM(e,e.prev,t)>=0:QM(e,t,e.prev)<0||QM(e,e.next,t)<0}function aN(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function oN(e,t){let n=lN(e.i,e.x,e.y),r=lN(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function sN(e,t,n,r){let i=lN(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function cN(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function lN(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function uN(e,t,n,r){let i=0;for(let a=t,o=n-r;a2&&e[t-1].equals(e[0])&&e.pop()}function mN(e,t){for(let n=0;n2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new X(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new X(r/a,i/a)}let A=[];for(let e=0,t=D.length,n=t-1,r=e+1;e=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e0)&&f.push(t,i,c),(e!==n-1||s0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},TN=class extends hA{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=jD,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},EN=class extends hA{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};function DN(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}var ON=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e=i)){let o=t[1];e=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(KD(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(KD(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){KD(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){KD(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&BD(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){KD(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===DD,i=e.length-1,a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};MN.prototype.ValueTypeName=``,MN.prototype.TimeBufferType=Float32Array,MN.prototype.ValueBufferType=Float32Array,MN.prototype.DefaultInterpolation=ED;var NN=class extends MN{constructor(e,t,n){super(e,t,n)}};NN.prototype.ValueTypeName=`bool`,NN.prototype.ValueBufferType=Array,NN.prototype.DefaultInterpolation=TD,NN.prototype.InterpolantFactoryMethodLinear=void 0,NN.prototype.InterpolantFactoryMethodSmooth=void 0;var PN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}};PN.prototype.ValueTypeName=`color`;var FN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}};FN.prototype.ValueTypeName=`number`;var IN=class extends ON{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)CO.slerpFlat(i,0,a,c-o,a,c,s);return i}},LN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new IN(this.times,this.values,this.getValueSize(),e)}};LN.prototype.ValueTypeName=`quaternion`,LN.prototype.InterpolantFactoryMethodSmooth=void 0;var RN=class extends MN{constructor(e,t,n){super(e,t,n)}};RN.prototype.ValueTypeName=`string`,RN.prototype.ValueBufferType=Array,RN.prototype.DefaultInterpolation=TD,RN.prototype.InterpolantFactoryMethodLinear=void 0,RN.prototype.InterpolantFactoryMethodSmooth=void 0;var zN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}};zN.prototype.ValueTypeName=`vector`;var BN={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},VN=new class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t{t&&t(i),this.manager.itemEnd(e)},0),i;if(UN[e]!==void 0){UN[e].push({onLoad:t,onProgress:n,onError:r});return}UN[e]=[],UN[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&GD(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=UN[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})}}});return new Response(c)}throw new WN(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{BN.add(`file:${e}`,t);let n=UN[e];delete UN[e];for(let e=0,r=n.length;e{let n=UN[e];if(n===void 0)throw this.manager.itemError(e),t;delete UN[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},KN=class extends qk{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new fA(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},qN=new bk,JN=new Z,YN=new Z,XN=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new X(512,512),this.mapType=bE,this.map=null,this.mapPass=null,this.matrix=new bk,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Sj,this._frameExtents=new X(1,1),this._viewportCount=1,this._viewports=[new HO(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;JN.setFromMatrixPosition(e.matrixWorld),t.position.copy(JN),YN.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(YN),t.updateMatrixWorld(),qN.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(qN,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(qN)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},ZN=class extends XN{constructor(){super(new ij(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=$D*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},QN=class extends KN{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(qk.DEFAULT_UP),this.updateMatrix(),this.target=new qk,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new ZN}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},$N=class extends XN{constructor(){super(new ij(90,1,.5,500)),this.isPointLightShadow=!0}},eP=class extends KN{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new $N}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},tP=class extends ej{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},nP=class extends XN{constructor(){super(new tP(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},rP=class extends KN{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(qk.DEFAULT_UP),this.updateMatrix(),this.target=new qk,this.shadow=new nP}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},iP=class extends KN{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},aP=class extends KN{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type=`RectAreaLight`,this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},oP=class extends ij{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},sP=`\\[\\]\\.:\\/`,cP=RegExp(`[\\[\\]\\.:\\/]`,`g`),lP=`[^\\[\\]\\.:\\/]`,uP=`[^`+sP.replace(`\\.`,``)+`]`,dP=`((?:WC+[\\/:])*)`.replace(`WC`,lP),fP=`(WCOD+)?`.replace(`WCOD`,uP),pP=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,lP),mP=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,lP),hP=RegExp(`^`+dP+fP+pP+mP+`$`),gP=[`material`,`materials`,`bones`,`map`],_P=class{constructor(e,t,n){let r=n||vP.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},vP=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(cP,``)}static parseTrackName(e){let t=hP.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);gP.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{wP.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(wP,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},OP=class extends Fj{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new jA;r.setAttribute(`position`,new CA(t,3)),r.setAttribute(`color`,new CA(n,3));let i=new Cj({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new fA,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},kP=class{constructor(){this.type=`ShapePath`,this.color=new fA,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new AM,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=fN.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new jM,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t1){let e=!1,t=0;for(let e=0,t=d.length;e0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;ee.start-t.start);let t=0;for(let e=1;e.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Bj)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new zj;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Hj=class extends SA{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new aA,this.environmentIntensity=1,this.environmentRotation=new aA,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},Uj=class extends gk{constructor(e=null,t=1,n=1,r,i,a,o,s,c=UE,l=UE,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Wj=new Z,Gj=new Z,Kj=new tk,qj=class{constructor(e=new Z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Wj.subVectors(n,t).cross(Gj.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(Wj),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||Kj.getNormalMatrix(e),r=this.coplanarPoint(Wj).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},Jj=new Bk,Yj=new X(.5,.5),Xj=new Z,Zj=class{constructor(e=new qj,t=new qj,n=new qj,r=new qj,i=new qj,a=new qj){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=pO,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Jj.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Jj.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Jj)}intersectsSprite(e){return Jj.center.set(0,0,0),Jj.radius=.7071067811865476+Yj.distanceTo(e.center),Jj.applyMatrix4(e.matrixWorld),this.intersectsSphere(Jj)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,Xj.y=r.normal.y>0?e.max.y:e.min.y,Xj.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Xj)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},Qj=class extends WA{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new VA(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},$j=new Z,eM=new Z,tM=new Yk,nM=new Jk,rM=new Bk,iM=new Z,aM=new Z,oM=class extends SA{constructor(e=new oj,t=new Qj){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;iM.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(iM);if(!(ct.far))return{distance:c,point:aM.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var cM=new Z,lM=new Z,uM=class extends oM{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var vM=class extends gk{constructor(e,t,n=eD,r,i,a,o=UE,s=UE,c,l=dD,u=1){if(l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new fk(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},yM=class extends vM{constructor(e,t=eD,n=301,r,i,a=UE,o=UE,s,c=dD){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},bM=class extends gk{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},xM=class e extends oj{constructor(e=1,t=1,n=4,r=8,i=1){super(),this.type=`CapsuleGeometry`,this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:i},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),i=Math.max(1,Math.floor(i));let a=[],o=[],s=[],c=[],l=t/2,u=Math.PI/2*e,d=t,f=2*u+d,p=n*2+i,m=r+1,h=new Z,g=new Z;for(let _=0;_<=p;_++){let v=0,y=0,b=0,x=0;if(_<=n){let t=_/n,r=t*Math.PI/2;y=-l-e*Math.cos(r),b=e*Math.sin(r),x=-e*Math.cos(r),v=t*u}else if(_<=n+i){let r=(_-n)/i;y=-l+r*t,b=e,x=0,v=u+r*d}else{let t=(_-n-i)/n,r=t*Math.PI/2;y=l+e*Math.sin(r),b=e*Math.cos(r),x=e*Math.sin(r),v=u+d+t*u}let S=Math.max(0,Math.min(1,v/f)),C=0;_===0?C=.5/r:_===p&&(C=-.5/r);for(let e=0;e<=r;e++){let t=e/r,n=t*Math.PI*2,i=Math.sin(n),a=Math.cos(n);g.x=-b*a,g.y=y,g.z=b*i,o.push(g.x,g.y,g.z),h.set(-b*a,x,b*i),h.normalize(),s.push(h.x,h.y,h.z),c.push(t+C,S)}if(_>0){let e=(_-1)*m;for(let t=0;t0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new QA(u,3)),this.setAttribute(`normal`,new QA(d,3)),this.setAttribute(`uv`,new QA(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new Z,t=new Z,n=new Z,r=new Z,o=new X,s=new X,c=new X;for(let l=0,u=0;l0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new X:new Z);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new Z,r=[],i=[],a=[],o=new Z,s=new Yk;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new Z)}i[0]=new Z,a[0]=new Z;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(AO(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(AO(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},MM=class extends jM{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new X){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},NM=class extends MM{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function PM(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var FM=new Z,IM=new PM,LM=new PM,RM=new PM,zM=class extends jM{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new Z){let n=t,r=this.points,i=r.length,a=(i-+!this.closed)*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(FM.subVectors(r[0],r[1]).add(r[0]),c=FM);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(BM(o,s.x,c.x,l.x,u.x),BM(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},oN=class extends aN{constructor(e){super(e),this.uuid=kO(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;at&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return uN(a,o,n,s,c,l,0),o}function cN(e,t,n,r,i){let a;if(i===zN(e,t,n,r)>0)for(let i=t;i=t;i-=r)a=IN(i/r|0,e[i],e[i+1],a);return a&&ON(a,a.next)&&(LN(a),a=a.next),a}function lN(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&(ON(n,n.next)||DN(n.prev,n,n.next)===0)){if(LN(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function uN(e,t,n,r,i,a,o){if(!e)return;!o&&a&&bN(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?fN(e,r,i,a):dN(e)){t.push(c.i,e.i,l.i),LN(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=pN(lN(e),t),uN(e,t,n,r,i,a,2)):o===2&&mN(e,t,n,r,i,a):uN(lN(e),t,n,r,i,a,1);break}}}function dN(e){let t=e.prev,n=e,r=e.next;if(DN(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&TN(i,s,a,c,o,l,m.x,m.y)&&DN(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function fN(e,t,n,r){let i=e.prev,a=e,o=e.next;if(DN(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=SN(p,m,t,n,r),v=SN(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&TN(s,u,c,d,l,f,y.x,y.y)&&DN(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&TN(s,u,c,d,l,f,b.x,b.y)&&DN(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&TN(s,u,c,d,l,f,y.x,y.y)&&DN(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&TN(s,u,c,d,l,f,b.x,b.y)&&DN(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function pN(e,t){let n=e;do{let r=n.prev,i=n.next.next;!ON(r,i)&&kN(r,n,n.next,i)&&NN(r,i)&&NN(i,r)&&(t.push(r.i,n.i,i.i),LN(n),LN(n.next),n=e=i),n=n.next}while(n!==e);return lN(n)}function mN(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&EN(o,e)){let s=FN(o,e);o=lN(o,o.next),s=lN(s,s.next),uN(o,t,n,r,i,a,0),uN(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function hN(e,t,n,r){let i=[];for(let n=0,a=t.length;n=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=c&&r!==n.x&&wN(io.x||n.x===o.x&&yN(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function yN(e,t){return DN(e.prev,e,t.prev)<0&&DN(t.next,e,e.next)<0}function bN(e,t,n,r){let i=e;do i.z===0&&(i.z=SN(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,xN(i)}function xN(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function SN(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function CN(e){let t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function TN(e,t,n,r,i,a,o,s){return(e!==o||t!==s)&&wN(e,t,n,r,i,a,o,s)}function EN(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!MN(e,t)&&(NN(e,t)&&NN(t,e)&&PN(e,t)&&(DN(e.prev,e,t.prev)||DN(e,t.prev,t))||ON(e,t)&&DN(e.prev,e,e.next)>0&&DN(t.prev,t,t.next)>0)}function DN(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ON(e,t){return e.x===t.x&&e.y===t.y}function kN(e,t,n,r){let i=jN(DN(e,t,n)),a=jN(DN(e,t,r)),o=jN(DN(n,r,e)),s=jN(DN(n,r,t));return!!(i!==a&&o!==s||i===0&&AN(e,n,t)||a===0&&AN(e,r,t)||o===0&&AN(n,e,r)||s===0&&AN(n,t,r))}function AN(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function jN(e){return e>0?1:e<0?-1:0}function MN(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&kN(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function NN(e,t){return DN(e.prev,e,e.next)<0?DN(e,t,e.next)>=0&&DN(e,e.prev,t)>=0:DN(e,t,e.prev)<0||DN(e,e.next,t)<0}function PN(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function FN(e,t){let n=RN(e.i,e.x,e.y),r=RN(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function IN(e,t,n,r){let i=RN(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function LN(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function RN(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zN(e,t,n,r){let i=0;for(let a=t,o=n-r;a2&&e[t-1].equals(e[0])&&e.pop()}function UN(e,t){for(let n=0;n2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new X(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new X(r/a,i/a)}let A=[];for(let e=0,t=D.length,n=t-1,r=e+1;e=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e0)&&f.push(t,i,c),(e!==n-1||s0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},eP=class extends WA{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=oO,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},tP=class extends WA{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};function nP(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}var rP=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e=i)){let o=t[1];e=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(xO(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(xO(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){xO(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){xO(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&hO(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){xO(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===nO,i=e.length-1,a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};sP.prototype.ValueTypeName=``,sP.prototype.TimeBufferType=Float32Array,sP.prototype.ValueBufferType=Float32Array,sP.prototype.DefaultInterpolation=tO;var cP=class extends sP{constructor(e,t,n){super(e,t,n)}};cP.prototype.ValueTypeName=`bool`,cP.prototype.ValueBufferType=Array,cP.prototype.DefaultInterpolation=eO,cP.prototype.InterpolantFactoryMethodLinear=void 0,cP.prototype.InterpolantFactoryMethodSmooth=void 0;var lP=class extends sP{constructor(e,t,n,r){super(e,t,n,r)}};lP.prototype.ValueTypeName=`color`;var uP=class extends sP{constructor(e,t,n,r){super(e,t,n,r)}};uP.prototype.ValueTypeName=`number`;var dP=class extends rP{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)QO.slerpFlat(i,0,a,c-o,a,c,s);return i}},fP=class extends sP{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new dP(this.times,this.values,this.getValueSize(),e)}};fP.prototype.ValueTypeName=`quaternion`,fP.prototype.InterpolantFactoryMethodSmooth=void 0;var pP=class extends sP{constructor(e,t,n){super(e,t,n)}};pP.prototype.ValueTypeName=`string`,pP.prototype.ValueBufferType=Array,pP.prototype.DefaultInterpolation=eO,pP.prototype.InterpolantFactoryMethodLinear=void 0,pP.prototype.InterpolantFactoryMethodSmooth=void 0;var mP=class extends sP{constructor(e,t,n,r){super(e,t,n,r)}};mP.prototype.ValueTypeName=`vector`;var hP={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},gP=new class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t{t&&t(i),this.manager.itemEnd(e)},0),i;if(vP[e]!==void 0){vP[e].push({onLoad:t,onProgress:n,onError:r});return}vP[e]=[],vP[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&bO(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=vP[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})}}});return new Response(c)}throw new yP(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{hP.add(`file:${e}`,t);let n=vP[e];delete vP[e];for(let e=0,r=n.length;e{let n=vP[e];if(n===void 0)throw this.manager.itemError(e),t;delete vP[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},xP=class extends SA{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new VA(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},SP=new Yk,CP=new Z,wP=new Z,TP=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new X(512,512),this.mapType=YE,this.map=null,this.mapPass=null,this.matrix=new Yk,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Zj,this._frameExtents=new X(1,1),this._viewportCount=1,this._viewports=[new _k(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;CP.setFromMatrixPosition(e.matrixWorld),t.position.copy(CP),wP.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(wP),t.updateMatrixWorld(),SP.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(SP,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(SP)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},EP=class extends TP{constructor(){super(new Nj(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=OO*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},DP=class extends xP{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(SA.DEFAULT_UP),this.updateMatrix(),this.target=new SA,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new EP}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},OP=class extends TP{constructor(){super(new Nj(90,1,.5,500)),this.isPointLightShadow=!0}},kP=class extends xP{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new OP}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},AP=class extends kj{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},jP=class extends TP{constructor(){super(new AP(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},MP=class extends xP{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(SA.DEFAULT_UP),this.updateMatrix(),this.target=new SA,this.shadow=new jP}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},NP=class extends xP{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},PP=class extends xP{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type=`RectAreaLight`,this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},FP=class extends Nj{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},IP=`\\[\\]\\.:\\/`,LP=RegExp(`[\\[\\]\\.:\\/]`,`g`),RP=`[^\\[\\]\\.:\\/]`,zP=`[^`+IP.replace(`\\.`,``)+`]`,BP=`((?:WC+[\\/:])*)`.replace(`WC`,RP),VP=`(WCOD+)?`.replace(`WCOD`,zP),HP=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,RP),UP=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,RP),WP=RegExp(`^`+BP+VP+HP+UP+`$`),GP=[`material`,`materials`,`bones`,`map`],KP=class{constructor(e,t,n){let r=n||qP.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},qP=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(LP,``)}static parseTrackName(e){let t=WP.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);GP.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{$P.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle($P,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},rF=class extends uM{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new oj;r.setAttribute(`position`,new QA(t,3)),r.setAttribute(`color`,new QA(n,3));let i=new Qj({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new VA,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},iF=class{constructor(){this.type=`ShapePath`,this.color=new VA,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new aN,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=VN.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new oN,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t1){let e=!1,t=0;for(let e=0,t=d.length;e0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;ee.start-t.start);let t=0;for(let e=1;e #include #include -}`},$={common:{diffuse:{value:new fA(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new EO},alphaMap:{value:null},alphaMapTransform:{value:new EO},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new EO}},envmap:{envMap:{value:null},envMapRotation:{value:new EO},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new EO}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new EO}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new EO},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new EO},normalScale:{value:new X(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new EO},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new EO}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new EO}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new EO}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fA(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fA(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new EO},alphaTest:{value:0},uvTransform:{value:new EO}},sprite:{diffuse:{value:new fA(16777215)},opacity:{value:1},center:{value:new X(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new EO},alphaMap:{value:null},alphaMapTransform:{value:new EO},alphaTest:{value:0}}},IP={basic:{uniforms:qA([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.fog]),vertexShader:FP.meshbasic_vert,fragmentShader:FP.meshbasic_frag},lambert:{uniforms:qA([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new fA(0)}}]),vertexShader:FP.meshlambert_vert,fragmentShader:FP.meshlambert_frag},phong:{uniforms:qA([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new fA(0)},specular:{value:new fA(1118481)},shininess:{value:30}}]),vertexShader:FP.meshphong_vert,fragmentShader:FP.meshphong_frag},standard:{uniforms:qA([$.common,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.roughnessmap,$.metalnessmap,$.fog,$.lights,{emissive:{value:new fA(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:FP.meshphysical_vert,fragmentShader:FP.meshphysical_frag},toon:{uniforms:qA([$.common,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.gradientmap,$.fog,$.lights,{emissive:{value:new fA(0)}}]),vertexShader:FP.meshtoon_vert,fragmentShader:FP.meshtoon_frag},matcap:{uniforms:qA([$.common,$.bumpmap,$.normalmap,$.displacementmap,$.fog,{matcap:{value:null}}]),vertexShader:FP.meshmatcap_vert,fragmentShader:FP.meshmatcap_frag},points:{uniforms:qA([$.points,$.fog]),vertexShader:FP.points_vert,fragmentShader:FP.points_frag},dashed:{uniforms:qA([$.common,$.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:FP.linedashed_vert,fragmentShader:FP.linedashed_frag},depth:{uniforms:qA([$.common,$.displacementmap]),vertexShader:FP.depth_vert,fragmentShader:FP.depth_frag},normal:{uniforms:qA([$.common,$.bumpmap,$.normalmap,$.displacementmap,{opacity:{value:1}}]),vertexShader:FP.meshnormal_vert,fragmentShader:FP.meshnormal_frag},sprite:{uniforms:qA([$.sprite,$.fog]),vertexShader:FP.sprite_vert,fragmentShader:FP.sprite_frag},background:{uniforms:{uvTransform:{value:new EO},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:FP.background_vert,fragmentShader:FP.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new EO}},vertexShader:FP.backgroundCube_vert,fragmentShader:FP.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:FP.cube_vert,fragmentShader:FP.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:FP.equirect_vert,fragmentShader:FP.equirect_frag},distance:{uniforms:qA([$.common,$.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:FP.distance_vert,fragmentShader:FP.distance_frag},shadow:{uniforms:qA([$.lights,$.fog,{color:{value:new fA(0)},opacity:{value:1}}]),vertexShader:FP.shadow_vert,fragmentShader:FP.shadow_frag}};IP.physical={uniforms:qA([IP.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new EO},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new EO},clearcoatNormalScale:{value:new X(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new EO},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new EO},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new EO},sheen:{value:0},sheenColor:{value:new fA(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new EO},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new EO},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new EO},transmissionSamplerSize:{value:new X},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new EO},attenuationDistance:{value:0},attenuationColor:{value:new fA(0)},specularColor:{value:new fA(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new EO},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new EO},anisotropyVector:{value:new X},anisotropyMap:{value:null},anisotropyMapTransform:{value:new EO}}]),vertexShader:FP.meshphysical_vert,fragmentShader:FP.meshphysical_frag};var LP={r:0,b:0,g:0},RP=new Ak,zP=new bk;function BP(e,t,n,r,i,a,o){let s=new fA(0),c=a===!0?0:1,l,u,d=null,f=0,p=null;function m(e){let r=e.isScene===!0?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function h(t){let n=!1,i=m(t);i===null?_(s,c):i&&i.isColor&&(_(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();a===`additive`?r.buffers.color.setClear(0,0,0,1,o):a===`alpha-blend`&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function g(t,n){let r=m(n);r&&(r.isCubeTexture||r.mapping===306)?(u===void 0&&(u=new Q(new GA(1,1,1),new $A({name:`BackgroundCubeMaterial`,uniforms:KA(IP.backgroundCube.uniforms),vertexShader:IP.backgroundCube.vertexShader,fragmentShader:IP.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute(`normal`),u.geometry.deleteAttribute(`uv`),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),RP.copy(n.backgroundRotation),RP.x*=-1,RP.y*=-1,RP.z*=-1,r.isCubeTexture&&r.isRenderTargetTexture===!1&&(RP.y*=-1,RP.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&r.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(zP.makeRotationFromEuler(RP)),u.material.toneMapped=jO.getTransfer(r.colorSpace)!==FD,(d!==r||f!==r.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(l===void 0&&(l=new Q(new yN(2,2),new $A({name:`BackgroundMaterial`,uniforms:KA(IP.background.uniforms),vertexShader:IP.background.vertexShader,fragmentShader:IP.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=jO.getTransfer(r.colorSpace)!==FD,r.matrixAutoUpdate===!0&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),(d!==r||f!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}function _(t,n){t.getRGB(LP,YA(e)),r.buffers.color.setClear(LP.r,LP.g,LP.b,n,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),c=t,_(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,_(s,c)},render:h,addToRenderList:g,dispose:v}}function VP(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n){let i=n.wireframe===!0,a=r[e.id];a===void 0&&(a={},r[e.id]=a);let o=a[t.id];o===void 0&&(o={},a[t.id]=o);let s=o[i];return s===void 0&&(s=f(c()),o[i]=s),s}function f(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(GD(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function WP(e){let t=this,n=null,r=0,i=!1,a=!1,o=new vj,s=new EO,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0){let o=new lj(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener(`dispose`,i),n(o.texture,r.mapping)}return null}}}return r}function i(e){let n=e.target;n.removeEventListener(`dispose`,i);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function a(){t=new WeakMap}return{get:r,dispose:a}}var KP=4,qP=[.125,.215,.35,.446,.526,.582],JP=20,YP=256,XP=new tP,ZP=new fA,QP=null,$P=0,eF=0,tF=!1,nF=new Z,rF=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=nF}=i;QP=this._renderer.getRenderTarget(),$P=this._renderer.getActiveCubeFace(),eF=this._renderer.getActiveMipmapLevel(),tF=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=uF(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=lF(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=uF()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=lF());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;oF(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,XP)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;td-KP?n-d+KP:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,oF(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,XP),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,oF(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,XP)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&KD(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):JP;m>JP&&GD(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${JP}`);let h=[],g=0;for(let e=0;e_-KP?r-_+KP:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,XP)}};function iF(e){let t=[],n=[],r=[],i=e,a=e-KP+1+qP.length;for(let o=0;oe-KP?s=qP[o-e+KP-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new jA;h.setAttribute(`position`,new bA(f,3)),h.setAttribute(`uv`,new bA(p,2)),h.setAttribute(`faceIndex`,new bA(m,1)),r.push(new Q(h,null)),i>KP&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function aF(e,t,n){let r=new WO(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function oF(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function sF(e,t,n){return new $A({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:YP,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:dF(),fragmentShader:` +}`},$={common:{diffuse:{value:new VA(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new tk},alphaMap:{value:null},alphaMapTransform:{value:new tk},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new tk}},envmap:{envMap:{value:null},envMapRotation:{value:new tk},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new tk}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new tk}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new tk},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new tk},normalScale:{value:new X(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new tk},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new tk}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new tk}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new tk}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new VA(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new VA(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new tk},alphaTest:{value:0},uvTransform:{value:new tk}},sprite:{diffuse:{value:new VA(16777215)},opacity:{value:1},center:{value:new X(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new tk},alphaMap:{value:null},alphaMapTransform:{value:new tk},alphaTest:{value:0}}},dF={basic:{uniforms:Sj([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.fog]),vertexShader:uF.meshbasic_vert,fragmentShader:uF.meshbasic_frag},lambert:{uniforms:Sj([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new VA(0)}}]),vertexShader:uF.meshlambert_vert,fragmentShader:uF.meshlambert_frag},phong:{uniforms:Sj([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new VA(0)},specular:{value:new VA(1118481)},shininess:{value:30}}]),vertexShader:uF.meshphong_vert,fragmentShader:uF.meshphong_frag},standard:{uniforms:Sj([$.common,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.roughnessmap,$.metalnessmap,$.fog,$.lights,{emissive:{value:new VA(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:uF.meshphysical_vert,fragmentShader:uF.meshphysical_frag},toon:{uniforms:Sj([$.common,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.gradientmap,$.fog,$.lights,{emissive:{value:new VA(0)}}]),vertexShader:uF.meshtoon_vert,fragmentShader:uF.meshtoon_frag},matcap:{uniforms:Sj([$.common,$.bumpmap,$.normalmap,$.displacementmap,$.fog,{matcap:{value:null}}]),vertexShader:uF.meshmatcap_vert,fragmentShader:uF.meshmatcap_frag},points:{uniforms:Sj([$.points,$.fog]),vertexShader:uF.points_vert,fragmentShader:uF.points_frag},dashed:{uniforms:Sj([$.common,$.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:uF.linedashed_vert,fragmentShader:uF.linedashed_frag},depth:{uniforms:Sj([$.common,$.displacementmap]),vertexShader:uF.depth_vert,fragmentShader:uF.depth_frag},normal:{uniforms:Sj([$.common,$.bumpmap,$.normalmap,$.displacementmap,{opacity:{value:1}}]),vertexShader:uF.meshnormal_vert,fragmentShader:uF.meshnormal_frag},sprite:{uniforms:Sj([$.sprite,$.fog]),vertexShader:uF.sprite_vert,fragmentShader:uF.sprite_frag},background:{uniforms:{uvTransform:{value:new tk},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:uF.background_vert,fragmentShader:uF.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new tk}},vertexShader:uF.backgroundCube_vert,fragmentShader:uF.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:uF.cube_vert,fragmentShader:uF.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:uF.equirect_vert,fragmentShader:uF.equirect_frag},distance:{uniforms:Sj([$.common,$.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:uF.distance_vert,fragmentShader:uF.distance_frag},shadow:{uniforms:Sj([$.lights,$.fog,{color:{value:new VA(0)},opacity:{value:1}}]),vertexShader:uF.shadow_vert,fragmentShader:uF.shadow_frag}};dF.physical={uniforms:Sj([dF.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new tk},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new tk},clearcoatNormalScale:{value:new X(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new tk},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new tk},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new tk},sheen:{value:0},sheenColor:{value:new VA(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new tk},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new tk},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new tk},transmissionSamplerSize:{value:new X},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new tk},attenuationDistance:{value:0},attenuationColor:{value:new VA(0)},specularColor:{value:new VA(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new tk},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new tk},anisotropyVector:{value:new X},anisotropyMap:{value:null},anisotropyMapTransform:{value:new tk}}]),vertexShader:uF.meshphysical_vert,fragmentShader:uF.meshphysical_frag};var fF={r:0,b:0,g:0},pF=new aA,mF=new Yk;function hF(e,t,n,r,i,a,o){let s=new VA(0),c=a===!0?0:1,l,u,d=null,f=0,p=null;function m(e){let r=e.isScene===!0?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function h(t){let n=!1,i=m(t);i===null?_(s,c):i&&i.isColor&&(_(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();a===`additive`?r.buffers.color.setClear(0,0,0,1,o):a===`alpha-blend`&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function g(t,n){let r=m(n);r&&(r.isCubeTexture||r.mapping===306)?(u===void 0&&(u=new Q(new bj(1,1,1),new Oj({name:`BackgroundCubeMaterial`,uniforms:xj(dF.backgroundCube.uniforms),vertexShader:dF.backgroundCube.vertexShader,fragmentShader:dF.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute(`normal`),u.geometry.deleteAttribute(`uv`),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),pF.copy(n.backgroundRotation),pF.x*=-1,pF.y*=-1,pF.z*=-1,r.isCubeTexture&&r.isRenderTargetTexture===!1&&(pF.y*=-1,pF.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&r.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(mF.makeRotationFromEuler(pF)),u.material.toneMapped=ok.getTransfer(r.colorSpace)!==uO,(d!==r||f!==r.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(l===void 0&&(l=new Q(new JN(2,2),new Oj({name:`BackgroundMaterial`,uniforms:xj(dF.background.uniforms),vertexShader:dF.background.vertexShader,fragmentShader:dF.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=ok.getTransfer(r.colorSpace)!==uO,r.matrixAutoUpdate===!0&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),(d!==r||f!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}function _(t,n){t.getRGB(fF,wj(e)),r.buffers.color.setClear(fF.r,fF.g,fF.b,n,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),c=t,_(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,_(s,c)},render:h,addToRenderList:g,dispose:v}}function gF(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n){let i=n.wireframe===!0,a=r[e.id];a===void 0&&(a={},r[e.id]=a);let o=a[t.id];o===void 0&&(o={},a[t.id]=o);let s=o[i];return s===void 0&&(s=f(c()),o[i]=s),s}function f(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(bO(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function yF(e){let t=this,n=null,r=0,i=!1,a=!1,o=new qj,s=new tk,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0){let o=new Rj(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener(`dispose`,i),n(o.texture,r.mapping)}return null}}}return r}function i(e){let n=e.target;n.removeEventListener(`dispose`,i);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function a(){t=new WeakMap}return{get:r,dispose:a}}var xF=4,SF=[.125,.215,.35,.446,.526,.582],CF=20,wF=256,TF=new AP,EF=new VA,DF=null,OF=0,kF=0,AF=!1,jF=new Z,MF=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=jF}=i;DF=this._renderer.getRenderTarget(),OF=this._renderer.getActiveCubeFace(),kF=this._renderer.getActiveMipmapLevel(),AF=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=zF(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=RF(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=zF()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=RF());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;FF(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,TF)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;td-xF?n-d+xF:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,FF(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,TF),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,FF(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,TF)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&xO(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):CF;m>CF&&bO(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${CF}`);let h=[],g=0;for(let e=0;e_-xF?r-_+xF:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,TF)}};function NF(e){let t=[],n=[],r=[],i=e,a=e-xF+1+SF.length;for(let o=0;oe-xF?s=SF[o-e+xF-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new oj;h.setAttribute(`position`,new YA(f,3)),h.setAttribute(`uv`,new YA(p,2)),h.setAttribute(`faceIndex`,new YA(m,1)),r.push(new Q(h,null)),i>xF&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function PF(e,t,n){let r=new yk(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function FF(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function IF(e,t,n){return new Oj({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:wF,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:BF(),fragmentShader:` precision highp float; precision highp int; @@ -3715,7 +3715,7 @@ void main() { gl_FragColor = vec4(prefilteredColor, 1.0); } - `,blending:0,depthTest:!1,depthWrite:!1})}function cF(e,t,n){let r=new Float32Array(JP),i=new Z(0,1,0);return new $A({name:`SphericalGaussianBlur`,defines:{n:JP,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:dF(),fragmentShader:` + `,blending:0,depthTest:!1,depthWrite:!1})}function LF(e,t,n){let r=new Float32Array(CF),i=new Z(0,1,0);return new Oj({name:`SphericalGaussianBlur`,defines:{n:CF,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:BF(),fragmentShader:` precision mediump float; precision mediump int; @@ -3775,7 +3775,7 @@ void main() { } } - `,blending:0,depthTest:!1,depthWrite:!1})}function lF(){return new $A({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:dF(),fragmentShader:` + `,blending:0,depthTest:!1,depthWrite:!1})}function RF(){return new Oj({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:BF(),fragmentShader:` precision mediump float; precision mediump int; @@ -3794,7 +3794,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:0,depthTest:!1,depthWrite:!1})}function uF(){return new $A({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:dF(),fragmentShader:` + `,blending:0,depthTest:!1,depthWrite:!1})}function zF(){return new Oj({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:BF(),fragmentShader:` precision mediump float; precision mediump int; @@ -3810,7 +3810,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:0,depthTest:!1,depthWrite:!1})}function dF(){return` + `,blending:0,depthTest:!1,depthWrite:!1})}function BF(){return` precision mediump float; precision mediump int; @@ -3865,7 +3865,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function fF(e){let t=new WeakMap,n=null;function r(r){if(r&&r.isTexture){let o=r.mapping,s=o===303||o===304,c=o===301||o===302;if(s||c){let o=t.get(r),l=o===void 0?0:o.texture.pmremVersion;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return n===null&&(n=new rF(e)),o=s?n.fromEquirectangular(r,o):n.fromCubemap(r,o),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),o.texture;if(o!==void 0)return o.texture;{let l=r.image;return s&&l&&l.height>0||c&&l&&i(l)?(n===null&&(n=new rF(e)),o=s?n.fromEquirectangular(r):n.fromCubemap(r),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),r.addEventListener(`dispose`,a),o.texture):null}}}return r}function i(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function a(e){let n=e.target;n.removeEventListener(`dispose`,a);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function o(){t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:o}}function pF(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&qD(`WebGLRenderer: `+e+` extension not supported.`),t}}}function mF(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;tt.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new GO(h,p,m,u);g.type=EE,g.needsUpdate=!0;let _=f*4;for(let t=0;t0||c&&l&&i(l)?(n===null&&(n=new MF(e)),o=s?n.fromEquirectangular(r):n.fromCubemap(r),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),r.addEventListener(`dispose`,a),o.texture):null}}}return r}function i(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function a(e){let n=e.target;n.removeEventListener(`dispose`,a);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function o(){t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:o}}function HF(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&SO(`WebGLRenderer: `+e+` extension not supported.`),t}}}function UF(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;tt.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new bk(h,p,m,u);g.type=tD,g.needsUpdate=!0;let _=f*4;for(let t=0;t0&&g[0].isRenderPass===!0;let t=a.width,n=a.height;for(let e=0;e0)return e;let i=t*n,a=EF[i];if(a===void 0&&(a=new Float32Array(i),EF[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function MF(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function OI(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var kI=37297,AI=0;function jI(e,t){let n=e.split(` + }`,depthTest:!1,depthWrite:!1}),l=new Q(s,c),u=new AP(-1,1,1,-1,0,1),d=null,f=null,p=!1,m,h=null,g=[],_=!1;this.setSize=function(e,t){a.setSize(e,t),o.setSize(e,t);for(let n=0;n0&&g[0].isRenderPass===!0;let t=a.width,n=a.height;for(let e=0;e0)return e;let i=t*n,a=tI[i];if(a===void 0&&(a=new Float32Array(i),tI[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function sI(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function rL(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var iL=37297,aL=0;function oL(e,t){let n=e.split(` `),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e`:` `} ${i}: ${n[e]}`)}return r.join(` -`)}var MI=new EO;function NI(e){jO._getMatrix(MI,jO.workingColorSpace,e);let t=`mat3( ${MI.elements.map(e=>e.toFixed(4))} )`;switch(jO.getTransfer(e)){case PD:return[t,`LinearTransferOETF`];case FD:return[t,`sRGBTransferOETF`];default:return GD(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function PI(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` +`)}var sL=new tk;function cL(e){ok._getMatrix(sL,ok.workingColorSpace,e);let t=`mat3( ${sL.elements.map(e=>e.toFixed(4))} )`;switch(ok.getTransfer(e)){case lO:return[t,`LinearTransferOETF`];case uO:return[t,`sRGBTransferOETF`];default:return bO(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function lL(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` `+i+` -`+jI(e.getShaderSource(t),r)}return i}function FI(e,t){let n=NI(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` -`)}var II={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function LI(e,t){let n=II[t];return n===void 0?(GD(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var RI=new Z;function zI(){return jO.getLuminanceCoefficients(RI),[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${RI.x.toFixed(4)}, ${RI.y.toFixed(4)}, ${RI.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(` -`)}function BI(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(UI).join(` -`)}function VI(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(` -`)}function HI(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function qI(e){return e.replace(KI,YI)}var JI=new Map;function YI(e,t){let n=FP[t];if(n===void 0){let e=JI.get(t);if(e!==void 0)n=FP[e],GD(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return qI(n)}var XI=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ZI(e){return e.replace(XI,QI)}function QI(e,t,n,r){let i=``;for(let e=parseInt(t);e/gm;function SL(e){return e.replace(xL,wL)}var CL=new Map;function wL(e,t){let n=uF[t];if(n===void 0){let e=CL.get(t);if(e!==void 0)n=uF[e],bO(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return SL(n)}var TL=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function EL(e){return e.replace(TL,DL)}function DL(e,t,n,r){let i=``;for(let e=parseInt(t);e0&&(g+=` -`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(UI).join(` +`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(vL).join(` `),_.length>0&&(_+=` -`)):(g=[$I(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` -`].filter(UI).join(` -`),_=[$I(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor||n.batchingColor?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:FP.tonemapping_pars_fragment,n.toneMapping===0?``:LI(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,FP.colorspace_pars_fragment,FI(`linearToOutputTexel`,n.outputColorSpace),zI(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` -`].filter(UI).join(` -`)),o=qI(o),o=WI(o,n),o=GI(o,n),s=qI(s),s=WI(s,n),s=GI(s,n),o=ZI(o),s=ZI(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es +`)):(g=[OL(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` +`].filter(vL).join(` +`),_=[OL(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor||n.batchingColor?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:uF.tonemapping_pars_fragment,n.toneMapping===0?``:fL(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,uF.colorspace_pars_fragment,uL(`linearToOutputTexel`,n.outputColorSpace),mL(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` +`].filter(vL).join(` +`)),o=SL(o),o=yL(o,n),o=bL(o,n),s=SL(s),s=yL(s,n),s=bL(s,n),o=EL(o),s=EL(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es `,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` `)+` `+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` `)+` -`+_);let y=v+g+o,b=v+_+s,x=OI(i,i.VERTEX_SHADER,y),S=OI(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1){if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=PI(i,x,`vertex`),n=PI(i,S,`fragment`);KD(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` +`+_);let y=v+g+o,b=v+_+s,x=rL(i,i.VERTEX_SHADER,y),S=rL(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1){if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=lL(i,x,`vertex`),n=lL(i,S,`fragment`);xO(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` Material Name: `+t.name+` Material Type: `+t.type+` Program Info Log: `+o+` `+e+` -`+n)}}else o===``?(s===``||c===``)&&(u=!1):GD(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new DI(i,h),T=HI(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,kI)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=AI++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var uL=0,dL=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new fL(e),t.set(e,n)),n}},fL=class{constructor(e){this.id=uL++,this.code=e,this.usedTimes=0}};function pL(e,t,n,r,i,a,o){let s=new jk,c=new dL,l=new Set,u=[],d=new Map,f=i.logarithmicDepthBuffer,p=i.precision,m={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function h(e){return l.add(e),e===0?`uv`:`uv${e}`}function g(a,s,u,d,g){let _=d.fog,v=g.geometry,y=a.isMeshStandardMaterial?d.environment:null,b=(a.isMeshStandardMaterial?n:t).get(a.envMap||y),x=b&&b.mapping===306?b.image.height:null,S=m[a.type];a.precision!==null&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&GD(`WebGLProgram.getParameters:`,a.precision,`not supported, using`,p,`instead.`));let C=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,w=C===void 0?0:C.length,T=0;v.morphAttributes.position!==void 0&&(T=1),v.morphAttributes.normal!==void 0&&(T=2),v.morphAttributes.color!==void 0&&(T=3);let E,D,O,ee;if(S){let e=IP[S];E=e.vertexShader,D=e.fragmentShader}else E=a.vertexShader,D=a.fragmentShader,c.update(a),O=c.getVertexShaderID(a),ee=c.getFragmentShaderID(a);let k=e.getRenderTarget(),A=e.state.buffers.depth.getReversed(),te=g.isInstancedMesh===!0,j=g.isBatchedMesh===!0,ne=!!a.map,M=!!a.matcap,N=!!b,re=!!a.aoMap,ie=!!a.lightMap,ae=!!a.bumpMap,oe=!!a.normalMap,se=!!a.displacementMap,ce=!!a.emissiveMap,le=!!a.metalnessMap,ue=!!a.roughnessMap,de=a.anisotropy>0,fe=a.clearcoat>0,pe=a.dispersion>0,me=a.iridescence>0,he=a.sheen>0,ge=a.transmission>0,_e=de&&!!a.anisotropyMap,ve=fe&&!!a.clearcoatMap,P=fe&&!!a.clearcoatNormalMap,ye=fe&&!!a.clearcoatRoughnessMap,be=me&&!!a.iridescenceMap,xe=me&&!!a.iridescenceThicknessMap,Se=he&&!!a.sheenColorMap,Ce=he&&!!a.sheenRoughnessMap,we=!!a.specularMap,Te=!!a.specularColorMap,Ee=!!a.specularIntensityMap,De=ge&&!!a.transmissionMap,Oe=ge&&!!a.thicknessMap,ke=!!a.gradientMap,Ae=!!a.alphaMap,je=a.alphaTest>0,Me=!!a.alphaHash,Ne=!!a.extensions,Pe=0;a.toneMapped&&(k===null||k.isXRRenderTarget===!0)&&(Pe=e.toneMapping);let Fe={shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:E,fragmentShader:D,defines:a.defines,customVertexShaderID:O,customFragmentShaderID:ee,isRawShaderMaterial:a.isRawShaderMaterial===!0,glslVersion:a.glslVersion,precision:p,batching:j,batchingColor:j&&g._colorsTexture!==null,instancing:te,instancingColor:te&&g.instanceColor!==null,instancingMorph:te&&g.morphTexture!==null,outputColorSpace:k===null?e.outputColorSpace:k.isXRRenderTarget===!0?k.texture.colorSpace:ND,alphaToCoverage:!!a.alphaToCoverage,map:ne,matcap:M,envMap:N,envMapMode:N&&b.mapping,envMapCubeUVHeight:x,aoMap:re,lightMap:ie,bumpMap:ae,normalMap:oe,displacementMap:se,emissiveMap:ce,normalMapObjectSpace:oe&&a.normalMapType===1,normalMapTangentSpace:oe&&a.normalMapType===0,metalnessMap:le,roughnessMap:ue,anisotropy:de,anisotropyMap:_e,clearcoat:fe,clearcoatMap:ve,clearcoatNormalMap:P,clearcoatRoughnessMap:ye,dispersion:pe,iridescence:me,iridescenceMap:be,iridescenceThicknessMap:xe,sheen:he,sheenColorMap:Se,sheenRoughnessMap:Ce,specularMap:we,specularColorMap:Te,specularIntensityMap:Ee,transmission:ge,transmissionMap:De,thicknessMap:Oe,gradientMap:ke,opaque:a.transparent===!1&&a.blending===1&&a.alphaToCoverage===!1,alphaMap:Ae,alphaTest:je,alphaHash:Me,combine:a.combine,mapUv:ne&&h(a.map.channel),aoMapUv:re&&h(a.aoMap.channel),lightMapUv:ie&&h(a.lightMap.channel),bumpMapUv:ae&&h(a.bumpMap.channel),normalMapUv:oe&&h(a.normalMap.channel),displacementMapUv:se&&h(a.displacementMap.channel),emissiveMapUv:ce&&h(a.emissiveMap.channel),metalnessMapUv:le&&h(a.metalnessMap.channel),roughnessMapUv:ue&&h(a.roughnessMap.channel),anisotropyMapUv:_e&&h(a.anisotropyMap.channel),clearcoatMapUv:ve&&h(a.clearcoatMap.channel),clearcoatNormalMapUv:P&&h(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ye&&h(a.clearcoatRoughnessMap.channel),iridescenceMapUv:be&&h(a.iridescenceMap.channel),iridescenceThicknessMapUv:xe&&h(a.iridescenceThicknessMap.channel),sheenColorMapUv:Se&&h(a.sheenColorMap.channel),sheenRoughnessMapUv:Ce&&h(a.sheenRoughnessMap.channel),specularMapUv:we&&h(a.specularMap.channel),specularColorMapUv:Te&&h(a.specularColorMap.channel),specularIntensityMapUv:Ee&&h(a.specularIntensityMap.channel),transmissionMapUv:De&&h(a.transmissionMap.channel),thicknessMapUv:Oe&&h(a.thicknessMap.channel),alphaMapUv:Ae&&h(a.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(oe||de),vertexColors:a.vertexColors,vertexAlphas:a.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:g.isPoints===!0&&!!v.attributes.uv&&(ne||Ae),fog:!!_,useFog:a.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:a.flatShading===!0&&a.wireframe===!1,sizeAttenuation:a.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:A,skinning:g.isSkinnedMesh===!0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:w,morphTextureStride:T,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:Pe,decodeVideoTexture:ne&&a.map.isVideoTexture===!0&&jO.getTransfer(a.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ce&&a.emissiveMap.isVideoTexture===!0&&jO.getTransfer(a.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===2,flipSided:a.side===1,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:Ne&&a.extensions.clipCullDistance===!0&&r.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(Ne&&a.extensions.multiDraw===!0||j)&&r.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:r.has(`KHR_parallel_shader_compile`),customProgramCacheKey:a.customProgramCacheKey()};return Fe.vertexUv1s=l.has(1),Fe.vertexUv2s=l.has(2),Fe.vertexUv3s=l.has(3),l.clear(),Fe}function _(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(v(n,t),y(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function v(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function y(e,t){s.disableAll(),t.instancing&&s.enable(0),t.instancingColor&&s.enable(1),t.instancingMorph&&s.enable(2),t.matcap&&s.enable(3),t.envMap&&s.enable(4),t.normalMapObjectSpace&&s.enable(5),t.normalMapTangentSpace&&s.enable(6),t.clearcoat&&s.enable(7),t.iridescence&&s.enable(8),t.alphaTest&&s.enable(9),t.vertexColors&&s.enable(10),t.vertexAlphas&&s.enable(11),t.vertexUv1s&&s.enable(12),t.vertexUv2s&&s.enable(13),t.vertexUv3s&&s.enable(14),t.vertexTangents&&s.enable(15),t.anisotropy&&s.enable(16),t.alphaHash&&s.enable(17),t.batching&&s.enable(18),t.dispersion&&s.enable(19),t.batchingColor&&s.enable(20),t.gradientMap&&s.enable(21),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reversedDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}function b(e){let t=m[e.type],n;if(t){let e=IP[t];n=XA.clone(e.uniforms)}else n=e.uniforms;return n}function x(t,n){let r=d.get(n);return r===void 0?(r=new lL(e,n,t,a),u.push(r),d.set(n,r)):++r.usedTimes,r}function S(e){if(--e.usedTimes===0){let t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),d.delete(e.cacheKey),e.destroy()}}function C(e){c.remove(e)}function w(){c.dispose()}return{getParameters:g,getProgramCacheKey:_,getUniforms:b,acquireProgram:x,releaseProgram:S,releaseShaderCache:C,programs:u,dispose:w}}function mL(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function hL(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.z===t.z?e.id-t.id:e.z-t.z:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function gL(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function _L(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(n,r,i,a,o,s){let c=e[t];return c===void 0?(c={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=o,c.group=s),t++,c}function s(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function c(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function l(e,t){n.length>1&&n.sort(e||hL),r.length>1&&r.sort(t||gL),i.length>1&&i.sort(t||gL)}function u(){for(let n=t,r=e.length;n=r.length?(i=new _L,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function yL(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new Z,color:new fA};break;case`SpotLight`:n={position:new Z,direction:new Z,color:new fA,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new Z,color:new fA,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new Z,skyColor:new fA,groundColor:new fA};break;case`RectAreaLight`:n={color:new fA,position:new Z,halfWidth:new Z,halfHeight:new Z}}return e[t.id]=n,n}}}function bL(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}var xL=0;function SL(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function CL(e){let t=new yL,n=bL(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new Z);let i=new Z,a=new bk,o=new bk;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(SL);for(let e=0,y=i.length;e0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=$.LTC_FLOAT_1,r.rectAreaLTC2=$.LTC_FLOAT_2):(r.rectAreaLTC1=$.LTC_HALF_1,r.rectAreaLTC2=$.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=xL++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new wL(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var EL=`void main() { +`+n)}}else o===``?(s===``||c===``)&&(u=!1):bO(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new nL(i,h),T=_L(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,iL)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=aL++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var zL=0,BL=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new VL(e),t.set(e,n)),n}},VL=class{constructor(e){this.id=zL++,this.code=e,this.usedTimes=0}};function HL(e,t,n,r,i,a,o){let s=new oA,c=new BL,l=new Set,u=[],d=new Map,f=i.logarithmicDepthBuffer,p=i.precision,m={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function h(e){return l.add(e),e===0?`uv`:`uv${e}`}function g(a,s,u,d,g){let _=d.fog,v=g.geometry,y=a.isMeshStandardMaterial?d.environment:null,b=(a.isMeshStandardMaterial?n:t).get(a.envMap||y),x=b&&b.mapping===306?b.image.height:null,S=m[a.type];a.precision!==null&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&bO(`WebGLProgram.getParameters:`,a.precision,`not supported, using`,p,`instead.`));let C=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,w=C===void 0?0:C.length,T=0;v.morphAttributes.position!==void 0&&(T=1),v.morphAttributes.normal!==void 0&&(T=2),v.morphAttributes.color!==void 0&&(T=3);let E,D,O,ee;if(S){let e=dF[S];E=e.vertexShader,D=e.fragmentShader}else E=a.vertexShader,D=a.fragmentShader,c.update(a),O=c.getVertexShaderID(a),ee=c.getFragmentShaderID(a);let k=e.getRenderTarget(),A=e.state.buffers.depth.getReversed(),te=g.isInstancedMesh===!0,j=g.isBatchedMesh===!0,ne=!!a.map,M=!!a.matcap,N=!!b,re=!!a.aoMap,ie=!!a.lightMap,ae=!!a.bumpMap,oe=!!a.normalMap,se=!!a.displacementMap,ce=!!a.emissiveMap,le=!!a.metalnessMap,ue=!!a.roughnessMap,de=a.anisotropy>0,fe=a.clearcoat>0,pe=a.dispersion>0,me=a.iridescence>0,he=a.sheen>0,ge=a.transmission>0,_e=de&&!!a.anisotropyMap,ve=fe&&!!a.clearcoatMap,P=fe&&!!a.clearcoatNormalMap,ye=fe&&!!a.clearcoatRoughnessMap,be=me&&!!a.iridescenceMap,xe=me&&!!a.iridescenceThicknessMap,Se=he&&!!a.sheenColorMap,Ce=he&&!!a.sheenRoughnessMap,we=!!a.specularMap,Te=!!a.specularColorMap,Ee=!!a.specularIntensityMap,De=ge&&!!a.transmissionMap,Oe=ge&&!!a.thicknessMap,ke=!!a.gradientMap,Ae=!!a.alphaMap,je=a.alphaTest>0,Me=!!a.alphaHash,Ne=!!a.extensions,Pe=0;a.toneMapped&&(k===null||k.isXRRenderTarget===!0)&&(Pe=e.toneMapping);let Fe={shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:E,fragmentShader:D,defines:a.defines,customVertexShaderID:O,customFragmentShaderID:ee,isRawShaderMaterial:a.isRawShaderMaterial===!0,glslVersion:a.glslVersion,precision:p,batching:j,batchingColor:j&&g._colorsTexture!==null,instancing:te,instancingColor:te&&g.instanceColor!==null,instancingMorph:te&&g.morphTexture!==null,outputColorSpace:k===null?e.outputColorSpace:k.isXRRenderTarget===!0?k.texture.colorSpace:cO,alphaToCoverage:!!a.alphaToCoverage,map:ne,matcap:M,envMap:N,envMapMode:N&&b.mapping,envMapCubeUVHeight:x,aoMap:re,lightMap:ie,bumpMap:ae,normalMap:oe,displacementMap:se,emissiveMap:ce,normalMapObjectSpace:oe&&a.normalMapType===1,normalMapTangentSpace:oe&&a.normalMapType===0,metalnessMap:le,roughnessMap:ue,anisotropy:de,anisotropyMap:_e,clearcoat:fe,clearcoatMap:ve,clearcoatNormalMap:P,clearcoatRoughnessMap:ye,dispersion:pe,iridescence:me,iridescenceMap:be,iridescenceThicknessMap:xe,sheen:he,sheenColorMap:Se,sheenRoughnessMap:Ce,specularMap:we,specularColorMap:Te,specularIntensityMap:Ee,transmission:ge,transmissionMap:De,thicknessMap:Oe,gradientMap:ke,opaque:a.transparent===!1&&a.blending===1&&a.alphaToCoverage===!1,alphaMap:Ae,alphaTest:je,alphaHash:Me,combine:a.combine,mapUv:ne&&h(a.map.channel),aoMapUv:re&&h(a.aoMap.channel),lightMapUv:ie&&h(a.lightMap.channel),bumpMapUv:ae&&h(a.bumpMap.channel),normalMapUv:oe&&h(a.normalMap.channel),displacementMapUv:se&&h(a.displacementMap.channel),emissiveMapUv:ce&&h(a.emissiveMap.channel),metalnessMapUv:le&&h(a.metalnessMap.channel),roughnessMapUv:ue&&h(a.roughnessMap.channel),anisotropyMapUv:_e&&h(a.anisotropyMap.channel),clearcoatMapUv:ve&&h(a.clearcoatMap.channel),clearcoatNormalMapUv:P&&h(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ye&&h(a.clearcoatRoughnessMap.channel),iridescenceMapUv:be&&h(a.iridescenceMap.channel),iridescenceThicknessMapUv:xe&&h(a.iridescenceThicknessMap.channel),sheenColorMapUv:Se&&h(a.sheenColorMap.channel),sheenRoughnessMapUv:Ce&&h(a.sheenRoughnessMap.channel),specularMapUv:we&&h(a.specularMap.channel),specularColorMapUv:Te&&h(a.specularColorMap.channel),specularIntensityMapUv:Ee&&h(a.specularIntensityMap.channel),transmissionMapUv:De&&h(a.transmissionMap.channel),thicknessMapUv:Oe&&h(a.thicknessMap.channel),alphaMapUv:Ae&&h(a.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(oe||de),vertexColors:a.vertexColors,vertexAlphas:a.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:g.isPoints===!0&&!!v.attributes.uv&&(ne||Ae),fog:!!_,useFog:a.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:a.flatShading===!0&&a.wireframe===!1,sizeAttenuation:a.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:A,skinning:g.isSkinnedMesh===!0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:w,morphTextureStride:T,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:Pe,decodeVideoTexture:ne&&a.map.isVideoTexture===!0&&ok.getTransfer(a.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ce&&a.emissiveMap.isVideoTexture===!0&&ok.getTransfer(a.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===2,flipSided:a.side===1,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:Ne&&a.extensions.clipCullDistance===!0&&r.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(Ne&&a.extensions.multiDraw===!0||j)&&r.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:r.has(`KHR_parallel_shader_compile`),customProgramCacheKey:a.customProgramCacheKey()};return Fe.vertexUv1s=l.has(1),Fe.vertexUv2s=l.has(2),Fe.vertexUv3s=l.has(3),l.clear(),Fe}function _(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(v(n,t),y(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function v(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function y(e,t){s.disableAll(),t.instancing&&s.enable(0),t.instancingColor&&s.enable(1),t.instancingMorph&&s.enable(2),t.matcap&&s.enable(3),t.envMap&&s.enable(4),t.normalMapObjectSpace&&s.enable(5),t.normalMapTangentSpace&&s.enable(6),t.clearcoat&&s.enable(7),t.iridescence&&s.enable(8),t.alphaTest&&s.enable(9),t.vertexColors&&s.enable(10),t.vertexAlphas&&s.enable(11),t.vertexUv1s&&s.enable(12),t.vertexUv2s&&s.enable(13),t.vertexUv3s&&s.enable(14),t.vertexTangents&&s.enable(15),t.anisotropy&&s.enable(16),t.alphaHash&&s.enable(17),t.batching&&s.enable(18),t.dispersion&&s.enable(19),t.batchingColor&&s.enable(20),t.gradientMap&&s.enable(21),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reversedDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}function b(e){let t=m[e.type],n;if(t){let e=dF[t];n=Tj.clone(e.uniforms)}else n=e.uniforms;return n}function x(t,n){let r=d.get(n);return r===void 0?(r=new RL(e,n,t,a),u.push(r),d.set(n,r)):++r.usedTimes,r}function S(e){if(--e.usedTimes===0){let t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),d.delete(e.cacheKey),e.destroy()}}function C(e){c.remove(e)}function w(){c.dispose()}return{getParameters:g,getProgramCacheKey:_,getUniforms:b,acquireProgram:x,releaseProgram:S,releaseShaderCache:C,programs:u,dispose:w}}function UL(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function WL(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.z===t.z?e.id-t.id:e.z-t.z:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function GL(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function KL(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(n,r,i,a,o,s){let c=e[t];return c===void 0?(c={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=o,c.group=s),t++,c}function s(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function c(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function l(e,t){n.length>1&&n.sort(e||WL),r.length>1&&r.sort(t||GL),i.length>1&&i.sort(t||GL)}function u(){for(let n=t,r=e.length;n=r.length?(i=new KL,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function JL(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new Z,color:new VA};break;case`SpotLight`:n={position:new Z,direction:new Z,color:new VA,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new Z,color:new VA,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new Z,skyColor:new VA,groundColor:new VA};break;case`RectAreaLight`:n={color:new VA,position:new Z,halfWidth:new Z,halfHeight:new Z}}return e[t.id]=n,n}}}function YL(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}var XL=0;function ZL(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function QL(e){let t=new JL,n=YL(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new Z);let i=new Z,a=new Yk,o=new Yk;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(ZL);for(let e=0,y=i.length;e0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=$.LTC_FLOAT_1,r.rectAreaLTC2=$.LTC_FLOAT_2):(r.rectAreaLTC1=$.LTC_HALF_1,r.rectAreaLTC2=$.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=XL++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new $L(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var tR=`void main() { gl_Position = vec4( position, 1.0 ); -}`,DL=`uniform sampler2D shadow_pass; +}`,nR=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; void main() { @@ -3989,12 +3989,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); -}`,OL=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],kL=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],AL=new bk,jL=new Z,ML=new Z;function NL(e,t,n){let r=new Sj,i=new X,a=new X,o=new HO,s=new TN,c=new EN,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new $A({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new X},radius:{value:4}},vertexShader:EL,fragmentShader:DL}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new jA;m.setAttribute(`position`,new bA(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Q(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;t.type===2&&(GD(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),t.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;cu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y)),d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){GD(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new WO(i.x,i.y,{format:BE,type:DE,minFilter:_E,magFilter:_E,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new Uj(i.x,i.y,EE),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=IE,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=mE,d.map.depthTexture.magFilter=mE}else{l.isPointLight?(d.map=new lj(i.x),d.map.depthTexture=new Wj(i.x,TE)):(d.map=new WO(i.x,i.y),d.map.depthTexture=new Uj(i.x,i.y,TE)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=IE;let t=e.state.buffers.depth.getReversed();this.type===1?(d.map.depthTexture.compareFunction=t?518:515,d.map.depthTexture.minFilter=_E,d.map.depthTexture.magFilter=_E):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=mE,d.map.depthTexture.magFilter=mE)}d.camera.updateProjectionMatrix()}let h=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l=2):(j=parseFloat(/^WebGL (\d)/.exec(ne)[1]),te=j>=1);let M=null,N={},re=e.getParameter(e.SCISSOR_BOX),ie=e.getParameter(e.VIEWPORT),ae=new HO().fromArray(re),oe=new HO().fromArray(ie);function se(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new X,u=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function m(e,t){return p?new OffscreenCanvas(e,t):VD(`canvas`)}function h(e,t,n){let r=1,i=Ce(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);d===void 0&&(d=m(n,a));let o=t?m(n,a):d;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),GD(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&GD(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function g(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(n,r,i,a,o=!1){if(n!==null){if(e[n]!==void 0)return e[n];GD(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(s=e.R11F_G11F_B10F)),r===e.RGBA){let t=o?PD:jO.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return(s===e.R16F||s===e.R32F||s===e.RG16F||s===e.RG32F||s===e.RGBA16F||s===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),s}function b(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,GD(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return g(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener(`dispose`,S),w(t),t.isVideoTexture&&u.delete(t)}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),E(t)}function w(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=f.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&T(e),Object.keys(i).length===0&&f.delete(n)}r.remove(e)}function T(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=f.get(i);delete a[n.__cacheKey],o.memory.textures--}function E(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r=i.maxTextures&&GD(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),D+=1,e}function k(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function A(t,i){let a=r.get(t);if(t.isVideoTexture&&xe(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)GD(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)GD(`WebGLRenderer: Texture marked for update but image is incomplete`);else{ce(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function te(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function j(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ne(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){le(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let M={[dE]:e.REPEAT,[fE]:e.CLAMP_TO_EDGE,[pE]:e.MIRRORED_REPEAT},N={[mE]:e.NEAREST,[hE]:e.NEAREST_MIPMAP_NEAREST,[gE]:e.NEAREST_MIPMAP_LINEAR,[_E]:e.LINEAR,[vE]:e.LINEAR_MIPMAP_NEAREST,[yE]:e.LINEAR_MIPMAP_LINEAR},re={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function ie(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&GD(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,M[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,M[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,M[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,N[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,N[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,re[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ae(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,S));let i=n.source,a=f.get(i);a===void 0&&(a={},f.set(i,a));let s=k(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&T(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function oe(e,t,n){return Math.floor(Math.floor(e/n)/t)}function se(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e0){T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let r=jP(C.width,C.height,o.format,o.type);for(let i of o.layerUpdates){let a=C.data.subarray(i*r/C.data.BYTES_PER_ELEMENT,(i+1)*r/C.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,C.width,C.height,1,m,a)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,C.data)}}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,C.data,0,0)}else GD(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`)}else T?D&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,v,C.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,m,v,C.data)}else{T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let t=jP(p.width,p.height,o.format,o.type);for(let r of o.layerUpdates){let i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,m,v,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)}}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,m,v,p.data)}else if(o.isData3DTexture)T?(E&&n.texStorage3D(e.TEXTURE_3D,O,S,p.width,p.height,p.depth),D&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)):n.texImage3D(e.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isFramebufferTexture){if(E){if(T)n.texStorage2D(e.TEXTURE_2D,O,S,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i>=1,r>>=1}}}else if(w.length>0){if(T&&E){let t=Ce(w[0]);n.texStorage2D(e.TEXTURE_2D,O,S,t.width,t.height)}for(let t=0,r=w.length;t0&&D++;let t=Ce(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,b,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,b,S,m[t].data);for(let r=0;r>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),be(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,ye(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function de(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;be(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ye(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ye(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)for(let e=0;e<6;e++)fe(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?fe(i.__webglFramebuffer[0],t,0):fe(i.__webglFramebuffer,t,0)}}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),de(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),de(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function me(t,n,i){let a=r.get(t);n!==void 0&&ue(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&pe(t)}function he(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,C);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&be(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(be(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function xe(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function Se(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(jO.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&GD(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):KD(`WebGLTextures: Unsupported texture color space:`,n)),t}function Ce(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=ee,this.resetTextureUnits=O,this.setTexture2D=A,this.setTexture2DArray=te,this.setTexture3D=j,this.setTextureCube=ne,this.rebindTextures=me,this.setupRenderTarget=he,this.updateRenderTargetMipmap=ge,this.updateMultisampleRenderTarget=P,this.setupDepthRenderbuffer=pe,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=be,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function LL(e,t){function n(n,r=``){let i,a=jO.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779){if(a===`srgb`){if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null}else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null}if(n===35840||n===35841||n===35842||n===35843){if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null}if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491){if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null}if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821){if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null}if(n===36492||n===36494||n===36495){if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null}if(n===36283||n===36284||n===36285||n===36286){if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null}return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var RL=` +}`,rR=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],iR=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],aR=new Yk,oR=new Z,sR=new Z;function cR(e,t,n){let r=new Zj,i=new X,a=new X,o=new _k,s=new eP,c=new tP,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new Oj({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new X},radius:{value:4}},vertexShader:tR,fragmentShader:nR}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new oj;m.setAttribute(`position`,new YA(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Q(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;t.type===2&&(bO(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),t.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;cu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y)),d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){bO(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new yk(i.x,i.y,{format:hD,type:nD,minFilter:KE,magFilter:KE,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new vM(i.x,i.y,tD),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=dD,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=UE,d.map.depthTexture.magFilter=UE}else{l.isPointLight?(d.map=new Rj(i.x),d.map.depthTexture=new yM(i.x,eD)):(d.map=new yk(i.x,i.y),d.map.depthTexture=new vM(i.x,i.y,eD)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=dD;let t=e.state.buffers.depth.getReversed();this.type===1?(d.map.depthTexture.compareFunction=t?518:515,d.map.depthTexture.minFilter=KE,d.map.depthTexture.magFilter=KE):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=UE,d.map.depthTexture.magFilter=UE)}d.camera.updateProjectionMatrix()}let h=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l=2):(j=parseFloat(/^WebGL (\d)/.exec(ne)[1]),te=j>=1);let M=null,N={},re=e.getParameter(e.SCISSOR_BOX),ie=e.getParameter(e.VIEWPORT),ae=new _k().fromArray(re),oe=new _k().fromArray(ie);function se(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new X,u=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function m(e,t){return p?new OffscreenCanvas(e,t):gO(`canvas`)}function h(e,t,n){let r=1,i=Ce(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);d===void 0&&(d=m(n,a));let o=t?m(n,a):d;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),bO(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&bO(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function g(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(n,r,i,a,o=!1){if(n!==null){if(e[n]!==void 0)return e[n];bO(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(s=e.R11F_G11F_B10F)),r===e.RGBA){let t=o?lO:ok.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return(s===e.R16F||s===e.R32F||s===e.RG16F||s===e.RG32F||s===e.RGBA16F||s===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),s}function b(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,bO(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return g(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener(`dispose`,S),w(t),t.isVideoTexture&&u.delete(t)}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),E(t)}function w(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=f.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&T(e),Object.keys(i).length===0&&f.delete(n)}r.remove(e)}function T(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=f.get(i);delete a[n.__cacheKey],o.memory.textures--}function E(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r=i.maxTextures&&bO(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),D+=1,e}function k(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function A(t,i){let a=r.get(t);if(t.isVideoTexture&&xe(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)bO(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)bO(`WebGLRenderer: Texture marked for update but image is incomplete`);else{ce(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function te(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function j(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ne(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){le(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let M={[BE]:e.REPEAT,[VE]:e.CLAMP_TO_EDGE,[HE]:e.MIRRORED_REPEAT},N={[UE]:e.NEAREST,[WE]:e.NEAREST_MIPMAP_NEAREST,[GE]:e.NEAREST_MIPMAP_LINEAR,[KE]:e.LINEAR,[qE]:e.LINEAR_MIPMAP_NEAREST,[JE]:e.LINEAR_MIPMAP_LINEAR},re={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function ie(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&bO(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,M[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,M[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,M[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,N[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,N[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,re[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ae(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,S));let i=n.source,a=f.get(i);a===void 0&&(a={},f.set(i,a));let s=k(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&T(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function oe(e,t,n){return Math.floor(Math.floor(e/n)/t)}function se(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e0){T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let r=oF(C.width,C.height,o.format,o.type);for(let i of o.layerUpdates){let a=C.data.subarray(i*r/C.data.BYTES_PER_ELEMENT,(i+1)*r/C.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,C.width,C.height,1,m,a)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,C.data)}}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,C.data,0,0)}else bO(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`)}else T?D&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,v,C.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,m,v,C.data)}else{T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let t=oF(p.width,p.height,o.format,o.type);for(let r of o.layerUpdates){let i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,m,v,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)}}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,m,v,p.data)}else if(o.isData3DTexture)T?(E&&n.texStorage3D(e.TEXTURE_3D,O,S,p.width,p.height,p.depth),D&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)):n.texImage3D(e.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isFramebufferTexture){if(E){if(T)n.texStorage2D(e.TEXTURE_2D,O,S,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i>=1,r>>=1}}}else if(w.length>0){if(T&&E){let t=Ce(w[0]);n.texStorage2D(e.TEXTURE_2D,O,S,t.width,t.height)}for(let t=0,r=w.length;t0&&D++;let t=Ce(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,b,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,b,S,m[t].data);for(let r=0;r>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),be(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,ye(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function de(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;be(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ye(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ye(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)for(let e=0;e<6;e++)fe(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?fe(i.__webglFramebuffer[0],t,0):fe(i.__webglFramebuffer,t,0)}}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),de(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),de(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function me(t,n,i){let a=r.get(t);n!==void 0&&ue(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&pe(t)}function he(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,C);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&be(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(be(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function xe(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function Se(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(ok.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&bO(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):xO(`WebGLTextures: Unsupported texture color space:`,n)),t}function Ce(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=ee,this.resetTextureUnits=O,this.setTexture2D=A,this.setTexture2DArray=te,this.setTexture3D=j,this.setTextureCube=ne,this.rebindTextures=me,this.setupRenderTarget=he,this.updateRenderTargetMipmap=ge,this.updateMultisampleRenderTarget=P,this.setupDepthRenderbuffer=pe,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=be,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function fR(e,t){function n(n,r=``){let i,a=ok.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779){if(a===`srgb`){if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null}else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null}if(n===35840||n===35841||n===35842||n===35843){if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null}if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491){if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null}if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821){if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null}if(n===36492||n===36494||n===36495){if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null}if(n===36283||n===36284||n===36285||n===36286){if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null}return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var pR=` void main() { gl_Position = vec4( position, 1.0 ); -}`,zL=` +}`,mR=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -4013,7 +4013,7 @@ void main() { } -}`,BL=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Gj(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new $A({vertexShader:RL,fragmentShader:zL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Q(new yN(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},VL=class extends YD{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new BL,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new X,C=null,w=new ij;w.viewport=new HO;let T=new ij;T.viewport=new HO;let E=[w,T],D=new oP,O=null,ee=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new fj,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new fj,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new fj,b[e]=t),t.getHandSpace()};function k(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function A(){r.removeEventListener(`select`,k),r.removeEventListener(`selectstart`,k),r.removeEventListener(`selectend`,k),r.removeEventListener(`squeeze`,k),r.removeEventListener(`squeezestart`,k),r.removeEventListener(`squeezeend`,k),r.removeEventListener(`end`,A),r.removeEventListener(`inputsourceschange`,te);for(let e=0;e=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let j=new Z,ne=new Z;function M(e,t,n){j.setFromMatrixPosition(t.matrixWorld),ne.setFromMatrixPosition(n.matrixWorld);let r=j.distanceTo(ne),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function N(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||ee!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,ee=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&3,T.layers.mask=D.layers.mask&5;let i=e.parent,a=D.cameras;N(D,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,HL.copy(o),HL.x*=-1,HL.y*=-1,HL.z*=-1,a.isCubeTexture&&a.isRenderTargetTexture===!1&&(HL.y*=-1,HL.z*=-1),e.envMapRotation.value.setFromMatrix4(UL.makeRotationFromEuler(HL)),e.flipEnvMap.value=a.isCubeTexture&&a.isRenderTargetTexture===!1?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function GL(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e0&&(n+=16-r),e.__size=n,e.__cache={},this}function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?GD(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):GD(`WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var KL=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),qL=null;function JL(){return qL===null&&(qL=new mj(KL,16,16,BE,DE),qL.name=`DFG_LUT`,qL.minFilter=_E,qL.magFilter=_E,qL.wrapS=fE,qL.wrapT=fE,qL.generateMipmaps=!1,qL.needsUpdate=!0),qL}var YL=class{constructor(e={}){let{canvas:t=HD(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=bE}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([HE,VE,zE]),g=new Set([bE,TE,CE,AE,OE,kE]),_=new Uint32Array(4),v=new Int32Array(4),y=null,b=null,x=[],S=[],C=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let w=this,T=!1;this._outputColorSpace=MD;let E=0,D=0,O=null,ee=-1,k=null,A=new HO,te=new HO,j=null,ne=new fA(0),M=0,N=t.width,re=t.height,ie=1,ae=null,oe=null,se=new HO(0,0,N,re),ce=new HO(0,0,N,re),le=!1,ue=new Sj,de=!1,fe=!1,pe=new bk,me=new Z,he=new HO,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},_e=!1;function ve(){return O===null?ie:1}let P=n;function ye(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r182`),t.addEventListener(`webglcontextlost`,Ke,!1),t.addEventListener(`webglcontextrestored`,qe,!1),t.addEventListener(`webglcontextcreationerror`,Je,!1),P===null){let t=`webgl2`;if(P=ye(t,e),P===null)throw ye(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw KD(`WebGLRenderer: `+e.message),e}let be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue;function We(){be=new pF(P),be.init(),Ve=new LL(P,be),xe=new UP(P,be,e,Ve),Se=new FL(P,be),xe.reversedDepthBuffer&&d&&Se.buffers.depth.setReversed(!0),Ce=new gF(P),we=new mL,Te=new IL(P,be,Se,we,xe,Ve,Ce),Ee=new GP(w),De=new fF(w),Oe=new PP(P),He=new VP(P,Oe),ke=new mF(P,Oe,Ce,He),Ae=new vF(P,ke,Oe,Ce),Re=new _F(P,xe,Te),Fe=new WP(we),je=new pL(w,Ee,De,be,xe,He,Fe),Me=new WL(w,we),Ne=new vL,Pe=new TL(be),Le=new BP(w,Ee,De,Se,Ae,p,s),Ie=new NL(w,Ae,xe),Ue=new GL(P,Ce,xe,Se),ze=new HP(P,be,Ce),Be=new hF(P,be,Ce),Ce.programs=je.programs,w.capabilities=xe,w.extensions=be,w.properties=we,w.renderLists=Ne,w.shadowMap=Ie,w.state=Se,w.info=Ce}We(),m!==1009&&(C=new bF(m,t.width,t.height,r,i));let Ge=new VL(w,P);this.xr=Ge,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){let e=be.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=be.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function(e){e!==void 0&&(ie=e,this.setSize(N,re,!1))},this.getSize=function(e){return e.set(N,re)},this.setSize=function(e,n,r=!0){if(Ge.isPresenting){GD(`WebGLRenderer: Can't change size while VR device is presenting.`);return}N=e,re=n,t.width=Math.floor(e*ie),t.height=Math.floor(n*ie),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),C!==null&&C.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(N*ie,re*ie).floor()},this.setDrawingBufferSize=function(e,n,r){N=e,re=n,ie=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){console.error(`THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t{function n(){if(r.forEach(function(e){we.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}be.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let $e=null;function et(e){$e&&$e(e)}function tt(){rt.stop()}function nt(){rt.start()}let rt=new NP;rt.setAnimationLoop(et),typeof self<`u`&&rt.setContext(self),this.setAnimationLoop=function(e){$e=e,Ge.setAnimationLoop(e),e===null?rt.stop():rt.start()},Ge.addEventListener(`sessionstart`,tt),Ge.addEventListener(`sessionend`,nt),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){KD(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(T===!0)return;let n=Ge.enabled===!0&&Ge.isPresenting===!0,r=C!==null&&(O===null||n)&&C.begin(w,O);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Ge.enabled===!0&&Ge.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(Ge.cameraAutoUpdate===!0&&Ge.updateCamera(t),t=Ge.getCamera()),e.isScene===!0&&e.onBeforeRender(w,e,t,O),b=Pe.get(e,S.length),b.init(t),S.push(b),pe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ue.setFromProjectionMatrix(pe,RD,t.reversedDepth),fe=this.localClippingEnabled,de=Fe.init(this.clippingPlanes,fe),y=Ne.get(e,x.length),y.init(),x.push(y),Ge.enabled===!0&&Ge.isPresenting===!0){let e=w.xr.getDepthSensingMesh();e!==null&&it(e,t,-1/0,w.sortObjects)}it(e,t,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(ae,oe),_e=Ge.enabled===!1||Ge.isPresenting===!1||Ge.hasDepthSensing()===!1,_e&&Le.addToRenderList(y,e),this.info.render.frame++,de===!0&&Fe.beginShadows();let i=b.state.shadowsArray;if(Ie.render(i,e,t),de===!0&&Fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(r&&C.hasRenderPass())===!1){let n=y.opaque,r=y.transmissive;if(b.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t0&&ot(n,r,e,t),_e&&Le.render(e),at(y,e,t)}O!==null&&D===0&&(Te.updateMultisampleRenderTarget(O),Te.updateRenderTargetMipmap(O)),r&&C.end(w),e.isScene===!0&&e.onAfterRender(w,e,t),He.resetDefaultState(),ee=-1,k=null,S.pop(),S.length>0?(b=S[S.length-1],de===!0&&Fe.setGlobalState(w.clippingPlanes,b.state.camera)):b=null,x.pop(),y=x.length>0?x[x.length-1]:null};function it(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)b.pushLight(e),e.castShadow&&b.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ue.intersectsSprite(e)){r&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(pe);let t=Ae.update(e),i=e.material;i.visible&&y.push(e,t,i,n,he.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ue.intersectsObject(e))){let t=Ae.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),he.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),he.copy(e.boundingSphere.center)),he.applyMatrix4(e.matrixWorld).applyMatrix4(pe)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&st(i,t,n),a.length>0&&st(a,t,n),o.length>0&&st(o,t,n),Se.buffers.depth.setTest(!0),Se.buffers.depth.setMask(!0),Se.buffers.color.setMask(!0),Se.setPolygonOffset(!1)}function ot(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(b.state.transmissionRenderTarget[r.id]===void 0){let e=be.has(`EXT_color_buffer_half_float`)||be.has(`EXT_color_buffer_float`);b.state.transmissionRenderTarget[r.id]=new WO(1,1,{generateMipmaps:!0,type:e?DE:bE,minFilter:yE,samples:xe.samples,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:jO.workingColorSpace})}let a=b.state.transmissionRenderTarget[r.id],o=r.viewport||A;a.setSize(o.z*w.transmissionResolutionScale,o.w*w.transmissionResolutionScale);let s=w.getRenderTarget(),c=w.getActiveCubeFace(),l=w.getActiveMipmapLevel();w.setRenderTarget(a),w.getClearColor(ne),M=w.getClearAlpha(),M<1&&w.setClearColor(16777215,.5),w.clear(),_e&&Le.render(n);let u=w.toneMapping;w.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),b.setupLightsView(r),de===!0&&Fe.setGlobalState(w.clippingPlanes,r),st(e,n,r),Te.updateMultisampleRenderTarget(a),Te.updateRenderTargetMipmap(a),be.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i0),d=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=0;r.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(m=w.toneMapping);let h=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=h===void 0?0:h.length,_=we.get(r),v=b.state.lights;if(de===!0&&(fe===!0||e!==k)){let t=e===k&&r.id===ee;Fe.setState(r,e,t)}let y=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==v.state.version?y=!0:_.outputColorSpace===s?i.isBatchedMesh&&_.batching===!1||!i.isBatchedMesh&&_.batching===!0||i.isBatchedMesh&&_.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&_.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&_.instancing===!1||!i.isInstancedMesh&&_.instancing===!0||i.isSkinnedMesh&&_.skinning===!1||!i.isSkinnedMesh&&_.skinning===!0||i.isInstancedMesh&&_.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&_.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&_.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&_.instancingMorph===!1&&i.morphTexture!==null?y=!0:_.envMap===c?r.fog===!0&&_.fog!==a||_.numClippingPlanes!==void 0&&(_.numClippingPlanes!==Fe.numPlanes||_.numIntersection!==Fe.numIntersection)?y=!0:_.vertexAlphas===l&&_.vertexTangents===u&&_.morphTargets===d&&_.morphNormals===f&&_.morphColors===p&&_.toneMapping===m?_.morphTargetsCount!==g&&(y=!0):y=!0:y=!0:y=!0:(y=!0,_.__version=r.version);let x=_.currentProgram;y===!0&&(x=lt(r,t,i));let S=!1,C=!1,T=!1,E=x.getUniforms(),D=_.uniforms;if(Se.useProgram(x.program)&&(S=!0,C=!0,T=!0),r.id!==ee&&(ee=r.id,C=!0),S||k!==e){Se.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),E.setValue(P,`projectionMatrix`,e.projectionMatrix),E.setValue(P,`viewMatrix`,e.matrixWorldInverse);let t=E.map.cameraPosition;t!==void 0&&t.setValue(P,me.setFromMatrixPosition(e.matrixWorld)),xe.logarithmicDepthBuffer&&E.setValue(P,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&E.setValue(P,`isOrthographic`,e.isOrthographicCamera===!0),k!==e&&(k=e,C=!0,T=!0)}if(_.needsLights&&(v.state.directionalShadowMap.length>0&&E.setValue(P,`directionalShadowMap`,v.state.directionalShadowMap,Te),v.state.spotShadowMap.length>0&&E.setValue(P,`spotShadowMap`,v.state.spotShadowMap,Te),v.state.pointShadowMap.length>0&&E.setValue(P,`pointShadowMap`,v.state.pointShadowMap,Te)),i.isSkinnedMesh){E.setOptional(P,i,`bindMatrix`),E.setOptional(P,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),E.setValue(P,`boneTexture`,e.boneTexture,Te))}i.isBatchedMesh&&(E.setOptional(P,i,`batchingTexture`),E.setValue(P,`batchingTexture`,i._matricesTexture,Te),E.setOptional(P,i,`batchingIdTexture`),E.setValue(P,`batchingIdTexture`,i._indirectTexture,Te),E.setOptional(P,i,`batchingColorTexture`),i._colorsTexture!==null&&E.setValue(P,`batchingColorTexture`,i._colorsTexture,Te));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&Re.update(i,n,x),(C||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,E.setValue(P,`receiveShadow`,i.receiveShadow)),r.isMeshGouraudMaterial&&r.envMap!==null&&(D.envMap.value=c,D.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1),r.isMeshStandardMaterial&&r.envMap===null&&t.environment!==null&&(D.envMapIntensity.value=t.environmentIntensity),D.dfgLUT!==void 0&&(D.dfgLUT.value=JL()),C&&(E.setValue(P,`toneMappingExposure`,w.toneMappingExposure),_.needsLights&&pt(D,T),a&&r.fog===!0&&Me.refreshFogUniforms(D,a),Me.refreshMaterialUniforms(D,r,ie,re,b.state.transmissionRenderTarget[e.id]),DI.upload(P,ut(_),D,Te)),r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(DI.upload(P,ut(_),D,Te),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&E.setValue(P,`center`,i.center),E.setValue(P,`modelViewMatrix`,i.modelViewMatrix),E.setValue(P,`normalMatrix`,i.normalMatrix),E.setValue(P,`modelMatrix`,i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,n=e.length;t0&&Te.useMultisampledRTT(e)===!1?we.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,A.copy(e.viewport),te.copy(e.scissor),j=e.scissorTest}else A.copy(se).multiplyScalar(ie).floor(),te.copy(ce).multiplyScalar(ie).floor(),j=le;if(n!==0&&(r=ht),Se.bindFramebuffer(P.FRAMEBUFFER,r)&&Se.drawBuffers(e,r),Se.viewport(A),Se.scissor(te),Se.setScissorTest(j),i){let r=we.get(e.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),P.readPixels(t,n,r,i,Ve.convert(c),Ve.convert(l),a))}finally{let e=O===null?null:we.get(O).__webglFramebuffer;Se.bindFramebuffer(P.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=we.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){Se.bindFramebuffer(P.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(!xe.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!xe.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.bufferData(P.PIXEL_PACK_BUFFER,a.byteLength,P.STREAM_READ),e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),P.readPixels(t,n,r,i,Ve.convert(l),Ve.convert(u),0);let f=O===null?null:we.get(O).__webglFramebuffer;Se.bindFramebuffer(P.FRAMEBUFFER,f);let p=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await JD(P,p,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,a),P.deleteBuffer(d),P.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;Te.setTexture2D(e,0),P.copyTexSubImage2D(P.TEXTURE_2D,n,0,0,o,s,i,a),Se.unbindTexture()};let gt=P.createFramebuffer(),_t=P.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=null){a===null&&(i===0?a=0:(qD(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),a=i,i=0));let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Ve.convert(t.format),_=Ve.convert(t.type),v;t.isData3DTexture?(Te.setTexture3D(t,0),v=P.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(Te.setTexture2DArray(t,0),v=P.TEXTURE_2D_ARRAY):(Te.setTexture2D(t,0),v=P.TEXTURE_2D),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,t.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,t.unpackAlignment);let y=P.getParameter(P.UNPACK_ROW_LENGTH),b=P.getParameter(P.UNPACK_IMAGE_HEIGHT),x=P.getParameter(P.UNPACK_SKIP_PIXELS),S=P.getParameter(P.UNPACK_SKIP_ROWS),C=P.getParameter(P.UNPACK_SKIP_IMAGES);P.pixelStorei(P.UNPACK_ROW_LENGTH,h.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,h.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,l),P.pixelStorei(P.UNPACK_SKIP_ROWS,u),P.pixelStorei(P.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=we.get(e),r=we.get(t),h=we.get(n.__renderTarget),g=we.get(r.__renderTarget);Se.bindFramebuffer(P.READ_FRAMEBUFFER,h.__webglFramebuffer),Se.bindFramebuffer(P.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{t[n*3]=e.x,t[n*3+1]=e.y,t[n*3+2]=e.z}),t}function ZL(e,t){let n=[];return e.forEach((e,r)=>{let i=n=>{let i=e[n];if(i===void 0||!Number.isInteger(i)||i<0||i>=t)throw RangeError(`Face ${r} references vertex ${String(i)}, which is outside the ${t} available vertices`);return i};for(let t=1;te.indices),e.vertices.length);return t.setIndex(r),t.setAttribute(`position`,new bA(n,3)),t.computeVertexNormals(),new Q(t,new CN({color:30719,flatShading:!0,side:2}))}function $L(e){let t=new jA,n=XL(e.vertices),r=ZL(e.faces.map(e=>e.vertexIndices),e.vertices.length);return t.setIndex(r),t.setAttribute(`position`,new bA(n,3)),t.computeVertexNormals(),new Q(t,new CN({color:52292,side:2}))}function eR(e){let t=new Z(e.point.x,e.point.y,e.point.z),n=new Z(e.xaxis.x,e.xaxis.y,e.xaxis.z),r=new Z(e.yaxis.x,e.yaxis.y,e.yaxis.z),i=new Z().crossVectors(n,r),a=new bk;return a.makeBasis(n,r,i),a.setPosition(t),a}function tR(e){let t=new Float32Array(e.length*3);return e.forEach((e,n)=>{t[n*3]=e.x,t[n*3+1]=e.y,t[n*3+2]=e.z}),t}function nR(e){let t=new GA(e.xsize,e.ysize,e.zsize),n=eR(e.frame),r=new Q(t);return r.applyMatrix4(n),r}function rR(e,t,n){let r=new Q(new Kj(e.radius,e.height,t,n)),i=eR(e.frame);return r.applyMatrix4(i),r}function iR(e,t){let n=new qj(e.radius,t),r=eR(e.frame),i=new Q(n);return i.applyMatrix4(r),i}function aR(e,t){let n=new Q(new Yj(e.radius,e.height,t)),r=eR(e.frame);return n.applyMatrix4(r),n}function oR(e,t){let n=new Q(new Jj(e.radius,e.radius,e.height,t)),r=eR(e.frame);return n.applyMatrix4(r),n}function sR(e){let t=new OP(1);t.setColors(new fA(16711680),new fA(65280),new fA(255));let n=eR(e);return t.applyMatrix4(n),t}function cR(e){let t=new Z(e.start.x,e.start.y,e.start.z),n=new Z(e.end.x,e.end.y,e.end.z);return new jj(new jA().setFromPoints([t,n]),new Cj({color:255}))}function lR(e){let t=new Z(e.point.x,e.point.y,e.point.z),n=new Z(e.normal.x,e.normal.y,e.normal.z),r=new Q(new yN(1,1),new gA({color:16711935,side:2}));r.position.copy(t);let i=new CO;return i.setFromUnitVectors(new Z(0,0,1),n),r.quaternion.copy(i),r}function uR(e){let t=new jA,n=new Float32Array([e.x,e.y,e.z]);return t.setAttribute(`position`,new bA(n,3)),new Vj(t,new Ij({size:.2,color:255}))}function dR(e){let t=new jA,n=tR(e.points);return t.setAttribute(`position`,new bA(n,3)),new Vj(t,new Ij({size:.2,color:16711935}))}function fR(e){let t=new jA,n=tR(e.points);return t.setAttribute(`position`,new bA(n,3)),new jj(t,new Cj({color:0}))}function pR(e,t=64,n=64){let r=new Q(new bN(e.radius,t,n)),i=eR(e.frame);return r.applyMatrix4(i),r}function mR(e,t=64,n=64){let r=new Q(new xN(e.radiusAxis,e.radiusPipe,t,n)),i=eR(e.frame);return r.applyMatrix4(i),r}function hR(e,t){let n=new Z(e.x,e.y,e.z),r=n.length();n.normalize();let i;i=t?new Z(t.x,t.y,t.z):new Z(0,0,0);let a=new DP(n,i,r,16711680);return a.setDirection(n),a}var gR=[Ew,kw,Ww,mw,qw,$w,cT],_R=[mT,_T,bT,CT,ET,kT,RT,VT];function vR(e){return e===null?`null`:e===void 0?`undefined`:typeof e==`object`?e.constructor?.name||`object`:typeof e}var yR=class extends TypeError{objectType;constructor(e,t=`is not supported by the viewer`){let n=vR(e);super(`${n} ${t}`),this.name=`UnsupportedCompasObjectError`,this.objectType=n}};function bR(e){if(gR.some(t=>e instanceof t))throw new yR(e,`does not have an implemented renderer`);if(_R.some(t=>e instanceof t))throw new yR(e,`is data, not renderable scene geometry`);switch(!0){case e instanceof Mw:return nR(e);case e instanceof Fw:return rR(e,32,32);case e instanceof Cw:return iR(e,64);case e instanceof Rw:return aR(e,64);case e instanceof Vw:return oR(e,64);case e instanceof bw:return sR(e);case e instanceof Xw:return cR(e);case e instanceof nT:return lR(e);case e instanceof QC:return uR(e);case e instanceof aT:return dR(e);case e instanceof dT:return fR(e);case e instanceof MT:return pR(e);case e instanceof FT:return mR(e);case e instanceof _w:return hR(e);case e instanceof dw:return QL(e);case e instanceof aw:return $L(e)}throw new yR(e)}function xR(e){switch(e.type){case`standard_material`:return CR(e);case`line_material`:return wR(e);case`point_material`:return TR(e);case`physical_material`:return ER(e)}}function SR(e){let t=e.replace(`#`,`0x`);return parseInt(t)}function CR(e){return new CN({color:SR(e.color),metalness:e.metalness,roughness:e.roughness,emissive:SR(e.emissive),emissiveIntensity:e.emissive_intensity,flatShading:e.flat_shading,wireframe:e.wireframe,side:2,transparent:e.transparent,opacity:e.opacity})}function wR(e){return new Cj({color:SR(e.color)})}function TR(e){return new Ij({color:SR(e.color),size:e.size})}function ER(e){return new wN({color:SR(e.color),metalness:e.metalness,roughness:e.roughness,emissive:SR(e.emissive),emissiveIntensity:e.emissive_intensity,flatShading:e.flat_shading,wireframe:e.wireframe,side:2,anisotropy:e.anisotropy,anisotropyRotation:e.anisotropy_rotation,attenuationColor:SR(e.attenuation_color),...e.attenuation_distance===void 0?{}:{attenuationDistance:e.attenuation_distance},clearcoat:e.clearcoat,clearcoatRoughness:e.clearcoat_roughness,dispersion:e.dispersion,ior:e.ior,iridescence:e.iridescence,iridescenceIOR:e.iridescence_ior,iridescenceThicknessRange:[e.iridescence_thickness_start,e.iridescence_thickness_end],reflectivity:e.reflectivity,sheen:e.sheen,sheenColor:SR(e.sheen_color),specularColor:SR(e.specular_color),sheenRoughness:e.sheen_roughness,specularIntensity:e.specular_intensity,thickness:e.thickness,transmission:e.transmission})}var DR=class e extends Q{constructor(){let t=e.SkyShader,n=new $A({name:t.name,uniforms:XA.clone(t.uniforms),vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,side:1,depthWrite:!1});super(new GA(1,1,1),n),this.isSky=!0}};DR.SkyShader={name:`SkyShader`,uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new Z},up:{value:new Z(0,1,0)}},vertexShader:` +}`,hR=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new bM(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new Oj({vertexShader:pR,fragmentShader:mR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Q(new JN(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},gR=class extends wO{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new hR,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new X,C=null,w=new Nj;w.viewport=new _k;let T=new Nj;T.viewport=new _k;let E=[w,T],D=new FP,O=null,ee=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new Vj,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new Vj,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new Vj,b[e]=t),t.getHandSpace()};function k(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function A(){r.removeEventListener(`select`,k),r.removeEventListener(`selectstart`,k),r.removeEventListener(`selectend`,k),r.removeEventListener(`squeeze`,k),r.removeEventListener(`squeezestart`,k),r.removeEventListener(`squeezeend`,k),r.removeEventListener(`end`,A),r.removeEventListener(`inputsourceschange`,te);for(let e=0;e=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let j=new Z,ne=new Z;function M(e,t,n){j.setFromMatrixPosition(t.matrixWorld),ne.setFromMatrixPosition(n.matrixWorld);let r=j.distanceTo(ne),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function N(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||ee!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,ee=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&3,T.layers.mask=D.layers.mask&5;let i=e.parent,a=D.cameras;N(D,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,_R.copy(o),_R.x*=-1,_R.y*=-1,_R.z*=-1,a.isCubeTexture&&a.isRenderTargetTexture===!1&&(_R.y*=-1,_R.z*=-1),e.envMapRotation.value.setFromMatrix4(vR.makeRotationFromEuler(_R)),e.flipEnvMap.value=a.isCubeTexture&&a.isRenderTargetTexture===!1?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function bR(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e0&&(n+=16-r),e.__size=n,e.__cache={},this}function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?bO(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):bO(`WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var xR=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),SR=null;function CR(){return SR===null&&(SR=new Uj(xR,16,16,hD,nD),SR.name=`DFG_LUT`,SR.minFilter=KE,SR.magFilter=KE,SR.wrapS=VE,SR.wrapT=VE,SR.generateMipmaps=!1,SR.needsUpdate=!0),SR}var wR=class{constructor(e={}){let{canvas:t=_O(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=YE}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([_D,gD,mD]),g=new Set([YE,eD,QE,aD,rD,iD]),_=new Uint32Array(4),v=new Int32Array(4),y=null,b=null,x=[],S=[],C=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let w=this,T=!1;this._outputColorSpace=sO;let E=0,D=0,O=null,ee=-1,k=null,A=new _k,te=new _k,j=null,ne=new VA(0),M=0,N=t.width,re=t.height,ie=1,ae=null,oe=null,se=new _k(0,0,N,re),ce=new _k(0,0,N,re),le=!1,ue=new Zj,de=!1,fe=!1,pe=new Yk,me=new Z,he=new _k,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},_e=!1;function ve(){return O===null?ie:1}let P=n;function ye(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r182`),t.addEventListener(`webglcontextlost`,Ke,!1),t.addEventListener(`webglcontextrestored`,qe,!1),t.addEventListener(`webglcontextcreationerror`,Je,!1),P===null){let t=`webgl2`;if(P=ye(t,e),P===null)throw ye(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw xO(`WebGLRenderer: `+e.message),e}let be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue;function We(){be=new HF(P),be.init(),Ve=new fR(P,be),xe=new vF(P,be,e,Ve),Se=new uR(P,be),xe.reversedDepthBuffer&&d&&Se.buffers.depth.setReversed(!0),Ce=new GF(P),we=new UL,Te=new dR(P,be,Se,we,xe,Ve,Ce),Ee=new bF(w),De=new VF(w),Oe=new lF(P),He=new gF(P,Oe),ke=new UF(P,Oe,Ce,He),Ae=new qF(P,ke,Oe,Ce),Re=new KF(P,xe,Te),Fe=new yF(we),je=new HL(w,Ee,De,be,xe,He,Fe),Me=new yR(w,we),Ne=new qL,Pe=new eR(be),Le=new hF(w,Ee,De,Se,Ae,p,s),Ie=new cR(w,Ae,xe),Ue=new bR(P,Ce,xe,Se),ze=new _F(P,be,Ce),Be=new WF(P,be,Ce),Ce.programs=je.programs,w.capabilities=xe,w.extensions=be,w.properties=we,w.renderLists=Ne,w.shadowMap=Ie,w.state=Se,w.info=Ce}We(),m!==1009&&(C=new YF(m,t.width,t.height,r,i));let Ge=new gR(w,P);this.xr=Ge,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){let e=be.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=be.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function(e){e!==void 0&&(ie=e,this.setSize(N,re,!1))},this.getSize=function(e){return e.set(N,re)},this.setSize=function(e,n,r=!0){if(Ge.isPresenting){bO(`WebGLRenderer: Can't change size while VR device is presenting.`);return}N=e,re=n,t.width=Math.floor(e*ie),t.height=Math.floor(n*ie),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),C!==null&&C.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(N*ie,re*ie).floor()},this.setDrawingBufferSize=function(e,n,r){N=e,re=n,ie=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){console.error(`THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t{function n(){if(r.forEach(function(e){we.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}be.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let $e=null;function et(e){$e&&$e(e)}function tt(){rt.stop()}function nt(){rt.start()}let rt=new cF;rt.setAnimationLoop(et),typeof self<`u`&&rt.setContext(self),this.setAnimationLoop=function(e){$e=e,Ge.setAnimationLoop(e),e===null?rt.stop():rt.start()},Ge.addEventListener(`sessionstart`,tt),Ge.addEventListener(`sessionend`,nt),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){xO(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(T===!0)return;let n=Ge.enabled===!0&&Ge.isPresenting===!0,r=C!==null&&(O===null||n)&&C.begin(w,O);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Ge.enabled===!0&&Ge.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(Ge.cameraAutoUpdate===!0&&Ge.updateCamera(t),t=Ge.getCamera()),e.isScene===!0&&e.onBeforeRender(w,e,t,O),b=Pe.get(e,S.length),b.init(t),S.push(b),pe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ue.setFromProjectionMatrix(pe,pO,t.reversedDepth),fe=this.localClippingEnabled,de=Fe.init(this.clippingPlanes,fe),y=Ne.get(e,x.length),y.init(),x.push(y),Ge.enabled===!0&&Ge.isPresenting===!0){let e=w.xr.getDepthSensingMesh();e!==null&&it(e,t,-1/0,w.sortObjects)}it(e,t,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(ae,oe),_e=Ge.enabled===!1||Ge.isPresenting===!1||Ge.hasDepthSensing()===!1,_e&&Le.addToRenderList(y,e),this.info.render.frame++,de===!0&&Fe.beginShadows();let i=b.state.shadowsArray;if(Ie.render(i,e,t),de===!0&&Fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(r&&C.hasRenderPass())===!1){let n=y.opaque,r=y.transmissive;if(b.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t0&&ot(n,r,e,t),_e&&Le.render(e),at(y,e,t)}O!==null&&D===0&&(Te.updateMultisampleRenderTarget(O),Te.updateRenderTargetMipmap(O)),r&&C.end(w),e.isScene===!0&&e.onAfterRender(w,e,t),He.resetDefaultState(),ee=-1,k=null,S.pop(),S.length>0?(b=S[S.length-1],de===!0&&Fe.setGlobalState(w.clippingPlanes,b.state.camera)):b=null,x.pop(),y=x.length>0?x[x.length-1]:null};function it(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)b.pushLight(e),e.castShadow&&b.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ue.intersectsSprite(e)){r&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(pe);let t=Ae.update(e),i=e.material;i.visible&&y.push(e,t,i,n,he.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ue.intersectsObject(e))){let t=Ae.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),he.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),he.copy(e.boundingSphere.center)),he.applyMatrix4(e.matrixWorld).applyMatrix4(pe)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&st(i,t,n),a.length>0&&st(a,t,n),o.length>0&&st(o,t,n),Se.buffers.depth.setTest(!0),Se.buffers.depth.setMask(!0),Se.buffers.color.setMask(!0),Se.setPolygonOffset(!1)}function ot(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(b.state.transmissionRenderTarget[r.id]===void 0){let e=be.has(`EXT_color_buffer_half_float`)||be.has(`EXT_color_buffer_float`);b.state.transmissionRenderTarget[r.id]=new yk(1,1,{generateMipmaps:!0,type:e?nD:YE,minFilter:JE,samples:xe.samples,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ok.workingColorSpace})}let a=b.state.transmissionRenderTarget[r.id],o=r.viewport||A;a.setSize(o.z*w.transmissionResolutionScale,o.w*w.transmissionResolutionScale);let s=w.getRenderTarget(),c=w.getActiveCubeFace(),l=w.getActiveMipmapLevel();w.setRenderTarget(a),w.getClearColor(ne),M=w.getClearAlpha(),M<1&&w.setClearColor(16777215,.5),w.clear(),_e&&Le.render(n);let u=w.toneMapping;w.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),b.setupLightsView(r),de===!0&&Fe.setGlobalState(w.clippingPlanes,r),st(e,n,r),Te.updateMultisampleRenderTarget(a),Te.updateRenderTargetMipmap(a),be.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i0),d=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=0;r.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(m=w.toneMapping);let h=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=h===void 0?0:h.length,_=we.get(r),v=b.state.lights;if(de===!0&&(fe===!0||e!==k)){let t=e===k&&r.id===ee;Fe.setState(r,e,t)}let y=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==v.state.version?y=!0:_.outputColorSpace===s?i.isBatchedMesh&&_.batching===!1||!i.isBatchedMesh&&_.batching===!0||i.isBatchedMesh&&_.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&_.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&_.instancing===!1||!i.isInstancedMesh&&_.instancing===!0||i.isSkinnedMesh&&_.skinning===!1||!i.isSkinnedMesh&&_.skinning===!0||i.isInstancedMesh&&_.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&_.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&_.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&_.instancingMorph===!1&&i.morphTexture!==null?y=!0:_.envMap===c?r.fog===!0&&_.fog!==a||_.numClippingPlanes!==void 0&&(_.numClippingPlanes!==Fe.numPlanes||_.numIntersection!==Fe.numIntersection)?y=!0:_.vertexAlphas===l&&_.vertexTangents===u&&_.morphTargets===d&&_.morphNormals===f&&_.morphColors===p&&_.toneMapping===m?_.morphTargetsCount!==g&&(y=!0):y=!0:y=!0:y=!0:(y=!0,_.__version=r.version);let x=_.currentProgram;y===!0&&(x=lt(r,t,i));let S=!1,C=!1,T=!1,E=x.getUniforms(),D=_.uniforms;if(Se.useProgram(x.program)&&(S=!0,C=!0,T=!0),r.id!==ee&&(ee=r.id,C=!0),S||k!==e){Se.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),E.setValue(P,`projectionMatrix`,e.projectionMatrix),E.setValue(P,`viewMatrix`,e.matrixWorldInverse);let t=E.map.cameraPosition;t!==void 0&&t.setValue(P,me.setFromMatrixPosition(e.matrixWorld)),xe.logarithmicDepthBuffer&&E.setValue(P,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&E.setValue(P,`isOrthographic`,e.isOrthographicCamera===!0),k!==e&&(k=e,C=!0,T=!0)}if(_.needsLights&&(v.state.directionalShadowMap.length>0&&E.setValue(P,`directionalShadowMap`,v.state.directionalShadowMap,Te),v.state.spotShadowMap.length>0&&E.setValue(P,`spotShadowMap`,v.state.spotShadowMap,Te),v.state.pointShadowMap.length>0&&E.setValue(P,`pointShadowMap`,v.state.pointShadowMap,Te)),i.isSkinnedMesh){E.setOptional(P,i,`bindMatrix`),E.setOptional(P,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),E.setValue(P,`boneTexture`,e.boneTexture,Te))}i.isBatchedMesh&&(E.setOptional(P,i,`batchingTexture`),E.setValue(P,`batchingTexture`,i._matricesTexture,Te),E.setOptional(P,i,`batchingIdTexture`),E.setValue(P,`batchingIdTexture`,i._indirectTexture,Te),E.setOptional(P,i,`batchingColorTexture`),i._colorsTexture!==null&&E.setValue(P,`batchingColorTexture`,i._colorsTexture,Te));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&Re.update(i,n,x),(C||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,E.setValue(P,`receiveShadow`,i.receiveShadow)),r.isMeshGouraudMaterial&&r.envMap!==null&&(D.envMap.value=c,D.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1),r.isMeshStandardMaterial&&r.envMap===null&&t.environment!==null&&(D.envMapIntensity.value=t.environmentIntensity),D.dfgLUT!==void 0&&(D.dfgLUT.value=CR()),C&&(E.setValue(P,`toneMappingExposure`,w.toneMappingExposure),_.needsLights&&pt(D,T),a&&r.fog===!0&&Me.refreshFogUniforms(D,a),Me.refreshMaterialUniforms(D,r,ie,re,b.state.transmissionRenderTarget[e.id]),nL.upload(P,ut(_),D,Te)),r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(nL.upload(P,ut(_),D,Te),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&E.setValue(P,`center`,i.center),E.setValue(P,`modelViewMatrix`,i.modelViewMatrix),E.setValue(P,`normalMatrix`,i.normalMatrix),E.setValue(P,`modelMatrix`,i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,n=e.length;t0&&Te.useMultisampledRTT(e)===!1?we.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,A.copy(e.viewport),te.copy(e.scissor),j=e.scissorTest}else A.copy(se).multiplyScalar(ie).floor(),te.copy(ce).multiplyScalar(ie).floor(),j=le;if(n!==0&&(r=ht),Se.bindFramebuffer(P.FRAMEBUFFER,r)&&Se.drawBuffers(e,r),Se.viewport(A),Se.scissor(te),Se.setScissorTest(j),i){let r=we.get(e.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),P.readPixels(t,n,r,i,Ve.convert(c),Ve.convert(l),a))}finally{let e=O===null?null:we.get(O).__webglFramebuffer;Se.bindFramebuffer(P.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=we.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){Se.bindFramebuffer(P.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(!xe.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!xe.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.bufferData(P.PIXEL_PACK_BUFFER,a.byteLength,P.STREAM_READ),e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),P.readPixels(t,n,r,i,Ve.convert(l),Ve.convert(u),0);let f=O===null?null:we.get(O).__webglFramebuffer;Se.bindFramebuffer(P.FRAMEBUFFER,f);let p=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await CO(P,p,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,a),P.deleteBuffer(d),P.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;Te.setTexture2D(e,0),P.copyTexSubImage2D(P.TEXTURE_2D,n,0,0,o,s,i,a),Se.unbindTexture()};let gt=P.createFramebuffer(),_t=P.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=null){a===null&&(i===0?a=0:(SO(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),a=i,i=0));let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Ve.convert(t.format),_=Ve.convert(t.type),v;t.isData3DTexture?(Te.setTexture3D(t,0),v=P.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(Te.setTexture2DArray(t,0),v=P.TEXTURE_2D_ARRAY):(Te.setTexture2D(t,0),v=P.TEXTURE_2D),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,t.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,t.unpackAlignment);let y=P.getParameter(P.UNPACK_ROW_LENGTH),b=P.getParameter(P.UNPACK_IMAGE_HEIGHT),x=P.getParameter(P.UNPACK_SKIP_PIXELS),S=P.getParameter(P.UNPACK_SKIP_ROWS),C=P.getParameter(P.UNPACK_SKIP_IMAGES);P.pixelStorei(P.UNPACK_ROW_LENGTH,h.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,h.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,l),P.pixelStorei(P.UNPACK_SKIP_ROWS,u),P.pixelStorei(P.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=we.get(e),r=we.get(t),h=we.get(n.__renderTarget),g=we.get(r.__renderTarget);Se.bindFramebuffer(P.READ_FRAMEBUFFER,h.__webglFramebuffer),Se.bindFramebuffer(P.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{t[n*3]=e.x,t[n*3+1]=e.y,t[n*3+2]=e.z}),t}function ER(e,t){let n=[];return e.forEach((e,r)=>{let i=n=>{let i=e[n];if(i===void 0||!Number.isInteger(i)||i<0||i>=t)throw RangeError(`Face ${r} references vertex ${String(i)}, which is outside the ${t} available vertices`);return i};for(let t=1;te.indices),e.vertices.length);return t.setIndex(r),t.setAttribute(`position`,new YA(n,3)),t.computeVertexNormals(),new Q(t,new QN({color:30719,flatShading:!0,side:2}))}function OR(e){let t=new oj,n=TR(e.vertices),r=ER(e.faces.map(e=>e.vertexIndices),e.vertices.length);return t.setIndex(r),t.setAttribute(`position`,new YA(n,3)),t.computeVertexNormals(),new Q(t,new QN({color:52292,side:2}))}function kR(e){let t=new Z(e.point.x,e.point.y,e.point.z),n=new Z(e.xaxis.x,e.xaxis.y,e.xaxis.z),r=new Z(e.yaxis.x,e.yaxis.y,e.yaxis.z),i=new Z().crossVectors(n,r),a=new Yk;return a.makeBasis(n,r,i),a.setPosition(t),a}function AR(e){let t=new Float32Array(e.length*3);return e.forEach((e,n)=>{t[n*3]=e.x,t[n*3+1]=e.y,t[n*3+2]=e.z}),t}function jR(e){let t=new bj(e.xsize,e.ysize,e.zsize),n=kR(e.frame),r=new Q(t);return r.applyMatrix4(n),r}function MR(e,t,n){let r=new Q(new xM(e.radius,e.height,t,n)),i=kR(e.frame);return r.applyMatrix4(i),r}function NR(e,t){let n=new SM(e.radius,t),r=kR(e.frame),i=new Q(n);return i.applyMatrix4(r),i}function PR(e,t){let n=new Q(new wM(e.radius,e.height,t)),r=kR(e.frame);return n.applyMatrix4(r),n}function FR(e,t){let n=new Q(new CM(e.radius,e.radius,e.height,t)),r=kR(e.frame);return n.applyMatrix4(r),n}function IR(e){let t=new rF(1);t.setColors(new VA(16711680),new VA(65280),new VA(255));let n=kR(e);return t.applyMatrix4(n),t}function LR(e){let t=new Z(e.start.x,e.start.y,e.start.z),n=new Z(e.end.x,e.end.y,e.end.z);return new oM(new oj().setFromPoints([t,n]),new Qj({color:255}))}function RR(e){let t=new Z(e.point.x,e.point.y,e.point.z),n=new Z(e.normal.x,e.normal.y,e.normal.z),r=new Q(new JN(1,1),new GA({color:16711935,side:2}));r.position.copy(t);let i=new QO;return i.setFromUnitVectors(new Z(0,0,1),n),r.quaternion.copy(i),r}function zR(e){let t=new oj,n=new Float32Array([e.x,e.y,e.z]);return t.setAttribute(`position`,new YA(n,3)),new gM(t,new dM({size:.2,color:255}))}function BR(e){let t=new oj,n=AR(e.points);return t.setAttribute(`position`,new YA(n,3)),new gM(t,new dM({size:.2,color:16711935}))}function VR(e){let t=new oj,n=AR(e.points);return t.setAttribute(`position`,new YA(n,3)),new oM(t,new Qj({color:0}))}function HR(e,t=64,n=64){let r=new Q(new YN(e.radius,t,n)),i=kR(e.frame);return r.applyMatrix4(i),r}function UR(e,t=64,n=64){let r=new Q(new XN(e.radiusAxis,e.radiusPipe,t,n)),i=kR(e.frame);return r.applyMatrix4(i),r}function WR(e,t){let n=new Z(e.x,e.y,e.z),r=n.length();n.normalize();let i;i=t?new Z(t.x,t.y,t.z):new Z(0,0,0);let a=new nF(n,i,r,16711680);return a.setDirection(n),a}var GR=[tT,iT,yT,Uw,ST,OT,LT],KR=[UT,KT,YT,QT,tE,iE,pE,gE];function qR(e){return e===null?`null`:e===void 0?`undefined`:typeof e==`object`?e.constructor?.name||`object`:typeof e}var JR=class extends TypeError{objectType;constructor(e,t=`is not supported by the viewer`){let n=qR(e);super(`${n} ${t}`),this.name=`UnsupportedCompasObjectError`,this.objectType=n}};function YR(e){if(GR.some(t=>e instanceof t))throw new JR(e,`does not have an implemented renderer`);if(KR.some(t=>e instanceof t))throw new JR(e,`is data, not renderable scene geometry`);switch(!0){case e instanceof sT:return jR(e);case e instanceof uT:return MR(e,32,32);case e instanceof Qw:return NR(e,64);case e instanceof pT:return PR(e,64);case e instanceof gT:return FR(e,64);case e instanceof Yw:return IR(e);case e instanceof TT:return LR(e);case e instanceof jT:return RR(e);case e instanceof Dw:return zR(e);case e instanceof PT:return BR(e);case e instanceof BT:return VR(e);case e instanceof sE:return HR(e);case e instanceof uE:return UR(e);case e instanceof Kw:return WR(e);case e instanceof Bw:return DR(e);case e instanceof Pw:return OR(e)}throw new JR(e)}function XR(e){switch(e.type){case`standard_material`:return QR(e);case`line_material`:return $R(e);case`point_material`:return ez(e);case`physical_material`:return tz(e)}}function ZR(e){let t=e.replace(`#`,`0x`);return parseInt(t)}function QR(e){return new QN({color:ZR(e.color),metalness:e.metalness,roughness:e.roughness,emissive:ZR(e.emissive),emissiveIntensity:e.emissive_intensity,flatShading:e.flat_shading,wireframe:e.wireframe,side:2,transparent:e.transparent,opacity:e.opacity})}function $R(e){return new Qj({color:ZR(e.color)})}function ez(e){return new dM({color:ZR(e.color),size:e.size})}function tz(e){return new $N({color:ZR(e.color),metalness:e.metalness,roughness:e.roughness,emissive:ZR(e.emissive),emissiveIntensity:e.emissive_intensity,flatShading:e.flat_shading,wireframe:e.wireframe,side:2,anisotropy:e.anisotropy,anisotropyRotation:e.anisotropy_rotation,attenuationColor:ZR(e.attenuation_color),...e.attenuation_distance===void 0?{}:{attenuationDistance:e.attenuation_distance},clearcoat:e.clearcoat,clearcoatRoughness:e.clearcoat_roughness,dispersion:e.dispersion,ior:e.ior,iridescence:e.iridescence,iridescenceIOR:e.iridescence_ior,iridescenceThicknessRange:[e.iridescence_thickness_start,e.iridescence_thickness_end],reflectivity:e.reflectivity,sheen:e.sheen,sheenColor:ZR(e.sheen_color),specularColor:ZR(e.specular_color),sheenRoughness:e.sheen_roughness,specularIntensity:e.specular_intensity,thickness:e.thickness,transmission:e.transmission})}var nz=class e extends Q{constructor(){let t=e.SkyShader,n=new Oj({name:t.name,uniforms:Tj.clone(t.uniforms),vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,side:1,depthWrite:!1});super(new bj(1,1,1),n),this.isSky=!0}};nz.SkyShader={name:`SkyShader`,uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new Z},up:{value:new Z(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -4166,5 +4166,5 @@ void main() { #include #include - }`};function OR(e){switch(e.type){case`point_light`:return AR(e);case`spot_light`:return jR(e);case`rect_light`:return MR(e);case`sunlight`:return NR(e);case`sky`:return PR(e);case`ambient_light`:return IR(e)}}function kR(e){let t=e.replace(`#`,`0x`);return parseInt(t)}function AR(e){let t=new eP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.distance=e.distance,t.decay=e.decay,t.position.set(e.x,e.y,e.z),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,t}function jR(e){let t=new QN;t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.distance=e.distance,t.angle=e.angle,t.penumbra=e.penumbra,t.decay=e.decay,t.position.set(e.x,e.y,e.z),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02;let n=new qk;return n.position.set(e.tx,e.ty,e.tz),t.target=n,t}function MR(e){let t=new aP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.width=e.width,t.height=e.height,t.position.set(e.x,e.y,e.z),t.lookAt(e.tx,e.ty,e.tz),t}function NR(e){let t=new rP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.position.set(e.x,e.y,e.z),t.target.position.set(e.tx,e.ty,e.tz),t.castShadow=!0,t}function PR(e){let t=new DR;t.scale.setScalar(1e3),FR(t,`up`,new Z(0,0,1)),FR(t,`turbidity`,e.turbidity),FR(t,`rayleigh`,e.rayleigh),FR(t,`mieCoefficient`,e.mie_coefficient),FR(t,`mieDirectionalG`,e.mie_directional_g);let n=new Z,r=SO.degToRad(90-e.elevation),i=SO.degToRad(e.azimuth);return n.setFromSphericalCoords(1,r,i),FR(t,`sunPosition`,n),t}function FR(e,t,n){let r=e.material.uniforms[t];if(!r)throw Error(`The Three.js Sky shader has no "${t}" uniform`);r.value=n}function IR(e){let t=new iP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t}var LR=class extends Error{code;details;constructor(e,t,n={}){super(t,{cause:n.cause}),this.name=`CompasViewerError`,this.code=e,this.details=n.details}};function RR(e,t,n,r){return e instanceof LR?e:new LR(t,n,{cause:e,...r===void 0?{}:{details:r}})}var zR=new Set([`background_color`,`controls_damping`,`world_axis`,`picker`,`camera_fov`,`camera_zoom`,`camera_position`,`camera_target`,`camera_view`,`show_edges`]),BR=new Set([`button`,`load_json_button`,`slider`,`number_field`,`checkbox`,`select`]),VR=new Set([`remove`,`set_visibility`,`toggle_visibility`]),HR=new Set([`standard_material`,`line_material`,`point_material`,`physical_material`]),UR=new Set([`point_light`,`spot_light`,`rect_light`,`sunlight`,`sky`,`ambient_light`]),WR=new Set([`top`,`bottom`,`front`,`back`,`left`,`right`,`front_left`,`front_right`,`back_left`,`back_right`]);function GR(e){let t=qR(e,`dispatch`);switch(t){case`material`:return ez(e),e;case`light`:return tz(e),e;case`object_action`:return oz(e),e;case`scene`:return nz(e),e;case`theme`:return $R(e,`mode`,new Set([`light`,`dark`])),e;case`ui`:return rz(e),e;case`text`:return $R(e,`type`,new Set([`text_geometry`])),iz(e),e;case`text_tag`:return az(e),e;case`object_infos`:return e;case`handle_geometry`:return sz(e),e;default:throw new LR(`unsupported_message`,`Unsupported viewer dispatch: ${t}`,{details:{dispatch:t}})}}function KR(e){let t=e.geometry_guid??e.geometryBackendGuid;return(typeof t!=`string`||t.length===0)&&uz(e,`geometry_guid`,`a non-empty geometry GUID (geometry_guid or geometryBackendGuid)`),t}function qR(e,t){let n=e[t];return typeof n!=`string`&&uz(e,t,`a string`),n}function JR(e,t){let n=qR(e,t);return n.length===0&&uz(e,t,`a non-empty string`),n}function YR(e,t){let n=e[t];if(n!=null)return typeof n!=`string`&&uz(e,t,`a string`),n}function XR(e,t){let n=e[t];return(typeof n!=`number`||!Number.isFinite(n))&&uz(e,t,`a finite number`),n}function ZR(e,t){let n=e[t];return typeof n!=`boolean`&&uz(e,t,`a boolean`),n}function QR(e,t){let n=e[t];return(!Array.isArray(n)||!n.every(e=>typeof e==`string`))&&uz(e,t,`an array of strings`),n}function $R(e,t,n){let r=qR(e,t);if(!n.has(r))throw new LR(`unsupported_message`,`Unsupported ${dz(e)} ${t}: ${r}`,{details:{dispatch:e.dispatch,field:t,value:r}});return r}function ez(e){let t=$R(e,`type`,HR);if(JR(e,`guid`),KR(e),qR(e,`color`),t!==`line_material`){if(t===`point_material`){XR(e,`size`);return}if(cz(e,[`metalness`,`roughness`,`emissive_intensity`]),qR(e,`emissive`),lz(e,[`flat_shading`,`wireframe`]),t===`standard_material`){ZR(e,`transparent`),XR(e,`opacity`);return}cz(e,[`anisotropy`,`anisotropy_rotation`,`clearcoat`,`clearcoat_roughness`,`dispersion`,`ior`,`iridescence`,`iridescence_ior`,`iridescence_thickness_start`,`iridescence_thickness_end`,`reflectivity`,`sheen`,`sheen_roughness`,`specular_intensity`,`thickness`,`transmission`]),e.attenuation_distance!==void 0&&XR(e,`attenuation_distance`);for(let t of[`attenuation_color`,`sheen_color`,`specular_color`])qR(e,t)}}function tz(e){let t=$R(e,`type`,UR);if(JR(e,`guid`),t===`sky`){cz(e,[`turbidity`,`rayleigh`,`mie_coefficient`,`mie_directional_g`,`elevation`,`azimuth`]);return}qR(e,`color`),XR(e,`intensity`),t!==`ambient_light`&&(cz(e,[`x`,`y`,`z`]),t===`point_light`?cz(e,[`distance`,`decay`]):t===`spot_light`?cz(e,[`distance`,`decay`,`angle`,`penumbra`,`tx`,`ty`,`tz`]):(cz(e,[`tx`,`ty`,`tz`]),t===`rect_light`&&cz(e,[`width`,`height`])))}function nz(e){switch($R(e,`type`,zR)){case`background_color`:qR(e,`color`);break;case`controls_damping`:ZR(e,`damping`);break;case`world_axis`:case`show_edges`:ZR(e,`show`);break;case`picker`:ZR(e,`enabled`);break;case`camera_fov`:XR(e,`fov`);break;case`camera_zoom`:XR(e,`zoom`);break;case`camera_position`:case`camera_target`:cz(e,[`x`,`y`,`z`]);break;case`camera_view`:$R(e,`preset`,WR)}}function rz(e){let t=$R(e,`type`,BR);switch(JR(e,`guid`),YR(e,`label`),t){case`button`:case`load_json_button`:qR(e,`text`),qR(e,`variant`);break;case`slider`:cz(e,[`min`,`max`,`step`,`default_value`]);break;case`number_field`:cz(e,[`min`,`max`,`step`,`value`]);break;case`checkbox`:qR(e,`text`),ZR(e,`default_value`);break;case`select`:QR(e,`options`),YR(e,`placeholder`),YR(e,`default_value`)}}function iz(e){JR(e,`guid`),qR(e,`text`),YR(e,`font`),YR(e,`weight`),cz(e,[`size`,`depth`,`direction_x`,`direction_y`,`direction_z`,`up_x`,`up_y`,`up_z`,`point_x`,`point_y`,`point_z`]),ZR(e,`centered`)}function az(e){JR(e,`guid`),qR(e,`text`),YR(e,`color`),cz(e,[`x`,`y`,`z`])}function oz(e){JR(e,`guid`),qR(e,`type`),JR(e,`object_guid`),YR(e,`label`),YR(e,`text`),YR(e,`placeholder`),e.options!==void 0&&QR(e,`options`)}function sz(e){let t=$R(e,`type`,VR);JR(e,`guid`),t===`set_visibility`&&ZR(e,`visible`)}function cz(e,t){for(let n of t)XR(e,n)}function lz(e,t){for(let n of t)ZR(e,n)}function uz(e,t,n){throw new LR(`invalid_message`,`Invalid ${dz(e)} command: ${t} must be ${n}`,{details:{dispatch:e.dispatch,field:t,value:e[t]}})}function dz(e){return typeof e.dispatch==`string`?e.dispatch:`viewer`}function fz(){return{objectBarData:Kt({title:`Object Infos`,isVisible:!1,data:null}),objectActionsState:Kt([]),sideBarInfoState:Kt({title:`Sidebar Infos`,isVisible:!1,data:null}),sidebarComponents:Kt([]),pickerEnabled:Kt({value:!0}),pickerMode:Kt({value:`translate`}),blockPicker:Kt({value:!1}),showEdges:Kt({value:!1}),theme:Kt({value:`light`})}}var pz={type:`change`},mz={type:`start`},hz={type:`end`},gz=new yk,_z=new vj,vz=Math.cos(70*SO.DEG2RAD),yz=new Z,bz=2*Math.PI,xz={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Sz=1e-6,Cz=class extends AP{constructor(e,t=null){super(e,t),this.state=xz.NONE,this.target=new Z,this.cursor=new Z,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:lE.ROTATE,MIDDLE:lE.DOLLY,RIGHT:lE.PAN},this.touches={ONE:uE.ROTATE,TWO:uE.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new Z,this._lastQuaternion=new CO,this._lastTargetPosition=new Z,this._quat=new CO().setFromUnitVectors(e.up,new Z(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new CP,this._sphericalDelta=new CP,this._scale=1,this._panOffset=new Z,this._rotateStart=new X,this._rotateEnd=new X,this._rotateDelta=new X,this._panStart=new X,this._panEnd=new X,this._panDelta=new X,this._dollyStart=new X,this._dollyEnd=new X,this._dollyDelta=new X,this._dollyDirection=new Z,this._mouse=new X,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Tz.bind(this),this._onPointerDown=wz.bind(this),this._onPointerUp=Ez.bind(this),this._onContextMenu=Nz.bind(this),this._onMouseWheel=kz.bind(this),this._onKeyDown=Az.bind(this),this._onTouchStart=jz.bind(this),this._onTouchMove=Mz.bind(this),this._onMouseDown=Dz.bind(this),this._onMouseMove=Oz.bind(this),this._interceptControlDown=Pz.bind(this),this._interceptControlUp=Fz.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(pz),this.update(),this.state=xz.NONE}update(e=null){let t=this.object.position;yz.copy(t).sub(this.target),yz.applyQuaternion(this._quat),this._spherical.setFromVector3(yz),this.autoRotate&&this.state===xz.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=bz:n>Math.PI&&(n-=bz),r<-Math.PI?r+=bz:r>Math.PI&&(r-=bz),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(yz.setFromSpherical(this._spherical),yz.applyQuaternion(this._quatInverse),t.copy(this.target).add(yz),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=yz.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new Z(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new Z(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=yz.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(gz.origin.copy(this.object.position),gz.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(gz.direction))Sz||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Sz||this._lastTargetPosition.distanceToSquared(this.target)>Sz?(this.dispatchEvent(pz),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?bz/60/60*this.autoRotateSpeed:bz/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){yz.setFromMatrixColumn(t,0),yz.multiplyScalar(-e),this._panOffset.add(yz)}_panUp(e,t){this.screenSpacePanning===!0?yz.setFromMatrixColumn(t,1):(yz.setFromMatrixColumn(t,0),yz.crossVectors(this.object.up,yz)),yz.multiplyScalar(e),this._panOffset.add(yz)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;yz.copy(r).sub(this.target);let i=yz.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(bz*this._rotateDelta.x/t.clientHeight),this._rotateUp(bz*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(bz*this._rotateDelta.x/t.clientHeight),this._rotateUp(bz*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t.9&&(r.visible=!1)),this.axis===`Y`&&(zz.setFromEuler(Qz.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(zz),Math.abs($z.copy(sB).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(zz.setFromEuler(Qz.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(zz),Math.abs($z.copy(cB).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(zz.setFromEuler(Qz.set(0,Math.PI/2,0)),$z.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(tB.lookAt(eB,$z,sB)),r.quaternion.multiply(zz),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),Lz.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Lz.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Lz),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));continue}if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs($z.copy(oB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs($z.copy(sB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs($z.copy(cB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs($z.copy(cB).applyQuaternion(t).dot(this.eye))=-1&&xB.z<=1&&e.layers.test(r.layers)===!0,l=e.element;l.style.display=c===!0?``:`none`,c===!0&&(e.onBeforeRender(t,n,r),l.style.transform=`translate(`+-100*e.center.x+`%,`+-100*e.center.y+`%)translate(`+(xB.x*i+i)+`px,`+(-xB.y*a+a)+`px)`,l.parentNode!==s&&s.appendChild(l),e.onAfterRender(t,n,r));let d={distanceToCameraSquared:u(r,e)};o.objects.set(e,d)}for(let t=0,i=e.children.length;tthis.resize();onPointerDown=e=>this.pickFromPointer(e);onKeyDown=e=>this.handleKeyDown(e);animationFrame=null;attachedContainer=null;componentId=0;disposed=!1;pickedObject=null;pickedMaterial=null;highlightMaterial=new CN({color:`orange`,emissive:`yellow`,emissiveIntensity:.1});constructor(e,t){this.root=e,this.options=t;let{width:n,height:r}=this.getDimensions();this.camera=new ij(60,n/r,.1,1e3),this.camera.up.set(0,0,1),this.camera.position.set(8,-15,15),this.camera.layers.enable(1),this.renderer=new YL({antialias:!0}),this.renderer.domElement.tabIndex=0,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.toneMapping=4,this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=2,this.renderer.toneMappingExposure=2.5,this.renderer.outputColorSpace=MD,this.controls=new Cz(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:lE.ROTATE},this.transformControls=new Gz(this.camera,this.renderer.domElement),this.transformHelper=this.transformControls.getHelper(),this.transformControls.addEventListener(`dragging-changed`,e=>{this.controls.enabled=!e.value}),this.scene.add(this.transformHelper),this.labelRenderer.domElement.style.position=`absolute`,this.labelRenderer.domElement.style.inset=`0`,this.labelRenderer.domElement.style.pointerEvents=`none`,this.scene.add(this.axesHelper),this.applyTheme(`light`),this.resize(),this.connection=new cE({...t.websocket,...t.send===void 0?{}:{send:t.send},dispatch:e=>this.dispatch(e),onError:e=>this.reportAsyncError(RR(e,`connection_error`,`The viewer WebSocket connection failed`))})}attach(e){if(this.assertUsable(),this.attachedContainer!==e){if(this.attachedContainer=e,e.append(this.renderer.domElement,this.labelRenderer.domElement),window.addEventListener(`resize`,this.onResize),this.renderer.domElement.addEventListener(`mousedown`,this.onPointerDown),this.root.addEventListener(`keydown`,this.onKeyDown),this.options.defaultLighting&&this.addDefaultLighting(),(this.options.mode??`embedded`)===`websocket`)try{this.connection.start()}catch(e){this.reportOrThrow(RR(e,`connection_error`,`Unable to start the viewer WebSocket connection`))}this.startAnimation(),this.resize()}}dispatch(e){this.assertUsable();let t;try{t=sE(e)}catch(e){this.reportOrThrow(RR(e,`decode_error`,`Unable to decode the COMPAS Protobuf message`));return}try{this.dispatchObject(t)}catch(e){let t=e instanceof yR?new LR(`unsupported_message`,e.message,{cause:e,details:{objectType:e.objectType}}):RR(e,`render_error`,`Unable to apply the viewer message`);this.reportOrThrow(t)}}send(e){return this.connection.send(e)}sendData(e){return this.send(e)}handleUiAction(e,t){this.sendData({dispatch:`ui_callback`,action:e,value:t??null})}handleObjectAction(e,t){this.sendData({dispatch:`object_action_callback`,action_guid:e.guid,object_guid:e.objectGuid,value:t??null})}hideObjectInfo(){this.store.objectBarData.isVisible=!1}setTransformMode(e){this.store.pickerMode.value=e,this.transformControls.setMode(e)}toggleTheme(){this.applyTheme(this.store.theme.value===`dark`?`light`:`dark`)}setCameraViewPreset(e){let t=DB[e].clone().normalize(),n=this.camera.position.distanceTo(this.controls.target);this.camera.position.copy(this.controls.target.clone().add(t.multiplyScalar(n))),this.controls.update()}captureCurrentView(e){return{id:`view-${Date.now()}`,name:e,cameraPosition:this.vectorData(this.camera.position),target:this.vectorData(this.controls.target),zoom:this.camera.zoom,fov:this.camera.fov}}applySavedView(e){this.camera.position.set(e.cameraPosition.x,e.cameraPosition.y,e.cameraPosition.z),this.controls.target.set(e.target.x,e.target.y,e.target.z),this.camera.zoom=e.zoom,this.camera.fov=e.fov,this.camera.updateProjectionMatrix(),this.controls.update()}saveCurrentCanvasImage(e={}){let t=e.format??`png`,n=t===`jpg`?`image/jpeg`:`image/${t}`,r=t,i=Math.max(16,Math.round(e.width??this.renderer.domElement.width)),a=Math.max(16,Math.round(e.height??this.renderer.domElement.height));this.controls.update(),this.renderer.render(this.scene,this.camera);let o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s)throw Error(`Unable to create screenshot canvas context`);t===`jpg`&&(s.fillStyle=`#ffffff`,s.fillRect(0,0,i,a)),s.drawImage(this.renderer.domElement,0,0,i,a);let c=document.createElement(`a`);c.download=e.fileName??`compas-view-${Date.now()}.${r}`,c.href=o.toDataURL(n,e.quality),c.click()}reset(){this.clearPickedObject();for(let e of this.geometries.values())this.scene.remove(e),this.disposeObject(e);this.geometries.clear(),this.clearLights();for(let e of this.materials.values())e.material.dispose();this.materials.clear(),this.geometryMaterials.clear(),this.store.sidebarComponents.splice(0),this.store.objectActionsState.splice(0),this.store.objectBarData.data=null,this.store.objectBarData.isVisible=!1,this.store.sideBarInfoState.data=null,this.store.sideBarInfoState.isVisible=!1}resize(){if(this.disposed)return;let{width:e,height:t}=this.getDimensions();this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.labelRenderer.setSize(e,t)}dispose(){this.disposed||(this.disposed=!0,this.connection.dispose(),window.removeEventListener(`resize`,this.onResize),this.root.removeEventListener(`keydown`,this.onKeyDown),this.renderer.domElement.removeEventListener(`mousedown`,this.onPointerDown),this.animationFrame!==null&&cancelAnimationFrame(this.animationFrame),this.animationFrame=null,this.clearPickedObject(),this.resetAfterDispose(),this.controls.dispose(),this.transformControls.detach(),this.scene.remove(this.transformHelper),this.highlightMaterial.dispose(),this.renderer.dispose(),this.renderer.domElement.remove(),this.labelRenderer.domElement.remove(),this.attachedContainer=null)}dispatchObject(e){if(Array.isArray(e)){e.forEach(e=>this.dispatchObject(e));return}if(!e||typeof e!=`object`)return;let t=e;typeof t.dispatch==`string`?this.dispatchCommand(GR(t)):t.bytes instanceof Uint8Array?this.manageGeometry(t):Object.values(t).forEach(e=>this.dispatchObject(e))}dispatchCommand(e){switch(e.dispatch){case`material`:this.manageMaterial(e);break;case`light`:this.manageLight(e);break;case`scene`:this.manageScene(e);break;case`theme`:this.applyTheme(e.mode);break;case`ui`:this.manageUi(e);break;case`text`:this.manageText(e).catch(t=>this.reportAsyncError(RR(t,`render_error`,`Unable to create text geometry`,{dispatch:e.dispatch,guid:e.guid})));break;case`text_tag`:this.manageTextTag(e);break;case`object_infos`:this.store.objectBarData.data=this.withoutDispatch(e);break;case`object_action`:this.manageObjectAction(e);break;case`handle_geometry`:this.handleGeometry(e)}}manageGeometry(e){let t=JR(e,`guid`),n=bR(e),r=this.geometries.get(t);if(r&&(this.scene.remove(r),this.disposeObject(r)),this.applyGeometryMaterial(t,n),this.scene.add(n),this.geometries.set(t,n),this.store.showEdges.value&&n instanceof Q){let e=new Fj(new tM(n.geometry),new Cj({color:0}));e.layers.set(1),n.add(e)}}manageMaterial(e){let t=e.guid,n=KR(e),r=xR(e);this.materials.get(t)?.material.dispose(),this.materials.set(t,{material:r,materialType:e.type}),this.geometryMaterials.set(n,t);let i=this.geometries.get(n);i&&this.assignMaterial(i,r)}manageLight(e){let t=e.guid,n=OR(e);this.removeLight(t);let r=[n];n instanceof DR?r.push(new rP(16777215,1),new iP(16777215,.6)):n instanceof QN&&r.push(n.target),r.forEach(e=>this.scene.add(e)),this.lights.set(t,{objects:r})}manageScene(e){switch(e.type){case`background_color`:this.scene.background=new fA(e.color);break;case`controls_damping`:this.controls.enableDamping=e.damping;break;case`world_axis`:this.axesHelper.visible=e.show;break;case`picker`:this.store.pickerEnabled.value=e.enabled;break;case`camera_fov`:this.camera.fov=e.fov,this.camera.updateProjectionMatrix();break;case`camera_zoom`:this.camera.zoom=e.zoom,this.camera.updateProjectionMatrix();break;case`camera_position`:this.camera.position.set(e.x,e.y,e.z),this.controls.update();break;case`camera_target`:this.controls.target.set(e.x,e.y,e.z),this.controls.update();break;case`camera_view`:this.setCameraViewPreset(e.preset);break;case`show_edges`:this.store.showEdges.value=e.show}}manageUi(e){let t={id:++this.componentId,action:e.guid,...e.label===void 0?{}:{label:e.label}},n;switch(e.type){case`button`:case`load_json_button`:n={...t,component:e.type===`button`?`Button`:`LoadJsonButton`,props:{text:e.text,variant:e.variant}};break;case`slider`:n={...t,component:`Slider`,props:{min:e.min,max:e.max,step:e.step,defaultValue:[e.default_value]}};break;case`number_field`:n={...t,component:`NumberField`,props:{min:e.min,max:e.max,step:e.step,value:e.value}};break;case`checkbox`:n={...t,component:`Checkbox`,props:{text:e.text,defaultValue:e.default_value}};break;case`select`:n={...t,component:`Select`,props:{options:e.options,...e.placeholder===void 0?{}:{placeholder:e.placeholder},...e.default_value===void 0?{}:{defaultValue:e.default_value}}}}this.store.sidebarComponents.push(n),this.store.sideBarInfoState.isVisible=!0}manageObjectAction(e){this.store.objectActionsState.push({guid:e.guid,type:e.type,objectGuid:e.object_guid,...e.label===void 0?{}:{label:e.label},...e.text===void 0?{}:{text:e.text},...e.options===void 0?{}:{options:e.options},...e.placeholder===void 0?{}:{placeholder:e.placeholder},...e.default_value===void 0?{}:{defaultValue:e.default_value}})}pickFromPointer(e){if(this.renderer.domElement.focus({preventScroll:!0}),e.button!==0||!this.store.pickerEnabled.value||this.store.blockPicker.value||this.transformControls.dragging)return;let t=this.renderer.domElement.getBoundingClientRect();if(!t.width||!t.height)return;let n=new X((e.clientX-t.left)/t.width*2-1,-((e.clientY-t.top)/t.height)*2+1);this.raycaster.layers.set(0),this.raycaster.setFromCamera(n,this.camera);let r=Array.from(this.geometries.values()).filter(e=>e.visible),i=this.raycaster.intersectObjects(r,!0)[0]?.object??null;if(!i){this.clearPickedObject();return}if(this.clearPickedObject(),this.pickedObject=i,`material`in i){let e=i;this.pickedMaterial=e.material??null,e.material=this.highlightMaterial}this.transformControls.attach(i);let a=this.findGeometryGuid(i);a&&this.sendData({dispatch:`object_picked`,guid:a})}clearPickedObject(){this.pickedObject&&this.pickedMaterial&&`material`in this.pickedObject&&(this.pickedObject.material=this.pickedMaterial),this.pickedObject=null,this.pickedMaterial=null,this.transformControls.detach(),this.store.objectBarData.data=null,this.store.objectActionsState.splice(0)}findGeometryGuid(e){let t=e;for(;t;){for(let[e,n]of this.geometries)if(n===t)return e;t=t.parent}}handleKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?this.clearPickedObject():e.key.toLowerCase()===`p`?this.store.pickerEnabled.value=!this.store.pickerEnabled.value:e.key.toLowerCase()===`i`&&(this.store.objectBarData.isVisible=!this.store.objectBarData.isVisible))}manageTextTag(e){let t=e.guid,n=document.createElement(`div`);n.className=`text-tag`,n.textContent=e.text,e.color&&(n.style.color=e.color);let r=new bB(n);r.position.set(e.x,e.y,e.z);let i=this.geometries.get(t);i&&this.scene.remove(i),this.scene.add(r),this.geometries.set(t,r)}async manageText(e){let t=`${e.font??`helvetiker`}_${e.weight??`regular`}`,n=this.fonts.get(t);n||(n=await new gB().loadAsync(`/fonts/${t}.typeface.json`),this.fonts.set(t,n));let r=new hB(e.text,{font:n,size:e.size,depth:e.depth});if(e.centered){r.computeBoundingBox();let e=r.boundingBox;e&&r.translate(-.5*(e.max.x-e.min.x),0,0)}let i=new Z(e.direction_x,e.direction_y,e.direction_z).normalize(),a=new Z(e.up_x,e.up_y,e.up_z).normalize(),o=new Z().crossVectors(i,a).normalize(),s=new bk().makeBasis(i,a,o);s.setPosition(e.point_x,e.point_y,e.point_z);let c=e.guid,l=this.geometryMaterials.get(c),u=new Q(r,l?this.materials.get(l)?.material:new CN({color:65535,side:2}));u.applyMatrix4(s);let d=this.geometries.get(c);d&&(this.scene.remove(d),this.disposeObject(d)),this.scene.add(u),this.geometries.set(c,u)}handleGeometry(e){let t=e.guid,n=this.geometries.get(t);n&&(e.type===`remove`?(this.scene.remove(n),this.disposeObject(n),this.geometries.delete(t),this.geometryMaterials.delete(t)):e.type===`set_visibility`?n.visible=e.visible:e.type===`toggle_visibility`&&(n.visible=!n.visible))}applyGeometryMaterial(e,t){let n=this.geometryMaterials.get(e),r=n?this.materials.get(n)?.material:void 0;r?this.assignMaterial(t,r):t instanceof Q?t.material=new CN({color:37586,roughness:.7,metalness:.05}):t instanceof jj?t.material=new Cj({color:37586}):t instanceof Vj?t.material=new Ij({color:37586,size:.5}):t instanceof DP&&t.setColor(37586)}assignMaterial(e,t){e instanceof Q?e.material=t:e instanceof jj?e.material=t instanceof Cj?t:new Cj({color:this.materialColor(t)}):e instanceof Vj?e.material=t instanceof Ij?t:new Ij({color:this.materialColor(t),size:.5}):e instanceof DP&&e.setColor(this.materialColor(t))}materialColor(e){return`color`in e&&e.color instanceof fA?e.color:new fA(37586)}applyTheme(e){this.store.theme.value=e,this.scene.background=new fA(e===`dark`?0:15132390)}addDefaultLighting(){if(this.defaultLights.length)return;let e=new rP(16777215,1);e.position.set(30,-10,30);let t=new rP(16777215,.5);t.position.set(-30,-20,30);let n=new rP(16777215,.5);n.position.set(-30,20,10);let r=[e,t,n,new iP(16777215,.5)];r.forEach(e=>this.scene.add(e)),this.defaultLights.push(...r)}removeLight(e){let t=this.lights.get(e);t&&(t.objects.forEach(e=>this.scene.remove(e)),this.lights.delete(e))}clearLights(){for(let e of this.lights.keys())this.removeLight(e)}startAnimation(){if(this.animationFrame!==null)return;let e=()=>{this.disposed||(this.animationFrame=requestAnimationFrame(e),this.controls.update(),this.renderer.render(this.scene,this.camera),this.labelRenderer.render(this.scene,this.camera))};e()}getDimensions(){let e=this.root.getBoundingClientRect();return{width:Math.max(1,Math.round(e.width||this.root.clientWidth||window.innerWidth)),height:Math.max(1,Math.round(e.height||this.root.clientHeight||window.innerHeight))}}disposeObject(e){e.traverse(e=>{let t=e;t.geometry?.dispose(),Array.isArray(t.material)?t.material.forEach(e=>this.disposeUnregisteredMaterial(e)):this.disposeUnregisteredMaterial(t.material)})}disposeUnregisteredMaterial(e){e&&!Array.from(this.materials.values()).some(t=>t.material===e)&&e!==this.highlightMaterial&&e.dispose()}resetAfterDispose(){for(let e of this.geometries.values())this.disposeObject(e);this.geometries.clear(),this.clearLights(),this.materials.clear(),this.geometryMaterials.clear()}vectorData(e){return{x:e.x,y:e.y,z:e.z}}withoutDispatch(e){let{dispatch:t,...n}=e;return n}reportOrThrow(e){if(this.options.onError)this.options.onError(e);else throw e}reportAsyncError(e){this.options.onError?this.options.onError(e):console.error(e)}assertUsable(){if(this.disposed)throw new LR(`lifecycle_error`,`The COMPAS viewer has been disposed`)}};function kB(e,t={}){if(typeof HTMLElement>`u`||!(e instanceof HTMLElement))throw new LR(`lifecycle_error`,`createViewer requires an HTMLElement container`);let n=nn(new OB(e,t)),r=hu(xx,{runtime:n,showToolbar:t.showToolbar??!0});r.provide(iy,n),r.mount(e);let i=!1;return{dispatch(e){n.dispatch(e)},reset(){n.reset()},resize(){n.resize()},dispose(){i||(i=!0,r.unmount(),n.dispose())}}}var AB=document.querySelector(`#app`);if(!AB)throw Error(`Standalone viewer requires an #app container`);kB(AB,{mode:`websocket`,showToolbar:!0}); \ No newline at end of file + }`};function rz(e){switch(e.type){case`point_light`:return az(e);case`spot_light`:return oz(e);case`rect_light`:return sz(e);case`sunlight`:return cz(e);case`sky`:return lz(e);case`ambient_light`:return dz(e)}}function iz(e){let t=e.replace(`#`,`0x`);return parseInt(t)}function az(e){let t=new kP;return t.color.setHex(iz(e.color)),t.intensity=e.intensity,t.distance=e.distance,t.decay=e.decay,t.position.set(e.x,e.y,e.z),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,t}function oz(e){let t=new DP;t.color.setHex(iz(e.color)),t.intensity=e.intensity,t.distance=e.distance,t.angle=e.angle,t.penumbra=e.penumbra,t.decay=e.decay,t.position.set(e.x,e.y,e.z),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02;let n=new SA;return n.position.set(e.tx,e.ty,e.tz),t.target=n,t}function sz(e){let t=new PP;return t.color.setHex(iz(e.color)),t.intensity=e.intensity,t.width=e.width,t.height=e.height,t.position.set(e.x,e.y,e.z),t.lookAt(e.tx,e.ty,e.tz),t}function cz(e){let t=new MP;return t.color.setHex(iz(e.color)),t.intensity=e.intensity,t.position.set(e.x,e.y,e.z),t.target.position.set(e.tx,e.ty,e.tz),t.castShadow=!0,t}function lz(e){let t=new nz;t.scale.setScalar(1e3),uz(t,`up`,new Z(0,0,1)),uz(t,`turbidity`,e.turbidity),uz(t,`rayleigh`,e.rayleigh),uz(t,`mieCoefficient`,e.mie_coefficient),uz(t,`mieDirectionalG`,e.mie_directional_g);let n=new Z,r=ZO.degToRad(90-e.elevation),i=ZO.degToRad(e.azimuth);return n.setFromSphericalCoords(1,r,i),uz(t,`sunPosition`,n),t}function uz(e,t,n){let r=e.material.uniforms[t];if(!r)throw Error(`The Three.js Sky shader has no "${t}" uniform`);r.value=n}function dz(e){let t=new NP;return t.color.setHex(iz(e.color)),t.intensity=e.intensity,t}var fz=class extends Error{code;details;constructor(e,t,n={}){super(t,{cause:n.cause}),this.name=`CompasViewerError`,this.code=e,this.details=n.details}};function pz(e,t,n,r){return e instanceof fz?e:new fz(t,n,{cause:e,...r===void 0?{}:{details:r}})}var mz=new Set([`background_color`,`controls_damping`,`world_axis`,`picker`,`camera_fov`,`camera_zoom`,`camera_position`,`camera_target`,`camera_view`,`show_edges`]),hz=new Set([`button`,`load_json_button`,`slider`,`number_field`,`checkbox`,`select`]),gz=new Set([`remove`,`set_visibility`,`toggle_visibility`]),_z=new Set([`standard_material`,`line_material`,`point_material`,`physical_material`]),vz=new Set([`point_light`,`spot_light`,`rect_light`,`sunlight`,`sky`,`ambient_light`]),yz=new Set([`top`,`bottom`,`front`,`back`,`left`,`right`,`front_left`,`front_right`,`back_left`,`back_right`]);function bz(e){let t=Sz(e,`dispatch`);switch(t){case`material`:return kz(e),e;case`light`:return Az(e),e;case`object_action`:return Fz(e),e;case`scene`:return jz(e),e;case`theme`:return Oz(e,`mode`,new Set([`light`,`dark`])),e;case`ui`:return Mz(e),e;case`text`:return Oz(e,`type`,new Set([`text_geometry`])),Nz(e),e;case`text_tag`:return Pz(e),e;case`object_infos`:return e;case`handle_geometry`:return Iz(e),e;case`spinner`:return Lz(e),e;default:throw new fz(`unsupported_message`,`Unsupported viewer dispatch: ${t}`,{details:{dispatch:t}})}}function xz(e){let t=e.geometry_guid??e.geometryBackendGuid;return(typeof t!=`string`||t.length===0)&&Bz(e,`geometry_guid`,`a non-empty geometry GUID (geometry_guid or geometryBackendGuid)`),t}function Sz(e,t){let n=e[t];return typeof n!=`string`&&Bz(e,t,`a string`),n}function Cz(e,t){let n=Sz(e,t);return n.length===0&&Bz(e,t,`a non-empty string`),n}function wz(e,t){let n=e[t];if(n!=null)return typeof n!=`string`&&Bz(e,t,`a string`),n}function Tz(e,t){let n=e[t];return(typeof n!=`number`||!Number.isFinite(n))&&Bz(e,t,`a finite number`),n}function Ez(e,t){let n=e[t];return typeof n!=`boolean`&&Bz(e,t,`a boolean`),n}function Dz(e,t){let n=e[t];return(!Array.isArray(n)||!n.every(e=>typeof e==`string`))&&Bz(e,t,`an array of strings`),n}function Oz(e,t,n){let r=Sz(e,t);if(!n.has(r))throw new fz(`unsupported_message`,`Unsupported ${Vz(e)} ${t}: ${r}`,{details:{dispatch:e.dispatch,field:t,value:r}});return r}function kz(e){let t=Oz(e,`type`,_z);if(Cz(e,`guid`),xz(e),Sz(e,`color`),t!==`line_material`){if(t===`point_material`){Tz(e,`size`);return}if(Rz(e,[`metalness`,`roughness`,`emissive_intensity`]),Sz(e,`emissive`),zz(e,[`flat_shading`,`wireframe`]),t===`standard_material`){Ez(e,`transparent`),Tz(e,`opacity`);return}Rz(e,[`anisotropy`,`anisotropy_rotation`,`clearcoat`,`clearcoat_roughness`,`dispersion`,`ior`,`iridescence`,`iridescence_ior`,`iridescence_thickness_start`,`iridescence_thickness_end`,`reflectivity`,`sheen`,`sheen_roughness`,`specular_intensity`,`thickness`,`transmission`]),e.attenuation_distance!==void 0&&Tz(e,`attenuation_distance`);for(let t of[`attenuation_color`,`sheen_color`,`specular_color`])Sz(e,t)}}function Az(e){let t=Oz(e,`type`,vz);if(Cz(e,`guid`),t===`sky`){Rz(e,[`turbidity`,`rayleigh`,`mie_coefficient`,`mie_directional_g`,`elevation`,`azimuth`]);return}Sz(e,`color`),Tz(e,`intensity`),t!==`ambient_light`&&(Rz(e,[`x`,`y`,`z`]),t===`point_light`?Rz(e,[`distance`,`decay`]):t===`spot_light`?Rz(e,[`distance`,`decay`,`angle`,`penumbra`,`tx`,`ty`,`tz`]):(Rz(e,[`tx`,`ty`,`tz`]),t===`rect_light`&&Rz(e,[`width`,`height`])))}function jz(e){switch(Oz(e,`type`,mz)){case`background_color`:Sz(e,`color`);break;case`controls_damping`:Ez(e,`damping`);break;case`world_axis`:case`show_edges`:Ez(e,`show`);break;case`picker`:Ez(e,`enabled`);break;case`camera_fov`:Tz(e,`fov`);break;case`camera_zoom`:Tz(e,`zoom`);break;case`camera_position`:case`camera_target`:Rz(e,[`x`,`y`,`z`]);break;case`camera_view`:Oz(e,`preset`,yz)}}function Mz(e){let t=Oz(e,`type`,hz);switch(Cz(e,`guid`),wz(e,`label`),t){case`button`:case`load_json_button`:Sz(e,`text`),Sz(e,`variant`);break;case`slider`:Rz(e,[`min`,`max`,`step`,`default_value`]);break;case`number_field`:Rz(e,[`min`,`max`,`step`,`value`]);break;case`checkbox`:Sz(e,`text`),Ez(e,`default_value`);break;case`select`:Dz(e,`options`),wz(e,`placeholder`),wz(e,`default_value`)}}function Nz(e){Cz(e,`guid`),Sz(e,`text`),wz(e,`font`),wz(e,`weight`),Rz(e,[`size`,`depth`,`direction_x`,`direction_y`,`direction_z`,`up_x`,`up_y`,`up_z`,`point_x`,`point_y`,`point_z`]),Ez(e,`centered`)}function Pz(e){Cz(e,`guid`),Sz(e,`text`),wz(e,`color`),Rz(e,[`x`,`y`,`z`])}function Fz(e){Cz(e,`guid`),Sz(e,`type`),Cz(e,`object_guid`),wz(e,`label`),wz(e,`text`),wz(e,`placeholder`),e.options!==void 0&&Dz(e,`options`)}function Iz(e){let t=Oz(e,`type`,gz);Cz(e,`guid`),t===`set_visibility`&&Ez(e,`visible`)}function Lz(e){Ez(e,`visible`),e.message!==void 0&&e.message!==null&&wz(e,`message`)}function Rz(e,t){for(let n of t)Tz(e,n)}function zz(e,t){for(let n of t)Ez(e,n)}function Bz(e,t,n){throw new fz(`invalid_message`,`Invalid ${Vz(e)} command: ${t} must be ${n}`,{details:{dispatch:e.dispatch,field:t,value:e[t]}})}function Vz(e){return typeof e.dispatch==`string`?e.dispatch:`viewer`}function Hz(){return{objectBarData:Kt({title:`Object Infos`,isVisible:!1,data:null}),objectActionsState:Kt([]),sideBarInfoState:Kt({title:`Sidebar Infos`,isVisible:!1,data:null}),sidebarComponents:Kt([]),pickerEnabled:Kt({value:!0}),pickerMode:Kt({value:`translate`}),pickedObjectGuid:Kt({value:null}),blockPicker:Kt({value:!1}),showEdges:Kt({value:!1}),theme:Kt({value:`light`}),spinnerState:Kt({visible:!1,message:null})}}var Uz={type:`change`},Wz={type:`start`},Gz={type:`end`},Kz=new Jk,qz=new qj,Jz=Math.cos(70*ZO.DEG2RAD),Yz=new Z,Xz=2*Math.PI,Zz={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Qz=1e-6,$z=class extends aF{constructor(e,t=null){super(e,t),this.state=Zz.NONE,this.target=new Z,this.cursor=new Z,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:RE.ROTATE,MIDDLE:RE.DOLLY,RIGHT:RE.PAN},this.touches={ONE:zE.ROTATE,TWO:zE.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new Z,this._lastQuaternion=new QO,this._lastTargetPosition=new Z,this._quat=new QO().setFromUnitVectors(e.up,new Z(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new QP,this._sphericalDelta=new QP,this._scale=1,this._panOffset=new Z,this._rotateStart=new X,this._rotateEnd=new X,this._rotateDelta=new X,this._panStart=new X,this._panEnd=new X,this._panDelta=new X,this._dollyStart=new X,this._dollyEnd=new X,this._dollyDelta=new X,this._dollyDirection=new Z,this._mouse=new X,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=tB.bind(this),this._onPointerDown=eB.bind(this),this._onPointerUp=nB.bind(this),this._onContextMenu=lB.bind(this),this._onMouseWheel=aB.bind(this),this._onKeyDown=oB.bind(this),this._onTouchStart=sB.bind(this),this._onTouchMove=cB.bind(this),this._onMouseDown=rB.bind(this),this._onMouseMove=iB.bind(this),this._interceptControlDown=uB.bind(this),this._interceptControlUp=dB.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Uz),this.update(),this.state=Zz.NONE}update(e=null){let t=this.object.position;Yz.copy(t).sub(this.target),Yz.applyQuaternion(this._quat),this._spherical.setFromVector3(Yz),this.autoRotate&&this.state===Zz.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=Xz:n>Math.PI&&(n-=Xz),r<-Math.PI?r+=Xz:r>Math.PI&&(r-=Xz),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(Yz.setFromSpherical(this._spherical),Yz.applyQuaternion(this._quatInverse),t.copy(this.target).add(Yz),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=Yz.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new Z(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new Z(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=Yz.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Kz.origin.copy(this.object.position),Kz.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Kz.direction))Qz||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Qz||this._lastTargetPosition.distanceToSquared(this.target)>Qz?(this.dispatchEvent(Uz),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?Xz/60/60*this.autoRotateSpeed:Xz/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Yz.setFromMatrixColumn(t,0),Yz.multiplyScalar(-e),this._panOffset.add(Yz)}_panUp(e,t){this.screenSpacePanning===!0?Yz.setFromMatrixColumn(t,1):(Yz.setFromMatrixColumn(t,0),Yz.crossVectors(this.object.up,Yz)),Yz.multiplyScalar(e),this._panOffset.add(Yz)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;Yz.copy(r).sub(this.target);let i=Yz.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Xz*this._rotateDelta.x/t.clientHeight),this._rotateUp(Xz*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Xz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Xz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Xz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Xz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Xz*this._rotateDelta.x/t.clientHeight),this._rotateUp(Xz*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t.9&&(r.visible=!1)),this.axis===`Y`&&(hB.setFromEuler(OB.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(hB),Math.abs(kB.copy(LB).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(hB.setFromEuler(OB.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(hB),Math.abs(kB.copy(RB).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(hB.setFromEuler(OB.set(0,Math.PI/2,0)),kB.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(jB.lookAt(AB,kB,LB)),r.quaternion.multiply(hB),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),pB.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),pB.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(pB),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));continue}if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(kB.copy(IB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(kB.copy(LB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(kB.copy(RB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(kB.copy(RB).applyQuaternion(t).dot(this.eye))=-1&&ZB.z<=1&&e.layers.test(r.layers)===!0,l=e.element;l.style.display=c===!0?``:`none`,c===!0&&(e.onBeforeRender(t,n,r),l.style.transform=`translate(`+-100*e.center.x+`%,`+-100*e.center.y+`%)translate(`+(ZB.x*i+i)+`px,`+(-ZB.y*a+a)+`px)`,l.parentNode!==s&&s.appendChild(l),e.onAfterRender(t,n,r));let d={distanceToCameraSquared:u(r,e)};o.objects.set(e,d)}for(let t=0,i=e.children.length;tthis.resize();onPointerDown=e=>this.pickFromPointer(e);onKeyDown=e=>this.handleKeyDown(e);animationFrame=null;attachedContainer=null;componentId=0;disposed=!1;pickedObject=null;pickedMaterial=null;dragStartMatrix=null;highlightMaterial=new QN({color:`orange`,emissive:`yellow`,emissiveIntensity:.1});constructor(e,t){this.root=e,this.options=t;let{width:n,height:r}=this.getDimensions();this.camera=new Nj(60,n/r,.1,1e3),this.camera.up.set(0,0,1),this.camera.position.set(8,-15,15),this.camera.layers.enable(1),this.renderer=new wR({antialias:!0}),this.renderer.domElement.tabIndex=0,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.toneMapping=4,this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=2,this.renderer.toneMappingExposure=2.5,this.renderer.outputColorSpace=sO,this.controls=new $z(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:RE.ROTATE},this.transformControls=new xB(this.camera,this.renderer.domElement),this.transformHelper=this.transformControls.getHelper(),this.transformControls.addEventListener(`dragging-changed`,e=>{this.controls.enabled=!e.value,e.value&&(this.dragStartMatrix=this.transformControls.object?.matrix.clone()??null)}),this.transformControls.addEventListener(`mouseUp`,()=>{this.sendObjectTransform()}),this.scene.add(this.transformHelper),this.labelRenderer.domElement.style.position=`absolute`,this.labelRenderer.domElement.style.inset=`0`,this.labelRenderer.domElement.style.pointerEvents=`none`,this.scene.add(this.axesHelper),this.applyTheme(`light`),this.resize(),this.connection=new LE({...t.websocket,...t.send===void 0?{}:{send:t.send},dispatch:e=>this.dispatch(e),onError:e=>this.reportAsyncError(pz(e,`connection_error`,`The viewer WebSocket connection failed`))})}attach(e){if(this.assertUsable(),this.attachedContainer!==e){if(this.attachedContainer=e,e.append(this.renderer.domElement,this.labelRenderer.domElement),window.addEventListener(`resize`,this.onResize),this.renderer.domElement.addEventListener(`mousedown`,this.onPointerDown),this.root.addEventListener(`keydown`,this.onKeyDown),this.options.defaultLighting&&this.addDefaultLighting(),(this.options.mode??`embedded`)===`websocket`)try{this.connection.start()}catch(e){this.reportOrThrow(pz(e,`connection_error`,`Unable to start the viewer WebSocket connection`))}this.startAnimation(),this.resize()}}dispatch(e){this.assertUsable();let t;try{t=IE(e)}catch(e){this.reportOrThrow(pz(e,`decode_error`,`Unable to decode the COMPAS Protobuf message`));return}try{this.dispatchObject(t)}catch(e){let t=e instanceof JR?new fz(`unsupported_message`,e.message,{cause:e,details:{objectType:e.objectType}}):pz(e,`render_error`,`Unable to apply the viewer message`);this.reportOrThrow(t)}}send(e){return this.connection.send(e)}sendData(e){return this.send(e)}handleUiAction(e,t){this.sendData({dispatch:`ui_callback`,action:e,value:t??null})}handleObjectAction(e,t){this.sendData({dispatch:`object_action_callback`,action_guid:e.guid,object_guid:e.objectGuid,value:t??null})}createGeometry(e,t){let n=this.vectorData(this.controls.target);this.sendData({dispatch:`create_geometry`,type:e,point:[n.x,n.y,n.z],params:t})}getMaterialSnapshot(e){let t=this.geometryMaterials.get(e);if(!t)return null;let n=this.materials.get(t);if(!n||n.materialType!==`standard_material`)return null;let r=n.material;return{color:`#${r.color.getHexString()}`,metalness:r.metalness,roughness:r.roughness}}setMaterial(e,t){let n=this.geometryMaterials.get(e),r=n?this.materials.get(n):void 0;if(r&&r.materialType===`standard_material`){let e=r.material;t.color!==void 0&&e.color.set(t.color),t.metalness!==void 0&&(e.metalness=t.metalness),t.roughness!==void 0&&(e.roughness=t.roughness)}this.sendData({dispatch:`material_edit`,guid:e,...t})}hideObjectInfo(){this.store.objectBarData.isVisible=!1}setTransformMode(e){this.store.pickerMode.value=e,this.transformControls.setMode(e)}toggleTheme(){this.applyTheme(this.store.theme.value===`dark`?`light`:`dark`)}setCameraViewPreset(e){let t=rV[e].clone().normalize(),n=this.camera.position.distanceTo(this.controls.target);this.camera.position.copy(this.controls.target.clone().add(t.multiplyScalar(n))),this.controls.update()}captureCurrentView(e){return{id:`view-${Date.now()}`,name:e,cameraPosition:this.vectorData(this.camera.position),target:this.vectorData(this.controls.target),zoom:this.camera.zoom,fov:this.camera.fov}}applySavedView(e){this.camera.position.set(e.cameraPosition.x,e.cameraPosition.y,e.cameraPosition.z),this.controls.target.set(e.target.x,e.target.y,e.target.z),this.camera.zoom=e.zoom,this.camera.fov=e.fov,this.camera.updateProjectionMatrix(),this.controls.update()}saveCurrentCanvasImage(e={}){let t=e.format??`png`,n=t===`jpg`?`image/jpeg`:`image/${t}`,r=t,i=Math.max(16,Math.round(e.width??this.renderer.domElement.width)),a=Math.max(16,Math.round(e.height??this.renderer.domElement.height));this.controls.update(),this.renderer.render(this.scene,this.camera);let o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s)throw Error(`Unable to create screenshot canvas context`);t===`jpg`&&(s.fillStyle=`#ffffff`,s.fillRect(0,0,i,a)),s.drawImage(this.renderer.domElement,0,0,i,a);let c=document.createElement(`a`);c.download=e.fileName??`compas-view-${Date.now()}.${r}`,c.href=o.toDataURL(n,e.quality),c.click()}reset(){this.clearPickedObject();for(let e of this.geometries.values())this.scene.remove(e),this.disposeObject(e);this.geometries.clear(),this.clearLights();for(let e of this.materials.values())e.material.dispose();this.materials.clear(),this.geometryMaterials.clear(),this.store.sidebarComponents.splice(0),this.store.objectActionsState.splice(0),this.store.objectBarData.data=null,this.store.objectBarData.isVisible=!1,this.store.sideBarInfoState.data=null,this.store.sideBarInfoState.isVisible=!1}resize(){if(this.disposed)return;let{width:e,height:t}=this.getDimensions();this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.labelRenderer.setSize(e,t)}dispose(){this.disposed||(this.disposed=!0,this.connection.dispose(),window.removeEventListener(`resize`,this.onResize),this.root.removeEventListener(`keydown`,this.onKeyDown),this.renderer.domElement.removeEventListener(`mousedown`,this.onPointerDown),this.animationFrame!==null&&cancelAnimationFrame(this.animationFrame),this.animationFrame=null,this.clearPickedObject(),this.resetAfterDispose(),this.controls.dispose(),this.transformControls.detach(),this.transformControls.dispose(),this.scene.remove(this.transformHelper),this.scene.remove(this.axesHelper),this.disposeObject(this.axesHelper),this.clearDefaultLighting(),this.highlightMaterial.dispose(),this.renderer.dispose(),this.renderer.domElement.remove(),this.labelRenderer.domElement.remove(),this.attachedContainer=null)}dispatchObject(e){if(Array.isArray(e)){e.forEach(e=>this.dispatchObject(e));return}if(!e||typeof e!=`object`)return;let t=e;typeof t.dispatch==`string`?this.dispatchCommand(bz(t)):t.bytes instanceof Uint8Array?this.manageGeometry(t):Object.values(t).forEach(e=>this.dispatchObject(e))}dispatchCommand(e){switch(e.dispatch){case`material`:this.manageMaterial(e);break;case`light`:this.manageLight(e);break;case`scene`:this.manageScene(e);break;case`theme`:this.applyTheme(e.mode);break;case`ui`:this.manageUi(e);break;case`text`:this.manageText(e).catch(t=>this.reportAsyncError(pz(t,`render_error`,`Unable to create text geometry`,{dispatch:e.dispatch,guid:e.guid})));break;case`text_tag`:this.manageTextTag(e);break;case`object_infos`:this.store.objectBarData.data=this.withoutDispatch(e);break;case`object_action`:this.manageObjectAction(e);break;case`handle_geometry`:this.handleGeometry(e);break;case`spinner`:this.manageSpinner(e)}}manageGeometry(e){let t=Cz(e,`guid`),n=this.geometries.get(t);if(n&&this.transformControls.dragging&&n===this.transformControls.object)return;let r=YR(e),i=n!==void 0&&n===this.pickedObject;if(n&&(this.scene.remove(n),this.disposeObject(n)),this.applyGeometryMaterial(t,r),this.scene.add(r),this.geometries.set(t,r),this.store.showEdges.value&&r instanceof Q){let e=new uM(new AM(r.geometry),new Qj({color:0}));e.layers.set(1),r.add(e)}if(i){if(this.pickedObject=r,`material`in r){let e=r;this.pickedMaterial=e.material??null,e.material=this.highlightMaterial}this.transformControls.attach(r)}}manageMaterial(e){let t=e.guid,n=xz(e),r=XR(e),i=this.materials.get(t)?.material;this.geometryMaterials.set(n,t);for(let[e,n]of this.geometryMaterials){if(n!==t)continue;let i=this.geometries.get(e);i&&this.assignMaterial(i,r)}this.materials.set(t,{material:r,materialType:e.type}),i?.dispose()}manageLight(e){let t=e.guid,n=rz(e);this.removeLight(t);let r=[n];n instanceof nz?r.push(new MP(16777215,1),new NP(16777215,.6)):n instanceof DP&&r.push(n.target),r.forEach(e=>this.scene.add(e)),this.lights.set(t,{objects:r})}manageScene(e){switch(e.type){case`background_color`:this.scene.background=new VA(e.color);break;case`controls_damping`:this.controls.enableDamping=e.damping;break;case`world_axis`:this.axesHelper.visible=e.show;break;case`picker`:this.store.pickerEnabled.value=e.enabled;break;case`camera_fov`:this.camera.fov=e.fov,this.camera.updateProjectionMatrix();break;case`camera_zoom`:this.camera.zoom=e.zoom,this.camera.updateProjectionMatrix();break;case`camera_position`:this.camera.position.set(e.x,e.y,e.z),this.controls.update();break;case`camera_target`:this.controls.target.set(e.x,e.y,e.z),this.controls.update();break;case`camera_view`:this.setCameraViewPreset(e.preset);break;case`show_edges`:this.store.showEdges.value=e.show}}manageUi(e){let t={id:++this.componentId,action:e.guid,...e.label===void 0?{}:{label:e.label}},n;switch(e.type){case`button`:case`load_json_button`:n={...t,component:e.type===`button`?`Button`:`LoadJsonButton`,props:{text:e.text,variant:e.variant}};break;case`slider`:n={...t,component:`Slider`,props:{min:e.min,max:e.max,step:e.step,defaultValue:[e.default_value]}};break;case`number_field`:n={...t,component:`NumberField`,props:{min:e.min,max:e.max,step:e.step,value:e.value}};break;case`checkbox`:n={...t,component:`Checkbox`,props:{text:e.text,defaultValue:e.default_value}};break;case`select`:n={...t,component:`Select`,props:{options:e.options,...e.placeholder===void 0?{}:{placeholder:e.placeholder},...e.default_value===void 0?{}:{defaultValue:e.default_value}}}}this.store.sidebarComponents.push(n),this.store.sideBarInfoState.isVisible=!0}manageObjectAction(e){this.store.objectActionsState.push({guid:e.guid,type:e.type,objectGuid:e.object_guid,...e.label===void 0?{}:{label:e.label},...e.text===void 0?{}:{text:e.text},...e.options===void 0?{}:{options:e.options},...e.placeholder===void 0?{}:{placeholder:e.placeholder},...e.default_value===void 0?{}:{defaultValue:e.default_value}})}manageSpinner(e){this.store.spinnerState.visible=e.visible,this.store.spinnerState.message=e.visible?e.message??null:null}pickFromPointer(e){if(this.renderer.domElement.focus({preventScroll:!0}),e.button!==0||!this.store.pickerEnabled.value||this.store.blockPicker.value||this.transformControls.dragging)return;let t=this.renderer.domElement.getBoundingClientRect();if(!t.width||!t.height)return;let n=new X((e.clientX-t.left)/t.width*2-1,-((e.clientY-t.top)/t.height)*2+1);this.raycaster.layers.set(0),this.raycaster.setFromCamera(n,this.camera);let r=Array.from(this.geometries.values()).filter(e=>e.visible),i=this.raycaster.intersectObjects(r,!0)[0]?.object??null;if(!i){this.clearPickedObject();return}if(this.clearPickedObject(),this.pickedObject=i,`material`in i){let e=i;this.pickedMaterial=e.material??null,e.material=this.highlightMaterial}this.transformControls.attach(i);let a=this.findGeometryGuid(i);this.store.pickedObjectGuid.value=a??null,a&&this.sendData({dispatch:`object_picked`,guid:a})}clearPickedObject(){this.pickedObject&&this.pickedMaterial&&`material`in this.pickedObject&&(this.pickedObject.material=this.pickedMaterial),this.pickedObject=null,this.pickedMaterial=null,this.transformControls.detach(),this.store.pickedObjectGuid.value=null,this.store.objectBarData.data=null,this.store.objectActionsState.splice(0)}findGeometryGuid(e){let t=e;for(;t;){for(let[e,n]of this.geometries)if(n===t)return e;t=t.parent}}sendObjectTransform(){let e=this.transformControls.object,t=this.dragStartMatrix;if(this.dragStartMatrix=null,!e||!t)return;let n=e.matrix.clone().multiply(t.clone().invert());if(n.equals(new Yk))return;let r=this.findGeometryGuid(e);if(!r)return;let i=n.elements,a=[[i[0],i[4],i[8],i[12]],[i[1],i[5],i[9],i[13]],[i[2],i[6],i[10],i[14]],[i[3],i[7],i[11],i[15]]];this.sendData({dispatch:`object_transform`,guid:r,matrix:a})}handleKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?this.clearPickedObject():e.key.toLowerCase()===`p`?this.store.pickerEnabled.value=!this.store.pickerEnabled.value:e.key.toLowerCase()===`i`&&(this.store.objectBarData.isVisible=!this.store.objectBarData.isVisible))}manageTextTag(e){let t=e.guid,n=document.createElement(`div`);n.className=`text-tag`,n.textContent=e.text,e.color&&(n.style.color=e.color);let r=new XB(n);r.position.set(e.x,e.y,e.z);let i=this.geometries.get(t);i&&this.scene.remove(i),this.scene.add(r),this.geometries.set(t,r)}async manageText(e){let t=`${e.font??`helvetiker`}_${e.weight??`regular`}`,n=this.fonts.get(t);n||(n=await new KB().loadAsync(`/fonts/${t}.typeface.json`),this.fonts.set(t,n));let r=new GB(e.text,{font:n,size:e.size,depth:e.depth});if(e.centered){r.computeBoundingBox();let e=r.boundingBox;e&&r.translate(-.5*(e.max.x-e.min.x),0,0)}let i=new Z(e.direction_x,e.direction_y,e.direction_z).normalize(),a=new Z(e.up_x,e.up_y,e.up_z).normalize(),o=new Z().crossVectors(i,a).normalize(),s=new Yk().makeBasis(i,a,o);s.setPosition(e.point_x,e.point_y,e.point_z);let c=e.guid,l=this.geometryMaterials.get(c),u=new Q(r,l?this.materials.get(l)?.material:new QN({color:65535,side:2}));u.applyMatrix4(s);let d=this.geometries.get(c);d&&(this.scene.remove(d),this.disposeObject(d)),this.scene.add(u),this.geometries.set(c,u)}handleGeometry(e){let t=e.guid,n=this.geometries.get(t);n&&(e.type===`remove`?(this.scene.remove(n),this.disposeObject(n),this.geometries.delete(t),this.geometryMaterials.delete(t)):e.type===`set_visibility`?n.visible=e.visible:e.type===`toggle_visibility`&&(n.visible=!n.visible))}applyGeometryMaterial(e,t){let n=this.geometryMaterials.get(e),r=n?this.materials.get(n)?.material:void 0;if(r)this.assignMaterial(t,r);else if(t instanceof rF)return;else t instanceof Q?this.replaceMaterial(t,new QN({color:37586,roughness:.7,metalness:.05})):t instanceof oM?this.replaceMaterial(t,new Qj({color:37586})):t instanceof gM?this.replaceMaterial(t,new dM({color:37586,size:.5})):t instanceof nF&&t.setColor(37586)}assignMaterial(e,t){e instanceof rF||(e instanceof Q?this.replaceMaterial(e,t):e instanceof oM?this.replaceMaterial(e,t instanceof Qj?t:new Qj({color:this.materialColor(t)})):e instanceof gM?this.replaceMaterial(e,t instanceof dM?t:new dM({color:this.materialColor(t),size:.5})):e instanceof nF&&e.setColor(this.materialColor(t)))}replaceMaterial(e,t){let n=e.material;e.material=t;let r=Array.isArray(n)?n:[n];for(let e of r)e&&!this.includesMaterial(t,e)&&this.disposeUnregisteredMaterial(e)}includesMaterial(e,t){return Array.isArray(e)?e.includes(t):e===t}materialColor(e){return`color`in e&&e.color instanceof VA?e.color:new VA(37586)}applyTheme(e){this.store.theme.value=e,this.scene.background=new VA(e===`dark`?0:15132390)}addDefaultLighting(){if(this.defaultLights.length)return;let e=new MP(16777215,1);e.position.set(30,-10,30);let t=new MP(16777215,.5);t.position.set(-30,-20,30);let n=new MP(16777215,.5);n.position.set(-30,20,10);let r=[e,t,n,new NP(16777215,.5)];r.forEach(e=>this.scene.add(e)),this.defaultLights.push(...r)}removeLight(e){let t=this.lights.get(e);t&&(t.objects.forEach(e=>{this.scene.remove(e),this.disposeObject(e)}),this.lights.delete(e))}clearLights(){for(let e of this.lights.keys())this.removeLight(e)}clearDefaultLighting(){for(let e of this.defaultLights)this.scene.remove(e),this.disposeObject(e);this.defaultLights.splice(0)}startAnimation(){if(this.animationFrame!==null)return;let e=()=>{this.disposed||(this.animationFrame=requestAnimationFrame(e),this.controls.update(),this.renderer.render(this.scene,this.camera),this.labelRenderer.render(this.scene,this.camera))};e()}getDimensions(){let e=this.root.getBoundingClientRect();return{width:Math.max(1,Math.round(e.width||this.root.clientWidth||window.innerWidth)),height:Math.max(1,Math.round(e.height||this.root.clientHeight||window.innerHeight))}}disposeObject(e){e.traverse(e=>{e instanceof xP&&e.dispose();let t=e;t.geometry?.dispose(),Array.isArray(t.material)?t.material.forEach(e=>this.disposeUnregisteredMaterial(e)):this.disposeUnregisteredMaterial(t.material)})}disposeUnregisteredMaterial(e){e&&!Array.from(this.materials.values()).some(t=>t.material===e)&&e!==this.highlightMaterial&&e.dispose()}resetAfterDispose(){for(let e of this.geometries.values())this.disposeObject(e);this.geometries.clear(),this.clearLights();for(let e of this.materials.values())e.material.dispose();this.materials.clear(),this.geometryMaterials.clear()}vectorData(e){return{x:e.x,y:e.y,z:e.z}}withoutDispatch(e){let{dispatch:t,...n}=e;return n}reportOrThrow(e){if(this.options.onError)this.options.onError(e);else throw e}reportAsyncError(e){this.options.onError?this.options.onError(e):console.error(e)}assertUsable(){if(this.disposed)throw new fz(`lifecycle_error`,`The COMPAS viewer has been disposed`)}};function aV(e,t={}){if(typeof HTMLElement>`u`||!(e instanceof HTMLElement))throw new fz(`lifecycle_error`,`createViewer requires an HTMLElement container`);let n=nn(new iV(e,t)),r=hu(Xx,{runtime:n,showToolbar:t.showToolbar??!0});r.provide(iy,n),r.mount(e);let i=!1;return{dispatch(e){n.dispatch(e)},reset(){n.reset()},resize(){n.resize()},dispose(){i||(i=!0,r.unmount(),n.dispose())}}}var oV=document.querySelector(`#app`);if(!oV)throw Error(`Standalone viewer requires an #app container`);aV(oV,{mode:`websocket`,showToolbar:!0}); \ No newline at end of file diff --git a/src/compas_threejs/viewer/frontend/index.html b/src/compas_threejs/viewer/frontend/index.html index 2c0a358..e9d273e 100644 --- a/src/compas_threejs/viewer/frontend/index.html +++ b/src/compas_threejs/viewer/frontend/index.html @@ -5,8 +5,6 @@ COMPAS ThreeJS - -