diff --git a/CHANGELOG.md b/CHANGELOG.md index 908940f..150b6fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,129 @@ All notable changes to Vestige will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.3.0] - 2026-07-26 — "Cognitive Observatory + Zero-Knowledge Sync" -### Fixed — Auto-consolidation merge: opt-out lever + protected pins honored (#142) +Two audits (39 verified fixes), three dormant features brought to life, a +raw-WebGPU dashboard, and the first Vestige Pro surface — a cloud-sync client +that refuses to sync anything it hasn't encrypted first. + +### Added — Cognitive Observatory: a raw-WebGPU living memory field + +The dashboard gains a full-bleed, zero-library WebGPU surface that renders the +memory graph as a living cognitive field: GPU force simulation, HDR bloom, and +a recall wavefront sweeping the **real** memory graph. Five deterministic demo +moments are driven by a URL contract (`?demo=&seed=...&frame=N`): +recall-path, engram-birth, salience-rescue, forgetting-horizon, firewall — +capture mode (`?frame=N`) freezes the sim so the same URL produces identical +pixels. No Three.js, no chart library: bare-metal WebGPU engine, WGSL shaders, +DOM as instrument overlays only. The Observatory is also embedded in the main +graph page (an Observatory button beside Dream and Memory Cinema takes over +full-bleed; Esc exits), and the field is clickable — GPU picking opens the +same Memory Detail inspector Classic's picking drove. + +### Added — Vestige Pro: zero-knowledge cloud-sync client + upgrade surfaces + +The public client for the hosted Vestige Cloud managed-sync service lands +behind the optional `cloud-sync` cargo feature, and encryption is mandatory: +**the client refuses plaintext sync**. The portable archive is encrypted +on-device before upload (Argon2id KDF → XChaCha20-Poly1305 AEAD, a +self-describing `VSTGENC1` envelope) under a passphrase +(`VESTIGE_CLOUD_ENCRYPTION_KEY`) that is **never sent to the server** and is +independent of the bearer sync key — the hosted service only ever stores +ciphertext, so "we hold no keys" is literally true, and a lost passphrase means +the synced blob is unrecoverable by design (we cannot reset what we never +have). The refusal cuts both ways: the client will not upload an unencrypted +archive, and it rejects a plaintext blob on download instead of quietly +accepting it. The transport is the existing pull-merge-push portable-sync +engine over HTTP with ETag/`If-Match` optimistic concurrency, so two devices +converge without lost updates. The dashboard gains matching Pro upgrade +surfaces. **The hosted service is optional and paid; local-first stays free** — +the default build links no HTTP client and behaves exactly as before. + +### Changed — The living field is now the main graph renderer + +The main graph page defaults to the Observatory engine wherever WebGPU exists. +A new **Field | Classic** toggle in the control bar keeps the Three.js view one +click away and untouched (picking, colour modes, temporal scrubbing and legends +remain Classic features); no WebGPU forces Classic automatically, and the +choice persists in `localStorage`. Dream, Observatory takeover, Memory Cinema, +and Reload work in both modes. + +### Changed — `smart_ingest` batch mode honors an explicit `forceCreate: false` + +**Write-semantics change for existing clients.** Batch mode has defaulted to +`batchMergePolicy: "force_create"` since v2.1.23 — but under that default, an +explicit per-call `forceCreate: false` was silently inverted into a +force-create. An explicit `forceCreate` is now authoritative in both policies: +pass `forceCreate: false` and batch items go through Prediction Error Gating +(merge/update/create against existing memories) even under the default policy. +Callers that were sending `forceCreate: false` while relying on the old +always-create behavior will now see merges and updates instead of new nodes — +drop the parameter (or send `true`) to keep the old behavior. + +### Fixed — 29 bugs from the full-backend adversarial audit (#139) + +A backend-wide audit (18 feature areas, each finding adversarially re-verified) +surfaced 31 real bugs; this release fixes 29. Highlights: **migrations now run +in a transaction** (a mid-migration failure no longer bricks the DB), +`decide_memory_pr` rejects re-deciding a finalized PR, `suppress` reverse is a +true inverse (was leaving stability permanently halved), `update_node_content` +regenerates a stale embedding when the embedder wasn't ready, `plan_merge` +validates `survivor_id` (was an unchecked-unwrap panic), the contradiction +heuristic requires a real polarity flip (was demoting correct memories on +benign "do not" notes), and hybrid-search relevance is the min-max-normalized +RRF fused score. Full workspace stayed green (1556 tests, clippy `-D warnings` +clean). + +### Fixed — Three dormant features wired live (#117, #124, #137 via #140) + +Honesty first: each of these is now genuinely producing data, and none of the +three is 100% finished. The remaining edges are stated per item. + +- **Agent Black Box records traces for real (#117)**: the trace recorder had + zero production callers, so `agent_traces` never populated. + `handle_tools_call` now records the opening `mcp.call` event before dispatch + and the memory events after, under a shared `run_id` — including in pure + stdio mode (was gated on a dashboard socket). **Not yet wired**: the + receipts and memory-PR producers — those Black Box surfaces still have no + production writer and stay empty for now. +- **Recurring intentions re-arm (#124)**: `mark_triggered` advances a + recurring trigger's `next_occurrence` and returns it to Active (was firing + once and staying Triggered forever). **Not yet done**: the re-arm logic is + fixed, but recurring intentions are not yet hydrated into the live engine, + so a re-armed intention is not automatically picked up by the running + trigger loop. +- **Co-access prediction is live (#137)**: `search_unified` feeds retrieved + sets to the speculative retriever, so co-access patterns populate (were + permanently empty). **Partially wired**: #137's remaining speculative + channels are still only partially connected to production callers. + +### Fixed — 10 more bugs from the second full-codebase audit (#141) + +A second adversarial pass over areas the first under-covered. Majors: the FTS5 +sanitizer leaked bare operators on doubled input ("foo AND AND AND"), aborting +MATCH or silently flipping AND→OR; unbounded MCP `hours_back`/`hours_forward` +and an unclamped `limit` could panic the server (DoS); and the connector +idempotency key omitted `source_project`, so two repos with overlapping issue +ids clobbered each other's memories — **migration V19** adds the project to the +key and unique index. Minors: `list_memories` honors `node_type`/`tag` on the +search path, HTTP Accept handles `*/*` wildcards, Bearer matches +case-insensitively (RFC 7235), dream insights no longer fabricate a +TemporalTrend from sentinel dates, the dashboard WebSocket can't resurrect +itself after `disconnect()`, and Redmine thread truncation keeps the newest +journals. 1559 tests + clippy clean; dashboard check green. + +### Fixed — Dashboard mock data replaced with real APIs + +The `/duplicates`, `/contradictions`, and `/patterns` routes shipped hardcoded +mock data — and `/duplicates` rendered a "Live" badge over it. The three mocks +are replaced (`898bd33`) with real dashboard HTTP endpoints backed by existing +core capabilities: `GET /api/duplicates` (dedup cluster detection), +`GET /api/contradictions` (trust-weighted contradiction analysis), and +`GET /api/patterns/cross-project` (cross-project pattern transfer). The "Live" +badge is now truthful. + +### Fixed — Auto-consolidation merge: opt-out lever + protected pins honored (#142, via #143) The background consolidation cycle's auto-dedup pass silently concat-merges near-duplicate memories (cosine ≥ 0.85): it keeps the strongest node, folds the @@ -21,7 +141,44 @@ available for on-demand, previewable, reversible merges regardless. Second, unattended, contradicting the interactive contract that a protected node may only survive a merge, never be absorbed. A protected node is now never an anchor, never a cluster member, and thus never merged into or deleted, whether the lever is on -or off. +or off. To be plain about what did **not** change: when the pass is enabled, +its merges are still hard-deletes with no reversible trail — the lever and the +pin exclusion narrow the blast radius, they do not add a reflog. Thanks +@Vrakoss for the report and the fix. + +### Docs — README rewrite; CauseBench replaced by Silent Rotation + +The README is rewritten for clarity, with stale facts and a dead link fixed. +The advertised CauseBench benchmark is withdrawn: `benchmarks/causebench/` no +longer exists, so its link and repro command 404'd, and its published numbers +are retracted. It is replaced by **Silent Rotation**, which is real and +auditable — three coding agents, one failing end-to-end test, a signing key +that exists only in the memory layer, and 246 raw agent transcripts published +instead of a summary table. The headline metric is the converged-wrong column: +a no-memory fleet agrees on a planted decoy 21 times in 25; dense cosine 12 in +23. The repro is three verbatim commands verified from a fresh clone. The +ComposeBench roadmap note now points at the silent-rotation harness. + +### Upgrade notes + +- **Migration V19 runs automatically** and adds `source_project` to the + connector idempotency key and unique index. If you synced **two or more + projects of the same source system** (e.g. two GitHub repos) under 2.2.x, + their overlapping issue ids clobbered each other's memories. After + upgrading, re-run `source_sync` once **per project** so each project's + records are re-indexed under its own key. + +### Credits + +This release was again driven in part by the community: + +- **@Vrakoss** reported the silent auto-consolidation merge behavior (#142) + with a precise write-up of the missing opt-out and the ignored `dedup + protect` pins, and contributed the basis of the fix itself — the + `VESTIGE_AUTO_CONSOLIDATE_MERGE` lever and the protected-pin exclusion + shipped as they built them (PR #143, co-authored in `f7a782d`). + +Thank you. ## [2.2.1] - 2026-07-02 — "Windows embeddings + backfill safety" diff --git a/Cargo.lock b/Cargo.lock index 90d70a0..4a05b8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4897,7 +4897,7 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vestige-core" -version = "2.2.1" +version = "2.3.0" dependencies = [ "argon2", "blake3", @@ -4938,7 +4938,7 @@ dependencies = [ [[package]] name = "vestige-mcp" -version = "2.2.1" +version = "2.3.0" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index 9dffd26..ebee9f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ exclude = [ ] [workspace.package] -version = "2.2.1" +version = "2.3.0" edition = "2024" license = "AGPL-3.0-only" repository = "https://github.com/samvallad33/vestige" diff --git a/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css b/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css new file mode 100644 index 0000000..0c4987d --- /dev/null +++ b/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css @@ -0,0 +1 @@ +/*! tailwindcss v4.2.0 | 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-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--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-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-duration:initial;--tw-ease:initial;--angle:0deg;--shine:0%}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", "Fira Code", "SF Mono", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-400:oklch(82.8% .189 84.429);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--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);--color-void:#050510;--color-abyss:#0a0a1a;--color-deep:#10102a;--color-surface:#161638;--color-elevated:#1e1e4a;--color-subtle:#2a2a5e;--color-muted:#4a4a7a;--color-dim:#7a7aaa;--color-text:#e0e0ff;--color-bright:#fff;--color-synapse:#6366f1;--color-synapse-glow:#818cf8;--color-dream:#a855f7;--color-dream-glow:#c084fc;--color-memory:#3b82f6;--color-recall:#10b981;--color-decay:#ef4444;--color-warning:#f59e0b;--color-node-pattern:#ec4899}}@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%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, 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;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{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]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.visible\!{visibility:visible!important}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.start\!{inset-inline-start:var(--spacing)!important}.end{inset-inline-end:var(--spacing)}.end\!{inset-inline-end:var(--spacing)!important}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1{top:calc(var(--spacing) * 1)}.top-1\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-10{top:calc(var(--spacing) * 10)}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.-left-\[29px\]{left:-29px}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-3\.5{left:calc(var(--spacing) * 3.5)}.left-4{left:calc(var(--spacing) * 4)}.left-6{left:calc(var(--spacing) * 6)}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-\[-12px\]{margin-top:-12px}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.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-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-\[520px\]{height:520px}.h-\[560px\]{height:560px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[620px\]{max-height:620px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-\[240px\]{min-height:240px}.min-h-\[320px\]{min-height:320px}.min-h-\[520px\]{min-height:520px}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-96{width:calc(var(--spacing) * 96)}.w-\[3px\]{width:3px}.w-\[6ch\]{width:6ch}.w-\[90\%\]{width:90%}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-20{max-width:calc(var(--spacing) * 20)}.max-w-\[220px\]{max-width:220px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-12{min-width:calc(var(--spacing) * 12)}.min-w-16{min-width:calc(var(--spacing) * 16)}.min-w-64{min-width:calc(var(--spacing) * 64)}.min-w-\[2rem\]{min-width:2rem}.min-w-\[3\.5rem\]{min-width:3.5rem}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-separate{border-collapse:separate}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-150{--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\[2px\]{gap:2px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}: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)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.\!border-decay\/20{border-color:#ef444433!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/20{border-color:color-mix(in oklab,var(--color-decay) 20%,transparent)!important}}.\!border-decay\/30{border-color:#ef44444d!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/30{border-color:color-mix(in oklab,var(--color-decay) 30%,transparent)!important}}.\!border-decay\/40{border-color:#ef444466!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/40{border-color:color-mix(in oklab,var(--color-decay) 40%,transparent)!important}}.\!border-dream\/20{border-color:#a855f733!important}@supports (color:color-mix(in lab,red,red)){.\!border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)!important}}.\!border-synapse\/15{border-color:#6366f126!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/15{border-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)!important}}.\!border-synapse\/20{border-color:#6366f133!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/20{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)!important}}.\!border-synapse\/25{border-color:#6366f140!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/25{border-color:color-mix(in oklab,var(--color-synapse) 25%,transparent)!important}}.\!border-synapse\/30{border-color:#6366f14d!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)!important}}.\!border-synapse\/40{border-color:#6366f166!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)!important}}.border-\[\#5dcaa5\]{border-color:#5dcaa5}.border-\[\#5dcaa5\]\/20{border-color:#5dcaa533}.border-\[\#5dcaa5\]\/25{border-color:#5dcaa540}.border-\[\#5dcaa5\]\/40{border-color:#5dcaa566}.border-\[\#A33FFF\]\/40{border-color:#a33fff66}.border-decay\/20{border-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.border-decay\/20{border-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.border-dream-glow\/40{border-color:#c084fc66}@supports (color:color-mix(in lab,red,red)){.border-dream-glow\/40{border-color:color-mix(in oklab,var(--color-dream-glow) 40%,transparent)}}.border-dream\/10{border-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.border-dream\/10{border-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.border-dream\/20{border-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.border-dream\/30{border-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.border-dream\/30{border-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.border-dream\/40{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.border-dream\/40{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.border-dream\/50{border-color:#a855f780}@supports (color:color-mix(in lab,red,red)){.border-dream\/50{border-color:color-mix(in oklab,var(--color-dream) 50%,transparent)}}.border-recall\/25{border-color:#10b98140}@supports (color:color-mix(in lab,red,red)){.border-recall\/25{border-color:color-mix(in oklab,var(--color-recall) 25%,transparent)}}.border-recall\/30{border-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.border-recall\/30{border-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.border-recall\/40{border-color:#10b98166}@supports (color:color-mix(in lab,red,red)){.border-recall\/40{border-color:color-mix(in oklab,var(--color-recall) 40%,transparent)}}.border-red-900\/50{border-color:#82181a80}@supports (color:color-mix(in lab,red,red)){.border-red-900\/50{border-color:color-mix(in oklab,var(--color-red-900) 50%,transparent)}}.border-subtle\/15{border-color:#2a2a5e26}@supports (color:color-mix(in lab,red,red)){.border-subtle\/15{border-color:color-mix(in oklab,var(--color-subtle) 15%,transparent)}}.border-subtle\/20{border-color:#2a2a5e33}@supports (color:color-mix(in lab,red,red)){.border-subtle\/20{border-color:color-mix(in oklab,var(--color-subtle) 20%,transparent)}}.border-subtle\/30{border-color:#2a2a5e4d}@supports (color:color-mix(in lab,red,red)){.border-subtle\/30{border-color:color-mix(in oklab,var(--color-subtle) 30%,transparent)}}.border-synapse{border-color:var(--color-synapse)}.border-synapse\/5{border-color:#6366f10d}@supports (color:color-mix(in lab,red,red)){.border-synapse\/5{border-color:color-mix(in oklab,var(--color-synapse) 5%,transparent)}}.border-synapse\/10{border-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.border-synapse\/10{border-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.border-synapse\/15{border-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.border-synapse\/15{border-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)}}.border-synapse\/20{border-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.border-synapse\/20{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.border-synapse\/25{border-color:#6366f140}@supports (color:color-mix(in lab,red,red)){.border-synapse\/25{border-color:color-mix(in oklab,var(--color-synapse) 25%,transparent)}}.border-synapse\/30{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.border-synapse\/40{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.border-transparent{border-color:#0000}.border-warning\/30{border-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.border-warning\/30{border-color:color-mix(in oklab,var(--color-warning) 30%,transparent)}}.border-warning\/40{border-color:#f59e0b66}@supports (color:color-mix(in lab,red,red)){.border-warning\/40{border-color:color-mix(in oklab,var(--color-warning) 40%,transparent)}}.border-warning\/50{border-color:#f59e0b80}@supports (color:color-mix(in lab,red,red)){.border-warning\/50{border-color:color-mix(in oklab,var(--color-warning) 50%,transparent)}}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.border-t-dream{border-top-color:var(--color-dream)}.border-t-synapse{border-top-color:var(--color-synapse)}.border-t-warning{border-top-color:var(--color-warning)}.bg-\[\#5dcaa5\]{background-color:#5dcaa5}.bg-\[\#5dcaa5\]\/15{background-color:#5dcaa526}.bg-\[\#5dcaa5\]\/25{background-color:#5dcaa540}.bg-\[\#03040a\]{background-color:#03040a}.bg-\[\#05060a\]{background-color:#05060a}.bg-\[\#05060a\]\/70{background-color:#05060ab3}.bg-\[\#A33FFF\]{background-color:#a33fff}.bg-\[\#A33FFF\]\/10{background-color:#a33fff1a}.bg-amber-400{background-color:var(--color-amber-400)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-decay{background-color:var(--color-decay)}.bg-decay\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-decay\/10{background-color:color-mix(in oklab,var(--color-decay) 10%,transparent)}}.bg-decay\/20{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.bg-decay\/20{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.bg-decay\/\[0\.05\]{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.bg-decay\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-decay) 5%,transparent)}}.bg-deep{background-color:var(--color-deep)}.bg-deep\/40{background-color:#10102a66}@supports (color:color-mix(in lab,red,red)){.bg-deep\/40{background-color:color-mix(in oklab,var(--color-deep) 40%,transparent)}}.bg-deep\/60{background-color:#10102a99}@supports (color:color-mix(in lab,red,red)){.bg-deep\/60{background-color:color-mix(in oklab,var(--color-deep) 60%,transparent)}}.bg-dream{background-color:var(--color-dream)}.bg-dream\/5{background-color:#a855f70d}@supports (color:color-mix(in lab,red,red)){.bg-dream\/5{background-color:color-mix(in oklab,var(--color-dream) 5%,transparent)}}.bg-dream\/10{background-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.bg-dream\/10{background-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.bg-dream\/15{background-color:#a855f726}@supports (color:color-mix(in lab,red,red)){.bg-dream\/15{background-color:color-mix(in oklab,var(--color-dream) 15%,transparent)}}.bg-dream\/20{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.bg-dream\/20{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.bg-muted{background-color:var(--color-muted)}.bg-node-pattern{background-color:var(--color-node-pattern)}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-recall{background-color:var(--color-recall)}.bg-recall\/10{background-color:#10b9811a}@supports (color:color-mix(in lab,red,red)){.bg-recall\/10{background-color:color-mix(in oklab,var(--color-recall) 10%,transparent)}}.bg-recall\/15{background-color:#10b98126}@supports (color:color-mix(in lab,red,red)){.bg-recall\/15{background-color:color-mix(in oklab,var(--color-recall) 15%,transparent)}}.bg-recall\/20{background-color:#10b98133}@supports (color:color-mix(in lab,red,red)){.bg-recall\/20{background-color:color-mix(in oklab,var(--color-recall) 20%,transparent)}}.bg-red-950\/30{background-color:#4608094d}@supports (color:color-mix(in lab,red,red)){.bg-red-950\/30{background-color:color-mix(in oklab,var(--color-red-950) 30%,transparent)}}.bg-synapse{background-color:var(--color-synapse)}.bg-synapse-glow{background-color:var(--color-synapse-glow)}.bg-synapse\/10{background-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/10{background-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.bg-synapse\/15{background-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/15{background-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)}}.bg-synapse\/20{background-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/20{background-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.bg-synapse\/25{background-color:#6366f140}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/25{background-color:color-mix(in oklab,var(--color-synapse) 25%,transparent)}}.bg-synapse\/70{background-color:#6366f1b3}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/70{background-color:color-mix(in oklab,var(--color-synapse) 70%,transparent)}}.bg-transparent{background-color:#0000}.bg-void{background-color:var(--color-void)}.bg-void\/60{background-color:#05051099}@supports (color:color-mix(in lab,red,red)){.bg-void\/60{background-color:color-mix(in oklab,var(--color-void) 60%,transparent)}}.bg-warning{background-color:var(--color-warning)}.bg-warning\/5{background-color:#f59e0b0d}@supports (color:color-mix(in lab,red,red)){.bg-warning\/5{background-color:color-mix(in oklab,var(--color-warning) 5%,transparent)}}.bg-warning\/20{background-color:#f59e0b33}@supports (color:color-mix(in lab,red,red)){.bg-warning\/20{background-color:color-mix(in oklab,var(--color-warning) 20%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.bg-white\/\[0\.05\]{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#05060a\]\/85{--tw-gradient-from:oklab(12.2919% .000261273 -.0107539/.85);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-dream{--tw-gradient-from:var(--color-dream);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-synapse{--tw-gradient-to:var(--color-synapse);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-0{padding:calc(var(--spacing) * 0)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-10{padding:calc(var(--spacing) * 10)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.\[padding-top\:max\(0\.75rem\,env\(safe-area-inset-top\)\)\]{padding-top:max(.75rem,env(safe-area-inset-top))}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-\[10vh\]{padding-top:10vh}.\[padding-right\:max\(0\.75rem\,env\(safe-area-inset-right\)\)\]{padding-right:max(.75rem,env(safe-area-inset-right))}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.\[padding-left\:max\(0\.75rem\,env\(safe-area-inset-left\)\)\]{padding-left:max(.75rem,env(safe-area-inset-left))}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-10{padding-left:calc(var(--spacing) * 10)}.pl-14{padding-left:calc(var(--spacing) * 14)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-bottom{vertical-align:bottom}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.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-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.text-pretty{text-wrap:pretty}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#5dcaa5\]{color:#5dcaa5}.text-\[\#5dcaa5\]\/60{color:#5dcaa599}.text-\[\#5dcaa5\]\/70{color:#5dcaa5b3}.text-\[\#7fe6c0\]{color:#7fe6c0}.text-\[\#05060a\]{color:#05060a}.text-\[\#E4C8FF\]{color:#e4c8ff}.text-\[\#a6dcff\]{color:#a6dcff}.text-\[\#ffffff\]\/\[0\.5\]{color:#ffffff80}.text-\[\#ffffff\]\/\[0\.55\]{color:#ffffff8c}.text-amber-400{color:var(--color-amber-400)}.text-bright{color:var(--color-bright)}.text-decay{color:var(--color-decay)}.text-decay\/60{color:#ef444499}@supports (color:color-mix(in lab,red,red)){.text-decay\/60{color:color-mix(in oklab,var(--color-decay) 60%,transparent)}}.text-decay\/80{color:#ef4444cc}@supports (color:color-mix(in lab,red,red)){.text-decay\/80{color:color-mix(in oklab,var(--color-decay) 80%,transparent)}}.text-dim{color:var(--color-dim)}.text-dim\/70{color:#7a7aaab3}@supports (color:color-mix(in lab,red,red)){.text-dim\/70{color:color-mix(in oklab,var(--color-dim) 70%,transparent)}}.text-dream{color:var(--color-dream)}.text-dream-glow{color:var(--color-dream-glow)}.text-dream\/50{color:#a855f780}@supports (color:color-mix(in lab,red,red)){.text-dream\/50{color:color-mix(in oklab,var(--color-dream) 50%,transparent)}}.text-dream\/80{color:#a855f7cc}@supports (color:color-mix(in lab,red,red)){.text-dream\/80{color:color-mix(in oklab,var(--color-dream) 80%,transparent)}}.text-memory{color:var(--color-memory)}.text-muted{color:var(--color-muted)}.text-muted\/50{color:#4a4a7a80}@supports (color:color-mix(in lab,red,red)){.text-muted\/50{color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.text-muted\/60{color:#4a4a7a99}@supports (color:color-mix(in lab,red,red)){.text-muted\/60{color:color-mix(in oklab,var(--color-muted) 60%,transparent)}}.text-node-pattern{color:var(--color-node-pattern)}.text-purple-400{color:var(--color-purple-400)}.text-recall{color:var(--color-recall)}.text-red-400{color:var(--color-red-400)}.text-subtle{color:var(--color-subtle)}.text-synapse{color:var(--color-synapse)}.text-synapse-glow{color:var(--color-synapse-glow)}.text-text{color:var(--color-text)}.text-text\/80{color:#e0e0ffcc}@supports (color:color-mix(in lab,red,red)){.text-text\/80{color:color-mix(in oklab,var(--color-text) 80%,transparent)}}.text-warning{color:var(--color-warning)}.text-warning\/60{color:#f59e0b99}@supports (color:color-mix(in lab,red,red)){.text-warning\/60{color:color-mix(in oklab,var(--color-warning) 60%,transparent)}}.text-warning\/70{color:#f59e0bb3}@supports (color:color-mix(in lab,red,red)){.text-warning\/70{color:color-mix(in oklab,var(--color-warning) 70%,transparent)}}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.\[font-variant-numeric\:tabular-nums\]{font-variant-numeric:tabular-nums}.underline-offset-4{text-underline-offset:4px}.accent-synapse{accent-color:var(--color-synapse)}.accent-synapse-glow{accent-color:var(--color-synapse-glow)}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-100{opacity:1}.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\!{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(239\,68\,68\,0\.7\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#ef4444b3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(99\,102\,241\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#6366f126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(99\,102\,241\,0\.18\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#6366f12e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(163\,63\,255\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#a33fff26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_-4px_var\(--color-synapse-glow\)\]{--tw-shadow:0 0 16px -4px var(--tw-shadow-color,var(--color-synapse-glow));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_rgba\(99\,102\,241\,0\.3\)\]{--tw-shadow:0 0 16px var(--tw-shadow-color,#6366f14d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow:0 0 16px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px 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-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px 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)}.ring,.ring-1{--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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + 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)}.shadow-synapse\/10{--tw-shadow-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-synapse\/20{--tw-shadow-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-dream-glow{--tw-ring-color:var(--color-dream-glow)}.ring-dream\/60{--tw-ring-color:#a855f799}@supports (color:color-mix(in lab,red,red)){.ring-dream\/60{--tw-ring-color:color-mix(in oklab, var(--color-dream) 60%, transparent)}}.ring-recall\/30{--tw-ring-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.ring-recall\/30{--tw-ring-color:color-mix(in oklab, var(--color-recall) 30%, transparent)}}.ring-synapse\/60{--tw-ring-color:#6366f199}@supports (color:color-mix(in lab,red,red)){.ring-synapse\/60{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 60%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-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,)}.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-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))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.placeholder\:text-muted::placeholder{color:var(--color-muted)}@media(hover:hover){.hover\:z-10:hover{z-index:10}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-\[1\.03\]:hover{scale:1.03}.hover\:rotate-180:hover{rotate:180deg}.hover\:\!border-synapse\/30:hover{border-color:#6366f14d!important}@supports (color:color-mix(in lab,red,red)){.hover\:\!border-synapse\/30:hover{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)!important}}.hover\:border-\[\#5dcaa5\]\/50:hover{border-color:#5dcaa580}.hover\:border-\[\#5dcaa5\]\/60:hover{border-color:#5dcaa599}.hover\:border-synapse\/20:hover{border-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/20:hover{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.hover\:border-synapse\/30:hover{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/30:hover{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:border-synapse\/50:hover{border-color:#6366f180}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/50:hover{border-color:color-mix(in oklab,var(--color-synapse) 50%,transparent)}}.hover\:bg-\[\#5dcaa5\]\/25:hover{background-color:#5dcaa540}.hover\:bg-decay\/20:hover{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/20:hover{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.hover\:bg-decay\/30:hover{background-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/30:hover{background-color:color-mix(in oklab,var(--color-decay) 30%,transparent)}}.hover\:bg-decay\/\[0\.06\]:hover{background-color:#ef44440f}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/\[0\.06\]:hover{background-color:color-mix(in oklab,var(--color-decay) 6%,transparent)}}.hover\:bg-dream\/20:hover{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/20:hover{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.hover\:bg-dream\/30:hover{background-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/30:hover{background-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.hover\:bg-recall\/30:hover{background-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-recall\/30:hover{background-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.hover\:bg-synapse\/30:hover{background-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-synapse\/30:hover{background-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:bg-warning\/30:hover{background-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-warning\/30:hover{background-color:color-mix(in oklab,var(--color-warning) 30%,transparent)}}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.02\]:hover{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.hover\:bg-white\/\[0\.08\]:hover{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.08\]:hover{background-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.hover\:text-\[\#5dcaa5\]:hover{color:#5dcaa5}.hover\:text-bright:hover{color:var(--color-bright)}.hover\:text-dim:hover{color:var(--color-dim)}.hover\:text-synapse-glow:hover{color:var(--color-synapse-glow)}.hover\:text-text:hover{color:var(--color-text)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:\!border-synapse\/40:focus{border-color:#6366f166!important}@supports (color:color-mix(in lab,red,red)){.focus\:\!border-synapse\/40:focus{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)!important}}.focus\:border-dream\/40:focus{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.focus\:border-dream\/40:focus{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.focus\:border-synapse\/40:focus{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.focus\:border-synapse\/40:focus{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.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-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + 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-synapse-glow:focus{--tw-ring-color:var(--color-synapse-glow)}.focus\:ring-synapse\/15:focus{--tw-ring-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.focus\:ring-synapse\/15:focus{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 15%, transparent)}}.focus\:ring-synapse\/20:focus{--tw-ring-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.focus\:ring-synapse\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 20%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + 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-dream-glow\/60:focus-visible{--tw-ring-color:#c084fc99}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-dream-glow\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-dream-glow) 60%, transparent)}}.focus-visible\:ring-recall\/60:focus-visible{--tw-ring-color:#10b98199}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-recall\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-recall) 60%, transparent)}}.focus-visible\:ring-synapse\/60:focus-visible{--tw-ring-color:#6366f199}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-synapse\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 60%, transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:top-4{top:calc(var(--spacing) * 4)}.sm\:right-4{right:calc(var(--spacing) * 4)}.sm\:left-4{left:calc(var(--spacing) * 4)}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:inline-flex{display:inline-flex}.sm\:w-auto{width:auto}.sm\:max-w-md{max-width:var(--container-md)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:p-0{padding:calc(var(--spacing) * 0)}.sm\:\[padding-top\:0\]{padding-top:0}.sm\:\[padding-right\:0\]{padding-right:0}.sm\:\[padding-left\:0\]{padding-left:0}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}@media(min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:inline{display:inline}.md\:inline-flex{display:inline-flex}.md\:min-w-\[340px\]{min-width:340px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.md\:grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.md\:flex-row{flex-direction:row}.md\:pt-\[15vh\]{padding-top:15vh}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}}@media(min-width:64rem){.lg\:block{display:block}.lg\:inline{display:inline}.lg\:inline-flex{display:inline-flex}.lg\:w-56{width:calc(var(--spacing) * 56)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_280px\]{grid-template-columns:1fr 280px}.lg\:grid-cols-\[1fr_340px\]{grid-template-columns:1fr 340px}.lg\:grid-cols-\[1fr_360px\]{grid-template-columns:1fr 360px}.lg\:grid-cols-\[minmax\(0\,1fr\)_340px\]{grid-template-columns:minmax(0,1fr) 340px}}.\[\&\:\:-webkit-slider-thumb\]\:h-3::-webkit-slider-thumb{height:calc(var(--spacing) * 3)}.\[\&\:\:-webkit-slider-thumb\]\:w-3::-webkit-slider-thumb{width:calc(var(--spacing) * 3)}.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{border-radius:3.40282e38px}.\[\&\:\:-webkit-slider-thumb\]\:bg-synapse-glow::-webkit-slider-thumb{background-color:var(--color-synapse-glow)}.\[\&\:\:-webkit-slider-thumb\]\:shadow-\[0_0_8px_rgba\(129\,140\,248\,0\.4\)\]::-webkit-slider-thumb{--tw-shadow:0 0 8px var(--tw-shadow-color,#818cf866);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}html{background:var(--color-void);color:var(--color-text);font-family:var(--font-mono)}@supports (color:oklch(0 0 0)){:root{--color-synapse:oklch(58.5% .222 277);--color-synapse-glow:oklch(68.5% .169 277);--color-dream:oklch(62.7% .265 304);--color-dream-glow:oklch(71.4% .203 305);--color-memory:oklch(62.3% .214 259);--color-recall:oklch(69.6% .17 162);--color-decay:oklch(63.7% .237 25);--color-warning:oklch(76.9% .188 70);--color-node-fact:oklch(62.3% .214 259);--color-node-concept:oklch(60.6% .25 292);--color-node-event:oklch(76.9% .188 70);--color-node-person:oklch(69.6% .17 162);--color-node-place:oklch(71.5% .143 215);--color-node-note:oklch(55.1% .027 264);--color-node-pattern:oklch(65.6% .241 354);--color-node-decision:oklch(63.7% .237 25)}}body{min-height:100vh;margin:0;overflow:hidden}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-subtle);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-muted)}.glass{-webkit-backdrop-filter:blur(20px)saturate(180%);background:#16163873;border:1px solid #6366f114;box-shadow:inset 0 1px #ffffff08,0 4px 24px #0000004d}.glass-subtle{-webkit-backdrop-filter:blur(12px)saturate(150%);background:#10102a66;border:1px solid #6366f10f;box-shadow:inset 0 1px #ffffff05,0 2px 12px #0003}.glass-sidebar{-webkit-backdrop-filter:blur(24px)saturate(180%);background:#0a0a1a99;border-right:1px solid #6366f11a;box-shadow:inset -1px 0 #ffffff05,4px 0 24px #0000004d}.glass-panel{-webkit-backdrop-filter:blur(24px)saturate(180%);background:#0a0a1acc;border:1px solid #6366f11a;box-shadow:inset 0 1px #ffffff08,0 8px 32px #0006}.glow-synapse{box-shadow:0 0 20px #6366f14d,0 0 60px #6366f11a}.glow-dream{box-shadow:0 0 20px #a855f74d,0 0 60px #a855f71a}.glow-memory{box-shadow:0 0 20px #3b82f64d,0 0 60px #3b82f61a}@keyframes pulse-glow{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-glow{animation:2s ease-in-out infinite pulse-glow}@keyframes orb-float-1{0%,to{transform:translate(0)scale(1)}25%{transform:translate(60px,-40px)scale(1.1)}50%{transform:translate(-30px,-80px)scale(.95)}75%{transform:translate(-60px,-20px)scale(1.05)}}@keyframes orb-float-2{0%,to{transform:translate(0)scale(1)}25%{transform:translate(-50px,30px)scale(1.08)}50%{transform:translate(40px,60px)scale(.92)}75%{transform:translate(20px,-40px)scale(1.03)}}@keyframes orb-float-3{0%,to{transform:translate(0)scale(1)}25%{transform:translate(30px,50px)scale(1.05)}50%{transform:translate(-60px,20px)scale(.98)}75%{transform:translate(40px,-30px)scale(1.1)}}.ambient-orb{filter:blur(80px);pointer-events:none;z-index:0;opacity:.35;border-radius:50%;position:fixed}.ambient-orb-1{background:radial-gradient(circle,#a855f766,#0000 70%);width:400px;height:400px;animation:20s ease-in-out infinite orb-float-1;top:-10%;right:-5%}.ambient-orb-2{background:radial-gradient(circle,#6366f159,#0000 70%);width:350px;height:350px;animation:25s ease-in-out infinite orb-float-2;bottom:-15%;left:-5%}.ambient-orb-3{background:radial-gradient(circle,#f59e0b33,#0000 70%);width:300px;height:300px;animation:22s ease-in-out infinite orb-float-3;top:40%;left:40%}.nav-active-border{position:relative}.nav-active-border:before{content:"";background:linear-gradient(180deg,var(--color-synapse),var(--color-dream),var(--color-synapse));background-size:100% 200%;border-radius:1px;width:2px;animation:3s ease-in-out infinite gradient-shift;position:absolute;top:4px;bottom:4px;left:0}@keyframes gradient-shift{0%,to{background-position:0 0}50%{background-position:0 100%}}@keyframes float{0%,to{transform:translateY(0)translate(0)}25%{transform:translateY(-10px)translate(5px)}50%{transform:translateY(-5px)translate(-5px)}75%{transform:translateY(-15px)translate(3px)}}.retention-critical{color:var(--color-decay)}.retention-low{color:var(--color-warning)}.retention-good{color:var(--color-recall)}.retention-strong{color:var(--color-synapse)}@media not all and (prefers-reduced-motion:reduce){::view-transition-old(root){animation-duration:.18s;animation-timing-function:ease}::view-transition-new(root){animation-duration:.18s;animation-timing-function:ease}::view-transition-old(root){animation-name:vt-fade-out}::view-transition-new(root){animation-name:vt-fade-in}@keyframes vt-fade-out{0%{opacity:1}to{opacity:0}}@keyframes vt-fade-in{0%{opacity:0}to{opacity:1}}}@property --angle{syntax:"";inherits:false;initial-value:0deg}@property --shine{syntax:"";inherits:false;initial-value:0%}.reveal{opacity:0;transform:translateY(var(--reveal-y,16px));transition:opacity .55s cubic-bezier(.22,1,.36,1),transform .55s cubic-bezier(.22,1,.36,1);transition-delay:var(--reveal-delay,0s);will-change:opacity,transform}.reveal-in{opacity:1;transform:none}@media(prefers-reduced-motion:reduce){.reveal{opacity:1;transition:none;transform:none}}@media not all and (prefers-reduced-motion:reduce){.enter{transition:opacity .4s,transform .4s cubic-bezier(.22,1,.36,1)}@starting-style{.enter{opacity:0;transform:translateY(10px)}}}.live-border{isolation:isolate;position:relative}.live-border:before{content:"";border-radius:inherit;background:conic-gradient(from var(--angle),transparent 0%,var(--color-synapse) 18%,var(--color-dream) 33%,transparent 50%,transparent 100%);pointer-events:none;opacity:.6;z-index:-1;padding:1px;position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;-webkit-mask-image:linear-gradient(#000 0 0),linear-gradient(#000 0 0);-webkit-mask-position:0 0,0 0;-webkit-mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}@media not all and (prefers-reduced-motion:reduce){.live-border:before{animation:6s linear infinite border-rotate}@keyframes border-rotate{to{--angle:360deg}}}.spotlight-surface{position:relative;overflow:hidden}.spotlight-surface:after{content:"";pointer-events:none;background:radial-gradient(340px circle at var(--spot-x,50%) var(--spot-y,50%),#818cf81f,transparent 60%);opacity:var(--spot-o,0);z-index:0;transition:opacity .3s;position:absolute;top:0;right:0;bottom:0;left:0}.tilt-glare{position:relative;overflow:hidden}.tilt-glare:after{content:"";pointer-events:none;background:radial-gradient(circle at var(--glare-x,50%) var(--glare-y,50%),#ffffff24,transparent 45%);opacity:var(--glare-o,0);transition:opacity .3s;position:absolute;top:0;right:0;bottom:0;left:0}.breathe{animation:3.2s ease-in-out infinite breathe}@keyframes breathe{0%,to{filter:drop-shadow(0 0 2px);opacity:.85;transform:scale(1)}50%{filter:drop-shadow(0 0 7px);opacity:1;transform:scale(1.18)}}@media(prefers-reduced-motion:reduce){.breathe{animation:none}}.ping-host{position:relative}.ping-host:before{content:"";opacity:.6;z-index:-1;background:currentColor;border-radius:50%;position:absolute;top:0;right:0;bottom:0;left:0}@media not all and (prefers-reduced-motion:reduce){.ping-host:before{animation:2.4s cubic-bezier(0,0,.2,1) infinite ping}@keyframes ping{0%{opacity:.5;transform:scale(1)}80%,to{opacity:0;transform:scale(2.6)}}}.shimmer{background:#ffffff08;position:relative;overflow:hidden}.shimmer:after{content:"";background:linear-gradient(90deg,#0000,#818cf81f,#0000);position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%)}@media not all and (prefers-reduced-motion:reduce){.shimmer:after{animation:1.6s ease-in-out infinite shimmer}@keyframes shimmer{to{transform:translate(100%)}}}.text-aurora{background:linear-gradient(100deg,var(--color-synapse-glow),var(--color-dream-glow),var(--color-recall),var(--color-synapse-glow));color:#0000;background-size:250% 100%;-webkit-background-clip:text;background-clip:text}@media not all and (prefers-reduced-motion:reduce){.text-aurora{animation:8s ease-in-out infinite aurora-drift}@keyframes aurora-drift{0%,to{background-position:0%}50%{background-position:100%}}}.lift{transition:transform .28s cubic-bezier(.34,1.56,.64,1),box-shadow .28s,border-color .28s}.lift:hover{transform:translateY(-3px);box-shadow:0 12px 32px #00000059,0 0 0 1px #6366f12e}@media(prefers-reduced-motion:reduce){.lift:hover{transform:none}}.tabular-nums{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}:where(button,a,input,select,[role=button],[tabindex]):focus-visible{outline:2px solid var(--color-synapse-glow);outline-offset:2px;border-radius:.4rem}@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-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@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-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}.toast-layer.svelte-pry2ep{position:fixed;z-index:60;pointer-events:none;display:flex;flex-direction:column;gap:.5rem;right:1.25rem;bottom:1.25rem;max-width:22rem;width:calc(100vw - 2.5rem)}@media(max-width:768px){.toast-layer.svelte-pry2ep{right:.75rem;left:.75rem;bottom:auto;top:5.25rem;max-width:none;width:auto;align-items:stretch}}.toast-item.svelte-pry2ep{pointer-events:auto;position:relative;display:flex;gap:.75rem;align-items:stretch;text-align:left;font:inherit;color:inherit;background:#0c0e16b8;backdrop-filter:blur(14px) saturate(160%);-webkit-backdrop-filter:blur(14px) saturate(160%);border:1px solid rgba(255,255,255,.06);border-radius:.75rem;padding:.75rem .9rem .75rem .5rem;overflow:hidden;box-shadow:0 10px 40px -12px #000c,0 0 22px -6px var(--toast-color);cursor:pointer;animation:svelte-pry2ep-toast-in .32s cubic-bezier(.16,1,.3,1);transform-origin:right center;transition:transform .15s ease,box-shadow .15s ease}.toast-item.svelte-pry2ep:hover{transform:translateY(-1px) scale(1.015);box-shadow:0 14px 48px -12px #000000d9,0 0 32px -4px var(--toast-color)}.toast-item.svelte-pry2ep:focus-visible{outline:1px solid var(--toast-color);outline-offset:2px}.toast-accent.svelte-pry2ep{width:3px;border-radius:2px;background:var(--toast-color);box-shadow:0 0 10px var(--toast-color);flex-shrink:0}.toast-body.svelte-pry2ep{display:flex;flex-direction:column;gap:.15rem;flex:1;min-width:0}.toast-head.svelte-pry2ep{display:flex;align-items:center;gap:.5rem}.toast-icon.svelte-pry2ep{color:var(--toast-color);font-size:.95rem;text-shadow:0 0 8px var(--toast-color);line-height:1;width:1rem;display:inline-flex;justify-content:center}.toast-title.svelte-pry2ep{color:#f5f5fa;font-size:.82rem;font-weight:600;letter-spacing:.01em}.toast-sub.svelte-pry2ep{color:#b0b6c4;font-size:.74rem;line-height:1.35;padding-left:1.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toast-progress.svelte-pry2ep{position:absolute;left:0;bottom:0;height:2px;width:100%;background:#ffffff0a}.toast-progress-fill.svelte-pry2ep{height:100%;background:var(--toast-color);opacity:.55;transform-origin:left center;animation:svelte-pry2ep-toast-progress var(--toast-dwell) linear forwards}.toast-item.svelte-pry2ep:hover .toast-progress-fill:where(.svelte-pry2ep),.toast-item.svelte-pry2ep:focus-visible .toast-progress-fill:where(.svelte-pry2ep){animation-play-state:paused}@keyframes svelte-pry2ep-toast-in{0%{opacity:0;transform:translate(24px) scale(.98)}to{opacity:1;transform:translate(0) scale(1)}}@media(max-width:768px){.toast-item.svelte-pry2ep{transform-origin:top center;animation:svelte-pry2ep-toast-in-mobile .3s cubic-bezier(.16,1,.3,1)}}@keyframes svelte-pry2ep-toast-in-mobile{0%{opacity:0;transform:translateY(-12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes svelte-pry2ep-toast-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@media(prefers-reduced-motion:reduce){.toast-item.svelte-pry2ep{animation:none}.toast-progress-fill.svelte-pry2ep{animation:none;transform:scaleX(.5)}}.strip-item.svelte-1kk3799{display:inline-flex;align-items:center;gap:.4rem;padding:0 .75rem;white-space:nowrap;flex-shrink:0}.strip-divider.svelte-1kk3799{width:1px;height:14px;background:#6366f11f;flex-shrink:0}.ambient-strip.ambient-flash.svelte-1kk3799{background:linear-gradient(90deg,#ef444414,#ef444400 70%),#0006;border-bottom-color:#ef444459;transition:background .3s ease,border-color .3s ease}@keyframes svelte-1kk3799-ping-slow{0%{transform:scale(1);opacity:.8}80%,to{transform:scale(2);opacity:0}}.animate-ping-slow{animation:svelte-1kk3799-ping-slow 2.2s cubic-bezier(0,0,.2,1) infinite}@media(prefers-reduced-motion:reduce){.ambient-strip.svelte-1kk3799 .animate-ping,.ambient-strip.svelte-1kk3799 .animate-ping-slow,.ambient-strip.svelte-1kk3799 .animate-pulse{animation:none!important}}.verdict-bar.svelte-1j425e6{border-bottom:1px solid rgba(255,255,255,.06);background:#080912b8;backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);box-shadow:0 6px 24px #0000002e}.verdict-summary.svelte-1j425e6{width:100%;min-height:2.75rem;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center;gap:.75rem;padding:.55rem 1rem;color:var(--color-text);text-align:left;font:inherit}.sr-only.svelte-1j425e6{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.label.svelte-1j425e6,.field-label.svelte-1j425e6,.appeal-row.svelte-1j425e6>span:where(.svelte-1j425e6){color:var(--color-dim);font-size:.68rem;text-transform:uppercase;letter-spacing:0}.levels.svelte-1j425e6{display:flex;align-items:center;gap:.25rem}.levels.svelte-1j425e6 span:where(.svelte-1j425e6){border:1px solid rgba(255,255,255,.08);border-radius:.35rem;padding:.18rem .38rem;color:var(--color-muted);font-size:.64rem;line-height:1}.levels.svelte-1j425e6 span.active:where(.svelte-1j425e6){color:var(--color-bright);border-color:var(--verdict-color);background:color-mix(in srgb,var(--verdict-color) 18%,transparent);box-shadow:0 0 14px color-mix(in srgb,var(--verdict-color) 28%,transparent)}.summary-text.svelte-1j425e6{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.78rem;color:var(--color-dim)}.when.svelte-1j425e6{color:var(--color-muted);font-size:.68rem}.receipt.svelte-1j425e6{margin:0 1rem .75rem;border:1px solid rgba(255,255,255,.08);border-radius:.5rem;background:#0a0a1ac7;padding:.85rem}.receipt-grid.svelte-1j425e6{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(10rem,.8fr) minmax(0,1.1fr) minmax(0,1.1fr);gap:.85rem}.receipt.svelte-1j425e6 p:where(.svelte-1j425e6),.receipt.svelte-1j425e6 li:where(.svelte-1j425e6){margin:.25rem 0 0;color:var(--color-text);font-size:.76rem;line-height:1.45;overflow-wrap:anywhere}.receipt.svelte-1j425e6 ul:where(.svelte-1j425e6){margin:.25rem 0 0;padding-left:1rem}.appeal-row.svelte-1j425e6{display:flex;align-items:center;gap:.4rem;margin-top:.85rem;flex-wrap:wrap}.appeal-row.svelte-1j425e6 button:where(.svelte-1j425e6),.appeal-row.svelte-1j425e6 p:where(.svelte-1j425e6){border:1px solid rgba(255,255,255,.1);border-radius:.4rem;padding:.35rem .6rem;color:var(--color-text);background:#ffffff0a;font-size:.72rem;margin:0}.appeal-row.svelte-1j425e6 button:where(.svelte-1j425e6):hover:not(:disabled),.verdict-summary.svelte-1j425e6:hover{background:#ffffff0d}.appeal-row.svelte-1j425e6 button:where(.svelte-1j425e6):disabled{opacity:.55;cursor:wait}.tone-pass.svelte-1j425e6,.tone-note.svelte-1j425e6{--verdict-color: #10b981}.tone-caution.svelte-1j425e6{--verdict-color: #f59e0b}.tone-veto.svelte-1j425e6{--verdict-color: #ef4444}.tone-appealed.svelte-1j425e6{--verdict-color: #818cf8}@media(max-width:900px){.verdict-summary.svelte-1j425e6{grid-template-columns:auto minmax(0,1fr) auto}.levels.svelte-1j425e6{grid-column:1 / -1;order:4;overflow-x:auto;padding-bottom:.1rem}.receipt-grid.svelte-1j425e6{grid-template-columns:1fr}}.theme-toggle.svelte-1cmi4dh{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:8px;background:#6366f10f;border:1px solid rgba(99,102,241,.14);color:var(--color-text);cursor:pointer;transition:background .2s ease,border-color .2s ease,color .2s ease,transform .12s ease;-webkit-tap-highlight-color:transparent}.theme-toggle.svelte-1cmi4dh:hover{background:#6366f124;border-color:#6366f14d;color:var(--color-bright)}.theme-toggle.svelte-1cmi4dh:active{transform:scale(.94)}.theme-toggle.svelte-1cmi4dh:focus-visible{outline:1px solid var(--color-synapse);outline-offset:2px}.icon-wrap.svelte-1cmi4dh{position:relative;width:18px;height:18px;display:inline-block}.icon.svelte-1cmi4dh{position:absolute;top:0;right:0;bottom:0;left:0;width:18px;height:18px;opacity:0;transform:scale(.7) rotate(-30deg);transition:opacity .2s ease,transform .2s cubic-bezier(.16,1,.3,1);pointer-events:none}.icon.active.svelte-1cmi4dh{opacity:1;transform:scale(1) rotate(0)}.theme-toggle[data-mode=dark].svelte-1cmi4dh{color:var(--color-synapse-glow, #818cf8)}.theme-toggle[data-mode=light].svelte-1cmi4dh{color:var(--color-warning, #f59e0b)}.theme-toggle[data-mode=auto].svelte-1cmi4dh{color:var(--color-dream-glow, #c084fc)}@media(prefers-reduced-motion:reduce){.theme-toggle.svelte-1cmi4dh,.icon.svelte-1cmi4dh{transition:none}}.safe-bottom.svelte-12qhfyh{padding-bottom:env(safe-area-inset-bottom,0px)}.logo-mark.svelte-12qhfyh{transition:transform .3s cubic-bezier(.34,1.56,.64,1),box-shadow .3s ease}.logo-link.svelte-12qhfyh:hover .logo-mark:where(.svelte-12qhfyh){transform:rotate(-6deg) scale(1.08);box-shadow:0 0 0 1px #818cf866,0 0 22px #6366f180}.nav-link.text-synapse-glow.svelte-12qhfyh .nav-icon:where(.svelte-12qhfyh) svg,.nav-active-border.svelte-12qhfyh .nav-icon:where(.svelte-12qhfyh) svg{filter:drop-shadow(0 0 6px rgba(129,140,248,.55))} diff --git a/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css.br b/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css.br new file mode 100644 index 0000000..efc434f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css.br differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css.gz b/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css.gz new file mode 100644 index 0000000..610a041 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/0.BRosXaQv.css.gz differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css b/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css deleted file mode 100644 index ed2360d..0000000 --- a/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.2.0 | 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-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--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-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-duration:initial;--tw-ease:initial;--angle:0deg;--shine:0%}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", "Fira Code", "SF Mono", monospace;--color-amber-400:oklch(82.8% .189 84.429);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--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);--color-void:#050510;--color-abyss:#0a0a1a;--color-deep:#10102a;--color-surface:#161638;--color-elevated:#1e1e4a;--color-subtle:#2a2a5e;--color-muted:#4a4a7a;--color-dim:#7a7aaa;--color-text:#e0e0ff;--color-bright:#fff;--color-synapse:#6366f1;--color-synapse-glow:#818cf8;--color-dream:#a855f7;--color-dream-glow:#c084fc;--color-memory:#3b82f6;--color-recall:#10b981;--color-decay:#ef4444;--color-warning:#f59e0b;--color-node-pattern:#ec4899}}@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%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, 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;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{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]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.end\!{inset-inline-end:var(--spacing)!important}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1{top:calc(var(--spacing) * 1)}.top-1\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-10{top:calc(var(--spacing) * 10)}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.-left-\[29px\]{left:-29px}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-3\.5{left:calc(var(--spacing) * 3.5)}.left-4{left:calc(var(--spacing) * 4)}.left-6{left:calc(var(--spacing) * 6)}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-\[-12px\]{margin-top:-12px}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.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-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-\[520px\]{height:520px}.h-\[560px\]{height:560px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[620px\]{max-height:620px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-\[240px\]{min-height:240px}.min-h-\[320px\]{min-height:320px}.min-h-\[520px\]{min-height:520px}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-96{width:calc(var(--spacing) * 96)}.w-\[3px\]{width:3px}.w-\[90\%\]{width:90%}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-20{max-width:calc(var(--spacing) * 20)}.max-w-\[220px\]{max-width:220px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-12{min-width:calc(var(--spacing) * 12)}.min-w-16{min-width:calc(var(--spacing) * 16)}.min-w-64{min-width:calc(var(--spacing) * 64)}.min-w-\[2rem\]{min-width:2rem}.min-w-\[3\.5rem\]{min-width:3.5rem}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-separate{border-collapse:separate}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-150{--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[fadeSlide_0\.35s_ease-out_both\]{animation:.35s ease-out both fadeSlide}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\[2px\]{gap:2px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}: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)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.\!border-decay\/20{border-color:#ef444433!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/20{border-color:color-mix(in oklab,var(--color-decay) 20%,transparent)!important}}.\!border-decay\/30{border-color:#ef44444d!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/30{border-color:color-mix(in oklab,var(--color-decay) 30%,transparent)!important}}.\!border-decay\/40{border-color:#ef444466!important}@supports (color:color-mix(in lab,red,red)){.\!border-decay\/40{border-color:color-mix(in oklab,var(--color-decay) 40%,transparent)!important}}.\!border-dream\/20{border-color:#a855f733!important}@supports (color:color-mix(in lab,red,red)){.\!border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)!important}}.\!border-synapse\/15{border-color:#6366f126!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/15{border-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)!important}}.\!border-synapse\/20{border-color:#6366f133!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/20{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)!important}}.\!border-synapse\/25{border-color:#6366f140!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/25{border-color:color-mix(in oklab,var(--color-synapse) 25%,transparent)!important}}.\!border-synapse\/30{border-color:#6366f14d!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)!important}}.\!border-synapse\/40{border-color:#6366f166!important}@supports (color:color-mix(in lab,red,red)){.\!border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)!important}}.border-\[\#A33FFF\]\/40{border-color:#a33fff66}.border-decay\/20{border-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.border-decay\/20{border-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.border-dream-glow\/40{border-color:#c084fc66}@supports (color:color-mix(in lab,red,red)){.border-dream-glow\/40{border-color:color-mix(in oklab,var(--color-dream-glow) 40%,transparent)}}.border-dream\/10{border-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.border-dream\/10{border-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.border-dream\/20{border-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.border-dream\/20{border-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.border-dream\/30{border-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.border-dream\/30{border-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.border-dream\/40{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.border-dream\/40{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.border-dream\/50{border-color:#a855f780}@supports (color:color-mix(in lab,red,red)){.border-dream\/50{border-color:color-mix(in oklab,var(--color-dream) 50%,transparent)}}.border-recall\/25{border-color:#10b98140}@supports (color:color-mix(in lab,red,red)){.border-recall\/25{border-color:color-mix(in oklab,var(--color-recall) 25%,transparent)}}.border-recall\/30{border-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.border-recall\/30{border-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.border-recall\/40{border-color:#10b98166}@supports (color:color-mix(in lab,red,red)){.border-recall\/40{border-color:color-mix(in oklab,var(--color-recall) 40%,transparent)}}.border-subtle\/15{border-color:#2a2a5e26}@supports (color:color-mix(in lab,red,red)){.border-subtle\/15{border-color:color-mix(in oklab,var(--color-subtle) 15%,transparent)}}.border-subtle\/20{border-color:#2a2a5e33}@supports (color:color-mix(in lab,red,red)){.border-subtle\/20{border-color:color-mix(in oklab,var(--color-subtle) 20%,transparent)}}.border-subtle\/30{border-color:#2a2a5e4d}@supports (color:color-mix(in lab,red,red)){.border-subtle\/30{border-color:color-mix(in oklab,var(--color-subtle) 30%,transparent)}}.border-synapse{border-color:var(--color-synapse)}.border-synapse\/5{border-color:#6366f10d}@supports (color:color-mix(in lab,red,red)){.border-synapse\/5{border-color:color-mix(in oklab,var(--color-synapse) 5%,transparent)}}.border-synapse\/10{border-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.border-synapse\/10{border-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.border-synapse\/15{border-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.border-synapse\/15{border-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)}}.border-synapse\/20{border-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.border-synapse\/20{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.border-synapse\/25{border-color:#6366f140}@supports (color:color-mix(in lab,red,red)){.border-synapse\/25{border-color:color-mix(in oklab,var(--color-synapse) 25%,transparent)}}.border-synapse\/30{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.border-synapse\/30{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.border-synapse\/40{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.border-synapse\/40{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.border-transparent{border-color:#0000}.border-warning\/30{border-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.border-warning\/30{border-color:color-mix(in oklab,var(--color-warning) 30%,transparent)}}.border-warning\/40{border-color:#f59e0b66}@supports (color:color-mix(in lab,red,red)){.border-warning\/40{border-color:color-mix(in oklab,var(--color-warning) 40%,transparent)}}.border-warning\/50{border-color:#f59e0b80}@supports (color:color-mix(in lab,red,red)){.border-warning\/50{border-color:color-mix(in oklab,var(--color-warning) 50%,transparent)}}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.border-t-dream{border-top-color:var(--color-dream)}.border-t-synapse{border-top-color:var(--color-synapse)}.border-t-warning{border-top-color:var(--color-warning)}.bg-\[\#A33FFF\]{background-color:#a33fff}.bg-\[\#A33FFF\]\/10{background-color:#a33fff1a}.bg-amber-400{background-color:var(--color-amber-400)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-decay{background-color:var(--color-decay)}.bg-decay\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-decay\/10{background-color:color-mix(in oklab,var(--color-decay) 10%,transparent)}}.bg-decay\/20{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.bg-decay\/20{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.bg-decay\/\[0\.05\]{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.bg-decay\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-decay) 5%,transparent)}}.bg-deep{background-color:var(--color-deep)}.bg-deep\/40{background-color:#10102a66}@supports (color:color-mix(in lab,red,red)){.bg-deep\/40{background-color:color-mix(in oklab,var(--color-deep) 40%,transparent)}}.bg-deep\/60{background-color:#10102a99}@supports (color:color-mix(in lab,red,red)){.bg-deep\/60{background-color:color-mix(in oklab,var(--color-deep) 60%,transparent)}}.bg-dream{background-color:var(--color-dream)}.bg-dream\/5{background-color:#a855f70d}@supports (color:color-mix(in lab,red,red)){.bg-dream\/5{background-color:color-mix(in oklab,var(--color-dream) 5%,transparent)}}.bg-dream\/10{background-color:#a855f71a}@supports (color:color-mix(in lab,red,red)){.bg-dream\/10{background-color:color-mix(in oklab,var(--color-dream) 10%,transparent)}}.bg-dream\/15{background-color:#a855f726}@supports (color:color-mix(in lab,red,red)){.bg-dream\/15{background-color:color-mix(in oklab,var(--color-dream) 15%,transparent)}}.bg-dream\/20{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.bg-dream\/20{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.bg-muted{background-color:var(--color-muted)}.bg-node-pattern{background-color:var(--color-node-pattern)}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-recall{background-color:var(--color-recall)}.bg-recall\/10{background-color:#10b9811a}@supports (color:color-mix(in lab,red,red)){.bg-recall\/10{background-color:color-mix(in oklab,var(--color-recall) 10%,transparent)}}.bg-recall\/15{background-color:#10b98126}@supports (color:color-mix(in lab,red,red)){.bg-recall\/15{background-color:color-mix(in oklab,var(--color-recall) 15%,transparent)}}.bg-recall\/20{background-color:#10b98133}@supports (color:color-mix(in lab,red,red)){.bg-recall\/20{background-color:color-mix(in oklab,var(--color-recall) 20%,transparent)}}.bg-synapse{background-color:var(--color-synapse)}.bg-synapse-glow{background-color:var(--color-synapse-glow)}.bg-synapse\/10{background-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/10{background-color:color-mix(in oklab,var(--color-synapse) 10%,transparent)}}.bg-synapse\/15{background-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/15{background-color:color-mix(in oklab,var(--color-synapse) 15%,transparent)}}.bg-synapse\/20{background-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/20{background-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.bg-synapse\/25{background-color:#6366f140}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/25{background-color:color-mix(in oklab,var(--color-synapse) 25%,transparent)}}.bg-synapse\/70{background-color:#6366f1b3}@supports (color:color-mix(in lab,red,red)){.bg-synapse\/70{background-color:color-mix(in oklab,var(--color-synapse) 70%,transparent)}}.bg-transparent{background-color:#0000}.bg-void{background-color:var(--color-void)}.bg-void\/60{background-color:#05051099}@supports (color:color-mix(in lab,red,red)){.bg-void\/60{background-color:color-mix(in oklab,var(--color-void) 60%,transparent)}}.bg-warning{background-color:var(--color-warning)}.bg-warning\/5{background-color:#f59e0b0d}@supports (color:color-mix(in lab,red,red)){.bg-warning\/5{background-color:color-mix(in oklab,var(--color-warning) 5%,transparent)}}.bg-warning\/20{background-color:#f59e0b33}@supports (color:color-mix(in lab,red,red)){.bg-warning\/20{background-color:color-mix(in oklab,var(--color-warning) 20%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.bg-white\/\[0\.05\]{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-dream{--tw-gradient-from:var(--color-dream);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-synapse{--tw-gradient-to:var(--color-synapse);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-0{padding:calc(var(--spacing) * 0)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-10{padding:calc(var(--spacing) * 10)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.\[padding-top\:max\(0\.75rem\,env\(safe-area-inset-top\)\)\]{padding-top:max(.75rem,env(safe-area-inset-top))}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-\[10vh\]{padding-top:10vh}.\[padding-right\:max\(0\.75rem\,env\(safe-area-inset-right\)\)\]{padding-right:max(.75rem,env(safe-area-inset-right))}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.\[padding-left\:max\(0\.75rem\,env\(safe-area-inset-left\)\)\]{padding-left:max(.75rem,env(safe-area-inset-left))}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-10{padding-left:calc(var(--spacing) * 10)}.pl-14{padding-left:calc(var(--spacing) * 14)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-bottom{vertical-align:bottom}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.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-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.text-pretty{text-wrap:pretty}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#E4C8FF\]{color:#e4c8ff}.text-amber-400{color:var(--color-amber-400)}.text-bright{color:var(--color-bright)}.text-decay{color:var(--color-decay)}.text-decay\/60{color:#ef444499}@supports (color:color-mix(in lab,red,red)){.text-decay\/60{color:color-mix(in oklab,var(--color-decay) 60%,transparent)}}.text-decay\/80{color:#ef4444cc}@supports (color:color-mix(in lab,red,red)){.text-decay\/80{color:color-mix(in oklab,var(--color-decay) 80%,transparent)}}.text-dim{color:var(--color-dim)}.text-dim\/70{color:#7a7aaab3}@supports (color:color-mix(in lab,red,red)){.text-dim\/70{color:color-mix(in oklab,var(--color-dim) 70%,transparent)}}.text-dream{color:var(--color-dream)}.text-dream-glow{color:var(--color-dream-glow)}.text-dream\/40{color:#a855f766}@supports (color:color-mix(in lab,red,red)){.text-dream\/40{color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.text-dream\/50{color:#a855f780}@supports (color:color-mix(in lab,red,red)){.text-dream\/50{color:color-mix(in oklab,var(--color-dream) 50%,transparent)}}.text-dream\/80{color:#a855f7cc}@supports (color:color-mix(in lab,red,red)){.text-dream\/80{color:color-mix(in oklab,var(--color-dream) 80%,transparent)}}.text-memory{color:var(--color-memory)}.text-muted{color:var(--color-muted)}.text-muted\/50{color:#4a4a7a80}@supports (color:color-mix(in lab,red,red)){.text-muted\/50{color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.text-muted\/60{color:#4a4a7a99}@supports (color:color-mix(in lab,red,red)){.text-muted\/60{color:color-mix(in oklab,var(--color-muted) 60%,transparent)}}.text-node-pattern{color:var(--color-node-pattern)}.text-purple-400{color:var(--color-purple-400)}.text-recall{color:var(--color-recall)}.text-subtle{color:var(--color-subtle)}.text-synapse{color:var(--color-synapse)}.text-synapse-glow{color:var(--color-synapse-glow)}.text-text{color:var(--color-text)}.text-text\/80{color:#e0e0ffcc}@supports (color:color-mix(in lab,red,red)){.text-text\/80{color:color-mix(in oklab,var(--color-text) 80%,transparent)}}.text-warning{color:var(--color-warning)}.text-warning\/60{color:#f59e0b99}@supports (color:color-mix(in lab,red,red)){.text-warning\/60{color:color-mix(in oklab,var(--color-warning) 60%,transparent)}}.text-warning\/70{color:#f59e0bb3}@supports (color:color-mix(in lab,red,red)){.text-warning\/70{color:color-mix(in oklab,var(--color-warning) 70%,transparent)}}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline-offset-4{text-underline-offset:4px}.accent-synapse{accent-color:var(--color-synapse)}.accent-synapse-glow{accent-color:var(--color-synapse-glow)}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-100{opacity:1}.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\!{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(239\,68\,68\,0\.7\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#ef4444b3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(99\,102\,241\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#6366f126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(99\,102\,241\,0\.18\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#6366f12e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(163\,63\,255\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#a33fff26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_-4px_var\(--color-synapse-glow\)\]{--tw-shadow:0 0 16px -4px var(--tw-shadow-color,var(--color-synapse-glow));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_rgba\(99\,102\,241\,0\.3\)\]{--tw-shadow:0 0 16px var(--tw-shadow-color,#6366f14d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow:0 0 16px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px 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-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px 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)}.ring,.ring-1{--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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + 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)}.shadow-synapse\/10{--tw-shadow-color:#6366f11a}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-synapse\/20{--tw-shadow-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.shadow-synapse\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-synapse) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-dream-glow{--tw-ring-color:var(--color-dream-glow)}.ring-dream\/60{--tw-ring-color:#a855f799}@supports (color:color-mix(in lab,red,red)){.ring-dream\/60{--tw-ring-color:color-mix(in oklab, var(--color-dream) 60%, transparent)}}.ring-recall\/30{--tw-ring-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.ring-recall\/30{--tw-ring-color:color-mix(in oklab, var(--color-recall) 30%, transparent)}}.ring-synapse\/60{--tw-ring-color:#6366f199}@supports (color:color-mix(in lab,red,red)){.ring-synapse\/60{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 60%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-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,)}.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-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))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.placeholder\:text-muted::placeholder{color:var(--color-muted)}@media(hover:hover){.hover\:z-10:hover{z-index:10}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-\[1\.03\]:hover{scale:1.03}.hover\:rotate-180:hover{rotate:180deg}.hover\:\!border-synapse\/30:hover{border-color:#6366f14d!important}@supports (color:color-mix(in lab,red,red)){.hover\:\!border-synapse\/30:hover{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)!important}}.hover\:border-synapse\/20:hover{border-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/20:hover{border-color:color-mix(in oklab,var(--color-synapse) 20%,transparent)}}.hover\:border-synapse\/30:hover{border-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/30:hover{border-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:border-synapse\/50:hover{border-color:#6366f180}@supports (color:color-mix(in lab,red,red)){.hover\:border-synapse\/50:hover{border-color:color-mix(in oklab,var(--color-synapse) 50%,transparent)}}.hover\:bg-decay\/20:hover{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/20:hover{background-color:color-mix(in oklab,var(--color-decay) 20%,transparent)}}.hover\:bg-decay\/30:hover{background-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/30:hover{background-color:color-mix(in oklab,var(--color-decay) 30%,transparent)}}.hover\:bg-decay\/\[0\.06\]:hover{background-color:#ef44440f}@supports (color:color-mix(in lab,red,red)){.hover\:bg-decay\/\[0\.06\]:hover{background-color:color-mix(in oklab,var(--color-decay) 6%,transparent)}}.hover\:bg-dream\/20:hover{background-color:#a855f733}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/20:hover{background-color:color-mix(in oklab,var(--color-dream) 20%,transparent)}}.hover\:bg-dream\/30:hover{background-color:#a855f74d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-dream\/30:hover{background-color:color-mix(in oklab,var(--color-dream) 30%,transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.hover\:bg-recall\/30:hover{background-color:#10b9814d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-recall\/30:hover{background-color:color-mix(in oklab,var(--color-recall) 30%,transparent)}}.hover\:bg-synapse\/30:hover{background-color:#6366f14d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-synapse\/30:hover{background-color:color-mix(in oklab,var(--color-synapse) 30%,transparent)}}.hover\:bg-warning\/30:hover{background-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-warning\/30:hover{background-color:color-mix(in oklab,var(--color-warning) 30%,transparent)}}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.02\]:hover{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.hover\:bg-white\/\[0\.08\]:hover{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.08\]:hover{background-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.hover\:text-bright:hover{color:var(--color-bright)}.hover\:text-dim:hover{color:var(--color-dim)}.hover\:text-synapse-glow:hover{color:var(--color-synapse-glow)}.hover\:text-text:hover{color:var(--color-text)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:\!border-synapse\/40:focus{border-color:#6366f166!important}@supports (color:color-mix(in lab,red,red)){.focus\:\!border-synapse\/40:focus{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)!important}}.focus\:border-dream\/40:focus{border-color:#a855f766}@supports (color:color-mix(in lab,red,red)){.focus\:border-dream\/40:focus{border-color:color-mix(in oklab,var(--color-dream) 40%,transparent)}}.focus\:border-synapse\/40:focus{border-color:#6366f166}@supports (color:color-mix(in lab,red,red)){.focus\:border-synapse\/40:focus{border-color:color-mix(in oklab,var(--color-synapse) 40%,transparent)}}.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-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + 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-synapse-glow:focus{--tw-ring-color:var(--color-synapse-glow)}.focus\:ring-synapse\/15:focus{--tw-ring-color:#6366f126}@supports (color:color-mix(in lab,red,red)){.focus\:ring-synapse\/15:focus{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 15%, transparent)}}.focus\:ring-synapse\/20:focus{--tw-ring-color:#6366f133}@supports (color:color-mix(in lab,red,red)){.focus\:ring-synapse\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 20%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + 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-dream-glow\/60:focus-visible{--tw-ring-color:#c084fc99}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-dream-glow\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-dream-glow) 60%, transparent)}}.focus-visible\:ring-recall\/60:focus-visible{--tw-ring-color:#10b98199}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-recall\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-recall) 60%, transparent)}}.focus-visible\:ring-synapse\/60:focus-visible{--tw-ring-color:#6366f199}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-synapse\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-synapse) 60%, transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:top-4{top:calc(var(--spacing) * 4)}.sm\:right-4{right:calc(var(--spacing) * 4)}.sm\:left-4{left:calc(var(--spacing) * 4)}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:inline-flex{display:inline-flex}.sm\:w-auto{width:auto}.sm\:max-w-md{max-width:var(--container-md)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:p-0{padding:calc(var(--spacing) * 0)}.sm\:\[padding-top\:0\]{padding-top:0}.sm\:\[padding-right\:0\]{padding-right:0}.sm\:\[padding-left\:0\]{padding-left:0}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}}@media(min-width:48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:inline-flex{display:inline-flex}.md\:min-w-\[340px\]{min-width:340px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.md\:grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.md\:flex-row{flex-direction:row}.md\:pt-\[15vh\]{padding-top:15vh}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}}@media(min-width:64rem){.lg\:block{display:block}.lg\:inline-flex{display:inline-flex}.lg\:w-56{width:calc(var(--spacing) * 56)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_280px\]{grid-template-columns:1fr 280px}.lg\:grid-cols-\[1fr_340px\]{grid-template-columns:1fr 340px}.lg\:grid-cols-\[1fr_360px\]{grid-template-columns:1fr 360px}.lg\:grid-cols-\[minmax\(0\,1fr\)_340px\]{grid-template-columns:minmax(0,1fr) 340px}}.\[\&\:\:-webkit-slider-thumb\]\:h-3::-webkit-slider-thumb{height:calc(var(--spacing) * 3)}.\[\&\:\:-webkit-slider-thumb\]\:w-3::-webkit-slider-thumb{width:calc(var(--spacing) * 3)}.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{border-radius:3.40282e38px}.\[\&\:\:-webkit-slider-thumb\]\:bg-synapse-glow::-webkit-slider-thumb{background-color:var(--color-synapse-glow)}.\[\&\:\:-webkit-slider-thumb\]\:shadow-\[0_0_8px_rgba\(129\,140\,248\,0\.4\)\]::-webkit-slider-thumb{--tw-shadow:0 0 8px var(--tw-shadow-color,#818cf866);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}html{background:var(--color-void);color:var(--color-text);font-family:var(--font-mono)}@supports (color:oklch(0 0 0)){:root{--color-synapse:oklch(58.5% .222 277);--color-synapse-glow:oklch(68.5% .169 277);--color-dream:oklch(62.7% .265 304);--color-dream-glow:oklch(71.4% .203 305);--color-memory:oklch(62.3% .214 259);--color-recall:oklch(69.6% .17 162);--color-decay:oklch(63.7% .237 25);--color-warning:oklch(76.9% .188 70);--color-node-fact:oklch(62.3% .214 259);--color-node-concept:oklch(60.6% .25 292);--color-node-event:oklch(76.9% .188 70);--color-node-person:oklch(69.6% .17 162);--color-node-place:oklch(71.5% .143 215);--color-node-note:oklch(55.1% .027 264);--color-node-pattern:oklch(65.6% .241 354);--color-node-decision:oklch(63.7% .237 25)}}body{min-height:100vh;margin:0;overflow:hidden}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-subtle);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-muted)}.glass{-webkit-backdrop-filter:blur(20px)saturate(180%);background:#16163873;border:1px solid #6366f114;box-shadow:inset 0 1px #ffffff08,0 4px 24px #0000004d}.glass-subtle{-webkit-backdrop-filter:blur(12px)saturate(150%);background:#10102a66;border:1px solid #6366f10f;box-shadow:inset 0 1px #ffffff05,0 2px 12px #0003}.glass-sidebar{-webkit-backdrop-filter:blur(24px)saturate(180%);background:#0a0a1a99;border-right:1px solid #6366f11a;box-shadow:inset -1px 0 #ffffff05,4px 0 24px #0000004d}.glass-panel{-webkit-backdrop-filter:blur(24px)saturate(180%);background:#0a0a1acc;border:1px solid #6366f11a;box-shadow:inset 0 1px #ffffff08,0 8px 32px #0006}.glow-synapse{box-shadow:0 0 20px #6366f14d,0 0 60px #6366f11a}.glow-dream{box-shadow:0 0 20px #a855f74d,0 0 60px #a855f71a}.glow-memory{box-shadow:0 0 20px #3b82f64d,0 0 60px #3b82f61a}@keyframes pulse-glow{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse-glow{animation:2s ease-in-out infinite pulse-glow}@keyframes orb-float-1{0%,to{transform:translate(0)scale(1)}25%{transform:translate(60px,-40px)scale(1.1)}50%{transform:translate(-30px,-80px)scale(.95)}75%{transform:translate(-60px,-20px)scale(1.05)}}@keyframes orb-float-2{0%,to{transform:translate(0)scale(1)}25%{transform:translate(-50px,30px)scale(1.08)}50%{transform:translate(40px,60px)scale(.92)}75%{transform:translate(20px,-40px)scale(1.03)}}@keyframes orb-float-3{0%,to{transform:translate(0)scale(1)}25%{transform:translate(30px,50px)scale(1.05)}50%{transform:translate(-60px,20px)scale(.98)}75%{transform:translate(40px,-30px)scale(1.1)}}.ambient-orb{filter:blur(80px);pointer-events:none;z-index:0;opacity:.35;border-radius:50%;position:fixed}.ambient-orb-1{background:radial-gradient(circle,#a855f766,#0000 70%);width:400px;height:400px;animation:20s ease-in-out infinite orb-float-1;top:-10%;right:-5%}.ambient-orb-2{background:radial-gradient(circle,#6366f159,#0000 70%);width:350px;height:350px;animation:25s ease-in-out infinite orb-float-2;bottom:-15%;left:-5%}.ambient-orb-3{background:radial-gradient(circle,#f59e0b33,#0000 70%);width:300px;height:300px;animation:22s ease-in-out infinite orb-float-3;top:40%;left:40%}.nav-active-border{position:relative}.nav-active-border:before{content:"";background:linear-gradient(180deg,var(--color-synapse),var(--color-dream),var(--color-synapse));background-size:100% 200%;border-radius:1px;width:2px;animation:3s ease-in-out infinite gradient-shift;position:absolute;top:4px;bottom:4px;left:0}@keyframes gradient-shift{0%,to{background-position:0 0}50%{background-position:0 100%}}@keyframes float{0%,to{transform:translateY(0)translate(0)}25%{transform:translateY(-10px)translate(5px)}50%{transform:translateY(-5px)translate(-5px)}75%{transform:translateY(-15px)translate(3px)}}.retention-critical{color:var(--color-decay)}.retention-low{color:var(--color-warning)}.retention-good{color:var(--color-recall)}.retention-strong{color:var(--color-synapse)}@media not all and (prefers-reduced-motion:reduce){::view-transition-old(root){animation-duration:.18s;animation-timing-function:ease}::view-transition-new(root){animation-duration:.18s;animation-timing-function:ease}::view-transition-old(root){animation-name:vt-fade-out}::view-transition-new(root){animation-name:vt-fade-in}@keyframes vt-fade-out{0%{opacity:1}to{opacity:0}}@keyframes vt-fade-in{0%{opacity:0}to{opacity:1}}}@property --angle{syntax:"";inherits:false;initial-value:0deg}@property --shine{syntax:"";inherits:false;initial-value:0%}.reveal{opacity:0;transform:translateY(var(--reveal-y,16px));transition:opacity .55s cubic-bezier(.22,1,.36,1),transform .55s cubic-bezier(.22,1,.36,1);transition-delay:var(--reveal-delay,0s);will-change:opacity,transform}.reveal-in{opacity:1;transform:none}@media(prefers-reduced-motion:reduce){.reveal{opacity:1;transition:none;transform:none}}@media not all and (prefers-reduced-motion:reduce){.enter{transition:opacity .4s,transform .4s cubic-bezier(.22,1,.36,1)}@starting-style{.enter{opacity:0;transform:translateY(10px)}}}.live-border{isolation:isolate;position:relative}.live-border:before{content:"";border-radius:inherit;background:conic-gradient(from var(--angle),transparent 0%,var(--color-synapse) 18%,var(--color-dream) 33%,transparent 50%,transparent 100%);pointer-events:none;opacity:.6;z-index:-1;padding:1px;position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;-webkit-mask-image:linear-gradient(#000 0 0),linear-gradient(#000 0 0);-webkit-mask-position:0 0,0 0;-webkit-mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}@media not all and (prefers-reduced-motion:reduce){.live-border:before{animation:6s linear infinite border-rotate}@keyframes border-rotate{to{--angle:360deg}}}.spotlight-surface{position:relative;overflow:hidden}.spotlight-surface:after{content:"";pointer-events:none;background:radial-gradient(340px circle at var(--spot-x,50%) var(--spot-y,50%),#818cf81f,transparent 60%);opacity:var(--spot-o,0);z-index:0;transition:opacity .3s;position:absolute;top:0;right:0;bottom:0;left:0}.tilt-glare{position:relative;overflow:hidden}.tilt-glare:after{content:"";pointer-events:none;background:radial-gradient(circle at var(--glare-x,50%) var(--glare-y,50%),#ffffff24,transparent 45%);opacity:var(--glare-o,0);transition:opacity .3s;position:absolute;top:0;right:0;bottom:0;left:0}.breathe{animation:3.2s ease-in-out infinite breathe}@keyframes breathe{0%,to{filter:drop-shadow(0 0 2px);opacity:.85;transform:scale(1)}50%{filter:drop-shadow(0 0 7px);opacity:1;transform:scale(1.18)}}@media(prefers-reduced-motion:reduce){.breathe{animation:none}}.ping-host{position:relative}.ping-host:before{content:"";opacity:.6;z-index:-1;background:currentColor;border-radius:50%;position:absolute;top:0;right:0;bottom:0;left:0}@media not all and (prefers-reduced-motion:reduce){.ping-host:before{animation:2.4s cubic-bezier(0,0,.2,1) infinite ping}@keyframes ping{0%{opacity:.5;transform:scale(1)}80%,to{opacity:0;transform:scale(2.6)}}}.shimmer{background:#ffffff08;position:relative;overflow:hidden}.shimmer:after{content:"";background:linear-gradient(90deg,#0000,#818cf81f,#0000);position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%)}@media not all and (prefers-reduced-motion:reduce){.shimmer:after{animation:1.6s ease-in-out infinite shimmer}@keyframes shimmer{to{transform:translate(100%)}}}.text-aurora{background:linear-gradient(100deg,var(--color-synapse-glow),var(--color-dream-glow),var(--color-recall),var(--color-synapse-glow));color:#0000;background-size:250% 100%;-webkit-background-clip:text;background-clip:text}@media not all and (prefers-reduced-motion:reduce){.text-aurora{animation:8s ease-in-out infinite aurora-drift}@keyframes aurora-drift{0%,to{background-position:0%}50%{background-position:100%}}}.lift{transition:transform .28s cubic-bezier(.34,1.56,.64,1),box-shadow .28s,border-color .28s}.lift:hover{transform:translateY(-3px);box-shadow:0 12px 32px #00000059,0 0 0 1px #6366f12e}@media(prefers-reduced-motion:reduce){.lift:hover{transform:none}}.tabular-nums{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}:where(button,a,input,select,[role=button],[tabindex]):focus-visible{outline:2px solid var(--color-synapse-glow);outline-offset:2px;border-radius:.4rem}@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-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@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-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}.toast-layer.svelte-pry2ep{position:fixed;z-index:60;pointer-events:none;display:flex;flex-direction:column;gap:.5rem;right:1.25rem;bottom:1.25rem;max-width:22rem;width:calc(100vw - 2.5rem)}@media(max-width:768px){.toast-layer.svelte-pry2ep{right:.75rem;left:.75rem;bottom:auto;top:5.25rem;max-width:none;width:auto;align-items:stretch}}.toast-item.svelte-pry2ep{pointer-events:auto;position:relative;display:flex;gap:.75rem;align-items:stretch;text-align:left;font:inherit;color:inherit;background:#0c0e16b8;backdrop-filter:blur(14px) saturate(160%);-webkit-backdrop-filter:blur(14px) saturate(160%);border:1px solid rgba(255,255,255,.06);border-radius:.75rem;padding:.75rem .9rem .75rem .5rem;overflow:hidden;box-shadow:0 10px 40px -12px #000c,0 0 22px -6px var(--toast-color);cursor:pointer;animation:svelte-pry2ep-toast-in .32s cubic-bezier(.16,1,.3,1);transform-origin:right center;transition:transform .15s ease,box-shadow .15s ease}.toast-item.svelte-pry2ep:hover{transform:translateY(-1px) scale(1.015);box-shadow:0 14px 48px -12px #000000d9,0 0 32px -4px var(--toast-color)}.toast-item.svelte-pry2ep:focus-visible{outline:1px solid var(--toast-color);outline-offset:2px}.toast-accent.svelte-pry2ep{width:3px;border-radius:2px;background:var(--toast-color);box-shadow:0 0 10px var(--toast-color);flex-shrink:0}.toast-body.svelte-pry2ep{display:flex;flex-direction:column;gap:.15rem;flex:1;min-width:0}.toast-head.svelte-pry2ep{display:flex;align-items:center;gap:.5rem}.toast-icon.svelte-pry2ep{color:var(--toast-color);font-size:.95rem;text-shadow:0 0 8px var(--toast-color);line-height:1;width:1rem;display:inline-flex;justify-content:center}.toast-title.svelte-pry2ep{color:#f5f5fa;font-size:.82rem;font-weight:600;letter-spacing:.01em}.toast-sub.svelte-pry2ep{color:#b0b6c4;font-size:.74rem;line-height:1.35;padding-left:1.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toast-progress.svelte-pry2ep{position:absolute;left:0;bottom:0;height:2px;width:100%;background:#ffffff0a}.toast-progress-fill.svelte-pry2ep{height:100%;background:var(--toast-color);opacity:.55;transform-origin:left center;animation:svelte-pry2ep-toast-progress var(--toast-dwell) linear forwards}.toast-item.svelte-pry2ep:hover .toast-progress-fill:where(.svelte-pry2ep),.toast-item.svelte-pry2ep:focus-visible .toast-progress-fill:where(.svelte-pry2ep){animation-play-state:paused}@keyframes svelte-pry2ep-toast-in{0%{opacity:0;transform:translate(24px) scale(.98)}to{opacity:1;transform:translate(0) scale(1)}}@media(max-width:768px){.toast-item.svelte-pry2ep{transform-origin:top center;animation:svelte-pry2ep-toast-in-mobile .3s cubic-bezier(.16,1,.3,1)}}@keyframes svelte-pry2ep-toast-in-mobile{0%{opacity:0;transform:translateY(-12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes svelte-pry2ep-toast-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@media(prefers-reduced-motion:reduce){.toast-item.svelte-pry2ep{animation:none}.toast-progress-fill.svelte-pry2ep{animation:none;transform:scaleX(.5)}}.strip-item.svelte-1kk3799{display:inline-flex;align-items:center;gap:.4rem;padding:0 .75rem;white-space:nowrap;flex-shrink:0}.strip-divider.svelte-1kk3799{width:1px;height:14px;background:#6366f11f;flex-shrink:0}.ambient-strip.ambient-flash.svelte-1kk3799{background:linear-gradient(90deg,#ef444414,#ef444400 70%),#0006;border-bottom-color:#ef444459;transition:background .3s ease,border-color .3s ease}@keyframes svelte-1kk3799-ping-slow{0%{transform:scale(1);opacity:.8}80%,to{transform:scale(2);opacity:0}}.animate-ping-slow{animation:svelte-1kk3799-ping-slow 2.2s cubic-bezier(0,0,.2,1) infinite}@media(prefers-reduced-motion:reduce){.ambient-strip.svelte-1kk3799 .animate-ping,.ambient-strip.svelte-1kk3799 .animate-ping-slow,.ambient-strip.svelte-1kk3799 .animate-pulse{animation:none!important}}.verdict-bar.svelte-1j425e6{border-bottom:1px solid rgba(255,255,255,.06);background:#080912b8;backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);box-shadow:0 6px 24px #0000002e}.verdict-summary.svelte-1j425e6{width:100%;min-height:2.75rem;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center;gap:.75rem;padding:.55rem 1rem;color:var(--color-text);text-align:left;font:inherit}.sr-only.svelte-1j425e6{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.label.svelte-1j425e6,.field-label.svelte-1j425e6,.appeal-row.svelte-1j425e6>span:where(.svelte-1j425e6){color:var(--color-dim);font-size:.68rem;text-transform:uppercase;letter-spacing:0}.levels.svelte-1j425e6{display:flex;align-items:center;gap:.25rem}.levels.svelte-1j425e6 span:where(.svelte-1j425e6){border:1px solid rgba(255,255,255,.08);border-radius:.35rem;padding:.18rem .38rem;color:var(--color-muted);font-size:.64rem;line-height:1}.levels.svelte-1j425e6 span.active:where(.svelte-1j425e6){color:var(--color-bright);border-color:var(--verdict-color);background:color-mix(in srgb,var(--verdict-color) 18%,transparent);box-shadow:0 0 14px color-mix(in srgb,var(--verdict-color) 28%,transparent)}.summary-text.svelte-1j425e6{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.78rem;color:var(--color-dim)}.when.svelte-1j425e6{color:var(--color-muted);font-size:.68rem}.receipt.svelte-1j425e6{margin:0 1rem .75rem;border:1px solid rgba(255,255,255,.08);border-radius:.5rem;background:#0a0a1ac7;padding:.85rem}.receipt-grid.svelte-1j425e6{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(10rem,.8fr) minmax(0,1.1fr) minmax(0,1.1fr);gap:.85rem}.receipt.svelte-1j425e6 p:where(.svelte-1j425e6),.receipt.svelte-1j425e6 li:where(.svelte-1j425e6){margin:.25rem 0 0;color:var(--color-text);font-size:.76rem;line-height:1.45;overflow-wrap:anywhere}.receipt.svelte-1j425e6 ul:where(.svelte-1j425e6){margin:.25rem 0 0;padding-left:1rem}.appeal-row.svelte-1j425e6{display:flex;align-items:center;gap:.4rem;margin-top:.85rem;flex-wrap:wrap}.appeal-row.svelte-1j425e6 button:where(.svelte-1j425e6),.appeal-row.svelte-1j425e6 p:where(.svelte-1j425e6){border:1px solid rgba(255,255,255,.1);border-radius:.4rem;padding:.35rem .6rem;color:var(--color-text);background:#ffffff0a;font-size:.72rem;margin:0}.appeal-row.svelte-1j425e6 button:where(.svelte-1j425e6):hover:not(:disabled),.verdict-summary.svelte-1j425e6:hover{background:#ffffff0d}.appeal-row.svelte-1j425e6 button:where(.svelte-1j425e6):disabled{opacity:.55;cursor:wait}.tone-pass.svelte-1j425e6,.tone-note.svelte-1j425e6{--verdict-color: #10b981}.tone-caution.svelte-1j425e6{--verdict-color: #f59e0b}.tone-veto.svelte-1j425e6{--verdict-color: #ef4444}.tone-appealed.svelte-1j425e6{--verdict-color: #818cf8}@media(max-width:900px){.verdict-summary.svelte-1j425e6{grid-template-columns:auto minmax(0,1fr) auto}.levels.svelte-1j425e6{grid-column:1 / -1;order:4;overflow-x:auto;padding-bottom:.1rem}.receipt-grid.svelte-1j425e6{grid-template-columns:1fr}}.theme-toggle.svelte-1cmi4dh{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:8px;background:#6366f10f;border:1px solid rgba(99,102,241,.14);color:var(--color-text);cursor:pointer;transition:background .2s ease,border-color .2s ease,color .2s ease,transform .12s ease;-webkit-tap-highlight-color:transparent}.theme-toggle.svelte-1cmi4dh:hover{background:#6366f124;border-color:#6366f14d;color:var(--color-bright)}.theme-toggle.svelte-1cmi4dh:active{transform:scale(.94)}.theme-toggle.svelte-1cmi4dh:focus-visible{outline:1px solid var(--color-synapse);outline-offset:2px}.icon-wrap.svelte-1cmi4dh{position:relative;width:18px;height:18px;display:inline-block}.icon.svelte-1cmi4dh{position:absolute;top:0;right:0;bottom:0;left:0;width:18px;height:18px;opacity:0;transform:scale(.7) rotate(-30deg);transition:opacity .2s ease,transform .2s cubic-bezier(.16,1,.3,1);pointer-events:none}.icon.active.svelte-1cmi4dh{opacity:1;transform:scale(1) rotate(0)}.theme-toggle[data-mode=dark].svelte-1cmi4dh{color:var(--color-synapse-glow, #818cf8)}.theme-toggle[data-mode=light].svelte-1cmi4dh{color:var(--color-warning, #f59e0b)}.theme-toggle[data-mode=auto].svelte-1cmi4dh{color:var(--color-dream-glow, #c084fc)}@media(prefers-reduced-motion:reduce){.theme-toggle.svelte-1cmi4dh,.icon.svelte-1cmi4dh{transition:none}}.safe-bottom.svelte-12qhfyh{padding-bottom:env(safe-area-inset-bottom,0px)}.logo-mark.svelte-12qhfyh{transition:transform .3s cubic-bezier(.34,1.56,.64,1),box-shadow .3s ease}.logo-link.svelte-12qhfyh:hover .logo-mark:where(.svelte-12qhfyh){transform:rotate(-6deg) scale(1.08);box-shadow:0 0 0 1px #818cf866,0 0 22px #6366f180}.nav-link.text-synapse-glow.svelte-12qhfyh .nav-icon:where(.svelte-12qhfyh) svg,.nav-active-border.svelte-12qhfyh .nav-icon:where(.svelte-12qhfyh) svg{filter:drop-shadow(0 0 6px rgba(129,140,248,.55))} diff --git a/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css.br b/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css.br deleted file mode 100644 index bc588d0..0000000 Binary files a/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css.gz b/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css.gz deleted file mode 100644 index 30b4fce..0000000 Binary files a/apps/dashboard/build/_app/immutable/assets/0.Cf27G70K.css.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/assets/17.ChjqzJHo.css b/apps/dashboard/build/_app/immutable/assets/18.ChjqzJHo.css similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/17.ChjqzJHo.css rename to apps/dashboard/build/_app/immutable/assets/18.ChjqzJHo.css diff --git a/apps/dashboard/build/_app/immutable/assets/17.ChjqzJHo.css.br b/apps/dashboard/build/_app/immutable/assets/18.ChjqzJHo.css.br similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/17.ChjqzJHo.css.br rename to apps/dashboard/build/_app/immutable/assets/18.ChjqzJHo.css.br diff --git a/apps/dashboard/build/_app/immutable/assets/17.ChjqzJHo.css.gz b/apps/dashboard/build/_app/immutable/assets/18.ChjqzJHo.css.gz similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/17.ChjqzJHo.css.gz rename to apps/dashboard/build/_app/immutable/assets/18.ChjqzJHo.css.gz diff --git a/apps/dashboard/build/_app/immutable/assets/18.BnHgRQtR.css b/apps/dashboard/build/_app/immutable/assets/19.BnHgRQtR.css similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/18.BnHgRQtR.css rename to apps/dashboard/build/_app/immutable/assets/19.BnHgRQtR.css diff --git a/apps/dashboard/build/_app/immutable/assets/18.BnHgRQtR.css.br b/apps/dashboard/build/_app/immutable/assets/19.BnHgRQtR.css.br similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/18.BnHgRQtR.css.br rename to apps/dashboard/build/_app/immutable/assets/19.BnHgRQtR.css.br diff --git a/apps/dashboard/build/_app/immutable/assets/18.BnHgRQtR.css.gz b/apps/dashboard/build/_app/immutable/assets/19.BnHgRQtR.css.gz similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/18.BnHgRQtR.css.gz rename to apps/dashboard/build/_app/immutable/assets/19.BnHgRQtR.css.gz diff --git a/apps/dashboard/build/_app/immutable/assets/19.C2qtIyf6.css b/apps/dashboard/build/_app/immutable/assets/20.C2qtIyf6.css similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/19.C2qtIyf6.css rename to apps/dashboard/build/_app/immutable/assets/20.C2qtIyf6.css diff --git a/apps/dashboard/build/_app/immutable/assets/19.C2qtIyf6.css.br b/apps/dashboard/build/_app/immutable/assets/20.C2qtIyf6.css.br similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/19.C2qtIyf6.css.br rename to apps/dashboard/build/_app/immutable/assets/20.C2qtIyf6.css.br diff --git a/apps/dashboard/build/_app/immutable/assets/19.C2qtIyf6.css.gz b/apps/dashboard/build/_app/immutable/assets/20.C2qtIyf6.css.gz similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/19.C2qtIyf6.css.gz rename to apps/dashboard/build/_app/immutable/assets/20.C2qtIyf6.css.gz diff --git a/apps/dashboard/build/_app/immutable/assets/20.CO50G5tF.css b/apps/dashboard/build/_app/immutable/assets/21.CO50G5tF.css similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/20.CO50G5tF.css rename to apps/dashboard/build/_app/immutable/assets/21.CO50G5tF.css diff --git a/apps/dashboard/build/_app/immutable/assets/20.CO50G5tF.css.br b/apps/dashboard/build/_app/immutable/assets/21.CO50G5tF.css.br similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/20.CO50G5tF.css.br rename to apps/dashboard/build/_app/immutable/assets/21.CO50G5tF.css.br diff --git a/apps/dashboard/build/_app/immutable/assets/20.CO50G5tF.css.gz b/apps/dashboard/build/_app/immutable/assets/21.CO50G5tF.css.gz similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/20.CO50G5tF.css.gz rename to apps/dashboard/build/_app/immutable/assets/21.CO50G5tF.css.gz diff --git a/apps/dashboard/build/_app/immutable/assets/22.DKhUrxcR.css b/apps/dashboard/build/_app/immutable/assets/23.DKhUrxcR.css similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/22.DKhUrxcR.css rename to apps/dashboard/build/_app/immutable/assets/23.DKhUrxcR.css diff --git a/apps/dashboard/build/_app/immutable/assets/22.DKhUrxcR.css.br b/apps/dashboard/build/_app/immutable/assets/23.DKhUrxcR.css.br similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/22.DKhUrxcR.css.br rename to apps/dashboard/build/_app/immutable/assets/23.DKhUrxcR.css.br diff --git a/apps/dashboard/build/_app/immutable/assets/22.DKhUrxcR.css.gz b/apps/dashboard/build/_app/immutable/assets/23.DKhUrxcR.css.gz similarity index 100% rename from apps/dashboard/build/_app/immutable/assets/22.DKhUrxcR.css.gz rename to apps/dashboard/build/_app/immutable/assets/23.DKhUrxcR.css.gz diff --git a/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css b/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css new file mode 100644 index 0000000..61df11c --- /dev/null +++ b/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css @@ -0,0 +1 @@ +.spine.svelte-8n8iia{position:absolute;left:8%;right:8%;bottom:calc(2.5rem + env(safe-area-inset-bottom,0px));pointer-events:none}.active-label.svelte-8n8iia{text-align:center;margin-bottom:.6rem;font-family:SF Mono,ui-monospace,Menlo,Consolas,monospace;font-size:.72rem;letter-spacing:.08em;color:#cfe9ff;text-shadow:0 0 24px rgba(30,180,255,.35);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.track.svelte-8n8iia{position:relative;height:2px;background:#ffffff12;border-radius:1px}.tick.svelte-8n8iia{position:absolute;top:50%;width:3px;height:10px;transform:translate(-50%,-50%);border-radius:2px;background:#6ef0e6;transition:opacity .2s linear}.tick.hot.svelte-8n8iia{box-shadow:0 0 12px #6ef0e6bf}.tick.backward.svelte-8n8iia{background:#ff4070}.tick.backward.hot.svelte-8n8iia{box-shadow:0 0 12px #ff4070bf}.playhead.svelte-8n8iia{position:absolute;top:50%;width:1.5px;height:16px;transform:translate(-50%,-50%);background:#cfe9ffe6;box-shadow:0 0 10px #1eb4ff80}.verdict.svelte-ssd7yu{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);text-align:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;padding:clamp(18px,3vw,40px) clamp(28px,6vw,80px);border-radius:20px;background:radial-gradient(ellipse at center,#05070edb,#05070eb8 60%,#05070e00);pointer-events:none}.k.svelte-ssd7yu{font-size:clamp(13px,1.8vw,18px);color:#9fd0e4;letter-spacing:.16em;text-transform:uppercase}.v.svelte-ssd7yu{font-size:clamp(32px,6.4vw,72px);font-weight:600;margin-top:.12em;line-height:1.05;background:linear-gradient(90deg,#7fe6c0,#6ef0e6,#a6dcff);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 0 26px rgba(110,240,220,.45))}.s.svelte-ssd7yu{font-size:clamp(11px,1.5vw,15px);color:#8fb0be;margin-top:.6em;font-family:SF Mono,ui-monospace,Menlo,Consolas,monospace;letter-spacing:.04em}.quarantine.svelte-ssd7yu .k:where(.svelte-ssd7yu){color:#ffb0a6}.quarantine.svelte-ssd7yu .v:where(.svelte-ssd7yu){background:linear-gradient(90deg,#ff6a5e,#ff9d6b,#ffd2a8);filter:drop-shadow(0 0 26px rgba(255,90,70,.45))}.quarantine.svelte-ssd7yu .s:where(.svelte-ssd7yu){color:#d9a49a}.observatory-canvas.svelte-16248mg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;display:block;background:#05060a}.fallback.svelte-16248mg{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;text-align:center;padding:0 10%;font-family:SF Mono,ui-monospace,Menlo,Consolas,monospace;pointer-events:auto}.fallback-title.svelte-16248mg{color:#5dcaa5;font-size:.95rem;letter-spacing:.28em;text-shadow:0 0 20px rgba(93,202,165,.4)}.fallback-reason.svelte-16248mg{color:#9fd0e4;font-size:.8rem;letter-spacing:.04em;opacity:.85}.fallback-hint.svelte-16248mg{color:#7c8a97;font-size:.75rem;max-width:34rem;line-height:1.6}.fallback-hint.svelte-16248mg a:where(.svelte-16248mg){color:#cfe9ff;text-decoration:underline;text-underline-offset:3px} diff --git a/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css.br b/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css.br new file mode 100644 index 0000000..4f9eb09 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css.br differ diff --git a/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css.gz b/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css.gz new file mode 100644 index 0000000..e8ce312 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/assets/ObservatoryStage.CnF5Ezel.css.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js b/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js deleted file mode 100644 index df354f9..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js +++ /dev/null @@ -1,2 +0,0 @@ -import{D as z,q as dr,aD as sr,G as A,L as U,N as gr,T as pr,g as m,U as hr,W as _r,X as x,K,M as G,I as Er,aE as Ar,aF as y,w as Sr,aG as b,$ as q,aH as Tr,a1 as Nr,ao as br,z as Ir,aI as V,aJ as Mr,aK as Or,ac as Cr,aL as rr,aM as Rr,Y as ur,_ as or,aN as P,R as lr,aO as Lr,aP as wr,aQ as Hr,Z as kr,J as Dr,aR as Fr,aS as Gr,aT as zr,aU as Ur,aV as tr,aW as Kr}from"./wpu9U-D0.js";function jr(r,e){return e}function Pr(r,e,f){for(var a=[],n=e.length,s,u=e.length,v=0;v{if(s){if(s.pending.delete(g),s.done.add(g),s.pending.size===0){var t=r.outrogroups;B(V(s.done)),t.delete(s),t.size===0&&(r.outrogroups=null)}}else u-=1},!1)}if(u===0){var o=a.length===0&&f!==null;if(o){var d=f,l=d.parentNode;Hr(l),l.append(d),r.items.clear()}B(e,!o)}else s={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(s)}function B(r,e=!0){for(var f=0;f{var c=f();return Ir(c)?c:c==null?[]:V(c)}),t,p=!0;function S(){i.fallback=l,Yr(i,t,u,e,a),l!==null&&(t.length===0?(l.f&b)===0?ur(l):(l.f^=b,k(l,null,u)):or(l,()=>{l=null}))}var T=dr(()=>{t=m(g);var c=t.length;let C=!1;if(A){var R=hr(u)===_r;R!==(c===0)&&(u=x(),U(u),K(!1),C=!0)}for(var _=new Set,M=Sr,L=Nr(),h=0;hs(u)):(l=q(()=>s(er??(er=z()))),l.f|=b)),c>_.size&&Tr(),A&&c>0&&U(x()),!p)if(L){for(const[D,F]of v)_.has(D)||M.skip_effect(F.e);M.oncommit(S),M.ondiscard(()=>{})}else S();C&&K(!0),m(g)}),i={effect:T,items:v,outrogroups:null,fallback:l};p=!1,A&&(u=G)}function H(r){for(;r!==null&&(r.f&Lr)===0;)r=r.next;return r}function Yr(r,e,f,a,n){var E,D,F,X,J,W,$,Q,Z;var s=(a&wr)!==0,u=e.length,v=r.items,o=H(r.effect.first),d,l=null,g,t=[],p=[],S,T,i,c;if(s)for(c=0;c0){var w=(a&sr)!==0&&u===0?f:null;if(s){for(c=0;c{var N,j;if(g!==void 0)for(i of g)(j=(N=i.nodes)==null?void 0:N.a)==null||j.apply()})}function qr(r,e,f,a,n,s,u,v){var o=(u&Mr)!==0?(u&Or)===0?Cr(f,!1,!1):rr(f):null,d=(u&Rr)!==0?rr(n):null;return{v:o,i:d,e:q(()=>(s(e,o??f,d??n,v),()=>{r.delete(a)}))}}function k(r,e,f){if(r.nodes)for(var a=r.nodes.start,n=r.nodes.end,s=e&&(e.f&b)===0?e.nodes.start:f;a!==null;){var u=Dr(a);if(s.before(a),a===n)return;a=u}}function I(r,e,f){e===null?r.effect.first=f:e.next=f,f===null?r.effect.last=e:f.prev=e}function cr(r){var e,f,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e=0;){var v=u+s;(u===0||fr.includes(a[u-1]))&&(v===a.length||fr.includes(a[v]))?a=(u===0?"":a.substring(0,u))+a.substring(v+1):u=v}}return a===""?null:a}function ar(r,e=!1){var f=e?" !important;":";",a="";for(var n of Object.keys(r)){var s=r[n];s!=null&&s!==""&&(a+=" "+n+": "+s+f)}return a}function Y(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function yr(r,e){if(e){var f="",a,n;if(Array.isArray(e)?(a=e[0],n=e[1]):a=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,u=0,v=!1,o=[];a&&o.push(...Object.keys(a).map(Y)),n&&o.push(...Object.keys(n).map(Y));var d=0,l=-1;const T=r.length;for(var g=0;g{if(!e){if(e=!0,r.hasAttribute("value")){var a=r.value;ir(r,"value",null),r.value=a}if(r.hasAttribute("checked")){var n=r.checked;ir(r,"checked",null),r.checked=n}}};r.__on_r=f,lr(f),Kr()}}function fe(r,e){var f=vr(r);f.value===(f.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==$r)||(r.value=e??"")}function ir(r,e,f,a){var n=vr(r);A&&(n[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Wr)||n[e]!==(n[e]=f)&&(e==="loading"&&(r[Fr]=f),f==null?r.removeAttribute(e):typeof f!="string"&&Qr(r).includes(e)?r[e]=f:r.setAttribute(e,f))}function vr(r){return r.__attributes??(r.__attributes={[Xr]:r.nodeName.includes("-"),[Jr]:r.namespaceURI===Gr})}var nr=new Map;function Qr(r){var e=r.getAttribute("is")||r.nodeName,f=nr.get(e);if(f)return f;nr.set(e,f=[]);for(var a,n=r,s=Element.prototype;s!==n;){a=Ur(n);for(var u in a)a[u].set&&f.push(u);n=zr(n)}return f}export{ir as a,fe as b,xr as c,mr as e,jr as i,ee as r,re as s,yr as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js.br b/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js.br deleted file mode 100644 index 8810358..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js.gz b/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js.gz deleted file mode 100644 index 2795bf5..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/60_R_Vbt.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js b/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js new file mode 100644 index 0000000..9056957 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js @@ -0,0 +1 @@ +import{q as T,v as o,w as h,E as b,V as p,W as v,X as A,Y as E,N as R,M as l}from"./CW7md74C.js";import{B as g}from"./DExHDOmW.js";function S(t,u,_=!1){o&&h();var n=new g(t),c=_?b:0;function i(a,r){if(o){const e=p(t);var s;if(e===v?s=0:e===A?s=!1:s=parseInt(e.substring(1)),a!==s){var f=E();R(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;u((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},c)}export{S as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js.br b/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js.br new file mode 100644 index 0000000..8f8443e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js.gz b/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js.gz new file mode 100644 index 0000000..295ffd4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/9-jplUL5.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js b/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js new file mode 100644 index 0000000..39cc35a --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js @@ -0,0 +1 @@ +import{b as s,w as g}from"./D90q9c2i.js";const v=200;function $(){const{subscribe:e,set:n,update:t}=g({connected:!1,reconnecting:!1,events:[],lastHeartbeat:null,error:null});let o=null,a=null,d=0;function m(l){const i=l||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((o==null?void 0:o.readyState)!==WebSocket.OPEN)try{o=new WebSocket(i),o.onopen=()=>{d=0,t(r=>({...r,connected:!0,reconnecting:!1,error:null}))},o.onmessage=r=>{try{const u=JSON.parse(r.data);t(f=>{if(u.type==="Heartbeat")return{...f,lastHeartbeat:u};const h=[u,...f.events].slice(0,v);return{...f,events:h}})}catch(u){console.warn("[vestige] Failed to parse WebSocket message:",u)}},o.onclose=()=>{t(r=>({...r,connected:!1})),p(i)},o.onerror=()=>{t(r=>({...r,error:"WebSocket connection failed"}))}}catch(r){t(u=>({...u,error:String(r)}))}}function p(l){a&&clearTimeout(a),t(r=>({...r,reconnecting:!0}));const i=Math.min(1e3*2**d,3e4);d++,a=setTimeout(()=>m(l),i)}function b(){a&&(clearTimeout(a),a=null),o&&(o.onclose=null,o.onerror=null,o.onmessage=null,o.close()),o=null,n({connected:!1,reconnecting:!1,events:[],lastHeartbeat:null,error:null})}function w(){t(l=>({...l,events:[]}))}function y(l){t(i=>{const r=[l,...i.events].slice(0,v);return{...i,events:r}})}return{subscribe:e,connect:m,disconnect:b,clearEvents:w,injectEvent:y}}const c=$(),S=s(c,e=>e.connected),H=s(c,e=>e.reconnecting),T=s(c,e=>e.events);s(c,e=>e.lastHeartbeat);const M=s(c,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.memory_count)??0}),k=s(c,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.avg_retention)??0}),_=s(c,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.suppressed_count)??0}),W=s(c,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.uptime_secs)??0}),N=s(c,e=>e.events.filter(n=>n.type==="TraceEvent")),P=s(c,e=>{var t;const n=e.events.find(o=>o.type==="TraceEvent");return((t=n==null?void 0:n.data)==null?void 0:t.run_id)??null}),R=s(c,e=>e.events.find(n=>n.type==="TraceEvent")??null),C=s(c,e=>e.events.filter(n=>n.type==="MemoryPrOpened"||n.type==="MemoryPrDecided"));function F(e){if(!Number.isFinite(e)||e<0)return"—";const n=Math.floor(e/86400),t=Math.floor(e%86400/3600),o=Math.floor(e%3600/60),a=Math.floor(e%60);return n>0?t>0?`${n}d ${t}h`:`${n}d`:t>0?o>0?`${t}h ${o}m`:`${t}h`:o>0?a>0?`${o}m ${a}s`:`${o}m`:`${a}s`}export{k as a,M as b,H as c,P as d,T as e,F as f,S as i,R as l,C as m,_ as s,N as t,W as u,c as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js.br b/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js.br new file mode 100644 index 0000000..b39d4fa Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js.gz b/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js.gz new file mode 100644 index 0000000..6bce232 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BFpewGai.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js b/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js similarity index 97% rename from apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js rename to apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js index 7367f60..baa2bda 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js +++ b/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js @@ -1 +1 @@ -import{w as N,g as T}from"./D8mhvFt8.js";import{e as E}from"./BhIgFntf.js";import{E as p}from"./CcUbQ_Wl.js";const y=4,R=5500,F=1500;function x(){const{subscribe:b,update:u}=N([]);let m=1,f=0;const c=new Map,a=new Map,l=new Map;function w(e,s){l.set(e,Date.now());const t=setTimeout(()=>{c.delete(e),l.delete(e),h(e)},s);c.set(e,t)}function g(e){const s=m++,t=Date.now(),o={id:s,createdAt:t,...e};u(n=>{const r=[o,...n];if(r.length>y){for(const i of r.slice(y)){const d=c.get(i.id);d&&clearTimeout(d),c.delete(i.id),a.delete(i.id),l.delete(i.id)}return r.slice(0,y)}return r}),w(s,e.dwellMs)}function h(e){const s=c.get(e);s&&(clearTimeout(s),c.delete(e)),a.delete(e),l.delete(e),u(t=>t.filter(o=>o.id!==e))}function D(e,s){const t=c.get(e);if(!t)return;clearTimeout(t),c.delete(e);const o=l.get(e)??Date.now(),n=Date.now()-o,r=Math.max(200,s-n);a.set(e,{remaining:r})}function C(e){const s=a.get(e);s&&(a.delete(e),w(e,s.remaining))}function S(){for(const e of c.values())clearTimeout(e);c.clear(),a.clear(),l.clear(),u(()=>[])}function _(e){const s=p[e.type]??"#818CF8",t=e.data;switch(e.type){case"DreamCompleted":{const o=Number(t.memories_replayed??0),n=Number(t.connections_found??0),r=Number(t.insights_generated??0),i=Number(t.duration_ms??0),d=[];return d.push(`Replayed ${o} ${o===1?"memory":"memories"}`),n>0&&d.push(`${n} new connection${n===1?"":"s"}`),r>0&&d.push(`${r} insight${r===1?"":"s"}`),{type:e.type,title:"Dream consolidated",body:`${d.join(" · ")} in ${(i/1e3).toFixed(1)}s`,color:s,dwellMs:7e3}}case"ConsolidationCompleted":{const o=Number(t.nodes_processed??0),n=Number(t.decay_applied??0),r=Number(t.embeddings_generated??0),i=Number(t.duration_ms??0),d=[];return n>0&&d.push(`${n} decayed`),r>0&&d.push(`${r} embedded`),{type:e.type,title:"Consolidation swept",body:`${o} node${o===1?"":"s"}${d.length?" · "+d.join(" · "):""} in ${(i/1e3).toFixed(1)}s`,color:s,dwellMs:6e3}}case"ConnectionDiscovered":{const o=Date.now();if(o-f0?`suppression #${o} · Rac1 cascade ~${n} neighbors`:`suppression #${o}`,color:s,dwellMs:5500}}case"MemoryUnsuppressed":{const o=Number(t.remaining_count??0);return{type:e.type,title:"Recovered",body:o>0?`${o} suppression${o===1?"":"s"} remain`:"fully unsuppressed",color:s,dwellMs:5e3}}case"Rac1CascadeSwept":{const o=Number(t.seeds??0),n=Number(t.neighbors_affected??0);return{type:e.type,title:"Rac1 cascade",body:`${o} seed${o===1?"":"s"} · ${n} dendritic spine${n===1?"":"s"} pruned`,color:s,dwellMs:6e3}}case"MemoryDeleted":return{type:e.type,title:"Memory deleted",body:String(t.id??"").slice(0,8),color:s,dwellMs:4e3};case"HookVerdictRecorded":{const o=String(t.verdict??"NOTE"),n=String(t.reason??"Sanhedrin receipt updated");return{type:e.type,title:`Sanhedrin ${o}`,body:n,color:s,dwellMs:o==="VETO"?8e3:R}}case"Heartbeat":case"SearchPerformed":case"RetentionDecayed":case"ActivationSpread":case"ImportanceScored":case"MemoryCreated":case"MemoryUpdated":case"DreamStarted":case"DreamProgress":case"ConsolidationStarted":case"Connected":return null;default:return null}}let M=null;return E.subscribe(e=>{if(e.length===0)return;const s=[];for(const t of e){if(t===M)break;s.push(t)}if(s.length!==0){M=e[0];for(let t=s.length-1;t>=0;t--){const o=_(s[t]);o&&g(o)}}}),{subscribe:b,dismiss:h,clear:S,pauseDwell:D,resumeDwell:C,push:g}}const $=x();function I(){[{type:"DreamCompleted",title:"Dream consolidated",body:"Replayed 127 memories · 43 new connections · 5 insights in 2.4s",color:p.DreamCompleted,dwellMs:7e3},{type:"ConnectionDiscovered",title:"Bridge discovered",body:"semantic · weight 0.87",color:p.ConnectionDiscovered,dwellMs:4500},{type:"MemorySuppressed",title:"Forgetting",body:"suppression #2 · Rac1 cascade ~8 neighbors",color:p.MemorySuppressed,dwellMs:5500},{type:"ConsolidationCompleted",title:"Consolidation swept",body:"892 nodes · 156 decayed · 48 embedded in 1.1s",color:p.ConsolidationCompleted,dwellMs:6e3}].forEach((u,m)=>{setTimeout(()=>{$.push(u)},m*800)}),T($)}export{I as f,$ as t}; +import{w as N,g as T}from"./D90q9c2i.js";import{e as E}from"./BFpewGai.js";import{E as p}from"./CcUbQ_Wl.js";const y=4,R=5500,F=1500;function x(){const{subscribe:b,update:u}=N([]);let m=1,f=0;const c=new Map,a=new Map,l=new Map;function w(e,s){l.set(e,Date.now());const t=setTimeout(()=>{c.delete(e),l.delete(e),h(e)},s);c.set(e,t)}function g(e){const s=m++,t=Date.now(),o={id:s,createdAt:t,...e};u(n=>{const r=[o,...n];if(r.length>y){for(const i of r.slice(y)){const d=c.get(i.id);d&&clearTimeout(d),c.delete(i.id),a.delete(i.id),l.delete(i.id)}return r.slice(0,y)}return r}),w(s,e.dwellMs)}function h(e){const s=c.get(e);s&&(clearTimeout(s),c.delete(e)),a.delete(e),l.delete(e),u(t=>t.filter(o=>o.id!==e))}function D(e,s){const t=c.get(e);if(!t)return;clearTimeout(t),c.delete(e);const o=l.get(e)??Date.now(),n=Date.now()-o,r=Math.max(200,s-n);a.set(e,{remaining:r})}function C(e){const s=a.get(e);s&&(a.delete(e),w(e,s.remaining))}function S(){for(const e of c.values())clearTimeout(e);c.clear(),a.clear(),l.clear(),u(()=>[])}function _(e){const s=p[e.type]??"#818CF8",t=e.data;switch(e.type){case"DreamCompleted":{const o=Number(t.memories_replayed??0),n=Number(t.connections_found??0),r=Number(t.insights_generated??0),i=Number(t.duration_ms??0),d=[];return d.push(`Replayed ${o} ${o===1?"memory":"memories"}`),n>0&&d.push(`${n} new connection${n===1?"":"s"}`),r>0&&d.push(`${r} insight${r===1?"":"s"}`),{type:e.type,title:"Dream consolidated",body:`${d.join(" · ")} in ${(i/1e3).toFixed(1)}s`,color:s,dwellMs:7e3}}case"ConsolidationCompleted":{const o=Number(t.nodes_processed??0),n=Number(t.decay_applied??0),r=Number(t.embeddings_generated??0),i=Number(t.duration_ms??0),d=[];return n>0&&d.push(`${n} decayed`),r>0&&d.push(`${r} embedded`),{type:e.type,title:"Consolidation swept",body:`${o} node${o===1?"":"s"}${d.length?" · "+d.join(" · "):""} in ${(i/1e3).toFixed(1)}s`,color:s,dwellMs:6e3}}case"ConnectionDiscovered":{const o=Date.now();if(o-f0?`suppression #${o} · Rac1 cascade ~${n} neighbors`:`suppression #${o}`,color:s,dwellMs:5500}}case"MemoryUnsuppressed":{const o=Number(t.remaining_count??0);return{type:e.type,title:"Recovered",body:o>0?`${o} suppression${o===1?"":"s"} remain`:"fully unsuppressed",color:s,dwellMs:5e3}}case"Rac1CascadeSwept":{const o=Number(t.seeds??0),n=Number(t.neighbors_affected??0);return{type:e.type,title:"Rac1 cascade",body:`${o} seed${o===1?"":"s"} · ${n} dendritic spine${n===1?"":"s"} pruned`,color:s,dwellMs:6e3}}case"MemoryDeleted":return{type:e.type,title:"Memory deleted",body:String(t.id??"").slice(0,8),color:s,dwellMs:4e3};case"HookVerdictRecorded":{const o=String(t.verdict??"NOTE"),n=String(t.reason??"Sanhedrin receipt updated");return{type:e.type,title:`Sanhedrin ${o}`,body:n,color:s,dwellMs:o==="VETO"?8e3:R}}case"Heartbeat":case"SearchPerformed":case"RetentionDecayed":case"ActivationSpread":case"ImportanceScored":case"MemoryCreated":case"MemoryUpdated":case"DreamStarted":case"DreamProgress":case"ConsolidationStarted":case"Connected":return null;default:return null}}let M=null;return E.subscribe(e=>{if(e.length===0)return;const s=[];for(const t of e){if(t===M)break;s.push(t)}if(s.length!==0){M=e[0];for(let t=s.length-1;t>=0;t--){const o=_(s[t]);o&&g(o)}}}),{subscribe:b,dismiss:h,clear:S,pauseDwell:D,resumeDwell:C,push:g}}const $=x();function I(){[{type:"DreamCompleted",title:"Dream consolidated",body:"Replayed 127 memories · 43 new connections · 5 insights in 2.4s",color:p.DreamCompleted,dwellMs:7e3},{type:"ConnectionDiscovered",title:"Bridge discovered",body:"semantic · weight 0.87",color:p.ConnectionDiscovered,dwellMs:4500},{type:"MemorySuppressed",title:"Forgetting",body:"suppression #2 · Rac1 cascade ~8 neighbors",color:p.MemorySuppressed,dwellMs:5500},{type:"ConsolidationCompleted",title:"Consolidation swept",body:"892 nodes · 156 decayed · 48 embedded in 1.1s",color:p.ConsolidationCompleted,dwellMs:6e3}].forEach((u,m)=>{setTimeout(()=>{$.push(u)},m*800)}),T($)}export{I as f,$ as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js.br b/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js.br new file mode 100644 index 0000000..175c57f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js.gz b/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js.gz new file mode 100644 index 0000000..8bb9ed6 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BGTfzpXY.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js.br b/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js.br deleted file mode 100644 index 3474420..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js.gz b/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js.gz deleted file mode 100644 index 13f4a03..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js.br b/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js.br deleted file mode 100644 index 3022c57..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js.gz b/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js.gz deleted file mode 100644 index 7691181..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js b/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js similarity index 87% rename from apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js rename to apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js index 459bed2..44f1794 100644 --- a/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js +++ b/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js @@ -1 +1 @@ -import{t as b}from"./60_R_Vbt.js";import{G as c}from"./wpu9U-D0.js";function A(i,u={},r,f){for(var a in r){var o=r[a];u[a]!==o&&(r[a]==null?i.style.removeProperty(a):i.style.setProperty(a,o,f))}}function P(i,u,r,f){var a=i.__style;if(c||a!==u){var o=b(u,f);(!c||o!==i.getAttribute("style"))&&(o==null?i.removeAttribute("style"):i.style.cssText=o),i.__style=u}else f&&(Array.isArray(f)?(A(i,r==null?void 0:r[0],f[0]),A(i,r==null?void 0:r[1],f[1],"important")):A(i,r,f));return f}export{P as s}; +import{t as b}from"./Cc0l8Nd4.js";import{v as c}from"./CW7md74C.js";function A(i,u={},r,f){for(var a in r){var o=r[a];u[a]!==o&&(r[a]==null?i.style.removeProperty(a):i.style.setProperty(a,o,f))}}function P(i,u,r,f){var a=i.__style;if(c||a!==u){var o=b(u,f);(!c||o!==i.getAttribute("style"))&&(o==null?i.removeAttribute("style"):i.style.cssText=o),i.__style=u}else f&&(Array.isArray(f)?(A(i,r==null?void 0:r[0],f[0]),A(i,r==null?void 0:r[1],f[1],"important")):A(i,r,f));return f}export{P as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js.br b/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js.br new file mode 100644 index 0000000..84860b4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js.gz b/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js.gz new file mode 100644 index 0000000..3c03eba Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BNUnVJrY.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js b/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js deleted file mode 100644 index cd19933..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js +++ /dev/null @@ -1 +0,0 @@ -var B=Object.defineProperty;var g=i=>{throw TypeError(i)};var F=(i,e,s)=>e in i?B(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s;var w=(i,e,s)=>F(i,typeof e!="symbol"?e+"":e,s),M=(i,e,s)=>e.has(i)||g("Cannot "+s);var t=(i,e,s)=>(M(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>e.has(i)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),y=(i,e,s,a)=>(M(i,e,"write to private field"),a?a.call(i,s):e.set(i,s),s);import{w as D,Y as C,Z as k,_ as G,D as x,$ as A,G as S,M as Y,a0 as Z,a1 as $}from"./wpu9U-D0.js";var r,n,h,u,p,_,v;class z{constructor(e,s=!0){w(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=D;if(t(this,r).has(e)){var s=t(this,r).get(e),a=t(this,n).get(s);if(a)C(a),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),a=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();Z(o,b),b.append(x()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!a?(t(this,u).add(f),G(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[a,c]of t(this,h))s.includes(a)||(k(c.effect),t(this,h).delete(a))});this.anchor=e,y(this,p,s)}ensure(e,s){var a=D,c=$();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=x();f.append(o),t(this,h).set(e,{effect:A(()=>s(o)),fragment:f})}else t(this,n).set(e,A(()=>s(this.anchor)));if(t(this,r).set(a,e),c){for(const[d,m]of t(this,n))d===e?a.unskip_effect(m):a.skip_effect(m);for(const[d,m]of t(this,h))d===e?a.unskip_effect(m.effect):a.skip_effect(m.effect);a.oncommit(t(this,_)),a.ondiscard(t(this,v))}else S&&(this.anchor=Y),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{z as B}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js.br b/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js.br deleted file mode 100644 index e3163e0..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js.gz b/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js.gz deleted file mode 100644 index 1de713b..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BWk3o_TN.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js.br b/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js.br deleted file mode 100644 index 84b2088..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js.gz b/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js.gz deleted file mode 100644 index f4670dd..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js b/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js deleted file mode 100644 index 0f8a968..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js +++ /dev/null @@ -1 +0,0 @@ -import{b as c,w as g}from"./D8mhvFt8.js";const v=200;function $(){const{subscribe:e,set:n,update:t}=g({connected:!1,reconnecting:!1,events:[],lastHeartbeat:null,error:null});let o=null,s=null,d=0;function m(i){const l=i||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((o==null?void 0:o.readyState)!==WebSocket.OPEN)try{o=new WebSocket(l),o.onopen=()=>{d=0,t(r=>({...r,connected:!0,reconnecting:!1,error:null}))},o.onmessage=r=>{try{const u=JSON.parse(r.data);t(f=>{if(u.type==="Heartbeat")return{...f,lastHeartbeat:u};const w=[u,...f.events].slice(0,v);return{...f,events:w}})}catch(u){console.warn("[vestige] Failed to parse WebSocket message:",u)}},o.onclose=()=>{t(r=>({...r,connected:!1})),p(l)},o.onerror=()=>{t(r=>({...r,error:"WebSocket connection failed"}))}}catch(r){t(u=>({...u,error:String(r)}))}}function p(i){s&&clearTimeout(s),t(r=>({...r,reconnecting:!0}));const l=Math.min(1e3*2**d,3e4);d++,s=setTimeout(()=>m(i),l)}function b(){s&&clearTimeout(s),o==null||o.close(),o=null,n({connected:!1,reconnecting:!1,events:[],lastHeartbeat:null,error:null})}function y(){t(i=>({...i,events:[]}))}function h(i){t(l=>{const r=[i,...l.events].slice(0,v);return{...l,events:r}})}return{subscribe:e,connect:m,disconnect:b,clearEvents:y,injectEvent:h}}const a=$(),S=c(a,e=>e.connected),H=c(a,e=>e.reconnecting),T=c(a,e=>e.events);c(a,e=>e.lastHeartbeat);const M=c(a,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.memory_count)??0}),k=c(a,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.avg_retention)??0}),_=c(a,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.suppressed_count)??0}),W=c(a,e=>{var n,t;return((t=(n=e.lastHeartbeat)==null?void 0:n.data)==null?void 0:t.uptime_secs)??0}),N=c(a,e=>e.events.filter(n=>n.type==="TraceEvent")),P=c(a,e=>{var t;const n=e.events.find(o=>o.type==="TraceEvent");return((t=n==null?void 0:n.data)==null?void 0:t.run_id)??null}),R=c(a,e=>e.events.find(n=>n.type==="TraceEvent")??null),C=c(a,e=>e.events.filter(n=>n.type==="MemoryPrOpened"||n.type==="MemoryPrDecided"));function F(e){if(!Number.isFinite(e)||e<0)return"—";const n=Math.floor(e/86400),t=Math.floor(e%86400/3600),o=Math.floor(e%3600/60),s=Math.floor(e%60);return n>0?t>0?`${n}d ${t}h`:`${n}d`:t>0?o>0?`${t}h ${o}m`:`${t}h`:o>0?s>0?`${o}m ${s}s`:`${o}m`:`${s}s`}export{k as a,M as b,H as c,P as d,T as e,F as f,S as i,R as l,C as m,_ as s,N as t,W as u,a as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js.br b/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js.br deleted file mode 100644 index 56deb73..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js.gz b/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js.gz deleted file mode 100644 index 1102382..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/BhIgFntf.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js b/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js new file mode 100644 index 0000000..fdff1ed --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js @@ -0,0 +1 @@ +import{ac as R,ad as U,g as o,B,ae as N,i as A,af as y,ag as M,ah as Y,d as $,ai as h,aj as q,ak as w,al as x,R as j,am as p,an as z,ao as C,a8 as G,ap as Z,aq as F,U as H,ar as J}from"./CW7md74C.js";import{c as K,g as Q}from"./D90q9c2i.js";let v=!1,g=Symbol();function k(e,r,i){const n=i[r]??(i[r]={store:null,source:U(void 0),unsubscribe:R});if(n.store!==e&&!(g in i))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=R;else{var u=!0;n.unsubscribe=K(e,t=>{u?n.source.v=t:A(n.source,t)}),u=!1}return e&&g in i?Q(e):o(n.source)}function ee(){const e={};function r(){B(()=>{for(var i in e)e[i].unsubscribe();N(e,g,{enumerable:!1,value:!0})})}return[e,r]}function V(e){var r=v;try{return v=!1,[e(),v]}finally{v=r}}function re(e,r,i,n){var E;var u=!p||(i&z)!==0,t=(i&x)!==0,T=(i&F)!==0,f=n,b=!0,P=()=>(b&&(b=!1,f=T?j(n):n),f),d;if(t){var m=H in e||J in e;d=((E=y(e,r))==null?void 0:E.set)??(m&&r in e?a=>e[r]=a:void 0)}var _,I=!1;t?[_,I]=V(()=>e[r]):_=e[r],_===void 0&&n!==void 0&&(_=P(),d&&(u&&M(),d(_)));var s;if(u?s=()=>{var a=e[r];return a===void 0?P():(b=!0,a)}:s=()=>{var a=e[r];return a!==void 0&&(f=void 0),a===void 0?f:a},u&&(i&Y)===0)return s;if(d){var D=e.$$legacy;return(function(a,c){return arguments.length>0?((!u||!c||D||I)&&d(c?s():a),a):s()})}var S=!1,l=((i&C)!==0?G:Z)(()=>(S=!1,s()));t&&o(l);var L=q;return(function(a,c){if(arguments.length>0){const O=c?o(l):u&&t?$(a):a;return A(l,O),S=!0,f!==void 0&&(f=O),a}return h&&S||(L.f&w)!==0?l.v:o(l)})}export{ee as a,re as p,k as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js.br b/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js.br new file mode 100644 index 0000000..5766e01 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js.gz b/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js.gz new file mode 100644 index 0000000..925cb7b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/BjbQ7qSx.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js.br b/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js.br deleted file mode 100644 index 11713a3..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js.gz b/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js.gz deleted file mode 100644 index 6acb963..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js b/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js deleted file mode 100644 index 1776b5d..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js +++ /dev/null @@ -1 +0,0 @@ -import{ab as R,ac as y,g as o,y as N,ad as U,i as A,ae as B,af as M,ag as Y,d as $,ah as h,ai as q,aj as w,ak as x,P as j,al as p,am as z,an as C,a7 as G,ao as Z,ap as F,S as H,aq as J}from"./wpu9U-D0.js";import{c as K,g as Q}from"./D8mhvFt8.js";let v=!1,g=Symbol();function k(e,r,i){const n=i[r]??(i[r]={store:null,source:y(void 0),unsubscribe:R});if(n.store!==e&&!(g in i))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=R;else{var u=!0;n.unsubscribe=K(e,t=>{u?n.source.v=t:A(n.source,t)}),u=!1}return e&&g in i?Q(e):o(n.source)}function ee(){const e={};function r(){N(()=>{for(var i in e)e[i].unsubscribe();U(e,g,{enumerable:!1,value:!0})})}return[e,r]}function V(e){var r=v;try{return v=!1,[e(),v]}finally{v=r}}function re(e,r,i,n){var E;var u=!p||(i&z)!==0,t=(i&x)!==0,T=(i&F)!==0,f=n,b=!0,P=()=>(b&&(b=!1,f=T?j(n):n),f),d;if(t){var m=H in e||J in e;d=((E=B(e,r))==null?void 0:E.set)??(m&&r in e?a=>e[r]=a:void 0)}var _,I=!1;t?[_,I]=V(()=>e[r]):_=e[r],_===void 0&&n!==void 0&&(_=P(),d&&(u&&M(),d(_)));var s;if(u?s=()=>{var a=e[r];return a===void 0?P():(b=!0,a)}:s=()=>{var a=e[r];return a!==void 0&&(f=void 0),a===void 0?f:a},u&&(i&Y)===0)return s;if(d){var D=e.$$legacy;return(function(a,c){return arguments.length>0?((!u||!c||D||I)&&d(c?s():a),a):s()})}var S=!1,l=((i&C)!==0?G:Z)(()=>(S=!1,s()));t&&o(l);var L=q;return(function(a,c){if(arguments.length>0){const O=c?o(l):u&&t?$(a):a;return A(l,O),S=!0,f!==void 0&&(f=O),a}return h&&S||(L.f&w)!==0?l.v:o(l)})}export{ee as a,re as p,k as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js.br b/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js.br deleted file mode 100644 index 372bba1..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js.gz b/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js.gz deleted file mode 100644 index cbf9823..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/ByYB047u.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js b/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js deleted file mode 100644 index 27a1889..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js +++ /dev/null @@ -1,4118 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Ma4NfFrG.js","./Dp1pzeXC.js"])))=>i.map(i=>d[i]); -var ff=Object.defineProperty;var pf=(r,e,t)=>e in r?ff(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ke=(r,e,t)=>pf(r,typeof e!="symbol"?e+"":e,t);import"./Bzak7iHL.js";import{o as od,a as Ac}from"./TZu9D97Z.js";import{s as Qe,d as Al,i as le,g as L,p as sr,o as Ga,a as ot,b as rr,j as ut,e as xe,h as Ee,n as Or,r as fe,t as Pt,u as ei,c as mf,f as no,m as gf,l as _f}from"./wpu9U-D0.js";import{s as ct,d as Cc,a as Ut}from"./D8mhvFt8.js";import{i as It}from"./DKve45Wd.js";import{e as Pr,i as Wa,a as Rt,r as Br,s as Ns,c as vf}from"./60_R_Vbt.js";import{s as zr}from"./EqHb-9AZ.js";import{b as Cl,a as ph}from"./CnZzd20v.js";import{p as Dr,a as xf,s as yf}from"./ByYB047u.js";import{b as mh}from"./Bxs5UR9-.js";import{b as Rl}from"./g5OnrUYZ.js";import{N as Il}from"./CcUbQ_Wl.js";import{b as Mf}from"./DrafHjYM.js";import{i as bf}from"./BLadwbF7.js";import{_ as Sf}from"./Dp1pzeXC.js";import{I as ps}from"./D7A-gG4Z.js";import{D as wf}from"./CmbJHhgy.js";import{a as ms}from"./CZfHMhLI.js";import{e as Ef}from"./BhIgFntf.js";/** - * @license - * Copyright 2010-2024 Three.js Authors - * SPDX-License-Identifier: MIT - */const Rc="172",Xs={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Os={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Tf=0,gh=1,Af=2,sS=3,rS=0,ld=1,Cf=2,Qn=3,Ci=0,fn=1,Bn=2,ii=0,qs=1,Wt=2,_h=3,vh=4,Rf=5,Qi=100,If=101,Pf=102,Df=103,Lf=104,Uf=200,Nf=201,Ff=202,Of=203,Pl=204,Dl=205,Bf=206,zf=207,kf=208,Vf=209,Hf=210,Gf=211,Wf=212,Xf=213,qf=214,Ll=0,Ul=1,Nl=2,Ks=3,Fl=4,Ol=5,Bl=6,zl=7,bo=0,Yf=1,Zf=2,Ti=0,Jf=1,Kf=2,$f=3,cd=4,jf=5,Qf=6,ep=7,xh="attached",tp="detached",Ic=300,Ri=301,os=302,io=303,so=304,qr=306,ro=1e3,Nn=1001,ao=1002,Qt=1003,hd=1004,aS=1004,Cr=1005,oS=1005,Vt=1006,Xa=1007,lS=1007,ni=1008,cS=1008,li=1009,ud=1010,dd=1011,kr=1012,Pc=1013,Ii=1014,Mn=1015,si=1016,Dc=1017,Lc=1018,$s=1020,fd=35902,pd=1021,md=1022,dn=1023,gd=1024,_d=1025,Ys=1026,js=1027,Uc=1028,So=1029,vd=1030,Nc=1031,hS=1032,Fc=1033,qa=33776,Ya=33777,Za=33778,Ja=33779,kl=35840,Vl=35841,Hl=35842,Gl=35843,Wl=36196,Xl=37492,ql=37496,Yl=37808,Zl=37809,Jl=37810,Kl=37811,$l=37812,jl=37813,Ql=37814,ec=37815,tc=37816,nc=37817,ic=37818,sc=37819,rc=37820,ac=37821,Ka=36492,oc=36494,lc=36495,xd=36283,cc=36284,hc=36285,uc=36286,np=2200,ip=2201,sp=2202,oo=2300,dc=2301,Fo=2302,Bs=2400,zs=2401,lo=2402,Oc=2500,yd=2501,uS=0,dS=1,fS=2,rp=3200,ap=3201,pS=3202,mS=3203,cs=0,op=1,wi="",xn="srgb",Qs="srgb-linear",co="linear",vt="srgb",gS=0,gs=7680,_S=7681,vS=7682,xS=7683,yS=34055,MS=34056,bS=5386,SS=512,wS=513,ES=514,TS=515,AS=516,CS=517,RS=518,yh=519,lp=512,cp=513,hp=514,Md=515,up=516,dp=517,fp=518,pp=519,ho=35044,IS=35048,PS=35040,DS=35045,LS=35049,US=35041,NS=35046,FS=35050,OS=35042,BS="100",Mh="300 es",zn=2e3,uo=2001;class ci{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,a=i.length;s>8&255]+Jt[r>>16&255]+Jt[r>>24&255]+"-"+Jt[e&255]+Jt[e>>8&255]+"-"+Jt[e>>16&15|64]+Jt[e>>24&255]+"-"+Jt[t&63|128]+Jt[t>>8&255]+"-"+Jt[t>>16&255]+Jt[t>>24&255]+Jt[n&255]+Jt[n>>8&255]+Jt[n>>16&255]+Jt[n>>24&255]).toLowerCase()}function et(r,e,t){return Math.max(e,Math.min(t,r))}function Bc(r,e){return(r%e+e)%e}function mp(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function gp(r,e,t){return r!==e?(t-r)/(e-r):0}function Lr(r,e,t){return(1-t)*r+t*e}function _p(r,e,t,n){return Lr(r,e,1-Math.exp(-t*n))}function vp(r,e=1){return e-Math.abs(Bc(r,e*2)-e)}function xp(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function yp(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function Mp(r,e){return r+Math.floor(Math.random()*(e-r+1))}function bp(r,e){return r+Math.random()*(e-r)}function Sp(r){return r*(.5-Math.random())}function wp(r){r!==void 0&&(bh=r);let e=bh+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Ep(r){return r*ss}function Tp(r){return r*er}function Ap(r){return(r&r-1)===0&&r!==0}function Cp(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Rp(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function Ip(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),u=s((e-n)/2),f=a((e-n)/2),d=s((n-e)/2),p=a((n-e)/2);switch(i){case"XYX":r.set(o*h,l*u,l*f,o*c);break;case"YZY":r.set(l*f,o*h,l*u,o*c);break;case"ZXZ":r.set(l*u,l*f,o*h,o*c);break;case"XZX":r.set(o*h,l*p,l*d,o*c);break;case"YXY":r.set(l*d,o*h,l*p,o*c);break;case"ZYZ":r.set(l*p,l*d,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function sn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function nt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const bd={DEG2RAD:ss,RAD2DEG:er,generateUUID:bn,clamp:et,euclideanModulo:Bc,mapLinear:mp,inverseLerp:gp,lerp:Lr,damp:_p,pingpong:vp,smoothstep:xp,smootherstep:yp,randInt:Mp,randFloat:bp,randFloatSpread:Sp,seededRandom:wp,degToRad:Ep,radToDeg:Tp,isPowerOfTwo:Ap,ceilPowerOfTwo:Cp,floorPowerOfTwo:Rp,setQuaternionFromProperEuler:Ip,normalize:nt,denormalize:sn};class j{constructor(e=0,t=0){j.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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=et(this.x,e.x,t.x),this.y=et(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=et(this.x,e,t),this.y=et(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(et(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){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(et(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const 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){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class tt{constructor(e,t,n,i,s,a,o,l,c){tt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const 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){const 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){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],f=n[2],d=n[5],p=n[8],_=i[0],g=i[3],m=i[6],y=i[1],v=i[4],x=i[7],w=i[2],T=i[5],C=i[8];return s[0]=a*_+o*y+l*w,s[3]=a*g+o*v+l*T,s[6]=a*m+o*x+l*C,s[1]=c*_+h*y+u*w,s[4]=c*g+h*v+u*T,s[7]=c*m+h*x+u*C,s[2]=f*_+d*y+p*w,s[5]=f*g+d*v+p*T,s[8]=f*m+d*x+p*C,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*s*h+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=h*a-o*c,f=o*l-h*s,d=c*s-a*l,p=t*u+n*f+i*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=u*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=f*_,e[4]=(h*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=d*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,this}transpose(){let e;const 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){const 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,i,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Oo.makeScale(e,t)),this}rotate(e){return this.premultiply(Oo.makeRotation(-e)),this}translate(e,t){return this.premultiply(Oo.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){const 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){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])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){const 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)}}const Oo=new tt;function Sd(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}const Pp={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ks(r,e){return new Pp[r](e)}function Vr(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Dp(){const r=Vr("canvas");return r.style.display="block",r}const Sh={};function Fs(r){r in Sh||(Sh[r]=!0,console.warn(r))}function Lp(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function Up(r){const e=r.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Np(r){const e=r.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const wh=new tt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Eh=new tt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Fp(){const r={enabled:!0,workingColorSpace:Qs,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===vt&&(i.r=ri(i.r),i.g=ri(i.g),i.b=ri(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===vt&&(i.r=Zs(i.r),i.g=Zs(i.g),i.b=Zs(i.b))),i},fromWorkingColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},toWorkingColorSpace:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===wi?co:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Qs]:{primaries:e,whitePoint:n,transfer:co,toXYZ:wh,fromXYZ:Eh,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:xn},outputColorSpaceConfig:{drawingBufferColorSpace:xn}},[xn]:{primaries:e,whitePoint:n,transfer:vt,toXYZ:wh,fromXYZ:Eh,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:xn}}}),r}const ht=Fp();function ri(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Zs(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let _s;class Op{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{_s===void 0&&(_s=Vr("canvas")),_s.width=e.width,_s.height=e.height;const n=_s.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=_s}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Vr("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ic)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ro:e.x=e.x-Math.floor(e.x);break;case Nn:e.x=e.x<0?0:1;break;case ao:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ro:e.y=e.y-Math.floor(e.y);break;case Nn:e.y=e.y<0?0:1;break;case ao:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Et.DEFAULT_IMAGE=null;Et.DEFAULT_MAPPING=Ic;Et.DEFAULT_ANISOTROPY=1;class pt{constructor(e=0,t=0,n=0,i=1){pt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,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,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,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);const 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,i,s;const l=e.elements,c=l[0],h=l[4],u=l[8],f=l[1],d=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(h-f)<.01&&Math.abs(u-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(h+f)<.1&&Math.abs(u+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(c+1)/2,x=(d+1)/2,w=(m+1)/2,T=(h+f)/4,C=(u+_)/4,P=(p+g)/4;return v>x&&v>w?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=T/n,s=C/n):x>w?x<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(x),n=T/i,s=P/i):w<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(w),n=C/s,i=P/s),this.set(n,i,s,t),this}let y=Math.sqrt((g-p)*(g-p)+(u-_)*(u-_)+(f-h)*(f-h));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(u-_)/y,this.z=(f-h)/y,this.w=Math.acos((c+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=et(this.x,e.x,t.x),this.y=et(this.y,e.y,t.y),this.z=et(this.z,e.z,t.z),this.w=et(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=et(this.x,e,t),this.y=et(this.y,e,t),this.z=et(this.z,e,t),this.w=et(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(et(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class zc extends ci{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new pt(0,0,e,t),this.scissorTest=!1,this.viewport=new pt(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new Et(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o=0?1:-1,v=1-m*m;if(v>Number.EPSILON){const w=Math.sqrt(v),T=Math.atan2(w,m*y);g=Math.sin(g*T)/w,o=Math.sin(o*T)/w}const x=o*y;if(l=l*g+f*x,c=c*g+d*x,h=h*g+p*x,u=u*g+_*x,g===1-o){const w=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=w,c*=w,h*=w,u*=w}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=s[a],f=s[a+1],d=s[a+2],p=s[a+3];return e[t]=o*p+h*u+l*d-c*f,e[t+1]=l*p+h*f+c*u-o*d,e[t+2]=c*p+h*d+o*f-l*u,e[t+3]=h*p-o*u-l*f-c*d,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,i){return this._x=e,this._y=t,this._z=n,this._w=i,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){const n=e._x,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(s/2),f=l(n/2),d=l(i/2),p=l(s/2);switch(a){case"XYZ":this._x=f*h*u+c*d*p,this._y=c*d*u-f*h*p,this._z=c*h*p+f*d*u,this._w=c*h*u-f*d*p;break;case"YXZ":this._x=f*h*u+c*d*p,this._y=c*d*u-f*h*p,this._z=c*h*p-f*d*u,this._w=c*h*u+f*d*p;break;case"ZXY":this._x=f*h*u-c*d*p,this._y=c*d*u+f*h*p,this._z=c*h*p+f*d*u,this._w=c*h*u-f*d*p;break;case"ZYX":this._x=f*h*u-c*d*p,this._y=c*d*u+f*h*p,this._z=c*h*p-f*d*u,this._w=c*h*u+f*d*p;break;case"YZX":this._x=f*h*u+c*d*p,this._y=c*d*u+f*h*p,this._z=c*h*p-f*d*u,this._w=c*h*u-f*d*p;break;case"XZY":this._x=f*h*u-c*d*p,this._y=c*d*u-f*h*p,this._z=c*h*p+f*d*u,this._w=c*h*u+f*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],u=t[10],f=n+o+u;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(h-l)*d,this._y=(s-c)*d,this._z=(a-i)*d}else if(n>o&&n>u){const d=2*Math.sqrt(1+n-o-u);this._w=(h-l)/d,this._x=.25*d,this._y=(i+a)/d,this._z=(s+c)/d}else if(o>u){const d=2*Math.sqrt(1+o-n-u);this._w=(s-c)/d,this._x=(i+a)/d,this._y=.25*d,this._z=(l+h)/d}else{const d=2*Math.sqrt(1+u-n-o);this._w=(a-i)/d,this._x=(s+c)/d,this._y=(l+h)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.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(et(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-s*l,this._y=i*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-t;return this._w=d*a+t*this._w,this._x=d*n+t*this._x,this._y=d*i+t*this._y,this._z=d*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-t)*h)/c,f=Math.sin(t*h)/c;return this._w=a*u+this._w*f,this._x=n*u+this._x*f,this._y=i*u+this._y*f,this._z=s*u+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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}}class A{constructor(e=0,t=0,n=0){A.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Th.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Th.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-s*i),u=2*(s*n-a*t);return this.x=t+l*c+a*u-o*h,this.y=n+l*h+o*c-s*u,this.z=i+l*u+s*h-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){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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=et(this.x,e.x,t.x),this.y=et(this.y,e.y,t.y),this.z=et(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=et(this.x,e,t),this.y=et(this.y,e,t),this.z=et(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(et(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){const n=e.x,i=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return zo.copy(this).projectOnVector(e),this.sub(zo)}reflect(e){return this.sub(zo.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(et(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*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){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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(){const 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}}const zo=new A,Th=new rn;class pn{constructor(e=new A(1/0,1/0,1/0),t=new A(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t=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,Dn),Dn.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(mr),$r.subVectors(this.max,mr),vs.subVectors(e.a,mr),xs.subVectors(e.b,mr),ys.subVectors(e.c,mr),mi.subVectors(xs,vs),gi.subVectors(ys,xs),Fi.subVectors(vs,ys);let t=[0,-mi.z,mi.y,0,-gi.z,gi.y,0,-Fi.z,Fi.y,mi.z,0,-mi.x,gi.z,0,-gi.x,Fi.z,0,-Fi.x,-mi.y,mi.x,0,-gi.y,gi.x,0,-Fi.y,Fi.x,0];return!ko(t,vs,xs,ys,$r)||(t=[1,0,0,0,1,0,0,0,1],!ko(t,vs,xs,ys,$r))?!1:(jr.crossVectors(mi,gi),t=[jr.x,jr.y,jr.z],ko(t,vs,xs,ys,$r))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Dn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Dn).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:(qn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),qn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),qn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),qn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),qn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),qn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),qn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),qn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(qn),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)}}const qn=[new A,new A,new A,new A,new A,new A,new A,new A],Dn=new A,Kr=new pn,vs=new A,xs=new A,ys=new A,mi=new A,gi=new A,Fi=new A,mr=new A,$r=new A,jr=new A,Oi=new A;function ko(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Oi.fromArray(r,s);const o=i.x*Math.abs(Oi.x)+i.y*Math.abs(Oi.y)+i.z*Math.abs(Oi.z),l=e.dot(Oi),c=t.dot(Oi),h=n.dot(Oi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const kp=new pn,gr=new A,Vo=new A;class an{constructor(e=new A,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){const n=this.center;t!==void 0?n.copy(t):kp.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;gr.subVectors(e,this.center);const t=gr.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(gr,i/n),this.radius+=i}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):(Vo.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(gr.copy(e.center).add(Vo)),this.expandByPoint(gr.copy(e.center).sub(Vo))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Yn=new A,Ho=new A,Qr=new A,_i=new A,Go=new A,ea=new A,Wo=new A;class ar{constructor(e=new A,t=new A(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,Yn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const 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){const t=Yn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Yn.copy(this.origin).addScaledVector(this.direction,t),Yn.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ho.copy(e).add(t).multiplyScalar(.5),Qr.copy(t).sub(e).normalize(),_i.copy(this.origin).sub(Ho);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Qr),o=_i.dot(this.direction),l=-_i.dot(Qr),c=_i.lengthSq(),h=Math.abs(1-a*a);let u,f,d,p;if(h>0)if(u=a*l-o,f=a*o-l,p=s*h,u>=0)if(f>=-p)if(f<=p){const _=1/h;u*=_,f*=_,d=u*(u+a*f+2*o)+f*(a*u+f+2*l)+c}else f=s,u=Math.max(0,-(a*f+o)),d=-u*u+f*(f+2*l)+c;else f=-s,u=Math.max(0,-(a*f+o)),d=-u*u+f*(f+2*l)+c;else f<=-p?(u=Math.max(0,-(-a*s+o)),f=u>0?-s:Math.min(Math.max(-s,-l),s),d=-u*u+f*(f+2*l)+c):f<=p?(u=0,f=Math.min(Math.max(-s,-l),s),d=f*(f+2*l)+c):(u=Math.max(0,-(a*s+o)),f=u>0?s:Math.min(Math.max(-s,-l),s),d=-u*u+f*(f+2*l)+c);else f=a>0?-s:s,u=Math.max(0,-(a*f+o)),d=-u*u+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Ho).addScaledVector(Qr,f),d}intersectSphere(e,t){Yn.subVectors(e.center,this.origin);const n=Yn.dot(this.direction),i=Yn.dot(Yn)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),h>=0?(s=(e.min.y-f.y)*h,a=(e.max.y-f.y)*h):(s=(e.max.y-f.y)*h,a=(e.min.y-f.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a=0?(o=(e.min.z-f.z)*u,l=(e.max.z-f.z)*u):(o=(e.max.z-f.z)*u,l=(e.min.z-f.z)*u),n>l||o>i)||((o>n||n!==n)&&(n=o),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Yn)!==null}intersectTriangle(e,t,n,i,s){Go.subVectors(t,e),ea.subVectors(n,e),Wo.crossVectors(Go,ea);let a=this.direction.dot(Wo),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_i.subVectors(this.origin,e);const l=o*this.direction.dot(ea.crossVectors(_i,ea));if(l<0)return null;const c=o*this.direction.dot(Go.cross(_i));if(c<0||l+c>a)return null;const h=-o*_i.dot(Wo);return h<0?null:this.at(h/a,s)}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)}}class Ze{constructor(e,t,n,i,s,a,o,l,c,h,u,f,d,p,_,g){Ze.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c,h,u,f,d,p,_,g)}set(e,t,n,i,s,a,o,l,c,h,u,f,d,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=i,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=h,m[10]=u,m[14]=f,m[3]=d,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ze().fromArray(this.elements)}copy(e){const 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){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Ms.setFromMatrixColumn(e,0).length(),s=1/Ms.setFromMatrixColumn(e,1).length(),a=1/Ms.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,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){const t=this.elements,n=e.x,i=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const f=a*h,d=a*u,p=o*h,_=o*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=d+p*c,t[5]=f-_*c,t[9]=-o*l,t[2]=_-f*c,t[6]=p+d*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*h,d=l*u,p=c*h,_=c*u;t[0]=f+_*o,t[4]=p*o-d,t[8]=a*c,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=d*o-p,t[6]=_+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*h,d=l*u,p=c*h,_=c*u;t[0]=f-_*o,t[4]=-a*u,t[8]=p+d*o,t[1]=d+p*o,t[5]=a*h,t[9]=_-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*h,d=a*u,p=o*h,_=o*u;t[0]=l*h,t[4]=p*c-d,t[8]=f*c+_,t[1]=l*u,t[5]=_*c+f,t[9]=d*c-p,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,d=a*c,p=o*l,_=o*c;t[0]=l*h,t[4]=_-f*u,t[8]=p*u+d,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=d*u+p,t[10]=f-_*u}else if(e.order==="XZY"){const f=a*l,d=a*c,p=o*l,_=o*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=f*u+_,t[5]=a*h,t[9]=d*u-p,t[2]=p*u-d,t[6]=o*h,t[10]=_*u+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Vp,e,Hp)}lookAt(e,t,n){const i=this.elements;return _n.subVectors(e,t),_n.lengthSq()===0&&(_n.z=1),_n.normalize(),vi.crossVectors(n,_n),vi.lengthSq()===0&&(Math.abs(n.z)===1?_n.x+=1e-4:_n.z+=1e-4,_n.normalize(),vi.crossVectors(n,_n)),vi.normalize(),ta.crossVectors(_n,vi),i[0]=vi.x,i[4]=ta.x,i[8]=_n.x,i[1]=vi.y,i[5]=ta.y,i[9]=_n.y,i[2]=vi.z,i[6]=ta.z,i[10]=_n.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],f=n[9],d=n[13],p=n[2],_=n[6],g=n[10],m=n[14],y=n[3],v=n[7],x=n[11],w=n[15],T=i[0],C=i[4],P=i[8],S=i[12],M=i[1],D=i[5],G=i[9],F=i[13],V=i[2],J=i[6],q=i[10],se=i[14],Z=i[3],_e=i[7],be=i[11],Re=i[15];return s[0]=a*T+o*M+l*V+c*Z,s[4]=a*C+o*D+l*J+c*_e,s[8]=a*P+o*G+l*q+c*be,s[12]=a*S+o*F+l*se+c*Re,s[1]=h*T+u*M+f*V+d*Z,s[5]=h*C+u*D+f*J+d*_e,s[9]=h*P+u*G+f*q+d*be,s[13]=h*S+u*F+f*se+d*Re,s[2]=p*T+_*M+g*V+m*Z,s[6]=p*C+_*D+g*J+m*_e,s[10]=p*P+_*G+g*q+m*be,s[14]=p*S+_*F+g*se+m*Re,s[3]=y*T+v*M+x*V+w*Z,s[7]=y*C+v*D+x*J+w*_e,s[11]=y*P+v*G+x*q+w*be,s[15]=y*S+v*F+x*se+w*Re,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],u=e[6],f=e[10],d=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+s*l*u-i*c*u-s*o*f+n*c*f+i*o*d-n*l*d)+_*(+t*l*d-t*c*f+s*a*f-i*a*d+i*c*h-s*l*h)+g*(+t*c*u-t*o*d-s*a*u+n*a*d+s*o*h-n*c*h)+m*(-i*o*h-t*l*u+t*o*f+i*a*u-n*a*f+n*l*h)}transpose(){const e=this.elements;let 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){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],f=e[10],d=e[11],p=e[12],_=e[13],g=e[14],m=e[15],y=u*g*c-_*f*c+_*l*d-o*g*d-u*l*m+o*f*m,v=p*f*c-h*g*c-p*l*d+a*g*d+h*l*m-a*f*m,x=h*_*c-p*u*c+p*o*d-a*_*d-h*o*m+a*u*m,w=p*u*l-h*_*l-p*o*f+a*_*f+h*o*g-a*u*g,T=t*y+n*v+i*x+s*w;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/T;return e[0]=y*C,e[1]=(_*f*s-u*g*s-_*i*d+n*g*d+u*i*m-n*f*m)*C,e[2]=(o*g*s-_*l*s+_*i*c-n*g*c-o*i*m+n*l*m)*C,e[3]=(u*l*s-o*f*s-u*i*c+n*f*c+o*i*d-n*l*d)*C,e[4]=v*C,e[5]=(h*g*s-p*f*s+p*i*d-t*g*d-h*i*m+t*f*m)*C,e[6]=(p*l*s-a*g*s-p*i*c+t*g*c+a*i*m-t*l*m)*C,e[7]=(a*f*s-h*l*s+h*i*c-t*f*c-a*i*d+t*l*d)*C,e[8]=x*C,e[9]=(p*u*s-h*_*s-p*n*d+t*_*d+h*n*m-t*u*m)*C,e[10]=(a*_*s-p*o*s+p*n*c-t*_*c-a*n*m+t*o*m)*C,e[11]=(h*o*s-a*u*s-h*n*c+t*u*c+a*n*d-t*o*d)*C,e[12]=w*C,e[13]=(h*_*i-p*u*i+p*n*f-t*_*f-h*n*g+t*u*g)*C,e[14]=(p*o*i-a*_*i-p*n*l+t*_*l+a*n*g-t*o*g)*C,e[15]=(a*u*i-h*o*i+h*n*l-t*u*l-a*n*f+t*o*f)*C,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const 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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}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){const 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){const 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){const 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){const n=Math.cos(t),i=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,u=o+o,f=s*c,d=s*h,p=s*u,_=a*h,g=a*u,m=o*u,y=l*c,v=l*h,x=l*u,w=n.x,T=n.y,C=n.z;return i[0]=(1-(_+m))*w,i[1]=(d+x)*w,i[2]=(p-v)*w,i[3]=0,i[4]=(d-x)*T,i[5]=(1-(f+m))*T,i[6]=(g+y)*T,i[7]=0,i[8]=(p+v)*C,i[9]=(g-y)*C,i[10]=(1-(f+_))*C,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=Ms.set(i[0],i[1],i[2]).length();const a=Ms.set(i[4],i[5],i[6]).length(),o=Ms.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Ln.copy(this);const c=1/s,h=1/a,u=1/o;return Ln.elements[0]*=c,Ln.elements[1]*=c,Ln.elements[2]*=c,Ln.elements[4]*=h,Ln.elements[5]*=h,Ln.elements[6]*=h,Ln.elements[8]*=u,Ln.elements[9]*=u,Ln.elements[10]*=u,t.setFromRotationMatrix(Ln),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,i,s,a,o=zn){const l=this.elements,c=2*s/(t-e),h=2*s/(n-i),u=(t+e)/(t-e),f=(n+i)/(n-i);let d,p;if(o===zn)d=-(a+s)/(a-s),p=-2*a*s/(a-s);else if(o===uo)d=-a/(a-s),p=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,s,a,o=zn){const l=this.elements,c=1/(t-e),h=1/(n-i),u=1/(a-s),f=(t+e)*c,d=(n+i)*h;let p,_;if(o===zn)p=(a+s)*u,_=-2*u;else if(o===uo)p=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])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){const 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}}const Ms=new A,Ln=new Ze,Vp=new A(0,0,0),Hp=new A(1,1,1),vi=new A,ta=new A,_n=new A,Ah=new Ze,Ch=new rn;class In{constructor(e=0,t=0,n=0,i=In.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,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,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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){const i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],f=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(et(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-et(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(et(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-et(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(et(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-et(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ah.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ah,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ch.setFromEuler(this),this.setFromQuaternion(Ch,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}In.DEFAULT_ORDER="XYZ";class Vc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){i.children=[];for(let o=0;o0){i.animations=[];for(let o=0;o0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),p.length>0&&(n.nodes=p)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Un.subVectors(i,t),Jn.subVectors(n,t),qo.subVectors(e,t);const a=Un.dot(Un),o=Un.dot(Jn),l=Un.dot(qo),c=Jn.dot(Jn),h=Jn.dot(qo),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const f=1/u,d=(c*l-o*h)*f,p=(a*h-o*l)*f;return s.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Kn)===null?!1:Kn.x>=0&&Kn.y>=0&&Kn.x+Kn.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,Kn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Kn.x),l.addScaledVector(a,Kn.y),l.addScaledVector(o,Kn.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return Ko.setScalar(0),$o.setScalar(0),jo.setScalar(0),Ko.fromBufferAttribute(e,t),$o.fromBufferAttribute(e,n),jo.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Ko,s.x),a.addScaledVector($o,s.y),a.addScaledVector(jo,s.z),a}static isFrontFacing(e,t,n,i){return Un.subVectors(n,t),Jn.subVectors(e,t),Un.cross(Jn).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 Un.subVectors(this.c,this.b),Jn.subVectors(this.a,this.b),Un.cross(Jn).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return yn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return yn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return yn.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return yn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return yn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;ws.subVectors(i,n),Es.subVectors(s,n),Yo.subVectors(e,n);const l=ws.dot(Yo),c=Es.dot(Yo);if(l<=0&&c<=0)return t.copy(n);Zo.subVectors(e,i);const h=ws.dot(Zo),u=Es.dot(Zo);if(h>=0&&u<=h)return t.copy(i);const f=l*u-h*c;if(f<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(ws,a);Jo.subVectors(e,s);const d=ws.dot(Jo),p=Es.dot(Jo);if(p>=0&&d<=p)return t.copy(s);const _=d*c-l*p;if(_<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Es,o);const g=h*p-d*u;if(g<=0&&u-h>=0&&d-p>=0)return Uh.subVectors(s,i),o=(u-h)/(u-h+(d-p)),t.copy(i).addScaledVector(Uh,o);const m=1/(g+_+f);return a=_*m,o=f*m,t.copy(n).addScaledVector(ws,a).addScaledVector(Es,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const wd={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},xi={h:0,s:0,l:0},ia={h:0,s:0,l:0};function Qo(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class ne{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){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=xn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ht.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=ht.workingColorSpace){return this.r=e,this.g=t,this.b=n,ht.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=ht.workingColorSpace){if(e=Bc(e,1),t=et(t,0,1),n=et(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=Qo(a,s,e+1/3),this.g=Qo(a,s,e),this.b=Qo(a,s,e-1/3)}return ht.toWorkingColorSpace(this,i),this}setStyle(e,t=xn){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=xn){const n=wd[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ri(e.r),this.g=ri(e.g),this.b=ri(e.b),this}copyLinearToSRGB(e){return this.r=Zs(e.r),this.g=Zs(e.g),this.b=Zs(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=xn){return ht.fromWorkingColorSpace(Kt.copy(this),e),Math.round(et(Kt.r*255,0,255))*65536+Math.round(et(Kt.g*255,0,255))*256+Math.round(et(Kt.b*255,0,255))}getHexString(e=xn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ht.workingColorSpace){ht.fromWorkingColorSpace(Kt.copy(this),t);const n=Kt.r,i=Kt.g,s=Kt.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-s)/u+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,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.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!==qs&&(n.blending=this.blending),this.side!==Ci&&(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!==Pl&&(n.blendSrc=this.blendSrc),this.blendDst!==Dl&&(n.blendDst=this.blendDst),this.blendEquation!==Qi&&(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!==Ks&&(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!==yh&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==gs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==gs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==gs&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}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;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class kn extends on{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ne(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new In,this.combine=bo,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}}const ti=Zp();function Zp(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,i[l]=24,i[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;(c&8388608)===0;)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function un(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=et(r,-65504,65504),ti.floatView[0]=r;const e=ti.uint32View[0],t=e>>23&511;return ti.baseTable[t]+((e&8388607)>>ti.shiftTable[t])}function Rr(r){const e=r>>10;return ti.uint32View[0]=ti.mantissaTable[ti.offsetTable[e]+(r&1023)]+ti.exponentTable[e],ti.floatView[0]}const VS={toHalfFloat:un,fromHalfFloat:Rr},Lt=new A,sa=new j;class rt{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=ho,this.updateRanges=[],this.gpuType=Mn,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 i=0,s=this.itemSize;it.count&&console.warn("THREE.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 pn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new A(-1/0,-1/0,-1/0),new A(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,f=c.length;u0&&(i[l]=h,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),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;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let f=0,d=u.length;f0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s(e.far-e.near)**2))&&(Nh.copy(s).invert(),Bi.copy(e.ray).applyMatrix4(Nh),!(n.boundingBox!==null&&Bi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Bi)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,f=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(a))for(let p=0,_=f.length;p<_;p++){const g=f[p],m=a[g.materialIndex],y=Math.max(g.start,d.start),v=Math.min(o.count,Math.min(g.start+g.count,d.start+d.count));for(let x=y,w=v;xt.far?null:{distance:c,point:ha.clone(),object:r}}function ua(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,aa),r.getVertexPosition(l,oa),r.getVertexPosition(c,la);const h=Kp(r,e,t,n,aa,oa,la,Oh);if(h){const u=new A;yn.getBarycoord(Oh,aa,oa,la,u),i&&(h.uv=yn.getInterpolatedAttribute(i,o,l,c,u,new j)),s&&(h.uv1=yn.getInterpolatedAttribute(s,o,l,c,u,new j)),a&&(h.normal=yn.getInterpolatedAttribute(a,o,l,c,u,new A),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new A,materialIndex:0};yn.getNormal(aa,oa,la,f.normal),h.face=f,h.barycoord=u}return h}class or extends qe{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let f=0,d=0;p("z","y","x",-1,-1,n,t,e,a,s,0),p("z","y","x",1,-1,n,t,-e,a,s,1),p("x","z","y",1,1,e,n,t,i,a,2),p("x","z","y",1,-1,e,n,-t,i,a,3),p("x","y","z",1,-1,e,t,n,i,s,4),p("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new Fe(c,3)),this.setAttribute("normal",new Fe(h,3)),this.setAttribute("uv",new Fe(u,2));function p(_,g,m,y,v,x,w,T,C,P,S){const M=x/C,D=w/P,G=x/2,F=w/2,V=T/2,J=C+1,q=P+1;let se=0,Z=0;const _e=new A;for(let be=0;be0?1:-1,h.push(_e.x,_e.y,_e.z),u.push(Ge/C),u.push(1-be/P),se+=1}}for(let be=0;be0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Hc extends mt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ze,this.projectionMatrix=new Ze,this.projectionMatrixInverse=new Ze,this.coordinateSystem=zn}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)}}const yi=new A,Bh=new j,zh=new j;class kt extends Hc{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,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){const t=.5*this.getFilmHeight()/e;this.fov=er*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ss*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return er*2*Math.atan(Math.tan(ss*.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){yi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(yi.x,yi.y).multiplyScalar(-e/yi.z),yi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(yi.x,yi.y).multiplyScalar(-e/yi.z)}getViewSize(e,t){return this.getViewBounds(e,Bh,zh),t.subVectors(zh,Bh)}setViewOffset(e,t,n,i,s,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=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ss*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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}}const As=-90,Cs=1;class em extends mt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new kt(As,Cs,e,t);i.layers=this.layers,this.add(i);const s=new kt(As,Cs,e,t);s.layers=this.layers,this.add(s);const a=new kt(As,Cs,e,t);a.layers=this.layers,this.add(a);const o=new kt(As,Cs,e,t);o.layers=this.layers,this.add(o);const l=new kt(As,Cs,e,t);l.layers=this.layers,this.add(l);const c=new kt(As,Cs,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,a,o,l]=t;for(const c of t)this.remove(c);if(e===zn)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.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),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===uo)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.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),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,c,h]=this.children,u=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,l),e.setRenderTarget(n,4,i),e.render(t,c),n.texture.generateMipmaps=_,e.setRenderTarget(n,5,i),e.render(t,h),e.setRenderTarget(u,f,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class Eo extends Et{constructor(e,t,n,i,s,a,o,l,c,h){e=e!==void 0?e:[],t=t!==void 0?t:Ri,super(e,t,n,i,s,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tm extends Sn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new Eo(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Vt}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;const n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new or(5,5,5),s=new Xt({name:"CubemapFromEquirect",uniforms:tr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:fn,blending:ii});s.uniforms.tEquirect.value=t;const a=new yt(i,s),o=t.minFilter;return t.minFilter===ni&&(t.minFilter=Vt),new em(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(s)}}class Yr{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ne(e),this.density=t}clone(){return new Yr(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Gc{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new ne(e),this.near=t,this.far=n}clone(){return new Gc(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Cd extends mt{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 In,this.environmentIntensity=1,this.environmentRotation=new In,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){const 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}}class Wc{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ho,this.updateRanges=[],this.version=0,this.uuid=bn()}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:xr.clone(),uv:yn.getInterpolation(xr,da,Mr,fa,kh,nl,Vh,new j),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function pa(r,e,t,n,i,s){Ds.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(yr.x=s*Ds.x-i*Ds.y,yr.y=i*Ds.x+s*Ds.y):yr.copy(Ds),r.copy(e),r.x+=yr.x,r.y+=yr.y,r.applyMatrix4(Rd)}const ma=new A,Hh=new A;class nm extends mt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){ma.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(ma);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ma.setFromMatrixPosition(e.matrixWorld),Hh.setFromMatrixPosition(this.matrixWorld);const n=ma.distanceTo(Hh)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=a)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const 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){const n=t||lm.getNormalMatrix(e),i=this.coplanarPoint(rl).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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)}}const zi=new an,va=new A;class To{constructor(e=new Si,t=new Si,n=new Si,i=new Si,s=new Si,a=new Si){this.planes=[e,t,n,i,s,a]}set(e,t,n,i,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=zn){const n=this.planes,i=e.elements,s=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],u=i[6],f=i[7],d=i[8],p=i[9],_=i[10],g=i[11],m=i[12],y=i[13],v=i[14],x=i[15];if(n[0].setComponents(l-s,f-c,g-d,x-m).normalize(),n[1].setComponents(l+s,f+c,g+d,x+m).normalize(),n[2].setComponents(l+a,f+h,g+p,x+y).normalize(),n[3].setComponents(l-a,f-h,g-p,x-y).normalize(),n[4].setComponents(l-o,f-u,g-_,x-v).normalize(),t===zn)n[5].setComponents(l+o,f+u,g+_,x+v).normalize();else if(t===uo)n[5].setComponents(o,u,_,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),zi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zi)}intersectsSprite(e){return zi.center.set(0,0,0),zi.radius=.7071067811865476,zi.applyMatrix4(e.matrixWorld),this.intersectsSphere(zi)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,va.y=i.normal.y>0?e.max.y:e.min.y,va.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(va)<0)return!1}return!0}containsPoint(e){const 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)}}function al(r,e){return r-e}function cm(r,e){return r.z-e.z}function hm(r,e){return e.z-r.z}class um{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,i){const s=this.pool,a=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const o=s[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=i}reset(){this.list.length=0,this.index=0}}const cn=new Ze,dm=new ne(1,1,1),ol=new To,xa=new pn,ki=new an,wr=new A,$h=new A,fm=new A,ll=new um,$t=new yt,ya=[];function pm(r,e,t=0){const n=e.itemSize;if(r.isInterleavedBufferAttribute||r.array.constructor!==e.array.constructor){const i=r.count;for(let s=0;s65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new rt(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=e.getAttribute(n),s=t.getAttribute(n);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pn);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(al),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=n):(i=this._instanceInfo.length,this._instanceInfo.push(n));const s=this._matricesTexture;cn.identity().toArray(s.image.data,i*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(dm.toArray(a.image.data,i*4),a.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const a=e.getIndex();if(a!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=n===-1?a.count:n),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(al),l=this._availableGeometryIds.shift(),s[l]=i):(l=this._geometryCount,this._geometryCount++,s.push(i)),this.setGeometryAt(l,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=n.getIndex()!==null,s=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(i&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const h in n.attributes){const u=t.getAttribute(h),f=n.getAttribute(h);pm(u,f,l);const d=u.itemSize;for(let p=u.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let i=0,s=n.length;io).sort((a,o)=>n[a].vertexStart-n[o].vertexStart),s=this.geometry;for(let a=0,o=n.length;a=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const s=new pn,a=n.index,o=n.attributes.position;for(let l=i.start,c=i.start+i.count;l=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const s=new an;this.getBoundingBoxAt(e,xa),xa.getCenter(s.center);const a=n.index,o=n.attributes.position;let l=0;for(let c=i.start,h=i.start+i.count;co.active);if(Math.max(...n.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new qe,this._initializeGeometry(s));const a=this.geometry;s.index&&Vi(s.index.array,a.index.array);for(const o in s.attributes)Vi(s.attributes[o].array,a.attributes[o].array)}raycast(e,t){const n=this._instanceInfo,i=this._geometryInfo,s=this.matrixWorld,a=this.geometry;$t.material=this.material,$t.geometry.index=a.index,$t.geometry.attributes=a.attributes,$t.geometry.boundingBox===null&&($t.geometry.boundingBox=new pn),$t.geometry.boundingSphere===null&&($t.geometry.boundingSphere=new an);for(let o=0,l=n.length;o({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,n,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=i.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._geometryInfo,f=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data;f&&(cn.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),ol.setFromProjectionMatrix(cn,e.coordinateSystem));let _=0;if(this.sortObjects){cn.copy(this.matrixWorld).invert(),wr.setFromMatrixPosition(n.matrixWorld).applyMatrix4(cn),$h.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(cn);for(let y=0,v=l.length;y0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;sn)return;cl.applyMatrix4(r.matrixWorld);const l=e.ray.origin.distanceTo(cl);if(!(le.far))return{distance:l,point:Qh.clone().applyMatrix4(r.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:r}}const eu=new A,tu=new A;class hi extends Vn{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;si.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class ns extends mt{constructor(){super(),this.isGroup=!0,this.type="Group"}}class ZS extends Et{constructor(e,t,n,i,s,a,o,l,c){super(e,t,n,i,s,a,o,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:Vt,this.magFilter=s!==void 0?s:Vt,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class JS extends Et{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Qt,this.minFilter=Qt,this.generateMipmaps=!1,this.needsUpdate=!0}}class qc extends Et{constructor(e,t,n,i,s,a,o,l,c,h,u,f){super(null,a,o,l,c,h,i,s,u,f),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class KS extends qc{constructor(e,t,n,i,s,a){super(e,t,n,s,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Nn,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class $S extends qc{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Ri),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Dd extends Et{constructor(e,t,n,i,s,a,o,l,c){super(e,t,n,i,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ld extends Et{constructor(e,t,n,i,s,a,o,l,c,h=Ys){if(h!==Ys&&h!==js)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Ys&&(n=Ii),n===void 0&&h===js&&(n=$s),super(null,i,s,a,o,l,h,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:Qt,this.minFilter=l!==void 0?l:Qt,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Hn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),s=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let a;t?a=t:a=e*n[s-1];let o=0,l=s-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(s-1);const h=n[i],f=n[i+1]-h,d=(a-h)/f;return(i+d)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const a=this.getPoint(i),o=this.getPoint(s),l=t||(a.isVector2?new j:new A);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new A,i=[],s=[],a=[],o=new A,l=new Ze;for(let d=0;d<=e;d++){const p=d/e;i[d]=this.getTangentAt(p,new A)}s[0]=new A,a[0]=new A;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),f=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),f<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),a[0].crossVectors(i[0],s[0]);for(let d=1;d<=e;d++){if(s[d]=s[d-1].clone(),a[d]=a[d-1].clone(),o.crossVectors(i[d-1],i[d]),o.length()>Number.EPSILON){o.normalize();const p=Math.acos(et(i[d-1].dot(i[d]),-1,1));s[d].applyMatrix4(l.makeRotationAxis(o,p))}a[d].crossVectors(i[d],s[d])}if(t===!0){let d=Math.acos(et(s[0].dot(s[e]),-1,1));d/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(d=-d);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],d*p)),a[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Yc extends Hn{constructor(e=0,t=0,n=1,i=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new j){const n=t,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%s]:(Ea.subVectors(i[0],i[1]).add(i[0]),c=Ea);const u=i[o%s],f=i[(o+1)%s];if(this.closed||o+2i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(su(o,l.x,c.x,h.x,u.x),su(o,l.y,c.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const a=i[s]-n,o=this.curves[s],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,t)}s++}return null}getLength(){const 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;const e=[];let t=0;for(let n=0,i=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){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Ao extends qe{constructor(e=[new j(0,-.5),new j(.5,0),new j(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=et(i,0,Math.PI*2);const s=[],a=[],o=[],l=[],c=[],h=1/t,u=new A,f=new j,d=new A,p=new A,_=new A;let g=0,m=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,_.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,p.copy(d),d.x+=_.x,d.y+=_.y,d.z+=_.z,d.normalize(),l.push(d.x,d.y,d.z),_.copy(p)}for(let y=0;y<=t;y++){const v=n+y*h*i,x=Math.sin(v),w=Math.cos(v);for(let T=0;T<=e.length-1;T++){u.x=e[T].x*x,u.y=e[T].y,u.z=e[T].x*w,a.push(u.x,u.y,u.z),f.x=y/t,f.y=T/(e.length-1),o.push(f.x,f.y);const C=l[3*T+0]*x,P=l[3*T+1],S=l[3*T+0]*w;c.push(C,P,S)}}for(let y=0;y0&&v(!0),t>0&&v(!1)),this.setIndex(h),this.setAttribute("position",new Fe(u,3)),this.setAttribute("normal",new Fe(f,3)),this.setAttribute("uv",new Fe(d,2));function y(){const x=new A,w=new A;let T=0;const C=(t-e)/n;for(let P=0;P<=s;P++){const S=[],M=P/s,D=M*(t-e)+e;for(let G=0;G<=i;G++){const F=G/i,V=F*l+o,J=Math.sin(V),q=Math.cos(V);w.x=D*J,w.y=-M*n+g,w.z=D*q,u.push(w.x,w.y,w.z),x.set(J,C,q).normalize(),f.push(x.x,x.y,x.z),d.push(F,1-M),S.push(p++)}_.push(S)}for(let P=0;P0||S!==0)&&(h.push(M,D,F),T+=3),(t>0||S!==s-1)&&(h.push(D,G,F),T+=3)}c.addGroup(m,T,0),m+=T}function v(x){const w=p,T=new j,C=new A;let P=0;const S=x===!0?e:t,M=x===!0?1:-1;for(let G=1;G<=i;G++)u.push(0,g*M,0),f.push(0,M,0),d.push(.5,.5),p++;const D=p;for(let G=0;G<=i;G++){const V=G/i*l+o,J=Math.cos(V),q=Math.sin(V);C.x=S*q,C.y=g*M,C.z=S*J,u.push(C.x,C.y,C.z),f.push(0,M,0),T.x=J*.5+.5,T.y=q*.5*M+.5,d.push(T.x,T.y),p++}for(let G=0;G.9&&C<.1&&(v<.2&&(a[y+0]+=1),x<.2&&(a[y+2]+=1),w<.2&&(a[y+4]+=1))}}function f(y){s.push(y.x,y.y,y.z)}function d(y,v){const x=y*3;v.x=e[x+0],v.y=e[x+1],v.z=e[x+2]}function p(){const y=new A,v=new A,x=new A,w=new A,T=new j,C=new j,P=new j;for(let S=0,M=0;S80*t){o=c=r[0],l=h=r[1];for(let p=t;pc&&(c=u),f>h&&(h=f);d=Math.max(c-o,h-l),d=d!==0?32767/d:0}return Gr(s,a,t,o,l,d,0),a}};function zd(r,e,t,n,i){let s,a;if(i===qm(r,e,t,n)>0)for(s=e;s=e;s-=n)a=ru(s,r[s],r[s+1],a);return a&&Co(a,a.next)&&(Xr(a),a=a.next),a}function ls(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(Co(t,t.next)||wt(t.prev,t,t.next)===0)){if(Xr(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Gr(r,e,t,n,i,s,a){if(!r)return;!a&&s&&km(r,n,i,s);let o=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?Dm(r,n,i,s):Pm(r)){e.push(l.i/t|0),e.push(r.i/t|0),e.push(c.i/t|0),Xr(r),r=c.next,o=c.next;continue}if(r=c,r===o){a?a===1?(r=Lm(ls(r),e,t),Gr(r,e,t,n,i,s,2)):a===2&&Um(r,e,t,n,i,s):Gr(ls(r),e,t,n,i,s,1);break}}}function Pm(r){const e=r.prev,t=r,n=r.next;if(wt(e,t,n)>=0)return!1;const i=e.x,s=t.x,a=n.x,o=e.y,l=t.y,c=n.y,h=is?i>a?i:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let p=n.next;for(;p!==e;){if(p.x>=h&&p.x<=f&&p.y>=u&&p.y<=d&&Hs(i,o,s,l,a,c,p.x,p.y)&&wt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Dm(r,e,t,n){const i=r.prev,s=r,a=r.next;if(wt(i,s,a)>=0)return!1;const o=i.x,l=s.x,c=a.x,h=i.y,u=s.y,f=a.y,d=ol?o>c?o:c:l>c?l:c,g=h>u?h>f?h:f:u>f?u:f,m=pc(d,p,e,t,n),y=pc(_,g,e,t,n);let v=r.prevZ,x=r.nextZ;for(;v&&v.z>=m&&x&&x.z<=y;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==i&&v!==a&&Hs(o,h,l,u,c,f,v.x,v.y)&&wt(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==i&&x!==a&&Hs(o,h,l,u,c,f,x.x,x.y)&&wt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=m;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==i&&v!==a&&Hs(o,h,l,u,c,f,v.x,v.y)&&wt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==i&&x!==a&&Hs(o,h,l,u,c,f,x.x,x.y)&&wt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Lm(r,e,t){let n=r;do{const i=n.prev,s=n.next.next;!Co(i,s)&&kd(i,n,n.next,s)&&Wr(i,s)&&Wr(s,i)&&(e.push(i.i/t|0),e.push(n.i/t|0),e.push(s.i/t|0),Xr(n),Xr(n.next),n=r=s),n=n.next}while(n!==r);return ls(n)}function Um(r,e,t,n,i,s){let a=r;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&Gm(a,o)){let l=Vd(a,o);a=ls(a,a.next),l=ls(l,l.next),Gr(a,e,t,n,i,s,0),Gr(l,e,t,n,i,s,0);return}o=o.next}a=a.next}while(a!==r)}function Nm(r,e,t,n){const i=[];let s,a,o,l,c;for(s=0,a=e.length;s=t.next.y&&t.next.y!==t.y){const f=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=s&&f>n&&(n=f,i=t.x=t.x&&t.x>=l&&s!==t.x&&Hs(ai.x||t.x===i.x&&zm(i,t)))&&(i=t,h=u)),t=t.next;while(t!==o);return i}function zm(r,e){return wt(r.prev,r,e.prev)<0&&wt(e.next,r,r.next)<0}function km(r,e,t,n){let i=r;do i.z===0&&(i.z=pc(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,Vm(i)}function Vm(r){let e,t,n,i,s,a,o,l,c=1;do{for(t=r,r=null,s=null,a=0;t;){for(a++,n=t,o=0,e=0;e0||l>0&&n;)o!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,o--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(a>1);return r}function pc(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function Hm(r){let e=r,t=r;do(e.x=(r-a)*(s-o)&&(r-a)*(n-o)>=(t-a)*(e-o)&&(t-a)*(s-o)>=(i-a)*(n-o)}function Gm(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!Wm(r,e)&&(Wr(r,e)&&Wr(e,r)&&Xm(r,e)&&(wt(r.prev,r,e.prev)||wt(r,e.prev,e))||Co(r,e)&&wt(r.prev,r,r.next)>0&&wt(e.prev,e,e.next)>0)}function wt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function Co(r,e){return r.x===e.x&&r.y===e.y}function kd(r,e,t,n){const i=Ia(wt(r,e,t)),s=Ia(wt(r,e,n)),a=Ia(wt(t,n,r)),o=Ia(wt(t,n,e));return!!(i!==s&&a!==o||i===0&&Ra(r,t,e)||s===0&&Ra(r,n,e)||a===0&&Ra(t,r,n)||o===0&&Ra(t,e,n))}function Ra(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Ia(r){return r>0?1:r<0?-1:0}function Wm(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&kd(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Wr(r,e){return wt(r.prev,r,r.next)<0?wt(r,e,r.next)>=0&&wt(r,r.prev,e)>=0:wt(r,e,r.prev)<0||wt(r,r.next,e)<0}function Xm(r,e){let t=r,n=!1;const i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Vd(r,e){const t=new mc(r.i,r.x,r.y),n=new mc(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function ru(r,e,t,n){const i=new mc(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Xr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function mc(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function qm(r,e,t,n){let i=0;for(let s=e,a=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function ou(r,e){for(let t=0;tNumber.EPSILON){const k=Math.sqrt(b),X=Math.sqrt(Se*Se+R*R),W=de.x-Ve/k,ce=de.y+me/k,oe=I.x-R/X,ge=I.y+Se/X,Be=((oe-W)*R-(ge-ce)*Se)/(me*R-Ve*Se);De=W+me*Be-te.x,re=ce+Ve*Be-te.y;const $=De*De+re*re;if($<=2)return new j(De,re);Ae=Math.sqrt($/2)}else{let k=!1;me>Number.EPSILON?Se>Number.EPSILON&&(k=!0):me<-Number.EPSILON?Se<-Number.EPSILON&&(k=!0):Math.sign(Ve)===Math.sign(R)&&(k=!0),k?(De=-Ve,re=me,Ae=Math.sqrt(b)):(De=me,re=Ve,Ae=Math.sqrt(b/2))}return new j(De/Ae,re/Ae)}const _e=[];for(let te=0,de=V.length,I=de-1,De=te+1;te=0;te--){const de=te/g,I=d*Math.cos(de*Math.PI/2),De=p*Math.sin(de*Math.PI/2)+_;for(let re=0,Ae=V.length;re=0;){const De=I;let re=I-1;re<0&&(re=te.length-1);for(let Ae=0,me=h+g*2;Ae0)&&d.push(v,x,T),(m!==n-1||l0!=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}}class eg extends on{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ne(16777215),this.specular=new ne(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ne(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cs,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new In,this.combine=bo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.flatShading=e.flatShading,this.fog=e.fog,this}}class tg extends on{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ne(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ne(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cs,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class ng extends on{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cs,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class ig extends on{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ne(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ne(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cs,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new In,this.combine=bo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.flatShading=e.flatShading,this.fog=e.fog,this}}class Hd extends on{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=rp,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}}class Gd extends on{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}}class sg extends on{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ne(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cs,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class rg extends qt{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function is(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function Wd(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function Xd(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function gc(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,a=0;a!==n;++s){const o=t[s]*e;for(let l=0;l!==e;++l)i[a++]=r[o+l]}return i}function oh(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let a=s[n];if(a!==void 0)if(Array.isArray(a))do a=s[n],a!==void 0&&(e.push(s.time),t.push.apply(t,a)),s=r[i++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[n],a!==void 0&&(e.push(s.time),a.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do a=s[n],a!==void 0&&(e.push(s.time),t.push(a)),s=r[i++];while(s!==void 0)}function ag(r,e,t,n,i=30){const s=r.clone();s.name=e;const a=[];for(let l=0;l=n)){u.push(c.times[d]);for(let _=0;_s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l=o.times[p]){const m=p*u+h,y=m+u-h;_=o.values.slice(m,y)}else{const m=o.createInterpolant(),y=h,v=u-h;m.evaluate(s),_=m.resultBuffer.slice(y,v)}l==="quaternion"&&new rn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=s)){const o=t[1];e=s)break t}a=n,n=0;break n}break e}for(;n>>1;et;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==s;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(i!==void 0&&Wd(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Fo,s=e.length-1;let a=1;for(let o=1;o0){e[a]=e[s];for(let o=s*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Gn.prototype.TimeBufferType=Float32Array;Gn.prototype.ValueBufferType=Float32Array;Gn.prototype.DefaultInterpolation=dc;class hr extends Gn{constructor(e,t,n){super(e,t,n)}}hr.prototype.ValueTypeName="bool";hr.prototype.ValueBufferType=Array;hr.prototype.DefaultInterpolation=oo;hr.prototype.InterpolantFactoryMethodLinear=void 0;hr.prototype.InterpolantFactoryMethodSmooth=void 0;class Yd extends Gn{}Yd.prototype.ValueTypeName="color";class vo extends Gn{}vo.prototype.ValueTypeName="number";class hg extends Po{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(i-t);let c=e*o;for(let h=c+o;c!==h;c+=4)rn.slerpFlat(s,0,a,c-o,a,c,l);return s}}class Do extends Gn{InterpolantFactoryMethodLinear(e){return new hg(this.times,this.values,this.getValueSize(),e)}}Do.prototype.ValueTypeName="quaternion";Do.prototype.InterpolantFactoryMethodSmooth=void 0;class ur extends Gn{constructor(e,t,n){super(e,t,n)}}ur.prototype.ValueTypeName="string";ur.prototype.ValueBufferType=Array;ur.prototype.DefaultInterpolation=oo;ur.prototype.InterpolantFactoryMethodLinear=void 0;ur.prototype.InterpolantFactoryMethodSmooth=void 0;class xo extends Gn{}xo.prototype.ValueTypeName="vector";class yo{constructor(e="",t=-1,n=[],i=Oc){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=bn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(dg(n[a]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,a=n.length;s!==a;++s)t.push(Gn.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,a=[];for(let o=0;o1){const u=h[1];let f=i[u];f||(i[u]=f=[]),f.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,n));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,f,d,p,_){if(d.length!==0){const g=[],m=[];oh(d,g,m,p),g.length!==0&&_.push(new u(f,g,m))}},i=[],s=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u{t&&t(s),this.manager.itemEnd(e)},0),s;if($n[e]!==void 0){$n[e].push({onLoad:t,onProgress:n,onError:i});return}$n[e]=[],$n[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=$n[e],u=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=f?parseInt(f):0,p=d!==0;let _=0;const g=new ReadableStream({start(m){y();function y(){u.read().then(({done:v,value:x})=>{if(v)m.close();else{_+=x.byteLength;const w=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:d});for(let T=0,C=h.length;T{m.error(v)})}}});return new Response(g)}else throw new pg(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),f=u&&u[1]?u[1].toLowerCase():void 0,d=new TextDecoder(f);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{Ei.add(e,c);const h=$n[e];delete $n[e];for(let u=0,f=h.length;u{const h=$n[e];if(h===void 0)throw this.manager.itemError(e),c;delete $n[e];for(let u=0,f=h.length;u{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class QS extends wn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new Pi(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const a=e.uniforms[s];switch(i.uniforms[s]={},a.type){case"t":i.uniforms[s].value=n(a.value);break;case"c":i.uniforms[s].value=new ne().setHex(a.value);break;case"v2":i.uniforms[s].value=new j().fromArray(a.value);break;case"v3":i.uniforms[s].value=new A().fromArray(a.value);break;case"v4":i.uniforms[s].value=new pt().fromArray(a.value);break;case"m3":i.uniforms[s].value=new tt().fromArray(a.value);break;case"m4":i.uniforms[s].value=new Ze().fromArray(a.value);break;default:i.uniforms[s].value=a.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new j().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new j().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return ch.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:$m,SpriteMaterial:rs,RawShaderMaterial:jm,ShaderMaterial:Xt,PointsMaterial:Ai,MeshPhysicalMaterial:Qm,MeshStandardMaterial:ah,MeshPhongMaterial:eg,MeshToonMaterial:tg,MeshNormalMaterial:ng,MeshLambertMaterial:ig,MeshDepthMaterial:Hd,MeshDistanceMaterial:Gd,MeshBasicMaterial:kn,MeshMatcapMaterial:sg,LineDashedMaterial:rg,LineBasicMaterial:qt,Material:on};return new t[e]}}class fu{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){const l=new Zd(t);s=new Mo(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,h=e.length;c0){i=new Mo(this.manager),i.setCrossOrigin(this.crossOrigin);for(let a=0,o=e.length;a{const g=new pn;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const m=new an;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:m}}),a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._geometryCount=e.geometryCount,a._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":a=new nm;break;case"Line":a=new Vn(o(e.geometry),l(e.material));break;case"LineLoop":a=new gm(o(e.geometry),l(e.material));break;case"LineSegments":a=new hi(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":a=new as(o(e.geometry),l(e.material));break;case"Sprite":a=new ts(l(e.material));break;case"Group":a=new ns;break;case"Bone":a=new Id;break;default:a=new mt}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix!==void 0?(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){const f=e.children;for(let d=0;d"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=Ei.get(e);if(a!==void 0){if(s.manager.itemStart(e),a.then){a.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{i&&i(c)});return}return setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(e,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Ei.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){i&&i(c),Ei.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Ei.add(e,l),s.manager.itemStart(e)}}let Pa;class Kd{static getContext(){return Pa===void 0&&(Pa=new(window.AudioContext||window.webkitAudioContext)),Pa}static setContext(e){Pa=e}}class aw extends wn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new Pi(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{const c=l.slice(0);Kd.getContext().decodeAudioData(c,function(u){t(u)}).catch(o)}catch(c){o(c)}},n,i);function o(l){i?i(l):console.error(l),s.manager.itemError(e)}}}const gu=new Ze,_u=new Ze,Hi=new Ze;class ow{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new kt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new kt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Hi.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,a=t.near*Math.tan(ss*t.fov*.5)/t.zoom;let o,l;_u.elements[12]=-i,gu.elements[12]=i,o=-a*t.aspect+s,l=a*t.aspect+s,Hi.elements[0]=2*t.near/(l-o),Hi.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Hi),o=-a*t.aspect-s,l=a*t.aspect-s,Hi.elements[0]=2*t.near/(l-o),Hi.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Hi)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(_u),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(gu)}}class Ag extends kt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class $d{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=vu(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=vu();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function vu(){return performance.now()}const Gi=new A,xu=new rn,Cg=new A,Wi=new A;class lw extends mt{constructor(){super(),this.type="AudioListener",this.context=Kd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new $d}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Gi,xu,Cg),Wi.set(0,0,-1).applyQuaternion(xu),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Gi.x,i),t.positionY.linearRampToValueAtTime(Gi.y,i),t.positionZ.linearRampToValueAtTime(Gi.z,i),t.forwardX.linearRampToValueAtTime(Wi.x,i),t.forwardY.linearRampToValueAtTime(Wi.y,i),t.forwardZ.linearRampToValueAtTime(Wi.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Gi.x,Gi.y,Gi.z),t.setOrientation(Wi.x,Wi.y,Wi.z,n.x,n.y,n.z)}}class Rg extends mt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){o.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,a=i;s!==a;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let a=0;a!==s;++a)e[t+a]=e[n+a]}_slerp(e,t,n,i){rn.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const a=this._workIndex*s;rn.multiplyQuaternionsFlat(e,a,e,t,e,n),rn.slerpFlat(e,t,e,t,e,a,i)}_lerp(e,t,n,i,s){const a=1-i;for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]*a+e[n+o]*i}}_lerpAdditive(e,t,n,i,s){for(let a=0;a!==s;++a){const o=t+a;e[o]=e[o]+e[n+a]*i}}}const hh="\\[\\]\\.:\\/",Dg=new RegExp("["+hh+"]","g"),uh="[^"+hh+"]",Lg="[^"+hh.replace("\\.","")+"]",Ug=/((?:WC+[\/:])*)/.source.replace("WC",uh),Ng=/(WCOD+)?/.source.replace("WCOD",Lg),Fg=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",uh),Og=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",uh),Bg=new RegExp("^"+Ug+Ng+Fg+Og+"$"),zg=["material","materials","bones","map"];class kg{constructor(e,t,n){const i=n||ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class ft{constructor(e,t,n){this.path=t,this.parsedPath=n||ft.parseTrackName(t),this.node=ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new ft.Composite(e,t,n):new ft(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Dg,"")}static parseTrackName(e){const t=Bg.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);zg.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new 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){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let a=0;a=s){const u=s++,f=e[u];t[f.uuid]=h,e[h]=f,t[c]=u,e[u]=l;for(let d=0,p=i;d!==p;++d){const _=n[d],g=_[u],m=_[h];_[h]=g,_[u]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,a=e.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u0&&(t[d.uuid]=u),e[u]=d,e.pop();for(let p=0,_=i;p!==_;++p){const g=n[p];g[u]=g[f],g.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);i=s.length,n[e]=i,a.push(e),o.push(t),s.push(u);for(let f=h,d=l.length;f!==d;++f){const p=l[f];u[f]=new ft(p,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=e[o];t[c]=n,a[n]=l,a.pop(),s[n]=s[o],s.pop(),i[n]=i[o],i.pop()}}}class Vg{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,a=s.length,o=new Array(a),l={endingStart:Bs,endingEnd:Bs};for(let c=0;c!==a;++c){const h=s[c].createInterpolant(null);o[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ip,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,a=s/i,o=i/s;e.warp(1,a,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*n;l<0||n===0?t=0:(this._startTime=null,t=n*l)}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case yd:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulateAdditive(o);break;case Oc:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(i,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const a=n===sp;if(e===0)return s===-1?i:a&&(s&1)===1?t-i:i;if(n===np){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),i>=t||i<0){const o=Math.floor(i/t);i-=t*o,s+=Math.abs(o);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(a&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=zs,i.endingEnd=zs):(e?i.endingStart=this.zeroSlopeAtStart?zs:Bs:i.endingStart=lo,t?i.endingEnd=this.zeroSlopeAtEnd?zs:Bs:i.endingEnd=lo)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,l[0]=t,o[1]=s+e,l[1]=n,this}}const Hg=new Float32Array(1);class dw extends ci{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,a=e._propertyBindings,o=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){const f=i[u],d=f.name;let p=h[d];if(p!==void 0)++p.referenceCount,a[u]=p;else{if(p=a[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}const _=t&&t._propertyBindings[u].binding.parsedPath;p=new Pg(ft.create(n,d,_),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),a[u]=p}o[u].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),a=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,a);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(a);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}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}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))}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}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Su).distanceTo(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}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)}}const wu=new A,Da=new A;class yw{constructor(e=new A,t=new A){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){wu.subVectors(e,this.start),Da.subVectors(this.end,this.start);const n=Da.dot(Da);let s=Da.dot(wu)/n;return t&&(s=et(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Eu=new A;class Mw extends mt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new qe,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,l=32;a1)for(let u=0;u.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Iu.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Iu,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()}}class Lw extends hi{constructor(e=1){const 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],i=new qe;i.setAttribute("position",new Fe(t,3)),i.setAttribute("color",new Fe(n,3));const s=new qt({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new ne,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Uw{constructor(){this.type="ShapePath",this.color=new ne,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new _o,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,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,a){return this.currentPath.bezierCurveTo(e,t,n,i,s,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const y=[];for(let v=0,x=m.length;vNumber.EPSILON){if(M<0&&(C=y[T],S=-S,P=y[w],M=-M),m.yP.y)continue;if(m.y===C.y){if(m.x===C.x)return!0}else{const D=M*(m.x-C.x)-S*(m.y-C.y);if(D===0)return!0;if(D<0)continue;x=!x}}else{if(m.y!==C.y)continue;if(P.x<=m.x&&m.x<=C.x||C.x<=m.x&&m.x<=P.x)return!0}}return x}const i=oi.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,l;const c=[];if(s.length===1)return o=s[0],l=new Js,l.curves=o.curves,c.push(l),c;let h=!i(s[0].getPoints());h=e?!h:h;const u=[],f=[];let d=[],p=0,_;f[p]=void 0,d[p]=[];for(let m=0,y=s.length;m1){let m=!1,y=0;for(let v=0,x=f.length;v0&&m===!1&&(d=u)}let g;for(let m=0,y=f.length;me?(r.repeat.x=1,r.repeat.y=t/e,r.offset.x=0,r.offset.y=(1-r.repeat.y)/2):(r.repeat.x=e/t,r.repeat.y=1,r.offset.x=(1-r.repeat.x)/2,r.offset.y=0),r}function Zg(r,e){const t=r.image&&r.image.width?r.image.width/r.image.height:1;return t>e?(r.repeat.x=e/t,r.repeat.y=1,r.offset.x=(1-r.repeat.x)/2,r.offset.y=0):(r.repeat.x=1,r.repeat.y=t/e,r.offset.x=0,r.offset.y=(1-r.repeat.y)/2),r}function Jg(r){return r.repeat.x=1,r.repeat.y=1,r.offset.x=0,r.offset.y=0,r}function yc(r,e,t,n){const i=Kg(n);switch(t){case pd:return r*e;case gd:return r*e;case _d:return r*e*2;case Uc:return r*e/i.components*i.byteLength;case So:return r*e/i.components*i.byteLength;case vd:return r*e*2/i.components*i.byteLength;case Nc:return r*e*2/i.components*i.byteLength;case md:return r*e*3/i.components*i.byteLength;case dn:return r*e*4/i.components*i.byteLength;case Fc:return r*e*4/i.components*i.byteLength;case qa:case Ya:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case Za:case Ja:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Vl:case Gl:return Math.max(r,16)*Math.max(e,8)/4;case kl:case Hl:return Math.max(r,8)*Math.max(e,8)/2;case Wl:case Xl:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case ql:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Yl:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Zl:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case Jl:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case Kl:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case $l:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case jl:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case Ql:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case ec:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case tc:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case nc:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case ic:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case sc:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case rc:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case ac:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case Ka:case oc:case lc:return Math.ceil(r/4)*Math.ceil(e/4)*16;case xd:case cc:return Math.ceil(r/4)*Math.ceil(e/4)*8;case hc:case uc:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Kg(r){switch(r){case li:case ud:return{byteLength:1,components:1};case kr:case dd:case si:return{byteLength:2,components:1};case Dc:case Lc:return{byteLength:2,components:4};case Ii:case Pc:case Mn:return{byteLength:4,components:1};case fd:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}const Nw={contain:Yg,cover:Zg,fill:Jg,getByteLength:yc};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Rc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Rc);/** - * @license - * Copyright 2010-2024 Three.js Authors - * SPDX-License-Identifier: MIT - */function tf(){let r=null,e=!1,t=null,n=null;function i(s,a){t(s,a),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function $g(r){const e=new WeakMap;function t(o,l){const c=o.array,h=o.usage,u=c.byteLength,f=r.createBuffer();r.bindBuffer(l,f),r.bufferData(l,c,h),o.onUploadCallback();let d;if(c instanceof Float32Array)d=r.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=r.HALF_FLOAT:d=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=r.SHORT;else if(c instanceof Uint32Array)d=r.UNSIGNED_INT;else if(c instanceof Int32Array)d=r.INT;else if(c instanceof Int8Array)d=r.BYTE;else if(c instanceof Uint8Array)d=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,l,c){const h=l.array,u=l.updateRanges;if(r.bindBuffer(c,o),u.length===0)r.bufferSubData(c,0,h);else{u.sort((d,p)=>d.start-p.start);let f=0;for(let d=1;d 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,p0=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,m0=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,g0=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,_0=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,v0=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,x0=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,y0=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,M0=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,b0=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,S0=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,w0=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,E0=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,T0=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,A0=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,C0="gl_FragColor = linearToOutputTexel( gl_FragColor );",R0=`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,I0=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,P0=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,D0=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,L0=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,U0=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,N0=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,F0=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,O0=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,B0=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,z0=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,k0=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,V0=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,H0=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,G0=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,W0=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,X0=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,q0=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Y0=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Z0=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,J0=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,K0=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,$0=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,j0=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,Q0=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,e_=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,t_=`#if defined( USE_LOGDEPTHBUF ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,n_=`#ifdef USE_LOGDEPTHBUF - varying float vFragDepth; - varying float vIsPerspective; -#endif`,i_=`#ifdef USE_LOGDEPTHBUF - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,s_=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,r_=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,a_=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,o_=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,l_=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,c_=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,h_=`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,u_=`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,d_=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,f_=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,p_=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,m_=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,g_=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,__=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,v_=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,x_=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,y_=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,M_=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,b_=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,S_=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,w_=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,E_=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,T_=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,A_=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,C_=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,R_=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,I_=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,P_=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,D_=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,L_=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - - float lightToPositionLength = length( lightToPosition ); - if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { - float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - shadow = ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } -#endif`,U_=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,N_=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,F_=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,O_=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,B_=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,z_=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,k_=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,V_=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,H_=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,G_=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,W_=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,X_=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,q_=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,Y_=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,Z_=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,J_=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,K_=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const $_=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,j_=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,Q_=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,ev=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,tv=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,nv=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,iv=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,sv=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,rv=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,av=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,ov=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,lv=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,cv=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,hv=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,uv=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,dv=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,fv=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,pv=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,mv=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,gv=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,_v=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,vv=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,xv=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,yv=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,Mv=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,bv=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,Sv=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,wv=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,Ev=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,Tv=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,Av=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,Cv=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,Rv=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,Iv=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,st={alphahash_fragment:jg,alphahash_pars_fragment:Qg,alphamap_fragment:e0,alphamap_pars_fragment:t0,alphatest_fragment:n0,alphatest_pars_fragment:i0,aomap_fragment:s0,aomap_pars_fragment:r0,batching_pars_vertex:a0,batching_vertex:o0,begin_vertex:l0,beginnormal_vertex:c0,bsdfs:h0,iridescence_fragment:u0,bumpmap_pars_fragment:d0,clipping_planes_fragment:f0,clipping_planes_pars_fragment:p0,clipping_planes_pars_vertex:m0,clipping_planes_vertex:g0,color_fragment:_0,color_pars_fragment:v0,color_pars_vertex:x0,color_vertex:y0,common:M0,cube_uv_reflection_fragment:b0,defaultnormal_vertex:S0,displacementmap_pars_vertex:w0,displacementmap_vertex:E0,emissivemap_fragment:T0,emissivemap_pars_fragment:A0,colorspace_fragment:C0,colorspace_pars_fragment:R0,envmap_fragment:I0,envmap_common_pars_fragment:P0,envmap_pars_fragment:D0,envmap_pars_vertex:L0,envmap_physical_pars_fragment:W0,envmap_vertex:U0,fog_vertex:N0,fog_pars_vertex:F0,fog_fragment:O0,fog_pars_fragment:B0,gradientmap_pars_fragment:z0,lightmap_pars_fragment:k0,lights_lambert_fragment:V0,lights_lambert_pars_fragment:H0,lights_pars_begin:G0,lights_toon_fragment:X0,lights_toon_pars_fragment:q0,lights_phong_fragment:Y0,lights_phong_pars_fragment:Z0,lights_physical_fragment:J0,lights_physical_pars_fragment:K0,lights_fragment_begin:$0,lights_fragment_maps:j0,lights_fragment_end:Q0,logdepthbuf_fragment:e_,logdepthbuf_pars_fragment:t_,logdepthbuf_pars_vertex:n_,logdepthbuf_vertex:i_,map_fragment:s_,map_pars_fragment:r_,map_particle_fragment:a_,map_particle_pars_fragment:o_,metalnessmap_fragment:l_,metalnessmap_pars_fragment:c_,morphinstance_vertex:h_,morphcolor_vertex:u_,morphnormal_vertex:d_,morphtarget_pars_vertex:f_,morphtarget_vertex:p_,normal_fragment_begin:m_,normal_fragment_maps:g_,normal_pars_fragment:__,normal_pars_vertex:v_,normal_vertex:x_,normalmap_pars_fragment:y_,clearcoat_normal_fragment_begin:M_,clearcoat_normal_fragment_maps:b_,clearcoat_pars_fragment:S_,iridescence_pars_fragment:w_,opaque_fragment:E_,packing:T_,premultiplied_alpha_fragment:A_,project_vertex:C_,dithering_fragment:R_,dithering_pars_fragment:I_,roughnessmap_fragment:P_,roughnessmap_pars_fragment:D_,shadowmap_pars_fragment:L_,shadowmap_pars_vertex:U_,shadowmap_vertex:N_,shadowmask_pars_fragment:F_,skinbase_vertex:O_,skinning_pars_vertex:B_,skinning_vertex:z_,skinnormal_vertex:k_,specularmap_fragment:V_,specularmap_pars_fragment:H_,tonemapping_fragment:G_,tonemapping_pars_fragment:W_,transmission_fragment:X_,transmission_pars_fragment:q_,uv_pars_fragment:Y_,uv_pars_vertex:Z_,uv_vertex:J_,worldpos_vertex:K_,background_vert:$_,background_frag:j_,backgroundCube_vert:Q_,backgroundCube_frag:ev,cube_vert:tv,cube_frag:nv,depth_vert:iv,depth_frag:sv,distanceRGBA_vert:rv,distanceRGBA_frag:av,equirect_vert:ov,equirect_frag:lv,linedashed_vert:cv,linedashed_frag:hv,meshbasic_vert:uv,meshbasic_frag:dv,meshlambert_vert:fv,meshlambert_frag:pv,meshmatcap_vert:mv,meshmatcap_frag:gv,meshnormal_vert:_v,meshnormal_frag:vv,meshphong_vert:xv,meshphong_frag:yv,meshphysical_vert:Mv,meshphysical_frag:bv,meshtoon_vert:Sv,meshtoon_frag:wv,points_vert:Ev,points_frag:Tv,shadow_vert:Av,shadow_frag:Cv,sprite_vert:Rv,sprite_frag:Iv},Te={common:{diffuse:{value:new ne(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new tt},alphaMap:{value:null},alphaMapTransform:{value:new tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new tt}},envmap:{envMap:{value:null},envMapRotation:{value:new tt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new tt},normalScale:{value:new j(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ne(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 ne(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new tt},alphaTest:{value:0},uvTransform:{value:new tt}},sprite:{diffuse:{value:new ne(16777215)},opacity:{value:1},center:{value:new j(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new tt},alphaMap:{value:null},alphaMapTransform:{value:new tt},alphaTest:{value:0}}},On={basic:{uniforms:nn([Te.common,Te.specularmap,Te.envmap,Te.aomap,Te.lightmap,Te.fog]),vertexShader:st.meshbasic_vert,fragmentShader:st.meshbasic_frag},lambert:{uniforms:nn([Te.common,Te.specularmap,Te.envmap,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.fog,Te.lights,{emissive:{value:new ne(0)}}]),vertexShader:st.meshlambert_vert,fragmentShader:st.meshlambert_frag},phong:{uniforms:nn([Te.common,Te.specularmap,Te.envmap,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.fog,Te.lights,{emissive:{value:new ne(0)},specular:{value:new ne(1118481)},shininess:{value:30}}]),vertexShader:st.meshphong_vert,fragmentShader:st.meshphong_frag},standard:{uniforms:nn([Te.common,Te.envmap,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.roughnessmap,Te.metalnessmap,Te.fog,Te.lights,{emissive:{value:new ne(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:st.meshphysical_vert,fragmentShader:st.meshphysical_frag},toon:{uniforms:nn([Te.common,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.gradientmap,Te.fog,Te.lights,{emissive:{value:new ne(0)}}]),vertexShader:st.meshtoon_vert,fragmentShader:st.meshtoon_frag},matcap:{uniforms:nn([Te.common,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.fog,{matcap:{value:null}}]),vertexShader:st.meshmatcap_vert,fragmentShader:st.meshmatcap_frag},points:{uniforms:nn([Te.points,Te.fog]),vertexShader:st.points_vert,fragmentShader:st.points_frag},dashed:{uniforms:nn([Te.common,Te.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:st.linedashed_vert,fragmentShader:st.linedashed_frag},depth:{uniforms:nn([Te.common,Te.displacementmap]),vertexShader:st.depth_vert,fragmentShader:st.depth_frag},normal:{uniforms:nn([Te.common,Te.bumpmap,Te.normalmap,Te.displacementmap,{opacity:{value:1}}]),vertexShader:st.meshnormal_vert,fragmentShader:st.meshnormal_frag},sprite:{uniforms:nn([Te.sprite,Te.fog]),vertexShader:st.sprite_vert,fragmentShader:st.sprite_frag},background:{uniforms:{uvTransform:{value:new tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:st.background_vert,fragmentShader:st.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new tt}},vertexShader:st.backgroundCube_vert,fragmentShader:st.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:st.cube_vert,fragmentShader:st.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:st.equirect_vert,fragmentShader:st.equirect_frag},distanceRGBA:{uniforms:nn([Te.common,Te.displacementmap,{referencePosition:{value:new A},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:st.distanceRGBA_vert,fragmentShader:st.distanceRGBA_frag},shadow:{uniforms:nn([Te.lights,Te.fog,{color:{value:new ne(0)},opacity:{value:1}}]),vertexShader:st.shadow_vert,fragmentShader:st.shadow_frag}};On.physical={uniforms:nn([On.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new tt},clearcoatNormalScale:{value:new j(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new tt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new tt},sheen:{value:0},sheenColor:{value:new ne(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new tt},transmissionSamplerSize:{value:new j},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new tt},attenuationDistance:{value:0},attenuationColor:{value:new ne(0)},specularColor:{value:new ne(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new tt},anisotropyVector:{value:new j},anisotropyMap:{value:null},anisotropyMapTransform:{value:new tt}}]),vertexShader:st.meshphysical_vert,fragmentShader:st.meshphysical_frag};const Ba={r:0,b:0,g:0},Yi=new In,Pv=new Ze;function Dv(r,e,t,n,i,s,a){const o=new ne(0);let l=s===!0?0:1,c,h,u=null,f=0,d=null;function p(v){let x=v.isScene===!0?v.background:null;return x&&x.isTexture&&(x=(v.backgroundBlurriness>0?t:e).get(x)),x}function _(v){let x=!1;const w=p(v);w===null?m(o,l):w&&w.isColor&&(m(w,1),x=!0);const T=r.xr.getEnvironmentBlendMode();T==="additive"?n.buffers.color.setClear(0,0,0,1,a):T==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||x)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function g(v,x){const w=p(x);w&&(w.isCubeTexture||w.mapping===qr)?(h===void 0&&(h=new yt(new or(1,1,1),new Xt({name:"BackgroundCubeMaterial",uniforms:tr(On.backgroundCube.uniforms),vertexShader:On.backgroundCube.vertexShader,fragmentShader:On.backgroundCube.fragmentShader,side:fn,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(T,C,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Yi.copy(x.backgroundRotation),Yi.x*=-1,Yi.y*=-1,Yi.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Yi.y*=-1,Yi.z*=-1),h.material.uniforms.envMap.value=w,h.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Pv.makeRotationFromEuler(Yi)),h.material.toneMapped=ht.getTransfer(w.colorSpace)!==vt,(u!==w||f!==w.version||d!==r.toneMapping)&&(h.material.needsUpdate=!0,u=w,f=w.version,d=r.toneMapping),h.layers.enableAll(),v.unshift(h,h.geometry,h.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new yt(new lr(2,2),new Xt({name:"BackgroundMaterial",uniforms:tr(On.background.uniforms),vertexShader:On.background.vertexShader,fragmentShader:On.background.fragmentShader,side:Ci,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=ht.getTransfer(w.colorSpace)!==vt,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(u!==w||f!==w.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,u=w,f=w.version,d=r.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null))}function m(v,x){v.getRGB(Ba,Ad(r)),n.buffers.color.setClear(Ba.r,Ba.g,Ba.b,x,a)}function y(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),c!==void 0&&(c.geometry.dispose(),c.material.dispose())}return{getClearColor:function(){return o},setClearColor:function(v,x=1){o.set(v),l=x,m(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,m(o,l)},render:_,addToRenderList:g,dispose:y}}function Lv(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=f(null);let s=i,a=!1;function o(M,D,G,F,V){let J=!1;const q=u(F,G,D);s!==q&&(s=q,c(s.object)),J=d(M,F,G,V),J&&p(M,F,G,V),V!==null&&e.update(V,r.ELEMENT_ARRAY_BUFFER),(J||a)&&(a=!1,x(M,D,G,F),V!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(V).buffer))}function l(){return r.createVertexArray()}function c(M){return r.bindVertexArray(M)}function h(M){return r.deleteVertexArray(M)}function u(M,D,G){const F=G.wireframe===!0;let V=n[M.id];V===void 0&&(V={},n[M.id]=V);let J=V[D.id];J===void 0&&(J={},V[D.id]=J);let q=J[F];return q===void 0&&(q=f(l()),J[F]=q),q}function f(M){const D=[],G=[],F=[];for(let V=0;V=0){const be=V[Z];let Re=J[Z];if(Re===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(Re=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(Re=M.instanceColor)),be===void 0||be.attribute!==Re||Re&&be.data!==Re.data)return!0;q++}return s.attributesNum!==q||s.index!==F}function p(M,D,G,F){const V={},J=D.attributes;let q=0;const se=G.getAttributes();for(const Z in se)if(se[Z].location>=0){let be=J[Z];be===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(be=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(be=M.instanceColor));const Re={};Re.attribute=be,be&&be.data&&(Re.data=be.data),V[Z]=Re,q++}s.attributes=V,s.attributesNum=q,s.index=F}function _(){const M=s.newAttributes;for(let D=0,G=M.length;D=0){let _e=V[se];if(_e===void 0&&(se==="instanceMatrix"&&M.instanceMatrix&&(_e=M.instanceMatrix),se==="instanceColor"&&M.instanceColor&&(_e=M.instanceColor)),_e!==void 0){const be=_e.normalized,Re=_e.itemSize,Ge=e.get(_e);if(Ge===void 0)continue;const it=Ge.buffer,Q=Ge.type,ue=Ge.bytesPerElement,Ie=Q===r.INT||Q===r.UNSIGNED_INT||_e.gpuType===Pc;if(_e.isInterleavedBufferAttribute){const pe=_e.data,Oe=pe.stride,We=_e.offset;if(pe.isInstancedInterleavedBuffer){for(let ze=0;ze0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=t.logarithmicDepthBuffer===!0,f=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),y=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),x=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),w=p>0,T=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:f,maxTextures:d,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:y,maxVaryings:v,maxFragmentUniforms:x,vertexTextures:w,maxSamples:T}}function Fv(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Si,o=new tt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,f){const d=u.length!==0||f||n!==0||i;return i=f,n=u.length,d},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,f){t=h(u,f,0)},this.setState=function(u,f,d){const p=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,m=r.get(u);if(!i||p===null||p.length===0||s&&!g)s?h(null):c();else{const y=s?0:n,v=y*4;let x=m.clippingState||null;l.value=x,x=h(p,f,v,d);for(let w=0;w!==v;++w)x[w]=t[w];m.clippingState=x,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,f,d,p){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=d+_*4,y=f.matrixWorldInverse;o.getNormalMatrix(y),(g===null||g.length0){const c=new tm(l.height);return c.fromEquirectangularTexture(r,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const Gs=4,Pu=[.125,.215,.35,.446,.526,.582],es=20,vl=new Lo,Du=new ne;let xl=null,yl=0,Ml=0,bl=!1;const $i=(1+Math.sqrt(5))/2,Us=1/$i,Lu=[new A(-$i,Us,0),new A($i,Us,0),new A(-Us,0,$i),new A(Us,0,$i),new A(0,$i,-Us),new A(0,$i,Us),new A(-1,1,-1),new A(1,1,-1),new A(-1,1,1),new A(1,1,1)];class Uu{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){xl=this._renderer.getRenderTarget(),yl=this._renderer.getActiveCubeFace(),Ml=this._renderer.getActiveMipmapLevel(),bl=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),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=Ou(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Fu(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),h.setRenderTarget(i),_&&h.render(p,o),h.render(e,o)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=f,h.autoClear=u,e.background=g}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Ri||e.mapping===os;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Ou()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Fu());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new yt(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;za(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,vl)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;ses&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${es}`);const m=[];let y=0;for(let C=0;Cv-Gs?i-v+Gs:0),T=4*(this._cubeSize-x);za(t,w,T,3*x,2*x),l.setRenderTarget(t),l.render(u,vl)}}function Bv(r){const e=[],t=[],n=[];let i=r;const s=r-Gs+1+Pu.length;for(let a=0;ar-Gs?l=Pu[a-r+Gs-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,f=[h,h,u,h,u,u,h,h,u,u,h,u],d=6,p=6,_=3,g=2,m=1,y=new Float32Array(_*p*d),v=new Float32Array(g*p*d),x=new Float32Array(m*p*d);for(let T=0;T2?0:-1,S=[C,P,0,C+2/3,P,0,C+2/3,P+1,0,C,P,0,C+2/3,P+1,0,C,P+1,0];y.set(S,_*p*T),v.set(f,g*p*T);const M=[T,T,T,T,T,T];x.set(M,m*p*T)}const w=new qe;w.setAttribute("position",new rt(y,_)),w.setAttribute("uv",new rt(v,g)),w.setAttribute("faceIndex",new rt(x,m)),e.push(w),i>Gs&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function Nu(r,e,t){const n=new Sn(r,e,t);return n.texture.mapping=qr,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function za(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function zv(r,e,t){const n=new Float32Array(es),i=new A(0,1,0);return new Xt({name:"SphericalGaussianBlur",defines:{n:es,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:dh(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:ii,depthTest:!1,depthWrite:!1})}function Fu(){return new Xt({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:dh(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:ii,depthTest:!1,depthWrite:!1})}function Ou(){return new Xt({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:dh(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:ii,depthTest:!1,depthWrite:!1})}function dh(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function kv(r){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===io||l===so,h=l===Ri||l===os;if(c||h){let u=e.get(o);const f=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return t===null&&(t=new Uu(r)),u=c?t.fromEquirectangular(o,u):t.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),u.texture;if(u!==void 0)return u.texture;{const d=o.image;return c&&d&&d.height>0||h&&d&&i(d)?(t===null&&(t=new Uu(r)),u=c?t.fromEquirectangular(o):t.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),o.addEventListener("dispose",s),u.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;he.maxTextureSize&&(w=Math.ceil(x/e.maxTextureSize),x=e.maxTextureSize);const T=new Float32Array(x*w*4*u),C=new wo(T,x,w,u);C.type=Mn,C.needsUpdate=!0;const P=v*4;for(let M=0;M0)return r;const i=e*t;let s=zu[i];if(s===void 0&&(s=new Float32Array(i),zu[i]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,r[a].toArray(s,o)}return s}function Ot(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t":" "} ${o}: ${t[a]}`)}return n.join(` -`)}const qu=new tt;function kx(r){ht._getMatrix(qu,ht.workingColorSpace,r);const e=`mat3( ${qu.elements.map(t=>t.toFixed(4))} )`;switch(ht.getTransfer(r)){case co:return[e,"LinearTransferOETF"];case vt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",r),[e,"LinearTransferOETF"]}}function Yu(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const a=parseInt(s[1]);return t.toUpperCase()+` - -`+i+` - -`+zx(r.getShaderSource(e),a)}else return i}function Vx(r,e){const t=kx(e);return[`vec4 ${r}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` -`)}function Hx(r,e){let t;switch(e){case Jf:t="Linear";break;case Kf:t="Reinhard";break;case $f:t="Cineon";break;case cd:t="ACESFilmic";break;case Qf:t="AgX";break;case ep:t="Neutral";break;case jf:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const ka=new A;function Gx(){ht.getLuminanceCoefficients(ka);const r=ka.x.toFixed(4),e=ka.y.toFixed(4),t=ka.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function Wx(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ir).join(` -`)}function Xx(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function qx(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function Mc(r){return r.replace(Yx,Jx)}const Zx=new Map;function Jx(r,e){let t=st[e];if(t===void 0){const n=Zx.get(e);if(n!==void 0)t=st[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Mc(t)}const Kx=/#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 Ku(r){return r.replace(Kx,$x)}function $x(r,e,t,n){let i="";for(let s=parseInt(e);s0&&(g+=` -`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(Ir).join(` -`),m.length>0&&(m+=` -`)):(g=[$u(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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(Ir).join(` -`),m=[$u(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ti?"#define TONE_MAPPING":"",t.toneMapping!==Ti?st.tonemapping_pars_fragment:"",t.toneMapping!==Ti?Hx("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",st.colorspace_pars_fragment,Vx("linearToOutputTexel",t.outputColorSpace),Gx(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Ir).join(` -`)),a=Mc(a),a=Zu(a,t),a=Ju(a,t),o=Mc(o),o=Zu(o,t),o=Ju(o,t),a=Ku(a),o=Ku(o),t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,g=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+g,m=["#define varying in",t.glslVersion===Mh?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Mh?"":"#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(` -`)+` -`+m);const v=y+g+a,x=y+m+o,w=Xu(i,i.VERTEX_SHADER,v),T=Xu(i,i.FRAGMENT_SHADER,x);i.attachShader(_,w),i.attachShader(_,T),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function C(D){if(r.debug.checkShaderErrors){const G=i.getProgramInfoLog(_).trim(),F=i.getShaderInfoLog(w).trim(),V=i.getShaderInfoLog(T).trim();let J=!0,q=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(J=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,_,w,T);else{const se=Yu(i,w,"vertex"),Z=Yu(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` - -Material Name: `+D.name+` -Material Type: `+D.type+` - -Program Info Log: `+G+` -`+se+` -`+Z)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(F===""||V==="")&&(q=!1);q&&(D.diagnostics={runnable:J,programLog:G,vertexShader:{log:F,prefix:g},fragmentShader:{log:V,prefix:m}})}i.deleteShader(w),i.deleteShader(T),P=new $a(i,_),S=qx(i,_)}let P;this.getUniforms=function(){return P===void 0&&C(this),P};let S;this.getAttributes=function(){return S===void 0&&C(this),S};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(_,Ox)),M},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Bx++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=w,this.fragmentShader=T,this}let sy=0;class ry{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new ay(e),t.set(e,n)),n}}class ay{constructor(e){this.id=sy++,this.code=e,this.usedTimes=0}}function oy(r,e,t,n,i,s,a){const o=new Vc,l=new ry,c=new Set,h=[],u=i.logarithmicDepthBuffer,f=i.vertexTextures;let d=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",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 _(S){return c.add(S),S===0?"uv":`uv${S}`}function g(S,M,D,G,F){const V=G.fog,J=F.geometry,q=S.isMeshStandardMaterial?G.environment:null,se=(S.isMeshStandardMaterial?t:e).get(S.envMap||q),Z=se&&se.mapping===qr?se.image.height:null,_e=p[S.type];S.precision!==null&&(d=i.getMaxPrecision(S.precision),d!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",d,"instead."));const be=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,Re=be!==void 0?be.length:0;let Ge=0;J.morphAttributes.position!==void 0&&(Ge=1),J.morphAttributes.normal!==void 0&&(Ge=2),J.morphAttributes.color!==void 0&&(Ge=3);let it,Q,ue,Ie;if(_e){const at=On[_e];it=at.vertexShader,Q=at.fragmentShader}else it=S.vertexShader,Q=S.fragmentShader,l.update(S),ue=l.getVertexShaderID(S),Ie=l.getFragmentShaderID(S);const pe=r.getRenderTarget(),Oe=r.state.buffers.depth.getReversed(),We=F.isInstancedMesh===!0,ze=F.isBatchedMesh===!0,Je=!!S.map,te=!!S.matcap,de=!!se,I=!!S.aoMap,De=!!S.lightMap,re=!!S.bumpMap,Ae=!!S.normalMap,me=!!S.displacementMap,Ve=!!S.emissiveMap,Se=!!S.metalnessMap,R=!!S.roughnessMap,b=S.anisotropy>0,H=S.clearcoat>0,k=S.dispersion>0,X=S.iridescence>0,W=S.sheen>0,ce=S.transmission>0,oe=b&&!!S.anisotropyMap,ge=H&&!!S.clearcoatMap,Be=H&&!!S.clearcoatNormalMap,$=H&&!!S.clearcoatRoughnessMap,ve=X&&!!S.iridescenceMap,Y=X&&!!S.iridescenceThicknessMap,ie=W&&!!S.sheenColorMap,ae=W&&!!S.sheenRoughnessMap,Ne=!!S.specularMap,Pe=!!S.specularColorMap,Ke=!!S.specularIntensityMap,U=ce&&!!S.transmissionMap,ye=ce&&!!S.thicknessMap,K=!!S.gradientMap,ee=!!S.alphaMap,we=S.alphaTest>0,Me=!!S.alphaHash,Ye=!!S.extensions;let Mt=Ti;S.toneMapped&&(pe===null||pe.isXRRenderTarget===!0)&&(Mt=r.toneMapping);const St={shaderID:_e,shaderType:S.type,shaderName:S.name,vertexShader:it,fragmentShader:Q,defines:S.defines,customVertexShaderID:ue,customFragmentShaderID:Ie,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:d,batching:ze,batchingColor:ze&&F._colorsTexture!==null,instancing:We,instancingColor:We&&F.instanceColor!==null,instancingMorph:We&&F.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:pe===null?r.outputColorSpace:pe.isXRRenderTarget===!0?pe.texture.colorSpace:Qs,alphaToCoverage:!!S.alphaToCoverage,map:Je,matcap:te,envMap:de,envMapMode:de&&se.mapping,envMapCubeUVHeight:Z,aoMap:I,lightMap:De,bumpMap:re,normalMap:Ae,displacementMap:f&&me,emissiveMap:Ve,normalMapObjectSpace:Ae&&S.normalMapType===op,normalMapTangentSpace:Ae&&S.normalMapType===cs,metalnessMap:Se,roughnessMap:R,anisotropy:b,anisotropyMap:oe,clearcoat:H,clearcoatMap:ge,clearcoatNormalMap:Be,clearcoatRoughnessMap:$,dispersion:k,iridescence:X,iridescenceMap:ve,iridescenceThicknessMap:Y,sheen:W,sheenColorMap:ie,sheenRoughnessMap:ae,specularMap:Ne,specularColorMap:Pe,specularIntensityMap:Ke,transmission:ce,transmissionMap:U,thicknessMap:ye,gradientMap:K,opaque:S.transparent===!1&&S.blending===qs&&S.alphaToCoverage===!1,alphaMap:ee,alphaTest:we,alphaHash:Me,combine:S.combine,mapUv:Je&&_(S.map.channel),aoMapUv:I&&_(S.aoMap.channel),lightMapUv:De&&_(S.lightMap.channel),bumpMapUv:re&&_(S.bumpMap.channel),normalMapUv:Ae&&_(S.normalMap.channel),displacementMapUv:me&&_(S.displacementMap.channel),emissiveMapUv:Ve&&_(S.emissiveMap.channel),metalnessMapUv:Se&&_(S.metalnessMap.channel),roughnessMapUv:R&&_(S.roughnessMap.channel),anisotropyMapUv:oe&&_(S.anisotropyMap.channel),clearcoatMapUv:ge&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:Be&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:$&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:ve&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:Y&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:ie&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:ae&&_(S.sheenRoughnessMap.channel),specularMapUv:Ne&&_(S.specularMap.channel),specularColorMapUv:Pe&&_(S.specularColorMap.channel),specularIntensityMapUv:Ke&&_(S.specularIntensityMap.channel),transmissionMapUv:U&&_(S.transmissionMap.channel),thicknessMapUv:ye&&_(S.thicknessMap.channel),alphaMapUv:ee&&_(S.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(Ae||b),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:F.isPoints===!0&&!!J.attributes.uv&&(Je||ee),fog:!!V,useFog:S.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Oe,skinning:F.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:Re,morphTextureStride:Ge,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&D.length>0,shadowMapType:r.shadowMap.type,toneMapping:Mt,decodeVideoTexture:Je&&S.map.isVideoTexture===!0&&ht.getTransfer(S.map.colorSpace)===vt,decodeVideoTextureEmissive:Ve&&S.emissiveMap.isVideoTexture===!0&&ht.getTransfer(S.emissiveMap.colorSpace)===vt,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===Bn,flipSided:S.side===fn,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Ye&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ye&&S.extensions.multiDraw===!0||ze)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return St.vertexUv1s=c.has(1),St.vertexUv2s=c.has(2),St.vertexUv3s=c.has(3),c.clear(),St}function m(S){const M=[];if(S.shaderID?M.push(S.shaderID):(M.push(S.customVertexShaderID),M.push(S.customFragmentShaderID)),S.defines!==void 0)for(const D in S.defines)M.push(D),M.push(S.defines[D]);return S.isRawShaderMaterial===!1&&(y(M,S),v(M,S),M.push(r.outputColorSpace)),M.push(S.customProgramCacheKey),M.join()}function y(S,M){S.push(M.precision),S.push(M.outputColorSpace),S.push(M.envMapMode),S.push(M.envMapCubeUVHeight),S.push(M.mapUv),S.push(M.alphaMapUv),S.push(M.lightMapUv),S.push(M.aoMapUv),S.push(M.bumpMapUv),S.push(M.normalMapUv),S.push(M.displacementMapUv),S.push(M.emissiveMapUv),S.push(M.metalnessMapUv),S.push(M.roughnessMapUv),S.push(M.anisotropyMapUv),S.push(M.clearcoatMapUv),S.push(M.clearcoatNormalMapUv),S.push(M.clearcoatRoughnessMapUv),S.push(M.iridescenceMapUv),S.push(M.iridescenceThicknessMapUv),S.push(M.sheenColorMapUv),S.push(M.sheenRoughnessMapUv),S.push(M.specularMapUv),S.push(M.specularColorMapUv),S.push(M.specularIntensityMapUv),S.push(M.transmissionMapUv),S.push(M.thicknessMapUv),S.push(M.combine),S.push(M.fogExp2),S.push(M.sizeAttenuation),S.push(M.morphTargetsCount),S.push(M.morphAttributeCount),S.push(M.numDirLights),S.push(M.numPointLights),S.push(M.numSpotLights),S.push(M.numSpotLightMaps),S.push(M.numHemiLights),S.push(M.numRectAreaLights),S.push(M.numDirLightShadows),S.push(M.numPointLightShadows),S.push(M.numSpotLightShadows),S.push(M.numSpotLightShadowsWithMaps),S.push(M.numLightProbes),S.push(M.shadowMapType),S.push(M.toneMapping),S.push(M.numClippingPlanes),S.push(M.numClipIntersection),S.push(M.depthPacking)}function v(S,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),S.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),S.push(o.mask)}function x(S){const M=p[S.type];let D;if(M){const G=On[M];D=fo.clone(G.uniforms)}else D=S.uniforms;return D}function w(S,M){let D;for(let G=0,F=h.length;G0?n.push(m):d.transparent===!0?i.push(m):t.push(m)}function l(u,f,d,p,_,g){const m=a(u,f,d,p,_,g);d.transmission>0?n.unshift(m):d.transparent===!0?i.unshift(m):t.unshift(m)}function c(u,f){t.length>1&&t.sort(u||cy),n.length>1&&n.sort(f||ju),i.length>1&&i.sort(f||ju)}function h(){for(let u=e,f=r.length;u=s.length?(a=new Qu,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function uy(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new A,color:new ne};break;case"SpotLight":t={position:new A,direction:new A,color:new ne,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new A,color:new ne,distance:0,decay:0};break;case"HemisphereLight":t={direction:new A,skyColor:new ne,groundColor:new ne};break;case"RectAreaLight":t={color:new ne,position:new A,halfWidth:new A,halfHeight:new A};break}return r[e.id]=t,t}}}function dy(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let fy=0;function py(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function my(r){const e=new uy,t=dy(),n={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 c=0;c<9;c++)n.probe.push(new A);const i=new A,s=new Ze,a=new Ze;function o(c){let h=0,u=0,f=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let d=0,p=0,_=0,g=0,m=0,y=0,v=0,x=0,w=0,T=0,C=0;c.sort(py);for(let S=0,M=c.length;S0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Te.LTC_FLOAT_1,n.rectAreaLTC2=Te.LTC_FLOAT_2):(n.rectAreaLTC1=Te.LTC_HALF_1,n.rectAreaLTC2=Te.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=f;const P=n.hash;(P.directionalLength!==d||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==y||P.numPointShadows!==v||P.numSpotShadows!==x||P.numSpotMaps!==w||P.numLightProbes!==C)&&(n.directional.length=d,n.spot.length=_,n.rectArea.length=g,n.point.length=p,n.hemi.length=m,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=v,n.pointShadowMap.length=v,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=v,n.spotLightMatrix.length=x+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,P.directionalLength=d,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=v,P.numSpotShadows=x,P.numSpotMaps=w,P.numLightProbes=C,n.version=fy++)}function l(c,h){let u=0,f=0,d=0,p=0,_=0;const g=h.matrixWorldInverse;for(let m=0,y=c.length;m=a.length?(o=new ed(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const _y=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,vy=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function xy(r,e,t){let n=new To;const i=new j,s=new j,a=new pt,o=new Hd({depthPacking:ap}),l=new Gd,c={},h=t.maxTextureSize,u={[Ci]:fn,[fn]:Ci,[Bn]:Bn},f=new Xt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new j},radius:{value:4}},vertexShader:_y,fragmentShader:vy}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const p=new qe;p.setAttribute("position",new rt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new yt(p,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ld;let m=this.type;this.render=function(T,C,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const S=r.getRenderTarget(),M=r.getActiveCubeFace(),D=r.getActiveMipmapLevel(),G=r.state;G.setBlending(ii),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const F=m!==Qn&&this.type===Qn,V=m===Qn&&this.type!==Qn;for(let J=0,q=T.length;Jh||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/_e.x),i.x=s.x*_e.x,Z.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/_e.y),i.y=s.y*_e.y,Z.mapSize.y=s.y)),Z.map===null||F===!0||V===!0){const Re=this.type!==Qn?{minFilter:Qt,magFilter:Qt}:{};Z.map!==null&&Z.map.dispose(),Z.map=new Sn(i.x,i.y,Re),Z.map.texture.name=se.name+".shadowMap",Z.camera.updateProjectionMatrix()}r.setRenderTarget(Z.map),r.clear();const be=Z.getViewportCount();for(let Re=0;Re0||C.map&&C.alphaTest>0){const G=M.uuid,F=C.uuid;let V=c[G];V===void 0&&(V={},c[G]=V);let J=V[F];J===void 0&&(J=M.clone(),V[F]=J,C.addEventListener("dispose",w)),M=J}if(M.visible=C.visible,M.wireframe=C.wireframe,S===Qn?M.side=C.shadowSide!==null?C.shadowSide:C.side:M.side=C.shadowSide!==null?C.shadowSide:u[C.side],M.alphaMap=C.alphaMap,M.alphaTest=C.alphaTest,M.map=C.map,M.clipShadows=C.clipShadows,M.clippingPlanes=C.clippingPlanes,M.clipIntersection=C.clipIntersection,M.displacementMap=C.displacementMap,M.displacementScale=C.displacementScale,M.displacementBias=C.displacementBias,M.wireframeLinewidth=C.wireframeLinewidth,M.linewidth=C.linewidth,P.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const G=r.properties.get(M);G.light=P}return M}function x(T,C,P,S,M){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===Qn)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);const F=e.update(T),V=T.material;if(Array.isArray(V)){const J=F.groups;for(let q=0,se=J.length;q=1):Z.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),q=se>=2);let _e=null,be={};const Re=r.getParameter(r.SCISSOR_BOX),Ge=r.getParameter(r.VIEWPORT),it=new pt().fromArray(Re),Q=new pt().fromArray(Ge);function ue(U,ye,K,ee){const we=new Uint8Array(4),Me=r.createTexture();r.bindTexture(U,Me),r.texParameteri(U,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(U,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ye=0;Ye"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new j,h=new WeakMap;let u;const f=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(R,b){return d?new OffscreenCanvas(R,b):Vr("canvas")}function _(R,b,H){let k=1;const X=Se(R);if((X.width>H||X.height>H)&&(k=H/Math.max(X.width,X.height)),k<1)if(typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&R instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&R instanceof ImageBitmap||typeof VideoFrame<"u"&&R instanceof VideoFrame){const W=Math.floor(k*X.width),ce=Math.floor(k*X.height);u===void 0&&(u=p(W,ce));const oe=b?p(W,ce):u;return oe.width=W,oe.height=ce,oe.getContext("2d").drawImage(R,0,0,W,ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+X.width+"x"+X.height+") to ("+W+"x"+ce+")."),oe}else return"data"in R&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+X.width+"x"+X.height+")."),R;return R}function g(R){return R.generateMipmaps}function m(R){r.generateMipmap(R)}function y(R){return R.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:R.isWebGL3DRenderTarget?r.TEXTURE_3D:R.isWebGLArrayRenderTarget||R.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function v(R,b,H,k,X=!1){if(R!==null){if(r[R]!==void 0)return r[R];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let W=b;if(b===r.RED&&(H===r.FLOAT&&(W=r.R32F),H===r.HALF_FLOAT&&(W=r.R16F),H===r.UNSIGNED_BYTE&&(W=r.R8)),b===r.RED_INTEGER&&(H===r.UNSIGNED_BYTE&&(W=r.R8UI),H===r.UNSIGNED_SHORT&&(W=r.R16UI),H===r.UNSIGNED_INT&&(W=r.R32UI),H===r.BYTE&&(W=r.R8I),H===r.SHORT&&(W=r.R16I),H===r.INT&&(W=r.R32I)),b===r.RG&&(H===r.FLOAT&&(W=r.RG32F),H===r.HALF_FLOAT&&(W=r.RG16F),H===r.UNSIGNED_BYTE&&(W=r.RG8)),b===r.RG_INTEGER&&(H===r.UNSIGNED_BYTE&&(W=r.RG8UI),H===r.UNSIGNED_SHORT&&(W=r.RG16UI),H===r.UNSIGNED_INT&&(W=r.RG32UI),H===r.BYTE&&(W=r.RG8I),H===r.SHORT&&(W=r.RG16I),H===r.INT&&(W=r.RG32I)),b===r.RGB_INTEGER&&(H===r.UNSIGNED_BYTE&&(W=r.RGB8UI),H===r.UNSIGNED_SHORT&&(W=r.RGB16UI),H===r.UNSIGNED_INT&&(W=r.RGB32UI),H===r.BYTE&&(W=r.RGB8I),H===r.SHORT&&(W=r.RGB16I),H===r.INT&&(W=r.RGB32I)),b===r.RGBA_INTEGER&&(H===r.UNSIGNED_BYTE&&(W=r.RGBA8UI),H===r.UNSIGNED_SHORT&&(W=r.RGBA16UI),H===r.UNSIGNED_INT&&(W=r.RGBA32UI),H===r.BYTE&&(W=r.RGBA8I),H===r.SHORT&&(W=r.RGBA16I),H===r.INT&&(W=r.RGBA32I)),b===r.RGB&&H===r.UNSIGNED_INT_5_9_9_9_REV&&(W=r.RGB9_E5),b===r.RGBA){const ce=X?co:ht.getTransfer(k);H===r.FLOAT&&(W=r.RGBA32F),H===r.HALF_FLOAT&&(W=r.RGBA16F),H===r.UNSIGNED_BYTE&&(W=ce===vt?r.SRGB8_ALPHA8:r.RGBA8),H===r.UNSIGNED_SHORT_4_4_4_4&&(W=r.RGBA4),H===r.UNSIGNED_SHORT_5_5_5_1&&(W=r.RGB5_A1)}return(W===r.R16F||W===r.R32F||W===r.RG16F||W===r.RG32F||W===r.RGBA16F||W===r.RGBA32F)&&e.get("EXT_color_buffer_float"),W}function x(R,b){let H;return R?b===null||b===Ii||b===$s?H=r.DEPTH24_STENCIL8:b===Mn?H=r.DEPTH32F_STENCIL8:b===kr&&(H=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===Ii||b===$s?H=r.DEPTH_COMPONENT24:b===Mn?H=r.DEPTH_COMPONENT32F:b===kr&&(H=r.DEPTH_COMPONENT16),H}function w(R,b){return g(R)===!0||R.isFramebufferTexture&&R.minFilter!==Qt&&R.minFilter!==Vt?Math.log2(Math.max(b.width,b.height))+1:R.mipmaps!==void 0&&R.mipmaps.length>0?R.mipmaps.length:R.isCompressedTexture&&Array.isArray(R.image)?b.mipmaps.length:1}function T(R){const b=R.target;b.removeEventListener("dispose",T),P(b),b.isVideoTexture&&h.delete(b)}function C(R){const b=R.target;b.removeEventListener("dispose",C),M(b)}function P(R){const b=n.get(R);if(b.__webglInit===void 0)return;const H=R.source,k=f.get(H);if(k){const X=k[b.__cacheKey];X.usedTimes--,X.usedTimes===0&&S(R),Object.keys(k).length===0&&f.delete(H)}n.remove(R)}function S(R){const b=n.get(R);r.deleteTexture(b.__webglTexture);const H=R.source,k=f.get(H);delete k[b.__cacheKey],a.memory.textures--}function M(R){const b=n.get(R);if(R.depthTexture&&(R.depthTexture.dispose(),n.remove(R.depthTexture)),R.isWebGLCubeRenderTarget)for(let k=0;k<6;k++){if(Array.isArray(b.__webglFramebuffer[k]))for(let X=0;X=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+i.maxTextures),D+=1,R}function V(R){const b=[];return b.push(R.wrapS),b.push(R.wrapT),b.push(R.wrapR||0),b.push(R.magFilter),b.push(R.minFilter),b.push(R.anisotropy),b.push(R.internalFormat),b.push(R.format),b.push(R.type),b.push(R.generateMipmaps),b.push(R.premultiplyAlpha),b.push(R.flipY),b.push(R.unpackAlignment),b.push(R.colorSpace),b.join()}function J(R,b){const H=n.get(R);if(R.isVideoTexture&&me(R),R.isRenderTargetTexture===!1&&R.version>0&&H.__version!==R.version){const k=R.image;if(k===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(k.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Q(H,R,b);return}}t.bindTexture(r.TEXTURE_2D,H.__webglTexture,r.TEXTURE0+b)}function q(R,b){const H=n.get(R);if(R.version>0&&H.__version!==R.version){Q(H,R,b);return}t.bindTexture(r.TEXTURE_2D_ARRAY,H.__webglTexture,r.TEXTURE0+b)}function se(R,b){const H=n.get(R);if(R.version>0&&H.__version!==R.version){Q(H,R,b);return}t.bindTexture(r.TEXTURE_3D,H.__webglTexture,r.TEXTURE0+b)}function Z(R,b){const H=n.get(R);if(R.version>0&&H.__version!==R.version){ue(H,R,b);return}t.bindTexture(r.TEXTURE_CUBE_MAP,H.__webglTexture,r.TEXTURE0+b)}const _e={[ro]:r.REPEAT,[Nn]:r.CLAMP_TO_EDGE,[ao]:r.MIRRORED_REPEAT},be={[Qt]:r.NEAREST,[hd]:r.NEAREST_MIPMAP_NEAREST,[Cr]:r.NEAREST_MIPMAP_LINEAR,[Vt]:r.LINEAR,[Xa]:r.LINEAR_MIPMAP_NEAREST,[ni]:r.LINEAR_MIPMAP_LINEAR},Re={[lp]:r.NEVER,[pp]:r.ALWAYS,[cp]:r.LESS,[Md]:r.LEQUAL,[hp]:r.EQUAL,[fp]:r.GEQUAL,[up]:r.GREATER,[dp]:r.NOTEQUAL};function Ge(R,b){if(b.type===Mn&&e.has("OES_texture_float_linear")===!1&&(b.magFilter===Vt||b.magFilter===Xa||b.magFilter===Cr||b.magFilter===ni||b.minFilter===Vt||b.minFilter===Xa||b.minFilter===Cr||b.minFilter===ni)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(R,r.TEXTURE_WRAP_S,_e[b.wrapS]),r.texParameteri(R,r.TEXTURE_WRAP_T,_e[b.wrapT]),(R===r.TEXTURE_3D||R===r.TEXTURE_2D_ARRAY)&&r.texParameteri(R,r.TEXTURE_WRAP_R,_e[b.wrapR]),r.texParameteri(R,r.TEXTURE_MAG_FILTER,be[b.magFilter]),r.texParameteri(R,r.TEXTURE_MIN_FILTER,be[b.minFilter]),b.compareFunction&&(r.texParameteri(R,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(R,r.TEXTURE_COMPARE_FUNC,Re[b.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Qt||b.minFilter!==Cr&&b.minFilter!==ni||b.type===Mn&&e.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||n.get(b).__currentAnisotropy){const H=e.get("EXT_texture_filter_anisotropic");r.texParameterf(R,H.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,i.getMaxAnisotropy())),n.get(b).__currentAnisotropy=b.anisotropy}}}function it(R,b){let H=!1;R.__webglInit===void 0&&(R.__webglInit=!0,b.addEventListener("dispose",T));const k=b.source;let X=f.get(k);X===void 0&&(X={},f.set(k,X));const W=V(b);if(W!==R.__cacheKey){X[W]===void 0&&(X[W]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,H=!0),X[W].usedTimes++;const ce=X[R.__cacheKey];ce!==void 0&&(X[R.__cacheKey].usedTimes--,ce.usedTimes===0&&S(b)),R.__cacheKey=W,R.__webglTexture=X[W].texture}return H}function Q(R,b,H){let k=r.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(k=r.TEXTURE_2D_ARRAY),b.isData3DTexture&&(k=r.TEXTURE_3D);const X=it(R,b),W=b.source;t.bindTexture(k,R.__webglTexture,r.TEXTURE0+H);const ce=n.get(W);if(W.version!==ce.__version||X===!0){t.activeTexture(r.TEXTURE0+H);const oe=ht.getPrimaries(ht.workingColorSpace),ge=b.colorSpace===wi?null:ht.getPrimaries(b.colorSpace),Be=b.colorSpace===wi||oe===ge?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);let $=_(b.image,!1,i.maxTextureSize);$=Ve(b,$);const ve=s.convert(b.format,b.colorSpace),Y=s.convert(b.type);let ie=v(b.internalFormat,ve,Y,b.colorSpace,b.isVideoTexture);Ge(k,b);let ae;const Ne=b.mipmaps,Pe=b.isVideoTexture!==!0,Ke=ce.__version===void 0||X===!0,U=W.dataReady,ye=w(b,$);if(b.isDepthTexture)ie=x(b.format===js,b.type),Ke&&(Pe?t.texStorage2D(r.TEXTURE_2D,1,ie,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,ie,$.width,$.height,0,ve,Y,null));else if(b.isDataTexture)if(Ne.length>0){Pe&&Ke&&t.texStorage2D(r.TEXTURE_2D,ye,ie,Ne[0].width,Ne[0].height);for(let K=0,ee=Ne.length;K0){const we=yc(ae.width,ae.height,b.format,b.type);for(const Me of b.layerUpdates){const Ye=ae.data.subarray(Me*we/ae.data.BYTES_PER_ELEMENT,(Me+1)*we/ae.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,K,0,0,Me,ae.width,ae.height,1,ve,Ye)}b.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,K,0,0,0,ae.width,ae.height,$.depth,ve,ae.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,K,ie,ae.width,ae.height,$.depth,0,ae.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Pe?U&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,K,0,0,0,ae.width,ae.height,$.depth,ve,Y,ae.data):t.texImage3D(r.TEXTURE_2D_ARRAY,K,ie,ae.width,ae.height,$.depth,0,ve,Y,ae.data)}else{Pe&&Ke&&t.texStorage2D(r.TEXTURE_2D,ye,ie,Ne[0].width,Ne[0].height);for(let K=0,ee=Ne.length;K0){const K=yc($.width,$.height,b.format,b.type);for(const ee of b.layerUpdates){const we=$.data.subarray(ee*K/$.data.BYTES_PER_ELEMENT,(ee+1)*K/$.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ee,$.width,$.height,1,ve,Y,we)}b.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,$.width,$.height,$.depth,ve,Y,$.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,ie,$.width,$.height,$.depth,0,ve,Y,$.data);else if(b.isData3DTexture)Pe?(Ke&&t.texStorage3D(r.TEXTURE_3D,ye,ie,$.width,$.height,$.depth),U&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,$.width,$.height,$.depth,ve,Y,$.data)):t.texImage3D(r.TEXTURE_3D,0,ie,$.width,$.height,$.depth,0,ve,Y,$.data);else if(b.isFramebufferTexture){if(Ke)if(Pe)t.texStorage2D(r.TEXTURE_2D,ye,ie,$.width,$.height);else{let K=$.width,ee=$.height;for(let we=0;we>=1,ee>>=1}}else if(Ne.length>0){if(Pe&&Ke){const K=Se(Ne[0]);t.texStorage2D(r.TEXTURE_2D,ye,ie,K.width,K.height)}for(let K=0,ee=Ne.length;K0&&ye++;const ee=Se(ve[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,ye,Ne,ee.width,ee.height)}for(let ee=0;ee<6;ee++)if($){Pe?U&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,0,0,ve[ee].width,ve[ee].height,ie,ae,ve[ee].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,Ne,ve[ee].width,ve[ee].height,0,ie,ae,ve[ee].data);for(let we=0;we>W),Y=Math.max(1,b.height>>W);X===r.TEXTURE_3D||X===r.TEXTURE_2D_ARRAY?t.texImage3D(X,W,ge,ve,Y,b.depth,0,ce,oe,null):t.texImage2D(X,W,ge,ve,Y,0,ce,oe,null)}t.bindFramebuffer(r.FRAMEBUFFER,R),Ae(b)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,k,X,$.__webglTexture,0,re(b)):(X===r.TEXTURE_2D||X>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&X<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,k,X,$.__webglTexture,W),t.bindFramebuffer(r.FRAMEBUFFER,null)}function pe(R,b,H){if(r.bindRenderbuffer(r.RENDERBUFFER,R),b.depthBuffer){const k=b.depthTexture,X=k&&k.isDepthTexture?k.type:null,W=x(b.stencilBuffer,X),ce=b.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,oe=re(b);Ae(b)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,oe,W,b.width,b.height):H?r.renderbufferStorageMultisample(r.RENDERBUFFER,oe,W,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,W,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,ce,r.RENDERBUFFER,R)}else{const k=b.textures;for(let X=0;X{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,k.removeEventListener("dispose",X)};k.addEventListener("dispose",X),b.__depthDisposeCallback=X}b.__boundDepthTexture=k}if(R.depthTexture&&!b.__autoAllocateDepthBuffer){if(H)throw new Error("target.depthTexture not supported in Cube render targets");Oe(b.__webglFramebuffer,R)}else if(H){b.__webglDepthbuffer=[];for(let k=0;k<6;k++)if(t.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[k]),b.__webglDepthbuffer[k]===void 0)b.__webglDepthbuffer[k]=r.createRenderbuffer(),pe(b.__webglDepthbuffer[k],R,!1);else{const X=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,W=b.__webglDepthbuffer[k];r.bindRenderbuffer(r.RENDERBUFFER,W),r.framebufferRenderbuffer(r.FRAMEBUFFER,X,r.RENDERBUFFER,W)}}else if(t.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=r.createRenderbuffer(),pe(b.__webglDepthbuffer,R,!1);else{const k=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,X=b.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,X),r.framebufferRenderbuffer(r.FRAMEBUFFER,k,r.RENDERBUFFER,X)}t.bindFramebuffer(r.FRAMEBUFFER,null)}function ze(R,b,H){const k=n.get(R);b!==void 0&&Ie(k.__webglFramebuffer,R,R.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),H!==void 0&&We(R)}function Je(R){const b=R.texture,H=n.get(R),k=n.get(b);R.addEventListener("dispose",C);const X=R.textures,W=R.isWebGLCubeRenderTarget===!0,ce=X.length>1;if(ce||(k.__webglTexture===void 0&&(k.__webglTexture=r.createTexture()),k.__version=b.version,a.memory.textures++),W){H.__webglFramebuffer=[];for(let oe=0;oe<6;oe++)if(b.mipmaps&&b.mipmaps.length>0){H.__webglFramebuffer[oe]=[];for(let ge=0;ge0){H.__webglFramebuffer=[];for(let oe=0;oe0&&Ae(R)===!1){H.__webglMultisampledFramebuffer=r.createFramebuffer(),H.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,H.__webglMultisampledFramebuffer);for(let oe=0;oe0)for(let ge=0;ge0)for(let ge=0;ge0){if(Ae(R)===!1){const b=R.textures,H=R.width,k=R.height;let X=r.COLOR_BUFFER_BIT;const W=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ce=n.get(R),oe=b.length>1;if(oe)for(let ge=0;ge0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function me(R){const b=a.render.frame;h.get(R)!==b&&(h.set(R,b),R.update())}function Ve(R,b){const H=R.colorSpace,k=R.format,X=R.type;return R.isCompressedTexture===!0||R.isVideoTexture===!0||H!==Qs&&H!==wi&&(ht.getTransfer(H)===vt?(k!==dn||X!==li)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",H)),b}function Se(R){return typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement?(c.width=R.naturalWidth||R.width,c.height=R.naturalHeight||R.height):typeof VideoFrame<"u"&&R instanceof VideoFrame?(c.width=R.displayWidth,c.height=R.displayHeight):(c.width=R.width,c.height=R.height),c}this.allocateTextureUnit=F,this.resetTextureUnits=G,this.setTexture2D=J,this.setTexture2DArray=q,this.setTexture3D=se,this.setTextureCube=Z,this.rebindTextures=ze,this.setupRenderTarget=Je,this.updateRenderTargetMipmap=te,this.updateMultisampleRenderTarget=De,this.setupDepthRenderbuffer=We,this.setupFrameBufferTexture=Ie,this.useMultisampledRTT=Ae}function Sy(r,e){function t(n,i=wi){let s;const a=ht.getTransfer(i);if(n===li)return r.UNSIGNED_BYTE;if(n===Dc)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Lc)return r.UNSIGNED_SHORT_5_5_5_1;if(n===fd)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===ud)return r.BYTE;if(n===dd)return r.SHORT;if(n===kr)return r.UNSIGNED_SHORT;if(n===Pc)return r.INT;if(n===Ii)return r.UNSIGNED_INT;if(n===Mn)return r.FLOAT;if(n===si)return r.HALF_FLOAT;if(n===pd)return r.ALPHA;if(n===md)return r.RGB;if(n===dn)return r.RGBA;if(n===gd)return r.LUMINANCE;if(n===_d)return r.LUMINANCE_ALPHA;if(n===Ys)return r.DEPTH_COMPONENT;if(n===js)return r.DEPTH_STENCIL;if(n===Uc)return r.RED;if(n===So)return r.RED_INTEGER;if(n===vd)return r.RG;if(n===Nc)return r.RG_INTEGER;if(n===Fc)return r.RGBA_INTEGER;if(n===qa||n===Ya||n===Za||n===Ja)if(a===vt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===qa)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ya)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Za)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ja)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===qa)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ya)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Za)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ja)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===kl||n===Vl||n===Hl||n===Gl)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===kl)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Vl)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Hl)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Gl)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Wl||n===Xl||n===ql)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Wl||n===Xl)return a===vt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===ql)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Yl||n===Zl||n===Jl||n===Kl||n===$l||n===jl||n===Ql||n===ec||n===tc||n===nc||n===ic||n===sc||n===rc||n===ac)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Yl)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Zl)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Jl)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Kl)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===$l)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===jl)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ql)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ec)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===tc)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===nc)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ic)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===sc)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===rc)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===ac)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Ka||n===oc||n===lc)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Ka)return a===vt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===oc)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===lc)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===xd||n===cc||n===hc||n===uc)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Ka)return s.COMPRESSED_RED_RGTC1_EXT;if(n===cc)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===hc)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===uc)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===$s?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const wy={type:"move"};class wl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ns,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 ns,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new A,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new A),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ns,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new A,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new A),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){const t=this._hand;if(t)for(const 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 i=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,n),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],f=h.position.distanceTo(u.position),d=.02,p=.005;c.inputState.pinching&&f>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=d-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(wy)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new ns;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const Ey=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,Ty=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class Ay{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Et,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Xt({vertexShader:Ey,fragmentShader:Ty,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new yt(new lr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Cy extends ci{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,f=null,d=null,p=null;const _=new Ay,g=t.getContextAttributes();let m=null,y=null;const v=[],x=[],w=new j;let T=null;const C=new kt;C.viewport=new pt;const P=new kt;P.viewport=new pt;const S=[C,P],M=new Ag;let D=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let ue=v[Q];return ue===void 0&&(ue=new wl,v[Q]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(Q){let ue=v[Q];return ue===void 0&&(ue=new wl,v[Q]=ue),ue.getGripSpace()},this.getHand=function(Q){let ue=v[Q];return ue===void 0&&(ue=new wl,v[Q]=ue),ue.getHandSpace()};function F(Q){const ue=x.indexOf(Q.inputSource);if(ue===-1)return;const Ie=v[ue];Ie!==void 0&&(Ie.update(Q.inputSource,Q.frame,c||a),Ie.dispatchEvent({type:Q.type,data:Q.inputSource}))}function V(){i.removeEventListener("select",F),i.removeEventListener("selectstart",F),i.removeEventListener("selectend",F),i.removeEventListener("squeeze",F),i.removeEventListener("squeezestart",F),i.removeEventListener("squeezeend",F),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",J);for(let Q=0;Q=0&&(x[pe]=null,v[pe].disconnect(Ie))}for(let ue=0;ue=x.length){x.push(Ie),pe=We;break}else if(x[We]===null){x[We]=Ie,pe=We;break}if(pe===-1)break}const Oe=v[pe];Oe&&Oe.connect(Ie)}}const q=new A,se=new A;function Z(Q,ue,Ie){q.setFromMatrixPosition(ue.matrixWorld),se.setFromMatrixPosition(Ie.matrixWorld);const pe=q.distanceTo(se),Oe=ue.projectionMatrix.elements,We=Ie.projectionMatrix.elements,ze=Oe[14]/(Oe[10]-1),Je=Oe[14]/(Oe[10]+1),te=(Oe[9]+1)/Oe[5],de=(Oe[9]-1)/Oe[5],I=(Oe[8]-1)/Oe[0],De=(We[8]+1)/We[0],re=ze*I,Ae=ze*De,me=pe/(-I+De),Ve=me*-I;if(ue.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(Ve),Q.translateZ(me),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert(),Oe[10]===-1)Q.projectionMatrix.copy(ue.projectionMatrix),Q.projectionMatrixInverse.copy(ue.projectionMatrixInverse);else{const Se=ze+me,R=Je+me,b=re-Ve,H=Ae+(pe-Ve),k=te*Je/R*Se,X=de*Je/R*Se;Q.projectionMatrix.makePerspective(b,H,k,X,Se,R),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}}function _e(Q,ue){ue===null?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(ue.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(i===null)return;let ue=Q.near,Ie=Q.far;_.texture!==null&&(_.depthNear>0&&(ue=_.depthNear),_.depthFar>0&&(Ie=_.depthFar)),M.near=P.near=C.near=ue,M.far=P.far=C.far=Ie,(D!==M.near||G!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),D=M.near,G=M.far),C.layers.mask=Q.layers.mask|2,P.layers.mask=Q.layers.mask|4,M.layers.mask=C.layers.mask|P.layers.mask;const pe=Q.parent,Oe=M.cameras;_e(M,pe);for(let We=0;We0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),v=y.envMap,x=y.envMapRotation;v&&(g.envMap.value=v,Zi.copy(x),Zi.x*=-1,Zi.y*=-1,Zi.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Zi.y*=-1,Zi.z*=-1),g.envMapRotation.value.setFromMatrix4(Ry.makeRotationFromEuler(Zi)),g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function o(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,y,v){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=v*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function h(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,y){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===fn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const y=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function Py(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,v){const x=v.program;n.uniformBlockBinding(y,x)}function c(y,v){let x=i[y.id];x===void 0&&(p(y),x=h(y),i[y.id]=x,y.addEventListener("dispose",g));const w=v.program;n.updateUBOMapping(y,w);const T=e.render.frame;s[y.id]!==T&&(f(y),s[y.id]=T)}function h(y){const v=u();y.__bindingPointIndex=v;const x=r.createBuffer(),w=y.__size,T=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,w,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,x),x}function u(){for(let y=0;y0&&(x+=w-T),y.__size=x,y.__cache={},this}function _(y){const v={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function g(y){const v=y.target;v.removeEventListener("dispose",g);const x=a.indexOf(v.__bindingPointIndex);a.splice(x,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function m(){for(const y in i)r.deleteBuffer(i[y]);a=[],i={},s={}}return{bind:l,update:c,dispose:m}}class Dy{constructor(e={}){const{canvas:t=Dp(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const y=[],v=[];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._outputColorSpace=xn,this.toneMapping=Ti,this.toneMappingExposure=1;const x=this;let w=!1,T=0,C=0,P=null,S=-1,M=null;const D=new pt,G=new pt;let F=null;const V=new ne(0);let J=0,q=t.width,se=t.height,Z=1,_e=null,be=null;const Re=new pt(0,0,q,se),Ge=new pt(0,0,q,se);let it=!1;const Q=new To;let ue=!1,Ie=!1;this.transmissionResolutionScale=1;const pe=new Ze,Oe=new Ze,We=new A,ze=new pt,Je={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let te=!1;function de(){return P===null?Z:1}let I=n;function De(E,B){return t.getContext(E,B)}try{const E={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Rc}`),t.addEventListener("webglcontextlost",ee,!1),t.addEventListener("webglcontextrestored",we,!1),t.addEventListener("webglcontextcreationerror",Me,!1),I===null){const B="webgl2";if(I=De(B,E),I===null)throw De(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let re,Ae,me,Ve,Se,R,b,H,k,X,W,ce,oe,ge,Be,$,ve,Y,ie,ae,Ne,Pe,Ke,U;function ye(){re=new Vv(I),re.init(),Pe=new Sy(I,re),Ae=new Nv(I,re,e,Pe),me=new My(I,re),Ae.reverseDepthBuffer&&f&&me.buffers.depth.setReversed(!0),Ve=new Wv(I),Se=new ly,R=new by(I,re,me,Se,Ae,Pe,Ve),b=new Ov(x),H=new kv(x),k=new $g(I),Ke=new Lv(I,k),X=new Hv(I,k,Ve,Ke),W=new qv(I,X,k,Ve),ie=new Xv(I,Ae,R),$=new Fv(Se),ce=new oy(x,b,H,re,Ae,Ke,$),oe=new Iy(x,Se),ge=new hy,Be=new gy(re),Y=new Dv(x,b,H,me,W,d,l),ve=new xy(x,W,Ae),U=new Py(I,Ve,Ae,me),ae=new Uv(I,re,Ve),Ne=new Gv(I,re,Ve),Ve.programs=ce.programs,x.capabilities=Ae,x.extensions=re,x.properties=Se,x.renderLists=ge,x.shadowMap=ve,x.state=me,x.info=Ve}ye();const K=new Cy(x,I);this.xr=K,this.getContext=function(){return I},this.getContextAttributes=function(){return I.getContextAttributes()},this.forceContextLoss=function(){const E=re.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=re.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(E){E!==void 0&&(Z=E,this.setSize(q,se,!1))},this.getSize=function(E){return E.set(q,se)},this.setSize=function(E,B,N=!0){if(K.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}q=E,se=B,t.width=Math.floor(E*Z),t.height=Math.floor(B*Z),N===!0&&(t.style.width=E+"px",t.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set(q*Z,se*Z).floor()},this.setDrawingBufferSize=function(E,B,N){q=E,se=B,Z=N,t.width=Math.floor(E*N),t.height=Math.floor(B*N),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(D)},this.getViewport=function(E){return E.copy(Re)},this.setViewport=function(E,B,N,z){E.isVector4?Re.set(E.x,E.y,E.z,E.w):Re.set(E,B,N,z),me.viewport(D.copy(Re).multiplyScalar(Z).round())},this.getScissor=function(E){return E.copy(Ge)},this.setScissor=function(E,B,N,z){E.isVector4?Ge.set(E.x,E.y,E.z,E.w):Ge.set(E,B,N,z),me.scissor(G.copy(Ge).multiplyScalar(Z).round())},this.getScissorTest=function(){return it},this.setScissorTest=function(E){me.setScissorTest(it=E)},this.setOpaqueSort=function(E){_e=E},this.setTransparentSort=function(E){be=E},this.getClearColor=function(E){return E.copy(Y.getClearColor())},this.setClearColor=function(){Y.setClearColor.apply(Y,arguments)},this.getClearAlpha=function(){return Y.getClearAlpha()},this.setClearAlpha=function(){Y.setClearAlpha.apply(Y,arguments)},this.clear=function(E=!0,B=!0,N=!0){let z=0;if(E){let O=!1;if(P!==null){const he=P.texture.format;O=he===Fc||he===Nc||he===So}if(O){const he=P.texture.type,Ce=he===li||he===Ii||he===kr||he===$s||he===Dc||he===Lc,Le=Y.getClearColor(),Ue=Y.getClearAlpha(),$e=Le.r,je=Le.g,He=Le.b;Ce?(p[0]=$e,p[1]=je,p[2]=He,p[3]=Ue,I.clearBufferuiv(I.COLOR,0,p)):(_[0]=$e,_[1]=je,_[2]=He,_[3]=Ue,I.clearBufferiv(I.COLOR,0,_))}else z|=I.COLOR_BUFFER_BIT}B&&(z|=I.DEPTH_BUFFER_BIT),N&&(z|=I.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),I.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ee,!1),t.removeEventListener("webglcontextrestored",we,!1),t.removeEventListener("webglcontextcreationerror",Me,!1),Y.dispose(),ge.dispose(),Be.dispose(),Se.dispose(),b.dispose(),H.dispose(),W.dispose(),Ke.dispose(),U.dispose(),ce.dispose(),K.dispose(),K.removeEventListener("sessionstart",Di),K.removeEventListener("sessionend",ui),En.stop()};function ee(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function we(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const E=Ve.autoReset,B=ve.enabled,N=ve.autoUpdate,z=ve.needsUpdate,O=ve.type;ye(),Ve.autoReset=E,ve.enabled=B,ve.autoUpdate=N,ve.needsUpdate=z,ve.type=O}function Me(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function Ye(E){const B=E.target;B.removeEventListener("dispose",Ye),Mt(B)}function Mt(E){St(E),Se.remove(E)}function St(E){const B=Se.get(E).programs;B!==void 0&&(B.forEach(function(N){ce.releaseProgram(N)}),E.isShaderMaterial&&ce.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,N,z,O,he){B===null&&(B=Je);const Ce=O.isMesh&&O.matrixWorld.determinant()<0,Le=Nt(E,B,N,z,O);me.setMaterial(z,Ce);let Ue=N.index,$e=1;if(z.wireframe===!0){if(Ue=X.getWireframeAttribute(N),Ue===void 0)return;$e=2}const je=N.drawRange,He=N.attributes.position;let lt=je.start*$e,gt=(je.start+je.count)*$e;he!==null&&(lt=Math.max(lt,he.start*$e),gt=Math.min(gt,(he.start+he.count)*$e)),Ue!==null?(lt=Math.max(lt,0),gt=Math.min(gt,Ue.count)):He!=null&&(lt=Math.max(lt,0),gt=Math.min(gt,He.count));const Dt=gt-lt;if(Dt<0||Dt===1/0)return;Ke.setup(O,z,Le,N,Ue);let Tt,dt=ae;if(Ue!==null&&(Tt=k.get(Ue),dt=Ne,dt.setIndex(Tt)),O.isMesh)z.wireframe===!0?(me.setLineWidth(z.wireframeLinewidth*de()),dt.setMode(I.LINES)):dt.setMode(I.TRIANGLES);else if(O.isLine){let Xe=z.linewidth;Xe===void 0&&(Xe=1),me.setLineWidth(Xe*de()),O.isLineSegments?dt.setMode(I.LINES):O.isLineLoop?dt.setMode(I.LINE_LOOP):dt.setMode(I.LINE_STRIP)}else O.isPoints?dt.setMode(I.POINTS):O.isSprite&&dt.setMode(I.TRIANGLES);if(O.isBatchedMesh)if(O._multiDrawInstances!==null)dt.renderMultiDrawInstances(O._multiDrawStarts,O._multiDrawCounts,O._multiDrawCount,O._multiDrawInstances);else if(re.get("WEBGL_multi_draw"))dt.renderMultiDraw(O._multiDrawStarts,O._multiDrawCounts,O._multiDrawCount);else{const Xe=O._multiDrawStarts,Gt=O._multiDrawCounts,_t=O._multiDrawCount,Pn=Ue?k.get(Ue).bytesPerElement:1,fs=Se.get(z).currentProgram.getUniforms();for(let gn=0;gn<_t;gn++)fs.setValue(I,"_gl_DrawID",gn),dt.render(Xe[gn]/Pn,Gt[gn])}else if(O.isInstancedMesh)dt.renderInstances(lt,Dt,O.count);else if(N.isInstancedBufferGeometry){const Xe=N._maxInstanceCount!==void 0?N._maxInstanceCount:1/0,Gt=Math.min(N.instanceCount,Xe);dt.renderInstances(lt,Dt,Gt)}else dt.render(lt,Dt)};function at(E,B,N){E.transparent===!0&&E.side===Bn&&E.forceSinglePass===!1?(E.side=fn,E.needsUpdate=!0,Fn(E,B,N),E.side=Ci,E.needsUpdate=!0,Fn(E,B,N),E.side=Bn):Fn(E,B,N)}this.compile=function(E,B,N=null){N===null&&(N=E),m=Be.get(N),m.init(B),v.push(m),N.traverseVisible(function(O){O.isLight&&O.layers.test(B.layers)&&(m.pushLight(O),O.castShadow&&m.pushShadow(O))}),E!==N&&E.traverseVisible(function(O){O.isLight&&O.layers.test(B.layers)&&(m.pushLight(O),O.castShadow&&m.pushShadow(O))}),m.setupLights();const z=new Set;return E.traverse(function(O){if(!(O.isMesh||O.isPoints||O.isLine||O.isSprite))return;const he=O.material;if(he)if(Array.isArray(he))for(let Ce=0;Ce{function he(){if(z.forEach(function(Ce){Se.get(Ce).currentProgram.isReady()&&z.delete(Ce)}),z.size===0){O(E);return}setTimeout(he,10)}re.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let Yt=null;function Ht(E){Yt&&Yt(E)}function Di(){En.stop()}function ui(){En.start()}const En=new tf;En.setAnimationLoop(Ht),typeof self<"u"&&En.setContext(self),this.setAnimationLoop=function(E){Yt=E,K.setAnimationLoop(E),E===null?En.stop():En.start()},K.addEventListener("sessionstart",Di),K.addEventListener("sessionend",ui),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),K.enabled===!0&&K.isPresenting===!0&&(K.cameraAutoUpdate===!0&&K.updateCamera(B),B=K.getCamera()),E.isScene===!0&&E.onBeforeRender(x,E,B,P),m=Be.get(E,v.length),m.init(B),v.push(m),Oe.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),Q.setFromProjectionMatrix(Oe),Ie=this.localClippingEnabled,ue=$.init(this.clippingPlanes,Ie),g=ge.get(E,y.length),g.init(),y.push(g),K.enabled===!0&&K.isPresenting===!0){const he=x.xr.getDepthSensingMesh();he!==null&&di(he,B,-1/0,x.sortObjects)}di(E,B,0,x.sortObjects),g.finish(),x.sortObjects===!0&&g.sort(_e,be),te=K.enabled===!1||K.isPresenting===!1||K.hasDepthSensing()===!1,te&&Y.addToRenderList(g,E),this.info.render.frame++,ue===!0&&$.beginShadows();const N=m.state.shadowsArray;ve.render(N,E,B),ue===!0&&$.endShadows(),this.info.autoReset===!0&&this.info.reset();const z=g.opaque,O=g.transmissive;if(m.setupLights(),B.isArrayCamera){const he=B.cameras;if(O.length>0)for(let Ce=0,Le=he.length;Ce0&&Wn(z,O,E,B),te&&Y.render(E),Li(g,E,B);P!==null&&C===0&&(R.updateMultisampleRenderTarget(P),R.updateRenderTargetMipmap(P)),E.isScene===!0&&E.onAfterRender(x,E,B),Ke.resetDefaultState(),S=-1,M=null,v.pop(),v.length>0?(m=v[v.length-1],ue===!0&&$.setGlobalState(x.clippingPlanes,m.state.camera)):m=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function di(E,B,N,z){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)N=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)m.pushLight(E),E.castShadow&&m.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Q.intersectsSprite(E)){z&&ze.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Oe);const Ce=W.update(E),Le=E.material;Le.visible&&g.push(E,Ce,Le,N,ze.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Q.intersectsObject(E))){const Ce=W.update(E),Le=E.material;if(z&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ze.copy(E.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),ze.copy(Ce.boundingSphere.center)),ze.applyMatrix4(E.matrixWorld).applyMatrix4(Oe)),Array.isArray(Le)){const Ue=Ce.groups;for(let $e=0,je=Ue.length;$e0&&Xn(O,B,N),he.length>0&&Xn(he,B,N),Ce.length>0&&Xn(Ce,B,N),me.buffers.depth.setTest(!0),me.buffers.depth.setMask(!0),me.buffers.color.setMask(!0),me.setPolygonOffset(!1)}function Wn(E,B,N,z){if((N.isScene===!0?N.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[z.id]===void 0&&(m.state.transmissionRenderTarget[z.id]=new Sn(1,1,{generateMipmaps:!0,type:re.has("EXT_color_buffer_half_float")||re.has("EXT_color_buffer_float")?si:li,minFilter:ni,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ht.workingColorSpace}));const he=m.state.transmissionRenderTarget[z.id],Ce=z.viewport||D;he.setSize(Ce.z*x.transmissionResolutionScale,Ce.w*x.transmissionResolutionScale);const Le=x.getRenderTarget();x.setRenderTarget(he),x.getClearColor(V),J=x.getClearAlpha(),J<1&&x.setClearColor(16777215,.5),x.clear(),te&&Y.render(N);const Ue=x.toneMapping;x.toneMapping=Ti;const $e=z.viewport;if(z.viewport!==void 0&&(z.viewport=void 0),m.setupLightsView(z),ue===!0&&$.setGlobalState(x.clippingPlanes,z),Xn(E,N,z),R.updateMultisampleRenderTarget(he),R.updateRenderTargetMipmap(he),re.has("WEBGL_multisampled_render_to_texture")===!1){let je=!1;for(let He=0,lt=B.length;He0),He=!!N.morphAttributes.position,lt=!!N.morphAttributes.normal,gt=!!N.morphAttributes.color;let Dt=Ti;z.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Dt=x.toneMapping);const Tt=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,dt=Tt!==void 0?Tt.length:0,Xe=Se.get(z),Gt=m.state.lights;if(ue===!0&&(Ie===!0||E!==M)){const en=E===M&&z.id===S;$.setState(z,E,en)}let _t=!1;z.version===Xe.__version?(Xe.needsLights&&Xe.lightsStateVersion!==Gt.state.version||Xe.outputColorSpace!==Le||O.isBatchedMesh&&Xe.batching===!1||!O.isBatchedMesh&&Xe.batching===!0||O.isBatchedMesh&&Xe.batchingColor===!0&&O.colorTexture===null||O.isBatchedMesh&&Xe.batchingColor===!1&&O.colorTexture!==null||O.isInstancedMesh&&Xe.instancing===!1||!O.isInstancedMesh&&Xe.instancing===!0||O.isSkinnedMesh&&Xe.skinning===!1||!O.isSkinnedMesh&&Xe.skinning===!0||O.isInstancedMesh&&Xe.instancingColor===!0&&O.instanceColor===null||O.isInstancedMesh&&Xe.instancingColor===!1&&O.instanceColor!==null||O.isInstancedMesh&&Xe.instancingMorph===!0&&O.morphTexture===null||O.isInstancedMesh&&Xe.instancingMorph===!1&&O.morphTexture!==null||Xe.envMap!==Ue||z.fog===!0&&Xe.fog!==he||Xe.numClippingPlanes!==void 0&&(Xe.numClippingPlanes!==$.numPlanes||Xe.numIntersection!==$.numIntersection)||Xe.vertexAlphas!==$e||Xe.vertexTangents!==je||Xe.morphTargets!==He||Xe.morphNormals!==lt||Xe.morphColors!==gt||Xe.toneMapping!==Dt||Xe.morphTargetsCount!==dt)&&(_t=!0):(_t=!0,Xe.__version=z.version);let Pn=Xe.currentProgram;_t===!0&&(Pn=Fn(z,B,O));let fs=!1,gn=!1,pr=!1;const bt=Pn.getUniforms(),An=Xe.uniforms;if(me.useProgram(Pn.program)&&(fs=!0,gn=!0,pr=!0),z.id!==S&&(S=z.id,gn=!0),fs||M!==E){me.buffers.depth.getReversed()?(pe.copy(E.projectionMatrix),Up(pe),Np(pe),bt.setValue(I,"projectionMatrix",pe)):bt.setValue(I,"projectionMatrix",E.projectionMatrix),bt.setValue(I,"viewMatrix",E.matrixWorldInverse);const ln=bt.map.cameraPosition;ln!==void 0&&ln.setValue(I,We.setFromMatrixPosition(E.matrixWorld)),Ae.logarithmicDepthBuffer&&bt.setValue(I,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&bt.setValue(I,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,gn=!0,pr=!0)}if(O.isSkinnedMesh){bt.setOptional(I,O,"bindMatrix"),bt.setOptional(I,O,"bindMatrixInverse");const en=O.skeleton;en&&(en.boneTexture===null&&en.computeBoneTexture(),bt.setValue(I,"boneTexture",en.boneTexture,R))}O.isBatchedMesh&&(bt.setOptional(I,O,"batchingTexture"),bt.setValue(I,"batchingTexture",O._matricesTexture,R),bt.setOptional(I,O,"batchingIdTexture"),bt.setValue(I,"batchingIdTexture",O._indirectTexture,R),bt.setOptional(I,O,"batchingColorTexture"),O._colorsTexture!==null&&bt.setValue(I,"batchingColorTexture",O._colorsTexture,R));const Cn=N.morphAttributes;if((Cn.position!==void 0||Cn.normal!==void 0||Cn.color!==void 0)&&ie.update(O,N,Pn),(gn||Xe.receiveShadow!==O.receiveShadow)&&(Xe.receiveShadow=O.receiveShadow,bt.setValue(I,"receiveShadow",O.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(An.envMap.value=Ue,An.flipEnvMap.value=Ue.isCubeTexture&&Ue.isRenderTargetTexture===!1?-1:1),z.isMeshStandardMaterial&&z.envMap===null&&B.environment!==null&&(An.envMapIntensity.value=B.environmentIntensity),gn&&(bt.setValue(I,"toneMappingExposure",x.toneMappingExposure),Xe.needsLights&&mn(An,pr),he&&z.fog===!0&&oe.refreshFogUniforms(An,he),oe.refreshMaterialUniforms(An,z,Z,se,m.state.transmissionRenderTarget[E.id]),$a.upload(I,Ui(Xe),An,R)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&($a.upload(I,Ui(Xe),An,R),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&bt.setValue(I,"center",O.center),bt.setValue(I,"modelViewMatrix",O.modelViewMatrix),bt.setValue(I,"normalMatrix",O.normalMatrix),bt.setValue(I,"modelMatrix",O.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){const en=z.uniformsGroups;for(let ln=0,No=en.length;ln0&&R.useMultisampledRTT(E)===!1?O=Se.get(E).__webglMultisampledFramebuffer:Array.isArray(je)?O=je[N]:O=je,D.copy(E.viewport),G.copy(E.scissor),F=E.scissorTest}else D.copy(Re).multiplyScalar(Z).floor(),G.copy(Ge).multiplyScalar(Z).floor(),F=it;if(N!==0&&(O=pi),me.bindFramebuffer(I.FRAMEBUFFER,O)&&z&&me.drawBuffers(E,O),me.viewport(D),me.scissor(G),me.setScissorTest(F),he){const Ue=Se.get(E.texture);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_CUBE_MAP_POSITIVE_X+B,Ue.__webglTexture,N)}else if(Ce){const Ue=Se.get(E.texture),$e=B;I.framebufferTextureLayer(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,Ue.__webglTexture,N,$e)}else if(E!==null&&N!==0){const Ue=Se.get(E.texture);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_2D,Ue.__webglTexture,N)}S=-1},this.readRenderTargetPixels=function(E,B,N,z,O,he,Ce){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Le=Se.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){me.bindFramebuffer(I.FRAMEBUFFER,Le);try{const Ue=E.texture,$e=Ue.format,je=Ue.type;if(!Ae.textureFormatReadable($e)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ae.textureTypeReadable(je)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-z&&N>=0&&N<=E.height-O&&I.readPixels(B,N,z,O,Pe.convert($e),Pe.convert(je),he)}finally{const Ue=P!==null?Se.get(P).__webglFramebuffer:null;me.bindFramebuffer(I.FRAMEBUFFER,Ue)}}},this.readRenderTargetPixelsAsync=async function(E,B,N,z,O,he,Ce){if(!(E&&E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Le=Se.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){const Ue=E.texture,$e=Ue.format,je=Ue.type;if(!Ae.textureFormatReadable($e))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ae.textureTypeReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(B>=0&&B<=E.width-z&&N>=0&&N<=E.height-O){me.bindFramebuffer(I.FRAMEBUFFER,Le);const He=I.createBuffer();I.bindBuffer(I.PIXEL_PACK_BUFFER,He),I.bufferData(I.PIXEL_PACK_BUFFER,he.byteLength,I.STREAM_READ),I.readPixels(B,N,z,O,Pe.convert($e),Pe.convert(je),0);const lt=P!==null?Se.get(P).__webglFramebuffer:null;me.bindFramebuffer(I.FRAMEBUFFER,lt);const gt=I.fenceSync(I.SYNC_GPU_COMMANDS_COMPLETE,0);return I.flush(),await Lp(I,gt,4),I.bindBuffer(I.PIXEL_PACK_BUFFER,He),I.getBufferSubData(I.PIXEL_PACK_BUFFER,0,he),I.deleteBuffer(He),I.deleteSync(gt),he}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(E,B=null,N=0){E.isTexture!==!0&&(Fs("WebGLRenderer: copyFramebufferToTexture function signature has changed."),B=arguments[0]||null,E=arguments[1]);const z=Math.pow(2,-N),O=Math.floor(E.image.width*z),he=Math.floor(E.image.height*z),Ce=B!==null?B.x:0,Le=B!==null?B.y:0;R.setTexture2D(E,0),I.copyTexSubImage2D(I.TEXTURE_2D,N,0,0,Ce,Le,O,he),me.unbindTexture()};const fr=I.createFramebuffer(),ds=I.createFramebuffer();this.copyTextureToTexture=function(E,B,N=null,z=null,O=0,he=null){E.isTexture!==!0&&(Fs("WebGLRenderer: copyTextureToTexture function signature has changed."),z=arguments[0]||null,E=arguments[1],B=arguments[2],he=arguments[3]||0,N=null),he===null&&(O!==0?(Fs("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),he=O,O=0):he=0);let Ce,Le,Ue,$e,je,He,lt,gt,Dt;const Tt=E.isCompressedTexture?E.mipmaps[he]:E.image;if(N!==null)Ce=N.max.x-N.min.x,Le=N.max.y-N.min.y,Ue=N.isBox3?N.max.z-N.min.z:1,$e=N.min.x,je=N.min.y,He=N.isBox3?N.min.z:0;else{const Cn=Math.pow(2,-O);Ce=Math.floor(Tt.width*Cn),Le=Math.floor(Tt.height*Cn),E.isDataArrayTexture?Ue=Tt.depth:E.isData3DTexture?Ue=Math.floor(Tt.depth*Cn):Ue=1,$e=0,je=0,He=0}z!==null?(lt=z.x,gt=z.y,Dt=z.z):(lt=0,gt=0,Dt=0);const dt=Pe.convert(B.format),Xe=Pe.convert(B.type);let Gt;B.isData3DTexture?(R.setTexture3D(B,0),Gt=I.TEXTURE_3D):B.isDataArrayTexture||B.isCompressedArrayTexture?(R.setTexture2DArray(B,0),Gt=I.TEXTURE_2D_ARRAY):(R.setTexture2D(B,0),Gt=I.TEXTURE_2D),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,B.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,B.unpackAlignment);const _t=I.getParameter(I.UNPACK_ROW_LENGTH),Pn=I.getParameter(I.UNPACK_IMAGE_HEIGHT),fs=I.getParameter(I.UNPACK_SKIP_PIXELS),gn=I.getParameter(I.UNPACK_SKIP_ROWS),pr=I.getParameter(I.UNPACK_SKIP_IMAGES);I.pixelStorei(I.UNPACK_ROW_LENGTH,Tt.width),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,Tt.height),I.pixelStorei(I.UNPACK_SKIP_PIXELS,$e),I.pixelStorei(I.UNPACK_SKIP_ROWS,je),I.pixelStorei(I.UNPACK_SKIP_IMAGES,He);const bt=E.isDataArrayTexture||E.isData3DTexture,An=B.isDataArrayTexture||B.isData3DTexture;if(E.isDepthTexture){const Cn=Se.get(E),en=Se.get(B),ln=Se.get(Cn.__renderTarget),No=Se.get(en.__renderTarget);me.bindFramebuffer(I.READ_FRAMEBUFFER,ln.__webglFramebuffer),me.bindFramebuffer(I.DRAW_FRAMEBUFFER,No.__webglFramebuffer);for(let Ni=0;NiMath.PI&&(n-=hn),i<-Math.PI?i+=hn:i>Math.PI&&(i-=hn),n<=i?this._spherical.theta=Math.max(n,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+i)/2?Math.max(n,this._spherical.theta):Math.min(i,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 s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=a!=this._spherical.radius}if(Ft.setFromSpherical(this._spherical),Ft.applyQuaternion(this._quatInverse),t.copy(this.target).add(Ft),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 a=null;if(this.object.isPerspectiveCamera){const o=Ft.length();a=this._clampDistance(o*this._scale);const l=o-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const o=new A(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new A(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(o),this.object.updateMatrixWorld(),a=Ft.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Va.origin.copy(this.object.position),Va.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Va.direction))El||8*(1-this._lastQuaternion.dot(this.object.quaternion))>El||this._lastTargetPosition.distanceToSquared(this.target)>El?(this.dispatchEvent(td),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?hn/60*this.autoRotateSpeed*e:hn/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Ft.setFromMatrixColumn(t,0),Ft.multiplyScalar(-e),this._panOffset.add(Ft)}_panUp(e,t){this.screenSpacePanning===!0?Ft.setFromMatrixColumn(t,1):(Ft.setFromMatrixColumn(t,0),Ft.crossVectors(this.object.up,Ft)),Ft.multiplyScalar(e),this._panOffset.add(Ft)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Ft.copy(i).sub(this.target);let s=Ft.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/n.clientHeight,this.object.matrix),this._panUp(2*t*s/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;const n=this.domElement.getBoundingClientRect(),i=e-n.left,s=t-n.top,a=n.width,o=n.height;this._mouse.x=i/a*2-1,this._mouse.y=-(s/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);const t=this.domElement;this._rotateLeft(hn*this._rotateDelta.x/t.clientHeight),this._rotateUp(hn*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(hn*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(-hn*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(hn*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(-hn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panStart.set(n,i)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(n*n+i*i);this._dollyStart.set(0,s)}_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{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),s=.5*(e.pageY+n.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(hn*this._rotateDelta.x/t.clientHeight),this._rotateUp(hn*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{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panEnd.set(n,i)}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){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const 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 - varying vec2 vUv; - uniform sampler2D colorTexture; - uniform vec2 invSize; - uniform vec2 direction; - uniform float gaussianCoefficients[KERNEL_RADIUS]; - - void main() { - float weightSum = gaussianCoefficients[0]; - vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum; - for( int i = 1; i < KERNEL_RADIUS; i ++ ) { - float x = float(i); - float w = gaussianCoefficients[i]; - vec2 uvOffset = direction * invSize * x; - vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb; - vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb; - diffuseSum += (sample1 + sample2) * w; - weightSum += 2.0 * w; - } - gl_FragColor = vec4(diffuseSum/weightSum, 1.0); - }`})}getCompositeMaterial(e){return new Xt({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv; - void main() { - vUv = uv; - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - }`,fragmentShader:`varying vec2 vUv; - uniform sampler2D blurTexture1; - uniform sampler2D blurTexture2; - uniform sampler2D blurTexture3; - uniform sampler2D blurTexture4; - uniform sampler2D blurTexture5; - uniform float bloomStrength; - uniform float bloomRadius; - uniform float bloomFactors[NUM_MIPS]; - uniform vec3 bloomTintColors[NUM_MIPS]; - - float lerpBloomFactor(const in float factor) { - float mirrorFactor = 1.2 - factor; - return mix(factor, mirrorFactor, bloomRadius); - } - - void main() { - gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + - lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + - lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + - lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + - lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); - }`})}}ir.BlurDirectionX=new j(1,0);ir.BlurDirectionY=new j(0,1);function eM(){const e=new Float32Array(6e3),t=new Float32Array(2e3*3);for(let s=0;s<2e3;s++){const a=Math.random()*Math.PI*2,o=Math.acos(2*Math.random()-1),l=600+Math.random()*400;e[s*3]=l*Math.sin(o)*Math.cos(a),e[s*3+1]=l*Math.sin(o)*Math.sin(a),e[s*3+2]=l*Math.cos(o);const c=Math.random();t[s*3]=.55+c*.25,t[s*3+1]=.55+c*.15,t[s*3+2]=.75+c*.25}const n=new qe;n.setAttribute("position",new rt(e,3)),n.setAttribute("color",new rt(t,3));const i=new Ai({size:1.6,sizeAttenuation:!0,vertexColors:!0,transparent:!0,opacity:.6,depthWrite:!1,blending:Wt});return new as(n,i)}function tM(r){const e=new Cd;e.background=new ne(328975),e.fog=new Yr(657946,.0035);const t=new kt(60,r.clientWidth/r.clientHeight,.1,2e3);t.position.set(0,30,80);const n=new Dy({antialias:!0,alpha:!0,powerPreference:"high-performance"});n.setSize(r.clientWidth,r.clientHeight),n.setPixelRatio(Math.min(window.devicePixelRatio,2)),n.toneMapping=cd,n.toneMappingExposure=1.25,r.appendChild(n.domElement);const i=new Uy(t,n.domElement);i.enableDamping=!0,i.dampingFactor=.05,i.rotateSpeed=.5,i.zoomSpeed=.8,i.minDistance=12,i.maxDistance=180,i.autoRotate=!0,i.autoRotateSpeed=.3;const s=new $y(n);s.addPass(new jy(e,t));const a=new ir(new j(r.clientWidth,r.clientHeight),.55,.6,.2);s.addPass(a);const o=new Jd(2763354,.7);e.add(o);const l=new _c(6514417,1.8,240);l.position.set(50,50,50),e.add(l);const c=new _c(11032055,1.2,240);c.position.set(-50,-30,-50),e.add(c);const h=eM();e.add(h);const u=new Wg;u.params.Points={threshold:2};const f=new j;return{scene:e,camera:t,renderer:n,controls:i,composer:s,bloomPass:a,raycaster:u,mouse:f,lights:{ambient:o,point1:l,point2:c},starfield:h}}function nM(r,e){const t=e.clientWidth,n=e.clientHeight;r.camera.aspect=t/n,r.camera.updateProjectionMatrix(),r.renderer.setSize(t,n),r.composer.setSize(t,n)}function iM(r){r.scene.traverse(e=>{var t;(e instanceof yt||e instanceof Pd)&&((t=e.geometry)==null||t.dispose(),Array.isArray(e.material)?e.material.forEach(n=>n.dispose()):e.material&&e.material.dispose())}),r.renderer.dispose(),r.composer.dispose()}class sM{constructor(e){ke(this,"positions");ke(this,"velocities");ke(this,"running",!0);ke(this,"step",0);ke(this,"repulsionStrength",500);ke(this,"attractionStrength",.01);ke(this,"dampening",.9);ke(this,"baseMaxSteps",300);ke(this,"maxSteps",300);ke(this,"cooldownExtension",0);this.positions=e,this.velocities=new Map;for(const t of e.keys())this.velocities.set(t,new A)}addNode(e,t){this.positions.set(e,t.clone()),this.velocities.set(e,new A),this.cooldownExtension=100,this.maxSteps=Math.max(this.maxSteps,this.step+this.cooldownExtension),this.running=!0}removeNode(e){this.positions.delete(e),this.velocities.delete(e)}tick(e){if(!this.running)return;if(this.step>this.maxSteps){this.cooldownExtension>0&&(this.cooldownExtension=0,this.maxSteps=this.baseMaxSteps);return}this.step++;const t=Math.max(.001,1-this.step/this.maxSteps),n=Array.from(this.positions.keys());for(let i=0;i=.7?"active":r>=.4?"dormant":r>=.1?"silent":"unavailable"}const bc={active:"#10b981",dormant:"#f59e0b",silent:"#8b5cf6",unavailable:"#6b7280"},aM={active:"Easily retrievable (retention ≥ 70%)",dormant:"Retrievable with effort (40–70%)",silent:"Difficult, needs cues (10–40%)",unavailable:"Needs reinforcement (< 10%)"},Qa={aha:"#FFD700",confusion:"#EF4444",failure:"#9CA3AF"},oM={aha:"Aha moments and breakthroughs",confusion:"Confusions and weak spots",failure:"Failures and guardrails"};function sd(r,e){return e==="state"?bc[rM(r.retention)]:e==="ahagraph"?lM(r)??Il[r.type]??"#8B95A5":Il[r.type]||"#8B95A5"}function lM(r){const e=new Set((r.tags??[]).map(t=>t.toLowerCase()));return e.has("aha")?Qa.aha:e.has("confusion")||e.has("weak-spot")?Qa.confusion:e.has("failure")||e.has("guardrail")?Qa.failure:null}let Ar=null;function Sc(){if(Ar)return Ar;const r=128,e=document.createElement("canvas");e.width=r,e.height=r;const t=e.getContext("2d");if(!t)return Ar=new Et,Ar;const n=t.createRadialGradient(r/2,r/2,0,r/2,r/2,r/2);n.addColorStop(0,"rgba(255, 255, 255, 1.0)"),n.addColorStop(.25,"rgba(255, 255, 255, 0.7)"),n.addColorStop(.55,"rgba(255, 255, 255, 0.2)"),n.addColorStop(1,"rgba(255, 255, 255, 0.0)"),t.fillStyle=n,t.fillRect(0,0,r,r);const i=new Dd(e);return i.needsUpdate=!0,Ar=i,i}function rd(r){if(r===0||r===1)return r;const e=.3;return Math.pow(2,-10*r)*Math.sin((r-e/4)*(2*Math.PI)/e)+1}function cM(r){return r*r*((1.70158+1)*r-1.70158)}class hM{constructor(){ke(this,"group");ke(this,"meshMap",new Map);ke(this,"glowMap",new Map);ke(this,"positions",new Map);ke(this,"labelSprites",new Map);ke(this,"hoveredNode",null);ke(this,"selectedNode",null);ke(this,"colorMode","type");ke(this,"materializingNodes",[]);ke(this,"dissolvingNodes",[]);ke(this,"growingNodes",[]);this.group=new ns}setColorMode(e){if(this.colorMode!==e){this.colorMode=e;for(const[t,n]of this.meshMap){const i=n.userData.retention??0,s=n.userData.type??"fact",a=Array.isArray(n.userData.tags)?n.userData.tags:[],l=sd({type:s,retention:i,tags:a},e),c=new ne(l),h=n.material;h.color.copy(c),h.emissive.copy(c);const u=this.glowMap.get(t);u&&u.material.color.copy(c)}}}createNodes(e){const t=(1+Math.sqrt(5))/2,n=e.length;for(let i=0;i0,o=new cr(i,16,16),l=new ah({color:new ne(s),emissive:new ne(s),emissiveIntensity:a?0:.3+e.retention*.5,roughness:.3,metalness:.1,transparent:!0,opacity:a?.2:.3+e.retention*.7}),c=new yt(o,l);c.position.copy(t),c.scale.setScalar(n),c.userData={nodeId:e.id,type:e.type,retention:e.retention,tags:e.tags},this.meshMap.set(e.id,c),this.group.add(c);const h=new rs({map:Sc(),color:new ne(s),transparent:!0,opacity:n>0?a?.1:.3+e.retention*.35:0,blending:Wt,depthWrite:!1}),u=new ts(h);u.scale.set(i*6*n,i*6*n,1),u.position.copy(t),u.userData={isGlow:!0,nodeId:e.id},this.glowMap.set(e.id,u),this.group.add(u);const f=e.label||e.type,d=this.createTextSprite(f,"#94a3b8");return d.position.copy(t),d.position.y+=i*2+1.5,d.userData={isLabel:!0,nodeId:e.id,offset:i*2+1.5},this.group.add(d),this.labelSprites.set(e.id,d),{mesh:c,glow:u,label:d,size:i}}addNode(e,t,n={}){const i=(t==null?void 0:t.clone())??new A((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40);this.positions.set(e.id,i);const{mesh:s,glow:a,label:o}=this.createNodeMeshes(e,i,0);return s.scale.setScalar(.001),a.scale.set(.001,.001,1),a.material.opacity=0,o.material.opacity=0,n.isBirthRitual?(s.visible=!1,a.visible=!1,o.visible=!1,s.userData.birthRitualPending={totalFrames:30,targetScale:.5+e.retention*2}):this.materializingNodes.push({id:e.id,frame:0,totalFrames:30,mesh:s,glow:a,label:o,targetScale:.5+e.retention*2}),i}igniteNode(e){const t=this.meshMap.get(e),n=this.glowMap.get(e),i=this.labelSprites.get(e);if(!t||!n||!i)return;const s=t.userData.birthRitualPending;s&&(t.visible=!0,n.visible=!0,i.visible=!0,delete t.userData.birthRitualPending,this.materializingNodes.push({id:e,frame:0,totalFrames:s.totalFrames,mesh:t,glow:n,label:i,targetScale:s.targetScale}))}removeNode(e){const t=this.meshMap.get(e),n=this.glowMap.get(e),i=this.labelSprites.get(e);!t||!n||!i||(this.materializingNodes=this.materializingNodes.filter(s=>s.id!==e),this.dissolvingNodes.push({id:e,frame:0,totalFrames:60,mesh:t,glow:n,label:i,originalScale:t.scale.x}))}growNode(e,t){const n=this.meshMap.get(e);if(!n)return;const i=n.scale.x,s=.5+t*2;n.userData.retention=t,this.growingNodes.push({id:e,frame:0,totalFrames:30,startScale:i,targetScale:s})}createTextSprite(e,t){const n=document.createElement("canvas"),i=n.getContext("2d");if(!i){const m=new Et;return new ts(new rs({map:m,transparent:!0,opacity:0}))}n.width=512,n.height=64;const s=e.length>40?e.slice(0,37)+"...":e;i.clearRect(0,0,n.width,n.height),i.font='600 22px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif';const o=i.measureText(s).width,c=Math.min(o+14*2,n.width-4),h=40,u=(n.width-c)/2,f=(n.height-h)/2,d=h/2;i.fillStyle="rgba(10, 16, 28, 0.82)",i.beginPath(),i.moveTo(u+d,f),i.lineTo(u+c-d,f),i.quadraticCurveTo(u+c,f,u+c,f+d),i.lineTo(u+c,f+h-d),i.quadraticCurveTo(u+c,f+h,u+c-d,f+h),i.lineTo(u+d,f+h),i.quadraticCurveTo(u,f+h,u,f+h-d),i.lineTo(u,f+d),i.quadraticCurveTo(u,f,u+d,f),i.closePath(),i.fill(),i.strokeStyle="rgba(148, 163, 184, 0.18)",i.lineWidth=1,i.stroke(),i.textAlign="center",i.textBaseline="middle",i.fillStyle=t,i.fillText(s,n.width/2,n.height/2+1);const p=new Dd(n);p.needsUpdate=!0;const _=new rs({map:p,transparent:!0,opacity:0,depthTest:!1,sizeAttenuation:!0}),g=new ts(_);return g.scale.set(9,1.2,1),g}updatePositions(){this.group.children.forEach(e=>{if(e.userData.nodeId){const t=this.positions.get(e.userData.nodeId);if(!t)return;e.userData.isGlow?e.position.copy(t):e.userData.isLabel?(e.position.copy(t),e.position.y+=e.userData.offset):e instanceof yt&&e.position.copy(t)}})}animate(e,t,n,i=1){var a,o;for(let l=this.materializingNodes.length-1;l>=0;l--){const c=this.materializingNodes[l];c.frame++;const h=Math.min(c.frame/c.totalFrames,1),u=rd(h);if(c.mesh.scale.setScalar(Math.max(.001,u)),c.frame>=5){const f=Math.min((c.frame-5)/5,1),d=c.glow.material;d.opacity=f*.4;const p=c.targetScale*6*u;c.glow.scale.set(p,p,1)}if(c.frame>=40){const f=Math.min((c.frame-40)/20,1);c.label.material.opacity=f*.9}c.frame>=60&&this.materializingNodes.splice(l,1)}for(let l=this.dissolvingNodes.length-1;l>=0;l--){const c=this.dissolvingNodes[l];c.frame++;const h=Math.min(c.frame/c.totalFrames,1),u=1-cM(h),f=Math.max(.001,c.originalScale*u);c.mesh.scale.setScalar(f);const d=f*6;c.glow.scale.set(d,d,1);const p=c.mesh.material;p.opacity*=.97,c.glow.material.opacity*=.95,c.label.material.opacity*=.93,c.frame>=c.totalFrames&&(this.group.remove(c.mesh),this.group.remove(c.glow),this.group.remove(c.label),c.mesh.geometry.dispose(),c.mesh.material.dispose(),(a=c.glow.material.map)==null||a.dispose(),c.glow.material.dispose(),(o=c.label.material.map)==null||o.dispose(),c.label.material.dispose(),this.meshMap.delete(c.id),this.glowMap.delete(c.id),this.labelSprites.delete(c.id),this.positions.delete(c.id),this.dissolvingNodes.splice(l,1))}for(let l=this.growingNodes.length-1;l>=0;l--){const c=this.growingNodes[l];c.frame++;const h=Math.min(c.frame/c.totalFrames,1),u=c.startScale+(c.targetScale-c.startScale)*rd(h),f=this.meshMap.get(c.id);f&&f.scale.setScalar(u);const d=this.glowMap.get(c.id);if(d){const p=u*6;d.scale.set(p,p,1)}c.frame>=c.totalFrames&&this.growingNodes.splice(l,1)}const s=new Set([...this.materializingNodes.map(l=>l.id),...this.dissolvingNodes.map(l=>l.id),...this.growingNodes.map(l=>l.id)]);this.meshMap.forEach((l,c)=>{if(s.has(c))return;const h=t.find(y=>y.id===c);if(!h)return;const u=1+Math.sin(e*1.5+t.indexOf(h)*.5)*.15*h.retention;l.scale.setScalar(u);const f=this.positions.get(c),d=f?n.position.distanceTo(f):0,p=1+Math.min(1.4,Math.max(0,(d-60)/100)),_=l.material;if(c===this.hoveredNode)_.emissiveIntensity=1*i;else if(c===this.selectedNode)_.emissiveIntensity=.8*i;else{const v=.3+h.retention*.5+Math.sin(e*(.8+h.retention*.7))*.1*h.retention;_.emissiveIntensity=v*i*p}const g=.3+h.retention*.7;_.opacity=Math.min(1,g*i*p);const m=this.glowMap.get(c);if(m){const y=m.material,v=.3+h.retention*.35;y.opacity=Math.min(.95,v*i*p)}}),this.labelSprites.forEach((l,c)=>{if(s.has(c))return;const h=this.positions.get(c);if(!h)return;const u=n.position.distanceTo(h),f=l.material,d=c===this.hoveredNode||c===this.selectedNode?1:u<40?.9:u<80?.9*(1-(u-40)/40):0;f.opacity+=(d-f.opacity)*.1})}getMeshes(){return Array.from(this.meshMap.values())}dispose(){this.group.traverse(e=>{var t,n,i,s,a;e instanceof yt?((t=e.geometry)==null||t.dispose(),(n=e.material)==null||n.dispose()):e instanceof ts&&((s=(i=e.material)==null?void 0:i.map)==null||s.dispose(),(a=e.material)==null||a.dispose())}),this.materializingNodes=[],this.dissolvingNodes=[],this.growingNodes=[]}}function uM(r){return 1-Math.pow(1-r,3)}class dM{constructor(){ke(this,"group");ke(this,"growingEdges",[]);ke(this,"dissolvingEdges",[]);this.group=new ns}createEdges(e,t){for(const n of e){const i=t.get(n.source),s=t.get(n.target);if(!i||!s)continue;const a=[i,s],o=new qe().setFromPoints(a),l=new qt({color:9133302,transparent:!0,opacity:Math.min(.25+n.weight*.5,.8),blending:Wt,depthWrite:!1}),c=new Vn(o,l);c.userData={source:n.source,target:n.target},this.group.add(c)}}addEdge(e,t){const n=t.get(e.source),i=t.get(e.target);if(!n||!i)return;const s=[n.clone(),n.clone()],a=new qe().setFromPoints(s),o=new qt({color:9133302,transparent:!0,opacity:0,blending:Wt,depthWrite:!1}),l=new Vn(a,o);l.userData={source:e.source,target:e.target},this.group.add(l),this.growingEdges.push({line:l,source:e.source,target:e.target,frame:0,totalFrames:45})}removeEdgesForNode(e){const t=[];this.group.children.forEach(n=>{const i=n;(i.userData.source===e||i.userData.target===e)&&t.push(i)});for(const n of t)this.growingEdges=this.growingEdges.filter(i=>i.line!==n),this.dissolvingEdges.push({line:n,frame:0,totalFrames:40})}animateEdges(e){for(let t=this.growingEdges.length-1;t>=0;t--){const n=this.growingEdges[t];n.frame++;const i=uM(Math.min(n.frame/n.totalFrames,1)),s=e.get(n.source),a=e.get(n.target);if(!s||!a)continue;const o=s.clone().lerp(a,i),l=n.line.geometry.attributes.position;l.setXYZ(0,s.x,s.y,s.z),l.setXYZ(1,o.x,o.y,o.z),l.needsUpdate=!0;const c=n.line.material;c.opacity=i*.65,n.frame>=n.totalFrames&&(c.opacity=.65,this.growingEdges.splice(t,1))}for(let t=this.dissolvingEdges.length-1;t>=0;t--){const n=this.dissolvingEdges[t];n.frame++;const i=n.frame/n.totalFrames,s=n.line.material;s.opacity=Math.max(0,.65*(1-i)),n.frame>=n.totalFrames&&(this.group.remove(n.line),n.line.geometry.dispose(),n.line.material.dispose(),this.dissolvingEdges.splice(t,1))}}updatePositions(e){this.group.children.forEach(t=>{const n=t;if(this.growingEdges.some(a=>a.line===n)||this.dissolvingEdges.some(a=>a.line===n))return;const i=e.get(n.userData.source),s=e.get(n.userData.target);if(i&&s){const a=n.geometry.attributes.position;a.setXYZ(0,i.x,i.y,i.z),a.setXYZ(1,s.x,s.y,s.z),a.needsUpdate=!0}})}dispose(){this.group.children.forEach(e=>{var n,i;const t=e;(n=t.geometry)==null||n.dispose(),(i=t.material)==null||i.dispose()}),this.growingEdges=[],this.dissolvingEdges=[]}}class fM{constructor(e){ke(this,"starField");ke(this,"neuralParticles");this.starField=this.createStarField(),this.neuralParticles=this.createNeuralParticles(),e.add(this.starField),e.add(this.neuralParticles)}createStarField(){const t=new qe,n=new Float32Array(3e3*3),i=new Float32Array(3e3);for(let a=0;a<3e3;a++)n[a*3]=(Math.random()-.5)*1e3,n[a*3+1]=(Math.random()-.5)*1e3,n[a*3+2]=(Math.random()-.5)*1e3,i[a]=Math.random()*1.5;t.setAttribute("position",new rt(n,3)),t.setAttribute("size",new rt(i,1));const s=new Ai({color:6514417,size:.5,transparent:!0,opacity:.4,sizeAttenuation:!0,blending:Wt});return new as(t,s)}createNeuralParticles(){const t=new qe,n=new Float32Array(500*3),i=new Float32Array(500*3);for(let a=0;a<500;a++)n[a*3]=(Math.random()-.5)*100,n[a*3+1]=(Math.random()-.5)*100,n[a*3+2]=(Math.random()-.5)*100,i[a*3]=.4+Math.random()*.3,i[a*3+1]=.3+Math.random()*.2,i[a*3+2]=.8+Math.random()*.2;t.setAttribute("position",new rt(n,3)),t.setAttribute("color",new rt(i,3));const s=new Ai({size:.3,vertexColors:!0,transparent:!0,opacity:.4,blending:Wt,sizeAttenuation:!0});return new as(t,s)}animate(e){this.starField.rotation.y+=1e-4,this.starField.rotation.x+=5e-5;const t=this.neuralParticles.geometry.attributes.position;for(let n=0;n=0;i--){const s=this.pulseEffects[i];if(s.intensity-=s.decay,s.intensity<=0){this.pulseEffects.splice(i,1);continue}const a=e.get(s.nodeId);if(a){const o=a.material;o.emissive.lerp(s.color,s.intensity*.3),o.emissiveIntensity=Math.max(o.emissiveIntensity,s.intensity)}}for(let i=this.spawnBursts.length-1;i>=0;i--){const s=this.spawnBursts[i];if(s.age++,s.age>120){this.scene.remove(s.particles),s.particles.geometry.dispose(),s.particles.material.dispose(),this.spawnBursts.splice(i,1);continue}const a=s.particles.geometry.attributes.position,o=s.particles.geometry.attributes.velocity;for(let c=0;c=0;i--){const s=this.rainbowBursts[i];if(s.age++,s.age>s.maxAge){this.scene.remove(s.particles),s.particles.geometry.dispose(),s.particles.material.dispose(),this.rainbowBursts.splice(i,1);continue}const a=s.particles.geometry.attributes.position,o=s.particles.geometry.attributes.velocity;for(let f=0;f=0;i--){const s=this.rippleWaves[i];if(s.age++,s.radius+=s.speed,s.age>s.maxAge){this.rippleWaves.splice(i,1);continue}const a=s.radius,o=3;n.forEach((l,c)=>{if(s.pulsedNodes.has(c))return;const h=l.distanceTo(s.origin);h>=a-o&&h<=a+o&&(s.pulsedNodes.add(c),this.addPulse(c,.8,new ne(65489),.03))})}for(let i=this.implosions.length-1;i>=0;i--){const s=this.implosions[i];if(s.age++,s.age>s.maxAge+20){this.scene.remove(s.particles),s.particles.geometry.dispose(),s.particles.material.dispose(),s.flash&&(this.scene.remove(s.flash),s.flash.geometry.dispose(),s.flash.material.dispose()),this.implosions.splice(i,1);continue}if(s.age<=s.maxAge){const a=s.particles.geometry.attributes.position,o=s.particles.geometry.attributes.velocity,l=1+s.age*.02;for(let h=0;hs.maxAge){const a=(s.age-s.maxAge)/20;s.flash.material.opacity=Math.max(0,1-a),s.flash.scale.setScalar(1+a*3)}}for(let i=this.shockwaves.length-1;i>=0;i--){const s=this.shockwaves[i];if(s.age++,s.age>s.maxAge){this.scene.remove(s.mesh),s.mesh.geometry.dispose(),s.mesh.material.dispose(),this.shockwaves.splice(i,1);continue}const a=s.age/s.maxAge;s.mesh.scale.setScalar(1+a*20),s.mesh.material.opacity=.8*(1-a),s.mesh.lookAt(t.position)}for(let i=this.connectionFlashes.length-1;i>=0;i--){const s=this.connectionFlashes[i];if(s.intensity-=.015,s.intensity<=0){this.scene.remove(s.line),s.line.geometry.dispose(),s.line.material.dispose(),this.connectionFlashes.splice(i,1);continue}s.line.material.opacity=s.intensity}for(let i=this.birthOrbs.length-1;i>=0;i--){const s=this.birthOrbs[i];s.age++;const a=s.gestationFrames+s.flightFrames,o=s.sprite.material,l=s.core.material,c=s.getTargetPos();if(c)s.lastTargetPos.copy(c);else if(s.age>s.gestationFrames&&!s.aborted){s.aborted=!0;const h=s.sprite.position;o.color.setRGB(1,.15,.2),l.color.setRGB(1,.6,.6),this.createImplosion(h,new ne(16721203)),s.arriveFired=!0,s.age=a+1}if(s.age<=s.gestationFrames){const h=s.age/s.gestationFrames,u=1-Math.pow(1-h,3),f=.85+Math.sin(s.age*.35)*.15,d=.5+u*4.5*f,p=.2+u*1.8*f;s.sprite.scale.set(d,d,1),s.core.scale.set(p,p,1),o.opacity=u*.95,l.opacity=u,o.color.copy(s.color).multiplyScalar(.7+u*.3),s.sprite.position.copy(s.startPos),s.core.position.copy(s.startPos)}else if(s.age<=a){const h=(s.age-s.gestationFrames)/s.flightFrames,u=h<.5?2*h*h:1-Math.pow(-2*h+2,2)/2,f=s.startPos,d=s.lastTargetPos,p=d.x-f.x,_=d.y-f.y,g=d.z-f.z,m=Math.sqrt(p*p+_*_+g*g),y=(f.x+d.x)*.5,v=(f.y+d.y)*.5+30+m*.15,x=(f.z+d.z)*.5,w=1-u,T=w*w,C=2*w*u,P=u*u,S=T*f.x+C*y+P*d.x,M=T*f.y+C*v+P*d.y,D=T*f.z+C*x+P*d.z;s.sprite.position.set(S,M,D),s.core.position.set(S,M,D);const G=1-u*.35;s.sprite.scale.setScalar(5*G),s.core.scale.setScalar(2*G),o.opacity=.95,l.opacity=1,o.color.copy(s.color)}else if(s.arriveFired){const h=s.age-a,u=Math.max(0,1-h/8);o.opacity=.95*u,l.opacity=1*u,s.sprite.scale.setScalar(5*(1+(1-u)*2)),u<=0&&(this.scene.remove(s.sprite),this.scene.remove(s.core),o.dispose(),l.dispose(),this.birthOrbs.splice(i,1))}else{s.arriveFired=!0;try{s.onArrive()}catch(h){console.warn("[birth-orb] onArrive threw",h)}}}}dispose(){for(const e of this.spawnBursts)this.scene.remove(e.particles),e.particles.geometry.dispose(),e.particles.material.dispose();for(const e of this.rainbowBursts)this.scene.remove(e.particles),e.particles.geometry.dispose(),e.particles.material.dispose();for(const e of this.implosions)this.scene.remove(e.particles),e.particles.geometry.dispose(),e.particles.material.dispose(),e.flash&&(this.scene.remove(e.flash),e.flash.geometry.dispose(),e.flash.material.dispose());for(const e of this.shockwaves)this.scene.remove(e.mesh),e.mesh.geometry.dispose(),e.mesh.material.dispose();for(const e of this.connectionFlashes)this.scene.remove(e.line),e.line.geometry.dispose(),e.line.material.dispose();for(const e of this.birthOrbs)this.scene.remove(e.sprite),this.scene.remove(e.core),e.sprite.material.dispose(),e.core.material.dispose();this.pulseEffects=[],this.spawnBursts=[],this.rainbowBursts=[],this.rippleWaves=[],this.implosions=[],this.shockwaves=[],this.connectionFlashes=[],this.birthOrbs=[]}}const jn={bloomStrength:.8,rotateSpeed:.3,fogColor:328976,fogDensity:.008,nebulaIntensity:0,chromaticIntensity:.002,vignetteRadius:.9,breatheAmplitude:1},bi={bloomStrength:1.8,rotateSpeed:.08,fogColor:656672,fogDensity:.006,nebulaIntensity:1,chromaticIntensity:.005,vignetteRadius:.7,breatheAmplitude:2};class mM{constructor(){ke(this,"active",!1);ke(this,"transition",0);ke(this,"transitionSpeed",.008);ke(this,"current");ke(this,"auroraHue",0);this.current={...jn}}setActive(e){this.active=e}update(e,t,n,i,s){const a=this.active?1:0;this.transition+=(a-this.transition)*this.transitionSpeed*60*(1/60),this.transition=Math.max(0,Math.min(1,this.transition));const o=this.transition;this.current.bloomStrength=this.lerp(jn.bloomStrength,bi.bloomStrength,o),this.current.rotateSpeed=this.lerp(jn.rotateSpeed,bi.rotateSpeed,o),this.current.fogDensity=this.lerp(jn.fogDensity,bi.fogDensity,o),this.current.nebulaIntensity=this.lerp(jn.nebulaIntensity,bi.nebulaIntensity,o),this.current.chromaticIntensity=this.lerp(jn.chromaticIntensity,bi.chromaticIntensity,o),this.current.vignetteRadius=this.lerp(jn.vignetteRadius,bi.vignetteRadius,o),this.current.breatheAmplitude=this.lerp(jn.breatheAmplitude,bi.breatheAmplitude,o),t.strength=this.current.bloomStrength,n.autoRotateSpeed=this.current.rotateSpeed;const l=new ne(jn.fogColor),c=new ne(bi.fogColor),h=l.clone().lerp(c,o);if(e.fog=new Yr(h,this.current.fogDensity),o>.01){this.auroraHue=s*.1%1;const u=new ne().setHSL(.75+this.auroraHue*.15,.8,.5),f=new ne().setHSL(.55+this.auroraHue*.2,.7,.4);i.point1.color.lerp(u,o*.3),i.point2.color.lerp(f,o*.3)}else i.point1.color.set(6514417),i.point2.color.set(11032055)}lerp(e,t,n){return e+(t-e)*n}}const gM=50,Fr=[];function _M(r,e,t){const n=r.tags??[],i=r.type??"";let s=null,a=0;for(const o of e){let l=0;o.type===i&&(l+=2);for(const c of o.tags)n.includes(c)&&(l+=1);l>a&&(a=l,s=o.id)}if(s&&a>0){const o=t.get(s);if(o)return new A(o.x+(Math.random()-.5)*10,o.y+(Math.random()-.5)*10,o.z+(Math.random()-.5)*10)}return new A((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40)}function vM(r,e){if(Fr.length<=gM)return;const t=Fr.shift();r.edgeManager.removeEdgesForNode(t),r.nodeManager.removeNode(t),r.forceSim.removeNode(t),r.onMutation({type:"edgesRemoved",nodeId:t}),r.onMutation({type:"nodeRemoved",nodeId:t});const n=e.findIndex(i=>i.id===t);n!==-1&&e.splice(n,1)}function xM(r,e,t){var u,f;const{effects:n,nodeManager:i,edgeManager:s,forceSim:a,camera:o,onMutation:l}=e,c=i.positions,h=i.meshMap;switch(r.type){case"MemoryCreated":{const d=r.data;if(!d.id)break;const p={id:d.id,label:(d.content??"").slice(0,60),type:d.node_type??"fact",retention:Math.max(0,Math.min(1,d.retention??.9)),tags:d.tags??[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isCenter:!1},_=_M(p,t,c),g=i.addNode(p,_,{isBirthRitual:!0});a.addNode(d.id,g),Fr.push(d.id),vM(e,t);const m=new ne(Il[p.type]||"#00ffd1"),y=m.clone();y.offsetHSL(.15,0,0),n.createBirthOrb(o,m,()=>i.positions.get(p.id),()=>{i.igniteNode(p.id);const v=i.positions.get(p.id)??_,x=i.meshMap.get(p.id);x&&x.scale.multiplyScalar(1.8),n.createRainbowBurst(v,m),n.createShockwave(v,m,o),n.createShockwave(v,y,o),n.createRippleWave(v)}),l({type:"nodeAdded",node:p});break}case"ConnectionDiscovered":{const d=r.data;if(!d.source_id||!d.target_id)break;const p=c.get(d.source_id),_=c.get(d.target_id),g={source:d.source_id,target:d.target_id,weight:d.weight??.5,type:d.connection_type??"semantic"};s.addEdge(g,c),p&&_&&n.createConnectionFlash(p,_,new ne(54527)),d.source_id&&h.has(d.source_id)&&n.addPulse(d.source_id,1,new ne(54527),.02),d.target_id&&h.has(d.target_id)&&n.addPulse(d.target_id,1,new ne(54527),.02),l({type:"edgeAdded",edge:g});break}case"MemoryDeleted":{const d=r.data;if(!d.id)break;const p=c.get(d.id);if(p){const g=new ne(16729943);n.createImplosion(p,g)}s.removeEdgesForNode(d.id),i.removeNode(d.id),a.removeNode(d.id);const _=Fr.indexOf(d.id);_!==-1&&Fr.splice(_,1),l({type:"edgesRemoved",nodeId:d.id}),l({type:"nodeRemoved",nodeId:d.id});break}case"MemoryPromoted":{const d=r.data,p=d==null?void 0:d.id;if(!p)break;const _=d.new_retention??.95;if(h.has(p)){i.growNode(p,_),n.addPulse(p,1.2,new ne(65416),.01);const g=c.get(p);g&&(n.createShockwave(g,new ne(65416),o),n.createSpawnBurst(g,new ne(65416))),l({type:"nodeUpdated",nodeId:p,retention:_})}break}case"MemoryDemoted":{const d=r.data,p=d==null?void 0:d.id;if(!p)break;const _=d.new_retention??.3;h.has(p)&&(i.growNode(p,_),n.addPulse(p,.8,new ne(16729943),.03),l({type:"nodeUpdated",nodeId:p,retention:_}));break}case"MemoryUpdated":{const d=r.data,p=d==null?void 0:d.id;if(!p||!h.has(p))break;n.addPulse(p,.6,new ne(8490232),.02),d.retention!==void 0&&(i.growNode(p,d.retention),l({type:"nodeUpdated",nodeId:p,retention:d.retention}));break}case"SearchPerformed":{h.forEach((d,p)=>{n.addPulse(p,.6+Math.random()*.4,new ne(8490232),.02)});break}case"DreamStarted":{h.forEach((d,p)=>{n.addPulse(p,1,new ne(11032055),.005)});break}case"DreamProgress":{const d=(u=r.data)==null?void 0:u.memory_id;d&&h.has(d)&&n.addPulse(d,1.5,new ne(12616956),.01);break}case"DreamCompleted":{n.createSpawnBurst(new A(0,0,0),new ne(11032055)),n.createShockwave(new A(0,0,0),new ne(11032055),o);break}case"RetentionDecayed":{const d=(f=r.data)==null?void 0:f.id;d&&h.has(d)&&n.addPulse(d,.8,new ne(16729943),.03);break}case"ConsolidationCompleted":{h.forEach((d,p)=>{n.addPulse(p,.4+Math.random()*.3,new ne(16758784),.015)});break}case"ActivationSpread":{const d=r.data;if(d.source_id&&d.target_ids){const p=c.get(d.source_id);if(p)for(const _ of d.target_ids){const g=c.get(_);g&&n.createConnectionFlash(p,g,new ne(1370310))}}break}case"MemorySuppressed":{const d=r.data;if(!d.id)break;const p=c.get(d.id);if(p){n.createImplosion(p,new ne(11032055));const _=Math.max(1,d.suppression_count??1),g=Math.min(.4+_*.15,1);n.addPulse(d.id,g,new ne(11032055),.04)}break}case"MemoryUnsuppressed":{const d=r.data;if(!d.id)break;const p=c.get(d.id);p&&h.has(d.id)&&(n.createRainbowBurst(p,new ne(65416)),n.addPulse(d.id,1,new ne(65416),.02));break}case"Rac1CascadeSwept":{const p=r.data.neighbors_affected??0;if(p===0)break;const _=Array.from(h.keys()),g=Math.min(p,_.length,12);for(let m=0;m"u")return eo;const r=localStorage.getItem(hf);if(r===null)return eo;const e=Number(r);return Number.isFinite(e)?Math.min(Ec,Math.max(wc,e)):eo}const ji=IM();function IM(){let r=Qe(!1),e=Qe(Al(new Date)),t=Qe(!1),n=Qe(1),i=Qe(!1),s=Qe(Al(RM()));return{get temporalEnabled(){return L(r)},set temporalEnabled(a){le(r,a,!0)},get temporalDate(){return L(e)},set temporalDate(a){le(e,a,!0)},get temporalPlaying(){return L(t)},set temporalPlaying(a){le(t,a,!0)},get temporalSpeed(){return L(n)},set temporalSpeed(a){le(n,a,!0)},get dreamMode(){return L(i)},set dreamMode(a){le(i,a,!0)},get brightness(){return L(s)},set brightness(a){const o=Math.min(Ec,Math.max(wc,a));if(le(s,o,!0),typeof localStorage<"u")try{localStorage.setItem(hf,String(o))}catch{}},brightnessMin:wc,brightnessMax:Ec,brightnessDefault:eo}}var PM=ut('
');function DM(r,e){var G;sr(e,!0);let t=Dr(e,"events",19,()=>[]),n=Dr(e,"isDreaming",3,!1),i=Dr(e,"colorMode",3,"type");Ga(()=>{u==null||u.setColorMode(i())});let s,a,o,l=typeof window<"u"&&((G=window.matchMedia)==null?void 0:G.call(window,"(prefers-reduced-motion: reduce)").matches),c=null;function h(F){l=F.matches,a!=null&&a.controls&&(a.controls.autoRotate=!l)}let u,f,d,p,_,g,m,y,v=null,x=[];od(()=>{var J;a=tM(s),l&&(a.controls.autoRotate=!1),typeof window<"u"&&window.matchMedia&&(c=window.matchMedia("(prefers-reduced-motion: reduce)"),(J=c.addEventListener)==null||J.call(c,"change",h)),m=bM(a.scene).material,y=AM(a.composer),d=new fM(a.scene),u=new hM,u.colorMode=i(),f=new dM,p=new pM(a.scene),g=new mM;const V=u.createNodes(e.nodes);f.createEdges(e.edges,V),_=new sM(V),x=[...e.nodes],a.scene.add(f.group),a.scene.add(u.group),T(),window.addEventListener("resize",P),s.addEventListener("pointermove",S),s.addEventListener("click",M)}),Ac(()=>{var F;cancelAnimationFrame(o),window.removeEventListener("resize",P),(F=c==null?void 0:c.removeEventListener)==null||F.call(c,"change",h),s==null||s.removeEventListener("pointermove",S),s==null||s.removeEventListener("click",M),p==null||p.dispose(),d==null||d.dispose(),u==null||u.dispose(),f==null||f.dispose(),a&&iM(a)});let w=0;function T(){o=requestAnimationFrame(T);const F=performance.now();w===0&&(w=F);const V=F-w;if(V<16)return;w=F-V%16;const J=F*.001;_.tick(e.edges),u.updatePositions(),f.updatePositions(u.positions),f.animateEdges(u.positions),d.animate(J),u.animate(J,x,a.camera,ji.brightness),g.setActive(n()),g.update(a.scene,a.bloomPass,a.controls,a.lights,J),SM(m,J,g.current.nebulaIntensity,s.clientWidth,s.clientHeight),CM(y,J,g.current.nebulaIntensity),C(),p.update(u.meshMap,a.camera,u.positions),a.controls.update(),a.composer.render()}function C(){if(!t()||t().length===0)return;const F=[];for(const J of t()){if(J===v)break;F.push(J)}if(F.length===0)return;if(F.length===t().length&&t().length>=200){console.warn("[vestige] Event horizon overflow: dropping visuals for",F.length,"events"),v=t()[0];return}v=t()[0];const V={effects:p,nodeManager:u,edgeManager:f,forceSim:_,camera:a.camera,onMutation:J=>{var q;J.type==="nodeAdded"?x=[...x,J.node]:J.type==="nodeRemoved"&&(x=x.filter(se=>se.id!==J.nodeId)),(q=e.onGraphMutation)==null||q.call(e,J)}};for(let J=F.length-1;J>=0;J--)xM(F[J],V,x)}function P(){!s||!a||nM(a,s)}function S(F){const V=s.getBoundingClientRect();a.mouse.x=(F.clientX-V.left)/V.width*2-1,a.mouse.y=-((F.clientY-V.top)/V.height)*2+1,a.raycaster.setFromCamera(a.mouse,a.camera);const J=a.raycaster.intersectObjects(u.getMeshes());J.length>0?(u.hoveredNode=J[0].object.userData.nodeId,s.style.cursor="pointer"):(u.hoveredNode=null,s.style.cursor="grab")}function M(){var F;if(u.hoveredNode){u.selectedNode=u.hoveredNode,(F=e.onSelect)==null||F.call(e,u.hoveredNode);const V=u.positions.get(u.hoveredNode);V&&a.controls.target.lerp(V.clone(),.5)}}var D=PM();Rl(D,F=>s=F,()=>s),ot(r,D),rr()}var LM=ut('
'),UM=ut('
');function NM(r,e){sr(e,!0);let t=Dr(e,"width",3,240),n=Dr(e,"height",3,80);function i(g){return e.stability<=0?0:Math.exp(-g/e.stability)}let s=ei(()=>{const g=[],m=Math.max(e.stability*3,30),y=4,v=t()-y*2,x=n()-y*2;for(let w=0;w<=50;w++){const T=w/50*m,C=i(T),P=y+w/50*v,S=y+(1-C)*x;g.push(`${w===0?"M":"L"}${P.toFixed(1)},${S.toFixed(1)}`)}return g.join(" ")}),a=ei(()=>[{label:"Now",days:0,value:e.retention},{label:"1d",days:1,value:i(1)},{label:"7d",days:7,value:i(7)},{label:"30d",days:30,value:i(30)}]);function o(g){return g>.7?"#10b981":g>.4?"#f59e0b":"#ef4444"}var l=UM(),c=xe(l),h=xe(c),u=Ee(h),f=Ee(u),d=Ee(f),p=Ee(d);Or(),fe(c);var _=Ee(c,2);Pr(_,21,()=>L(a),Wa,(g,m)=>{var y=LM(),v=xe(y),x=xe(v);fe(v);var w=Ee(v,2),T=xe(w);fe(w),fe(y),Pt((C,P)=>{ct(x,`${L(m).label??""}:`),zr(w,`color: ${C??""}`),ct(T,`${P??""}%`)},[()=>o(L(m).value),()=>(L(m).value*100).toFixed(0)]),ot(g,y)}),fe(_),fe(l),Pt(g=>{Rt(c,"width",t()),Rt(c,"height",n()),Rt(c,"viewBox",`0 0 ${t()??""} ${n()??""}`),Rt(h,"y1",4+(n()-8)*.5),Rt(h,"x2",t()-4),Rt(h,"y2",4+(n()-8)*.5),Rt(u,"y1",4+(n()-8)*.8),Rt(u,"x2",t()-4),Rt(u,"y2",4+(n()-8)*.8),Rt(f,"d",L(s)),Rt(d,"d",`${L(s)??""} L${t()-4},${n()-4} L4,${n()-4} Z`),Rt(p,"cy",4+(1-e.retention)*(n()-8)),Rt(p,"fill",g)},[()=>o(e.retention)]),ot(r,l),rr()}function ad(r,e,t){const n=t.getTime(),i=new Set,s=new Map,a=r.filter(l=>{const c=new Date(l.createdAt).getTime();if(c<=n){i.add(l.id);const h=n-c,u=1440*60*1e3,f=hi.has(l.source)&&i.has(l.target));return{visibleNodes:a,visibleEdges:o,nodeOpacities:s}}function FM(r){if(r.length===0){const n=new Date;return{oldest:n,newest:n}}let e=1/0,t=-1/0;for(const n of r){const i=new Date(n.createdAt).getTime();it&&(t=i)}return{oldest:new Date(e),newest:new Date(t)}}var OM=ut(`
`),BM=ut('');function zM(r,e){sr(e,!0);let t=Qe(!1),n=Qe(!1),i=Qe(1),s=Qe(100),a,o=0,l=ei(()=>FM(e.nodes)),c=ei(()=>{const v=L(l).oldest.getTime(),w=L(l).newest.getTime()-v||1;return new Date(v+L(s)/100*w)});function h(v){return v.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function u(){le(t,!L(t)),e.onToggle(L(t)),L(t)&&(le(s,100),e.onDateChange(L(c)))}function f(){le(n,!L(n)),L(n)?(le(s,0),o=performance.now(),d()):cancelAnimationFrame(a)}function d(){L(n)&&(a=requestAnimationFrame(v=>{const x=(v-o)/1e3;o=v;const w=L(l).oldest.getTime(),C=(L(l).newest.getTime()-w)/(1440*60*1e3)||1,P=L(i)/C*100;if(le(s,Math.min(100,L(s)+P*x),!0),e.onDateChange(L(c)),L(s)>=100){le(n,!1);return}d()}))}function p(){e.onDateChange(L(c))}Ac(()=>{le(n,!1),cancelAnimationFrame(a)});var _=mf(),g=no(_);{var m=v=>{var x=OM(),w=xe(x),T=xe(w),C=xe(T),P=xe(C),S=xe(P,!0);fe(P);var M=Ee(P,2),D=xe(M);D.value=D.__value=1;var G=Ee(D);G.value=G.__value=7;var F=Ee(G);F.value=F.__value=30,fe(M),fe(C);var V=Ee(C,2),J=xe(V,!0);fe(V);var q=Ee(V,2);fe(T);var se=Ee(T,2);Br(se);var Z=Ee(se,2),_e=xe(Z),be=xe(_e,!0);fe(_e);var Re=Ee(_e,2),Ge=xe(Re,!0);fe(Re),fe(Z),fe(w),fe(x),Pt((it,Q,ue)=>{ct(S,L(n)?"⏸":"▶"),ct(J,it),ct(be,Q),ct(Ge,ue)},[()=>h(L(c)),()=>h(L(l).oldest),()=>h(L(l).newest)]),Ut("click",P,f),Mf(M,()=>L(i),it=>le(i,it)),Ut("click",q,u),Ut("input",se,p),Cl(se,()=>L(s),it=>le(s,it)),ot(v,x)},y=v=>{var x=BM();Ut("click",x,u),ot(v,x)};It(g,v=>{L(t)?v(m):v(y,!1)})}ot(r,_),rr()}Cc(["click","input"]);var kM=ut('
'),VM=ut('
FSRS accessibility
');function HM(r,e){sr(e,!1);const t=["active","dormant","silent","unavailable"];bf();var n=VM(),i=Ee(xe(n),2);Pr(i,1,()=>t,s=>s,(s,a)=>{var o=kM(),l=xe(o),c=Ee(l,2),h=xe(c,!0);fe(c);var u=Ee(c,2),f=xe(u,!0);fe(u),fe(o),Pt(d=>{zr(l,`background: ${bc[L(a)]??""}; box-shadow: 0 0 6px ${bc[L(a)]??""}55;`),ct(h,L(a)),ct(f,d)},[()=>{var d;return((d=aM[L(a)].match(/\(([^)]+)\)/))==null?void 0:d[1])??""}]),ot(s,o)}),fe(n),ot(r,n),rr()}function uf(r){var t,n;const e={};for(const i of r)(e[t=i.source]??(e[t]=[])).push({edge:i,otherId:i.target}),(e[n=i.target]??(e[n]=[])).push({edge:i,otherId:i.source});for(const i of Object.keys(e))e[i].sort((s,a)=>(a.edge.weight??0)-(s.edge.weight??0));return e}function to(r){const e=(r.type??"").toLowerCase();return e.includes("contradict")||e.includes("conflict")||e.includes("supersede")}function Ws(r){const e=Date.parse(r.updatedAt||r.createdAt||"");return Number.isFinite(e)?e:0}function GM(r,e,t,n=7){var g;const i=new Map(r.map(m=>[m.id,m])),s={beats:[],centerId:t,pivoted:!1,flowEdges:[]};if(r.length===0)return s;const a=uf(e),o=i.has(t);let l=o?t:"";l||(l=((g=r.find(m=>m.isCenter))==null?void 0:g.id)??""),l||(l=r.map(m=>{var y;return{id:m.id,deg:((y=a[m.id])==null?void 0:y.length)??0}}).sort((m,y)=>y.deg-m.deg)[0].id);const c=i.get(l);if(!c)return s;const h=!o,u=new Set([l]),f=[{nodeId:l,node:c,viaEdge:null,kind:"origin",intensity:1}],d=[];let p=l,_=!1;for(;f.length!u.has(x.otherId)&&to(x.edge)),y&&(_=!0)),y||(y=m.find(x=>!u.has(x.otherId))),!y){const x=r.filter(T=>!u.has(T.id)).sort((T,C)=>Ws(C)-Ws(T));if(x.length===0)break;const w=x[0];u.add(w.id),f.push({nodeId:w.id,node:w,viaEdge:null,kind:"bridge",intensity:.6}),p=w.id;continue}const v=i.get(y.otherId);if(!v){u.add(y.otherId);continue}u.add(v.id),d.push(y.edge),f.push({nodeId:v.id,node:v,viaEdge:y.edge,kind:to(y.edge)?"contradiction":"connection",intensity:to(y.edge)?1:Math.min(1,.55+(y.edge.weight??0)*.45)}),p=v.id}if(f.lengthv.id!==m).sort((v,x)=>Ws(x)-Ws(v))[0];y&&!f.some(v=>v.nodeId===y.id)&&f.push({nodeId:y.id,node:y,viaEdge:null,kind:"recent",intensity:.8})}return{beats:f,centerId:l,pivoted:h,flowEdges:d}}const jt=new A,WM=new A(0,1,0),XM=new A(0,0,0);class qM{constructor(e,t,n,i,s={},a={}){ke(this,"camera");ke(this,"target");ke(this,"positions");ke(this,"path");ke(this,"cb");ke(this,"opts");ke(this,"phase","idle");ke(this,"beatIndex",0);ke(this,"phaseElapsed",0);ke(this,"fromPos",new A);ke(this,"toPos",new A);ke(this,"fromTarget",new A);ke(this,"toTarget",new A);this.camera=e,this.target=t,this.positions=n,this.path=i,this.cb=s,this.opts={flightSeconds:a.flightSeconds??2.4,dwellSeconds:a.dwellSeconds??3.2,standoff:a.standoff??26,reducedMotion:a.reducedMotion??!1,shots:a.shots??[],centerOnOrigin:a.centerOnOrigin??!1}}shotAt(e){return this.opts.shots[e]??null}flightSecondsAt(e){var t;return((t=this.shotAt(e))==null?void 0:t.flightSeconds)??this.opts.flightSeconds}dwellSecondsAt(e){var t;return((t=this.shotAt(e))==null?void 0:t.dwellSeconds)??this.opts.dwellSeconds}get totalBeats(){return this.path.beats.length}get isRunning(){return this.phase!=="idle"&&this.phase!=="done"}start(){var e,t;if(this.path.beats.length===0){this.phase="done",(t=(e=this.cb).onComplete)==null||t.call(e);return}this.beatIndex=0,this.beginFlightTo(0)}stop(){this.phase="done"}focalPoint(e){return this.opts.centerOnOrigin?XM:this.positions.get(e.nodeId)??null}framePosition(e,t,n){const i=this.focalPoint(e);if(!i)return n.copy(this.camera.position);const s=this.shotAt(t);jt.copy(this.camera.position).sub(i),jt.lengthSq()<1e-4&&jt.set(0,.4,1),jt.normalize();let a=.35;s&&(s.angle==="low"?a=-.45:s.angle==="high"&&(a=.7)),jt.addScaledVector(WM,a).normalize();let o=(s==null?void 0:s.standoff)??this.opts.standoff;return s&&(s.move==="push_in"?o*=.7:s.move==="pull_back"?o*=1.5:s.move==="crane"&&(o*=1.8)),this.opts.centerOnOrigin&&(o=Math.max(31,Math.min(43,o))),n.copy(i).addScaledVector(jt,o)}beginFlightTo(e){var a,o;const t=this.path.beats[e],n=this.focalPoint(t),i=this.shotAt(e);this.fromPos.copy(this.camera.position),this.fromTarget.copy(this.target),this.framePosition(t,e,this.toPos),this.toTarget.copy(n??this.target),this.phaseElapsed=0,this.opts.reducedMotion||(i==null?void 0:i.cut)==="hard_cut"||(i==null?void 0:i.cut)==="match_cut"?(this.camera.position.copy(this.toPos),this.target.copy(this.toTarget),this.phase="dwelling",(o=(a=this.cb).onBeat)==null||o.call(a,t,e,i)):this.phase="flying"}update(e){var o,l,c,h,u,f,d,p,_;if(this.phase==="idle"||this.phase==="done")return;const t=Math.max(0,Math.min(e,.05));this.phaseElapsed+=t;const n=this.flightSecondsAt(this.beatIndex),i=this.dwellSecondsAt(this.beatIndex);if(this.phase==="flying"){const g=Math.min(1,this.phaseElapsed/n),m=YM(g);this.camera.position.lerpVectors(this.fromPos,this.toPos,m),this.target.lerpVectors(this.fromTarget,this.toTarget,m),this.applyDutch(this.beatIndex,m),g>=1&&(this.phase="dwelling",this.phaseElapsed=0,(l=(o=this.cb).onBeat)==null||l.call(o,this.path.beats[this.beatIndex],this.beatIndex,this.shotAt(this.beatIndex)))}else if(this.phase==="dwelling"){if(!this.opts.reducedMotion){const g=this.focalPoint(this.path.beats[this.beatIndex]);g&&(this.target.lerp(g,.02),((c=this.shotAt(this.beatIndex))==null?void 0:c.move)==="orbit"&&this.orbitAround(g,t*.35))}if(this.phaseElapsed>=i){const g=this.beatIndex+1;if(g>=this.path.beats.length){this.phase="done",(u=(h=this.cb).onProgress)==null||u.call(h,1),(d=(f=this.cb).onComplete)==null||d.call(f);return}this.beatIndex=g,this.beginFlightTo(g)}}const s=this.path.beats.length>0?1/this.path.beats.length:0,a=this.phase==="flying"?Math.min(1,this.phaseElapsed/n)*.5:.5+Math.min(1,this.phaseElapsed/i)*.5;(_=(p=this.cb).onProgress)==null||_.call(p,Math.min(1,this.beatIndex*s+a*s))}orbitAround(e,t){jt.copy(this.camera.position).sub(e);const n=Math.cos(t),i=Math.sin(t),s=jt.x*n-jt.z*i,a=jt.x*i+jt.z*n;jt.x=s,jt.z=a,this.camera.position.copy(e).add(jt)}applyDutch(e,t){var s;const i=(((s=this.shotAt(e))==null?void 0:s.dutch)??0)*t;jt.set(0,0,-1).applyQuaternion(this.camera.quaternion),this.camera.up.set(0,1,0).applyAxisAngle(jt,i)}}function YM(r){return r<.5?4*r*r*r:1-Math.pow(-2*r+2,3)/2}const Tc={origin:"Origin",connection:"Connection",contradiction:"Tension",recent:"Now",bridge:"Jump",surprise:"Surprise"};function ZM(r,e=90){const t=(r??"").replace(/\s+/g," ").trim();return t.length<=e?t:t.slice(0,e-1).trimEnd()+"…"}function Tl(r){const e=(r??"memory").toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}function df(r){return{source:"local-captions",beats:r.beats.map((t,n)=>{var o,l;const i=t.node,s=ZM(i.label||`(${Tl(i.type)} memory)`);let a;switch(t.kind){case"origin":a=`We begin at a ${Tl(i.type).toLowerCase()} the graph is centered on — "${s}".`;break;case"contradiction":{a=`This is held in tension with the last memory through ${(o=t.viaEdge)!=null&&o.type?t.viaEdge.type.replace(/_/g," "):"a conflict"}: "${s}".`;break}case"recent":a=`And where the mind is now — a recent memory: "${s}".`;break;case"bridge":a=`Crossing to a separate cluster — "${s}".`;break;default:{const c=((l=t.viaEdge)==null?void 0:l.weight)??0;a=`${c>.66?"strongly":c>.33?"closely":"loosely"} connected from there: a ${Tl(i.type).toLowerCase()} — "${s}".`}}return i.tags&&i.tags.length>0&&n>0&&(a+=` [${i.tags.slice(0,3).join(", ")}]`),{nodeId:t.nodeId,text:a,chip:Tc[t.kind]}})}}async function JM(r,e){const t=df(r);if(!e)return t;let n;try{const i=await Promise.race([e(),new Promise(l=>{n=setTimeout(()=>l(null),6e3)})]),s=Array.isArray(i)?i.filter(l=>!!l&&typeof l.nodeId=="string"&&typeof l.text=="string"&&l.text.trim().length>0):[];if(s.length===0)return t;const a=new Map(s.map(l=>[l.nodeId,l]));return{source:"backend-llm",beats:r.beats.map((l,c)=>{const h=a.get(l.nodeId);if(h){const u=typeof h.chip=="string"&&h.chip.trim()?h.chip:Tc[l.kind];return{nodeId:l.nodeId,text:h.text,chip:u}}return t.beats[c]??{nodeId:l.nodeId,text:l.node.label||"(unlabeled memory)",chip:Tc[l.kind]}})}}catch{return t}finally{n&&clearTimeout(n)}}function KM(r){const e=(r.type??"").toLowerCase();return e.includes("merge")||e.includes("supersede")||e.includes("duplicate")}function $M(r,e){const t=new Map;for(const n of r)t.set(n,0);for(const n of r){const i=[],s=new Map,a=new Map,o=new Map;for(const u of r)s.set(u,[]),a.set(u,0),o.set(u,-1);a.set(n,1),o.set(n,0);const l=[n];let c=0;for(;c0;){const u=i.pop();for(const f of s.get(u)??[]){const d=(a.get(f)??0)/(a.get(u)||1)*(1+(h.get(u)??0));h.set(f,(h.get(f)??0)+d)}u!==n&&t.set(u,(t.get(u)??0)+(h.get(u)??0))}}return t}function jM(r,e){const t=new Map;for(const l of r)t.set(l,l);const n=l=>{let c=l;for(;t.get(c)!==c;)c=t.get(c);let h=l;for(;t.get(h)!==c;){const u=t.get(h);t.set(h,c),h=u}return c},i=(l,c)=>{const h=n(l),u=n(c);h!==u&&t.set(h,u)};for(const l of e)t.has(l.source)&&t.has(l.target)&&i(l.source,l.target);const s=new Map,a=new Map;let o=0;for(const l of r){const c=n(l);s.has(c)||s.set(c,o++),a.set(l,s.get(c))}return{clusterOf:a,count:o}}function QM(r,e){var y;const t=r.map(v=>v.id),n=uf(e),i=[...r].sort((v,x)=>Ws(v)-Ws(x)),s=new Map;i.forEach((v,x)=>s.set(v.id,r.length>1?x/(r.length-1):1));const a=600;let o=t;t.length>a&&(o=[...t].sort((v,x)=>{var w,T;return(((w=n[x])==null?void 0:w.length)??0)-(((T=n[v])==null?void 0:T.length)??0)}).slice(0,a));const l=$M(o,n);let c=0;for(const v of l.values())c=Math.max(c,v);const{clusterOf:h,count:u}=jM(t,e),f=Math.max(1,...r.map(v=>v.suppression_count??0)),d=new Map;let p=t[0]??"",_=-1;for(const v of r){const x=c>0?(l.get(v.id)??0)/c:0;x>_&&(_=x,p=v.id),d.set(v.id,{nodeId:v.id,degree:((y=n[v.id])==null?void 0:y.length)??0,betweenness:x,clusterId:h.get(v.id)??0,recencyRank:s.get(v.id)??0,retention:Ha(v.retention??0),suppression:Ha((v.suppression_count??0)/f)})}const g=new Map;for(const v of t)g.set(v,new Set((n[v]??[]).map(x=>x.otherId)));const m=e.map(v=>{const x=g.get(v.source),w=g.get(v.target);let T=0;if(x&&w){const[M,D]=x.size{const h=t>1?c/(t-1):0,u=cb(h),f=e.nodes.get(l.nodeId),d=l.nodeId===e.peakBetweennessId,p=c===t-1,_=c===0;let g={nodeId:l.nodeId,move:"push_in",angle:"eye",cut:"fly",stormMode:"connection",tone:"curious",scoreCue:"motif",act:u,intensity:.6,tension:.3,why:"a connected memory"};return _&&(g={...g,move:"push_in",tone:"curious",tension:.25,stormMode:"anchor",why:"opening on the focal memory"}),(d||f&&f.betweenness>.6)&&(g={...g,move:"orbit",angle:"low",stormMode:"anchor",intensity:.75,tension:.45,tone:"awe",why:"low-angle orbit — the most load-bearing memory in the graph"}),l.kind==="contradiction"&&(g={...g,move:"push_in",angle:"eye",dutch:.28,cut:"hard_cut",stormMode:"contradiction",intensity:1,tension:.95,tone:"tense",scoreCue:"minor_drop",viaEdgeKey:l.viaEdge?`${l.viaEdge.source}->${l.viaEdge.target}`:void 0,why:"two memories in tension — a Dutch two-shot collision"}),l.kind==="surprise"&&(g={...g,move:"orbit",stormMode:"surprise",intensity:.85,tension:.6,tone:"awe",scoreCue:"motif",why:"a surprising, distant-but-plausible connection"}),f&&(f.retention<.35||f.suppression>.5)&&(g={...g,angle:"high",move:"pull_back",tone:"neutral",intensity:.4,why:"a fading memory — high-angle drift"}),l.kind==="recent"&&(g={...g,move:"push_in",tone:"resolved",tension:.4,why:"where the memory is now"}),p&&(g={...g,move:"crane",cut:"fly",stormMode:"anchor",tone:"awe",tension:.5,scoreCue:"major_resolve",why:"crane pull-back over the whole cluster — resolution"}),g}),i=r.beats.some(l=>l.kind==="contradiction")?"man_in_hole":"rags_to_riches";return{source:"deterministic",logline:`A short film about ${((o=r.beats[0])==null?void 0:o.node.label)??"a memory"} — ${t} shots through the graph${i==="man_in_hole"?", through a contradiction and out the other side":""}.`,arc:i,shots:n}}var ub=ut(''),db=ut(' '),fb=ut(' '),pb=ut('WebGPU'),mb=ut(' '),gb=ut(`
Director's plan

`),_b=ut('
'),vb=ut('

'),xb=ut('∞ dreaming'),yb=ut(''),Mb=ut('

',1),bb=ut(''),Sb=ut(' ',1);function wb(r,e){sr(e,!0);let t=Qe(!1),n=Qe("idle"),i=Qe(""),s=Qe(""),a=Qe(0),o=Qe(0),l=Qe(0),c=Qe(null),h=Qe(!1),u=Qe(!1),f=Qe(!1),d=Qe(!0),p=Qe(""),_=Qe(""),g=Qe("I"),m=Qe(0),y=Qe(""),v=Qe(null),x=Qe(void 0),w=null,T=null,C=null,P=null,S=0,M=0,D=null,G=0,F=Qe(null);const V=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=(k,X,W,ce)=>k+(X-k)*(1-Math.exp(-W*ce)),q={x:0,y:0},se={yaw:0,pitch:0};let Z=0,_e=0,be=0;const Re=2500,Ge=.35,it=.22,Q=()=>{be=performance.now()},ue=14;function Ie(k){const X=new Map,W=k.beats.length;for(let ce=0;ce1?ce/(W-1):.5)*2,Be=Math.sqrt(Math.max(0,1-ge*ge)),$=ce*2.399963;X.set(k.beats[ce].nodeId,new A(Math.cos($)*Be*ue,ge*ue*.5,Math.sin($)*Be*ue))}return X}function pe(k){if(!(!L(u)||typeof speechSynthesis>"u"))try{speechSynthesis.cancel();const X=new SpeechSynthesisUtterance(k);X.rate=.98,X.pitch=1,speechSynthesis.speak(X)}catch{}}function Oe(k){if(D&&clearInterval(D),le(i,""),V){le(i,k,!0);return}let X=0;D=setInterval(()=>{le(i,k.slice(0,++X),!0),X>=k.length&&D&&(clearInterval(D),D=null)},18)}function We(k){return k==="surprise"?"connection":k}function ze(k,X,W){var oe,ge;le(o,X+1);const ce=((oe=P==null?void 0:P.beats[X])==null?void 0:oe.text)??k.node.label??"";if(le(s,((ge=P==null?void 0:P.beats[X])==null?void 0:ge.chip)??"",!0),Oe(ce),pe(ce),W&&(le(_,W.why,!0),le(g,W.act,!0),le(m,W.tension,!0)),w&&L(h)){const Be=Je==null?void 0:Je.get(k.nodeId);if(Be){const ve=(W==null?void 0:W.stormMode)??"connection";w.transitionTo(We(ve),Be,(W==null?void 0:W.act)??"I",X)}const $=(W==null?void 0:W.tension)??0;w.setFlythrough(V?0:$*.8)}}let Je=null;async function te(){var ge,Be;if(cancelAnimationFrame(S),De(),D&&clearInterval(D),T==null||T.stop(),w==null||w.dispose(),w=null,T=null,P=null,G=0,le(_,""),le(y,""),le(v,null),le(g,"I"),le(m,0),le(t,!0),le(n,"planning"),le(p,"Planning a path through your memory…"),le(i,""),le(s,""),le(a,0),le(o,0),C=GM(e.nodes,e.edges,e.centerId,7),le(l,C.beats.length,!0),L(l)===0){le(p,"Not enough memory to compose a tour yet."),le(n,"done");return}Je=Ie(C);const k=QM(e.nodes,e.edges);le(v,hb(C,k),!0),le(y,L(v).logline,!0);const X=lb(L(v),C);if(le(g,((ge=X[0])==null?void 0:ge.act)??"I",!0),le(m,((Be=X[0])==null?void 0:Be.tension)??0,!0),P=await JM(C,L(f)?Ve():e.fetchBackendNarration),le(c,P.source,!0),le(h,!1),L(x))try{const{CinemaSandbox:$,isWebGPUSupported:ve}=await Sf(async()=>{const{CinemaSandbox:Y,isWebGPUSupported:ie}=await import("./Ma4NfFrG.js");return{CinemaSandbox:Y,isWebGPUSupported:ie}},__vite__mapDeps([0,1]),import.meta.url);ve()&&(w=new $(L(x)),await w.boot(),le(h,!0))}catch($){console.warn("[cinema] WebGPU sandbox unavailable, camera-only mode:",$),w=null,le(h,!1)}const W=L(x)&&L(x).clientHeight>0?L(x).clientWidth/L(x).clientHeight:16/9,ce=(w==null?void 0:w.cameraRef)??new kt(60,W,.1,2e3),oe=(w==null?void 0:w.target)??new A;T=new qM(ce,oe,Je,C,{onBeat:ze,onProgress:$=>le(a,$,!0),onComplete:()=>{le(n,"done"),le(p,V||!L(h)?"End of tour.":"∞ Dreaming — endless generative figures",!0),I()}},{reducedMotion:V,shots:X,centerOnOrigin:L(h)}),le(n,"playing"),le(p,L(h)?"Rendering 150k-particle semantic storm on WebGPU…":"Cinematic flythrough (captions mode).",!0),M=performance.now(),T.start(),de()}async function de(){const k=performance.now(),X=Math.max(0,Math.min(.05,(k-M)/1e3));M=k;try{T==null||T.update(X)}catch(ce){console.warn("[cinema] director error:",ce)}if(!V&&w&&L(h)){const ce=w.cameraRef,oe=performance.now()-be>Re,ge=oe?0:q.x*Ge,Be=oe?0:q.y*it,$=oe?1.5:9;se.yaw=J(se.yaw,ge,$,X),se.pitch=J(se.pitch,Be,$,X),oe&&(Z=J(Z,0,1.2,X)),_e=J(_e,Z,8,X);const ve=ce.position.clone(),Y=new xc().setFromVector3(ve);Y.theta+=se.yaw,Y.phi=bd.clamp(Y.phi+se.pitch,.2,Math.PI-.2),Y.radius*=1-_e*.35,ve.setFromSpherical(Y),ce.position.copy(ve)}const W=w;if(W&&L(h))try{await W.render(X),G=0}catch(ce){++G>=3&&w===W&&(console.warn("[cinema] WebGPU render failing, dropping to camera-only:",ce),le(h,!1),W.dispose(),w=null)}S=requestAnimationFrame(de)}function I(){V||!w||!L(h)||(De(),V||w==null||w.setFlythrough(.6),w==null||w.dreamBeat(),le(i,""),le(s,"Dreaming"),le(F,setInterval(()=>{if(!w||!L(h)){De();return}w.dreamBeat()},5500),!0))}function De(){L(F)&&(clearInterval(L(F)),le(F,null))}function re(){var k;cancelAnimationFrame(S),De(),D&&clearInterval(D),typeof speechSynthesis<"u"&&speechSynthesis.cancel(),w&&((k=w.setFlythrough)==null||k.call(w,0)),se.yaw=se.pitch=0,Z=_e=0,T==null||T.stop(),w==null||w.dispose(),w=null,T=null,le(t,!1),le(n,"idle"),le(h,!1)}let Ae=Qe(void 0);function me(k){k.key==="Escape"?(k.preventDefault(),re()):(k.key==="h"||k.key==="H")&&(k.preventDefault(),le(d,!L(d)))}Ga(()=>{L(t)&&L(Ae)&&L(Ae).focus()}),Ga(()=>{if(!(typeof document>"u"))return document.body.classList.toggle("cinema-open",L(t)),()=>document.body.classList.remove("cinema-open")}),Ga(()=>{if(!L(t)||V||!L(x))return;const k=L(x),X=($,ve,Y)=>Math.min(Y,Math.max(ve,$));k.style.touchAction="none";const W=$=>{q.x=$.clientX/window.innerWidth*2-1,q.y=-($.clientY/window.innerHeight)*2+1,Q()},ce=$=>{$.preventDefault(),Z=X(Z+$.deltaY*8e-4,-1,1),Q()};let oe=null;const ge=$=>{if($.touches.length===2){const ve=$.touches[0].clientX-$.touches[1].clientX,Y=$.touches[0].clientY-$.touches[1].clientY,ie=Math.hypot(ve,Y);oe!==null&&(Z=X(Z+(ie-oe)*.002,-1,1)),oe=ie,Q()}},Be=()=>{oe=null};return k.addEventListener("pointermove",W,{passive:!0}),k.addEventListener("wheel",ce,{passive:!1}),k.addEventListener("touchmove",ge,{passive:!0}),k.addEventListener("touchend",Be),()=>{k.removeEventListener("pointermove",W),k.removeEventListener("wheel",ce),k.removeEventListener("touchmove",ge),k.removeEventListener("touchend",Be)}});function Ve(){return async()=>{var k,X;if(!C)return null;try{le(p,"Loading on-device model (first run downloads weights)…");const ce=await import("@huggingface/transformers").catch(()=>null);if(!(ce!=null&&ce.pipeline))return null;const oe=await ce.pipeline("text-generation","onnx-community/Qwen2.5-0.5B-Instruct",{device:"webgpu",dtype:"q4"}),ge=df(C);le(p,"Narrating with the on-device model…");const Be=[];for(const $ of ge.beats){const ve=`You are narrating a cinematic tour of an AI's memory graph. In one vivid sentence, narrate this beat: "${$.text}"`,Y=await oe(ve,{max_new_tokens:48,temperature:.7,do_sample:!0}),ie=(X=(k=Y==null?void 0:Y[0])==null?void 0:k.generated_text)==null?void 0:X.replace(ve,"").trim();Be.push({nodeId:$.nodeId,chip:$.chip,text:ie&&ie.length>4?ie:$.text})}return Be}catch(W){return console.warn("[cinema] on-device narration failed, using local captions:",W),null}}}Ac(re);var Se=Sb(),R=no(Se),b=Ee(R,2);{var H=k=>{var X=bb(),W=xe(X);Rl(W,$=>le(x,$),()=>L(x));var ce=Ee(W,2);{var oe=$=>{var ve=ub();Ut("click",ve,()=>le(d,!0)),ot($,ve)};It(ce,$=>{L(d)||$(oe)})}var ge=Ee(ce,2);{var Be=$=>{var ve=Mb(),Y=no(ve),ie=xe(Y),ae=xe(ie);let Ne;var Pe=Ee(ae,2),Ke=xe(Pe,!0);fe(Pe);var U=Ee(Pe,2);{var ye=N=>{var z=db(),O=xe(z,!0);fe(z),Pt(()=>ct(O,L(v).source==="deterministic"?"Auteur (local)":"Auteur (AI)")),ot(N,z)};It(U,N=>{L(v)&&N(ye)})}var K=Ee(U,2);{var ee=N=>{var z=fb(),O=xe(z,!0);fe(z),Pt(()=>ct(O,L(c)==="backend-llm"?"AI narration":"Live captions")),ot(N,z)};It(K,N=>{L(c)&&N(ee)})}var we=Ee(K,2);{var Me=N=>{var z=pb();ot(N,z)};It(we,N=>{L(h)&&N(Me)})}var Ye=Ee(we,2);{var Mt=N=>{var z=mb(),O=xe(z);fe(z),Pt(()=>ct(O,`Act ${L(g)??""}`)),ot(N,z)};It(Ye,N=>{L(n)==="playing"&&N(Mt)})}fe(ie);var St=Ee(ie,2),at=xe(St),Yt=xe(at);Br(Yt),Or(),fe(at);var Ht=Ee(at,2),Di=xe(Ht);Br(Di),Or(),fe(Ht);var ui=Ee(Ht,2);Rl(ui,N=>le(Ae,N),()=>L(Ae)),fe(St),fe(Y);var En=Ee(Y,2);{var di=N=>{var z=gb(),O=Ee(xe(z),2),he=xe(O,!0);fe(O),fe(z),Pt(()=>ct(he,L(y))),ot(N,z)};It(En,N=>{L(n)==="planning"&&L(y)&&N(di)})}var Li=Ee(En,2),Wn=xe(Li);{var Xn=N=>{var z=_b(),O=xe(z,!0);fe(z),Pt(()=>ct(O,L(s))),ot(N,z)};It(Wn,N=>{L(s)&&N(Xn)})}var fi=Ee(Wn,2),Fn=xe(fi,!0);fe(fi);var Ui=Ee(fi,2);{var Zt=N=>{var z=vb(),O=xe(z);fe(z),Pt(()=>ct(O,`▸ ${L(_)??""}`)),ot(N,z)};It(Ui,N=>{L(_)&&L(n)==="playing"&&N(Zt)})}var Nt=Ee(Ui,2),mn=xe(Nt);fe(Nt);var Tn=Ee(Nt,2),pi=xe(Tn);{var fr=N=>{var z=xb();ot(N,z)},ds=N=>{var z=gf();Pt(()=>ct(z,`Beat ${L(o)??""} / ${L(l)??""}`)),ot(N,z)};It(pi,N=>{L(n)==="done"&&L(F)?N(fr):L(l)>0&&N(ds,1)})}var E=Ee(pi,2);{var B=N=>{var z=yb();Ut("click",z,te),ot(N,z)};It(E,N=>{L(n)==="done"&&N(B)})}fe(Tn),fe(Li),Pt(()=>{Ne=Ns(ae,1,"cinema-dot svelte-1uwqs3k",null,Ne,{active:L(n)==="playing"}),ct(Ke,L(p)),ct(Fn,L(i)),zr(mn,`width:${L(a)*100}%; --tension:${L(m)??""}`)}),ph(Yt,()=>L(u),N=>le(u,N)),ph(Di,()=>L(f),N=>le(f,N)),Ut("click",ui,re),ot($,ve)};It(ge,$=>{L(d)&&$(Be)})}fe(X),Ut("keydown",X,me),ot(k,X)};It(b,k=>{L(t)&&k(H)})}Ut("click",R,te),ot(r,Se),rr()}Cc(["click","keydown"]);var Eb=ut('

Weaving your memory graph…

'),Tb=ut(`

MCP Backend Offline

The Vestige MCP server isn't reachable on :3927. - The dashboard is running but has nothing to query.

Start the backend:
nohup bash -c 'tail -f /dev/null | VESTIGE_DASHBOARD_ENABLED=true ~/.local/bin/vestige-mcp' > /tmp/vestige.log 2>&1 & -disown
`),Ab=ut('

Your Mind Awaits

No memories yet — the moment Vestige starts remembering, your constellation will bloom here.

'),Cb=ut('

Your Mind Awaits

'),Rb=ut(' · · ',1),Ib=ut('
'),Pb=ut('
'),Db=ut('
AhaGraph
'),Lb=ut(' '),Ub=ut('
'),Nb=ut("
"),Fb=ut(`

Memory Detail

Retention Forecast
Explore Connections
`),Ob=ut(`
`);function Fw(r,e){sr(e,!0);const t=()=>yf(Ef,"$eventFeed",n),[n,i]=xf();let s=Qe(null),a=Qe(null),o=Qe(!0),l=Qe(""),c=Qe(!1),h=Qe(""),u=Qe(150);const f=[{value:"50",label:"50 nodes"},{value:"100",label:"100 nodes"},{value:"150",label:"150 nodes"},{value:"200",label:"200 nodes"}];let d=Qe("150");function p(Y){le(u,parseInt(Y,10),!0),S()}let _=Qe(!1),g=Qe(Al(new Date)),m=Qe("type");const y=Object.entries(Qa);let v=Qe(0),x=Qe(0),w=ei(()=>L(s)?L(_)?ad(L(s).nodes,L(s).edges,L(g)).visibleNodes:L(s).nodes:[]),T=ei(()=>L(s)?L(_)?ad(L(s).nodes,L(s).edges,L(g)).visibleEdges:L(s).edges:[]);function C(Y){if(L(s))switch(Y.type){case"nodeAdded":L(s).nodes=[...L(s).nodes,Y.node],L(s).nodeCount=L(s).nodes.length,le(v,L(s).nodeCount,!0);break;case"nodeRemoved":L(s).nodes=L(s).nodes.filter(ie=>ie.id!==Y.nodeId),L(s).nodeCount=L(s).nodes.length,le(v,L(s).nodeCount,!0);break;case"edgeAdded":L(s).edges=[...L(s).edges,Y.edge],L(s).edgeCount=L(s).edges.length,le(x,L(s).edgeCount,!0);break;case"edgesRemoved":L(s).edges=L(s).edges.filter(ie=>ie.source!==Y.nodeId&&ie.target!==Y.nodeId),L(s).edgeCount=L(s).edges.length,le(x,L(s).edgeCount,!0);break;case"nodeUpdated":{const ie=L(s).nodes.find(ae=>ae.id===Y.nodeId);ie&&(ie.retention=Y.retention);break}}}od(()=>{const Y=new URLSearchParams(window.location.search),ie=Y.get("colorMode");P(ie)&&le(m,ie,!0);const ae=Y.get("center");S(void 0,ae||void 0)});function P(Y){return Y==="type"||Y==="state"||Y==="ahagraph"}async function S(Y,ie){var ae;le(o,!0),le(l,"");try{const Ne=!Y&&!ie;if(le(s,await ms.graph({max_nodes:L(u),depth:3,query:Y||void 0,center_id:ie||void 0,sort:Ne?"recent":void 0}),!0),Ne&&L(s)&&L(s).nodeCount<=1&&L(s).edgeCount===0){const Pe=await ms.graph({max_nodes:L(u),depth:3,sort:"connected"});Pe&&Pe.nodeCount>L(s).nodeCount&&le(s,Pe,!0)}L(s)&&(le(v,L(s).nodeCount,!0),le(x,L(s).edgeCount,!0))}catch(Ne){const Pe=Ne instanceof Error?Ne.message:String(Ne),Ke=Pe.replace(/\/[\w./-]+\.(sqlite|rs|db|toml|lock)\b/g,"[path]").slice(0,200),U=Ne instanceof TypeError||/failed to fetch|NetworkError|load failed/i.test(Pe)||/^API 500:?\s*(Internal Server Error)?\s*$/i.test(Pe.trim()),ye=(((ae=L(s))==null?void 0:ae.nodeCount)??0)===0&&/not found|404|empty|no memor/i.test(Pe);U?le(l,"OFFLINE"):ye?le(l,"EMPTY"):le(l,`Failed to load graph: ${Ke}`)}finally{le(o,!1)}}async function M(){le(c,!0);try{await ms.dream(),await S()}catch{}finally{le(c,!1)}}async function D(Y){try{le(a,await ms.memories.get(Y),!0)}catch{le(a,null)}}function G(){L(h).trim()&&S(L(h))}var F=Ob(),V=xe(F);{var J=Y=>{var ie=Eb();ot(Y,ie)},q=Y=>{var ie=Tb(),ae=xe(ie),Ne=xe(ae),Pe=xe(Ne);ps(Pe,{name:"activation",size:52,strokeWidth:1.2}),fe(Ne);var Ke=Ee(Ne,8),U=xe(Ke),ye=Ee(U,2);fe(Ke),fe(ae),fe(ie),Pt(()=>Rt(ye,"href",`${mh??""}/settings`)),Ut("click",U,()=>S()),ot(Y,ie)},se=Y=>{var ie=Ab(),ae=xe(ie),Ne=xe(ae),Pe=xe(Ne);ps(Pe,{name:"graph",size:52,strokeWidth:1.2}),fe(Ne),Or(4),fe(ae),fe(ie),ot(Y,ie)},Z=Y=>{var ie=Cb(),ae=xe(ie),Ne=xe(ae),Pe=xe(Ne);ps(Pe,{name:"graph",size:52,strokeWidth:1.2}),fe(Ne);var Ke=Ee(Ne,4),U=xe(Ke,!0);fe(Ke),fe(ae),fe(ie),Pt(()=>ct(U,L(l))),ot(Y,ie)},_e=Y=>{DM(Y,{get nodes(){return L(w)},get edges(){return L(T)},get centerId(){return L(s).center_id},get events(){return t()},get isDreaming(){return L(c)},get colorMode(){return L(m)},onSelect:D,onGraphMutation:C})};It(V,Y=>{L(o)?Y(J):L(l)==="OFFLINE"?Y(q,1):L(l)==="EMPTY"?Y(se,2):L(l)?Y(Z,3):L(s)&&Y(_e,4)})}var be=Ee(V,2),Re=xe(be),Ge=xe(Re);Br(Ge);var it=Ee(Ge,2);fe(Re);var Q=Ee(Re,2),ue=xe(Q),Ie=xe(ue),pe=Ee(Ie,2),Oe=Ee(pe,2);fe(ue);var We=Ee(ue,2);wf(We,{get options(){return f},icon:"graph",class:"shrink-0",onChange:p,get value(){return L(d)},set value(Y){le(d,Y,!0)}});var ze=Ee(We,2),Je=Ee(xe(ze),2);Br(Je);var te=Ee(Je,2),de=xe(te);fe(te),fe(ze);var I=Ee(ze,2),De=xe(I),re=xe(De);ps(re,{name:"dreams",size:16}),fe(De);var Ae=Ee(De);fe(I);var me=Ee(I,2);{var Ve=Y=>{{let ie=ei(()=>{var ae;return((ae=L(s))==null?void 0:ae.center_id)??""});wb(Y,{get nodes(){return L(w)},get edges(){return L(T)},get centerId(){return L(ie)}})}};It(me,Y=>{L(w).length>0&&Y(Ve)})}var Se=Ee(me,2),R=xe(Se);ps(R,{name:"pulse",size:16}),fe(Se),fe(Q),fe(be);var b=Ee(be,2),H=xe(b);{var k=Y=>{var ie=Rb(),ae=no(ie),Ne=xe(ae);fe(ae);var Pe=Ee(ae,4),Ke=xe(Pe);fe(Pe);var U=Ee(Pe,4),ye=xe(U);fe(U),Pt(()=>{ct(Ne,`${L(v)??""} nodes`),ct(Ke,`${L(x)??""} edges`),ct(ye,`depth ${L(s).depth??""}`)}),ot(Y,ie)};It(H,Y=>{L(s)&&Y(k)})}fe(b);var X=Ee(b,2);{var W=Y=>{var ie=Ib(),ae=xe(ie);HM(ae,{}),fe(ie),ot(Y,ie)};It(X,Y=>{L(m)==="state"&&Y(W)})}var ce=Ee(X,2);{var oe=Y=>{var ie=Db(),ae=Ee(xe(ie),2);Pr(ae,21,()=>y,Wa,(Ne,Pe)=>{var Ke=ei(()=>_f(L(Pe),2));let U=()=>L(Ke)[0],ye=()=>L(Ke)[1];var K=Pb(),ee=xe(K),we=Ee(ee,2),Me=xe(we,!0);fe(we),fe(K),Pt(()=>{zr(ee,`background: ${ye()??""}`),ct(Me,oM[U()])}),ot(Ne,K)}),fe(ae),fe(ie),ot(Y,ie)};It(ce,Y=>{L(m)==="ahagraph"&&Y(oe)})}var ge=Ee(ce,2);{var Be=Y=>{zM(Y,{get nodes(){return L(s).nodes},onDateChange:ie=>{le(g,ie,!0)},onToggle:ie=>{le(_,ie,!0)}})};It(ge,Y=>{L(s)&&Y(Be)})}var $=Ee(ge,2);{var ve=Y=>{var ie=Fb(),ae=xe(ie),Ne=Ee(xe(ae),2);fe(ae);var Pe=Ee(ae,2),Ke=xe(Pe),U=xe(Ke),ye=xe(U,!0);fe(U);var K=Ee(U,2);Pr(K,17,()=>L(a).tags,Wa,(Zt,Nt)=>{var mn=Lb(),Tn=xe(mn,!0);fe(mn),Pt(()=>ct(Tn,L(Nt))),ot(Zt,mn)}),fe(Ke);var ee=Ee(Ke,2),we=xe(ee,!0);fe(ee);var Me=Ee(ee,2);Pr(Me,21,()=>[{label:"Retention",value:L(a).retentionStrength},{label:"Storage",value:L(a).storageStrength},{label:"Retrieval",value:L(a).retrievalStrength}],Wa,(Zt,Nt)=>{var mn=Ub(),Tn=xe(mn),pi=xe(Tn),fr=xe(pi,!0);fe(pi);var ds=Ee(pi,2),E=xe(ds);fe(ds),fe(Tn);var B=Ee(Tn,2),N=xe(B);fe(B),fe(mn),Pt(z=>{ct(fr,L(Nt).label),ct(E,`${z??""}%`),zr(N,`width: ${L(Nt).value*100}%; background: ${L(Nt).value>.7?"#10b981":L(Nt).value>.4?"#f59e0b":"#ef4444"}`)},[()=>(L(Nt).value*100).toFixed(1)]),ot(Zt,mn)}),fe(Me);var Ye=Ee(Me,2),Mt=Ee(xe(Ye),2);{let Zt=ei(()=>L(a).storageStrength*30);NM(Mt,{get retention(){return L(a).retentionStrength},get stability(){return L(Zt)}})}fe(Ye);var St=Ee(Ye,2),at=xe(St),Yt=xe(at);fe(at);var Ht=Ee(at,2),Di=xe(Ht);fe(Ht);var ui=Ee(Ht,2);{var En=Zt=>{var Nt=Nb(),mn=xe(Nt);fe(Nt),Pt(Tn=>ct(mn,`Accessed: ${Tn??""}`),[()=>new Date(L(a).lastAccessedAt).toLocaleString()]),ot(Zt,Nt)};It(ui,Zt=>{L(a).lastAccessedAt&&Zt(En)})}var di=Ee(ui,2),Li=xe(di);fe(di),fe(St);var Wn=Ee(St,2),Xn=xe(Wn),fi=Ee(Xn,2);fe(Wn);var Fn=Ee(Wn,2),Ui=xe(Fn);ps(Ui,{name:"explore",size:14}),Or(),fe(Fn),fe(Pe),fe(ie),Pt((Zt,Nt)=>{ct(ye,L(a).nodeType),ct(we,L(a).content),ct(Yt,`Created: ${Zt??""}`),ct(Di,`Updated: ${Nt??""}`),ct(Li,`Reviews: ${L(a).reviewCount??0??""}`),Rt(Fn,"href",`${mh??""}/explore`)},[()=>new Date(L(a).createdAt).toLocaleString(),()=>new Date(L(a).updatedAt).toLocaleString()]),Ut("click",Ne,()=>le(a,null)),Ut("click",Xn,()=>{L(a)&&ms.memories.promote(L(a).id)}),Ut("click",fi,()=>{L(a)&&ms.memories.demote(L(a).id)}),ot(Y,ie)};It($,Y=>{L(a)&&Y(ve)})}fe(F),Pt((Y,ie)=>{Rt(Ie,"aria-checked",L(m)==="type"),Ns(Ie,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${L(m)==="type"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),Rt(pe,"aria-checked",L(m)==="state"),Ns(pe,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${L(m)==="state"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),Rt(Oe,"aria-checked",L(m)==="ahagraph"),Ns(Oe,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${L(m)==="ahagraph"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),Rt(ze,"title",`Adjust graph brightness (${Y??""}x). Combines with auto distance compensation.`),Rt(Je,"min",ji.brightnessMin),Rt(Je,"max",ji.brightnessMax),ct(de,`${ie??""}x`),I.disabled=L(c),Ns(I,1,`shrink-0 inline-flex items-center gap-2 min-h-10 px-4 py-2 rounded-xl bg-dream/20 border border-dream/40 text-dream-glow text-sm - hover:bg-dream/30 transition-all backdrop-blur-sm disabled:opacity-50 - ${L(c)?"glow-dream animate-pulse-glow":""}`),Ns(De,1,vf(L(c)?"breathe":"")),ct(Ae,` ${L(c)?"Dreaming…":"Dream"}`)},[()=>ji.brightness.toFixed(1),()=>ji.brightness.toFixed(1)]),Ut("keydown",Ge,Y=>Y.key==="Enter"&&G()),Cl(Ge,()=>L(h),Y=>le(h,Y)),Ut("click",it,G),Ut("click",Ie,()=>le(m,"type")),Ut("click",pe,()=>le(m,"state")),Ut("click",Oe,()=>le(m,"ahagraph")),Cl(Je,()=>ji.brightness,Y=>ji.brightness=Y),Ut("click",I,M),Ut("click",Se,()=>S()),ot(r,F),rr(),i()}Cc(["click","keydown"]);export{cs as $,Wt as A,fn as B,ne as C,IS as D,ci as E,pt as F,ns as G,si as H,Pd as I,Pc as J,YS as K,rg as L,bd as M,ii as N,Rc as O,lr as P,wn as Q,zc as R,ho as S,Pi as T,Ii as U,A as V,uo as W,on as X,qs as Y,ch as Z,sw as _,tt as a,Nn as a$,op as a0,yt as a1,Lo as a2,kt as a3,or as a4,Et as a5,Ld as a6,Ti as a7,Qs as a8,Ze as a9,ld as aA,To as aB,Ci as aC,Bn as aD,Fs as aE,_c as aF,yg as aG,Mg as aH,Jd as aI,mg as aJ,Sg as aK,Jf as aL,Kf as aM,$f as aN,cd as aO,Qf as aP,ep as aQ,rS as aR,io as aS,so as aT,cr as aU,js as aV,Ys as aW,$s as aX,li as aY,Dp as aZ,ao as a_,wi as aa,Ic as ab,In as ac,cp as ad,Qn as ae,vd as af,$m as ag,rs as ah,rt as ai,JS as aj,Zf as ak,Yf as al,bo as am,wo as an,Mn as ao,tm as ap,Cd as aq,em as ar,qr as as,qe as at,dn as au,Fe as av,mt as aw,cS as ax,Si as ay,xn as az,j as b,Yl as b$,ro as b0,hd as b1,Qt as b2,dp as b3,up as b4,fp as b5,hp as b6,Md as b7,pp as b8,lp as b9,Ul as bA,Ll as bB,Dc as bC,Lc as bD,fd as bE,ud as bF,dd as bG,kr as bH,pd as bI,md as bJ,gd as bK,_d as bL,Uc as bM,So as bN,Nc as bO,Fc as bP,qa as bQ,Ya as bR,Za as bS,Ja as bT,kl as bU,Vl as bV,Hl as bW,Gl as bX,Wl as bY,Xl as bZ,ql as b_,Pf as ba,If as bb,Qi as bc,zf as bd,Vf as be,Dl as bf,Of as bg,Bf as bh,kf as bi,Hf as bj,Pl as bk,Ff as bl,Nf as bm,Uf as bn,Tf as bo,gh as bp,Af as bq,Rf as br,vh as bs,_h as bt,zl as bu,Bl as bv,Ol as bw,Fl as bx,Ks as by,Nl as bz,Wc as c,pn as c$,Zl as c0,Jl as c1,Kl as c2,$l as c3,jl as c4,Ql as c5,ec as c6,tc as c7,nc as c8,ic as c9,gs as cA,Lf as cB,Df as cC,Eo as cD,hS as cE,yd as cF,Vg as cG,yo as cH,QS as cI,dw as cJ,uw as cK,jS as cL,_m as cM,Ag as cN,Dw as cO,xh as cP,Rg as cQ,hw as cR,Kd as cS,lw as cT,aw as cU,Lw as cV,rp as cW,mm as cX,Id as cY,hr as cZ,xw as c_,sc as ca,rc as cb,ac as cc,Ka as cd,xd as ce,cc as cf,hc as cg,uc as ch,ai as ci,Td as cj,Ed as ck,CS as cl,AS as cm,RS as cn,ES as co,TS as cp,wS as cq,yh as cr,SS as cs,MS as ct,yS as cu,xS as cv,vS as cw,bS as cx,_S as cy,gS as cz,nr as d,Gn as d$,Iw as d0,Rw as d1,Eg as d2,Ei as d3,Hc as d4,Cw as d5,Dd as d6,Jc as d7,vm as d8,Kc as d9,Aw as dA,cg as dB,jc as dC,FS as dD,LS as dE,Rm as dF,Yc as dG,Qc as dH,Gc as dI,Yr as dJ,_w as dK,BS as dL,Mh as dM,Ew as dN,ww as dO,eh as dP,rw as dQ,Mo as dR,Op as dS,wg as dT,XS as dU,qS as dV,HS as dW,Po as dX,oo as dY,dc as dZ,Fo as d_,$d as da,Yd as db,KS as dc,$S as dd,qc as de,ew as df,$c as dg,Xf as dh,Gf as di,qg as dj,tw as dk,Ud as dl,Tm as dm,lg as dn,sS as dp,Hn as dq,Cm as dr,jf as ds,Zr as dt,vw as du,kc as dv,nw as dw,VS as dx,fg as dy,tp as dz,ht as e,Vs as e$,nm as e0,Ao as e1,Vc as e2,us as e3,Vn as e4,yw as e5,Nd as e6,Am as e7,gm as e8,hi as e9,cw as eA,ft as eB,Pg as eC,Fd as eD,Od as eE,rn as eF,Do as eG,hg as eH,ap as eI,pS as eJ,oc as eK,lc as eL,mS as eM,jm as eN,ar as eO,Wg as eP,fw as eQ,pw as eR,Io as eS,Xt as eT,Js as eU,th as eV,Uw as eW,oi as eX,Xc as eY,bw as eZ,sm as e_,qd as ea,lS as eb,co as ec,fu as ed,Zd as ee,np as ef,sp as eg,ip as eh,Xs as ei,Qd as ej,Hd as ek,Gd as el,oS as em,aS as en,Oc as eo,vo as ep,Ro as eq,qf as er,Wf as es,Cf as et,_o as eu,Pw as ev,Sw as ew,as as ex,Tw as ey,hs as ez,vt as f,an as f0,xc as f1,bg as f2,Bd as f3,Mw as f4,ts as f5,NS as f6,DS as f7,ow as f8,OS as f9,zs as fA,Fw as fB,PS as fa,US as fb,ur as fc,Os as fd,nh as fe,iw as ff,Nw as fg,ih as fh,sh as fi,yn as fj,fS as fk,dS as fl,uS as fm,rh as fn,GS as fo,WS as fp,jd as fq,mw as fr,xo as fs,ZS as ft,kS as fu,zS as fv,Sn as fw,Km as fx,lo as fy,Bs as fz,Ri as g,os as h,zn as i,_g as j,gw as k,Hr as l,Ai as m,qt as n,kn as o,ig as p,sg as q,ng as r,eg as s,Qm as t,ah as u,tg as v,Vt as w,Xa as x,Cr as y,ni as z}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js.br b/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js.br deleted file mode 100644 index 85b0c51..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js.gz b/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js.gz deleted file mode 100644 index fcd5c95..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C-SOZ1Oi.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js b/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js new file mode 100644 index 0000000..815a381 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js @@ -0,0 +1 @@ +const i="/api";async function t(e,o){const r=await fetch(`${i}${e}`,{headers:{"Content-Type":"application/json"},...o});if(!r.ok)throw new Error(`API ${r.status}: ${r.statusText}`);return r.json()}const n={memories:{list:e=>{const o=e?"?"+new URLSearchParams(e).toString():"";return t(`/memories${o}`)},get:e=>t(`/memories/${e}`),delete:e=>t(`/memories/${e}`,{method:"DELETE"}),promote:e=>t(`/memories/${e}/promote`,{method:"POST"}),demote:e=>t(`/memories/${e}/demote`,{method:"POST"}),suppress:(e,o)=>t(`/memories/${e}/suppress`,{method:"POST",body:o?JSON.stringify({reason:o}):void 0}),unsuppress:e=>t(`/memories/${e}/unsuppress`,{method:"POST"})},search:(e,o=20)=>t(`/search?q=${encodeURIComponent(e)}&limit=${o}`),stats:()=>t("/stats"),health:()=>t("/health"),timeline:(e=7,o=200)=>t(`/timeline?days=${e}&limit=${o}`),graph:e=>{const o=e?"?"+new URLSearchParams(Object.entries(e).filter(([,r])=>r!==void 0).map(([r,s])=>[r,String(s)])).toString():"";return t(`/graph${o}`)},dream:()=>t("/dream",{method:"POST"}),explore:(e,o="associations",r,s=10)=>t("/explore",{method:"POST",body:JSON.stringify({from_id:e,action:o,to_id:r,limit:s})}),predict:()=>t("/predict",{method:"POST"}),importance:e=>t("/importance",{method:"POST",body:JSON.stringify({content:e})}),consolidate:()=>t("/consolidate",{method:"POST"}),retentionDistribution:()=>t("/retention-distribution"),duplicates:(e=.8,o=20)=>t(`/duplicates?threshold=${e}&limit=${o}`),contradictions:e=>{const o=e?"?"+new URLSearchParams(Object.entries(e).filter(([,r])=>r!==void 0).map(([r,s])=>[r,String(s)])).toString():"";return t(`/contradictions${o}`)},crossProjectPatterns:()=>t("/patterns/cross-project"),memoryAudit:(e,o=100)=>t(`/memories/${encodeURIComponent(e)}/audit?limit=${o}`),intentions:(e="active")=>t(`/intentions?status=${e}`),deepReference:(e,o=20)=>t("/deep_reference",{method:"POST",body:JSON.stringify({query:e,depth:o})}),sanhedrin:{latest:()=>t("/sanhedrin/latest"),telemetry:(e=7)=>t(`/sanhedrin/telemetry?days=${e}`),appeal:(e,o,r,s)=>t("/sanhedrin/appeal",{method:"POST",body:JSON.stringify({reason:e,note:o,claimId:r,receiptId:s})})},traces:{list:(e=50)=>t(`/traces?limit=${e}`),get:e=>t(`/traces/${encodeURIComponent(e)}`),exportUrl:e=>`${i}/traces/${encodeURIComponent(e)}/export`},receipts:{list:(e=50)=>t(`/receipts?limit=${e}`),listForRun:(e,o=50)=>t(`/receipts?run=${encodeURIComponent(e)}&limit=${o}`),get:e=>t(`/receipts/${encodeURIComponent(e)}`)},memoryPrs:{list:(e,o=100)=>{const r=new URLSearchParams;return e&&r.set("status",e),r.set("limit",String(o)),t(`/memory-prs?${r.toString()}`)},get:e=>t(`/memory-prs/${encodeURIComponent(e)}`),act:(e,o)=>t(`/memory-prs/${encodeURIComponent(e)}/${o}`,{method:"POST"}),getMode:()=>t("/memory-prs/mode"),setMode:e=>t("/memory-prs/mode",{method:"POST",body:JSON.stringify({mode:e})})}};export{n as a}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js.br b/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js.br new file mode 100644 index 0000000..1592539 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js.gz b/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js.gz new file mode 100644 index 0000000..a52c0f7 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C-rZhKee.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js b/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js similarity index 87% rename from apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js rename to apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js index 1f1e177..4c42605 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js +++ b/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js @@ -1 +1 @@ -import{v as s,w as v,x as o,y as c,z as b,A as m,B as h,C as y}from"./wpu9U-D0.js";function _(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{_(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function p(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var d=e.querySelector(l)??e.querySelector("option:not([disabled])");n=d&&i(d)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(_(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{p as b}; +import{y as s,z as v,A as o,B as c,C as b,D as m,F as h,G as y}from"./CW7md74C.js";function _(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{_(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function p(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var d=e.querySelector(l)??e.querySelector("option:not([disabled])");n=d&&i(d)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(_(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{p as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js.br b/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js.br new file mode 100644 index 0000000..922e450 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js.gz b/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js.gz new file mode 100644 index 0000000..092add3 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C4Tpoo1i.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js.br b/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js.br deleted file mode 100644 index cb81051..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js.gz b/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js.gz deleted file mode 100644 index cc5255b..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js b/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js new file mode 100644 index 0000000..78aebc4 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js @@ -0,0 +1 @@ +import{H as y,q as u,I as _,J as o,v as t,K as g,L as i,M as l,N as d,O as p,P as v}from"./CW7md74C.js";function C(n,r){let s=null,E=t;var a;if(t){s=p;for(var e=v(document.head);e!==null&&(e.nodeType!==g||e.data!==n);)e=i(e);if(e===null)l(!1);else{var f=i(e);e.remove(),d(f)}}t||(a=document.head.appendChild(y()));try{u(()=>r(a),_|o)}finally{E&&(l(!0),d(s))}}export{C as h}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js.br b/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js.br new file mode 100644 index 0000000..1b9234a Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js.gz b/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js.gz new file mode 100644 index 0000000..da9afa6 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C98jjAli.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js b/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js similarity index 71% rename from apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js rename to apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js index 5a1ac32..7642dae 100644 --- a/apps/dashboard/build/_app/immutable/chunks/BLadwbF7.js +++ b/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js @@ -1 +1 @@ -import{a2 as g,a3 as d,o as c,P as m,a4 as i,a5 as b,g as p,a6 as v,a7 as h,a8 as k}from"./wpu9U-D0.js";function x(t=!1){const a=g,e=a.l.u;if(!e)return;let f=()=>v(a.s);if(t){let n=0,s={};const _=h(()=>{let l=!1;const r=a.s;for(const o in r)r[o]!==s[o]&&(s[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&d(()=>{u(a,f),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,f),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}k();export{x as i}; +import{a3 as g,a4 as d,x as c,R as m,a5 as i,a6 as b,g as p,a7 as v,a8 as h,a9 as k}from"./CW7md74C.js";function y(t=!1){const a=g,e=a.l.u;if(!e)return;let f=()=>v(a.s);if(t){let n=0,s={};const _=h(()=>{let l=!1;const r=a.s;for(const o in r)r[o]!==s[o]&&(s[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&d(()=>{u(a,f),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,f),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}k();export{y as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js.br b/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js.br new file mode 100644 index 0000000..7e76a9b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js.gz b/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js.gz new file mode 100644 index 0000000..9dc69de Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/C9BpaXFO.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js b/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js similarity index 70% rename from apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js rename to apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js index cbdf8cb..c265975 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js +++ b/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js @@ -1 +1 @@ -import{v as k,w as f,O as m,P as t,Q as _,G as b,C as i}from"./wpu9U-D0.js";function E(e,a,v=a){var c=new WeakSet;k(e,"input",async r=>{var l=r?e.defaultValue:e.value;if(l=o(e)?u(l):l,v(l),f!==null&&c.add(f),await m(),l!==(l=a())){var h=e.selectionStart,d=e.selectionEnd,n=e.value.length;if(e.value=l??"",d!==null){var s=e.value.length;h===d&&d===n&&s>n?(e.selectionStart=s,e.selectionEnd=s):(e.selectionStart=h,e.selectionEnd=Math.min(d,s))}}}),(b&&e.defaultValue!==e.value||t(a)==null&&e.value)&&(v(o(e)?u(e.value):e.value),f!==null&&c.add(f)),_(()=>{var r=a();if(e===document.activeElement){var l=i??f;if(c.has(l))return}o(e)&&r===u(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function S(e,a,v=a){k(e,"change",c=>{var r=c?e.defaultChecked:e.checked;v(r)}),(b&&e.defaultChecked!==e.checked||t(a)==null)&&v(e.checked),_(()=>{var c=a();e.checked=!!c})}function o(e){var a=e.type;return a==="number"||a==="range"}function u(e){return e===""?null:+e}export{S as a,E as b}; +import{y as k,z as f,Q as m,R as t,S as _,v as b,G as y}from"./CW7md74C.js";function S(e,a,v=a){var c=new WeakSet;k(e,"input",async r=>{var l=r?e.defaultValue:e.value;if(l=o(e)?u(l):l,v(l),f!==null&&c.add(f),await m(),l!==(l=a())){var h=e.selectionStart,d=e.selectionEnd,n=e.value.length;if(e.value=l??"",d!==null){var s=e.value.length;h===d&&d===n&&s>n?(e.selectionStart=s,e.selectionEnd=s):(e.selectionStart=h,e.selectionEnd=Math.min(d,s))}}}),(b&&e.defaultValue!==e.value||t(a)==null&&e.value)&&(v(o(e)?u(e.value):e.value),f!==null&&c.add(f)),_(()=>{var r=a();if(e===document.activeElement){var l=y??f;if(c.has(l))return}o(e)&&r===u(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function E(e,a,v=a){k(e,"change",c=>{var r=c?e.defaultChecked:e.checked;v(r)}),(b&&e.defaultChecked!==e.checked||t(a)==null)&&v(e.checked),_(()=>{var c=a();e.checked=!!c})}function o(e){var a=e.type;return a==="number"||a==="range"}function u(e){return e===""?null:+e}export{E as a,S as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js.br b/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js.br new file mode 100644 index 0000000..5f0f809 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js.gz b/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js.gz new file mode 100644 index 0000000..cf50c77 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CFefTDKL.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js.br b/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js.br deleted file mode 100644 index cba39ff..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js.gz b/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js.gz deleted file mode 100644 index 16ed5a1..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js b/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js similarity index 96% rename from apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js rename to apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js index ba54390..949d484 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CLrXVRi2.js +++ b/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js @@ -1 +1 @@ -import{TempNode as O,NodeUpdateType as D,RendererUtils as F,QuadMesh as L,NodeMaterial as f}from"./CfobEeQC.js";import{nodeObject as P,uniform as g,texture as c,passTexture as W,Fn as B,luminance as j,smoothstep as q,mix as H,vec4 as m,uniformArray as M,float as b,uv as E,Loop as Q,int as U,add as X}from"./BZQzXWp7.js";import{R as N,H as w,b as x,V as _}from"./C-SOZ1Oi.js";const p=new L,Y=new x,G=new x(1,0),I=new x(0,1);let z;class J extends O{static get type(){return"BloomNode"}constructor(r,t=1,i=0,s=0){super("vec4"),this.inputNode=r,this.strength=g(t),this.radius=g(i),this.threshold=g(s),this.smoothWidth=g(.01),this._renderTargetsHorizontal=[],this._renderTargetsVertical=[],this._nMips=5,this._renderTargetBright=new N(1,1,{depthBuffer:!1,type:w}),this._renderTargetBright.texture.name="UnrealBloomPass.bright",this._renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e{const a=this.inputNode,l=j(a.rgb),d=q(this.threshold,this.threshold.add(this.smoothWidth),l);return H(m(0),a,d)});this._highPassFilterMaterial=this._highPassFilterMaterial||new f,this._highPassFilterMaterial.fragmentNode=t().context(r.getSharedContext()),this._highPassFilterMaterial.name="Bloom_highPass",this._highPassFilterMaterial.needsUpdate=!0;const i=[3,5,7,9,11];for(let a=0;a{const d=b(1.2).sub(a);return H(a,d,l)}).setLayout({name:"lerpBloomFactor",type:"float",inputs:[{name:"factor",type:"float"},{name:"radius",type:"float"}]}),u=B(()=>{const a=o(s.element(0),this.radius).mul(m(e.element(0),1)).mul(this._textureNodeBlur0),l=o(s.element(1),this.radius).mul(m(e.element(1),1)).mul(this._textureNodeBlur1),d=o(s.element(2),this.radius).mul(m(e.element(2),1)).mul(this._textureNodeBlur2),h=o(s.element(3),this.radius).mul(m(e.element(3),1)).mul(this._textureNodeBlur3),n=o(s.element(4),this.radius).mul(m(e.element(4),1)).mul(this._textureNodeBlur4);return a.add(l).add(d).add(h).add(n).mul(this.strength)});return this._compositeMaterial=this._compositeMaterial||new f,this._compositeMaterial.fragmentNode=u().context(r.getSharedContext()),this._compositeMaterial.name="Bloom_comp",this._compositeMaterial.needsUpdate=!0,this._textureOutput}dispose(){for(let r=0;rs.sample(n),d=B(()=>{const n=e.element(0).toVar(),T=l(a).rgb.mul(n).toVar();return Q({start:U(1),end:U(t),type:"int",condition:"<"},({i:V})=>{const R=b(V),v=e.element(V),y=u.mul(o).mul(R),A=l(a.add(y)).rgb,C=l(a.sub(y)).rgb;T.addAssign(X(A,C).mul(v)),n.addAssign(b(2).mul(v))}),m(T.div(n),1)}),h=new f;return h.fragmentNode=d().context(r.getSharedContext()),h.name="Bloom_separable",h.needsUpdate=!0,h.colorTexture=s,h.direction=u,h.invSize=o,h}}const k=(S,r,t,i)=>P(new J(P(S),r,t,i));export{k as bloom,J as default}; +import{TempNode as O,NodeUpdateType as D,RendererUtils as F,QuadMesh as L,NodeMaterial as f}from"./DD4_gMN2.js";import{nodeObject as P,uniform as g,texture as c,passTexture as W,Fn as B,luminance as j,smoothstep as q,mix as H,vec4 as m,uniformArray as M,float as b,uv as E,Loop as Q,int as U,add as X}from"./CjKwt1b1.js";import{R as N,H as w,b as x,V as _}from"./DSmtfx7F.js";const p=new L,Y=new x,G=new x(1,0),I=new x(0,1);let z;class J extends O{static get type(){return"BloomNode"}constructor(r,t=1,i=0,s=0){super("vec4"),this.inputNode=r,this.strength=g(t),this.radius=g(i),this.threshold=g(s),this.smoothWidth=g(.01),this._renderTargetsHorizontal=[],this._renderTargetsVertical=[],this._nMips=5,this._renderTargetBright=new N(1,1,{depthBuffer:!1,type:w}),this._renderTargetBright.texture.name="UnrealBloomPass.bright",this._renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e{const a=this.inputNode,l=j(a.rgb),d=q(this.threshold,this.threshold.add(this.smoothWidth),l);return H(m(0),a,d)});this._highPassFilterMaterial=this._highPassFilterMaterial||new f,this._highPassFilterMaterial.fragmentNode=t().context(r.getSharedContext()),this._highPassFilterMaterial.name="Bloom_highPass",this._highPassFilterMaterial.needsUpdate=!0;const i=[3,5,7,9,11];for(let a=0;a{const d=b(1.2).sub(a);return H(a,d,l)}).setLayout({name:"lerpBloomFactor",type:"float",inputs:[{name:"factor",type:"float"},{name:"radius",type:"float"}]}),u=B(()=>{const a=o(s.element(0),this.radius).mul(m(e.element(0),1)).mul(this._textureNodeBlur0),l=o(s.element(1),this.radius).mul(m(e.element(1),1)).mul(this._textureNodeBlur1),d=o(s.element(2),this.radius).mul(m(e.element(2),1)).mul(this._textureNodeBlur2),h=o(s.element(3),this.radius).mul(m(e.element(3),1)).mul(this._textureNodeBlur3),n=o(s.element(4),this.radius).mul(m(e.element(4),1)).mul(this._textureNodeBlur4);return a.add(l).add(d).add(h).add(n).mul(this.strength)});return this._compositeMaterial=this._compositeMaterial||new f,this._compositeMaterial.fragmentNode=u().context(r.getSharedContext()),this._compositeMaterial.name="Bloom_comp",this._compositeMaterial.needsUpdate=!0,this._textureOutput}dispose(){for(let r=0;rs.sample(n),d=B(()=>{const n=e.element(0).toVar(),T=l(a).rgb.mul(n).toVar();return Q({start:U(1),end:U(t),type:"int",condition:"<"},({i:V})=>{const R=b(V),v=e.element(V),y=u.mul(o).mul(R),A=l(a.add(y)).rgb,C=l(a.sub(y)).rgb;T.addAssign(X(A,C).mul(v)),n.addAssign(b(2).mul(v))}),m(T.div(n),1)}),h=new f;return h.fragmentNode=d().context(r.getSharedContext()),h.name="Bloom_separable",h.needsUpdate=!0,h.colorTexture=s,h.direction=u,h.invSize=o,h}}const k=(S,r,t,i)=>P(new J(P(S),r,t,i));export{k as bloom,J as default}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js.br b/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js.br new file mode 100644 index 0000000..7e3ee74 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js.gz b/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js.gz new file mode 100644 index 0000000..9af9ba6 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CRPZuD1T.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js b/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js similarity index 95% rename from apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js rename to apps/dashboard/build/_app/immutable/chunks/CW7md74C.js index b5a27f7..18268b8 100644 --- a/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js +++ b/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js @@ -1 +1 @@ -var wn=Object.defineProperty;var mt=e=>{throw TypeError(e)};var yn=(e,t,n)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ye=(e,t,n)=>yn(e,typeof t!="symbol"?t+"":t,n),We=(e,t,n)=>t.has(e)||mt("Cannot "+n);var p=(e,t,n)=>(We(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?mt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(We(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(We(e,t,"access private method"),n);var mn=Array.isArray,En=Array.prototype.indexOf,Ae=Array.prototype.includes,yr=Array.from,mr=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,Tn=Object.prototype,bn=Array.prototype,Ct=Object.getPrototypeOf,Et=Object.isExtensible;const An=()=>{};function Er(e){return e()}function Sn(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function gr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,Pe=4,Me=8,Pt=1<<24,K=16,U=32,we=64,Rn=128,P=512,g=1024,R=2048,V=4096,Y=8192,Q=16384,ne=32768,Ve=65536,gt=1<<17,Mt=1<<18,Fe=1<<19,Ft=1<<20,Tr=1<<25,_e=65536,Je=1<<21,it=1<<22,ee=1<<23,ue=Symbol("$state"),br=Symbol("legacy props"),Ar=Symbol(""),fe=new class extends Error{constructor(){super(...arguments);ye(this,"name","StaleReactionError");ye(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var kt;const Rr=!!((kt=globalThis.document)!=null&&kt.contentType)&&globalThis.document.contentType.includes("xml"),Le=3,Lt=8;function Nn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Nr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function On(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function xn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function kn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Dn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Or(){throw new Error("https://svelte.dev/e/hydration_failed")}function xr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Cn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function In(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Pn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function kr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Dr=1,Cr=2,Ir=4,Pr=8,Mr=16,Fr=1,Lr=2,jr=4,Hr=8,Yr=16,jt=1,Mn=2,Fn="[",Ln="[!",qr="[?",jn="]",lt={},T=Symbol(),Hn="http://www.w3.org/1999/xhtml",Vr="http://www.w3.org/2000/svg",Ur="http://www.w3.org/1998/Math/MathML";function ot(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Br(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Gr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let D=!1;function $r(e){D=e}let y;function ve(e){if(e===null)throw ot(),lt;return y=e}function Yn(){return ve(se(y))}function zr(e){if(D){if(se(y)!==null)throw ot(),lt;y=e}}function Kr(e=1){if(D){for(var t=e,n=y;t--;)n=se(n);y=n}}function Wr(e=!0){for(var t=0,n=y;;){if(n.nodeType===Lt){var r=n.data;if(r===jn){if(t===0)return n;t-=1}else(r===Fn||r===Ln||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=se(n);e&&n.remove(),n=s}}function Xr(e){if(!e||e.nodeType!==Lt)throw ot(),lt;return e.data}function Ht(e){return e===this.v}function qn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Yt(e){return!qn(e,this.v)}let Ge=!1;function Zr(){Ge=!0}let S=null;function Ue(e){S=e}function Jr(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:Ge&&!t?{s:null,u:null,$:[]}:null}}function Qr(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)rn(r)}return t.i=!0,S=t.p,{}}function je(){return!Ge||S!==null&&S.l===null}let ae=[];function qt(){var e=ae;ae=[],Sn(e)}function Tt(e){if(ae.length===0&&!ke){var t=ae;queueMicrotask(()=>{t===ae&&qt()})}ae.push(e)}function Vn(){for(;ae.length>0;)qt()}function Un(e){var t=h;if(t===null)return _.f|=ee,e;if((t.f&ne)===0&&(t.f&Pe)===0)throw e;Be(e,t)}function Be(e,t){for(;t!==null;){if((t.f&Rn)!==0){if((t.f&ne)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Bn=-7169;function E(e,t){e.f=e.f&Bn|t}function ut(e){(e.f&P)!==0||e.deps===null?E(e,g):E(e,V)}function Vt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&_e)===0||(t.f^=_e,Vt(t.deps))}function Gn(e,t,n){(e.f&R)!==0?t.add(e):(e.f&V)!==0&&n.add(e),Vt(e.deps),E(e,g)}const Ye=new Set;let d=null,bt=null,b=null,O=[],$e=null,Qe=!1,ke=!1;var Ee,ge,le,Te,Ce,Ie,oe,$,be,C,et,tt,nt,Ut;const ht=class ht{constructor(){F(this,C);ye(this,"current",new Map);ye(this,"previous",new Map);F(this,Ee,new Set);F(this,ge,new Set);F(this,le,0);F(this,Te,0);F(this,Ce,null);F(this,Ie,new Set);F(this,oe,new Set);F(this,$,new Map);ye(this,"is_fork",!1);F(this,be,!1)}skip_effect(t){p(this,$).has(t)||p(this,$).set(t,{d:[],m:[]})}unskip_effect(t){var n=p(this,$).get(t);if(n){p(this,$).delete(t);for(var r of n.d)E(r,R),z(r);for(r of n.m)E(r,V),z(r)}}process(t){var s;O=[],this.apply();var n=[],r=[];for(const f of t)X(this,C,tt).call(this,f,n,r);if(X(this,C,et).call(this)){X(this,C,nt).call(this,r),X(this,C,nt).call(this,n);for(const[f,i]of p(this,$))zt(f,i)}else{for(const f of p(this,Ee))f();p(this,Ee).clear(),p(this,le)===0&&X(this,C,Ut).call(this),bt=this,d=null,At(r),At(n),bt=null,(s=p(this,Ce))==null||s.resolve()}b=null}capture(t,n){n!==T&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&ee)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){d=this,this.apply()}deactivate(){d===this&&(d=null,b=null)}flush(){if(this.activate(),O.length>0){if(Bt(),d!==null&&d!==this)return}else p(this,le)===0&&this.process([]);this.deactivate()}discard(){for(const t of p(this,ge))t(this);p(this,ge).clear()}increment(t){W(this,le,p(this,le)+1),t&&W(this,Te,p(this,Te)+1)}decrement(t){W(this,le,p(this,le)-1),t&&W(this,Te,p(this,Te)-1),!p(this,be)&&(W(this,be,!0),Tt(()=>{W(this,be,!1),X(this,C,et).call(this)?O.length>0&&this.flush():this.revive()}))}revive(){for(const t of p(this,Ie))p(this,oe).delete(t),E(t,R),z(t);for(const t of p(this,oe))E(t,V),z(t);this.flush()}oncommit(t){p(this,Ee).add(t)}ondiscard(t){p(this,ge).add(t)}settled(){return(p(this,Ce)??W(this,Ce,It())).promise}static ensure(){if(d===null){const t=d=new ht;Ye.add(d),ke||Tt(()=>{d===t&&t.flush()})}return d}apply(){}};Ee=new WeakMap,ge=new WeakMap,le=new WeakMap,Te=new WeakMap,Ce=new WeakMap,Ie=new WeakMap,oe=new WeakMap,$=new WeakMap,be=new WeakMap,C=new WeakSet,et=function(){return this.is_fork||p(this,Te)>0},tt=function(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var f=s.f,i=(f&(U|we))!==0,o=i&&(f&g)!==0,a=o||(f&Y)!==0||p(this,$).has(s);if(!a&&s.fn!==null){i?s.f^=g:(f&Pe)!==0?n.push(s):He(s)&&((f&K)!==0&&p(this,oe).add(s),Ne(s));var l=s.first;if(l!==null){s=l;continue}}for(;s!==null;){var c=s.next;if(c!==null){s=c;break}s=s.parent}}},nt=function(t){for(var n=0;n1){this.previous.clear();var t=b,n=!0;for(const f of Ye){if(f===this){n=!1;continue}const i=[];for(const[a,l]of this.current){if(f.current.has(a))if(n&&l!==f.current.get(a))f.current.set(a,l);else continue;i.push(a)}if(i.length===0)continue;const o=[...f.current.keys()].filter(a=>!this.current.has(a));if(o.length>0){var r=O;O=[];const a=new Set,l=new Map;for(const c of i)Gt(c,o,a,l);if(O.length>0){d=f,f.apply();for(const c of O)X(s=f,C,tt).call(s,c,[],[]);f.deactivate()}O=r}}d=null,b=t}Ye.delete(this)};let Se=ht;function $n(e){var t=ke;ke=!0;try{for(var n;;){if(Vn(),O.length===0&&(d==null||d.flush(),O.length===0))return $e=null,n;Bt()}}finally{ke=t}}function Bt(){Qe=!0;var e=null;try{for(var t=0;O.length>0;){var n=Se.ensure();if(t++>1e3){var r,s;zn()}n.process(O),te.clear()}}finally{O=[],Qe=!1,$e=null}}function zn(){try{Dn()}catch(e){Be(e,$e)}}let L=null;function At(e){var t=e.length;if(t!==0){for(var n=0;n0)){te.clear();for(const s of L){if((s.f&(Q|Y))!==0)continue;const f=[s];let i=s.parent;for(;i!==null;)L.has(i)&&(L.delete(i),f.push(i)),i=i.parent;for(let o=f.length-1;o>=0;o--){const a=f[o];(a.f&(Q|Y))===0&&Ne(a)}}L.clear()}}L=null}}function Gt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?Gt(s,t,n,r):(f&(it|K))!==0&&(f&R)===0&&$t(s,t,r)&&(E(s,R),z(s))}}function $t(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Ae.call(t,s))return!0;if((s.f&A)!==0&&$t(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function z(e){var t=$e=e,n=t.b;if(n!=null&&n.is_pending&&(e.f&(Pe|Me|Pt))!==0&&(e.f&ne)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Qe&&t===h&&(r&K)!==0&&(r&Mt)===0&&(r&ne)!==0)return;if((r&(we|U))!==0){if((r&g)===0)return;t.f^=g}}O.push(t)}function zt(e,t){if(!((e.f&U)!==0&&(e.f&g)!==0)){(e.f&R)!==0?t.d.push(e):(e.f&V)!==0&&t.m.push(e),E(e,g);for(var n=e.first;n!==null;)zt(n,t),n=n.next}}function Kn(e,t,n,r){const s=je()?ct:Jn;var f=e.filter(u=>!u.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var i=h,o=Wn(),a=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(u=>u.promise)):null;function l(u){o();try{r(u)}catch(v){(i.f&Q)===0&&Be(v,i)}rt()}if(n.length===0){a.then(()=>l(t.map(s)));return}function c(){o(),Promise.all(n.map(u=>Zn(u))).then(u=>l([...t.map(s),...u])).catch(u=>Be(u,i))}a?a.then(c):c()}function Wn(){var e=h,t=_,n=S,r=d;return function(f=!0){Re(e),re(t),Ue(n),f&&(r==null||r.activate())}}function rt(e=!0){Re(null),re(null),Ue(null),e&&(d==null||d.deactivate())}function Xn(){var e=h.b,t=d,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function ct(e){var t=A|R,n=_!==null&&(_.f&A)!==0?_:null;return h!==null&&(h.f|=Fe),{ctx:S,deps:null,effects:null,equals:Ht,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??h,ac:null}}function Zn(e,t,n){h===null&&Nn();var s=void 0,f=vt(T),i=!_,o=new Map;return or(()=>{var v;var a=It();s=a.promise;try{Promise.resolve(e()).then(a.resolve,a.reject).finally(rt)}catch(m){a.reject(m),rt()}var l=d;if(i){var c=Xn();(v=o.get(l))==null||v.reject(fe),o.delete(l),o.set(l,a)}const u=(m,w=void 0)=>{if(l.activate(),w)w!==fe&&(f.f|=ee,ft(f,w));else{(f.f&ee)!==0&&(f.f^=ee),ft(f,m);for(const[G,N]of o){if(o.delete(G),G===l)break;N.reject(fe)}}c&&c()};a.promise.then(u,m=>u(null,m||"unknown"))}),lr(()=>{for(const a of o.values())a.reject(fe)}),new Promise(a=>{function l(c){function u(){c===s?a(f):l(s)}c.then(u,u)}l(s)})}function es(e){const t=ct(e);return on(t),t}function Jn(e){const t=ct(e);return t.equals=Yt,t}function Qn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!Xt&&nr()}return t}function nr(){Xt=!1;for(const e of st)(e.f&g)!==0&&E(e,V),He(e)&&Ne(e);st.clear()}function ns(e,t=1){var n=me(e),r=t===1?n++:n--;return J(e,n),r}function Xe(e){J(e,e.v+1)}function Zt(e,t){var n=e.reactions;if(n!==null)for(var r=je(),s=n.length,f=0;f{if(ce===f)return o();var a=_,l=ce;re(null),xt(f);var c=o();return re(a),xt(l),c};return r&&n.set("length",Z(e.length)),new Proxy(e,{defineProperty(o,a,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&Cn();var c=n.get(a);return c===void 0?i(()=>{var u=Z(l.value);return n.set(a,u),u}):J(c,l.value,!0),!0},deleteProperty(o,a){var l=n.get(a);if(l===void 0){if(a in o){const c=i(()=>Z(T));n.set(a,c),Xe(s)}}else J(l,T),Xe(s);return!0},get(o,a,l){var m;if(a===ue)return e;var c=n.get(a),u=a in o;if(c===void 0&&(!u||(m=xe(o,a))!=null&&m.writable)&&(c=i(()=>{var w=Oe(u?o[a]:T),G=Z(w);return G}),n.set(a,c)),c!==void 0){var v=me(c);return v===T?void 0:v}return Reflect.get(o,a,l)},getOwnPropertyDescriptor(o,a){var l=Reflect.getOwnPropertyDescriptor(o,a);if(l&&"value"in l){var c=n.get(a);c&&(l.value=me(c))}else if(l===void 0){var u=n.get(a),v=u==null?void 0:u.v;if(u!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return l},has(o,a){var v;if(a===ue)return!0;var l=n.get(a),c=l!==void 0&&l.v!==T||Reflect.has(o,a);if(l!==void 0||h!==null&&(!c||(v=xe(o,a))!=null&&v.writable)){l===void 0&&(l=i(()=>{var m=c?Oe(o[a]):T,w=Z(m);return w}),n.set(a,l));var u=me(l);if(u===T)return!1}return c},set(o,a,l,c){var yt;var u=n.get(a),v=a in o;if(r&&a==="length")for(var m=l;mZ(T)),n.set(m+"",w))}if(u===void 0)(!v||(yt=xe(o,a))!=null&&yt.writable)&&(u=i(()=>Z(void 0)),J(u,Oe(l)),n.set(a,u));else{v=u.v!==T;var G=i(()=>Oe(l));J(u,G)}var N=Reflect.getOwnPropertyDescriptor(o,a);if(N!=null&&N.set&&N.set.call(c,l),!v){if(r&&typeof a=="string"){var wt=n.get("length"),Ke=Number(a);Number.isInteger(Ke)&&Ke>=wt.v&&J(wt,Ke+1)}Xe(s)}return!0},ownKeys(o){me(s);var a=Reflect.ownKeys(o).filter(u=>{var v=n.get(u);return v===void 0||v.v!==T});for(var[l,c]of n)c.v!==T&&!(l in o)&&a.push(l);return a},setPrototypeOf(){In()}})}function St(e){try{if(e!==null&&typeof e=="object"&&ue in e)return e[ue]}catch{}return e}function rs(e,t){return Object.is(St(e),St(t))}var Rt,rr,Jt,Qt,en;function ss(){if(Rt===void 0){Rt=window,rr=document,Jt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Qt=xe(t,"firstChild").get,en=xe(t,"nextSibling").get,Et(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Et(n)&&(n.__t=void 0)}}function de(e=""){return document.createTextNode(e)}function j(e){return Qt.call(e)}function se(e){return en.call(e)}function fs(e,t){if(!D)return j(e);var n=j(y);if(n===null)n=y.appendChild(de());else if(t&&n.nodeType!==Le){var r=de();return n==null||n.before(r),ve(r),r}return t&&ze(n),ve(n),n}function as(e,t=!1){if(!D){var n=j(e);return n instanceof Comment&&n.data===""?se(n):n}if(t){if((y==null?void 0:y.nodeType)!==Le){var r=de();return y==null||y.before(r),ve(r),r}ze(y)}return y}function is(e,t=1,n=!1){let r=D?y:e;for(var s;t--;)s=r,r=se(r);if(!D)return r;if(n){if((r==null?void 0:r.nodeType)!==Le){var f=de();return r===null?s==null||s.after(f):r.before(f),ve(f),f}ze(r)}return ve(r),r}function sr(e){e.textContent=""}function ls(){return!1}function fr(e,t,n){return document.createElementNS(t??Hn,e,void 0)}function ze(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Le;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function os(e){D&&j(e)!==null&&sr(e)}let Nt=!1;function ar(){Nt||(Nt=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function dt(e){var t=_,n=h;re(null),Re(null);try{return e()}finally{re(t),Re(n)}}function us(e,t,n,r=n){e.addEventListener(t,()=>dt(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),ar()}function tn(e){h===null&&(_===null&&kn(),xn()),he&&On()}function ir(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function B(e,t,n){var r=h;r!==null&&(r.f&Y)!==0&&(e|=Y);var s={ctx:S,deps:null,nodes:null,f:e|R|P,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Ne(s)}catch(o){throw pe(s),o}else t!==null&&z(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Fe)===0&&(f=f.first,(e&K)!==0&&(e&Ve)!==0&&f!==null&&(f.f|=Ve)),f!==null&&(f.parent=r,r!==null&&ir(f,r),_!==null&&(_.f&A)!==0&&(e&we)===0)){var i=_;(i.effects??(i.effects=[])).push(f)}return s}function nn(){return _!==null&&!H}function lr(e){const t=B(Me,null,!1);return E(t,g),t.teardown=e,t}function cs(e){tn();var t=h.f,n=!_&&(t&U)!==0&&(t&ne)===0;if(n){var r=S;(r.e??(r.e=[])).push(e)}else return rn(e)}function rn(e){return B(Pe|Ft,e,!1)}function _s(e){return tn(),B(Me|Ft,e,!0)}function vs(e){Se.ensure();const t=B(we|Fe,e,!0);return(n={})=>new Promise(r=>{n.outro?_r(t,()=>{pe(t),r(void 0)}):(pe(t),r(void 0))})}function ds(e){return B(Pe,e,!1)}function or(e){return B(it|Fe,e,!0)}function ps(e,t=0){return B(Me|t,e,!0)}function hs(e,t=[],n=[],r=[]){Kn(r,t,n,s=>{B(Me,()=>e(...s.map(me)),!0)})}function ws(e,t=0){var n=B(K|t,e,!0);return n}function ys(e){return B(U|Fe,e,!0)}function sn(e){var t=e.teardown;if(t!==null){const n=he,r=_;Ot(!0),re(null);try{t.call(null)}finally{Ot(n),re(r)}}}function pt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&dt(()=>{s.abort(fe)});var r=n.next;(n.f&we)!==0?n.parent=null:pe(n,t),n=r}}function ur(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&U)===0&&pe(t),t=n}}function pe(e,t=!0){var n=!1;(t||(e.f&Mt)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(cr(e.nodes.start,e.nodes.end),n=!0),pt(e,t&&!n),De(e,0),E(e,Q);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();sn(e);var s=e.parent;s!==null&&s.first!==null&&fn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function cr(e,t){for(;e!==null;){var n=e===t?null:se(e);e.remove(),e=n}}function fn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function _r(e,t,n=!0){var r=[];an(e,r,!0);var s=()=>{n&&pe(e),t&&t()},f=r.length;if(f>0){var i=()=>--f||s();for(var o of r)o.out(i)}else s()}function an(e,t,n){if((e.f&Y)===0){e.f^=Y;var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&t.push(o);for(var s=e.first;s!==null;){var f=s.next,i=(s.f&Ve)!==0||(s.f&U)!==0&&(e.f&K)!==0;an(s,t,i?n:!1),s=f}}}function ms(e){ln(e,!0)}function ln(e,t){if((e.f&Y)!==0){e.f^=Y,(e.f&g)===0&&(E(e,R),z(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Ve)!==0||(n.f&U)!==0;ln(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const i of f)(i.is_global||t)&&i.in()}}function Es(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:se(n);t.append(n),n=s}}let qe=!1,he=!1;function Ot(e){he=e}let _=null,H=!1;function re(e){_=e}let h=null;function Re(e){h=e}let M=null;function on(e){_!==null&&(M===null?M=[e]:M.push(e))}let x=null,k=0,I=null;function vr(e){I=e}let un=1,ie=0,ce=ie;function xt(e){ce=e}function cn(){return++un}function He(e){var t=e.f;if((t&R)!==0)return!0;if(t&A&&(e.f&=~_e),(t&V)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&P)!==0&&b===null&&E(e,g)}return!1}function _n(e,t,n=!0){var r=e.reactions;if(r!==null&&!(M!==null&&Ae.call(M,e)))for(var s=0;s{e.ac.abort(fe)}),e.ac=null);try{e.f|=Je;var c=e.fn,u=c();e.f|=ne;var v=e.deps,m=d==null?void 0:d.is_fork;if(x!==null){var w;if(m||De(e,k),v!==null&&k>0)for(v.length=k+x.length,w=0;we});function pr(e){return(Ze==null?void 0:Ze.createHTML(e))??e}function hn(e){var t=fr("template");return t.innerHTML=pr(e.replaceAll("","")),t.content}function q(e,t){var n=h;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Ss(e,t){var n=(t&jt)!==0,r=(t&Mn)!==0,s,f=!e.startsWith("");return()=>{if(D)return q(y,null),y;s===void 0&&(s=hn(f?e:""+e),n||(s=j(s)));var i=r||Jt?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=j(i),a=i.lastChild;q(o,a)}else q(i,i);return i}}function hr(e,t,n="svg"){var r=!e.startsWith(""),s=(t&jt)!==0,f=`<${n}>${r?e:""+e}`,i;return()=>{if(D)return q(y,null),y;if(!i){var o=hn(f),a=j(o);if(s)for(i=document.createDocumentFragment();j(a);)i.appendChild(j(a));else i=j(a)}var l=i.cloneNode(!0);if(s){var c=j(l),u=l.lastChild;q(c,u)}else q(l,l);return l}}function Rs(e,t){return hr(e,t,"svg")}function Ns(e=""){if(!D){var t=de(e+"");return q(t,t),t}var n=y;return n.nodeType!==Le?(n.before(n=de()),ve(n)):ze(n),q(n,n),n}function Os(){if(D)return q(y,null),y;var e=document.createDocumentFragment(),t=document.createComment(""),n=de();return e.append(t,n),q(t,n),e}function xs(e,t){if(D){var n=h;((n.f&ne)===0||n.nodes.end===null)&&(n.nodes.end=y),Yn();return}e!==null&&e.before(t)}export{ys as $,Br as A,rs as B,bt as C,de as D,Ve as E,Fe as F,D as G,Mt as H,Lt as I,se as J,$r as K,ve as L,y as M,j as N,gs as O,bs as P,ps as Q,Tt as R,ue as S,Yn as T,Xr as U,Fn as V,Ln as W,Wr as X,ms as Y,pe as Z,_r as _,xs as a,Se as a$,Es as a0,ls as a1,S as a2,_s as a3,Sn as a4,Er as a5,As as a6,ct as a7,Zr as a8,ns as a9,Vr as aA,Ur as aB,je as aC,Ir as aD,jn as aE,ft as aF,Tr as aG,Nr as aH,yr as aI,Dr as aJ,Mr as aK,vt as aL,Cr as aM,Y as aN,U as aO,Pr as aP,sr as aQ,Ar as aR,Hn as aS,Ct as aT,gn as aU,Rr as aV,ar as aW,nn as aX,Xe as aY,Rn as aZ,qr as a_,qn as aa,An as ab,ts as ac,mr as ad,xe as ae,xr as af,jr as ag,he as ah,h as ai,Q as aj,Hr as ak,Ge as al,Lr as am,Fr as an,Jn as ao,Yr as ap,br as aq,rr as ar,$n as as,Ts as at,Rs as au,cr as av,ot as aw,lt as ax,q as ay,fr as az,Qr as b,E as b0,R as b1,z as b2,V as b3,Gn as b4,Re as b5,re as b6,Ue as b7,Un as b8,_ as b9,Be as ba,kr as bb,Gr as bc,dt as bd,ss as be,Or as bf,vs as bg,Os as c,Oe as d,fs as e,as as f,me as g,is as h,J as i,Ss as j,os as k,gr as l,Ns as m,Kr as n,cs as o,Jr as p,ws as q,zr as r,Z as s,hs as t,es as u,us as v,d as w,ds as x,lr as y,mn as z}; +var wn=Object.defineProperty;var mt=e=>{throw TypeError(e)};var yn=(e,t,n)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ye=(e,t,n)=>yn(e,typeof t!="symbol"?t+"":t,n),We=(e,t,n)=>t.has(e)||mt("Cannot "+n);var p=(e,t,n)=>(We(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?mt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(We(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(We(e,t,"access private method"),n);var mn=Array.isArray,En=Array.prototype.indexOf,Ae=Array.prototype.includes,yr=Array.from,mr=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,Tn=Object.prototype,bn=Array.prototype,Ct=Object.getPrototypeOf,Et=Object.isExtensible;const An=()=>{};function Er(e){return e()}function Sn(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}function gr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const A=2,Pe=4,Me=8,Pt=1<<24,K=16,U=32,we=64,Rn=128,P=512,g=1024,R=2048,V=4096,Y=8192,Q=16384,ne=32768,Ve=65536,gt=1<<17,Mt=1<<18,Fe=1<<19,Ft=1<<20,Tr=1<<25,_e=65536,Je=1<<21,it=1<<22,ee=1<<23,ue=Symbol("$state"),br=Symbol("legacy props"),Ar=Symbol(""),fe=new class extends Error{constructor(){super(...arguments);ye(this,"name","StaleReactionError");ye(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var kt;const Rr=!!((kt=globalThis.document)!=null&&kt.contentType)&&globalThis.document.contentType.includes("xml"),Le=3,Lt=8;function Nn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Nr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function On(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function xn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function kn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Dn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Or(){throw new Error("https://svelte.dev/e/hydration_failed")}function xr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Cn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function In(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Pn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function kr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Dr=1,Cr=2,Ir=4,Pr=8,Mr=16,Fr=1,Lr=2,jr=4,Hr=8,Yr=16,jt=1,Mn=2,Fn="[",Ln="[!",qr="[?",jn="]",lt={},T=Symbol(),Hn="http://www.w3.org/1999/xhtml",Vr="http://www.w3.org/2000/svg",Ur="http://www.w3.org/1998/Math/MathML";function ot(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Br(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Gr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let D=!1;function $r(e){D=e}let y;function ve(e){if(e===null)throw ot(),lt;return y=e}function Yn(){return ve(se(y))}function zr(e){if(D){if(se(y)!==null)throw ot(),lt;y=e}}function Kr(e=1){if(D){for(var t=e,n=y;t--;)n=se(n);y=n}}function Wr(e=!0){for(var t=0,n=y;;){if(n.nodeType===Lt){var r=n.data;if(r===jn){if(t===0)return n;t-=1}else(r===Fn||r===Ln||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=se(n);e&&n.remove(),n=s}}function Xr(e){if(!e||e.nodeType!==Lt)throw ot(),lt;return e.data}function Ht(e){return e===this.v}function qn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Yt(e){return!qn(e,this.v)}let Ge=!1;function Zr(){Ge=!0}let S=null;function Ue(e){S=e}function Jr(e,t=!1,n){S={p:S,i:!1,c:null,e:null,s:e,x:null,l:Ge&&!t?{s:null,u:null,$:[]}:null}}function Qr(e){var t=S,n=t.e;if(n!==null){t.e=null;for(var r of n)rn(r)}return t.i=!0,S=t.p,{}}function je(){return!Ge||S!==null&&S.l===null}let ae=[];function qt(){var e=ae;ae=[],Sn(e)}function Tt(e){if(ae.length===0&&!ke){var t=ae;queueMicrotask(()=>{t===ae&&qt()})}ae.push(e)}function Vn(){for(;ae.length>0;)qt()}function Un(e){var t=h;if(t===null)return _.f|=ee,e;if((t.f&ne)===0&&(t.f&Pe)===0)throw e;Be(e,t)}function Be(e,t){for(;t!==null;){if((t.f&Rn)!==0){if((t.f&ne)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Bn=-7169;function E(e,t){e.f=e.f&Bn|t}function ut(e){(e.f&P)!==0||e.deps===null?E(e,g):E(e,V)}function Vt(e){if(e!==null)for(const t of e)(t.f&A)===0||(t.f&_e)===0||(t.f^=_e,Vt(t.deps))}function Gn(e,t,n){(e.f&R)!==0?t.add(e):(e.f&V)!==0&&n.add(e),Vt(e.deps),E(e,g)}const Ye=new Set;let d=null,bt=null,b=null,O=[],$e=null,Qe=!1,ke=!1;var Ee,ge,le,Te,Ce,Ie,oe,$,be,C,et,tt,nt,Ut;const ht=class ht{constructor(){F(this,C);ye(this,"current",new Map);ye(this,"previous",new Map);F(this,Ee,new Set);F(this,ge,new Set);F(this,le,0);F(this,Te,0);F(this,Ce,null);F(this,Ie,new Set);F(this,oe,new Set);F(this,$,new Map);ye(this,"is_fork",!1);F(this,be,!1)}skip_effect(t){p(this,$).has(t)||p(this,$).set(t,{d:[],m:[]})}unskip_effect(t){var n=p(this,$).get(t);if(n){p(this,$).delete(t);for(var r of n.d)E(r,R),z(r);for(r of n.m)E(r,V),z(r)}}process(t){var s;O=[],this.apply();var n=[],r=[];for(const f of t)X(this,C,tt).call(this,f,n,r);if(X(this,C,et).call(this)){X(this,C,nt).call(this,r),X(this,C,nt).call(this,n);for(const[f,i]of p(this,$))zt(f,i)}else{for(const f of p(this,Ee))f();p(this,Ee).clear(),p(this,le)===0&&X(this,C,Ut).call(this),bt=this,d=null,At(r),At(n),bt=null,(s=p(this,Ce))==null||s.resolve()}b=null}capture(t,n){n!==T&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&ee)===0&&(this.current.set(t,t.v),b==null||b.set(t,t.v))}activate(){d=this,this.apply()}deactivate(){d===this&&(d=null,b=null)}flush(){if(this.activate(),O.length>0){if(Bt(),d!==null&&d!==this)return}else p(this,le)===0&&this.process([]);this.deactivate()}discard(){for(const t of p(this,ge))t(this);p(this,ge).clear()}increment(t){W(this,le,p(this,le)+1),t&&W(this,Te,p(this,Te)+1)}decrement(t){W(this,le,p(this,le)-1),t&&W(this,Te,p(this,Te)-1),!p(this,be)&&(W(this,be,!0),Tt(()=>{W(this,be,!1),X(this,C,et).call(this)?O.length>0&&this.flush():this.revive()}))}revive(){for(const t of p(this,Ie))p(this,oe).delete(t),E(t,R),z(t);for(const t of p(this,oe))E(t,V),z(t);this.flush()}oncommit(t){p(this,Ee).add(t)}ondiscard(t){p(this,ge).add(t)}settled(){return(p(this,Ce)??W(this,Ce,It())).promise}static ensure(){if(d===null){const t=d=new ht;Ye.add(d),ke||Tt(()=>{d===t&&t.flush()})}return d}apply(){}};Ee=new WeakMap,ge=new WeakMap,le=new WeakMap,Te=new WeakMap,Ce=new WeakMap,Ie=new WeakMap,oe=new WeakMap,$=new WeakMap,be=new WeakMap,C=new WeakSet,et=function(){return this.is_fork||p(this,Te)>0},tt=function(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var f=s.f,i=(f&(U|we))!==0,o=i&&(f&g)!==0,a=o||(f&Y)!==0||p(this,$).has(s);if(!a&&s.fn!==null){i?s.f^=g:(f&Pe)!==0?n.push(s):He(s)&&((f&K)!==0&&p(this,oe).add(s),Ne(s));var l=s.first;if(l!==null){s=l;continue}}for(;s!==null;){var c=s.next;if(c!==null){s=c;break}s=s.parent}}},nt=function(t){for(var n=0;n1){this.previous.clear();var t=b,n=!0;for(const f of Ye){if(f===this){n=!1;continue}const i=[];for(const[a,l]of this.current){if(f.current.has(a))if(n&&l!==f.current.get(a))f.current.set(a,l);else continue;i.push(a)}if(i.length===0)continue;const o=[...f.current.keys()].filter(a=>!this.current.has(a));if(o.length>0){var r=O;O=[];const a=new Set,l=new Map;for(const c of i)Gt(c,o,a,l);if(O.length>0){d=f,f.apply();for(const c of O)X(s=f,C,tt).call(s,c,[],[]);f.deactivate()}O=r}}d=null,b=t}Ye.delete(this)};let Se=ht;function $n(e){var t=ke;ke=!0;try{for(var n;;){if(Vn(),O.length===0&&(d==null||d.flush(),O.length===0))return $e=null,n;Bt()}}finally{ke=t}}function Bt(){Qe=!0;var e=null;try{for(var t=0;O.length>0;){var n=Se.ensure();if(t++>1e3){var r,s;zn()}n.process(O),te.clear()}}finally{O=[],Qe=!1,$e=null}}function zn(){try{Dn()}catch(e){Be(e,$e)}}let L=null;function At(e){var t=e.length;if(t!==0){for(var n=0;n0)){te.clear();for(const s of L){if((s.f&(Q|Y))!==0)continue;const f=[s];let i=s.parent;for(;i!==null;)L.has(i)&&(L.delete(i),f.push(i)),i=i.parent;for(let o=f.length-1;o>=0;o--){const a=f[o];(a.f&(Q|Y))===0&&Ne(a)}}L.clear()}}L=null}}function Gt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&A)!==0?Gt(s,t,n,r):(f&(it|K))!==0&&(f&R)===0&&$t(s,t,r)&&(E(s,R),z(s))}}function $t(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(Ae.call(t,s))return!0;if((s.f&A)!==0&&$t(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function z(e){var t=$e=e,n=t.b;if(n!=null&&n.is_pending&&(e.f&(Pe|Me|Pt))!==0&&(e.f&ne)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(Qe&&t===h&&(r&K)!==0&&(r&Mt)===0&&(r&ne)!==0)return;if((r&(we|U))!==0){if((r&g)===0)return;t.f^=g}}O.push(t)}function zt(e,t){if(!((e.f&U)!==0&&(e.f&g)!==0)){(e.f&R)!==0?t.d.push(e):(e.f&V)!==0&&t.m.push(e),E(e,g);for(var n=e.first;n!==null;)zt(n,t),n=n.next}}function Kn(e,t,n,r){const s=je()?ct:Jn;var f=e.filter(u=>!u.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var i=h,o=Wn(),a=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(u=>u.promise)):null;function l(u){o();try{r(u)}catch(v){(i.f&Q)===0&&Be(v,i)}rt()}if(n.length===0){a.then(()=>l(t.map(s)));return}function c(){o(),Promise.all(n.map(u=>Zn(u))).then(u=>l([...t.map(s),...u])).catch(u=>Be(u,i))}a?a.then(c):c()}function Wn(){var e=h,t=_,n=S,r=d;return function(f=!0){Re(e),re(t),Ue(n),f&&(r==null||r.activate())}}function rt(e=!0){Re(null),re(null),Ue(null),e&&(d==null||d.deactivate())}function Xn(){var e=h.b,t=d,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function ct(e){var t=A|R,n=_!==null&&(_.f&A)!==0?_:null;return h!==null&&(h.f|=Fe),{ctx:S,deps:null,effects:null,equals:Ht,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:n??h,ac:null}}function Zn(e,t,n){h===null&&Nn();var s=void 0,f=vt(T),i=!_,o=new Map;return or(()=>{var v;var a=It();s=a.promise;try{Promise.resolve(e()).then(a.resolve,a.reject).finally(rt)}catch(m){a.reject(m),rt()}var l=d;if(i){var c=Xn();(v=o.get(l))==null||v.reject(fe),o.delete(l),o.set(l,a)}const u=(m,w=void 0)=>{if(l.activate(),w)w!==fe&&(f.f|=ee,ft(f,w));else{(f.f&ee)!==0&&(f.f^=ee),ft(f,m);for(const[G,N]of o){if(o.delete(G),G===l)break;N.reject(fe)}}c&&c()};a.promise.then(u,m=>u(null,m||"unknown"))}),lr(()=>{for(const a of o.values())a.reject(fe)}),new Promise(a=>{function l(c){function u(){c===s?a(f):l(s)}c.then(u,u)}l(s)})}function es(e){const t=ct(e);return on(t),t}function Jn(e){const t=ct(e);return t.equals=Yt,t}function Qn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!Xt&&nr()}return t}function nr(){Xt=!1;for(const e of st)(e.f&g)!==0&&E(e,V),He(e)&&Ne(e);st.clear()}function ns(e,t=1){var n=me(e),r=t===1?n++:n--;return J(e,n),r}function Xe(e){J(e,e.v+1)}function Zt(e,t){var n=e.reactions;if(n!==null)for(var r=je(),s=n.length,f=0;f{if(ce===f)return o();var a=_,l=ce;re(null),xt(f);var c=o();return re(a),xt(l),c};return r&&n.set("length",Z(e.length)),new Proxy(e,{defineProperty(o,a,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&Cn();var c=n.get(a);return c===void 0?i(()=>{var u=Z(l.value);return n.set(a,u),u}):J(c,l.value,!0),!0},deleteProperty(o,a){var l=n.get(a);if(l===void 0){if(a in o){const c=i(()=>Z(T));n.set(a,c),Xe(s)}}else J(l,T),Xe(s);return!0},get(o,a,l){var m;if(a===ue)return e;var c=n.get(a),u=a in o;if(c===void 0&&(!u||(m=xe(o,a))!=null&&m.writable)&&(c=i(()=>{var w=Oe(u?o[a]:T),G=Z(w);return G}),n.set(a,c)),c!==void 0){var v=me(c);return v===T?void 0:v}return Reflect.get(o,a,l)},getOwnPropertyDescriptor(o,a){var l=Reflect.getOwnPropertyDescriptor(o,a);if(l&&"value"in l){var c=n.get(a);c&&(l.value=me(c))}else if(l===void 0){var u=n.get(a),v=u==null?void 0:u.v;if(u!==void 0&&v!==T)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return l},has(o,a){var v;if(a===ue)return!0;var l=n.get(a),c=l!==void 0&&l.v!==T||Reflect.has(o,a);if(l!==void 0||h!==null&&(!c||(v=xe(o,a))!=null&&v.writable)){l===void 0&&(l=i(()=>{var m=c?Oe(o[a]):T,w=Z(m);return w}),n.set(a,l));var u=me(l);if(u===T)return!1}return c},set(o,a,l,c){var yt;var u=n.get(a),v=a in o;if(r&&a==="length")for(var m=l;mZ(T)),n.set(m+"",w))}if(u===void 0)(!v||(yt=xe(o,a))!=null&&yt.writable)&&(u=i(()=>Z(void 0)),J(u,Oe(l)),n.set(a,u));else{v=u.v!==T;var G=i(()=>Oe(l));J(u,G)}var N=Reflect.getOwnPropertyDescriptor(o,a);if(N!=null&&N.set&&N.set.call(c,l),!v){if(r&&typeof a=="string"){var wt=n.get("length"),Ke=Number(a);Number.isInteger(Ke)&&Ke>=wt.v&&J(wt,Ke+1)}Xe(s)}return!0},ownKeys(o){me(s);var a=Reflect.ownKeys(o).filter(u=>{var v=n.get(u);return v===void 0||v.v!==T});for(var[l,c]of n)c.v!==T&&!(l in o)&&a.push(l);return a},setPrototypeOf(){In()}})}function St(e){try{if(e!==null&&typeof e=="object"&&ue in e)return e[ue]}catch{}return e}function rs(e,t){return Object.is(St(e),St(t))}var Rt,rr,Jt,Qt,en;function ss(){if(Rt===void 0){Rt=window,rr=document,Jt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Qt=xe(t,"firstChild").get,en=xe(t,"nextSibling").get,Et(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Et(n)&&(n.__t=void 0)}}function de(e=""){return document.createTextNode(e)}function j(e){return Qt.call(e)}function se(e){return en.call(e)}function fs(e,t){if(!D)return j(e);var n=j(y);if(n===null)n=y.appendChild(de());else if(t&&n.nodeType!==Le){var r=de();return n==null||n.before(r),ve(r),r}return t&&ze(n),ve(n),n}function as(e,t=!1){if(!D){var n=j(e);return n instanceof Comment&&n.data===""?se(n):n}if(t){if((y==null?void 0:y.nodeType)!==Le){var r=de();return y==null||y.before(r),ve(r),r}ze(y)}return y}function is(e,t=1,n=!1){let r=D?y:e;for(var s;t--;)s=r,r=se(r);if(!D)return r;if(n){if((r==null?void 0:r.nodeType)!==Le){var f=de();return r===null?s==null||s.after(f):r.before(f),ve(f),f}ze(r)}return ve(r),r}function sr(e){e.textContent=""}function ls(){return!1}function fr(e,t,n){return document.createElementNS(t??Hn,e,void 0)}function ze(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Le;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function os(e){D&&j(e)!==null&&sr(e)}let Nt=!1;function ar(){Nt||(Nt=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function dt(e){var t=_,n=h;re(null),Re(null);try{return e()}finally{re(t),Re(n)}}function us(e,t,n,r=n){e.addEventListener(t,()=>dt(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),ar()}function tn(e){h===null&&(_===null&&kn(),xn()),he&&On()}function ir(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function B(e,t,n){var r=h;r!==null&&(r.f&Y)!==0&&(e|=Y);var s={ctx:S,deps:null,nodes:null,f:e|R|P,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Ne(s)}catch(o){throw pe(s),o}else t!==null&&z(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&Fe)===0&&(f=f.first,(e&K)!==0&&(e&Ve)!==0&&f!==null&&(f.f|=Ve)),f!==null&&(f.parent=r,r!==null&&ir(f,r),_!==null&&(_.f&A)!==0&&(e&we)===0)){var i=_;(i.effects??(i.effects=[])).push(f)}return s}function nn(){return _!==null&&!H}function lr(e){const t=B(Me,null,!1);return E(t,g),t.teardown=e,t}function cs(e){tn();var t=h.f,n=!_&&(t&U)!==0&&(t&ne)===0;if(n){var r=S;(r.e??(r.e=[])).push(e)}else return rn(e)}function rn(e){return B(Pe|Ft,e,!1)}function _s(e){return tn(),B(Me|Ft,e,!0)}function vs(e){Se.ensure();const t=B(we|Fe,e,!0);return(n={})=>new Promise(r=>{n.outro?_r(t,()=>{pe(t),r(void 0)}):(pe(t),r(void 0))})}function ds(e){return B(Pe,e,!1)}function or(e){return B(it|Fe,e,!0)}function ps(e,t=0){return B(Me|t,e,!0)}function hs(e,t=[],n=[],r=[]){Kn(r,t,n,s=>{B(Me,()=>e(...s.map(me)),!0)})}function ws(e,t=0){var n=B(K|t,e,!0);return n}function ys(e){return B(U|Fe,e,!0)}function sn(e){var t=e.teardown;if(t!==null){const n=he,r=_;Ot(!0),re(null);try{t.call(null)}finally{Ot(n),re(r)}}}function pt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&dt(()=>{s.abort(fe)});var r=n.next;(n.f&we)!==0?n.parent=null:pe(n,t),n=r}}function ur(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&U)===0&&pe(t),t=n}}function pe(e,t=!0){var n=!1;(t||(e.f&Mt)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(cr(e.nodes.start,e.nodes.end),n=!0),pt(e,t&&!n),De(e,0),E(e,Q);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();sn(e);var s=e.parent;s!==null&&s.first!==null&&fn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function cr(e,t){for(;e!==null;){var n=e===t?null:se(e);e.remove(),e=n}}function fn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function _r(e,t,n=!0){var r=[];an(e,r,!0);var s=()=>{n&&pe(e),t&&t()},f=r.length;if(f>0){var i=()=>--f||s();for(var o of r)o.out(i)}else s()}function an(e,t,n){if((e.f&Y)===0){e.f^=Y;var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&t.push(o);for(var s=e.first;s!==null;){var f=s.next,i=(s.f&Ve)!==0||(s.f&U)!==0&&(e.f&K)!==0;an(s,t,i?n:!1),s=f}}}function ms(e){ln(e,!0)}function ln(e,t){if((e.f&Y)!==0){e.f^=Y,(e.f&g)===0&&(E(e,R),z(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Ve)!==0||(n.f&U)!==0;ln(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const i of f)(i.is_global||t)&&i.in()}}function Es(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:se(n);t.append(n),n=s}}let qe=!1,he=!1;function Ot(e){he=e}let _=null,H=!1;function re(e){_=e}let h=null;function Re(e){h=e}let M=null;function on(e){_!==null&&(M===null?M=[e]:M.push(e))}let x=null,k=0,I=null;function vr(e){I=e}let un=1,ie=0,ce=ie;function xt(e){ce=e}function cn(){return++un}function He(e){var t=e.f;if((t&R)!==0)return!0;if(t&A&&(e.f&=~_e),(t&V)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&P)!==0&&b===null&&E(e,g)}return!1}function _n(e,t,n=!0){var r=e.reactions;if(r!==null&&!(M!==null&&Ae.call(M,e)))for(var s=0;s{e.ac.abort(fe)}),e.ac=null);try{e.f|=Je;var c=e.fn,u=c();e.f|=ne;var v=e.deps,m=d==null?void 0:d.is_fork;if(x!==null){var w;if(m||De(e,k),v!==null&&k>0)for(v.length=k+x.length,w=0;we});function pr(e){return(Ze==null?void 0:Ze.createHTML(e))??e}function hn(e){var t=fr("template");return t.innerHTML=pr(e.replaceAll("","")),t.content}function q(e,t){var n=h;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Ss(e,t){var n=(t&jt)!==0,r=(t&Mn)!==0,s,f=!e.startsWith("");return()=>{if(D)return q(y,null),y;s===void 0&&(s=hn(f?e:""+e),n||(s=j(s)));var i=r||Jt?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=j(i),a=i.lastChild;q(o,a)}else q(i,i);return i}}function hr(e,t,n="svg"){var r=!e.startsWith(""),s=(t&jt)!==0,f=`<${n}>${r?e:""+e}`,i;return()=>{if(D)return q(y,null),y;if(!i){var o=hn(f),a=j(o);if(s)for(i=document.createDocumentFragment();j(a);)i.appendChild(j(a));else i=j(a)}var l=i.cloneNode(!0);if(s){var c=j(l),u=l.lastChild;q(c,u)}else q(l,l);return l}}function Rs(e,t){return hr(e,t,"svg")}function Ns(e=""){if(!D){var t=de(e+"");return q(t,t),t}var n=y;return n.nodeType!==Le?(n.before(n=de()),ve(n)):ze(n),q(n,n),n}function Os(){if(D)return q(y,null),y;var e=document.createDocumentFragment(),t=document.createComment(""),n=de();return e.append(t,n),q(t,n),e}function xs(e,t){if(D){var n=h;((n.f&ne)===0||n.nodes.end===null)&&(n.nodes.end=y),Yn();return}e!==null&&e.before(t)}export{_r as $,ds as A,lr as B,mn as C,Br as D,Ve as E,rs as F,bt as G,de as H,Mt as I,Fe as J,Lt as K,se as L,$r as M,ve as N,y as O,j as P,gs as Q,bs as R,ps as S,Tt as T,ue as U,Xr as V,Fn as W,Ln as X,Wr as Y,ms as Z,pe as _,xs as a,Se as a$,ys as a0,Es as a1,ls as a2,S as a3,_s as a4,Sn as a5,Er as a6,As as a7,ct as a8,Zr as a9,fr as aA,Vr as aB,Ur as aC,Ir as aD,jn as aE,ft as aF,Tr as aG,Nr as aH,yr as aI,Dr as aJ,Mr as aK,vt as aL,Cr as aM,Y as aN,U as aO,Pr as aP,sr as aQ,Hn as aR,Ct as aS,gn as aT,Rr as aU,ar as aV,Ar as aW,nn as aX,Xe as aY,Rn as aZ,qr as a_,ns as aa,qn as ab,An as ac,ts as ad,mr as ae,xe as af,xr as ag,jr as ah,he as ai,h as aj,Q as ak,Hr as al,Ge as am,Lr as an,Fr as ao,Jn as ap,Yr as aq,br as ar,rr as as,$n as at,Ts as au,Rs as av,cr as aw,ot as ax,lt as ay,q as az,Qr as b,E as b0,R as b1,z as b2,V as b3,Gn as b4,Re as b5,re as b6,Ue as b7,Un as b8,_ as b9,Be as ba,kr as bb,Gr as bc,dt as bd,ss as be,Or as bf,vs as bg,Rt as bh,Os as c,Oe as d,fs as e,as as f,me as g,is as h,J as i,Ss as j,os as k,gr as l,Ns as m,Kr as n,je as o,Jr as p,ws as q,zr as r,Z as s,hs as t,es as u,D as v,Yn as w,cs as x,us as y,d as z}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js.br b/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js.br new file mode 100644 index 0000000..aadc865 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js.gz b/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js.gz similarity index 94% rename from apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js.gz rename to apps/dashboard/build/_app/immutable/chunks/CW7md74C.js.gz index 65c3116..a754270 100644 Binary files a/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js.gz and b/apps/dashboard/build/_app/immutable/chunks/CW7md74C.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js b/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js deleted file mode 100644 index bf586da..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js +++ /dev/null @@ -1 +0,0 @@ -const i="/api";async function t(e,o){const r=await fetch(`${i}${e}`,{headers:{"Content-Type":"application/json"},...o});if(!r.ok)throw new Error(`API ${r.status}: ${r.statusText}`);return r.json()}const n={memories:{list:e=>{const o=e?"?"+new URLSearchParams(e).toString():"";return t(`/memories${o}`)},get:e=>t(`/memories/${e}`),delete:e=>t(`/memories/${e}`,{method:"DELETE"}),promote:e=>t(`/memories/${e}/promote`,{method:"POST"}),demote:e=>t(`/memories/${e}/demote`,{method:"POST"}),suppress:(e,o)=>t(`/memories/${e}/suppress`,{method:"POST",body:o?JSON.stringify({reason:o}):void 0}),unsuppress:e=>t(`/memories/${e}/unsuppress`,{method:"POST"})},search:(e,o=20)=>t(`/search?q=${encodeURIComponent(e)}&limit=${o}`),stats:()=>t("/stats"),health:()=>t("/health"),timeline:(e=7,o=200)=>t(`/timeline?days=${e}&limit=${o}`),graph:e=>{const o=e?"?"+new URLSearchParams(Object.entries(e).filter(([,r])=>r!==void 0).map(([r,s])=>[r,String(s)])).toString():"";return t(`/graph${o}`)},dream:()=>t("/dream",{method:"POST"}),explore:(e,o="associations",r,s=10)=>t("/explore",{method:"POST",body:JSON.stringify({from_id:e,action:o,to_id:r,limit:s})}),predict:()=>t("/predict",{method:"POST"}),importance:e=>t("/importance",{method:"POST",body:JSON.stringify({content:e})}),consolidate:()=>t("/consolidate",{method:"POST"}),retentionDistribution:()=>t("/retention-distribution"),intentions:(e="active")=>t(`/intentions?status=${e}`),deepReference:(e,o=20)=>t("/deep_reference",{method:"POST",body:JSON.stringify({query:e,depth:o})}),sanhedrin:{latest:()=>t("/sanhedrin/latest"),telemetry:(e=7)=>t(`/sanhedrin/telemetry?days=${e}`),appeal:(e,o,r,s)=>t("/sanhedrin/appeal",{method:"POST",body:JSON.stringify({reason:e,note:o,claimId:r,receiptId:s})})},traces:{list:(e=50)=>t(`/traces?limit=${e}`),get:e=>t(`/traces/${encodeURIComponent(e)}`),exportUrl:e=>`${i}/traces/${encodeURIComponent(e)}/export`},receipts:{list:(e=50)=>t(`/receipts?limit=${e}`),listForRun:(e,o=50)=>t(`/receipts?run=${encodeURIComponent(e)}&limit=${o}`),get:e=>t(`/receipts/${encodeURIComponent(e)}`)},memoryPrs:{list:(e,o=100)=>{const r=new URLSearchParams;return e&&r.set("status",e),r.set("limit",String(o)),t(`/memory-prs?${r.toString()}`)},get:e=>t(`/memory-prs/${encodeURIComponent(e)}`),act:(e,o)=>t(`/memory-prs/${encodeURIComponent(e)}/${o}`,{method:"POST"}),getMode:()=>t("/memory-prs/mode"),setMode:e=>t("/memory-prs/mode",{method:"POST",body:JSON.stringify({mode:e})})}};export{n as a}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js.br b/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js.br deleted file mode 100644 index c18a573..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js.gz b/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js.gz deleted file mode 100644 index cc66162..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CZfHMhLI.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js b/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js similarity index 66% rename from apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js rename to apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js index 4ee383e..3e74887 100644 --- a/apps/dashboard/build/_app/immutable/chunks/Bxs5UR9-.js +++ b/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js @@ -1 +1 @@ -var x=t=>{throw TypeError(t)};var B=(t,e,n)=>e.has(t)||x("Cannot "+n);var a=(t,e,n)=>(B(t,e,"read from private field"),n?n.call(t):e.get(t)),c=(t,e,n)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{o as I}from"./TZu9D97Z.js";import{s as u,g as f,i as d}from"./wpu9U-D0.js";import{w as G}from"./D8mhvFt8.js";new URL("sveltekit-internal://");function ae(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function oe(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function le({href:t}){return t.split("#")[0]}function W(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let s=r.length;for(;s;)e=e*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function X(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&w.delete(U(t)),z(t,e));const w=new Map;function ce(t,e){const n=U(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:s,...l}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&w.set(n,{body:s,init:l,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(s=X(s)),Promise.resolve(new Response(s,l))}return window.fetch(t,e)}function ue(t,e,n){if(w.size>0){const r=U(t,n),s=w.get(r);if(s){if(performance.now()o)}function s(o){n=!1,e.set(o)}function l(o){let i;return e.subscribe(h=>{(i===void 0||n&&h!==i)&&o(i=h)})}return{notify:r,set:s,subscribe:l}}const D={v:()=>{}};function Ae(){const{set:t,subscribe:e}=G(!1);let n;async function r(){clearTimeout(n);try{const s=await fetch(`${M}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!s.ok)return!1;const o=(await s.json()).version!==F;return o&&(t(!0),D.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function Q(t,e,n){return t.origin!==Y||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Re(t){}const H=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...H];const Z=new Set([...H]);[...Z];let E,O,T;const ee=I.toString().includes("$$")||/function \w+\(\) \{\}/.test(I.toString());var b,_,m,p,v,y,k,A,P,R,V,S,j;ee?(E={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},O={current:null},T={current:!1}):(E=new(P=class{constructor(){c(this,b,u({}));c(this,_,u(null));c(this,m,u(null));c(this,p,u({}));c(this,v,u({id:null}));c(this,y,u({}));c(this,k,u(-1));c(this,A,u(new URL("https://example.com")))}get data(){return f(a(this,b))}set data(e){d(a(this,b),e)}get form(){return f(a(this,_))}set form(e){d(a(this,_),e)}get error(){return f(a(this,m))}set error(e){d(a(this,m),e)}get params(){return f(a(this,p))}set params(e){d(a(this,p),e)}get route(){return f(a(this,v))}set route(e){d(a(this,v),e)}get state(){return f(a(this,y))}set state(e){d(a(this,y),e)}get status(){return f(a(this,k))}set status(e){d(a(this,k),e)}get url(){return f(a(this,A))}set url(e){d(a(this,A),e)}},b=new WeakMap,_=new WeakMap,m=new WeakMap,p=new WeakMap,v=new WeakMap,y=new WeakMap,k=new WeakMap,A=new WeakMap,P),O=new(V=class{constructor(){c(this,R,u(null))}get current(){return f(a(this,R))}set current(e){d(a(this,R),e)}},R=new WeakMap,V),T=new(j=class{constructor(){c(this,S,u(!1))}get current(){return f(a(this,S))}set current(e){d(a(this,S),e)}},S=new WeakMap,j),D.v=()=>T.current=!0);function Ue(t){Object.assign(E,t)}export{we as H,be as N,ge as P,he as S,ye as a,J as b,Ae as c,le as d,ie as e,pe as f,ve as g,ae as h,Q as i,N as j,oe as k,fe as l,ue as m,O as n,Y as o,E as p,ce as q,_e as r,me as s,de as t,ke as u,Ue as v,Re as w}; +var x=t=>{throw TypeError(t)};var K=(t,e,n)=>e.has(t)||x("Cannot "+n);var a=(t,e,n)=>(K(t,e,"read from private field"),n?n.call(t):e.get(t)),c=(t,e,n)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{o as I}from"./JVtQszIZ.js";import{s as u,g as f,i as d}from"./CW7md74C.js";import{w as G}from"./D90q9c2i.js";new URL("sveltekit-internal://");function ae(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function oe(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function le({href:t}){return t.split("#")[0]}function B(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let s=r.length;for(;s;)e=e*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function W(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&b.delete(U(t)),X(t,e));const b=new Map;function ce(t,e){const n=U(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:s,...l}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&b.set(n,{body:s,init:l,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(s=W(s)),Promise.resolve(new Response(s,l))}return window.fetch(t,e)}function ue(t,e,n){if(b.size>0){const r=U(t,n),s=b.get(r);if(s){if(performance.now()o)}function s(o){n=!1,e.set(o)}function l(o){let i;return e.subscribe(h=>{(i===void 0||n&&h!==i)&&o(i=h)})}return{notify:r,set:s,subscribe:l}}const z={v:()=>{}};function Ae(){const{set:t,subscribe:e}=G(!1);let n;async function r(){clearTimeout(n);try{const s=await fetch(`${M}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!s.ok)return!1;const o=(await s.json()).version!==F;return o&&(t(!0),z.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function Q(t,e,n){return t.origin!==Y||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function Re(t){}const D=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...D];const Z=new Set([...D]);[...Z];let E,O,T;const ee=I.toString().includes("$$")||/function \w+\(\) \{\}/.test(I.toString());var _,w,m,p,v,y,k,A,P,R,V,S,j;ee?(E={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},O={current:null},T={current:!1}):(E=new(P=class{constructor(){c(this,_,u({}));c(this,w,u(null));c(this,m,u(null));c(this,p,u({}));c(this,v,u({id:null}));c(this,y,u({}));c(this,k,u(-1));c(this,A,u(new URL("https://example.com")))}get data(){return f(a(this,_))}set data(e){d(a(this,_),e)}get form(){return f(a(this,w))}set form(e){d(a(this,w),e)}get error(){return f(a(this,m))}set error(e){d(a(this,m),e)}get params(){return f(a(this,p))}set params(e){d(a(this,p),e)}get route(){return f(a(this,v))}set route(e){d(a(this,v),e)}get state(){return f(a(this,y))}set state(e){d(a(this,y),e)}get status(){return f(a(this,k))}set status(e){d(a(this,k),e)}get url(){return f(a(this,A))}set url(e){d(a(this,A),e)}},_=new WeakMap,w=new WeakMap,m=new WeakMap,p=new WeakMap,v=new WeakMap,y=new WeakMap,k=new WeakMap,A=new WeakMap,P),O=new(V=class{constructor(){c(this,R,u(null))}get current(){return f(a(this,R))}set current(e){d(a(this,R),e)}},R=new WeakMap,V),T=new(j=class{constructor(){c(this,S,u(!1))}get current(){return f(a(this,S))}set current(e){d(a(this,S),e)}},S=new WeakMap,j),z.v=()=>T.current=!0);function Ue(t){Object.assign(E,t)}export{be as H,_e as N,ge as P,he as S,ye as a,J as b,Ae as c,le as d,ie as e,pe as f,ve as g,ae as h,Q as i,N as j,oe as k,fe as l,ue as m,O as n,Y as o,E as p,ce as q,we as r,me as s,de as t,ke as u,Ue as v,Re as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js.br b/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js.br new file mode 100644 index 0000000..6e3b451 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js.gz b/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js.gz new file mode 100644 index 0000000..b1a7616 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CaEJGM7b.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js b/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js similarity index 79% rename from apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js rename to apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js index 24ae411..89852b7 100644 --- a/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js +++ b/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js @@ -1 +1 @@ -import"./Bzak7iHL.js";import{p as B,o as E,t as N,a as O,b as T,i as m,g as d,j as z,s as C,e as D,r as G,u as H}from"./wpu9U-D0.js";import{s as I}from"./D8mhvFt8.js";import{s as J}from"./60_R_Vbt.js";import{p as a}from"./ByYB047u.js";var K=z(" ");function U(v,t){var x;B(t,!0);let A=a(t,"decimals",3,0),_=a(t,"scale",3,1),g=a(t,"prefix",3,""),w=a(t,"suffix",3,""),F=a(t,"duration",3,900),M=a(t,"class",3,""),b=a(t,"group",3,!0),r=C(0),i=0,c=0,o=0,l=!1;const q=typeof window<"u"&&((x=window.matchMedia)==null?void 0:x.call(window,"(prefers-reduced-motion: reduce)").matches);function y(e){return e===1?1:1-Math.pow(2,-10*e)}function p(e){if(q){m(r,e,!0);return}cancelAnimationFrame(i),c=d(r),o=0;function s(f){o||(o=f);const n=Math.min(1,(f-o)/F());m(r,c+(e-c)*y(n)),n<1?i=requestAnimationFrame(s):m(r,e,!0)}i=requestAnimationFrame(s)}E(()=>{const e=t.value;return l||(l=!0),p(e),()=>cancelAnimationFrame(i)});let j=H(()=>(()=>{const s=(d(r)*_()).toFixed(A());if(!b())return s;const[f,n]=s.split("."),h=f.replace(/\B(?=(\d{3})+(?!\d))/g,",");return n!==void 0?`${h}.${n}`:h})());var u=K(),k=D(u);G(u),N(()=>{J(u,1,`tabular-nums ${M()??""}`),I(k,`${g()??""}${d(j)??""}${w()??""}`)}),O(v,u),T()}export{U as A}; +import"./Bzak7iHL.js";import{p as B,x as E,t as N,a as O,b as T,i as m,g as d,j as z,s as C,e as D,r as G,u as H}from"./CW7md74C.js";import{s as I}from"./D90q9c2i.js";import{s as J}from"./Cc0l8Nd4.js";import{p as a}from"./BjbQ7qSx.js";var K=z(" ");function U(v,t){var x;B(t,!0);let A=a(t,"decimals",3,0),_=a(t,"scale",3,1),g=a(t,"prefix",3,""),w=a(t,"suffix",3,""),F=a(t,"duration",3,900),M=a(t,"class",3,""),b=a(t,"group",3,!0),r=C(0),i=0,c=0,o=0,l=!1;const q=typeof window<"u"&&((x=window.matchMedia)==null?void 0:x.call(window,"(prefers-reduced-motion: reduce)").matches);function y(e){return e===1?1:1-Math.pow(2,-10*e)}function p(e){if(q){m(r,e,!0);return}cancelAnimationFrame(i),c=d(r),o=0;function s(f){o||(o=f);const n=Math.min(1,(f-o)/F());m(r,c+(e-c)*y(n)),n<1?i=requestAnimationFrame(s):m(r,e,!0)}i=requestAnimationFrame(s)}E(()=>{const e=t.value;return l||(l=!0),p(e),()=>cancelAnimationFrame(i)});let j=H(()=>(()=>{const s=(d(r)*_()).toFixed(A());if(!b())return s;const[f,n]=s.split("."),h=f.replace(/\B(?=(\d{3})+(?!\d))/g,",");return n!==void 0?`${h}.${n}`:h})());var u=K(),k=D(u);G(u),N(()=>{J(u,1,`tabular-nums ${M()??""}`),I(k,`${g()??""}${d(j)??""}${w()??""}`)}),O(v,u),T()}export{U as A}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js.br b/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js.br new file mode 100644 index 0000000..f922205 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js.gz b/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js.gz new file mode 100644 index 0000000..cfb1a3f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CaR6YsRq.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js b/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js new file mode 100644 index 0000000..085092b --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js @@ -0,0 +1,2 @@ +import{H as G,q as dr,aD as sr,v as A,N as P,P as gr,w as pr,g as m,V as hr,X as _r,Y as x,M as K,O as z,K as Er,aE as Ar,aF as y,z as Sr,aG as b,a0 as Y,aH as Tr,a2 as Nr,ap as br,C as Ir,aI as B,aJ as Or,aK as Cr,ad as Mr,aL as rr,aM as Lr,Z as ur,$ as or,aN as U,T as lr,aO as Rr,aP as wr,aQ as Hr,_ as kr,L as Dr,aR as Fr,aS as zr,aT as Gr,aU as tr,aV as Pr,aW as Kr}from"./CW7md74C.js";function jr(r,e){return e}function Ur(r,e,f){for(var a=[],n=e.length,s,u=e.length,c=0;c{if(s){if(s.pending.delete(g),s.done.add(g),s.pending.size===0){var t=r.outrogroups;q(B(s.done)),t.delete(s),t.size===0&&(r.outrogroups=null)}}else u-=1},!1)}if(u===0){var o=a.length===0&&f!==null;if(o){var d=f,l=d.parentNode;Hr(l),l.append(d),r.items.clear()}q(e,!o)}else s={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(s)}function q(r,e=!0){for(var f=0;f{var v=f();return Ir(v)?v:v==null?[]:B(v)}),t,p=!0;function S(){i.fallback=l,Vr(i,t,u,e,a),l!==null&&(t.length===0?(l.f&b)===0?ur(l):(l.f^=b,k(l,null,u)):or(l,()=>{l=null}))}var T=dr(()=>{t=m(g);var v=t.length;let M=!1;if(A){var L=hr(u)===_r;L!==(v===0)&&(u=x(),P(u),K(!1),M=!0)}for(var _=new Set,O=Sr,R=Nr(),h=0;hs(u)):(l=Y(()=>s(er??(er=G()))),l.f|=b)),v>_.size&&Tr(),A&&v>0&&P(x()),!p)if(R){for(const[D,F]of c)_.has(D)||O.skip_effect(F.e);O.oncommit(S),O.ondiscard(()=>{})}else S();M&&K(!0),m(g)}),i={effect:T,items:c,outrogroups:null,fallback:l};p=!1,A&&(u=z)}function H(r){for(;r!==null&&(r.f&Rr)===0;)r=r.next;return r}function Vr(r,e,f,a,n){var E,D,F,X,$,J,Q,W,Z;var s=(a&wr)!==0,u=e.length,c=r.items,o=H(r.effect.first),d,l=null,g,t=[],p=[],S,T,i,v;if(s)for(v=0;v0){var w=(a&sr)!==0&&u===0?f:null;if(s){for(v=0;v{var N,j;if(g!==void 0)for(i of g)(j=(N=i.nodes)==null?void 0:N.a)==null||j.apply()})}function Yr(r,e,f,a,n,s,u,c){var o=(u&Or)!==0?(u&Cr)===0?Mr(f,!1,!1):rr(f):null,d=(u&Lr)!==0?rr(n):null;return{v:o,i:d,e:Y(()=>(s(e,o??f,d??n,c),()=>{r.delete(a)}))}}function k(r,e,f){if(r.nodes)for(var a=r.nodes.start,n=r.nodes.end,s=e&&(e.f&b)===0?e.nodes.start:f;a!==null;){var u=Dr(a);if(s.before(a),a===n)return;a=u}}function I(r,e,f){e===null?r.effect.first=f:e.next=f,f===null?r.effect.last=e:f.prev=e}function vr(r){var e,f,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e=0;){var c=u+s;(u===0||fr.includes(a[u-1]))&&(c===a.length||fr.includes(a[c]))?a=(u===0?"":a.substring(0,u))+a.substring(c+1):u=c}}return a===""?null:a}function ar(r,e=!1){var f=e?" !important;":";",a="";for(var n of Object.keys(r)){var s=r[n];s!=null&&s!==""&&(a+=" "+n+": "+s+f)}return a}function V(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function yr(r,e){if(e){var f="",a,n;if(Array.isArray(e)?(a=e[0],n=e[1]):a=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,u=0,c=!1,o=[];a&&o.push(...Object.keys(a).map(V)),n&&o.push(...Object.keys(n).map(V));var d=0,l=-1;const T=r.length;for(var g=0;g{if(!e){if(e=!0,r.hasAttribute("value")){var a=r.value;ir(r,"value",null),r.value=a}if(r.hasAttribute("checked")){var n=r.checked;ir(r,"checked",null),r.checked=n}}};r.__on_r=f,lr(f),Pr()}}function fe(r,e){var f=cr(r);f.value===(f.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==Qr)||(r.value=e??"")}function ir(r,e,f,a){var n=cr(r);A&&(n[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Jr)||n[e]!==(n[e]=f)&&(e==="loading"&&(r[Kr]=f),f==null?r.removeAttribute(e):typeof f!="string"&&Wr(r).includes(e)?r[e]=f:r.setAttribute(e,f))}function cr(r){return r.__attributes??(r.__attributes={[Xr]:r.nodeName.includes("-"),[$r]:r.namespaceURI===Fr})}var nr=new Map;function Wr(r){var e=r.getAttribute("is")||r.nodeName,f=nr.get(e);if(f)return f;nr.set(e,f=[]);for(var a,n=r,s=Element.prototype;s!==n;){a=Gr(n);for(var u in a)a[u].set&&f.push(u);n=zr(n)}return f}export{ir as a,fe as b,xr as c,mr as e,jr as i,ee as r,re as s,yr as t}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js.br b/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js.br new file mode 100644 index 0000000..285cfeb Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js.gz b/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js.gz new file mode 100644 index 0000000..011a473 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Cc0l8Nd4.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js.br b/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js.br deleted file mode 100644 index 3973c96..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js.gz b/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js.gz deleted file mode 100644 index 11150f1..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js b/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js new file mode 100644 index 0000000..61c08ab --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js @@ -0,0 +1 @@ +import{A as S,S as T,R as h,T as k,U as A}from"./CW7md74C.js";function t(r,i){return r===i||(r==null?void 0:r[A])===i}function x(r={},i,a,c){return S(()=>{var f,s;return T(()=>{f=s,s=[],h(()=>{r!==a(...s)&&(i(r,...s),f&&t(a(...f),r)&&i(null,...f))})}),()=>{k(()=>{s&&t(a(...s),r)&&i(null,...s)})}}),r}export{x as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js.br b/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js.br new file mode 100644 index 0000000..d5879e0 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js.br @@ -0,0 +1,2 @@ +< Ĵ1'7v@ypEc-O. ;1zTsMa&˽uµNL'jNw?']HNQ-E3,vaA7 ѭy8kV(Fئ~yFPHO;<#֧IkdeR +junջ_m \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js.gz b/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js.gz new file mode 100644 index 0000000..2ab45f1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/ChcFQRZo.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js b/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js similarity index 99% rename from apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js rename to apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js index 1e262da..75bbbc0 100644 --- a/apps/dashboard/build/_app/immutable/chunks/BZQzXWp7.js +++ b/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js @@ -1,4 +1,4 @@ -import{TSL as t}from"./CfobEeQC.js";/** +import{TSL as t}from"./DD4_gMN2.js";/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT diff --git a/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js.br b/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js.br new file mode 100644 index 0000000..89c293e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js.gz b/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js.gz new file mode 100644 index 0000000..19a9a07 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CjKwt1b1.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js.br b/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js.br deleted file mode 100644 index e0c34cb..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js.gz b/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js.gz deleted file mode 100644 index b2dc537..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js.br b/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js.br deleted file mode 100644 index 9ca395f..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js.gz b/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js.gz deleted file mode 100644 index 7c30757..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CnZzd20v.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js.br b/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js.br deleted file mode 100644 index 3a8183c..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js.gz b/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js.gz deleted file mode 100644 index 1fcfe84..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/CqMQEF-F.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js b/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js new file mode 100644 index 0000000..81134c5 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js @@ -0,0 +1 @@ +import"./Bzak7iHL.js";import{t as k,v as f,w as v,aj as C,aw as g,O as x,K as w,L as _,ax as A,ay as z,az as u,N as L,aA as H,aB as V,aC as E,P as d,a as N,av as b,e as O,r as T}from"./CW7md74C.js";import{a as M,s as Z}from"./Cc0l8Nd4.js";import{p as n}from"./BjbQ7qSx.js";function I(h,c,t=!1,l=!1,p=!1){var a=h,r="";k(()=>{var o=C;if(r===(r=c()??"")){f&&v();return}if(o.nodes!==null&&(g(o.nodes.start,o.nodes.end),o.nodes=null),r!==""){if(f){x.data;for(var e=v(),y=e;e!==null&&(e.nodeType!==w||e.data!=="");)y=e,e=_(e);if(e===null)throw A(),z;u(x,y),a=L(e);return}var m=t?V:l?E:void 0,s=H(t?"svg":l?"math":"template",m);s.innerHTML=r;var i=t||l?s:s.content;if(u(d(i),i.lastChild),t||l)for(;d(i);)a.before(d(i));else a.before(i)}})}const P={blackbox:'',memorypr:'',graph:'',reasoning:'',memories:'',timeline:'',feed:'',explore:'',activation:'',dreams:'',schedule:'',importance:'',duplicates:'',contradictions:'',patterns:'',intentions:'',stats:'',settings:'',command:'',search:'',filter:'',sparkle:'',chevron:'',close:'',pulse:'',logo:''};var R=b('');function W(h,c){let t=n(c,"size",3,20),l=n(c,"strokeWidth",3,1.6),p=n(c,"class",3,""),a=n(c,"draw",3,!1);var r=R(),o=O(r);I(o,()=>P[c.name],!0),T(r),k(()=>{M(r,"width",t()),M(r,"height",t()),M(r,"stroke-width",l()),Z(r,0,`vestige-icon ${a()?"vestige-icon-draw":""} ${p()??""}`,"svelte-1eqehiz")}),N(h,r)}export{W as I}; diff --git a/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js.br b/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js.br new file mode 100644 index 0000000..2295a63 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js.gz b/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js.gz new file mode 100644 index 0000000..c2fa0c4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/CqwrgJOn.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js b/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js deleted file mode 100644 index a7eb8ff..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js +++ /dev/null @@ -1 +0,0 @@ -import"./Bzak7iHL.js";import{t as k,G as f,T as v,ai as C,av as g,M as x,I as _,J as w,aw as A,ax as z,ay as u,L,az as H,aA as V,aB as E,N as d,a as N,au as T,e as b,r as I}from"./wpu9U-D0.js";import{a as M,s as O}from"./60_R_Vbt.js";import{p as n}from"./ByYB047u.js";function Z(h,c,t=!1,l=!1,p=!1){var a=h,r="";k(()=>{var o=C;if(r===(r=c()??"")){f&&v();return}if(o.nodes!==null&&(g(o.nodes.start,o.nodes.end),o.nodes=null),r!==""){if(f){x.data;for(var e=v(),y=e;e!==null&&(e.nodeType!==_||e.data!=="");)y=e,e=w(e);if(e===null)throw A(),z;u(x,y),a=L(e);return}var m=t?V:l?E:void 0,s=H(t?"svg":l?"math":"template",m);s.innerHTML=r;var i=t||l?s:s.content;if(u(d(i),i.lastChild),t||l)for(;d(i);)a.before(d(i));else a.before(i)}})}const R={blackbox:'',memorypr:'',graph:'',reasoning:'',memories:'',timeline:'',feed:'',explore:'',activation:'',dreams:'',schedule:'',importance:'',duplicates:'',contradictions:'',patterns:'',intentions:'',stats:'',settings:'',command:'',search:'',filter:'',sparkle:'',chevron:'',close:'',pulse:'',logo:''};var S=T('');function W(h,c){let t=n(c,"size",3,20),l=n(c,"strokeWidth",3,1.6),p=n(c,"class",3,""),a=n(c,"draw",3,!1);var r=S(),o=b(r);Z(o,()=>R[c.name],!0),I(r),k(()=>{M(r,"width",t()),M(r,"height",t()),M(r,"stroke-width",l()),O(r,0,`vestige-icon ${a()?"vestige-icon-draw":""} ${p()??""}`,"svelte-1eqehiz")}),N(h,r)}export{W as I}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js.br b/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js.br deleted file mode 100644 index 009a8a4..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js.gz b/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js.gz deleted file mode 100644 index d5e541c..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D7A-gG4Z.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js b/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js similarity index 83% rename from apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js rename to apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js index 192a855..6bfc137 100644 --- a/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js +++ b/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js @@ -1 +1 @@ -import{x as f,P as d,Q as l,a6 as u,aa as p}from"./wpu9U-D0.js";function m(e,n,t){f(()=>{var r=d(()=>n(e,t==null?void 0:t())||{});if(t&&(r!=null&&r.update)){var a=!1,i={};l(()=>{var s=t();u(s),a&&p(i,s)&&(i=s,r.update(s))}),a=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}const y=()=>{var e;return typeof window<"u"&&((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-reduced-motion: reduce)").matches)};function x(e,n={}){const{y:t=16,delay:r=0,once:a=!0,threshold:i=.12}=n;if(y())return e.classList.add("reveal-in"),{};e.classList.add("reveal"),e.style.setProperty("--reveal-y",`${t}px`),r&&e.style.setProperty("--reveal-delay",`${r}ms`);const s=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting?(e.classList.add("reveal-in"),a&&s.unobserve(e)):a||e.classList.remove("reveal-in")},{threshold:i,rootMargin:"0px 0px -8% 0px"});return s.observe(e),{destroy(){s.disconnect()}}}export{m as a,x as r}; +import{A as f,R as d,S as l,a7 as u,ab as p}from"./CW7md74C.js";function m(e,n,t){f(()=>{var r=d(()=>n(e,t==null?void 0:t())||{});if(t&&(r!=null&&r.update)){var a=!1,i={};l(()=>{var s=t();u(s),a&&p(i,s)&&(i=s,r.update(s))}),a=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}const y=()=>{var e;return typeof window<"u"&&((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-reduced-motion: reduce)").matches)};function w(e,n={}){const{y:t=16,delay:r=0,once:a=!0,threshold:i=.12}=n;if(y())return e.classList.add("reveal-in"),{};e.classList.add("reveal"),e.style.setProperty("--reveal-y",`${t}px`),r&&e.style.setProperty("--reveal-delay",`${r}ms`);const s=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting?(e.classList.add("reveal-in"),a&&s.unobserve(e)):a||e.classList.remove("reveal-in")},{threshold:i,rootMargin:"0px 0px -8% 0px"});return s.observe(e),{destroy(){s.disconnect()}}}export{m as a,w as r}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js.br b/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js.br new file mode 100644 index 0000000..f4cb2be Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js.gz b/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js.gz new file mode 100644 index 0000000..263bf3d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D8RjhgN0.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js b/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js deleted file mode 100644 index def1896..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js +++ /dev/null @@ -1,2 +0,0 @@ -var qe=Object.defineProperty;var pe=t=>{throw TypeError(t)};var xe=(t,e,s)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var J=(t,e,s)=>xe(t,typeof e!="symbol"?e+"":e,s),ie=(t,e,s)=>e.has(t)||pe("Cannot "+s);var r=(t,e,s)=>(ie(t,e,"read from private field"),s?s.call(t):e.get(t)),_=(t,e,s)=>e.has(t)?pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),f=(t,e,s,i)=>(ie(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),b=(t,e,s)=>(ie(t,e,"access private method"),s);import{aX as Be,g as me,Q as Ce,P as Re,aY as ge,R as z,aL as Se,M as Y,G as k,ai as H,aZ as be,q as He,T as Pe,W as Ve,a_ as ye,$ as M,D as Ae,a$ as ne,_ as ae,a0 as We,b0 as ve,b1 as $e,b2 as Ee,b3 as ze,b4 as je,b5 as U,b6 as ee,b7 as we,b8 as Je,b9 as De,a2 as Ne,aF as Qe,Z as fe,L as te,n as Xe,X as Ze,ba as Q,E as Ge,F as Ke,bb as Ue,bc as et,y as tt,bd as st,ad as rt,be as oe,N as it,I as Fe,V as nt,J as at,ax as ue,K as X,bf as ft,aQ as ot,bg as ut,aI as ct,p as ht,ay as lt,aE as dt,aw as _t,b as pt,ab as P,aa as gt,a4 as bt}from"./wpu9U-D0.js";function yt(t){let e=0,s=Se(0),i;return()=>{Be()&&(me(s),Ce(()=>(e===0&&(i=Re(()=>t(()=>ge(s)))),e+=1,()=>{z(()=>{e-=1,e===0&&(i==null||i(),i=void 0,ge(s))})})))}}var vt=Ge|Ke;function Et(t,e,s,i){new wt(t,e,s,i)}var E,j,S,x,y,A,w,m,F,B,I,V,W,$,O,se,l,Oe,Ie,Le,ce,G,K,he;class wt{constructor(e,s,i,o){_(this,l);J(this,"parent");J(this,"is_pending",!1);J(this,"transform_error");_(this,E);_(this,j,k?Y:null);_(this,S);_(this,x);_(this,y);_(this,A,null);_(this,w,null);_(this,m,null);_(this,F,null);_(this,B,0);_(this,I,0);_(this,V,!1);_(this,W,new Set);_(this,$,new Set);_(this,O,null);_(this,se,yt(()=>(f(this,O,Se(r(this,B))),()=>{f(this,O,null)})));var n;f(this,E,e),f(this,S,s),f(this,x,u=>{var h=H;h.b=this,h.f|=be,i(u)}),this.parent=H.b,this.transform_error=o??((n=this.parent)==null?void 0:n.transform_error)??(u=>u),f(this,y,He(()=>{if(k){const u=r(this,j);Pe();const h=u.data===Ve;if(u.data.startsWith(ye)){const a=JSON.parse(u.data.slice(ye.length));b(this,l,Ie).call(this,a)}else h?b(this,l,Le).call(this):b(this,l,Oe).call(this)}else b(this,l,ce).call(this)},vt)),k&&f(this,E,Y)}defer_effect(e){je(e,r(this,W),r(this,$))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!r(this,S).pending}update_pending_count(e){b(this,l,he).call(this,e),f(this,B,r(this,B)+e),!(!r(this,O)||r(this,V))&&(f(this,V,!0),z(()=>{f(this,V,!1),r(this,O)&&Qe(r(this,O),r(this,B))}))}get_effect_pending(){return r(this,se).call(this),me(r(this,O))}error(e){var s=r(this,S).onerror;let i=r(this,S).failed;if(!s&&!i)throw e;r(this,A)&&(fe(r(this,A)),f(this,A,null)),r(this,w)&&(fe(r(this,w)),f(this,w,null)),r(this,m)&&(fe(r(this,m)),f(this,m,null)),k&&(te(r(this,j)),Xe(),te(Ze()));var o=!1,n=!1;const u=()=>{if(o){et();return}o=!0,n&&Ue(),r(this,m)!==null&&ae(r(this,m),()=>{f(this,m,null)}),b(this,l,K).call(this,()=>{ne.ensure(),b(this,l,ce).call(this)})},h=c=>{try{n=!0,s==null||s(c,u),n=!1}catch(a){Q(a,r(this,y)&&r(this,y).parent)}i&&f(this,m,b(this,l,K).call(this,()=>{ne.ensure();try{return M(()=>{var a=H;a.b=this,a.f|=be,i(r(this,E),()=>c,()=>u)})}catch(a){return Q(a,r(this,y).parent),null}}))};z(()=>{var c;try{c=this.transform_error(e)}catch(a){Q(a,r(this,y)&&r(this,y).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(h,a=>Q(a,r(this,y)&&r(this,y).parent)):h(c)})}}E=new WeakMap,j=new WeakMap,S=new WeakMap,x=new WeakMap,y=new WeakMap,A=new WeakMap,w=new WeakMap,m=new WeakMap,F=new WeakMap,B=new WeakMap,I=new WeakMap,V=new WeakMap,W=new WeakMap,$=new WeakMap,O=new WeakMap,se=new WeakMap,l=new WeakSet,Oe=function(){try{f(this,A,M(()=>r(this,x).call(this,r(this,E))))}catch(e){this.error(e)}},Ie=function(e){const s=r(this,S).failed;s&&f(this,m,M(()=>{s(r(this,E),()=>e,()=>()=>{})}))},Le=function(){const e=r(this,S).pending;e&&(this.is_pending=!0,f(this,w,M(()=>e(r(this,E)))),z(()=>{var s=f(this,F,document.createDocumentFragment()),i=Ae();s.append(i),f(this,A,b(this,l,K).call(this,()=>(ne.ensure(),M(()=>r(this,x).call(this,i))))),r(this,I)===0&&(r(this,E).before(s),f(this,F,null),ae(r(this,w),()=>{f(this,w,null)}),b(this,l,G).call(this))}))},ce=function(){try{if(this.is_pending=this.has_pending_snippet(),f(this,I,0),f(this,B,0),f(this,A,M(()=>{r(this,x).call(this,r(this,E))})),r(this,I)>0){var e=f(this,F,document.createDocumentFragment());We(r(this,A),e);const s=r(this,S).pending;f(this,w,M(()=>s(r(this,E))))}else b(this,l,G).call(this)}catch(s){this.error(s)}},G=function(){this.is_pending=!1;for(const e of r(this,W))ve(e,$e),Ee(e);for(const e of r(this,$))ve(e,ze),Ee(e);r(this,W).clear(),r(this,$).clear()},K=function(e){var s=H,i=De,o=Ne;U(r(this,y)),ee(r(this,y)),we(r(this,y).ctx);try{return e()}catch(n){return Je(n),null}finally{U(s),ee(i),we(o)}},he=function(e){var s;if(!this.has_pending_snippet()){this.parent&&b(s=this.parent,l,he).call(s,e);return}f(this,I,r(this,I)+e),r(this,I)===0&&(b(this,l,G).call(this),r(this,w)&&ae(r(this,w),()=>{f(this,w,null)}),r(this,F)&&(r(this,E).before(r(this,F)),f(this,F,null)))};const Tt=["touchstart","touchmove"];function mt(t){return Tt.includes(t)}const q=Symbol("events"),Me=new Set,le=new Set;function Rt(t,e,s,i={}){function o(n){if(i.capture||de.call(e,n),!n.cancelBubble)return st(()=>s==null?void 0:s.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?z(()=>{e.addEventListener(t,o,i)}):e.addEventListener(t,o,i),o}function Ot(t,e,s,i,o){var n={capture:i,passive:o},u=Rt(t,e,s,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&tt(()=>{e.removeEventListener(t,u,n)})}function It(t,e,s){(e[q]??(e[q]={}))[t]=s}function Lt(t){for(var e=0;e{throw L});throw T}}finally{t[q]=e,delete t.currentTarget,ee(R),U(D)}}}function Mt(t,e){var s=e==null?"":typeof e=="object"?e+"":e;s!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=s,t.nodeValue=s+"")}function St(t,e){return Ye(t,e)}function Yt(t,e){oe(),e.intro=e.intro??!1;const s=e.target,i=k,o=Y;try{for(var n=it(s);n&&(n.nodeType!==Fe||n.data!==nt);)n=at(n);if(!n)throw ue;X(!0),te(n);const u=Ye(t,{...e,anchor:n});return X(!1),u}catch(u){if(u instanceof Error&&u.message.split(` -`).some(h=>h.startsWith("https://svelte.dev/e/")))throw u;return u!==ue&&console.warn("Failed to hydrate: ",u),e.recover===!1&&ft(),oe(),ot(s),X(!1),St(t,e)}finally{X(i),te(o)}}const Z=new Map;function Ye(t,{target:e,anchor:s,props:i={},events:o,context:n,intro:u=!0,transformError:h}){oe();var c=void 0,a=ut(()=>{var R=s??e.appendChild(Ae());Et(R,{pending:()=>{}},g=>{ht({});var d=Ne;if(n&&(d.c=n),o&&(i.$$events=o),k&<(g,null),c=t(g,i)||{},k&&(H.nodes.end=Y,Y===null||Y.nodeType!==Fe||Y.data!==dt))throw _t(),ue;pt()},h);var D=new Set,T=g=>{for(var d=0;d{var N;for(var g of D)for(const v of[e,document]){var d=Z.get(v),p=d.get(g);--p==0?(v.removeEventListener(g,de),d.delete(g),d.size===0&&Z.delete(v)):d.set(g,p)}le.delete(T),R!==s&&((N=R.parentNode)==null||N.removeChild(R))}});return _e.set(c,a),c}let _e=new WeakMap;function kt(t,e){const s=_e.get(t);return s?(_e.delete(t),s(e)):Promise.resolve()}function ke(t,e,s){if(t==null)return e(void 0),s&&s(void 0),P;const i=Re(()=>t.subscribe(e,s));return i.unsubscribe?()=>i.unsubscribe():i}const C=[];function At(t,e){return{subscribe:Dt(t,e).subscribe}}function Dt(t,e=P){let s=null;const i=new Set;function o(h){if(gt(t,h)&&(t=h,s)){const c=!C.length;for(const a of i)a[1](),C.push(a,t);if(c){for(let a=0;a{i.delete(a),i.size===0&&s&&(s(),s=null)}}return{set:o,update:n,subscribe:u}}function qt(t,e,s){const i=!Array.isArray(t),o=i?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const n=e.length<2;return At(s,(u,h)=>{let c=!1;const a=[];let R=0,D=P;const T=()=>{if(R)return;D();const d=e(i?a[0]:a,u,h);n?u(d):D=typeof d=="function"?d:P},g=o.map((d,p)=>ke(d,N=>{a[p]=N,R&=~(1<{R|=1<e=s)(),e}export{It as a,qt as b,ke as c,Lt as d,Ot as e,xt as g,Yt as h,St as m,Mt as s,kt as u,Dt as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js.br b/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js.br deleted file mode 100644 index 8b6310a..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js.gz b/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js.gz deleted file mode 100644 index 3f5feb9..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/D8mhvFt8.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js b/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js new file mode 100644 index 0000000..1c06836 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js @@ -0,0 +1,2 @@ +var Be=Object.defineProperty;var pe=t=>{throw TypeError(t)};var qe=(t,e,s)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var J=(t,e,s)=>qe(t,typeof e!="symbol"?e+"":e,s),ie=(t,e,s)=>e.has(t)||pe("Cannot "+s);var r=(t,e,s)=>(ie(t,e,"read from private field"),s?s.call(t):e.get(t)),_=(t,e,s)=>e.has(t)?pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),f=(t,e,s,i)=>(ie(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),b=(t,e,s)=>(ie(t,e,"access private method"),s);import{aX as xe,g as me,S as He,R as Se,aY as ge,T as $,aL as Re,O as M,v as k,aj as C,aZ as be,q as Ce,w as Pe,X as We,a_ as ve,a0 as L,H as Ae,a$ as ne,$ as ae,a1 as ze,b0 as ye,b1 as Ve,b2 as Ee,b3 as $e,b4 as je,b5 as G,b6 as ee,b7 as we,b8 as Je,b9 as Ne,a3 as De,aF as Xe,_ as fe,N as te,n as Ke,Y as Qe,ba as X,E as Ue,J as Ze,bb as Ge,bc as et,B as tt,bd as st,ae as rt,be as oe,P as it,K as Oe,W as nt,L as at,ay as ue,M as K,bf as ft,aQ as ot,bg as ut,aI as ct,p as ht,az as lt,aE as dt,ax as _t,b as pt,ac as P,ab as gt,a5 as bt}from"./CW7md74C.js";function vt(t){let e=0,s=Re(0),i;return()=>{xe()&&(me(s),He(()=>(e===0&&(i=Se(()=>t(()=>ge(s)))),e+=1,()=>{$(()=>{e-=1,e===0&&(i==null||i(),i=void 0,ge(s))})})))}}var yt=Ue|Ze;function Et(t,e,s,i){new wt(t,e,s,i)}var E,j,R,q,v,A,w,m,O,x,Y,W,z,V,F,se,l,Fe,Ye,Ie,ce,U,Z,he;class wt{constructor(e,s,i,o){_(this,l);J(this,"parent");J(this,"is_pending",!1);J(this,"transform_error");_(this,E);_(this,j,k?M:null);_(this,R);_(this,q);_(this,v);_(this,A,null);_(this,w,null);_(this,m,null);_(this,O,null);_(this,x,0);_(this,Y,0);_(this,W,!1);_(this,z,new Set);_(this,V,new Set);_(this,F,null);_(this,se,vt(()=>(f(this,F,Re(r(this,x))),()=>{f(this,F,null)})));var n;f(this,E,e),f(this,R,s),f(this,q,u=>{var h=C;h.b=this,h.f|=be,i(u)}),this.parent=C.b,this.transform_error=o??((n=this.parent)==null?void 0:n.transform_error)??(u=>u),f(this,v,Ce(()=>{if(k){const u=r(this,j);Pe();const h=u.data===We;if(u.data.startsWith(ve)){const a=JSON.parse(u.data.slice(ve.length));b(this,l,Ye).call(this,a)}else h?b(this,l,Ie).call(this):b(this,l,Fe).call(this)}else b(this,l,ce).call(this)},yt)),k&&f(this,E,M)}defer_effect(e){je(e,r(this,z),r(this,V))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!r(this,R).pending}update_pending_count(e){b(this,l,he).call(this,e),f(this,x,r(this,x)+e),!(!r(this,F)||r(this,W))&&(f(this,W,!0),$(()=>{f(this,W,!1),r(this,F)&&Xe(r(this,F),r(this,x))}))}get_effect_pending(){return r(this,se).call(this),me(r(this,F))}error(e){var s=r(this,R).onerror;let i=r(this,R).failed;if(!s&&!i)throw e;r(this,A)&&(fe(r(this,A)),f(this,A,null)),r(this,w)&&(fe(r(this,w)),f(this,w,null)),r(this,m)&&(fe(r(this,m)),f(this,m,null)),k&&(te(r(this,j)),Ke(),te(Qe()));var o=!1,n=!1;const u=()=>{if(o){et();return}o=!0,n&&Ge(),r(this,m)!==null&&ae(r(this,m),()=>{f(this,m,null)}),b(this,l,Z).call(this,()=>{ne.ensure(),b(this,l,ce).call(this)})},h=c=>{try{n=!0,s==null||s(c,u),n=!1}catch(a){X(a,r(this,v)&&r(this,v).parent)}i&&f(this,m,b(this,l,Z).call(this,()=>{ne.ensure();try{return L(()=>{var a=C;a.b=this,a.f|=be,i(r(this,E),()=>c,()=>u)})}catch(a){return X(a,r(this,v).parent),null}}))};$(()=>{var c;try{c=this.transform_error(e)}catch(a){X(a,r(this,v)&&r(this,v).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(h,a=>X(a,r(this,v)&&r(this,v).parent)):h(c)})}}E=new WeakMap,j=new WeakMap,R=new WeakMap,q=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,m=new WeakMap,O=new WeakMap,x=new WeakMap,Y=new WeakMap,W=new WeakMap,z=new WeakMap,V=new WeakMap,F=new WeakMap,se=new WeakMap,l=new WeakSet,Fe=function(){try{f(this,A,L(()=>r(this,q).call(this,r(this,E))))}catch(e){this.error(e)}},Ye=function(e){const s=r(this,R).failed;s&&f(this,m,L(()=>{s(r(this,E),()=>e,()=>()=>{})}))},Ie=function(){const e=r(this,R).pending;e&&(this.is_pending=!0,f(this,w,L(()=>e(r(this,E)))),$(()=>{var s=f(this,O,document.createDocumentFragment()),i=Ae();s.append(i),f(this,A,b(this,l,Z).call(this,()=>(ne.ensure(),L(()=>r(this,q).call(this,i))))),r(this,Y)===0&&(r(this,E).before(s),f(this,O,null),ae(r(this,w),()=>{f(this,w,null)}),b(this,l,U).call(this))}))},ce=function(){try{if(this.is_pending=this.has_pending_snippet(),f(this,Y,0),f(this,x,0),f(this,A,L(()=>{r(this,q).call(this,r(this,E))})),r(this,Y)>0){var e=f(this,O,document.createDocumentFragment());ze(r(this,A),e);const s=r(this,R).pending;f(this,w,L(()=>s(r(this,E))))}else b(this,l,U).call(this)}catch(s){this.error(s)}},U=function(){this.is_pending=!1;for(const e of r(this,z))ye(e,Ve),Ee(e);for(const e of r(this,V))ye(e,$e),Ee(e);r(this,z).clear(),r(this,V).clear()},Z=function(e){var s=C,i=Ne,o=De;G(r(this,v)),ee(r(this,v)),we(r(this,v).ctx);try{return e()}catch(n){return Je(n),null}finally{G(s),ee(i),we(o)}},he=function(e){var s;if(!this.has_pending_snippet()){this.parent&&b(s=this.parent,l,he).call(s,e);return}f(this,Y,r(this,Y)+e),r(this,Y)===0&&(b(this,l,U).call(this),r(this,w)&&ae(r(this,w),()=>{f(this,w,null)}),r(this,O)&&(r(this,E).before(r(this,O)),f(this,O,null)))};const Tt=["touchstart","touchmove"];function mt(t){return Tt.includes(t)}const B=Symbol("events"),Le=new Set,le=new Set;function St(t,e,s,i={}){function o(n){if(i.capture||de.call(e,n),!n.cancelBubble)return st(()=>s==null?void 0:s.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?$(()=>{e.addEventListener(t,o,i)}):e.addEventListener(t,o,i),o}function Ft(t,e,s,i,o){var n={capture:i,passive:o},u=St(t,e,s,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&tt(()=>{e.removeEventListener(t,u,n)})}function Yt(t,e,s){(e[B]??(e[B]={}))[t]=s}function It(t){for(var e=0;e{throw I});throw T}}finally{t[B]=e,delete t.currentTarget,ee(S),G(N)}}}function Lt(t,e){var s=e==null?"":typeof e=="object"?e+"":e;s!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=s,t.nodeValue=s+"")}function Rt(t,e){return Me(t,e)}function Mt(t,e){oe(),e.intro=e.intro??!1;const s=e.target,i=k,o=M;try{for(var n=it(s);n&&(n.nodeType!==Oe||n.data!==nt);)n=at(n);if(!n)throw ue;K(!0),te(n);const u=Me(t,{...e,anchor:n});return K(!1),u}catch(u){if(u instanceof Error&&u.message.split(` +`).some(h=>h.startsWith("https://svelte.dev/e/")))throw u;return u!==ue&&console.warn("Failed to hydrate: ",u),e.recover===!1&&ft(),oe(),ot(s),K(!1),Rt(t,e)}finally{K(i),te(o)}}const Q=new Map;function Me(t,{target:e,anchor:s,props:i={},events:o,context:n,intro:u=!0,transformError:h}){oe();var c=void 0,a=ut(()=>{var S=s??e.appendChild(Ae());Et(S,{pending:()=>{}},g=>{ht({});var d=De;if(n&&(d.c=n),o&&(i.$$events=o),k&<(g,null),c=t(g,i)||{},k&&(C.nodes.end=M,M===null||M.nodeType!==Oe||M.data!==dt))throw _t(),ue;pt()},h);var N=new Set,T=g=>{for(var d=0;d{var D;for(var g of N)for(const y of[e,document]){var d=Q.get(y),p=d.get(g);--p==0?(y.removeEventListener(g,de),d.delete(g),d.size===0&&Q.delete(y)):d.set(g,p)}le.delete(T),S!==s&&((D=S.parentNode)==null||D.removeChild(S))}});return _e.set(c,a),c}let _e=new WeakMap;function kt(t,e){const s=_e.get(t);return s?(_e.delete(t),s(e)):Promise.resolve()}function ke(t,e,s){if(t==null)return e(void 0),s&&s(void 0),P;const i=Se(()=>t.subscribe(e,s));return i.unsubscribe?()=>i.unsubscribe():i}const H=[];function At(t,e){return{subscribe:Nt(t,e).subscribe}}function Nt(t,e=P){let s=null;const i=new Set;function o(h){if(gt(t,h)&&(t=h,s)){const c=!H.length;for(const a of i)a[1](),H.push(a,t);if(c){for(let a=0;a{i.delete(a),i.size===0&&s&&(s(),s=null)}}return{set:o,update:n,subscribe:u}}function Bt(t,e,s){const i=!Array.isArray(t),o=i?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const n=e.length<2;return At(s,(u,h)=>{let c=!1;const a=[];let S=0,N=P;const T=()=>{if(S)return;N();const d=e(i?a[0]:a,u,h);n?u(d):N=typeof d=="function"?d:P},g=o.map((d,p)=>ke(d,D=>{a[p]=D,S&=~(1<{S|=1<e=s)(),e}export{Yt as a,Bt as b,ke as c,It as d,Ft as e,qt as g,Mt as h,Rt as m,Lt as s,kt as u,Nt as w}; diff --git a/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js.br b/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js.br new file mode 100644 index 0000000..4527e82 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js.gz b/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js.gz new file mode 100644 index 0000000..2fa1f18 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/D90q9c2i.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js b/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js similarity index 99% rename from apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js rename to apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js index c2d39e6..f14ce9a 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CfobEeQC.js +++ b/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js @@ -1,4 +1,4 @@ -import{C as mt,S as vg,c as Ag,d as Rg,G as ll,e as _t,f as Ku,a as Yn,g as Zs,h as Js,W as ln,i as Pn,B as Ct,j as dl,k as Cg,D as zs,l as oa,m as hl,V as j,L as pl,N as en,n as Eg,o as fl,p as wg,q as Mg,r as Bg,s as Fg,t as Ug,u as Pg,v as Dg,E as gl,M as ml,R as Ss,w as ft,x as _o,y as Xs,z as ms,b as Ye,F as Me,J as ze,U as Le,K as yl,O as xl,Q as Lg,T as Ig,X as Xu,Y as Ys,Z as Vg,_ as Gg,$ as Yu,a0 as Og,a1 as tn,a2 as Tl,a3 as kg,a4 as _l,a5 as aa,a6 as vs,H as pt,a7 as ss,a8 as kt,a9 as Ie,aa as Dn,ab as zg,ac as Wg,ad as ua,ae as fr,af as Ln,ag as $g,ah as Hg,ai as Ur,aj as bl,ak as qg,al as Kg,am as Xg,an as Yg,ao as ot,ap as jg,aq as Nl,ar as Qg,as as bo,at as Sl,au as sn,av as ju,aw as Zg,ax as Jg,ay as vl,az as q,aA as em,aB as tm,aC as No,aD as js,aE as sm,aF as nm,aG as rm,aH as im,aI as om,aJ as am,aK as um,aL as cm,aM as lm,aN as dm,aO as hm,aP as pm,aQ as fm,aR as gm,aS as jn,aT as Qn,aU as mm,aV as oi,aW as ai,aX as ui,aY as ys,aZ as ym,a_ as ci,a$ as ca,b0 as li,b1 as So,b2 as bt,b3 as Al,b4 as Rl,b5 as Cl,b6 as El,b7 as wl,b8 as Ml,b9 as Bl,ba as Fl,bb as Ul,bc as Gs,bd as Pl,be as Dl,bf as Ll,bg as Il,bh as Vl,bi as Gl,bj as Ol,bk as kl,bl as zl,bm as Wl,bn as $l,bo as xm,bp as Tm,bq as _m,br as Hl,bs as $r,bt as Hr,A as qr,bu as ql,bv as Kl,bw as Xl,bx as Yl,by as jl,bz as Ql,bA as Zl,bB as Jl,bC as bm,bD as Nm,bE as ed,bF as An,bG as Rn,bH as Ws,bI as Sm,bJ as la,bK as vm,bL as Am,bM as da,bN as ha,bO as pa,bP as fa,bQ as Li,bR as Pr,bS as Dr,bT as Lr,bU as Qu,bV as Zu,bW as Ju,bX as ec,bY as tc,bZ as vo,b_ as Ao,b$ as Ro,c0 as Co,c1 as Eo,c2 as wo,c3 as Mo,c4 as Bo,c5 as Fo,c6 as Uo,c7 as Po,c8 as Do,c9 as Lo,ca as Io,cb as Vo,cc as Go,cd as Ii,ce as Rm,cf as sc,cg as nc,ch as rc,ci as Cm,cj as Em,ck as wm,cl as Mm,cm as Bm,cn as Fm,co as Um,cp as Pm,cq as Dm,cr as Lm,cs as Im,ct as Vm,cu as Gm,cv as Om,cw as km,cx as zm,cy as Wm,cz as $m,cA as Hm,cB as qm,cC as Km,cD as td,cE as Xm}from"./C-SOZ1Oi.js";import{cF as RR,cG as CR,cH as ER,cI as wR,cJ as MR,cK as BR,cL as FR,cM as UR,cN as PR,cO as DR,cP as LR,cQ as IR,cR as VR,cS as GR,cT as OR,cU as kR,cV as zR,cW as WR,cX as $R,cY as HR,cZ as qR,c_ as KR,c$ as XR,d0 as YR,d1 as jR,d2 as QR,d3 as ZR,d4 as JR,d5 as e0,d6 as t0,d7 as s0,d8 as n0,d9 as r0,da as i0,db as o0,dc as a0,dd as u0,de as c0,df as l0,dg as d0,dh as h0,di as p0,dj as f0,dk as g0,dl as m0,dm as y0,dn as x0,dp as T0,dq as _0,dr as b0,ds as N0,dt as S0,du as v0,dv as A0,dw as R0,dx as C0,dy as E0,dz as w0,dA as M0,dB as B0,dC as F0,dD as U0,dE as P0,dF as D0,dG as L0,dH as I0,dI as V0,dJ as G0,dK as O0,dL as k0,dM as z0,dN as W0,dO as $0,dP as H0,dQ as q0,dR as K0,dS as X0,dT as Y0,I as j0,dU as Q0,dV as Z0,dW as J0,dX as eC,dY as tC,dZ as sC,d_ as nC,d$ as rC,e0 as iC,e1 as oC,e2 as aC,e3 as uC,e4 as cC,e5 as lC,e6 as dC,e7 as hC,e8 as pC,e9 as fC,ea as gC,eb as mC,ec as yC,ed as xC,ee as TC,ef as _C,eg as bC,eh as NC,ei as SC,ej as vC,ek as AC,el as RC,em as CC,en as EC,eo as wC,ep as MC,eq as BC,er as FC,es as UC,et as PC,eu as DC,P as LC,ev as IC,ew as VC,ex as GC,ey as OC,ez as kC,eA as zC,eB as WC,eC as $C,eD as HC,eE as qC,eF as KC,eG as XC,eH as YC,eI as jC,eJ as QC,eK as ZC,eL as JC,eM as eE,eN as tE,eO as sE,eP as nE,eQ as rE,eR as iE,eS as oE,eT as aE,eU as uE,eV as cE,eW as lE,eX as dE,eY as hE,eZ as pE,e_ as fE,e$ as gE,f0 as mE,f1 as yE,f2 as xE,f3 as TE,f4 as _E,f5 as bE,f6 as NE,f7 as SE,f8 as vE,f9 as AE,fa as RE,fb as CE,fc as EE,fd as wE,fe as ME,ff as BE,fg as FE,fh as UE,fi as PE,fj as DE,fk as LE,fl as IE,fm as VE,fn as GE,fo as OE,fp as kE,fq as zE,fr as WE,fs as $E,ft as HE,fu as qE,fv as KE,fw as XE,fx as YE,fy as jE,fz as QE,fA as ZE}from"./C-SOZ1Oi.js";/** +import{C as mt,S as vg,c as Ag,d as Rg,G as ll,e as _t,f as Ku,a as Yn,g as Zs,h as Js,W as ln,i as Pn,B as Ct,j as dl,k as Cg,D as zs,l as oa,m as hl,V as j,L as pl,N as en,n as Eg,o as fl,p as wg,q as Mg,r as Bg,s as Fg,t as Ug,u as Pg,v as Dg,E as gl,M as ml,R as Ss,w as ft,x as _o,y as Xs,z as ms,b as Ye,F as Me,J as ze,U as Le,K as yl,O as xl,Q as Lg,T as Ig,X as Xu,Y as Ys,Z as Vg,_ as Gg,$ as Yu,a0 as Og,a1 as tn,a2 as Tl,a3 as kg,a4 as _l,a5 as aa,a6 as vs,H as pt,a7 as ss,a8 as kt,a9 as Ie,aa as Dn,ab as zg,ac as Wg,ad as ua,ae as fr,af as Ln,ag as $g,ah as Hg,ai as Ur,aj as bl,ak as qg,al as Kg,am as Xg,an as Yg,ao as ot,ap as jg,aq as Nl,ar as Qg,as as bo,at as Sl,au as sn,av as ju,aw as Zg,ax as Jg,ay as vl,az as q,aA as em,aB as tm,aC as No,aD as js,aE as sm,aF as nm,aG as rm,aH as im,aI as om,aJ as am,aK as um,aL as cm,aM as lm,aN as dm,aO as hm,aP as pm,aQ as fm,aR as gm,aS as jn,aT as Qn,aU as mm,aV as oi,aW as ai,aX as ui,aY as ys,aZ as ym,a_ as ci,a$ as ca,b0 as li,b1 as So,b2 as bt,b3 as Al,b4 as Rl,b5 as Cl,b6 as El,b7 as wl,b8 as Ml,b9 as Bl,ba as Fl,bb as Ul,bc as Gs,bd as Pl,be as Dl,bf as Ll,bg as Il,bh as Vl,bi as Gl,bj as Ol,bk as kl,bl as zl,bm as Wl,bn as $l,bo as xm,bp as Tm,bq as _m,br as Hl,bs as $r,bt as Hr,A as qr,bu as ql,bv as Kl,bw as Xl,bx as Yl,by as jl,bz as Ql,bA as Zl,bB as Jl,bC as bm,bD as Nm,bE as ed,bF as An,bG as Rn,bH as Ws,bI as Sm,bJ as la,bK as vm,bL as Am,bM as da,bN as ha,bO as pa,bP as fa,bQ as Li,bR as Pr,bS as Dr,bT as Lr,bU as Qu,bV as Zu,bW as Ju,bX as ec,bY as tc,bZ as vo,b_ as Ao,b$ as Ro,c0 as Co,c1 as Eo,c2 as wo,c3 as Mo,c4 as Bo,c5 as Fo,c6 as Uo,c7 as Po,c8 as Do,c9 as Lo,ca as Io,cb as Vo,cc as Go,cd as Ii,ce as Rm,cf as sc,cg as nc,ch as rc,ci as Cm,cj as Em,ck as wm,cl as Mm,cm as Bm,cn as Fm,co as Um,cp as Pm,cq as Dm,cr as Lm,cs as Im,ct as Vm,cu as Gm,cv as Om,cw as km,cx as zm,cy as Wm,cz as $m,cA as Hm,cB as qm,cC as Km,cD as td,cE as Xm}from"./DSmtfx7F.js";import{cF as RR,cG as CR,cH as ER,cI as wR,cJ as MR,cK as BR,cL as FR,cM as UR,cN as PR,cO as DR,cP as LR,cQ as IR,cR as VR,cS as GR,cT as OR,cU as kR,cV as zR,cW as WR,cX as $R,cY as HR,cZ as qR,c_ as KR,c$ as XR,d0 as YR,d1 as jR,d2 as QR,d3 as ZR,d4 as JR,d5 as e0,d6 as t0,d7 as s0,d8 as n0,d9 as r0,da as i0,db as o0,dc as a0,dd as u0,de as c0,df as l0,dg as d0,dh as h0,di as p0,dj as f0,dk as g0,dl as m0,dm as y0,dn as x0,dp as T0,dq as _0,dr as b0,ds as N0,dt as S0,du as v0,dv as A0,dw as R0,dx as C0,dy as E0,dz as w0,dA as M0,dB as B0,dC as F0,dD as U0,dE as P0,dF as D0,dG as L0,dH as I0,dI as V0,dJ as G0,dK as O0,dL as k0,dM as z0,dN as W0,dO as $0,dP as H0,dQ as q0,dR as K0,dS as X0,dT as Y0,I as j0,dU as Q0,dV as Z0,dW as J0,dX as eC,dY as tC,dZ as sC,d_ as nC,d$ as rC,e0 as iC,e1 as oC,e2 as aC,e3 as uC,e4 as cC,e5 as lC,e6 as dC,e7 as hC,e8 as pC,e9 as fC,ea as gC,eb as mC,ec as yC,ed as xC,ee as TC,ef as _C,eg as bC,eh as NC,ei as SC,ej as vC,ek as AC,el as RC,em as CC,en as EC,eo as wC,ep as MC,eq as BC,er as FC,es as UC,et as PC,eu as DC,P as LC,ev as IC,ew as VC,ex as GC,ey as OC,ez as kC,eA as zC,eB as WC,eC as $C,eD as HC,eE as qC,eF as KC,eG as XC,eH as YC,eI as jC,eJ as QC,eK as ZC,eL as JC,eM as eE,eN as tE,eO as sE,eP as nE,eQ as rE,eR as iE,eS as oE,eT as aE,eU as uE,eV as cE,eW as lE,eX as dE,eY as hE,eZ as pE,e_ as fE,e$ as gE,f0 as mE,f1 as yE,f2 as xE,f3 as TE,f4 as _E,f5 as bE,f6 as NE,f7 as SE,f8 as vE,f9 as AE,fa as RE,fb as CE,fc as EE,fd as wE,fe as ME,ff as BE,fg as FE,fh as UE,fi as PE,fj as DE,fk as LE,fl as IE,fm as VE,fn as GE,fo as OE,fp as kE,fq as zE,fr as WE,fs as $E,ft as HE,fu as qE,fv as KE,fw as XE,fx as YE,fy as jE,fz as QE,fA as ZE}from"./DSmtfx7F.js";/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT diff --git a/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js.br b/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js.br new file mode 100644 index 0000000..76b5870 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js.gz b/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js.gz new file mode 100644 index 0000000..5a74ed2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DD4_gMN2.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js b/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js new file mode 100644 index 0000000..d9cd6de --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js @@ -0,0 +1 @@ +var D=Object.defineProperty;var g=i=>{throw TypeError(i)};var F=(i,e,s)=>e in i?D(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s;var w=(i,e,s)=>F(i,typeof e!="symbol"?e+"":e,s),y=(i,e,s)=>e.has(i)||g("Cannot "+s);var t=(i,e,s)=>(y(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>e.has(i)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),M=(i,e,s,a)=>(y(i,e,"write to private field"),a?a.call(i,s):e.set(i,s),s);import{z as x,Z as z,_ as k,$ as C,H as A,a0 as B,v as H,O,a1 as S,a2 as Z}from"./CW7md74C.js";var r,n,h,u,p,_,v;class q{constructor(e,s=!0){w(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=x;if(t(this,r).has(e)){var s=t(this,r).get(e),a=t(this,n).get(s);if(a)z(a),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),a=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();S(o,b),b.append(A()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!a?(t(this,u).add(f),C(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[a,c]of t(this,h))s.includes(a)||(k(c.effect),t(this,h).delete(a))});this.anchor=e,M(this,p,s)}ensure(e,s){var a=x,c=Z();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=A();f.append(o),t(this,h).set(e,{effect:B(()=>s(o)),fragment:f})}else t(this,n).set(e,B(()=>s(this.anchor)));if(t(this,r).set(a,e),c){for(const[d,m]of t(this,n))d===e?a.unskip_effect(m):a.skip_effect(m);for(const[d,m]of t(this,h))d===e?a.unskip_effect(m.effect):a.skip_effect(m.effect);a.oncommit(t(this,_)),a.ondiscard(t(this,v))}else H&&(this.anchor=O),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{q as B}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js.br b/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js.br new file mode 100644 index 0000000..fb57202 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js.gz b/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js.gz new file mode 100644 index 0000000..1345063 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DExHDOmW.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js b/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js deleted file mode 100644 index 66e7aff..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js +++ /dev/null @@ -1 +0,0 @@ -import{q as T,G as o,T as h,E as b,U as p,V as A,W as E,X as R,L as g,K as l}from"./wpu9U-D0.js";import{B as v}from"./BWk3o_TN.js";function S(t,u,_=!1){o&&h();var n=new v(t),c=_?b:0;function i(a,r){if(o){const e=p(t);var s;if(e===A?s=0:e===E?s=!1:s=parseInt(e.substring(1)),a!==s){var f=R();g(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;u((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},c)}export{S as i}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js.br b/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js.br deleted file mode 100644 index 3241073..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js.gz b/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js.gz deleted file mode 100644 index 10e3b75..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DKve45Wd.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js b/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js new file mode 100644 index 0000000..2dde94d --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js @@ -0,0 +1,1479 @@ +var dl=Object.defineProperty;var fl=(l,t,e)=>t in l?dl(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e;var T=(l,t,e)=>fl(l,typeof t!="symbol"?t+"":t,e);import"./Bzak7iHL.js";import{o as mh,a as pl}from"./JVtQszIZ.js";import{p as Ms,e as rt,r as st,h as ct,t as oe,a as xt,b as Ss,j as At,c as gh,f as qr,g as D,u as Xr,s as Pt,d as yh,i as mt,n as ml,x as gl,bh as yl}from"./CW7md74C.js";import{d as xh,s as Xt,a as wn,e as xl}from"./D90q9c2i.js";import{i as zt}from"./9-jplUL5.js";import{e as bh,s as us,a as Yr}from"./Cc0l8Nd4.js";import{b as vh}from"./ChcFQRZo.js";import{p as lt}from"./BjbQ7qSx.js";import{a as bl}from"./C-rZhKee.js";import{b as wh}from"./CaEJGM7b.js";import{s as kr}from"./BNUnVJrY.js";import{N as ka}from"./CcUbQ_Wl.js";/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const _h="172",Rm={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Lm={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Om=0,Nm=1,Dm=2,Um=3,Vm=0,Gm=1,Wm=2,Hm=3,Er=0,Mh=1,qm=2,vl=0,Ea=1,wl=2,Xm=3,Ym=4,Jm=5,Ra=100,Zm=101,Km=102,jm=103,Qm=104,$m=200,t0=201,e0=202,i0=203,La=204,Oa=205,s0=206,n0=207,r0=208,a0=209,o0=210,h0=211,l0=212,c0=213,u0=214,d0=0,f0=1,p0=2,Na=3,m0=4,g0=5,y0=6,x0=7,Jr=0,b0=1,v0=2,w0=0,_0=1,M0=2,S0=3,A0=4,T0=5,I0=6,C0=7,Da="attached",_l="detached",Zr=300,Kr=301,Ml=302,Sl=303,Al=304,Tl=306,Rr=1e3,ue=1001,Lr=1002,he=1003,Il=1004,z0=1004,Cl=1005,B0=1005,ee=1006,zl=1007,F0=1007,Ln=1008,P0=1008,Sh=1009,Bl=1010,Fl=1011,Pl=1012,kl=1013,jr=1014,Li=1015,El=1016,Rl=1017,Ll=1018,Ol=1020,Nl=35902,Dl=1021,Ul=1022,ys=1023,Vl=1024,Gl=1025,qn=1026,Ua=1027,Ah=1028,Th=1029,Wl=1030,Hl=1031,k0=1032,ql=1033,Xl=33776,Yl=33777,Jl=33778,Zl=33779,Kl=35840,jl=35841,Ql=35842,$l=35843,tc=36196,ec=37492,ic=37496,sc=37808,nc=37809,rc=37810,ac=37811,oc=37812,hc=37813,lc=37814,cc=37815,uc=37816,dc=37817,fc=37818,pc=37819,mc=37820,gc=37821,yc=36492,xc=36494,bc=36495,vc=36283,wc=36284,_c=36285,Mc=36286,Sc=2200,Ac=2201,Tc=2202,Mn=2300,Or=2301,Xn=2302,zi=2400,Bi=2401,Sn=2402,Qr=2500,Ih=2501,E0=0,R0=1,L0=2,Ic=3200,O0=3201,N0=3202,D0=3203,Ni=0,U0=1,Ch="",$t="srgb",Va="srgb-linear",Ga="linear",Yn="srgb",V0=0,li=7680,G0=7681,W0=7682,H0=7683,q0=34055,X0=34056,Y0=5386,J0=512,Z0=513,K0=514,j0=515,Q0=516,$0=517,tg=518,Wa=519,eg=512,ig=513,sg=514,ng=515,rg=516,ag=517,og=518,hg=519,An=35044,lg=35048,cg=35040,ug=35045,dg=35049,fg=35041,pg=35046,mg=35050,gg=35042,yg="100",xg="300 es",Te=2e3,Tn=2001;class We{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const s=this._listeners[t];if(s!==void 0){const n=s.indexOf(e);n!==-1&&s.splice(n,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const s=i.slice(0);for(let n=0,r=s.length;n>8&255]+Tt[l>>16&255]+Tt[l>>24&255]+"-"+Tt[t&255]+Tt[t>>8&255]+"-"+Tt[t>>16&15|64]+Tt[t>>24&255]+"-"+Tt[e&63|128]+Tt[e>>8&255]+"-"+Tt[e>>16&255]+Tt[e>>24&255]+Tt[i&255]+Tt[i>>8&255]+Tt[i>>16&255]+Tt[i>>24&255]).toLowerCase()}function H(l,t,e){return Math.max(t,Math.min(e,l))}function $r(l,t){return(l%t+t)%t}function Cc(l,t,e,i,s){return i+(l-t)*(s-i)/(e-t)}function zc(l,t,e){return l!==t?(e-l)/(t-l):0}function ds(l,t,e){return(1-e)*l+e*t}function Bc(l,t,e,i){return ds(l,t,1-Math.exp(-e*i))}function Fc(l,t=1){return t-Math.abs($r(l,t*2)-t)}function Pc(l,t,e){return l<=t?0:l>=e?1:(l=(l-t)/(e-t),l*l*(3-2*l))}function kc(l,t,e){return l<=t?0:l>=e?1:(l=(l-t)/(e-t),l*l*l*(l*(l*6-15)+10))}function Ec(l,t){return l+Math.floor(Math.random()*(t-l+1))}function Rc(l,t){return l+Math.random()*(t-l)}function Lc(l){return l*(.5-Math.random())}function Oc(l){l!==void 0&&(Ha=l);let t=Ha+=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 Nc(l){return l*ii}function Dc(l){return l*xs}function Uc(l){return(l&l-1)===0&&l!==0}function Vc(l){return Math.pow(2,Math.ceil(Math.log(l)/Math.LN2))}function Gc(l){return Math.pow(2,Math.floor(Math.log(l)/Math.LN2))}function Wc(l,t,e,i,s){const n=Math.cos,r=Math.sin,a=n(e/2),o=r(e/2),h=n((t+i)/2),c=r((t+i)/2),u=n((t-i)/2),d=r((t-i)/2),f=n((i-t)/2),p=r((i-t)/2);switch(s){case"XYX":l.set(a*c,o*u,o*d,a*h);break;case"YZY":l.set(o*d,a*c,o*u,a*h);break;case"ZXZ":l.set(o*u,o*d,a*c,a*h);break;case"XZX":l.set(a*c,o*p,o*f,a*h);break;case"YXY":l.set(o*f,a*c,o*p,a*h);break;case"ZYZ":l.set(o*p,o*f,a*c,a*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function kt(l,t){switch(t.constructor){case Float32Array:return l;case Uint32Array:return l/4294967295;case Uint16Array:return l/65535;case Uint8Array:return l/255;case Int32Array:return Math.max(l/2147483647,-1);case Int16Array:return Math.max(l/32767,-1);case Int8Array:return Math.max(l/127,-1);default:throw new Error("Invalid component type.")}}function X(l,t){switch(t.constructor){case Float32Array:return l;case Uint32Array:return Math.round(l*4294967295);case Uint16Array:return Math.round(l*65535);case Uint8Array:return Math.round(l*255);case Int32Array:return Math.round(l*2147483647);case Int16Array:return Math.round(l*32767);case Int8Array:return Math.round(l*127);default:throw new Error("Invalid component type.")}}const bg={DEG2RAD:ii,RAD2DEG:xs,generateUUID:Jt,clamp:H,euclideanModulo:$r,mapLinear:Cc,inverseLerp:zc,lerp:ds,damp:Bc,pingpong:Fc,smoothstep:Pc,smootherstep:kc,randInt:Ec,randFloat:Rc,randFloatSpread:Lc,seededRandom:Oc,degToRad:Nc,radToDeg:Dc,isPowerOfTwo:Uc,ceilPowerOfTwo:Vc,floorPowerOfTwo:Gc,setQuaternionFromProperEuler:Wc,normalize:X,denormalize:kt};class B{constructor(t=0,e=0){B.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=H(this.x,t.x,e.x),this.y=H(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=H(this.x,t,e),this.y=H(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(H(i,t,e))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(H(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),s=Math.sin(e),n=this.x-t.x,r=this.y-t.y;return this.x=n*i-r*s+t.x,this.y=n*s+r*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class pe{constructor(t,e,i,s,n,r,a,o,h){pe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,s,n,r,a,o,h)}set(t,e,i,s,n,r,a,o,h){const c=this.elements;return c[0]=t,c[1]=s,c[2]=a,c[3]=e,c[4]=n,c[5]=o,c[6]=i,c[7]=r,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,n=this.elements,r=i[0],a=i[3],o=i[6],h=i[1],c=i[4],u=i[7],d=i[2],f=i[5],p=i[8],m=s[0],g=s[3],x=s[6],y=s[1],b=s[4],v=s[7],_=s[2],M=s[5],A=s[8];return n[0]=r*m+a*y+o*_,n[3]=r*g+a*b+o*M,n[6]=r*x+a*v+o*A,n[1]=h*m+c*y+u*_,n[4]=h*g+c*b+u*M,n[7]=h*x+c*v+u*A,n[2]=d*m+f*y+p*_,n[5]=d*g+f*b+p*M,n[8]=d*x+f*v+p*A,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],c=t[8];return e*r*c-e*a*h-i*n*c+i*a*o+s*n*h-s*r*o}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],c=t[8],u=c*r-a*h,d=a*o-c*n,f=h*n-r*o,p=e*u+i*d+s*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=u*m,t[1]=(s*h-c*i)*m,t[2]=(a*i-s*r)*m,t[3]=d*m,t[4]=(c*e-s*o)*m,t[5]=(s*n-a*e)*m,t[6]=f*m,t[7]=(i*o-h*e)*m,t[8]=(r*e-i*n)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,n,r,a){const o=Math.cos(n),h=Math.sin(n);return this.set(i*o,i*h,-i*(o*r+h*a)+r+t,-s*h,s*o,-s*(-h*r+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Jn.makeScale(t,e)),this}rotate(t){return this.premultiply(Jn.makeRotation(-t)),this}translate(t,e){return this.premultiply(Jn.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<9;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Jn=new pe;function Hc(l){for(let t=l.length-1;t>=0;--t)if(l[t]>=65535)return!0;return!1}const qc={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Fi(l,t){return new qc[l](t)}function In(l){return document.createElementNS("http://www.w3.org/1999/xhtml",l)}function vg(){const l=In("canvas");return l.style.display="block",l}const qa={};function wg(l){l in qa||(qa[l]=!0,console.warn(l))}function _g(l,t,e){return new Promise(function(i,s){function n(){switch(l.clientWaitSync(t,l.SYNC_FLUSH_COMMANDS_BIT,0)){case l.WAIT_FAILED:s();break;case l.TIMEOUT_EXPIRED:setTimeout(n,e);break;default:i()}}setTimeout(n,e)})}function Mg(l){const t=l.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function Sg(l){const t=l.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const Xa=new pe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ya=new pe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Xc(){const l={enabled:!0,workingColorSpace:Va,spaces:{},convert:function(s,n,r){return this.enabled===!1||n===r||!n||!r||(this.spaces[n].transfer===Yn&&(s.r=Ie(s.r),s.g=Ie(s.g),s.b=Ie(s.b)),this.spaces[n].primaries!==this.spaces[r].primaries&&(s.applyMatrix3(this.spaces[n].toXYZ),s.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===Yn&&(s.r=Ei(s.r),s.g=Ei(s.g),s.b=Ei(s.b))),s},fromWorkingColorSpace:function(s,n){return this.convert(s,this.workingColorSpace,n)},toWorkingColorSpace:function(s,n){return this.convert(s,n,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Ch?Ga:this.spaces[s].transfer},getLuminanceCoefficients:function(s,n=this.workingColorSpace){return s.fromArray(this.spaces[n].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,n,r){return s.copy(this.spaces[n].toXYZ).multiply(this.spaces[r].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],i=[.3127,.329];return l.define({[Va]:{primaries:t,whitePoint:i,transfer:Ga,toXYZ:Xa,fromXYZ:Ya,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:$t},outputColorSpaceConfig:{drawingBufferColorSpace:$t}},[$t]:{primaries:t,whitePoint:i,transfer:Yn,toXYZ:Xa,fromXYZ:Ya,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:$t}}}),l}const qt=Xc();function Ie(l){return l<.04045?l*.0773993808:Math.pow(l*.9478672986+.0521327014,2.4)}function Ei(l){return l<.0031308?l*12.92:1.055*Math.pow(l,.41666)-.055}let ci;class Yc{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{ci===void 0&&(ci=In("canvas")),ci.width=t.width,ci.height=t.height;const i=ci.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=ci}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=In("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),n=s.data;for(let r=0;r0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Zr)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Rr:t.x=t.x-Math.floor(t.x);break;case ue:t.x=t.x<0?0:1;break;case Lr:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Rr:t.y=t.y-Math.floor(t.y);break;case ue:t.y=t.y<0?0:1;break;case Lr:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}gt.DEFAULT_IMAGE=null;gt.DEFAULT_MAPPING=Zr;gt.DEFAULT_ANISOTROPY=1;class St{constructor(t=0,e=0,i=0,s=1){St.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,n=this.w,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,n;const o=t.elements,h=o[0],c=o[4],u=o[8],d=o[1],f=o[5],p=o[9],m=o[2],g=o[6],x=o[10];if(Math.abs(c-d)<.01&&Math.abs(u-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(c+d)<.1&&Math.abs(u+m)<.1&&Math.abs(p+g)<.1&&Math.abs(h+f+x-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(h+1)/2,v=(f+1)/2,_=(x+1)/2,M=(c+d)/4,A=(u+m)/4,S=(p+g)/4;return b>v&&b>_?b<.01?(i=0,s=.707106781,n=.707106781):(i=Math.sqrt(b),s=M/i,n=A/i):v>_?v<.01?(i=.707106781,s=0,n=.707106781):(s=Math.sqrt(v),i=M/s,n=S/s):_<.01?(i=.707106781,s=.707106781,n=0):(n=Math.sqrt(_),i=A/n,s=S/n),this.set(i,s,n,e),this}let y=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(d-c)*(d-c));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(u-m)/y,this.z=(d-c)/y,this.w=Math.acos((h+f+x-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=H(this.x,t.x,e.x),this.y=H(this.y,t.y,e.y),this.z=H(this.z,t.z,e.z),this.w=H(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=H(this.x,t,e),this.y=H(this.y,t,e),this.z=H(this.z,t,e),this.w=H(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(H(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ta extends We{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new St(0,0,t,e),this.scissorTest=!1,this.viewport=new St(0,0,t,e);const s={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ee,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const n=new gt(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);n.flipY=!1,n.generateMipmaps=i.generateMipmaps,n.internalFormat=i.internalFormat,this.textures=[];const r=i.count;for(let a=0;a=0?1:-1,b=1-x*x;if(b>Number.EPSILON){const _=Math.sqrt(b),M=Math.atan2(_,x*y);g=Math.sin(g*M)/_,a=Math.sin(a*M)/_}const v=a*y;if(o=o*g+d*v,h=h*g+f*v,c=c*g+p*v,u=u*g+m*v,g===1-a){const _=1/Math.sqrt(o*o+h*h+c*c+u*u);o*=_,h*=_,c*=_,u*=_}}t[e]=o,t[e+1]=h,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,n,r){const a=i[s],o=i[s+1],h=i[s+2],c=i[s+3],u=n[r],d=n[r+1],f=n[r+2],p=n[r+3];return t[e]=a*p+c*u+o*f-h*d,t[e+1]=o*p+c*d+h*u-a*f,t[e+2]=h*p+c*f+a*d-o*u,t[e+3]=c*p-a*u-o*d-h*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,s=t._y,n=t._z,r=t._order,a=Math.cos,o=Math.sin,h=a(i/2),c=a(s/2),u=a(n/2),d=o(i/2),f=o(s/2),p=o(n/2);switch(r){case"XYZ":this._x=d*c*u+h*f*p,this._y=h*f*u-d*c*p,this._z=h*c*p+d*f*u,this._w=h*c*u-d*f*p;break;case"YXZ":this._x=d*c*u+h*f*p,this._y=h*f*u-d*c*p,this._z=h*c*p-d*f*u,this._w=h*c*u+d*f*p;break;case"ZXY":this._x=d*c*u-h*f*p,this._y=h*f*u+d*c*p,this._z=h*c*p+d*f*u,this._w=h*c*u-d*f*p;break;case"ZYX":this._x=d*c*u-h*f*p,this._y=h*f*u+d*c*p,this._z=h*c*p-d*f*u,this._w=h*c*u+d*f*p;break;case"YZX":this._x=d*c*u+h*f*p,this._y=h*f*u+d*c*p,this._z=h*c*p-d*f*u,this._w=h*c*u-d*f*p;break;case"XZY":this._x=d*c*u-h*f*p,this._y=h*f*u-d*c*p,this._z=h*c*p+d*f*u,this._w=h*c*u+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],s=e[4],n=e[8],r=e[1],a=e[5],o=e[9],h=e[2],c=e[6],u=e[10],d=i+a+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(c-o)*f,this._y=(n-h)*f,this._z=(r-s)*f}else if(i>a&&i>u){const f=2*Math.sqrt(1+i-a-u);this._w=(c-o)/f,this._x=.25*f,this._y=(s+r)/f,this._z=(n+h)/f}else if(a>u){const f=2*Math.sqrt(1+a-i-u);this._w=(n-h)/f,this._x=(s+r)/f,this._y=.25*f,this._z=(o+c)/f}else{const f=2*Math.sqrt(1+u-i-a);this._w=(r-s)/f,this._x=(n+h)/f,this._y=(o+c)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(H(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,s=t._y,n=t._z,r=t._w,a=e._x,o=e._y,h=e._z,c=e._w;return this._x=i*c+r*a+s*h-n*o,this._y=s*c+r*o+n*a-i*h,this._z=n*c+r*h+i*o-s*a,this._w=r*c-i*a-s*o-n*h,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,s=this._y,n=this._z,r=this._w;let a=r*t._w+i*t._x+s*t._y+n*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=r,this._x=i,this._y=s,this._z=n,this;const o=1-a*a;if(o<=Number.EPSILON){const f=1-e;return this._w=f*r+e*this._w,this._x=f*i+e*this._x,this._y=f*s+e*this._y,this._z=f*n+e*this._z,this.normalize(),this}const h=Math.sqrt(o),c=Math.atan2(h,a),u=Math.sin((1-e)*c)/h,d=Math.sin(e*c)/h;return this._w=r*u+this._w*d,this._x=i*u+this._x*d,this._y=s*u+this._y*d,this._z=n*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),n=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),n*Math.sin(e),n*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class w{constructor(t=0,e=0,i=0){w.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ja.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ja.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,n=t.elements,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this}applyQuaternion(t){const e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=2*(r*s-a*i),c=2*(a*e-n*s),u=2*(n*i-r*e);return this.x=e+o*h+r*u-a*c,this.y=i+o*c+a*h-n*u,this.z=s+o*u+n*c-r*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,s=this.z,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*s,this.y=n[1]*e+n[5]*i+n[9]*s,this.z=n[2]*e+n[6]*i+n[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=H(this.x,t.x,e.x),this.y=H(this.y,t.y,e.y),this.z=H(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=H(this.x,t,e),this.y=H(this.y,t,e),this.z=H(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(H(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,n=t.z,r=e.x,a=e.y,o=e.z;return this.x=s*o-n*a,this.y=n*r-i*o,this.z=i*a-s*r,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Kn.copy(this).projectOnVector(t),this.sub(Kn)}reflect(t){return this.sub(Kn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(H(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Kn=new w,Ja=new Zt;class Ut{constructor(t=new w(1/0,1/0,1/0),e=new w(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,ne),ne.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Hi),Fs.subVectors(this.max,Hi),ui.subVectors(t.a,Hi),di.subVectors(t.b,Hi),fi.subVectors(t.c,Hi),Ee.subVectors(di,ui),Re.subVectors(fi,di),He.subVectors(ui,fi);let e=[0,-Ee.z,Ee.y,0,-Re.z,Re.y,0,-He.z,He.y,Ee.z,0,-Ee.x,Re.z,0,-Re.x,He.z,0,-He.x,-Ee.y,Ee.x,0,-Re.y,Re.x,0,-He.y,He.x,0];return!jn(e,ui,di,fi,Fs)||(e=[1,0,0,0,1,0,0,0,1],!jn(e,ui,di,fi,Fs))?!1:(Ps.crossVectors(Ee,Re),e=[Ps.x,Ps.y,Ps.z],jn(e,ui,di,fi,Fs))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ne).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(ne).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(be[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),be[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),be[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),be[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),be[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),be[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),be[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),be[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(be),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const be=[new w,new w,new w,new w,new w,new w,new w,new w],ne=new w,Bs=new Ut,ui=new w,di=new w,fi=new w,Ee=new w,Re=new w,He=new w,Hi=new w,Fs=new w,Ps=new w,qe=new w;function jn(l,t,e,i,s){for(let n=0,r=l.length-3;n<=r;n+=3){qe.fromArray(l,n);const a=s.x*Math.abs(qe.x)+s.y*Math.abs(qe.y)+s.z*Math.abs(qe.z),o=t.dot(qe),h=e.dot(qe),c=i.dot(qe);if(Math.max(-Math.max(o,h,c),Math.min(o,h,c))>a)return!1}return!0}const Kc=new Ut,qi=new w,Qn=new w;class Et{constructor(t=new w,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):Kc.setFromPoints(t).getCenter(i);let s=0;for(let n=0,r=t.length;nthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;qi.subVectors(t,this.center);const e=qi.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),s=(i-this.radius)*.5;this.center.addScaledVector(qi,s/i),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Qn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(qi.copy(t.center).add(Qn)),this.expandByPoint(qi.copy(t.center).sub(Qn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ve=new w,$n=new w,ks=new w,Le=new w,tr=new w,Es=new w,er=new w;class As{constructor(t=new w,e=new w(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ve)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ve.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ve.copy(this.origin).addScaledVector(this.direction,e),ve.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){$n.copy(t).add(e).multiplyScalar(.5),ks.copy(e).sub(t).normalize(),Le.copy(this.origin).sub($n);const n=t.distanceTo(e)*.5,r=-this.direction.dot(ks),a=Le.dot(this.direction),o=-Le.dot(ks),h=Le.lengthSq(),c=Math.abs(1-r*r);let u,d,f,p;if(c>0)if(u=r*o-a,d=r*a-o,p=n*c,u>=0)if(d>=-p)if(d<=p){const m=1/c;u*=m,d*=m,f=u*(u+r*d+2*a)+d*(r*u+d+2*o)+h}else d=n,u=Math.max(0,-(r*d+a)),f=-u*u+d*(d+2*o)+h;else d=-n,u=Math.max(0,-(r*d+a)),f=-u*u+d*(d+2*o)+h;else d<=-p?(u=Math.max(0,-(-r*n+a)),d=u>0?-n:Math.min(Math.max(-n,-o),n),f=-u*u+d*(d+2*o)+h):d<=p?(u=0,d=Math.min(Math.max(-n,-o),n),f=d*(d+2*o)+h):(u=Math.max(0,-(r*n+a)),d=u>0?n:Math.min(Math.max(-n,-o),n),f=-u*u+d*(d+2*o)+h);else d=r>0?-n:n,u=Math.max(0,-(r*d+a)),f=-u*u+d*(d+2*o)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy($n).addScaledVector(ks,d),f}intersectSphere(t,e){ve.subVectors(t.center,this.origin);const i=ve.dot(this.direction),s=ve.dot(ve)-i*i,n=t.radius*t.radius;if(s>n)return null;const r=Math.sqrt(n-s),a=i-r,o=i+r;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,s,n,r,a,o;const h=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return h>=0?(i=(t.min.x-d.x)*h,s=(t.max.x-d.x)*h):(i=(t.max.x-d.x)*h,s=(t.min.x-d.x)*h),c>=0?(n=(t.min.y-d.y)*c,r=(t.max.y-d.y)*c):(n=(t.max.y-d.y)*c,r=(t.min.y-d.y)*c),i>r||n>s||((n>i||isNaN(i))&&(i=n),(r=0?(a=(t.min.z-d.z)*u,o=(t.max.z-d.z)*u):(a=(t.max.z-d.z)*u,o=(t.min.z-d.z)*u),i>o||a>s)||((a>i||i!==i)&&(i=a),(o=0?i:s,e)}intersectsBox(t){return this.intersectBox(t,ve)!==null}intersectTriangle(t,e,i,s,n){tr.subVectors(e,t),Es.subVectors(i,t),er.crossVectors(tr,Es);let r=this.direction.dot(er),a;if(r>0){if(s)return null;a=1}else if(r<0)a=-1,r=-r;else return null;Le.subVectors(this.origin,t);const o=a*this.direction.dot(Es.crossVectors(Le,Es));if(o<0)return null;const h=a*this.direction.dot(tr.cross(Le));if(h<0||o+h>r)return null;const c=-a*Le.dot(er);return c<0?null:this.at(c/r,n)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Y{constructor(t,e,i,s,n,r,a,o,h,c,u,d,f,p,m,g){Y.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,e,i,s,n,r,a,o,h,c,u,d,f,p,m,g)}set(t,e,i,s,n,r,a,o,h,c,u,d,f,p,m,g){const x=this.elements;return x[0]=t,x[4]=e,x[8]=i,x[12]=s,x[1]=n,x[5]=r,x[9]=a,x[13]=o,x[2]=h,x[6]=c,x[10]=u,x[14]=d,x[3]=f,x[7]=p,x[11]=m,x[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Y().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,s=1/pi.setFromMatrixColumn(t,0).length(),n=1/pi.setFromMatrixColumn(t,1).length(),r=1/pi.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*n,e[5]=i[5]*n,e[6]=i[6]*n,e[7]=0,e[8]=i[8]*r,e[9]=i[9]*r,e[10]=i[10]*r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,s=t.y,n=t.z,r=Math.cos(i),a=Math.sin(i),o=Math.cos(s),h=Math.sin(s),c=Math.cos(n),u=Math.sin(n);if(t.order==="XYZ"){const d=r*c,f=r*u,p=a*c,m=a*u;e[0]=o*c,e[4]=-o*u,e[8]=h,e[1]=f+p*h,e[5]=d-m*h,e[9]=-a*o,e[2]=m-d*h,e[6]=p+f*h,e[10]=r*o}else if(t.order==="YXZ"){const d=o*c,f=o*u,p=h*c,m=h*u;e[0]=d+m*a,e[4]=p*a-f,e[8]=r*h,e[1]=r*u,e[5]=r*c,e[9]=-a,e[2]=f*a-p,e[6]=m+d*a,e[10]=r*o}else if(t.order==="ZXY"){const d=o*c,f=o*u,p=h*c,m=h*u;e[0]=d-m*a,e[4]=-r*u,e[8]=p+f*a,e[1]=f+p*a,e[5]=r*c,e[9]=m-d*a,e[2]=-r*h,e[6]=a,e[10]=r*o}else if(t.order==="ZYX"){const d=r*c,f=r*u,p=a*c,m=a*u;e[0]=o*c,e[4]=p*h-f,e[8]=d*h+m,e[1]=o*u,e[5]=m*h+d,e[9]=f*h-p,e[2]=-h,e[6]=a*o,e[10]=r*o}else if(t.order==="YZX"){const d=r*o,f=r*h,p=a*o,m=a*h;e[0]=o*c,e[4]=m-d*u,e[8]=p*u+f,e[1]=u,e[5]=r*c,e[9]=-a*c,e[2]=-h*c,e[6]=f*u+p,e[10]=d-m*u}else if(t.order==="XZY"){const d=r*o,f=r*h,p=a*o,m=a*h;e[0]=o*c,e[4]=-u,e[8]=h*c,e[1]=d*u+m,e[5]=r*c,e[9]=f*u-p,e[2]=p*u-f,e[6]=a*c,e[10]=m*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(jc,t,Qc)}lookAt(t,e,i){const s=this.elements;return Wt.subVectors(t,e),Wt.lengthSq()===0&&(Wt.z=1),Wt.normalize(),Oe.crossVectors(i,Wt),Oe.lengthSq()===0&&(Math.abs(i.z)===1?Wt.x+=1e-4:Wt.z+=1e-4,Wt.normalize(),Oe.crossVectors(i,Wt)),Oe.normalize(),Rs.crossVectors(Wt,Oe),s[0]=Oe.x,s[4]=Rs.x,s[8]=Wt.x,s[1]=Oe.y,s[5]=Rs.y,s[9]=Wt.y,s[2]=Oe.z,s[6]=Rs.z,s[10]=Wt.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,s=e.elements,n=this.elements,r=i[0],a=i[4],o=i[8],h=i[12],c=i[1],u=i[5],d=i[9],f=i[13],p=i[2],m=i[6],g=i[10],x=i[14],y=i[3],b=i[7],v=i[11],_=i[15],M=s[0],A=s[4],S=s[8],C=s[12],z=s[1],k=s[5],U=s[9],W=s[13],R=s[2],I=s[6],N=s[10],wt=s[14],Bt=s[3],nt=s[7],ht=s[11],et=s[15];return n[0]=r*M+a*z+o*R+h*Bt,n[4]=r*A+a*k+o*I+h*nt,n[8]=r*S+a*U+o*N+h*ht,n[12]=r*C+a*W+o*wt+h*et,n[1]=c*M+u*z+d*R+f*Bt,n[5]=c*A+u*k+d*I+f*nt,n[9]=c*S+u*U+d*N+f*ht,n[13]=c*C+u*W+d*wt+f*et,n[2]=p*M+m*z+g*R+x*Bt,n[6]=p*A+m*k+g*I+x*nt,n[10]=p*S+m*U+g*N+x*ht,n[14]=p*C+m*W+g*wt+x*et,n[3]=y*M+b*z+v*R+_*Bt,n[7]=y*A+b*k+v*I+_*nt,n[11]=y*S+b*U+v*N+_*ht,n[15]=y*C+b*W+v*wt+_*et,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],s=t[8],n=t[12],r=t[1],a=t[5],o=t[9],h=t[13],c=t[2],u=t[6],d=t[10],f=t[14],p=t[3],m=t[7],g=t[11],x=t[15];return p*(+n*o*u-s*h*u-n*a*d+i*h*d+s*a*f-i*o*f)+m*(+e*o*f-e*h*d+n*r*d-s*r*f+s*h*c-n*o*c)+g*(+e*h*u-e*a*f-n*r*u+i*r*f+n*a*c-i*h*c)+x*(-s*a*c-e*o*u+e*a*d+s*r*u-i*r*d+i*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],c=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],x=t[15],y=u*g*h-m*d*h+m*o*f-a*g*f-u*o*x+a*d*x,b=p*d*h-c*g*h-p*o*f+r*g*f+c*o*x-r*d*x,v=c*m*h-p*u*h+p*a*f-r*m*f-c*a*x+r*u*x,_=p*u*o-c*m*o-p*a*d+r*m*d+c*a*g-r*u*g,M=e*y+i*b+s*v+n*_;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/M;return t[0]=y*A,t[1]=(m*d*n-u*g*n-m*s*f+i*g*f+u*s*x-i*d*x)*A,t[2]=(a*g*n-m*o*n+m*s*h-i*g*h-a*s*x+i*o*x)*A,t[3]=(u*o*n-a*d*n-u*s*h+i*d*h+a*s*f-i*o*f)*A,t[4]=b*A,t[5]=(c*g*n-p*d*n+p*s*f-e*g*f-c*s*x+e*d*x)*A,t[6]=(p*o*n-r*g*n-p*s*h+e*g*h+r*s*x-e*o*x)*A,t[7]=(r*d*n-c*o*n+c*s*h-e*d*h-r*s*f+e*o*f)*A,t[8]=v*A,t[9]=(p*u*n-c*m*n-p*i*f+e*m*f+c*i*x-e*u*x)*A,t[10]=(r*m*n-p*a*n+p*i*h-e*m*h-r*i*x+e*a*x)*A,t[11]=(c*a*n-r*u*n-c*i*h+e*u*h+r*i*f-e*a*f)*A,t[12]=_*A,t[13]=(c*m*s-p*u*s+p*i*d-e*m*d-c*i*g+e*u*g)*A,t[14]=(p*a*s-r*m*s-p*i*o+e*m*o+r*i*g-e*a*g)*A,t[15]=(r*u*s-c*a*s+c*i*o-e*u*o-r*i*d+e*a*d)*A,this}scale(t){const e=this.elements,i=t.x,s=t.y,n=t.z;return e[0]*=i,e[4]*=s,e[8]*=n,e[1]*=i,e[5]*=s,e[9]*=n,e[2]*=i,e[6]*=s,e[10]*=n,e[3]*=i,e[7]*=s,e[11]*=n,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,a=t.y,o=t.z,h=n*r,c=n*a;return this.set(h*r+i,h*a-s*o,h*o+s*a,0,h*a+s*o,c*a+i,c*o-s*r,0,h*o-s*a,c*o+s*r,n*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,n,r){return this.set(1,i,n,0,t,1,r,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){const s=this.elements,n=e._x,r=e._y,a=e._z,o=e._w,h=n+n,c=r+r,u=a+a,d=n*h,f=n*c,p=n*u,m=r*c,g=r*u,x=a*u,y=o*h,b=o*c,v=o*u,_=i.x,M=i.y,A=i.z;return s[0]=(1-(m+x))*_,s[1]=(f+v)*_,s[2]=(p-b)*_,s[3]=0,s[4]=(f-v)*M,s[5]=(1-(d+x))*M,s[6]=(g+y)*M,s[7]=0,s[8]=(p+b)*A,s[9]=(g-y)*A,s[10]=(1-(d+m))*A,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){const s=this.elements;let n=pi.set(s[0],s[1],s[2]).length();const r=pi.set(s[4],s[5],s[6]).length(),a=pi.set(s[8],s[9],s[10]).length();this.determinant()<0&&(n=-n),t.x=s[12],t.y=s[13],t.z=s[14],re.copy(this);const h=1/n,c=1/r,u=1/a;return re.elements[0]*=h,re.elements[1]*=h,re.elements[2]*=h,re.elements[4]*=c,re.elements[5]*=c,re.elements[6]*=c,re.elements[8]*=u,re.elements[9]*=u,re.elements[10]*=u,e.setFromRotationMatrix(re),i.x=n,i.y=r,i.z=a,this}makePerspective(t,e,i,s,n,r,a=Te){const o=this.elements,h=2*n/(e-t),c=2*n/(i-s),u=(e+t)/(e-t),d=(i+s)/(i-s);let f,p;if(a===Te)f=-(r+n)/(r-n),p=-2*r*n/(r-n);else if(a===Tn)f=-r/(r-n),p=-r*n/(r-n);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return o[0]=h,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=c,o[9]=d,o[13]=0,o[2]=0,o[6]=0,o[10]=f,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,s,n,r,a=Te){const o=this.elements,h=1/(e-t),c=1/(i-s),u=1/(r-n),d=(e+t)*h,f=(i+s)*c;let p,m;if(a===Te)p=(r+n)*u,m=-2*u;else if(a===Tn)p=n*u,m=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return o[0]=2*h,o[4]=0,o[8]=0,o[12]=-d,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-f,o[2]=0,o[6]=0,o[10]=m,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let s=0;s<16;s++)if(e[s]!==i[s])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const pi=new w,re=new Y,jc=new w(0,0,0),Qc=new w(1,1,1),Oe=new w,Rs=new w,Wt=new w,Za=new Y,Ka=new Zt;class fe{constructor(t=0,e=0,i=0,s=fe.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const s=t.elements,n=s[0],r=s[4],a=s[8],o=s[1],h=s[5],c=s[9],u=s[2],d=s[6],f=s[10];switch(e){case"XYZ":this._y=Math.asin(H(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,f),this._z=Math.atan2(-r,n)):(this._x=Math.atan2(d,h),this._z=0);break;case"YXZ":this._x=Math.asin(-H(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,n),this._z=0);break;case"ZXY":this._x=Math.asin(H(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-r,h)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-H(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(H(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-u,n)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-H(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(d,h),this._y=Math.atan2(a,n)):(this._x=Math.atan2(-c,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Za.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Za,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ka.setFromEuler(this),this.setFromQuaternion(Ka,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}fe.DEFAULT_ORDER="XYZ";class Fh{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function n(a,o){return a[o.uuid]===void 0&&(a[o.uuid]=o.toJSON(t)),o.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=n(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const o=a.shapes;if(Array.isArray(o))for(let h=0,c=o.length;h0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),o.length>0&&(i.materials=o),h.length>0&&(i.textures=h),c.length>0&&(i.images=c),u.length>0&&(i.shapes=u),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),p.length>0&&(i.nodes=p)}return i.object=s,i;function r(a){const o=[];for(const h in a){const c=a[h];delete c.metadata,o.push(c)}return o}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(n)):s.set(0,0,0)}static getBarycoord(t,e,i,s,n){ae.subVectors(s,e),_e.subVectors(i,e),sr.subVectors(t,e);const r=ae.dot(ae),a=ae.dot(_e),o=ae.dot(sr),h=_e.dot(_e),c=_e.dot(sr),u=r*h-a*a;if(u===0)return n.set(0,0,0),null;const d=1/u,f=(h*o-a*c)*d,p=(r*c-a*o)*d;return n.set(1-f-p,p,f)}static containsPoint(t,e,i,s){return this.getBarycoord(t,e,i,s,Me)===null?!1:Me.x>=0&&Me.y>=0&&Me.x+Me.y<=1}static getInterpolation(t,e,i,s,n,r,a,o){return this.getBarycoord(t,e,i,s,Me)===null?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(n,Me.x),o.addScaledVector(r,Me.y),o.addScaledVector(a,Me.z),o)}static getInterpolatedAttribute(t,e,i,s,n,r){return or.setScalar(0),hr.setScalar(0),lr.setScalar(0),or.fromBufferAttribute(t,e),hr.fromBufferAttribute(t,i),lr.fromBufferAttribute(t,s),r.setScalar(0),r.addScaledVector(or,n.x),r.addScaledVector(hr,n.y),r.addScaledVector(lr,n.z),r}static isFrontFacing(t,e,i,s){return ae.subVectors(i,e),_e.subVectors(t,e),ae.cross(_e).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ae.subVectors(this.c,this.b),_e.subVectors(this.a,this.b),ae.cross(_e).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Yt.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Yt.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,n){return Yt.getInterpolation(t,this.a,this.b,this.c,e,i,s,n)}containsPoint(t){return Yt.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Yt.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,s=this.b,n=this.c;let r,a;yi.subVectors(s,i),xi.subVectors(n,i),nr.subVectors(t,i);const o=yi.dot(nr),h=xi.dot(nr);if(o<=0&&h<=0)return e.copy(i);rr.subVectors(t,s);const c=yi.dot(rr),u=xi.dot(rr);if(c>=0&&u<=c)return e.copy(s);const d=o*u-c*h;if(d<=0&&o>=0&&c<=0)return r=o/(o-c),e.copy(i).addScaledVector(yi,r);ar.subVectors(t,n);const f=yi.dot(ar),p=xi.dot(ar);if(p>=0&&f<=p)return e.copy(n);const m=f*h-o*p;if(m<=0&&h>=0&&p<=0)return a=h/(h-p),e.copy(i).addScaledVector(xi,a);const g=c*p-f*u;if(g<=0&&u-c>=0&&f-p>=0)return io.subVectors(n,s),a=(u-c)/(u-c+(f-p)),e.copy(s).addScaledVector(io,a);const x=1/(g+m+d);return r=m*x,a=d*x,e.copy(i).addScaledVector(yi,r).addScaledVector(xi,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Ph={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},Ne={h:0,s:0,l:0},Os={h:0,s:0,l:0};function cr(l,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?l+(t-l)*6*e:e<1/2?t:e<2/3?l+(t-l)*6*(2/3-e):l}class V{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=$t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,qt.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=qt.workingColorSpace){return this.r=t,this.g=e,this.b=i,qt.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=qt.workingColorSpace){if(t=$r(t,1),e=H(e,0,1),i=H(i,0,1),e===0)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=cr(r,n,t+1/3),this.g=cr(r,n,t),this.b=cr(r,n,t-1/3)}return qt.toWorkingColorSpace(this,s),this}setStyle(t,e=$t){function i(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let n;const r=s[1],a=s[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,e);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,e);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=s[1],r=n.length;if(r===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(r===6)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=$t){const i=Ph[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Ie(t.r),this.g=Ie(t.g),this.b=Ie(t.b),this}copyLinearToSRGB(t){return this.r=Ei(t.r),this.g=Ei(t.g),this.b=Ei(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=$t){return qt.fromWorkingColorSpace(It.copy(this),t),Math.round(H(It.r*255,0,255))*65536+Math.round(H(It.g*255,0,255))*256+Math.round(H(It.b*255,0,255))}getHexString(t=$t){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=qt.workingColorSpace){qt.fromWorkingColorSpace(It.copy(this),e);const i=It.r,s=It.g,n=It.b,r=Math.max(i,s,n),a=Math.min(i,s,n);let o,h;const c=(a+r)/2;if(a===r)o=0,h=0;else{const u=r-a;switch(h=c<=.5?u/(r+a):u/(2-r-a),r){case i:o=(s-n)/u+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ea&&(i.blending=this.blending),this.side!==Er&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==La&&(i.blendSrc=this.blendSrc),this.blendDst!==Oa&&(i.blendDst=this.blendDst),this.blendEquation!==Ra&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Na&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Wa&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==li&&(i.stencilFail=this.stencilFail),this.stencilZFail!==li&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==li&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(n){const r=[];for(const a in n){const o=n[a];delete o.metadata,r.push(o)}return r}if(e){const n=s(t.textures),r=s(t.images);n.length>0&&(i.textures=n),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const s=e.length;i=new Array(s);for(let n=0;n!==s;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Di extends Rt{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new V(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 fe,this.combine=Jr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Ae=nu();function nu(){const l=new ArrayBuffer(4),t=new Float32Array(l),e=new Uint32Array(l),i=new Uint32Array(512),s=new Uint32Array(512);for(let o=0;o<256;++o){const h=o-127;h<-27?(i[o]=0,i[o|256]=32768,s[o]=24,s[o|256]=24):h<-14?(i[o]=1024>>-h-14,i[o|256]=1024>>-h-14|32768,s[o]=-h-1,s[o|256]=-h-1):h<=15?(i[o]=h+15<<10,i[o|256]=h+15<<10|32768,s[o]=13,s[o|256]=13):h<128?(i[o]=31744,i[o|256]=64512,s[o]=24,s[o|256]=24):(i[o]=31744,i[o|256]=64512,s[o]=13,s[o|256]=13)}const n=new Uint32Array(2048),r=new Uint32Array(64),a=new Uint32Array(64);for(let o=1;o<1024;++o){let h=o<<13,c=0;for(;(h&8388608)===0;)h<<=1,c-=8388608;h&=-8388609,c+=947912704,n[o]=h|c}for(let o=1024;o<2048;++o)n[o]=939524096+(o-1024<<13);for(let o=1;o<31;++o)r[o]=o<<23;r[31]=1199570944,r[32]=2147483648;for(let o=33;o<63;++o)r[o]=2147483648+(o-32<<23);r[63]=3347054592;for(let o=1;o<64;++o)o!==32&&(a[o]=1024);return{floatView:t,uint32View:e,baseTable:i,shiftTable:s,mantissaTable:n,exponentTable:r,offsetTable:a}}function Dt(l){Math.abs(l)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),l=H(l,-65504,65504),Ae.floatView[0]=l;const t=Ae.uint32View[0],e=t>>23&511;return Ae.baseTable[e]+((t&8388607)>>Ae.shiftTable[e])}function ls(l){const t=l>>10;return Ae.uint32View[0]=Ae.mantissaTable[Ae.offsetTable[t]+(l&1023)]+Ae.exponentTable[t],Ae.floatView[0]}const Ig={toHalfFloat:Dt,fromHalfFloat:ls},yt=new w,Ns=new B;class dt{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=An,this.updateRanges=[],this.gpuType=Li,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,n=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ut);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new w(-1/0,-1/0,-1/0),new w(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,s=e.length;i0&&(t.userData=this.userData),this.parameters!==void 0){const o=this.parameters;for(const h in o)o[h]!==void 0&&(t[h]=o[h]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const o in i){const h=i[o];t.data.attributes[o]=h.toJSON(t.data)}const s={};let n=!1;for(const o in this.morphAttributes){const h=this.morphAttributes[o],c=[];for(let u=0,d=h.length;u0&&(s[o]=c,n=!0)}n&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(t.data.groups=JSON.parse(JSON.stringify(r)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const s=t.attributes;for(const h in s){const c=s[h];this.setAttribute(h,c.clone(e))}const n=t.morphAttributes;for(const h in n){const c=[],u=n[h];for(let d=0,f=u.length;d0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=s.length;n(t.far-t.near)**2))&&(so.copy(n).invert(),Xe.copy(t.ray).applyMatrix4(so),!(i.boundingBox!==null&&Xe.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Xe)))}_computeIntersections(t,e,i){let s;const n=this.geometry,r=this.material,a=n.index,o=n.attributes.position,h=n.attributes.uv,c=n.attributes.uv1,u=n.attributes.normal,d=n.groups,f=n.drawRange;if(a!==null)if(Array.isArray(r))for(let p=0,m=d.length;pe.far?null:{distance:h,point:Hs.clone(),object:l}}function qs(l,t,e,i,s,n,r,a,o,h){l.getVertexPosition(a,Us),l.getVertexPosition(o,Vs),l.getVertexPosition(h,Gs);const c=hu(l,t,e,i,Us,Vs,Gs,ro);if(c){const u=new w;Yt.getBarycoord(ro,Us,Vs,Gs,u),s&&(c.uv=Yt.getInterpolatedAttribute(s,a,o,h,u,new B)),n&&(c.uv1=Yt.getInterpolatedAttribute(n,a,o,h,u,new B)),r&&(c.normal=Yt.getInterpolatedAttribute(r,a,o,h,u,new w),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));const d={a,b:o,c:h,normal:new w,materialIndex:0};Yt.getNormal(Us,Vs,Gs,d.normal),c.face=d,c.barycoord=u}return c}class On extends Z{constructor(t=1,e=1,i=1,s=1,n=1,r=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:n,depthSegments:r};const a=this;s=Math.floor(s),n=Math.floor(n),r=Math.floor(r);const o=[],h=[],c=[],u=[];let d=0,f=0;p("z","y","x",-1,-1,i,e,t,r,n,0),p("z","y","x",1,-1,i,e,-t,r,n,1),p("x","z","y",1,1,t,i,e,s,r,2),p("x","z","y",1,-1,t,i,-e,s,r,3),p("x","y","z",1,-1,t,e,i,s,n,4),p("x","y","z",-1,-1,t,e,-i,s,n,5),this.setIndex(o),this.setAttribute("position",new O(h,3)),this.setAttribute("normal",new O(c,3)),this.setAttribute("uv",new O(u,2));function p(m,g,x,y,b,v,_,M,A,S,C){const z=v/A,k=_/S,U=v/2,W=_/2,R=M/2,I=A+1,N=S+1;let wt=0,Bt=0;const nt=new w;for(let ht=0;ht0?1:-1,c.push(nt.x,nt.y,nt.z),u.push(Lt/A),u.push(1-ht/S),wt+=1}}for(let ht=0;ht0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class sa extends tt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Y,this.projectionMatrix=new Y,this.projectionMatrixInverse=new Y,this.coordinateSystem=Te}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const De=new w,ao=new B,oo=new B;class te extends sa{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=xs*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ii*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return xs*2*Math.atan(Math.tan(ii*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){De.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(De.x,De.y).multiplyScalar(-t/De.z),De.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(De.x,De.y).multiplyScalar(-t/De.z)}getViewSize(t,e){return this.getViewBounds(t,ao,oo),e.subVectors(oo,ao)}setViewOffset(t,e,i,s,n,r){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(ii*.5*this.fov)/this.zoom,i=2*e,s=this.aspect*i,n=-.5*s;const r=this.view;if(this.view!==null&&this.view.enabled){const o=r.fullWidth,h=r.fullHeight;n+=r.offsetX*s/o,e-=r.offsetY*i/h,s*=r.width/o,i*=r.height/h}const a=this.filmOffset;a!==0&&(n+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+s,e,e-i,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const vi=-90,wi=1;class fu extends tt{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new te(vi,wi,t,e);s.layers=this.layers,this.add(s);const n=new te(vi,wi,t,e);n.layers=this.layers,this.add(n);const r=new te(vi,wi,t,e);r.layers=this.layers,this.add(r);const a=new te(vi,wi,t,e);a.layers=this.layers,this.add(a);const o=new te(vi,wi,t,e);o.layers=this.layers,this.add(o);const h=new te(vi,wi,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[i,s,n,r,a,o]=e;for(const h of e)this.remove(h);if(t===Te)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),r.up.set(0,0,1),r.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(t===Tn)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),r.up.set(0,0,-1),r.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const h of e)this.add(h),h.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[n,r,a,o,h,c]=this.children,u=t.getRenderTarget(),d=t.getActiveCubeFace(),f=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,s),t.render(e,n),t.setRenderTarget(i,1,s),t.render(e,r),t.setRenderTarget(i,2,s),t.render(e,a),t.setRenderTarget(i,3,s),t.render(e,o),t.setRenderTarget(i,4,s),t.render(e,h),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),t.render(e,c),t.setRenderTarget(u,d,f),t.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class na extends gt{constructor(t,e,i,s,n,r,a,o,h,c){t=t!==void 0?t:[],e=e!==void 0?e:Kr,super(t,e,i,s,n,r,a,o,h,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Lg extends ea{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},s=[i,i,i,i,i,i];this.texture=new na(s,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:ee}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new On(5,5,5),n=new ia({name:"CubemapFromEquirect",uniforms:Nn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Mh,blending:vl});n.uniforms.tEquirect.value=e;const r=new Vt(s,n),a=e.minFilter;return e.minFilter===Ln&&(e.minFilter=ee),new fu(1,10,this).update(t,r),e.minFilter=a,r.geometry.dispose(),r.material.dispose(),this}clear(t,e,i,s){const n=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,s);t.setRenderTarget(n)}}class ra{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new V(t),this.density=e}clone(){return new ra(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class aa{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new V(t),this.near=e,this.far=i}clone(){return new aa(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class pu extends tt{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 fe,this.environmentIntensity=1,this.environmentRotation=new fe,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class oa{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=An,this.updateRanges=[],this.version=0,this.uuid=Jt()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,n=this.stride;st.far||e.push({distance:o,point:Ji.clone(),uv:Yt.getInterpolation(Ji,Xs,Ki,Ys,ho,fr,lo,new B),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Js(l,t,e,i,s,n){Ai.subVectors(l,e).addScalar(.5).multiply(i),s!==void 0?(Zi.x=n*Ai.x-s*Ai.y,Zi.y=s*Ai.x+n*Ai.y):Zi.copy(Ai),l.copy(t),l.x+=Zi.x,l.y+=Zi.y,l.applyMatrix4(kh)}const Zs=new w,co=new w;class mu extends tt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let i=0,s=e.length;i0){let i,s;for(i=1,s=e.length;i0){Zs.setFromMatrixPosition(this.matrixWorld);const s=t.ray.origin.distanceTo(Zs);this.getObjectForDistance(s).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){Zs.setFromMatrixPosition(t.matrixWorld),co.setFromMatrixPosition(this.matrixWorld);const i=Zs.distanceTo(co)/t.zoom;e[0].object.visible=!0;let s,n;for(s=1,n=e.length;s=r)e[s-1].object.visible=!1,e[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:e.copy(t.start).addScaledVector(i,n)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||_u.getNormalMatrix(t),s=this.coplanarPoint(gr).applyMatrix4(t),n=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(n),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ye=new Et,Qs=new w;class Rh{constructor(t=new Ii,e=new Ii,i=new Ii,s=new Ii,n=new Ii,r=new Ii){this.planes=[t,e,i,s,n,r]}set(t,e,i,s,n,r){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(s),a[4].copy(n),a[5].copy(r),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=Te){const i=this.planes,s=t.elements,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],c=s[5],u=s[6],d=s[7],f=s[8],p=s[9],m=s[10],g=s[11],x=s[12],y=s[13],b=s[14],v=s[15];if(i[0].setComponents(o-n,d-h,g-f,v-x).normalize(),i[1].setComponents(o+n,d+h,g+f,v+x).normalize(),i[2].setComponents(o+r,d+c,g+p,v+y).normalize(),i[3].setComponents(o-r,d-c,g-p,v-y).normalize(),i[4].setComponents(o-a,d-u,g-m,v-b).normalize(),e===Te)i[5].setComponents(o+a,d+u,g+m,v+b).normalize();else if(e===Tn)i[5].setComponents(a,u,m,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Ye.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Ye.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Ye)}intersectsSprite(t){return Ye.center.set(0,0,0),Ye.radius=.7071067811865476,Ye.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ye)}intersectsSphere(t){const e=this.planes,i=t.center,s=-t.radius;for(let n=0;n<6;n++)if(e[n].distanceToPoint(i)0?t.max.x:t.min.x,Qs.y=s.normal.y>0?t.max.y:t.min.y,Qs.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Qs)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function yr(l,t){return l-t}function Mu(l,t){return l.z-t.z}function Su(l,t){return t.z-l.z}class Au{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,i,s){const n=this.pool,r=this.list;this.index>=n.length&&n.push({start:-1,count:-1,z:-1,index:-1});const a=n[this.index];r.push(a),this.index++,a.start=t,a.count=e,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}}const Nt=new Y,Tu=new V(1,1,1),xr=new Rh,$s=new Ut,Je=new Et,$i=new w,vo=new w,Iu=new w,br=new Au,Ct=new Vt,tn=[];function Cu(l,t,e=0){const i=t.itemSize;if(l.isInterleavedBufferAttribute||l.array.constructor!==t.array.constructor){const s=l.count;for(let n=0;n65535?new Uint32Array(s):new Uint16Array(s);e.setIndex(new dt(n,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in e.attributes){if(!t.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=t.getAttribute(i),n=e.getAttribute(i);if(s.itemSize!==n.itemSize||s.normalized!==n.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){const e=this._instanceInfo;if(t<0||t>=e.length||e[t].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){const e=this._geometryInfo;if(t<0||t>=e.length||e[t].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ut);const t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let i=0,s=e.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:t};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(yr),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const n=this._matricesTexture;Nt.identity().toArray(n.image.data,s*16),n.needsUpdate=!0;const r=this._colorsTexture;return r&&(Tu.toArray(r.image.data,s*4),r.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(t,e=-1,i=-1){this._initializeGeometry(t),this._validateGeometry(t);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},n=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=e===-1?t.getAttribute("position").count:e;const r=t.getIndex();if(r!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?r.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let o;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(yr),o=this._availableGeometryIds.shift(),n[o]=s):(o=this._geometryCount,this._geometryCount++,n.push(s)),this.setGeometryAt(o,t),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,o}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const i=this.geometry,s=i.getIndex()!==null,n=i.getIndex(),r=e.getIndex(),a=this._geometryInfo[t];if(s&&r.count>a.reservedIndexCount||e.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const o=a.vertexStart,h=a.reservedVertexCount;a.vertexCount=e.getAttribute("position").count;for(const c in i.attributes){const u=e.getAttribute(c),d=i.getAttribute(c);Cu(u,d,o);const f=u.itemSize;for(let p=u.count,m=h;p=e.length||e[t].active===!1)return this;const i=this._instanceInfo;for(let s=0,n=i.length;sa).sort((r,a)=>i[r].vertexStart-i[a].vertexStart),n=this.geometry;for(let r=0,a=i.length;r=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[t];if(s.boundingBox===null){const n=new Ut,r=i.index,a=i.attributes.position;for(let o=s.start,h=s.start+s.count;o=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[t];if(s.boundingSphere===null){const n=new Et;this.getBoundingBoxAt(t,$s),$s.getCenter(n.center);const r=i.index,a=i.attributes.position;let o=0;for(let h=s.start,c=s.start+s.count;ha.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>t)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(o=>o.indexStart+o.reservedIndexCount))>e)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);const n=this.geometry;n.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Z,this._initializeGeometry(n));const r=this.geometry;n.index&&Ze(n.index.array,r.index.array);for(const a in n.attributes)Ze(n.attributes[a].array,r.attributes[a].array)}raycast(t,e){const i=this._instanceInfo,s=this._geometryInfo,n=this.matrixWorld,r=this.geometry;Ct.material=this.material,Ct.geometry.index=r.index,Ct.geometry.attributes=r.attributes,Ct.geometry.boundingBox===null&&(Ct.geometry.boundingBox=new Ut),Ct.geometry.boundingSphere===null&&(Ct.geometry.boundingSphere=new Et);for(let a=0,o=i.length;a({...e,boundingBox:e.boundingBox!==null?e.boundingBox.clone():null,boundingSphere:e.boundingSphere!==null?e.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(e=>({...e})),this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(t,e,i,s,n){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const r=s.getIndex(),a=r===null?1:r.array.BYTES_PER_ELEMENT,o=this._instanceInfo,h=this._multiDrawStarts,c=this._multiDrawCounts,u=this._geometryInfo,d=this.perObjectFrustumCulled,f=this._indirectTexture,p=f.image.data;d&&(Nt.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),xr.setFromProjectionMatrix(Nt,t.coordinateSystem));let m=0;if(this.sortObjects){Nt.copy(this.matrixWorld).invert(),$i.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Nt),vo.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Nt);for(let y=0,b=o.length;y0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=s.length;ni)return;vr.applyMatrix4(l.matrixWorld);const o=t.ray.origin.distanceTo(vr);if(!(ot.far))return{distance:o,point:_o.clone().applyMatrix4(l.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:l}}const Mo=new w,So=new w;class Fe extends ni{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[];for(let s=0,n=e.count;s0){const s=e[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=s.length;ns.far)return;n.push({distance:h,distanceToRay:Math.sqrt(a),point:o,index:t,face:null,faceIndex:null,barycoord:null,object:r})}}class Oh extends tt{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Og extends gt{constructor(t,e,i,s,n,r,a,o,h){super(t,e,i,s,n,r,a,o,h),this.isVideoTexture=!0,this.minFilter=r!==void 0?r:ee,this.magFilter=n!==void 0?n:ee,this.generateMipmaps=!1;const c=this;function u(){c.needsUpdate=!0,t.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ng extends gt{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=he,this.minFilter=he,this.generateMipmaps=!1,this.needsUpdate=!0}}class la extends gt{constructor(t,e,i,s,n,r,a,o,h,c,u,d){super(null,r,a,o,h,c,s,n,u,d),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Dg extends la{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=ue,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class Ug extends la{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,Kr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class Nh extends gt{constructor(t,e,i,s,n,r,a,o,h){super(t,e,i,s,n,r,a,o,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Vg extends gt{constructor(t,e,i,s,n,r,a,o,h,c=qn){if(c!==qn&&c!==Ua)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&c===qn&&(i=jr),i===void 0&&c===Ua&&(i=Ol),super(null,s,n,r,a,o,c,i,h),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:he,this.minFilter=o!==void 0?o:he,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class me{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,s=this.getPoint(0),n=0;e.push(0);for(let r=1;r<=t;r++)i=this.getPoint(r/t),n+=i.distanceTo(s),e.push(n),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let s=0;const n=i.length;let r;e?r=e:r=t*i[n-1];let a=0,o=n-1,h;for(;a<=o;)if(s=Math.floor(a+(o-a)/2),h=i[s]-r,h<0)a=s+1;else if(h>0)o=s-1;else{o=s;break}if(s=o,i[s]===r)return s/(n-1);const c=i[s],d=i[s+1]-c,f=(r-c)/d;return(s+f)/(n-1)}getTangent(t,e){let s=t-1e-4,n=t+1e-4;s<0&&(s=0),n>1&&(n=1);const r=this.getPoint(s),a=this.getPoint(n),o=e||(r.isVector2?new B:new w);return o.copy(a).sub(r).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new w,s=[],n=[],r=[],a=new w,o=new Y;for(let f=0;f<=t;f++){const p=f/t;s[f]=this.getTangentAt(p,new w)}n[0]=new w,r[0]=new w;let h=Number.MAX_VALUE;const c=Math.abs(s[0].x),u=Math.abs(s[0].y),d=Math.abs(s[0].z);c<=h&&(h=c,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),d<=h&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),n[0].crossVectors(s[0],a),r[0].crossVectors(s[0],n[0]);for(let f=1;f<=t;f++){if(n[f]=n[f-1].clone(),r[f]=r[f-1].clone(),a.crossVectors(s[f-1],s[f]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(H(s[f-1].dot(s[f]),-1,1));n[f].applyMatrix4(o.makeRotationAxis(a,p))}r[f].crossVectors(s[f],n[f])}if(e===!0){let f=Math.acos(H(n[0].dot(n[t]),-1,1));f/=t,s[0].dot(a.crossVectors(n[0],n[t]))>0&&(f=-f);for(let p=1;p<=t;p++)n[p].applyMatrix4(o.makeRotationAxis(s[p],f*p)),r[p].crossVectors(s[p],n[p])}return{tangents:s,normals:n,binormals:r}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ca extends me{constructor(t=0,e=0,i=1,s=1,n=0,r=Math.PI*2,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=n,this.aEndAngle=r,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new B){const i=e,s=Math.PI*2;let n=this.aEndAngle-this.aStartAngle;const r=Math.abs(n)s;)n-=s;n0?0:(Math.floor(Math.abs(a)/n)+1)*n:o===0&&a===n-1&&(a=n-2,o=1);let h,c;this.closed||a>0?h=s[(a-1)%n]:(an.subVectors(s[0],s[1]).add(s[0]),h=an);const u=s[a%n],d=s[(a+1)%n];if(this.closed||a+2s.length-2?s.length-1:r+1],u=s[r>s.length-3?s.length-1:r+2];return i.set(Io(a,o.x,h.x,c.x,u.x),Io(a,o.y,h.y,c.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const r=s[n]-i,a=this.curves[n],o=a.getLength(),h=o===0?0:1-r/o;return a.getPointAt(h,e)}n++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,s=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const u=h.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(h);const c=h.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Dn extends Z{constructor(t=[new B(0,-.5),new B(.5,0),new B(0,.5)],e=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:s},e=Math.floor(e),s=H(s,0,Math.PI*2);const n=[],r=[],a=[],o=[],h=[],c=1/e,u=new w,d=new B,f=new w,p=new w,m=new w;let g=0,x=0;for(let y=0;y<=t.length-1;y++)switch(y){case 0:g=t[y+1].x-t[y].x,x=t[y+1].y-t[y].y,f.x=x*1,f.y=-g,f.z=x*0,m.copy(f),f.normalize(),o.push(f.x,f.y,f.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:g=t[y+1].x-t[y].x,x=t[y+1].y-t[y].y,f.x=x*1,f.y=-g,f.z=x*0,p.copy(f),f.x+=m.x,f.y+=m.y,f.z+=m.z,f.normalize(),o.push(f.x,f.y,f.z),m.copy(p)}for(let y=0;y<=e;y++){const b=i+y*c*s,v=Math.sin(b),_=Math.cos(b);for(let M=0;M<=t.length-1;M++){u.x=t[M].x*v,u.y=t[M].y,u.z=t[M].x*_,r.push(u.x,u.y,u.z),d.x=y/e,d.y=M/(t.length-1),a.push(d.x,d.y);const A=o[3*M+0]*v,S=o[3*M+1],C=o[3*M+0]*_;h.push(A,S,C)}}for(let y=0;y0&&b(!0),e>0&&b(!1)),this.setIndex(c),this.setAttribute("position",new O(u,3)),this.setAttribute("normal",new O(d,3)),this.setAttribute("uv",new O(f,2));function y(){const v=new w,_=new w;let M=0;const A=(e-t)/i;for(let S=0;S<=n;S++){const C=[],z=S/n,k=z*(e-t)+t;for(let U=0;U<=s;U++){const W=U/s,R=W*o+a,I=Math.sin(R),N=Math.cos(R);_.x=k*I,_.y=-z*i+g,_.z=k*N,u.push(_.x,_.y,_.z),v.set(I,A,N).normalize(),d.push(v.x,v.y,v.z),f.push(W,1-z),C.push(p++)}m.push(C)}for(let S=0;S0||C!==0)&&(c.push(z,k,W),M+=3),(e>0||C!==n-1)&&(c.push(k,U,W),M+=3)}h.addGroup(x,M,0),x+=M}function b(v){const _=p,M=new B,A=new w;let S=0;const C=v===!0?t:e,z=v===!0?1:-1;for(let U=1;U<=s;U++)u.push(0,g*z,0),d.push(0,z,0),f.push(.5,.5),p++;const k=p;for(let U=0;U<=s;U++){const R=U/s*o+a,I=Math.cos(R),N=Math.sin(R);A.x=C*N,A.y=g*z,A.z=C*I,u.push(A.x,A.y,A.z),d.push(0,z,0),M.x=I*.5+.5,M.y=N*.5*z+.5,f.push(M.x,M.y),p++}for(let U=0;U.9&&A<.1&&(b<.2&&(r[y+0]+=1),v<.2&&(r[y+2]+=1),_<.2&&(r[y+4]+=1))}}function d(y){n.push(y.x,y.y,y.z)}function f(y,b){const v=y*3;b.x=t[v+0],b.y=t[v+1],b.z=t[v+2]}function p(){const y=new w,b=new w,v=new w,_=new w,M=new B,A=new B,S=new B;for(let C=0,z=0;C80*e){a=h=l[0],o=c=l[1];for(let p=e;ph&&(h=u),d>c&&(c=d);f=Math.max(h-a,c-o),f=f!==0?32767/f:0}return vs(n,r,e,a,o,f,0),r}};function Hh(l,t,e,i,s){let n,r;if(s===od(l,t,e,i)>0)for(n=t;n=t;n-=i)r=Co(n,l[n],l[n+1],r);return r&&Un(r,r.next)&&(_s(r),r=r.next),r}function ri(l,t){if(!l)return l;t||(t=l);let e=l,i;do if(i=!1,!e.steiner&&(Un(e,e.next)||ut(e.prev,e,e.next)===0)){if(_s(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function vs(l,t,e,i,s,n,r){if(!l)return;!r&&n&&ed(l,i,s,n);let a=l,o,h;for(;l.prev!==l.next;){if(o=l.prev,h=l.next,n?Yu(l,i,s,n):Xu(l)){t.push(o.i/e|0),t.push(l.i/e|0),t.push(h.i/e|0),_s(l),l=h.next,a=h.next;continue}if(l=h,l===a){r?r===1?(l=Ju(ri(l),t,e),vs(l,t,e,i,s,n,2)):r===2&&Zu(l,t,e,i,s,n):vs(ri(l),t,e,i,s,n,1);break}}}function Xu(l){const t=l.prev,e=l,i=l.next;if(ut(t,e,i)>=0)return!1;const s=t.x,n=e.x,r=i.x,a=t.y,o=e.y,h=i.y,c=sn?s>r?s:r:n>r?n:r,f=a>o?a>h?a:h:o>h?o:h;let p=i.next;for(;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&ki(s,a,n,o,r,h,p.x,p.y)&&ut(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Yu(l,t,e,i){const s=l.prev,n=l,r=l.next;if(ut(s,n,r)>=0)return!1;const a=s.x,o=n.x,h=r.x,c=s.y,u=n.y,d=r.y,f=ao?a>h?a:h:o>h?o:h,g=c>u?c>d?c:d:u>d?u:d,x=Dr(f,p,t,e,i),y=Dr(m,g,t,e,i);let b=l.prevZ,v=l.nextZ;for(;b&&b.z>=x&&v&&v.z<=y;){if(b.x>=f&&b.x<=m&&b.y>=p&&b.y<=g&&b!==s&&b!==r&&ki(a,c,o,u,h,d,b.x,b.y)&&ut(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==r&&ki(a,c,o,u,h,d,v.x,v.y)&&ut(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=x;){if(b.x>=f&&b.x<=m&&b.y>=p&&b.y<=g&&b!==s&&b!==r&&ki(a,c,o,u,h,d,b.x,b.y)&&ut(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==r&&ki(a,c,o,u,h,d,v.x,v.y)&&ut(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Ju(l,t,e){let i=l;do{const s=i.prev,n=i.next.next;!Un(s,n)&&qh(s,i,i.next,n)&&ws(s,n)&&ws(n,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(n.i/e|0),_s(i),_s(i.next),i=l=n),i=i.next}while(i!==l);return ri(i)}function Zu(l,t,e,i,s,n){let r=l;do{let a=r.next.next;for(;a!==r.prev;){if(r.i!==a.i&&nd(r,a)){let o=Xh(r,a);r=ri(r,r.next),o=ri(o,o.next),vs(r,t,e,i,s,n,0),vs(o,t,e,i,s,n,0);return}a=a.next}r=r.next}while(r!==l)}function Ku(l,t,e,i){const s=[];let n,r,a,o,h;for(n=0,r=t.length;n=e.next.y&&e.next.y!==e.y){const d=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=n&&d>i&&(i=d,s=e.x=e.x&&e.x>=o&&n!==e.x&&ki(rs.x||e.x===s.x&&td(s,e)))&&(s=e,c=u)),e=e.next;while(e!==a);return s}function td(l,t){return ut(l.prev,l,t.prev)<0&&ut(t.next,l,l.next)<0}function ed(l,t,e,i){let s=l;do s.z===0&&(s.z=Dr(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==l);s.prevZ.nextZ=null,s.prevZ=null,id(s)}function id(l){let t,e,i,s,n,r,a,o,h=1;do{for(e=l,l=null,n=null,r=0;e;){for(r++,i=e,a=0,t=0;t0||o>0&&i;)a!==0&&(o===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,a--):(s=i,i=i.nextZ,o--),n?n.nextZ=s:l=s,s.prevZ=n,n=s;e=i}n.nextZ=null,h*=2}while(r>1);return l}function Dr(l,t,e,i,s){return l=(l-e)*s|0,t=(t-i)*s|0,l=(l|l<<8)&16711935,l=(l|l<<4)&252645135,l=(l|l<<2)&858993459,l=(l|l<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,l|t<<1}function sd(l){let t=l,e=l;do(t.x=(l-r)*(n-a)&&(l-r)*(i-a)>=(e-r)*(t-a)&&(e-r)*(n-a)>=(s-r)*(i-a)}function nd(l,t){return l.next.i!==t.i&&l.prev.i!==t.i&&!rd(l,t)&&(ws(l,t)&&ws(t,l)&&ad(l,t)&&(ut(l.prev,l,t.prev)||ut(l,t.prev,t))||Un(l,t)&&ut(l.prev,l,l.next)>0&&ut(t.prev,t,t.next)>0)}function ut(l,t,e){return(t.y-l.y)*(e.x-t.x)-(t.x-l.x)*(e.y-t.y)}function Un(l,t){return l.x===t.x&&l.y===t.y}function qh(l,t,e,i){const s=un(ut(l,t,e)),n=un(ut(l,t,i)),r=un(ut(e,i,l)),a=un(ut(e,i,t));return!!(s!==n&&r!==a||s===0&&cn(l,e,t)||n===0&&cn(l,i,t)||r===0&&cn(e,l,i)||a===0&&cn(e,t,i))}function cn(l,t,e){return t.x<=Math.max(l.x,e.x)&&t.x>=Math.min(l.x,e.x)&&t.y<=Math.max(l.y,e.y)&&t.y>=Math.min(l.y,e.y)}function un(l){return l>0?1:l<0?-1:0}function rd(l,t){let e=l;do{if(e.i!==l.i&&e.next.i!==l.i&&e.i!==t.i&&e.next.i!==t.i&&qh(e,e.next,l,t))return!0;e=e.next}while(e!==l);return!1}function ws(l,t){return ut(l.prev,l,l.next)<0?ut(l,t,l.next)>=0&&ut(l,l.prev,t)>=0:ut(l,t,l.prev)<0||ut(l,l.next,t)<0}function ad(l,t){let e=l,i=!1;const s=(l.x+t.x)/2,n=(l.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&s<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==l);return i}function Xh(l,t){const e=new Ur(l.i,l.x,l.y),i=new Ur(t.i,t.x,t.y),s=l.next,n=t.prev;return l.next=t,t.prev=l,e.next=s,s.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function Co(l,t,e,i){const s=new Ur(l,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function _s(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function Ur(l,t,e){this.i=l,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function od(l,t,e,i){let s=0;for(let n=t,r=e-i;n2&&l[t-1].equals(l[0])&&l.pop()}function Bo(l,t){for(let e=0;eNumber.EPSILON){const ie=Math.sqrt(ke),Cs=Math.sqrt(_t*_t+bt*bt),J=P.x-ot/ie,at=P.y+Q/ie,le=E.x-bt/Cs,se=E.y+_t/Cs,xe=((le-J)*bt-(se-at)*_t)/(Q*bt-ot*_t);G=J+Q*xe-F.x,L=at+ot*xe-F.y;const zs=G*G+L*L;if(zs<=2)return new B(G,L);j=Math.sqrt(zs/2)}else{let ie=!1;Q>Number.EPSILON?_t>Number.EPSILON&&(ie=!0):Q<-Number.EPSILON?_t<-Number.EPSILON&&(ie=!0):Math.sign(ot)===Math.sign(bt)&&(ie=!0),ie?(G=-ot,L=Q,j=Math.sqrt(ke)):(G=Q,L=ot,j=Math.sqrt(ke/2))}return new B(G/j,L/j)}const nt=[];for(let F=0,P=R.length,E=P-1,G=F+1;F=0;F--){const P=F/g,E=f*Math.cos(P*Math.PI/2),G=p*Math.sin(P*Math.PI/2)+m;for(let L=0,j=R.length;L=0;){const G=E;let L=E-1;L<0&&(L=F.length-1);for(let j=0,Q=c+g*2;j0)&&f.push(b,v,M),(x!==i-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class md extends Rt{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new V(16777215),this.specular=new V(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new V(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ni,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new fe,this.combine=Jr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class gd extends Rt{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new V(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new V(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ni,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class yd extends Rt{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ni,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class xd extends Rt{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new V(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new V(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ni,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new fe,this.combine=Jr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class bd extends Rt{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ic,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class vd extends Rt{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class wd extends Rt{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new V(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ni,this.normalScale=new B(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class _d extends Gt{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function ei(l,t,e){return!l||!e&&l.constructor===t?l:typeof t.BYTES_PER_ELEMENT=="number"?new t(l):Array.prototype.slice.call(l)}function Yh(l){return ArrayBuffer.isView(l)&&!(l instanceof DataView)}function Jh(l){function t(s,n){return l[s]-l[n]}const e=l.length,i=new Array(e);for(let s=0;s!==e;++s)i[s]=s;return i.sort(t),i}function Vr(l,t,e){const i=l.length,s=new l.constructor(i);for(let n=0,r=0;r!==i;++n){const a=e[n]*t;for(let o=0;o!==t;++o)s[r++]=l[a+o]}return s}function Ta(l,t,e,i){let s=1,n=l[0];for(;n!==void 0&&n[i]===void 0;)n=l[s++];if(n===void 0)return;let r=n[i];if(r!==void 0)if(Array.isArray(r))do r=n[i],r!==void 0&&(t.push(n.time),e.push.apply(e,r)),n=l[s++];while(n!==void 0);else if(r.toArray!==void 0)do r=n[i],r!==void 0&&(t.push(n.time),r.toArray(e,e.length)),n=l[s++];while(n!==void 0);else do r=n[i],r!==void 0&&(t.push(n.time),e.push(r)),n=l[s++];while(n!==void 0)}function Md(l,t,e,i,s=30){const n=l.clone();n.name=t;const r=[];for(let o=0;o=i)){u.push(h.times[f]);for(let m=0;mn.tracks[o].times[0]&&(a=n.tracks[o].times[0]);for(let o=0;o=a.times[p]){const x=p*u+c,y=x+u-c;m=a.values.slice(x,y)}else{const x=a.createInterpolant(),y=c,b=u-c;x.evaluate(n),m=x.resultBuffer.slice(y,b)}o==="quaternion"&&new Zt().fromArray(m).normalize().conjugate().toArray(m);const g=h.times.length;for(let x=0;x=n)){const a=e[1];t=n)break e}r=i,i=0;break i}break t}for(;i>>1;te;)--r;if(++r,n!==0||r!==s){n>=r&&(r=Math.max(r,1),n=r-1);const a=this.getValueSize();this.times=i.slice(n,r),this.values=this.values.slice(n*a,r*a)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,s=this.values,n=i.length;n===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let r=null;for(let a=0;a!==n;a++){const o=i[a];if(typeof o=="number"&&isNaN(o)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,o),t=!1;break}if(r!==null&&r>o){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,o,r),t=!1;break}r=o}if(s!==void 0&&Yh(s))for(let a=0,o=s.length;a!==o;++a){const h=s[a];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,h),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Xn,n=t.length-1;let r=1;for(let a=1;a0){t[r]=t[n];for(let a=n*i,o=r*i,h=0;h!==i;++h)e[o+h]=e[a+h];++r}return r!==t.length?(this.times=t.slice(0,r),this.values=e.slice(0,r*i)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),i=this.constructor,s=new i(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}}ge.prototype.TimeBufferType=Float32Array;ge.prototype.ValueBufferType=Float32Array;ge.prototype.DefaultInterpolation=Or;class Ui extends ge{constructor(t,e,i){super(t,e,i)}}Ui.prototype.ValueTypeName="bool";Ui.prototype.ValueBufferType=Array;Ui.prototype.DefaultInterpolation=Mn;Ui.prototype.InterpolantFactoryMethodLinear=void 0;Ui.prototype.InterpolantFactoryMethodSmooth=void 0;class Kh extends ge{}Kh.prototype.ValueTypeName="color";class Pn extends ge{}Pn.prototype.ValueTypeName="number";class Id extends Gn{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){const n=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=(i-e)/(s-e);let h=t*a;for(let c=h+a;h!==c;h+=4)Zt.slerpFlat(n,0,r,h-a,r,h,o);return n}}class Wn extends ge{InterpolantFactoryMethodLinear(t){return new Id(this.times,this.values,this.getValueSize(),t)}}Wn.prototype.ValueTypeName="quaternion";Wn.prototype.InterpolantFactoryMethodSmooth=void 0;class Vi extends ge{constructor(t,e,i){super(t,e,i)}}Vi.prototype.ValueTypeName="string";Vi.prototype.ValueBufferType=Array;Vi.prototype.DefaultInterpolation=Mn;Vi.prototype.InterpolantFactoryMethodLinear=void 0;Vi.prototype.InterpolantFactoryMethodSmooth=void 0;class kn extends ge{}kn.prototype.ValueTypeName="vector";class En{constructor(t="",e=-1,i=[],s=Qr){this.name=t,this.tracks=i,this.duration=e,this.blendMode=s,this.uuid=Jt(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,s=1/(t.fps||1);for(let r=0,a=i.length;r!==a;++r)e.push(zd(i[r]).scale(s));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],i=t.tracks,s={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let n=0,r=i.length;n!==r;++n)e.push(ge.toJSON(i[n]));return s}static CreateFromMorphTargetSequence(t,e,i,s){const n=e.length,r=[];for(let a=0;a1){const u=c[1];let d=s[u];d||(s[u]=d=[]),d.push(h)}}const r=[];for(const a in s)r.push(this.CreateFromMorphTargetSequence(a,s[a],e,i));return r}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(u,d,f,p,m){if(f.length!==0){const g=[],x=[];Ta(f,g,x,p),g.length!==0&&m.push(new u(d,g,x))}},s=[],n=t.name||"default",r=t.fps||30,a=t.blendMode;let o=t.length||-1;const h=t.hierarchy||[];for(let u=0;u{e&&e(n),this.manager.itemEnd(t)},0),n;if(Se[t]!==void 0){Se[t].push({onLoad:e,onProgress:i,onError:s});return}Se[t]=[],Se[t].push({onLoad:e,onProgress:i,onError:s});const r=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(r).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const c=Se[t],u=h.body.getReader(),d=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),f=d?parseInt(d):0,p=f!==0;let m=0;const g=new ReadableStream({start(x){y();function y(){u.read().then(({done:b,value:v})=>{if(b)x.close();else{m+=v.byteLength;const _=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:f});for(let M=0,A=c.length;M{x.error(b)})}}});return new Response(g)}else throw new Fd(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(o){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(c=>new DOMParser().parseFromString(c,a));case"json":return h.json();default:if(a===void 0)return h.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return h.arrayBuffer().then(p=>f.decode(p))}}}).then(h=>{Ve.add(t,h);const c=Se[t];delete Se[t];for(let u=0,d=c.length;u{const c=Se[t];if(c===void 0)throw this.manager.itemError(t),h;delete Se[t];for(let u=0,d=c.length;u{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Wg extends Kt{constructor(t){super(t)}load(t,e,i,s){const n=this,r=new Ge(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(t,function(a){try{e(n.parse(JSON.parse(a)))}catch(o){s?s(o):console.error(o),n.manager.itemError(t)}},i,s)}parse(t){const e=[];for(let i=0;i0:s.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const n in t.uniforms){const r=t.uniforms[n];switch(s.uniforms[n]={},r.type){case"t":s.uniforms[n].value=i(r.value);break;case"c":s.uniforms[n].value=new V().setHex(r.value);break;case"v2":s.uniforms[n].value=new B().fromArray(r.value);break;case"v3":s.uniforms[n].value=new w().fromArray(r.value);break;case"v4":s.uniforms[n].value=new St().fromArray(r.value);break;case"m3":s.uniforms[n].value=new pe().fromArray(r.value);break;case"m4":s.uniforms[n].value=new Y().fromArray(r.value);break;default:s.uniforms[n].value=r.value}}if(t.defines!==void 0&&(s.defines=t.defines),t.vertexShader!==void 0&&(s.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(s.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(s.glslVersion=t.glslVersion),t.extensions!==void 0)for(const n in t.extensions)s.extensions[n]=t.extensions[n];if(t.lights!==void 0&&(s.lights=t.lights),t.clipping!==void 0&&(s.clipping=t.clipping),t.size!==void 0&&(s.size=t.size),t.sizeAttenuation!==void 0&&(s.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(s.map=i(t.map)),t.matcap!==void 0&&(s.matcap=i(t.matcap)),t.alphaMap!==void 0&&(s.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(s.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(s.bumpScale=t.bumpScale),t.normalMap!==void 0&&(s.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(s.normalMapType=t.normalMapType),t.normalScale!==void 0){let n=t.normalScale;Array.isArray(n)===!1&&(n=[n,n]),s.normalScale=new B().fromArray(n)}return t.displacementMap!==void 0&&(s.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(s.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(s.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(s.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(s.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(s.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(s.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(s.specularMap=i(t.specularMap)),t.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(t.specularIntensityMap)),t.specularColorMap!==void 0&&(s.specularColorMap=i(t.specularColorMap)),t.envMap!==void 0&&(s.envMap=i(t.envMap)),t.envMapRotation!==void 0&&s.envMapRotation.fromArray(t.envMapRotation),t.envMapIntensity!==void 0&&(s.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(s.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(s.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(s.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(s.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(s.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(s.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(s.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(s.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new B().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(s.iridescenceMap=i(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(s.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(s.thicknessMap=i(t.thicknessMap)),t.anisotropyMap!==void 0&&(s.anisotropyMap=i(t.anisotropyMap)),t.sheenColorMap!==void 0&&(s.sheenColorMap=i(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(t.sheenRoughnessMap)),s}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return Ca.createMaterialFromType(t)}static createMaterialFromType(t){const e={ShadowMaterial:dd,SpriteMaterial:fs,RawShaderMaterial:fd,ShaderMaterial:ia,PointsMaterial:Lh,MeshPhysicalMaterial:pd,MeshStandardMaterial:Aa,MeshPhongMaterial:md,MeshToonMaterial:gd,MeshNormalMaterial:yd,MeshLambertMaterial:xd,MeshDepthMaterial:bd,MeshDistanceMaterial:vd,MeshBasicMaterial:Di,MeshMatcapMaterial:wd,LineDashedMaterial:_d,LineBasicMaterial:Gt,Material:Rt};return new e[t]}}class Lo{static decodeText(t){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let i=0,s=t.length;i0){const o=new jh(e);n=new Rn(o),n.setCrossOrigin(this.crossOrigin);for(let h=0,c=t.length;h0){s=new Rn(this.manager),s.setCrossOrigin(this.crossOrigin);for(let r=0,a=t.length;r{const g=new Ut;g.min.fromArray(m.boxMin),g.max.fromArray(m.boxMax);const x=new Et;return x.radius=m.sphereRadius,x.center.fromArray(m.sphereCenter),{boxInitialized:m.boxInitialized,box:g,sphereInitialized:m.sphereInitialized,sphere:x}}),r._maxInstanceCount=t.maxInstanceCount,r._maxVertexCount=t.maxVertexCount,r._maxIndexCount=t.maxIndexCount,r._geometryInitialized=t.geometryInitialized,r._geometryCount=t.geometryCount,r._matricesTexture=h(t.matricesTexture.uuid),t.colorsTexture!==void 0&&(r._colorsTexture=h(t.colorsTexture.uuid));break;case"LOD":r=new mu;break;case"Line":r=new ni(a(t.geometry),o(t.material));break;case"LineLoop":r=new Bu(a(t.geometry),o(t.material));break;case"LineSegments":r=new Fe(a(t.geometry),o(t.material));break;case"PointCloud":case"Points":r=new Fu(a(t.geometry),o(t.material));break;case"Sprite":r=new cs(o(t.material));break;case"Group":r=new Oh;break;case"Bone":r=new Eh;break;default:r=new tt}if(r.uuid=t.uuid,t.name!==void 0&&(r.name=t.name),t.matrix!==void 0?(r.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(r.matrixAutoUpdate=t.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(t.position!==void 0&&r.position.fromArray(t.position),t.rotation!==void 0&&r.rotation.fromArray(t.rotation),t.quaternion!==void 0&&r.quaternion.fromArray(t.quaternion),t.scale!==void 0&&r.scale.fromArray(t.scale)),t.up!==void 0&&r.up.fromArray(t.up),t.castShadow!==void 0&&(r.castShadow=t.castShadow),t.receiveShadow!==void 0&&(r.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.intensity!==void 0&&(r.shadow.intensity=t.shadow.intensity),t.shadow.bias!==void 0&&(r.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(r.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(r.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&r.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(r.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(r.visible=t.visible),t.frustumCulled!==void 0&&(r.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(r.renderOrder=t.renderOrder),t.userData!==void 0&&(r.userData=t.userData),t.layers!==void 0&&(r.layers.mask=t.layers),t.children!==void 0){const d=t.children;for(let f=0;f"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,s){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const n=this,r=Ve.get(t);if(r!==void 0){if(n.manager.itemStart(t),r.then){r.then(h=>{e&&e(h),n.manager.itemEnd(t)}).catch(h=>{s&&s(h)});return}return setTimeout(function(){e&&e(r),n.manager.itemEnd(t)},0),r}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const o=fetch(t,a).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(h){return Ve.add(t,h),e&&e(h),n.manager.itemEnd(t),h}).catch(function(h){s&&s(h),Ve.remove(t),n.manager.itemError(t),n.manager.itemEnd(t)});Ve.add(t,o),n.manager.itemStart(t)}}let dn;class $h{static getContext(){return dn===void 0&&(dn=new(window.AudioContext||window.webkitAudioContext)),dn}static setContext(t){dn=t}}class Kg extends Kt{constructor(t){super(t)}load(t,e,i,s){const n=this,r=new Ge(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(t,function(o){try{const h=o.slice(0);$h.getContext().decodeAudioData(h,function(u){e(u)}).catch(a)}catch(h){a(h)}},i,s);function a(o){s?s(o):console.error(o),n.manager.itemError(t)}}}const Do=new Y,Uo=new Y,Ke=new Y;class jg{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new te,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new te,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,Ke.copy(t.projectionMatrix);const s=e.eyeSep/2,n=s*e.near/e.focus,r=e.near*Math.tan(ii*e.fov*.5)/e.zoom;let a,o;Uo.elements[12]=-s,Do.elements[12]=s,a=-r*e.aspect+n,o=r*e.aspect+n,Ke.elements[0]=2*e.near/(o-a),Ke.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(Ke),a=-r*e.aspect-n,o=r*e.aspect-n,Ke.elements[0]=2*e.near/(o-a),Ke.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(Ke)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Uo),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Do)}}class Qg extends te{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Xd{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Vo(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Vo();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Vo(){return performance.now()}const je=new w,Go=new Zt,Yd=new w,Qe=new w;class $g extends tt{constructor(){super(),this.type="AudioListener",this.context=$h.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Xd}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(je,Go,Yd),Qe.set(0,0,-1).applyQuaternion(Go),e.positionX){const s=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(je.x,s),e.positionY.linearRampToValueAtTime(je.y,s),e.positionZ.linearRampToValueAtTime(je.z,s),e.forwardX.linearRampToValueAtTime(Qe.x,s),e.forwardY.linearRampToValueAtTime(Qe.y,s),e.forwardZ.linearRampToValueAtTime(Qe.z,s),e.upX.linearRampToValueAtTime(i.x,s),e.upY.linearRampToValueAtTime(i.y,s),e.upZ.linearRampToValueAtTime(i.z,s)}else e.setPosition(je.x,je.y,je.z),e.setOrientation(Qe.x,Qe.y,Qe.z,i.x,i.y,i.z)}}class Jd extends tt{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(t=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,s,this._addIndex*e,1,e);for(let o=e,h=e+e;o!==h;++o)if(i[o]!==i[o+e]){a.setValue(i,s);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,s=i*this._origIndex;t.getValue(e,s);for(let n=i,r=s;n!==r;++n)e[n]=e[s+n%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let r=0;r!==n;++r)t[e+r]=t[i+r]}_slerp(t,e,i,s){Zt.slerpFlat(t,e,t,e,t,i,s)}_slerpAdditive(t,e,i,s,n){const r=this._workIndex*n;Zt.multiplyQuaternionsFlat(t,r,t,e,t,i),Zt.slerpFlat(t,e,t,e,t,r,s)}_lerp(t,e,i,s,n){const r=1-s;for(let a=0;a!==n;++a){const o=e+a;t[o]=t[o]*r+t[i+a]*s}}_lerpAdditive(t,e,i,s,n){for(let r=0;r!==n;++r){const a=e+r;t[a]=t[a]+t[i+r]*s}}}const za="\\[\\]\\.:\\/",jd=new RegExp("["+za+"]","g"),Ba="[^"+za+"]",Qd="[^"+za.replace("\\.","")+"]",$d=/((?:WC+[\/:])*)/.source.replace("WC",Ba),tf=/(WCOD+)?/.source.replace("WCOD",Qd),ef=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ba),sf=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ba),nf=new RegExp("^"+$d+tf+ef+sf+"$"),rf=["material","materials","bones","map"];class af{constructor(t,e,i){const s=i||$.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,n=i.length;s!==n;++s)i[s].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class ${constructor(t,e,i){this.path=e,this.parsedPath=i||$.parseTrackName(e),this.node=$.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new $.Composite(t,e,i):new $(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(jd,"")}static parseTrackName(t){const e=nf.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const n=i.nodeName.substring(s+1);rf.indexOf(n)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=n)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){const i=function(n){for(let r=0;r=n){const u=n++,d=t[u];e[d.uuid]=c,t[c]=d,e[h]=u,t[u]=o;for(let f=0,p=s;f!==p;++f){const m=i[f],g=m[u],x=m[c];m[c]=g,m[u]=x}}}this.nCachedObjects_=n}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,s=i.length;let n=this.nCachedObjects_,r=t.length;for(let a=0,o=arguments.length;a!==o;++a){const h=arguments[a],c=h.uuid,u=e[c];if(u!==void 0)if(delete e[c],u0&&(e[f.uuid]=u),t[u]=f,t.pop();for(let p=0,m=s;p!==m;++p){const g=i[p];g[u]=g[d],g.pop()}}}this.nCachedObjects_=n}subscribe_(t,e){const i=this._bindingsIndicesByPath;let s=i[t];const n=this._bindings;if(s!==void 0)return n[s];const r=this._paths,a=this._parsedPaths,o=this._objects,h=o.length,c=this.nCachedObjects_,u=new Array(h);s=n.length,i[t]=s,r.push(t),a.push(e),n.push(u);for(let d=c,f=o.length;d!==f;++d){const p=o[d];u[d]=new $(p,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(i!==void 0){const s=this._paths,n=this._parsedPaths,r=this._bindings,a=r.length-1,o=r[a],h=t[a];e[h]=i,r[i]=o,r.pop(),n[i]=n[a],n.pop(),s[i]=s[a],s.pop()}}}class of{constructor(t,e,i=null,s=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=s;const n=e.tracks,r=n.length,a=new Array(r),o={endingStart:zi,endingEnd:zi};for(let h=0;h!==r;++h){const c=n[h].createInterpolant(null);a[h]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ac,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const s=this._clip.duration,n=t._clip.duration,r=n/s,a=s/n;t.warp(1,r,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const s=this._mixer,n=s.time,r=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,h=a.sampleValues;return o[0]=n,o[1]=n+i,h[0]=t/r,h[1]=e/r,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,s){if(!this.enabled){this._updateWeight(t);return}const n=this._startTime;if(n!==null){const o=(t-n)*i;o<0||i===0?e=0:(this._startTime=null,e=i*o)}e*=this._updateTimeScale(t);const r=this._updateTime(e),a=this._updateWeight(t);if(a>0){const o=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case Ih:for(let c=0,u=o.length;c!==u;++c)o[c].evaluate(r),h[c].accumulateAdditive(a);break;case Qr:default:for(let c=0,u=o.length;c!==u;++c)o[c].evaluate(r),h[c].accumulate(s,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(t)[0];e*=s,t>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(t)[0];e*=s,t>i.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let s=this.time+t,n=this._loopCount;const r=i===Tc;if(t===0)return n===-1?s:r&&(n&1)===1?e-s:s;if(i===Sc){n===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(s>=e)s=e;else if(s<0)s=0;else{this.time=s;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(n===-1&&(t>=0?(n=0,this._setEndings(!0,this.repetitions===0,r)):this._setEndings(this.repetitions===0,!0,r)),s>=e||s<0){const a=Math.floor(s/e);s-=e*a,n+=Math.abs(a);const o=this.repetitions-n;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=t>0?e:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(o===1){const h=t<0;this._setEndings(h,!h,r)}else this._setEndings(!1,!1,r);this._loopCount=n,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(r&&(n&1)===1)return e-s}return s}_setEndings(t,e,i){const s=this._interpolantSettings;i?(s.endingStart=Bi,s.endingEnd=Bi):(t?s.endingStart=this.zeroSlopeAtStart?Bi:zi:s.endingStart=Sn,e?s.endingEnd=this.zeroSlopeAtEnd?Bi:zi:s.endingEnd=Sn)}_scheduleFading(t,e,i){const s=this._mixer,n=s.time;let r=this._weightInterpolant;r===null&&(r=s._lendControlInterpolant(),this._weightInterpolant=r);const a=r.parameterPositions,o=r.sampleValues;return a[0]=n,o[0]=e,a[1]=n+t,o[1]=i,this}}const hf=new Float32Array(1);class sy extends We{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,s=t._clip.tracks,n=s.length,r=t._propertyBindings,a=t._interpolants,o=i.uuid,h=this._bindingsByRootAndName;let c=h[o];c===void 0&&(c={},h[o]=c);for(let u=0;u!==n;++u){const d=s[u],f=d.name;let p=c[f];if(p!==void 0)++p.referenceCount,r[u]=p;else{if(p=r[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,o,f));continue}const m=e&&e._propertyBindings[u].binding.parsedPath;p=new Kd($.create(i,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,o,f),r[u]=p}a[u].resultBuffer=p.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const i=(t._localRoot||this._root).uuid,s=t._clip.uuid,n=this._actionsByClip[s];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,s,i)}const e=t._propertyBindings;for(let i=0,s=e.length;i!==s;++i){const n=e[i];n.useCount++===0&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let i=0,s=e.length;i!==s;++i){const n=e[i];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return e!==null&&e=0;--i)t[i].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,s=this.time+=t,n=Math.sign(t),r=this._accuIndex^=1;for(let h=0;h!==i;++h)e[h]._update(s,t,n,r);const a=this._bindings,o=this._nActiveBindings;for(let h=0;h!==o;++h)a[h].apply(r);return this}setTime(t){this.time=0;for(let e=0;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Xo).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Yo=new w,fn=new w;class fy{constructor(t=new w,e=new w){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Yo.subVectors(t,this.start),fn.subVectors(this.end,this.start);const i=fn.dot(fn);let n=fn.dot(Yo)/i;return e&&(n=H(n,0,1)),n}closestPointToPoint(t,e,i){const s=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Jo=new w;class py extends tt{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new Z,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let r=0,a=1,o=32;r1)for(let u=0;u.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{$o.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle($o,e)}}setLength(t,e=t*.2,i=e*.2){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Ty extends Fe{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new Z;s.setAttribute("position",new O(e,3)),s.setAttribute("color",new O(i,3));const n=new Gt({vertexColors:!0,toneMapped:!1});super(s,n),this.type="AxesHelper"}setColors(t,e,i){const s=new V,n=this.geometry.attributes.color.array;return s.set(t),s.toArray(n,0),s.toArray(n,3),s.set(e),s.toArray(n,6),s.toArray(n,9),s.set(i),s.toArray(n,12),s.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Iy{constructor(){this.type="ShapePath",this.color=new V,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Fn,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.currentPath.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.currentPath.bezierCurveTo(t,e,i,s,n,r),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(x){const y=[];for(let b=0,v=x.length;bNumber.EPSILON){if(z<0&&(A=y[M],C=-C,S=y[_],z=-z),x.yS.y)continue;if(x.y===A.y){if(x.x===A.x)return!0}else{const k=z*(x.x-A.x)-C*(x.y-A.y);if(k===0)return!0;if(k<0)continue;v=!v}}else{if(x.y!==A.y)continue;if(S.x<=x.x&&x.x<=A.x||A.x<=x.x&&x.x<=S.x)return!0}}return v}const s=ze.isClockWise,n=this.subPaths;if(n.length===0)return[];let r,a,o;const h=[];if(n.length===1)return a=n[0],o=new Ri,o.curves=a.curves,h.push(o),h;let c=!s(n[0].getPoints());c=t?!c:c;const u=[],d=[];let f=[],p=0,m;d[p]=void 0,f[p]=[];for(let x=0,y=n.length;x1){let x=!1,y=0;for(let b=0,v=d.length;b0&&x===!1&&(f=u)}let g;for(let x=0,y=d.length;xt?(l.repeat.x=1,l.repeat.y=e/t,l.offset.x=0,l.offset.y=(1-l.repeat.y)/2):(l.repeat.x=t/e,l.repeat.y=1,l.offset.x=(1-l.repeat.x)/2,l.offset.y=0),l}function df(l,t){const e=l.image&&l.image.width?l.image.width/l.image.height:1;return e>t?(l.repeat.x=t/e,l.repeat.y=1,l.offset.x=(1-l.repeat.x)/2,l.offset.y=0):(l.repeat.x=1,l.repeat.y=e/t,l.offset.x=0,l.offset.y=(1-l.repeat.y)/2),l}function ff(l){return l.repeat.x=1,l.repeat.y=1,l.offset.x=0,l.offset.y=0,l}function pf(l,t,e,i){const s=mf(i);switch(e){case Dl:return l*t;case Vl:return l*t;case Gl:return l*t*2;case Ah:return l*t/s.components*s.byteLength;case Th:return l*t/s.components*s.byteLength;case Wl:return l*t*2/s.components*s.byteLength;case Hl:return l*t*2/s.components*s.byteLength;case Ul:return l*t*3/s.components*s.byteLength;case ys:return l*t*4/s.components*s.byteLength;case ql:return l*t*4/s.components*s.byteLength;case Xl:case Yl:return Math.floor((l+3)/4)*Math.floor((t+3)/4)*8;case Jl:case Zl:return Math.floor((l+3)/4)*Math.floor((t+3)/4)*16;case jl:case $l:return Math.max(l,16)*Math.max(t,8)/4;case Kl:case Ql:return Math.max(l,8)*Math.max(t,8)/2;case tc:case ec:return Math.floor((l+3)/4)*Math.floor((t+3)/4)*8;case ic:return Math.floor((l+3)/4)*Math.floor((t+3)/4)*16;case sc:return Math.floor((l+3)/4)*Math.floor((t+3)/4)*16;case nc:return Math.floor((l+4)/5)*Math.floor((t+3)/4)*16;case rc:return Math.floor((l+4)/5)*Math.floor((t+4)/5)*16;case ac:return Math.floor((l+5)/6)*Math.floor((t+4)/5)*16;case oc:return Math.floor((l+5)/6)*Math.floor((t+5)/6)*16;case hc:return Math.floor((l+7)/8)*Math.floor((t+4)/5)*16;case lc:return Math.floor((l+7)/8)*Math.floor((t+5)/6)*16;case cc:return Math.floor((l+7)/8)*Math.floor((t+7)/8)*16;case uc:return Math.floor((l+9)/10)*Math.floor((t+4)/5)*16;case dc:return Math.floor((l+9)/10)*Math.floor((t+5)/6)*16;case fc:return Math.floor((l+9)/10)*Math.floor((t+7)/8)*16;case pc:return Math.floor((l+9)/10)*Math.floor((t+9)/10)*16;case mc:return Math.floor((l+11)/12)*Math.floor((t+9)/10)*16;case gc:return Math.floor((l+11)/12)*Math.floor((t+11)/12)*16;case yc:case xc:case bc:return Math.ceil(l/4)*Math.ceil(t/4)*16;case vc:case wc:return Math.ceil(l/4)*Math.ceil(t/4)*8;case _c:case Mc:return Math.ceil(l/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function mf(l){switch(l){case Sh:case Bl:return{byteLength:1,components:1};case Pl:case Fl:case El:return{byteLength:2,components:1};case Rl:case Ll:return{byteLength:2,components:4};case jr:case kl:case Li:return{byteLength:4,components:1};case Nl:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${l}.`)}const zy={contain:uf,cover:df,fill:ff,getByteLength:pf};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_h}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_h);function sl(l){return l>=.7?"active":l>=.4?"dormant":l>=.1?"silent":"unavailable"}const nl={active:"#10b981",dormant:"#f59e0b",silent:"#8b5cf6",unavailable:"#6b7280"},By={active:"Easily retrievable (retention ≥ 70%)",dormant:"Retrievable with effort (40–70%)",silent:"Difficult, needs cues (10–40%)",unavailable:"Needs reinforcement (< 10%)"},zr={aha:"#FFD700",confusion:"#EF4444",failure:"#9CA3AF"},Fy={aha:"Aha moments and breakthroughs",confusion:"Confusions and weak spots",failure:"Failures and guardrails"};function th(l,t){return t==="state"?nl[sl(l.retention)]:t==="ahagraph"?rl(l)??ka[l.type]??"#8B95A5":ka[l.type]||"#8B95A5"}function rl(l){const t=new Set((l.tags??[]).map(e=>e.toLowerCase()));return t.has("aha")?zr.aha:t.has("confusion")||t.has("weak-spot")?zr.confusion:t.has("failure")||t.has("guardrail")?zr.failure:null}let is=null;function gf(){if(is)return is;const l=128,t=document.createElement("canvas");t.width=l,t.height=l;const e=t.getContext("2d");if(!e)return is=new gt,is;const i=e.createRadialGradient(l/2,l/2,0,l/2,l/2,l/2);i.addColorStop(0,"rgba(255, 255, 255, 1.0)"),i.addColorStop(.25,"rgba(255, 255, 255, 0.7)"),i.addColorStop(.55,"rgba(255, 255, 255, 0.2)"),i.addColorStop(1,"rgba(255, 255, 255, 0.0)"),e.fillStyle=i,e.fillRect(0,0,l,l);const s=new Nh(t);return s.needsUpdate=!0,is=s,s}function eh(l){if(l===0||l===1)return l;const t=.3;return Math.pow(2,-10*l)*Math.sin((l-t/4)*(2*Math.PI)/t)+1}function yf(l){return l*l*((1.70158+1)*l-1.70158)}class Py{constructor(){T(this,"group");T(this,"meshMap",new Map);T(this,"glowMap",new Map);T(this,"positions",new Map);T(this,"labelSprites",new Map);T(this,"hoveredNode",null);T(this,"selectedNode",null);T(this,"colorMode","type");T(this,"materializingNodes",[]);T(this,"dissolvingNodes",[]);T(this,"growingNodes",[]);this.group=new Oh}setColorMode(t){if(this.colorMode!==t){this.colorMode=t;for(const[e,i]of this.meshMap){const s=i.userData.retention??0,n=i.userData.type??"fact",r=Array.isArray(i.userData.tags)?i.userData.tags:[],o=th({type:n,retention:s,tags:r},t),h=new V(o),c=i.material;c.color.copy(h),c.emissive.copy(h);const u=this.glowMap.get(e);u&&u.material.color.copy(h)}}}createNodes(t){const e=(1+Math.sqrt(5))/2,i=t.length;for(let s=0;s0,a=new Is(s,16,16),o=new Aa({color:new V(n),emissive:new V(n),emissiveIntensity:r?0:.3+t.retention*.5,roughness:.3,metalness:.1,transparent:!0,opacity:r?.2:.3+t.retention*.7}),h=new Vt(a,o);h.position.copy(e),h.scale.setScalar(i),h.userData={nodeId:t.id,type:t.type,retention:t.retention,tags:t.tags},this.meshMap.set(t.id,h),this.group.add(h);const c=new fs({map:gf(),color:new V(n),transparent:!0,opacity:i>0?r?.1:.3+t.retention*.35:0,blending:wl,depthWrite:!1}),u=new cs(c);u.scale.set(s*6*i,s*6*i,1),u.position.copy(e),u.userData={isGlow:!0,nodeId:t.id},this.glowMap.set(t.id,u),this.group.add(u);const d=t.label||t.type,f=this.createTextSprite(d,"#94a3b8");return f.position.copy(e),f.position.y+=s*2+1.5,f.userData={isLabel:!0,nodeId:t.id,offset:s*2+1.5},this.group.add(f),this.labelSprites.set(t.id,f),{mesh:h,glow:u,label:f,size:s}}addNode(t,e,i={}){const s=(e==null?void 0:e.clone())??new w((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40);this.positions.set(t.id,s);const{mesh:n,glow:r,label:a}=this.createNodeMeshes(t,s,0);return n.scale.setScalar(.001),r.scale.set(.001,.001,1),r.material.opacity=0,a.material.opacity=0,i.isBirthRitual?(n.visible=!1,r.visible=!1,a.visible=!1,n.userData.birthRitualPending={totalFrames:30,targetScale:.5+t.retention*2}):this.materializingNodes.push({id:t.id,frame:0,totalFrames:30,mesh:n,glow:r,label:a,targetScale:.5+t.retention*2}),s}igniteNode(t){const e=this.meshMap.get(t),i=this.glowMap.get(t),s=this.labelSprites.get(t);if(!e||!i||!s)return;const n=e.userData.birthRitualPending;n&&(e.visible=!0,i.visible=!0,s.visible=!0,delete e.userData.birthRitualPending,this.materializingNodes.push({id:t,frame:0,totalFrames:n.totalFrames,mesh:e,glow:i,label:s,targetScale:n.targetScale}))}removeNode(t){const e=this.meshMap.get(t),i=this.glowMap.get(t),s=this.labelSprites.get(t);!e||!i||!s||(this.materializingNodes=this.materializingNodes.filter(n=>n.id!==t),this.dissolvingNodes.push({id:t,frame:0,totalFrames:60,mesh:e,glow:i,label:s,originalScale:e.scale.x}))}growNode(t,e){const i=this.meshMap.get(t);if(!i)return;const s=i.scale.x,n=.5+e*2;i.userData.retention=e,this.growingNodes.push({id:t,frame:0,totalFrames:30,startScale:s,targetScale:n})}createTextSprite(t,e){const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){const x=new gt;return new cs(new fs({map:x,transparent:!0,opacity:0}))}i.width=512,i.height=64;const n=t.length>40?t.slice(0,37)+"...":t;s.clearRect(0,0,i.width,i.height),s.font='600 22px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif';const a=s.measureText(n).width,h=Math.min(a+14*2,i.width-4),c=40,u=(i.width-h)/2,d=(i.height-c)/2,f=c/2;s.fillStyle="rgba(10, 16, 28, 0.82)",s.beginPath(),s.moveTo(u+f,d),s.lineTo(u+h-f,d),s.quadraticCurveTo(u+h,d,u+h,d+f),s.lineTo(u+h,d+c-f),s.quadraticCurveTo(u+h,d+c,u+h-f,d+c),s.lineTo(u+f,d+c),s.quadraticCurveTo(u,d+c,u,d+c-f),s.lineTo(u,d+f),s.quadraticCurveTo(u,d,u+f,d),s.closePath(),s.fill(),s.strokeStyle="rgba(148, 163, 184, 0.18)",s.lineWidth=1,s.stroke(),s.textAlign="center",s.textBaseline="middle",s.fillStyle=e,s.fillText(n,i.width/2,i.height/2+1);const p=new Nh(i);p.needsUpdate=!0;const m=new fs({map:p,transparent:!0,opacity:0,depthTest:!1,sizeAttenuation:!0}),g=new cs(m);return g.scale.set(9,1.2,1),g}updatePositions(){this.group.children.forEach(t=>{if(t.userData.nodeId){const e=this.positions.get(t.userData.nodeId);if(!e)return;t.userData.isGlow?t.position.copy(e):t.userData.isLabel?(t.position.copy(e),t.position.y+=t.userData.offset):t instanceof Vt&&t.position.copy(e)}})}animate(t,e,i,s=1){var r,a;for(let o=this.materializingNodes.length-1;o>=0;o--){const h=this.materializingNodes[o];h.frame++;const c=Math.min(h.frame/h.totalFrames,1),u=eh(c);if(h.mesh.scale.setScalar(Math.max(.001,u)),h.frame>=5){const d=Math.min((h.frame-5)/5,1),f=h.glow.material;f.opacity=d*.4;const p=h.targetScale*6*u;h.glow.scale.set(p,p,1)}if(h.frame>=40){const d=Math.min((h.frame-40)/20,1);h.label.material.opacity=d*.9}h.frame>=60&&this.materializingNodes.splice(o,1)}for(let o=this.dissolvingNodes.length-1;o>=0;o--){const h=this.dissolvingNodes[o];h.frame++;const c=Math.min(h.frame/h.totalFrames,1),u=1-yf(c),d=Math.max(.001,h.originalScale*u);h.mesh.scale.setScalar(d);const f=d*6;h.glow.scale.set(f,f,1);const p=h.mesh.material;p.opacity*=.97,h.glow.material.opacity*=.95,h.label.material.opacity*=.93,h.frame>=h.totalFrames&&(this.group.remove(h.mesh),this.group.remove(h.glow),this.group.remove(h.label),h.mesh.geometry.dispose(),h.mesh.material.dispose(),(r=h.glow.material.map)==null||r.dispose(),h.glow.material.dispose(),(a=h.label.material.map)==null||a.dispose(),h.label.material.dispose(),this.meshMap.delete(h.id),this.glowMap.delete(h.id),this.labelSprites.delete(h.id),this.positions.delete(h.id),this.dissolvingNodes.splice(o,1))}for(let o=this.growingNodes.length-1;o>=0;o--){const h=this.growingNodes[o];h.frame++;const c=Math.min(h.frame/h.totalFrames,1),u=h.startScale+(h.targetScale-h.startScale)*eh(c),d=this.meshMap.get(h.id);d&&d.scale.setScalar(u);const f=this.glowMap.get(h.id);if(f){const p=u*6;f.scale.set(p,p,1)}h.frame>=h.totalFrames&&this.growingNodes.splice(o,1)}const n=new Set([...this.materializingNodes.map(o=>o.id),...this.dissolvingNodes.map(o=>o.id),...this.growingNodes.map(o=>o.id)]);this.meshMap.forEach((o,h)=>{if(n.has(h))return;const c=e.find(y=>y.id===h);if(!c)return;const u=1+Math.sin(t*1.5+e.indexOf(c)*.5)*.15*c.retention;o.scale.setScalar(u);const d=this.positions.get(h),f=d?i.position.distanceTo(d):0,p=1+Math.min(1.4,Math.max(0,(f-60)/100)),m=o.material;if(h===this.hoveredNode)m.emissiveIntensity=1*s;else if(h===this.selectedNode)m.emissiveIntensity=.8*s;else{const b=.3+c.retention*.5+Math.sin(t*(.8+c.retention*.7))*.1*c.retention;m.emissiveIntensity=b*s*p}const g=.3+c.retention*.7;m.opacity=Math.min(1,g*s*p);const x=this.glowMap.get(h);if(x){const y=x.material,b=.3+c.retention*.35;y.opacity=Math.min(.95,b*s*p)}}),this.labelSprites.forEach((o,h)=>{if(n.has(h))return;const c=this.positions.get(h);if(!c)return;const u=i.position.distanceTo(c),d=o.material,f=h===this.hoveredNode||h===this.selectedNode?1:u<40?.9:u<80?.9*(1-(u-40)/40):0;d.opacity+=(f-d.opacity)*.1})}getMeshes(){return Array.from(this.meshMap.values())}dispose(){this.group.traverse(t=>{var e,i,s,n,r;t instanceof Vt?((e=t.geometry)==null||e.dispose(),(i=t.material)==null||i.dispose()):t instanceof cs&&((n=(s=t.material)==null?void 0:s.map)==null||n.dispose(),(r=t.material)==null||r.dispose())}),this.materializingNodes=[],this.dissolvingNodes=[],this.growingNodes=[]}}function xf(l){var e,i;const t={};for(const s of l)(t[e=s.source]??(t[e]=[])).push({edge:s,otherId:s.target}),(t[i=s.target]??(t[i]=[])).push({edge:s,otherId:s.source});for(const s of Object.keys(t))t[s].sort((n,r)=>(r.edge.weight??0)-(n.edge.weight??0));return t}function Br(l){const t=(l.type??"").toLowerCase();return t.includes("contradict")||t.includes("conflict")||t.includes("supersede")}function bn(l){const t=Date.parse(l.updatedAt||l.createdAt||"");return Number.isFinite(t)?t:0}function bf(l,t,e,i=7){var g;const s=new Map(l.map(x=>[x.id,x])),n={beats:[],centerId:e,pivoted:!1,flowEdges:[]};if(l.length===0)return n;const r=xf(t),a=s.has(e);let o=a?e:"";o||(o=((g=l.find(x=>x.isCenter))==null?void 0:g.id)??""),o||(o=l.map(x=>{var y;return{id:x.id,deg:((y=r[x.id])==null?void 0:y.length)??0}}).sort((x,y)=>y.deg-x.deg)[0].id);const h=s.get(o);if(!h)return n;const c=!a,u=new Set([o]),d=[{nodeId:o,node:h,viaEdge:null,kind:"origin",intensity:1}],f=[];let p=o,m=!1;for(;d.length!u.has(v.otherId)&&Br(v.edge)),y&&(m=!0)),y||(y=x.find(v=>!u.has(v.otherId))),!y){const v=l.filter(M=>!u.has(M.id)).sort((M,A)=>bn(A)-bn(M));if(v.length===0)break;const _=v[0];u.add(_.id),d.push({nodeId:_.id,node:_,viaEdge:null,kind:"bridge",intensity:.6}),p=_.id;continue}const b=s.get(y.otherId);if(!b){u.add(y.otherId);continue}u.add(b.id),f.push(y.edge),d.push({nodeId:b.id,node:b,viaEdge:y.edge,kind:Br(y.edge)?"contradiction":"connection",intensity:Br(y.edge)?1:Math.min(1,.55+(y.edge.weight??0)*.45)}),p=b.id}if(d.lengthb.id!==x).sort((b,v)=>bn(v)-bn(b))[0];y&&!d.some(b=>b.nodeId===y.id)&&d.push({nodeId:y.id,node:y,viaEdge:null,kind:"recent",intensity:.8})}return{beats:d,centerId:o,pivoted:c,flowEdges:f}}var vf=At(''),wf=At('CAPTURE'),_f=At(' '),Mf=At('
');function Sf(l,t){Ms(t,!0);let e=lt(t,"demoMode",3,"recall-path"),i=lt(t,"seed",3,"vestige-observatory-v1"),s=lt(t,"nodeCount",3,0),n=lt(t,"edgeCount",3,0),r=lt(t,"centerId",3,""),a=lt(t,"frameCount",3,0),o=lt(t,"fpsEstimate",3,0),h=lt(t,"freezeFrame",3,null);lt(t,"loading",3,!1),lt(t,"error",3,"");function c(){const R=new URLSearchParams({demo:e(),seed:i()});h()!==null&&R.set("frame",String(h()));const I=`${window.location.origin}${wh}/observatory?${R.toString()}`;navigator.clipboard.writeText(I).catch(()=>{})}var u=Mf(),d=rt(u),f=rt(d),p=rt(f),m=rt(p,!0);st(p);var g=ct(p,2),x=rt(g);st(g),st(f);var y=ct(f,2),b=rt(y),v=rt(b);st(b);var _=ct(b,2);{var M=R=>{var I=vf(),N=rt(I);st(I),oe(wt=>Xt(N,`center=${wt??""}`),[()=>r().slice(0,8)]),xt(R,I)};zt(_,R=>{r()&&R(M)})}st(y);var A=ct(y,2),S=rt(A),C=rt(S);st(S);var z=ct(S,2);{var k=R=>{var I=wf();xt(R,I)},U=R=>{var I=_f(),N=rt(I);st(I),oe(()=>Xt(N,`${o()??""}fps`)),xt(R,I)};zt(z,R=>{h()!==null?R(k):o()>0&&R(U,1)})}var W=ct(z,2);st(A),st(d),st(u),oe((R,I)=>{Xt(m,e()),Xt(x,`seed=${R??""}${i().length>12?"…":""}`),Xt(v,`${s()??""} nodes · ${n()??""} edges`),Xt(C,`frame: ${I??""}`)},[()=>i().slice(0,12),()=>String(a()).padStart(3," ")]),wn("click",W,c),xt(l,u),Ss()}xh(["click"]);var Af=At('
'),Tf=At("
"),If=At('
');function Cf(l,t){Ms(t,!0);let e=lt(t,"steps",19,()=>[]),i=lt(t,"frame",3,0),s=lt(t,"loopFrames",3,720);const n=u=>u/s()*100;function r(u,d){const f=d-u;return f<-14||f>90?0:f<0?1+f/14:1-f/90}let a=Xr(()=>{let u="",d=.15;for(const f of e()){const p=r(f.beatFrame,i());p>d&&(d=p,u=f.label)}return u});var o=gh(),h=qr(o);{var c=u=>{var d=If(),f=rt(d);{var p=y=>{var b=Af(),v=rt(b,!0);st(b),oe(()=>Xt(v,D(a))),xt(y,b)};zt(f,y=>{D(a)&&y(p)})}var m=ct(f,2),g=rt(m);bh(g,17,e,y=>y.beatFrame,(y,b)=>{var v=Tf();let _;oe((M,A,S)=>{_=us(v,1,"tick svelte-8n8iia",null,_,M),kr(v,`left: ${A??""}%; opacity: ${S??""}`),Yr(v,"title",D(b).label)},[()=>({hot:r(D(b).beatFrame,i())>0,backward:D(b).kind===1}),()=>n(D(b).beatFrame),()=>.45+.55*r(D(b).beatFrame,i())]),xt(y,v)});var x=ct(g,2);st(m),st(d),oe(y=>kr(x,`left: ${y??""}%`),[()=>n(i())]),xt(u,d)};zt(h,u=>{e().length>0&&u(c)})}xt(l,o),Ss()}var zf=At('
');function ih(l,t){Ms(t,!0);let e=lt(t,"frame",3,0),i=lt(t,"fadeWindow",19,()=>[600,620,705,719]),s=lt(t,"tone",3,"triumph");const n=(c,u,d)=>{const f=Math.min(1,Math.max(0,(d-c)/(u-c)));return f*f*(3-2*f)};let r=Xr(()=>n(i()[0],i()[1],e())*(1-n(i()[2],i()[3],e())));var a=gh(),o=qr(a);{var h=c=>{var u=zf();let d;var f=rt(u),p=rt(f,!0);st(f);var m=ct(f,2),g=rt(m,!0);st(m);var x=ct(m,2),y=rt(x,!0);st(x),st(u),oe(()=>{d=us(u,1,"verdict svelte-ssd7yu",null,d,{quarantine:s()==="quarantine"}),kr(u,`opacity: ${D(r)??""}`),Xt(p,t.verdict.headline),Xt(g,t.verdict.causeLabel),Xt(y,t.verdict.receipt)}),xt(c,u)};zt(o,c=>{D(r)>.001&&c(h)})}xt(l,a),Ss()}function sh(l){let t=1779033703^l.length;for(let e=0;e>>19;return function(){let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function nh(l){return function(){let t=l+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}class Hn{constructor(t){T(this,"fps");T(this,"loopFrames");T(this,"seedStr");T(this,"_frame");T(this,"_totalFrames");T(this,"_rng");this.fps=t.fps??60,this.loopFrames=t.loopFrames??720,this.seedStr=t.seed,this._frame=0,this._totalFrames=0;const e=sh(this.seedStr)();this._rng=nh(Math.floor(e*2**32))}tick(){return this._frame=(this._frame+1)%this.loopFrames,this._totalFrames++,this.state}get state(){return{frame:this._frame,phase:this._frame/this.loopFrames,rng:this._rng,totalFrames:this._totalFrames}}reset(){this._frame=0,this._totalFrames=0;const t=sh(this.seedStr)();this._rng=nh(Math.floor(t*2**32))}get loopDuration(){return this.loopFrames/this.fps}get framesPerLoop(){return this.loopFrames}}function al(l,t,e,i){const s=Math.PI*(3-Math.sqrt(5)),n=1-l/(t-1||1)*2,r=Math.sqrt(1-n*n),a=s*l,o=Math.cos(a)*r,h=Math.sin(a)*r,c=(i()-.5)*.1*e,u=(i()-.5)*.1*e,d=(i()-.5)*.1*e;return[o*e+c,n*e+u,h*e+d]}const Fa=["recall-path","engram-birth","salience-rescue","forgetting-horizon","firewall"];function ky(l){return Fa.includes(l)}const vt=16,ce={posRadius:0,velRetention:4,colorFlags:8},ss={isCenter:1,suppressed:2,isAha:4,isFailure:8,isConfusion:16},Fr=2,ns=4,Be={recall:0,backwardCause:1,probe:2},Bf=12;function Ff(l){const t=Fa.indexOf(l);return t<0?0:t}function Pf(l,t){return{id:l.id,index:t,label:l.label,type:l.type,retention:typeof l.retention=="number"?l.retention:0,tags:Array.isArray(l.tags)?l.tags:[],isCenter:!!l.isCenter,suppressed:(l.suppression_count??0)>0}}function kf(l,t){const e=Math.max(1,l>>1),i=Math.max(1,t>>1),s=Math.min(6,Math.max(1,1+Math.floor(Math.log2(Math.min(e,i)/8)))),n=Array.from({length:s},(r,a)=>[Math.max(1,e>>a),Math.max(1,i>>a)]);return{baseW:e,baseH:i,mipCount:s,sizes:n}}const _n=.18,Ef=0,Rf=2/255,Lf=.85,Of=.62,Nf=` +// Tuning constants — interpolated from post.wgsl.ts (TS single source of truth). +const BLOOM_STRENGTH: f32 = ${_n}; +const BLOOM_CHROMATIC_TEXELS: f32 = ${Ef}; +const GRAIN_AMP: f32 = ${Rf}; +const VIGNETTE_LIFT: f32 = ${Lf}; +const VIGNETTE_TAN: f32 = ${Of}; + +// Params layout — VERBATIM from render-nodes.wgsl.ts (types.PARAMS_FLOATS). +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +// Globally unique bindings — each entry point statically uses a subset; the +// explicit bind group layouts in post-chain.ts carry exactly what each +// pipeline needs (blur: 1+2, composite: 0+2+3+4). +@group(0) @binding(0) var params: Params; // composite only +@group(0) @binding(1) var src: texture_2d; // blur chain input +@group(0) @binding(2) var samp: sampler; // shared +@group(0) @binding(3) var scene_tex: texture_2d; // composite only +@group(0) @binding(4) var bloom_tex: texture_2d; // composite only (FULL-mip view) + +struct FSOut { + @builtin(position) pos: vec4f, + @location(0) uv: vec2f, +}; + +// Fullscreen triangle from bit math — no vertex buffer, no arrays. +// vi 0/1/2 → clip (-1,-1) (3,-1) (-1,3); uv y flipped so uv(0,0) = top-left. +@vertex +fn vs_fullscreen(@builtin(vertex_index) vi: u32) -> FSOut { + let xy = vec2f(f32((vi << 1u) & 2u), f32(vi & 2u)) * 2.0 - 1.0; + var out: FSOut; + out.pos = vec4f(xy, 0.0, 1.0); + out.uv = vec2f(xy.x, -xy.y) * 0.5 + 0.5; + return out; +} + +fn luma(c: vec3f) -> f32 { + return dot(c, vec3f(0.2126, 0.7152, 0.0722)); +} + +// --------------------------------------------------------------------------- +// Bloom downsample — 13-tap Jimenez (SIGGRAPH 2014 "Next Generation Post +// Processing in Call of Duty: Advanced Warfare"), taps fully unrolled. +// +// a b c outer ring at ±2 texels +// j k inner ring at ±1 texels +// d e f e = center +// l m +// g h i +// +// Grouped as 5 overlapping 4-tap boxes: center box (the four inner taps) +// weight 0.5, four corner boxes weight 0.125 each. A flat field reproduces +// itself EXACTLY (0.5 + 4·0.125 = 1) — that exactness is what the void +// preimage in tone-reference.ts depends on. +// --------------------------------------------------------------------------- + +@fragment +fn fs_downsample_karis(in: FSOut) -> @location(0) vec4f { + let ts = 1.0 / vec2f(textureDimensions(src)); + let a = textureSampleLevel(src, samp, in.uv + vec2f(-2.0, -2.0) * ts, 0.0).rgb; + let b = textureSampleLevel(src, samp, in.uv + vec2f( 0.0, -2.0) * ts, 0.0).rgb; + let c = textureSampleLevel(src, samp, in.uv + vec2f( 2.0, -2.0) * ts, 0.0).rgb; + let d = textureSampleLevel(src, samp, in.uv + vec2f(-2.0, 0.0) * ts, 0.0).rgb; + let e = textureSampleLevel(src, samp, in.uv, 0.0).rgb; + let f = textureSampleLevel(src, samp, in.uv + vec2f( 2.0, 0.0) * ts, 0.0).rgb; + let g = textureSampleLevel(src, samp, in.uv + vec2f(-2.0, 2.0) * ts, 0.0).rgb; + let h = textureSampleLevel(src, samp, in.uv + vec2f( 0.0, 2.0) * ts, 0.0).rgb; + let i = textureSampleLevel(src, samp, in.uv + vec2f( 2.0, 2.0) * ts, 0.0).rgb; + let j = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, -1.0) * ts, 0.0).rgb; + let k = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, -1.0) * ts, 0.0).rgb; + let l = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, 1.0) * ts, 0.0).rgb; + let m = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, 1.0) * ts, 0.0).rgb; + + let box_c = (j + k + l + m) * 0.25; + let box_tl = (a + b + d + e) * 0.25; + let box_tr = (b + c + e + f) * 0.25; + let box_bl = (d + e + g + h) * 0.25; + let box_br = (e + f + h + i) * 0.25; + + // Karis average (fireflies killer) — used ONLY on the full→mip0 hop. + // Each box is additionally weighted 1/(1 + luma) and the sum RENORMALIZED: + // on a flat field every Karis factor is equal, so the result is exact. + let w_c = 0.5 / (1.0 + luma(box_c)); + let w_tl = 0.125 / (1.0 + luma(box_tl)); + let w_tr = 0.125 / (1.0 + luma(box_tr)); + let w_bl = 0.125 / (1.0 + luma(box_bl)); + let w_br = 0.125 / (1.0 + luma(box_br)); + let sum = w_c * box_c + w_tl * box_tl + w_tr * box_tr + w_bl * box_bl + w_br * box_br; + return vec4f(sum / (w_c + w_tl + w_tr + w_bl + w_br), 1.0); +} + +@fragment +fn fs_downsample(in: FSOut) -> @location(0) vec4f { + let ts = 1.0 / vec2f(textureDimensions(src)); + let a = textureSampleLevel(src, samp, in.uv + vec2f(-2.0, -2.0) * ts, 0.0).rgb; + let b = textureSampleLevel(src, samp, in.uv + vec2f( 0.0, -2.0) * ts, 0.0).rgb; + let c = textureSampleLevel(src, samp, in.uv + vec2f( 2.0, -2.0) * ts, 0.0).rgb; + let d = textureSampleLevel(src, samp, in.uv + vec2f(-2.0, 0.0) * ts, 0.0).rgb; + let e = textureSampleLevel(src, samp, in.uv, 0.0).rgb; + let f = textureSampleLevel(src, samp, in.uv + vec2f( 2.0, 0.0) * ts, 0.0).rgb; + let g = textureSampleLevel(src, samp, in.uv + vec2f(-2.0, 2.0) * ts, 0.0).rgb; + let h = textureSampleLevel(src, samp, in.uv + vec2f( 0.0, 2.0) * ts, 0.0).rgb; + let i = textureSampleLevel(src, samp, in.uv + vec2f( 2.0, 2.0) * ts, 0.0).rgb; + let j = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, -1.0) * ts, 0.0).rgb; + let k = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, -1.0) * ts, 0.0).rgb; + let l = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, 1.0) * ts, 0.0).rgb; + let m = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, 1.0) * ts, 0.0).rgb; + + let box_c = (j + k + l + m) * 0.25; + let box_tl = (a + b + d + e) * 0.25; + let box_tr = (b + c + e + f) * 0.25; + let box_bl = (d + e + g + h) * 0.25; + let box_br = (e + f + h + i) * 0.25; + return vec4f(box_c * 0.5 + (box_tl + box_tr + box_bl + box_br) * 0.125, 1.0); +} + +// --------------------------------------------------------------------------- +// Bloom upsample — 9-tap 3×3 tent, 1/16·[1 2 1; 2 4 2; 1 2 1], radius = one +// SOURCE-mip texel. Rendered with additive one/one blending onto the stored +// downsample of the destination mip (accumulate-up-the-chain). The resulting +// DC gain of exactly mipCount is normalized in fs_composite. +// --------------------------------------------------------------------------- + +@fragment +fn fs_upsample_tent(in: FSOut) -> @location(0) vec4f { + let ts = 1.0 / vec2f(textureDimensions(src)); + let a = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, -1.0) * ts, 0.0).rgb; + let b = textureSampleLevel(src, samp, in.uv + vec2f( 0.0, -1.0) * ts, 0.0).rgb; + let c = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, -1.0) * ts, 0.0).rgb; + let d = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, 0.0) * ts, 0.0).rgb; + let e = textureSampleLevel(src, samp, in.uv, 0.0).rgb; + let f = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, 0.0) * ts, 0.0).rgb; + let g = textureSampleLevel(src, samp, in.uv + vec2f(-1.0, 1.0) * ts, 0.0).rgb; + let h = textureSampleLevel(src, samp, in.uv + vec2f( 0.0, 1.0) * ts, 0.0).rgb; + let i = textureSampleLevel(src, samp, in.uv + vec2f( 1.0, 1.0) * ts, 0.0).rgb; + let sum = (a + c + g + i) + (b + d + f + h) * 2.0 + e * 4.0; + return vec4f(sum * (1.0 / 16.0), 1.0); +} + +// --------------------------------------------------------------------------- +// Composite — bloom-add → PBR Neutral → grain → vignette (order is mandated). +// --------------------------------------------------------------------------- + +// Khronos PBR Neutral — EXACT port of the Khronos reference implementation. +// Hue-preserving; the FSRS palette keeps its channel ordering. Pinned to the +// CPU mirror in post/tone-reference.ts (pbrNeutralReference) — keep in +// lockstep, the void-preimage tests run against the mirror. +fn pbr_neutral(color_in: vec3f) -> vec3f { + let start_compression = 0.8 - 0.04; + let desaturation = 0.15; + var color = color_in; + let x = min(color.r, min(color.g, color.b)); + // WGSL select(false_value, true_value, condition) — argument order trap. + let offset = select(0.04, x - 6.25 * x * x, x < 0.08); + color = color - vec3f(offset); + let peak = max(color.r, max(color.g, color.b)); + if (peak < start_compression) { + return color; + } + let d = 1.0 - start_compression; + let new_peak = 1.0 - d * d / (peak + d - start_compression); + color = color * (new_peak / peak); + let g = 1.0 / (desaturation * (peak - new_peak) + 1.0); + // mix weight = 1 - g per the Khronos spec. + return mix(color, vec3f(new_peak), 1.0 - g); +} + +// PCG hash — integers only, 24-bit-exact output in [0, 1). Deterministic. +fn pcg(v: u32) -> u32 { + var s = v * 747796405u + 2891336453u; + let t = ((s >> ((s >> 28u) + 4u)) ^ s) * 277803737u; + return (t >> 22u) ^ t; +} + +fn hashf(p: vec2u, f: u32) -> f32 { + return f32(pcg(p.x ^ pcg(p.y ^ pcg(f))) >> 8u) / 16777216.0; +} + +@fragment +fn fs_composite(in: FSOut) -> @location(0) vec4f { + let pix = vec2u(in.pos.xy); + // Exact 1:1 fetch (alpha discarded — see module header). + let scene = textureLoad(scene_tex, pix, 0).rgb; + + // Bloom, normalized by the mip count: the additive up-chain has DC gain + // exactly mipCount, so /mips makes flat-field gain exactly 1 — the void + // preimage holds and brightness is viewport-stable. Chromatic dispersion + // rides the bloom term ONLY (BLOOM_CHROMATIC_TEXELS = 0.0 kills it). + let mips = f32(textureNumLevels(bloom_tex)); + let dims = vec2f(textureDimensions(bloom_tex)); + let dvec = in.uv - vec2f(0.5); + let off = dvec * (BLOOM_CHROMATIC_TEXELS * dot(dvec, dvec) * 4.0) / dims; + let bloom = vec3f( + textureSampleLevel(bloom_tex, samp, in.uv - off, 0.0).r, + textureSampleLevel(bloom_tex, samp, in.uv, 0.0).g, + textureSampleLevel(bloom_tex, samp, in.uv + off, 0.0).b + ) / mips; + + var c = pbr_neutral(scene + BLOOM_STRENGTH * bloom); + + // Seeded TPDF film grain (post-tonemap dither): keyed to the WRAPPED loop + // frame → 720-periodic and capture-pinned. Full strength in the shadows + // (kills #05060a banding), fades out of highlights. + let f = u32(params.frame + 0.5); + let n = hashf(pix, f) + hashf(pix ^ vec2u(0x9E3779B9u, 0x85EBCA6Bu), f) - 1.0; + let w = 1.0 - smoothstep(0.0, 0.8, luma(c)); + c += GRAIN_AMP * n * w; + + // cos⁴ vignette: cos⁴θ = (1 + r²·tan²)⁻², aspect-normalized so rn = 1.0 + // exactly at the corners regardless of viewport shape. Lifted floor keeps + // it an observatory, not a tunnel. + let ar = vec2f(params.viewport_w / max(params.viewport_h, 1.0), 1.0); + let rn = length((in.uv * 2.0 - 1.0) * ar) / length(ar); + let k = rn * rn * VIGNETTE_TAN * VIGNETTE_TAN; + c *= mix(VIGNETTE_LIFT, 1.0, 1.0 / ((1.0 + k) * (1.0 + k))); + + // NO gamma encode — display-referred pass-through, matching the pre-post + // look where shader outputs went straight to the swapchain. + return vec4f(c, 1.0); +} +`,Ci="rgba16float",Df={color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}};class Uf{constructor(t,e,i){T(this,"device");T(this,"paramsBuffer");T(this,"samp");T(this,"blurLayout");T(this,"compositeLayout");T(this,"pipeDownFirst");T(this,"pipeDown");T(this,"pipeUp");T(this,"pipeComposite");T(this,"width",0);T(this,"height",0);T(this,"plan",null);T(this,"sceneTex",null);T(this,"_sceneView",null);T(this,"bloomTex",null);T(this,"mipViews",[]);T(this,"bloomFullView",null);T(this,"downBind",[]);T(this,"upBind",[]);T(this,"compositeBind",null);this.device=t,this.paramsBuffer=e,this.samp=t.createSampler({label:"observatory-post-sampler",minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"});const s=t.createShaderModule({label:"observatory-post",code:Nf});this.blurLayout=t.createBindGroupLayout({label:"observatory-post-blur-layout",entries:[{binding:1,visibility:GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},{binding:2,visibility:GPUShaderStage.FRAGMENT,sampler:{type:"filtering"}}]}),this.compositeLayout=t.createBindGroupLayout({label:"observatory-post-composite-layout",entries:[{binding:0,visibility:GPUShaderStage.FRAGMENT,buffer:{type:"uniform"}},{binding:2,visibility:GPUShaderStage.FRAGMENT,sampler:{type:"filtering"}},{binding:3,visibility:GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},{binding:4,visibility:GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}}]});const n=t.createPipelineLayout({label:"observatory-post-blur-pipe-layout",bindGroupLayouts:[this.blurLayout]}),r=t.createPipelineLayout({label:"observatory-post-composite-pipe-layout",bindGroupLayouts:[this.compositeLayout]}),a=(o,h,c,u,d)=>t.createRenderPipeline({label:o,layout:h,vertex:{module:s,entryPoint:"vs_fullscreen"},fragment:{module:s,entryPoint:c,targets:[{format:u,blend:d}]},primitive:{topology:"triangle-list"}});this.pipeDownFirst=a("observatory-post-down-karis",n,"fs_downsample_karis",Ci),this.pipeDown=a("observatory-post-down",n,"fs_downsample",Ci),this.pipeUp=a("observatory-post-up",n,"fs_upsample_tent",Ci,Df),this.pipeComposite=a("observatory-post-composite",r,"fs_composite",i)}get sceneView(){if(!this._sceneView)throw new Error("PostChain.ensure() must run before sceneView is used");return this._sceneView}ensure(t,e){var o,h;const i=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(e));if(i===this.width&&s===this.height&&this.sceneTex!==null)return;this.width=i,this.height=s,(o=this.sceneTex)==null||o.destroy(),(h=this.bloomTex)==null||h.destroy(),this.sceneTex=this.device.createTexture({label:"observatory-scene-hdr",size:[i,s],format:Ci,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),this._sceneView=this.sceneTex.createView({label:"observatory-scene-hdr-view"});const n=kf(i,s);this.plan=n,this.bloomTex=this.device.createTexture({label:"observatory-bloom-mips",size:[n.baseW,n.baseH],format:Ci,mipLevelCount:n.mipCount,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING});const r=this.bloomTex;this.mipViews=Array.from({length:n.mipCount},(c,u)=>r.createView({label:`observatory-bloom-mip-${u}`,baseMipLevel:u,mipLevelCount:1})),this.bloomFullView=r.createView({label:"observatory-bloom-full"});const a=this._sceneView;this.downBind=this.mipViews.map((c,u)=>this.device.createBindGroup({label:`observatory-bloom-down-bind-${u}`,layout:this.blurLayout,entries:[{binding:1,resource:u===0?a:this.mipViews[u-1]},{binding:2,resource:this.samp}]})),this.upBind=[];for(let c=0;c+1=0;r--){const a=t.beginRenderPass({label:`observatory-bloom-up-${r}`,colorAttachments:[{view:this.mipViews[r],loadOp:"load",storeOp:"store"}]});a.setPipeline(this.pipeUp),a.setBindGroup(0,this.upBind[r]),a.draw(3),a.end()}const n=t.beginRenderPass({label:"observatory-post-composite",colorAttachments:[{view:e,loadOp:"clear",storeOp:"store"}]});n.setPipeline(this.pipeComposite),n.setBindGroup(0,this.compositeBind),n.draw(3),n.end()}dispose(){var t,e;(t=this.sceneTex)==null||t.destroy(),(e=this.bloomTex)==null||e.destroy(),this.sceneTex=null,this.bloomTex=null,this._sceneView=null,this.bloomFullView=null,this.mipViews=[],this.downBind=[],this.upBind=[],this.compositeBind=null,this.plan=null,this.width=0,this.height=0}}const ol=Math.sqrt(5/255/6.25),rh=ol-5/255,Vf={r:ol/(1+_n),g:(6/255+rh)/(1+_n),b:(10/255+rh)/(1+_n),a:1},gs=class gs{constructor(t){T(this,"canvas");T(this,"device",null);T(this,"context",null);T(this,"format","bgra8unorm");T(this,"clock");T(this,"demo");T(this,"freezeFrame");T(this,"rafId",0);T(this,"running",!1);T(this,"disposed",!1);T(this,"maxDpr");T(this,"onFrame");T(this,"params",new Float32Array(Bf));T(this,"paramsBuffer",null);T(this,"passes",[]);T(this,"post",null);T(this,"_status",{state:"booting"});T(this,"statusListeners",new Set);T(this,"lastRafTs",0);T(this,"fpsEstimate",0);T(this,"accumulatorMs",0);T(this,"frame",t=>{var u,d,f;if(!this.running||!this.device||!this.context||!this.paramsBuffer||!this.post)return;let e=0;for(this.lastRafTs>0&&(e=t-this.lastRafTs,e>0&&(this.fpsEstimate=Math.round(1e3/e))),this.lastRafTs=t,this.accumulatorMs+=Math.min(e,250);this.accumulatorMs>=gs.FIXED_DT_MS;)this.clock.tick(),this.accumulatorMs-=gs.FIXED_DT_MS;const i=this.clock.state,s=this.freezeFrame??i.frame,n=s/this.clock.framesPerLoop,r=this.params;r[0]=s,r[1]=n,r[5]=.5+.5*Math.sin(2*Math.PI*4*n),r[6]=this.canvas.width,r[7]=this.canvas.height,r[9]=Ff(this.demo),r[10]=s/60,r[11]=this.freezeFrame!==null?1:0,this.device.queue.writeBuffer(this.paramsBuffer,0,r);let a;try{a=this.context.getCurrentTexture()}catch{this.rafId=requestAnimationFrame(this.frame);return}this.post.ensure(a.width,a.height);const o=a.createView(),h=this.device.createCommandEncoder({label:"observatory-frame"});for(const p of this.passes)(u=p.compute)==null||u.call(p,h,s);const c=h.beginRenderPass({label:"observatory-main",colorAttachments:[{view:this.post.sceneView,clearValue:Vf,loadOp:"clear",storeOp:"store"}]});for(const p of this.passes)(d=p.render)==null||d.call(p,c,s);c.end(),this.post.encode(h,o),this.device.queue.submit([h.finish()]),(f=this.onFrame)==null||f.call(this,s,this.fpsEstimate),this.rafId=requestAnimationFrame(this.frame)});this.canvas=t.canvas,this.demo=t.demo,this.maxDpr=t.maxDpr??2,this.onFrame=t.onFrame,this.clock=new Hn({seed:t.seed}),this.freezeFrame=typeof t.freezeFrame=="number"&&Number.isFinite(t.freezeFrame)?(Math.floor(t.freezeFrame)%this.clock.framesPerLoop+this.clock.framesPerLoop)%this.clock.framesPerLoop:null,this.params[8]=1}get status(){return this._status}get gpuDevice(){return this.device}get presentationFormat(){return this.format}get sceneFormat(){return Ci}get demoClock(){return this.clock}onStatus(t){return this.statusListeners.add(t),t(this._status),()=>this.statusListeners.delete(t)}setStatus(t){this._status=t;for(const e of this.statusListeners)e(t)}addPass(t){this.passes.push(t)}async start(){var s;if(this.disposed)return!1;const t=navigator.gpu;if(!t)return this.setStatus({state:"unsupported",reason:"WebGPU is not available in this browser."}),!1;let e=null;try{e=await t.requestAdapter()}catch(n){return this.setStatus({state:"error",reason:n instanceof Error?n.message:"requestAdapter failed"}),!1}if(!e)return this.setStatus({state:"unsupported",reason:"No suitable GPU adapter found."}),!1;try{this.device=await e.requestDevice()}catch(n){return this.setStatus({state:"error",reason:n instanceof Error?n.message:"requestDevice failed"}),!1}if(this.disposed)return(s=this.device)==null||s.destroy(),this.device=null,!1;this.device.lost.then(n=>{this.disposed||n.reason==="destroyed"||(this.setStatus({state:"error",reason:`GPU device lost: ${n.message}`}),this.stopLoop())}),this.device.onuncapturederror=n=>{console.error("[observatory] WebGPU error:",n.error.message)};const i=this.canvas.getContext("webgpu");return i?(this.context=i,this.format=t.getPreferredCanvasFormat(),this.configureContext(),this.paramsBuffer=this.device.createBuffer({label:"observatory-params",size:this.params.byteLength,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.post=new Uf(this.device,this.paramsBuffer,this.format),this.setStatus({state:"running"}),this.running=!0,this.rafId=requestAnimationFrame(this.frame),!0):(this.setStatus({state:"error",reason:"Could not get webgpu canvas context."}),!1)}resize(){var s;if(!this.device||!this.context)return;const t=Math.min(window.devicePixelRatio||1,this.maxDpr),e=Math.max(1,Math.floor(this.canvas.clientWidth*t)),i=Math.max(1,Math.floor(this.canvas.clientHeight*t));(this.canvas.width!==e||this.canvas.height!==i)&&(this.canvas.width=e,this.canvas.height=i,this.configureContext(),(s=this.post)==null||s.ensure(e,i))}configureContext(){!this.device||!this.context||this.context.configure({device:this.device,format:this.format,alphaMode:"opaque"})}stopLoop(){this.running=!1,this.rafId!==0&&(cancelAnimationFrame(this.rafId),this.rafId=0)}dispose(){var t,e,i;this.disposed||(this.disposed=!0,this.stopLoop(),(t=this.paramsBuffer)==null||t.destroy(),this.paramsBuffer=null,(e=this.post)==null||e.dispose(),this.post=null,(i=this.device)==null||i.destroy(),this.device=null,this.context=null,this.passes=[],this.setStatus({state:"disposed"}),this.statusListeners.clear())}};T(gs,"FIXED_DT_MS",1e3/60);let Wr=gs;var Gf=At(``),Wf=At(' ',1);function Hf(l,t){Ms(t,!0);let e=lt(t,"freezeFrame",3,null),i,s=null,n=Pt(yh({state:"booting"})),r=null,a=null;mh(()=>{s=new Wr({canvas:i,demo:t.demo,seed:t.seed,freezeFrame:e(),maxDpr:2,onFrame:(d,f)=>{var p;return(p=t.onframe)==null?void 0:p.call(t,d,f)}}),r=s.onStatus(d=>{var f;mt(n,d,!0),(f=t.onstatus)==null||f.call(t,d)}),a=new ResizeObserver(()=>s==null?void 0:s.resize()),a.observe(i),s.start().then(d=>{var f;d&&s&&(s.resize(),(f=t.onready)==null||f.call(t,s))})}),pl(()=>{r==null||r(),a==null||a.disconnect(),s==null||s.dispose(),s=null});var o=Wf(),h=qr(o);vh(h,d=>i=d,()=>i);var c=ct(h,2);{var u=d=>{var f=Gf(),p=ct(rt(f),2),m=rt(p,!0);st(p);var g=ct(p,2),x=ct(rt(g));ml(),st(g),st(f),oe(()=>{Xt(m,D(n).reason),Yr(x,"href",`${wh??""}/graph`)}),xt(d,f)};zt(c,d=>{(D(n).state==="unsupported"||D(n).state==="error")&&d(u)})}xt(l,o),Ss()}function qf(l,t,e,i){const s=1/Math.tan(l/2),n=1/(e-i),r=new Float32Array(16);return r[0]=s/t,r[5]=s,r[10]=i*n,r[11]=-1,r[14]=i*e*n,r}function Xf(l,t,e){const[i,s,n]=l;let r=i-t[0],a=s-t[1],o=n-t[2],h=Math.hypot(r,a,o)||1;r/=h,a/=h,o/=h;let c=e[1]*o-e[2]*a,u=e[2]*r-e[0]*o,d=e[0]*a-e[1]*r;h=Math.hypot(c,u,d)||1,c/=h,u/=h,d/=h;const f=a*d-o*u,p=o*c-r*d,m=r*u-a*c,g=new Float32Array(16);return g[0]=c,g[1]=f,g[2]=r,g[4]=u,g[5]=p,g[6]=a,g[8]=d,g[9]=m,g[10]=o,g[12]=-(c*i+u*s+d*n),g[13]=-(f*i+p*s+m*n),g[14]=-(r*i+a*s+o*n),g[15]=1,g}function Yf(l,t){const e=new Float32Array(16);for(let i=0;i<4;i++)for(let s=0;s<4;s++)e[i*4+s]=l[s]*t[i*4]+l[4+s]*t[i*4+1]+l[8+s]*t[i*4+2]+l[12+s]*t[i*4+3];return e}function ah(l,t,e,i=.35){const s=l*Math.PI*2,n=[Math.sin(s)*e,e*i,Math.cos(s)*e],r=qf(50*Math.PI/180,t,.1,4e3),a=Xf(n,[0,0,0],[0,1,0]);let o=-n[0],h=-n[1],c=-n[2],u=Math.hypot(o,h,c)||1;o/=u,h/=u,c/=u;let d=h*0-c*1,f=c*0-o*0,p=o*1-h*0;u=Math.hypot(d,f,p)||1,d/=u,f/=u,p/=u;const m=f*c-p*h,g=p*o-d*c,x=d*h-f*o;return{viewProj:Yf(r,a),right:[d,f,p],up:[m,g,x],eye:n}}function oh(l){const t=/^#?([0-9a-fA-F]{6})$/.exec(l.trim());if(!t)return[107/255,114/255,128/255];const e=parseInt(t[1],16);return[(e>>16&255)/255,(e>>8&255)/255,(e&255)/255]}function Jf(l){const t=rl({tags:l.tags});return oh(t||nl[sl(l.retention)])}function Zf(l){const e=[...l.nodes].sort((r,a)=>r.isCenter!==a.isCenter?r.isCenter?-1:1:r.ida.id?1:0).map((r,a)=>Pf(r,a)),i=new Map;for(const r of e)i.set(r.id,r.index);const s=[];for(const r of l.edges){const a=i.get(r.source),o=i.get(r.target);a===void 0||o===void 0||a===o||s.push({sourceIndex:a,targetIndex:o,weight:r.weight,type:r.type})}const n=e.findIndex(r=>r.isCenter);return{nodes:e,edges:s,indexById:i,centerIndex:n<0?0:n}}function hl(l,t,e=120){const i=l.nodes.length,s=new Float32Array(i*vt);for(let n=0;nx.toLowerCase()));g.has("aha")&&(m|=ss.isAha),(g.has("failure")||g.has("guardrail"))&&(m|=ss.isFailure),(g.has("confusion")||g.has("weak-spot"))&&(m|=ss.isConfusion),s[a+ce.colorFlags+0]=d,s[a+ce.colorFlags+1]=f,s[a+ce.colorFlags+2]=p,s[a+ce.colorFlags+3]=m}return{data:s,nodeCount:i}}function Kf(l){const t=new Uint32Array(Math.max(1,l.edges.length)*Fr);return l.edges.forEach((e,i)=>{t[i*Fr]=e.sourceIndex,t[i*Fr+1]=e.targetIndex}),t}const jf=` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Camera { + view_proj: mat4x4, + right: vec4, + up: vec4, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var camera: Camera; +@group(0) @binding(2) var nodes: array; + +// Iridescent thin-film band — ported EXACTLY from causal-brain-demo.html +// spectral(w) (visual DNA §7.1): indigo → cyan-teal → mint → magenta rim, +// wrapping. Activation glow rides this band; base color stays FSRS state. +fn spectral(w_in: f32) -> vec3 { + let w = fract(w_in); + // var, not let: WGSL only allows dynamic indexing through a reference. + var stops = array, 4>( + vec3(0.20, 0.28, 0.95), // indigo + vec3(0.20, 0.85, 0.90), // cyan-teal + vec3(0.45, 1.00, 0.72), // mint + vec3(0.85, 0.45, 1.00) // magenta rim + ); + let f = w * 4.0; + let i = u32(floor(f)) % 4u; + let frac = f - floor(f); + let a = stops[i]; + let b = stops[(i + 1u) % 4u]; + return mix(a, b, frac); +} + +struct VSOut { + @builtin(position) clip: vec4, + @location(0) uv: vec2, + // Per-instance constants: flat interpolation guarantees the flag bit + // field survives the raster stage bit-exact (no barycentric rounding). + @location(1) @interpolate(flat) color: vec3, + // x retention, y flags (bit field as f32), z recall intensity, w radius + @location(2) @interpolate(flat) misc: vec4, + // Per-demo choreography lanes (demo.y, demo.z, demo.w), gated by demo_id: + // rescue (2) searchlight/wave/shock, forgetting-horizon (3) fade-and-fall, + // firewall (4) flare-membrane/shock. Each demo's choreography pass is the + // ONLY writer of its lanes, and every gated term below is an exact no-op + // when its lane is 0.0 — other demos stay pixel-identical. + @location(3) @interpolate(flat) demo_yzw: vec3, +}; + +// Quad corners for two triangles (vertex_index 0..5). +const CORNERS = array, 6>( + vec2(-1.0, -1.0), + vec2( 1.0, -1.0), + vec2( 1.0, 1.0), + vec2(-1.0, -1.0), + vec2( 1.0, 1.0), + vec2(-1.0, 1.0) +); + +@vertex +fn vs_main( + @builtin(vertex_index) vi: u32, + @builtin(instance_index) ii: u32 +) -> VSOut { + var out: VSOut; + if (ii >= u32(params.node_count)) { + // degenerate — clipped away + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + return out; + } + + let node = nodes[ii]; + let corner = CORNERS[vi]; + + // Breath: halo geometry swells ~6% on the global pulse (§7.2), and the + // center memory breathes a touch deeper — a heartbeat, not a strobe. + let flags = u32(node.color_flags.w); + let is_center = (flags & 1u) != 0u; + var breath = 1.0 + 0.06 * params.pulse; + if (is_center) { + breath = 1.0 + 0.12 * params.pulse; + } + + // Sprite spans ~3.2× the core radius so the halo has room to feather out. + // Recall activation swells the sprite — the wavefront physically blooms. + // Per-demo choreography lanes swell it too, gated by demo_id so each + // demo's grammar can never leak into another (lanes are 0.0 elsewhere, + // and the gate makes the no-op structural, not just numerical). + let recall = node.demo.x; + let dy = node.demo.y; + let dz = node.demo.z; + let dw = node.demo.w; + var lane_swell = 0.0; + if (params.demo_id == 2.0) { + // salience-rescue: searchlight pop, wave shiver, shock bloom. + lane_swell = 0.5 * dy + 0.25 * dz + 0.9 * dw; + } else if (params.demo_id == 4.0) { + // firewall: intrusion flare pop (band (0..1]), membrane presence + // (band [2.6..2.9] via the range gate), crimson shock bloom. + lane_swell = 0.35 * min(dy, 1.0) + 0.3 * smoothstep(1.5, 2.2, dy) + 0.55 * dw; + } + // forgetting-horizon (demo 3): VISUAL displacement toward the horizon — + // down and away from the field axis, ~40.5 units at dz = 1 — plus a + // shrink. pos_radius is NEVER written (the force sim owns positions); + // drift is pure of demo.z, so ?frame=N capture stays exact. CPU mirror: + // forgetting-plan.ts horizonDrift(). + var horizon_scale = 1.0; + var drift = vec3(0.0); + if (params.demo_id == 3.0) { + let dzc = clamp(dz, 0.0, 1.0); + horizon_scale = 1.0 - 0.35 * dzc; + if (dz > 0.0) { + let p = node.pos_radius.xyz; + let r_xz = max(length(p.xz), 0.001); + let away = vec3(p.x / r_xz, 0.0, p.z / r_xz); + drift = dzc * (vec3(0.0, -34.0, 0.0) + away * 22.0); + } + } + let half_size = node.pos_radius.w * 3.2 * breath * (1.0 + 0.9 * recall) + * (1.0 + lane_swell) * horizon_scale; + let world = node.pos_radius.xyz + drift + + camera.right.xyz * corner.x * half_size + + camera.up.xyz * corner.y * half_size; + + out.clip = camera.view_proj * vec4(world, 1.0); + out.uv = corner; + out.color = node.color_flags.rgb; + out.misc = vec4(node.vel_retention.w, node.color_flags.w, node.demo.x, node.pos_radius.w); + out.demo_yzw = vec3(dy, dz, dw); + return out; +} + +@fragment +fn fs_main(in: VSOut) -> @location(0) vec4 { + let d = length(in.uv); + if (d > 1.0) { + discard; + } + + let retention = in.misc.x; + let flags = u32(in.misc.y); + let suppressed = (flags & 2u) != 0u; + let is_center = (flags & 1u) != 0u; + + // Soft sprite: hot core + feathered halo. The halo rides the breath pulse. + let core = smoothstep(0.22, 0.0, d); + let halo = pow(max(1.0 - d, 0.0), 2.4); + var intensity = core * 1.35 + halo * (0.42 + 0.18 * params.pulse); + + // Meaning layer: low-retention memories glow dimmer (drifting toward the + // horizon), the center anchor reads brightest. + intensity = intensity * (0.45 + 0.55 * retention); + if (is_center) { + intensity = intensity * 1.6; + } + if (suppressed) { + intensity = intensity * 0.28; + } + + var color = in.color * intensity; + + // Forgetting-horizon (demo 3): multiplicative dim toward near-black as + // demo.z rises. Floor 0.06 — never fully gone, always retrievable. Sits + // BEFORE the recall block so a rescued memory's ignition burns through + // the fade. demo_yzw.y carries demo.z (vec3 = y/z/w lanes). + if (params.demo_id == 3.0) { + color = color * mix(1.0, 0.06, clamp(in.demo_yzw.y, 0.0, 1.0)); + } + + // Recall activation (§7.1): the thin-film band takes over as the wave + // lands. Hue drifts exactly ONE full spectral cycle per 720-frame loop + // (loop_phase wraps 0→1 and spectral() fract-wraps) — oil-slick shimmer + // with a mathematically invisible loop seam. + let recall = in.misc.z; + if (recall > 0.001) { + let band = spectral(0.1 + params.loop_phase + d * 0.35); + let activation = band * recall * (core * 1.7 + halo * 0.9); + // white-hot pinpoint at full ignition + let flash = vec3(1.0, 1.0, 1.0) * core * recall * 0.55; + color = color + activation + flash; + } + + // Per-demo choreography lanes — gated by demo_id AND on nonzero values so + // every other demo is pixel-unchanged (each demo's pass is the only + // writer of its lanes, and lanes are exactly 0.0 everywhere else). + if (params.demo_id == 2.0) { + if (in.demo_yzw.x > 0.001) { + // Searchlight: cold clinical white — unmistakably NOT the spectral grammar. + color = color + vec3(0.82, 0.90, 1.00) * in.demo_yzw.x * (core * 1.8 + halo * 0.7); + } + if (in.demo_yzw.y > 0.001) { + // Interrogation shimmer: icy spectral strobe as the wave scrubs the past. + color = color + spectral(0.55 + params.loop_phase) * in.demo_yzw.y * (core * 0.9 + halo * 0.5) + + vec3(1.0) * core * in.demo_yzw.y * 0.2; + } + if (in.demo_yzw.z > 0.001) { + // Detonation: crimson blaze + warm-white pinpoint. + color = color + vec3(1.00, 0.16, 0.10) * in.demo_yzw.z * (core * 1.9 + halo * 1.1) + + vec3(1.0, 0.85, 0.8) * core * in.demo_yzw.z * 0.4; + } + } else if (params.demo_id == 4.0) { + // firewall: demo.y carries TWO value bands — intrusion flare (0..1] + // and membrane [2.6..2.9] — separated by range, one lane. demo.w is + // the crimson shock rim / sever blink. (demo_yzw = y/z/w lanes.) + let fy = in.demo_yzw.x; + let fw = in.demo_yzw.z; + // Intrusion flare: sickly green-white — a hue deliberately OUTSIDE + // both the FSRS palette and the thin-film band. Continuous across the + // band boundary (fades out as fy climbs toward the membrane band). + let flare = min(fy, 1.0) * (1.0 - smoothstep(1.0, 1.8, fy)); + if (flare > 0.001) { + color = color + vec3(0.62, 1.00, 0.55) * flare * (core * 1.7 + halo * 0.9) + + vec3(0.90, 1.00, 0.85) * core * flare * 0.5; + } + // Membrane: quarantine ring at d ≈ 0.75 with fresnel-ish falloff — + // green body, crimson edge. exp(-q·q) squares by multiplication and + // the pow base is clamped ≥ 0 (no pow(neg) anywhere). + let mw = smoothstep(1.5, 2.2, fy); + if (mw > 0.001) { + let q = (d - 0.75) * 9.0; + let ring = exp(-q * q); + let fresnel = pow(clamp(d / 0.75, 0.0, 1.0), 3.0); + let ring_col = mix(vec3(0.55, 1.00, 0.60), vec3(1.00, 0.20, 0.16), + smoothstep(0.72, 0.92, d)); + color = color + ring_col * ring * fresnel * mw * 1.4; + } + // Shockwave: crimson RIM as the front passes (a rim, not a blaze). + if (fw > 0.001) { + let rim = smoothstep(0.45, 0.8, d) * (1.0 - smoothstep(0.85, 1.0, d)); + color = color + vec3(1.00, 0.14, 0.10) * rim * fw * 1.5 + + vec3(1.00, 0.60, 0.50) * core * fw * 0.15; + } + } + + // Additive target (src=one, dst=one): alpha is ignored, light accumulates. + return vec4(color * params.brightness, 1.0); +} +`,Qf=` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var nodes: array; +// x source index, y target index, z beat frame, w kind (0 recall, 1 backward) +@group(0) @binding(2) var path: array>; +// x source index, y target node index (Increment 7: force simulation edges) +@group(0) @binding(3) var edges: array>; + +// --- Force-simulation helpers (Increment 7) --- + +fn safe_normalize(v: vec3) -> vec3 { + let l = length(v); + if (l < 0.0001) { return vec3(0.0); } + return v / l; +} + +fn clamp_len(v: vec3, hi: f32) -> vec3 { + let l = length(v); + if (l > hi && l > 0.0001) { return v * (hi / l); } + return v; +} + +@compute @workgroup_size(64) +fn recall_sim(@builtin(global_invocation_id) id: vec3) { + let i = id.x; + if (i >= u32(params.node_count)) { + return; + } + + let frame = params.frame; + var intensity = 0.0; + + let steps = u32(params.path_count); + for (var s = 0u; s < steps; s = s + 1u) { + let step = path[s]; + let bf = f32(step.z); + + if (step.y == i) { + // Arrival: sharp attack as the wavefront lands, slow afterglow. + let attack = smoothstep(bf - 14.0, bf + 4.0, frame); + let decay = 1.0 - smoothstep(bf + 40.0, bf + 200.0, frame); + intensity = max(intensity, attack * decay); + } + if (step.x == i && step.x != step.y) { + // Departure: the source shimmers as the wave leaves it. + let rise = smoothstep(bf - 55.0, bf - 30.0, frame); + let fall = 1.0 - smoothstep(bf + 10.0, bf + 70.0, frame); + intensity = max(intensity, rise * fall * 0.45); + } + } + + var node = nodes[i]; + let flags = u32(node.color_flags.w); + let is_center = (flags & 1u) != 0u; + + // Write recall intensity (existing behavior preserved). + node.demo.x = intensity; + + // --- Increment 7: force simulation --- + + // Capture mode (params._pad == 1.0): skip physics integration entirely. + // The storage-buffer state stays frozen at initial upload values, + // making same URL + frame → identical pixels (spec §4 Inc 9). + if (params._pad == 0.0) { + // 7B: center anchor — center node never moves. + // (WGSL forbids swizzle stores — reconstruct the vec4, preserving .w.) + if (is_center) { + node.pos_radius = vec4(0.0, 0.0, 0.0, node.pos_radius.w); + node.vel_retention = vec4(0.0, 0.0, 0.0, node.vel_retention.w); + nodes[i] = node; + return; + } + + let pos = node.pos_radius.xyz; + var force = vec3(0.0); + + // 7C: edge springs — scan existing edgeBuffer, no atomics. + for (var e = 0u; e < u32(params.edge_count); e = e + 1u) { + let edge = edges[e]; + var other_idx = 0xffffffffu; + if (edge.x == i) { other_idx = edge.y; } + if (edge.y == i) { other_idx = edge.x; } + if (other_idx != 0xffffffffu && other_idx < u32(params.node_count)) { + let other = nodes[other_idx].pos_radius.xyz; + let delta = other - pos; + let dist = max(length(delta), 0.001); + let dir = delta / dist; + let stretch = dist - 34.0; + force = force + dir * stretch * 0.00055; + } + } + + // 7D: soft repulsion (only ≤ 500 nodes for performance). + if (u32(params.node_count) <= 500u) { + for (var j = 0u; j < u32(params.node_count); j = j + 1u) { + if (j == i) { continue; } + let other = nodes[j].pos_radius.xyz; + let delta = pos - other; + let d2 = max(dot(delta, delta), 9.0); + force = force + safe_normalize(delta) * (7.5 / d2); + } + } + + // Gentle centering: keeps the field in frame without crushing it. + force = force + (-pos) * 0.0008; + + // 7B: velocity damping + cap, then position integration. + var vel = node.vel_retention.xyz; + vel = (vel + force) * 0.88; + vel = clamp_len(vel, 0.42); + node.vel_retention = vec4(vel, node.vel_retention.w); + node.pos_radius = vec4(pos + vel, node.pos_radius.w); + } + // When capture_mode (params._pad == 1.0), node is NOT written back — + // the storage buffer retains its initial upload values, guaranteeing + // deterministic pixels for the same frame index. + nodes[i] = node; +} +`,ll=` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Camera { + view_proj: mat4x4, + right: vec4, + up: vec4, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var camera: Camera; +@group(0) @binding(2) var nodes: array; +// x source index, y target index, z beat frame, w kind (0 recall, 1 backward) +@group(0) @binding(3) var path: array>; + +// Same thin-film band as the node shader (§7.1). +fn spectral(w_in: f32) -> vec3 { + let w = fract(w_in); + // var, not let: WGSL only allows dynamic indexing through a reference. + var stops = array, 4>( + vec3(0.20, 0.28, 0.95), + vec3(0.20, 0.85, 0.90), + vec3(0.45, 1.00, 0.72), + vec3(0.85, 0.45, 1.00) + ); + let f = w * 4.0; + let i = u32(floor(f)) % 4u; + let frac = f - floor(f); + let a = stops[i]; + let b = stops[(i + 1u) % 4u]; + return mix(a, b, frac); +} + +struct VSOut { + @builtin(position) clip: vec4, + // x: t along segment (0 source → 1 target), y: side (-1..1) + @location(0) uv: vec2, + // x: beat frame, y: kind, z: segment visible (0 skips degenerate steps) + // Per-instance constant — flat keeps it bit-exact through the raster. + @location(1) @interpolate(flat) beat: vec3, +}; + +// (t, side) corners for two triangles of the ribbon. +const RIBBON = array, 6>( + vec2(0.0, -1.0), + vec2(1.0, -1.0), + vec2(1.0, 1.0), + vec2(0.0, -1.0), + vec2(1.0, 1.0), + vec2(0.0, 1.0) +); + +@vertex +fn vs_main( + @builtin(vertex_index) vi: u32, + @builtin(instance_index) ii: u32 +) -> VSOut { + var out: VSOut; + if (ii >= u32(params.path_count)) { + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + out.beat = vec3(0.0); + return out; + } + + let step = path[ii]; + let src = nodes[step.x]; + let dst = nodes[step.y]; + let corner = RIBBON[vi]; + + // Degenerate (origin beat: source == target) — emit nothing visible. + if (step.x == step.y) { + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + out.beat = vec3(0.0); + return out; + } + + let a = camera.view_proj * vec4(src.pos_radius.xyz, 1.0); + let b = camera.view_proj * vec4(dst.pos_radius.xyz, 1.0); + + // NDC-space perpendicular for constant screen width. + let ndc_a = a.xy / max(a.w, 0.0001); + let ndc_b = b.xy / max(b.w, 0.0001); + var dir = ndc_b - ndc_a; + let dlen = max(length(dir), 0.0001); + dir = dir / dlen; + let perp = vec2(-dir.y, dir.x); + + // Ribbon half-width in NDC (aspect-corrected), ~2.5 px on a 900px-tall view. + let px = 2.5 / max(params.viewport_h, 1.0) * 2.0; + let width = vec2(px * (params.viewport_h / max(params.viewport_w, 1.0)), px); + + let base = mix(a, b, corner.x); + let offset = perp * width * corner.y * base.w; + out.clip = vec4(base.xy + offset, base.zw); + out.uv = vec2(corner.x, corner.y); + out.beat = vec3(f32(step.z), f32(step.w), 1.0); + return out; +} + +@fragment +fn fs_main(in: VSOut) -> @location(0) vec4 { + if (in.beat.z < 0.5) { + discard; + } + + let frame = params.frame; + let bf = in.beat.x; + let t = in.uv.x; + + // Wave departs 45 frames before the beat and lands exactly on it. + let progress = clamp((frame - (bf - 45.0)) / 45.0, 0.0, 1.0); + // Nothing before departure; trail lingers ~90 frames after arrival. + let live = smoothstep(bf - 46.0, bf - 44.0, frame) + * (1.0 - smoothstep(bf + 40.0, bf + 90.0, frame)); + if (live <= 0.001) { + discard; + } + + // The light packet: gaussian around the wavefront position. + let dwave = (t - progress) * 14.0; + let packet = exp(-dwave * dwave); + + // Fading trail behind the packet — provenance stays visible a beat. + var trail = 0.0; + if (t < progress) { + trail = (1.0 - (progress - t)) * 0.22; + } + + // Feather across the ribbon width. + let across = 1.0 - abs(in.uv.y); + let profile = across * across; + + // Backward/contradiction hops burn hotter into the magenta rim (§7.4). + // Hue drifts one full spectral cycle per loop (seamless at the wrap). + // Kind 2 (salience-rescue probe): a gray failing beam — vector search + // visibly probing lookalikes and coming back empty. Kinds 0/1 unchanged. + var band = spectral(0.15 + t * 0.35 + params.loop_phase); + var packet_white = 0.35; + if (in.beat.y > 1.5) { + band = vec3(0.62, 0.66, 0.72); + packet_white = 0.18; + } else if (in.beat.y > 0.5) { + band = mix(band, vec3(1.0, 0.25, 0.45), 0.55); + } + + let energy = (packet * 1.6 + trail) * profile * live; + let color = band * energy + vec3(1.0) * packet * profile * live * packet_white; + return vec4(color * params.brightness, 1.0); +} +`;function $f(l){return 60+l*60}function tp(l,t,e=8){const i=[...l.nodes].sort((o,h)=>o.idh.id?1:0),s=[...l.edges].sort((o,h)=>{const c=`${o.source}\0${o.target}\0${o.type}`,u=`${h.source}\0${h.target}\0${h.type}`;return cu?1:0}),n=bf(i,s,l.center_id,e),r=[];for(let o=0;o0?n.beats[o-1].nodeId:h.nodeId,d=t.indexById.get(u)??c;r.push({sourceIndex:d,targetIndex:c,beatFrame:$f(o),kind:h.kind==="contradiction"?Be.backwardCause:Be.recall,beatKind:h.kind,nodeId:h.nodeId,label:h.node.label})}const a=new Uint32Array(Math.max(1,r.length)*ns);return r.forEach((o,h)=>{a[h*ns]=o.sourceIndex,a[h*ns+1]=o.targetIndex,a[h*ns+2]=o.beatFrame,a[h*ns+3]=o.kind}),{data:a,steps:r,path:n}}const ep=24,hh=300;class ip{constructor(t){T(this,"engine");T(this,"pipeline",null);T(this,"bindGroup",null);T(this,"cameraBuffer",null);T(this,"nodeBuffer",null);T(this,"edgeBuffer",null);T(this,"cameraData",new Float32Array(ep));T(this,"nodeCount",0);T(this,"simPipeline",null);T(this,"simBindGroup",null);T(this,"pathBuffer",null);T(this,"pathPipeline",null);T(this,"pathBindGroup",null);T(this,"pathStepCount",0);T(this,"graph",null);T(this,"pathSteps",[]);this.engine=t,t.addPass(this)}upload(t,e,i){var d,f,p;const s=this.engine.gpuDevice;if(!s)return;const n=(i==null?void 0:i.recallPath)??!0,r=Zf(t);this.graph=r;const a=new Hn({seed:e}),{data:o,nodeCount:h}=hl(r,a.state.rng);this.nodeCount=h,(d=this.nodeBuffer)==null||d.destroy(),this.nodeBuffer=s.createBuffer({label:"observatory-node-state",size:Math.max(o.byteLength,64),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC|GPUBufferUsage.VERTEX}),s.queue.writeBuffer(this.nodeBuffer,0,o.buffer);const c=Kf(r);(f=this.edgeBuffer)==null||f.destroy(),this.edgeBuffer=s.createBuffer({label:"observatory-edge-index",size:c.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),s.queue.writeBuffer(this.edgeBuffer,0,c.buffer);const u=n?tp(t,r):{steps:[],data:new Uint32Array(4)};this.pathSteps=u.steps,(p=this.pathBuffer)==null||p.destroy(),this.pathBuffer=s.createBuffer({label:"observatory-path-steps",size:u.data.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),s.queue.writeBuffer(this.pathBuffer,0,u.data.buffer),this.pathStepCount=this.pathSteps.length,this.engine.params[2]=h,this.engine.params[3]=r.edges.length,this.engine.params[4]=this.pathSteps.length,this.cameraBuffer||(this.cameraBuffer=s.createBuffer({label:"observatory-camera",size:this.cameraData.byteLength,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})),this.createPipeline(s)}setPathSteps(t,e){var s;const i=this.engine.gpuDevice;i&&(this.pathSteps=e,this.pathStepCount=e.length,(s=this.pathBuffer)==null||s.destroy(),this.pathBuffer=i.createBuffer({label:"observatory-path-steps",size:Math.max(t.byteLength,16),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),i.queue.writeBuffer(this.pathBuffer,0,t.buffer),this.engine.params[4]=e.length,this.createPipeline(i))}createPipeline(t){if(!this.engine.paramsBuffer||!this.cameraBuffer||!this.nodeBuffer)return;if(this.pathBuffer){const i=t.createShaderModule({label:"observatory-simulate",code:Qf});this.simPipeline=t.createComputePipeline({label:"observatory-recall-sim",layout:"auto",compute:{module:i,entryPoint:"recall_sim"}});const s=[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.nodeBuffer}},{binding:2,resource:{buffer:this.pathBuffer}}];this.edgeBuffer&&s.push({binding:3,resource:{buffer:this.edgeBuffer}}),this.simBindGroup=t.createBindGroup({label:"observatory-recall-sim-bind",layout:this.simPipeline.getBindGroupLayout(0),entries:s})}const e=t.createShaderModule({label:"observatory-render-nodes",code:jf});if(this.pipeline=t.createRenderPipeline({label:"observatory-nodes",layout:"auto",vertex:{module:e,entryPoint:"vs_main"},fragment:{module:e,entryPoint:"fs_main",targets:[{format:this.engine.sceneFormat,blend:{color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}}}]},primitive:{topology:"triangle-list"}}),this.bindGroup=t.createBindGroup({label:"observatory-nodes-bind",layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.cameraBuffer}},{binding:2,resource:{buffer:this.nodeBuffer}}]}),this.pathBuffer){const i=t.createShaderModule({label:"observatory-render-path",code:ll});this.pathPipeline=t.createRenderPipeline({label:"observatory-path",layout:"auto",vertex:{module:i,entryPoint:"vs_main"},fragment:{module:i,entryPoint:"fs_main",targets:[{format:this.engine.sceneFormat,blend:{color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}}}]},primitive:{topology:"triangle-list"}}),this.pathBindGroup=t.createBindGroup({label:"observatory-path-bind",layout:this.pathPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.cameraBuffer}},{binding:2,resource:{buffer:this.nodeBuffer}},{binding:3,resource:{buffer:this.pathBuffer}}]})}}compute(t){const e=this.engine.gpuDevice;if(!e||!this.cameraBuffer)return;const i=this.engine.params[6]||1,s=this.engine.params[7]||1,n=this.engine.params[1],r=ah(n,i/s,hh);if(this.cameraData.set(r.viewProj,0),this.cameraData[16]=r.right[0],this.cameraData[17]=r.right[1],this.cameraData[18]=r.right[2],this.cameraData[19]=0,this.cameraData[20]=r.up[0],this.cameraData[21]=r.up[1],this.cameraData[22]=r.up[2],this.cameraData[23]=0,e.queue.writeBuffer(this.cameraBuffer,0,this.cameraData),this.simPipeline&&this.simBindGroup&&this.nodeCount>0){const a=t.beginComputePass({label:"observatory-recall-sim"});a.setPipeline(this.simPipeline),a.setBindGroup(0,this.simBindGroup),a.dispatchWorkgroups(Math.ceil(this.nodeCount/64)),a.end()}}render(t){!this.pipeline||!this.bindGroup||this.nodeCount===0||(t.setPipeline(this.pipeline),t.setBindGroup(0,this.bindGroup),t.draw(6,this.nodeCount),this.pathPipeline&&this.pathBindGroup&&this.pathStepCount>0&&(t.setPipeline(this.pathPipeline),t.setBindGroup(0,this.pathBindGroup),t.draw(6,this.pathStepCount)))}get nodeStateBuffer(){return this.nodeBuffer}get cameraUniformBuffer(){return this.cameraBuffer}get nodeCountValue(){return this.nodeCount}get pathStepMeta(){return this.pathSteps}async pickAt(t,e){const i=this.engine.gpuDevice;if(!i||!this.nodeBuffer||!this.graph||this.nodeCount===0)return null;const s=this.nodeCount*vt*4,n=i.createBuffer({label:"observatory-pick-staging",size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),r=i.createCommandEncoder({label:"observatory-pick-copy"});r.copyBufferToBuffer(this.nodeBuffer,0,n,0,s),i.queue.submit([r.finish()]);let a;try{await n.mapAsync(GPUMapMode.READ),a=new Float32Array(n.getMappedRange().slice(0))}catch{return n.destroy(),null}n.unmap(),n.destroy();const o=this.engine.params[6]||1,h=this.engine.params[7]||1,c=this.engine.params[1],u=ah(c,o/h,hh).viewProj,d=1/Math.tan(50*Math.PI/360);let f=-1,p=1/0;for(let m=0;m0){const t=l.centerIndex,e=l.edges.filter(i=>i.sourceIndex===t||i.targetIndex===t);if(e.length>0){let i=-1,s=-1;for(const n of e){const r=n.sourceIndex===t?n.targetIndex:n.sourceIndex,a=l.nodes[r];a&&a.retention>s&&(s=a.retention,i=r)}if(i>=0)return i}}for(let t=0;tx.sourceIndex===i||x.targetIndex===i);for(let x=0;xn.sourceIndex===t||n.targetIndex===t),i=e.length;if(i===0)return new Uint32Array(0);const s=new Uint32Array(i*rs);for(let n=0;n, + target_size: vec4, + color_phase: vec4, + state: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var particles: array; + +@compute @workgroup_size(64) +fn birth_compute(@builtin(global_invocation_id) id: vec3) { + let i = id.x; + if (i >= arrayLength(&particles)) { + return; + } + + // Capture mode (params._pad == 1.0): skip physics integration. + // The storage-buffer state stays frozen at initial upload values. + if (params._pad == 1.0) { + return; + } + + var particle = particles[i]; + let frame = params.frame; + let phase = params.loop_phase; + + // --- Convergence choreography (integer cycles per 720-frame loop) --- + + // Phase offset (stagger) from start_life.w: 0..1 → delays convergence. + let stagger = particle.start_life.w; + + // Effective frame: staggered loop frame (wraps at 720). + let effFrame = fract(phase + stagger * 0.15) * 720.0; + + // --- Phase 1: latent trace condensing (frames 0–239) --- + // Slow drift toward target. + var t: f32; + if (effFrame < 240.0) { + // Smooth ease-in: 0 → 1 over 240 frames. + t = effFrame / 240.0; + t = t * t * (3.0 - 2.0 * t); // smoothstep + } + // --- Phase 2: engram coalescence (frames 240–329) --- + // Accelerated convergence to target. + else if (effFrame < 330.0) { + let localFrame = effFrame - 240.0; + // 0 → 1 over 90 frames, with slight overshoot then settle. + t = localFrame / 90.0; + t = t * t * (3.0 - 2.0 * t); + // Add a small overshoot (1.05) then settle back to 1.0. + t = 1.0 - 0.05 * (1.0 - t); + } + // --- Phase 3: memory ignition (frames 330–359) --- + // Hold at target (flash handled in render). + else if (effFrame < 360.0) { + t = 1.0; + } + // --- Phase 4: associations engrave (frames 360–509) --- + // Hold at target. + else if (effFrame < 510.0) { + t = 1.0; + } + // --- Phase 5: stabilization (frames 510–719) --- + // Hold at target, then fade alpha for reset. + else { + let localFrame = effFrame - 510.0; + // Fade alpha to 0 for seamless reset at frame 0. + t = 1.0; + particle.state.w = 1.0 - smoothstep(0.0, 150.0, localFrame); + } + + // Interpolate from start to target. + let startPos = particle.start_life.xyz; + let targetPos = particle.target_size.xyz; + // (WGSL forbids swizzle stores - reconstruct, preserving alpha in .w) + particle.state = vec4(mix(startPos, targetPos, t), particle.state.w); + + // Alpha: particles fade in during convergence, fade out during reset. + let fadeIn = smoothstep(0.0, 60.0, effFrame); + particle.state.w = max(particle.state.w, fadeIn * 0.8); + + particles[i] = particle; +} +`,fp=16,pp=6,mp=330,gp=359,yp=360;class xp{constructor(t){T(this,"engine");T(this,"nodeRenderer");T(this,"active");T(this,"computePipeline",null);T(this,"computeBindGroup",null);T(this,"particleBuffer",null);T(this,"particleCount",0);T(this,"renderPipeline",null);T(this,"renderBindGroup",null);T(this,"haloPipeline",null);T(this,"haloBindGroup",null);T(this,"haloIndexBuffer",null);T(this,"engravePipeline",null);T(this,"engraveBindGroup",null);T(this,"engraveBuffer",null);T(this,"engraveStepCount",0);T(this,"timeline",[]);T(this,"birthPlan",null);this.engine=t.engine,this.nodeRenderer=t.nodeRenderer,this.active=!1,this.engine.addPass(this)}get engraveSteps(){var t;return((t=this.birthPlan)==null?void 0:t.edgeSteps)??new Uint32Array(0)}upload(t){var n,r;const e=this.engine.gpuDevice;if(!e||!this.nodeRenderer.nodeStateBuffer)return;const i=this.nodeRenderer.graph;if(!i)return;this.birthPlan=lp(i,t),this.timeline=this.birthPlan.timeline;const s=this.birthPlan.particles.length/fp;this.particleCount=s,(n=this.particleBuffer)==null||n.destroy(),this.particleBuffer=e.createBuffer({label:"observatory-birth-particles",size:this.birthPlan.particles.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),e.queue.writeBuffer(this.particleBuffer,0,this.birthPlan.particles.buffer),(r=this.engraveBuffer)==null||r.destroy(),this.engraveStepCount=this.birthPlan.edgeSteps.length/4,this.engraveStepCount>0&&(this.engraveBuffer=e.createBuffer({label:"observatory-birth-engrave",size:this.birthPlan.edgeSteps.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),e.queue.writeBuffer(this.engraveBuffer,0,this.birthPlan.edgeSteps.buffer)),this.createComputePipeline(e),this.createRenderPipeline(e),this.createHaloPipeline(e),this.createEngravePipeline(e)}createComputePipeline(t){const e=t.createShaderModule({label:"observatory-birth-compute",code:dp});this.computePipeline=t.createComputePipeline({label:"observatory-birth-compute-pipeline",layout:"auto",compute:{module:e,entryPoint:"birth_compute"}});const i=[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.particleBuffer}}];this.computeBindGroup=t.createBindGroup({label:"observatory-birth-compute-bind",layout:this.computePipeline.getBindGroupLayout(0),entries:i})}createRenderPipeline(t){const i=t.createShaderModule({label:"observatory-birth-render",code:` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Camera { + view_proj: mat4x4, + right: vec4, + up: vec4, +}; + +struct BirthParticle { + start_life: vec4, + target_size: vec4, + color_phase: vec4, + state: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var camera: Camera; +@group(0) @binding(2) var particles: array; + +struct VSOut { + @builtin(position) clip: vec4, + @location(0) uv: vec2, + @location(1) @interpolate(flat) color: vec3, + @location(2) @interpolate(flat) misc: vec4, +}; + +const CORNERS = array, 6>( + vec2(-1.0, -1.0), + vec2( 1.0, -1.0), + vec2( 1.0, 1.0), + vec2(-1.0, -1.0), + vec2( 1.0, 1.0), + vec2(-1.0, 1.0) +); + +@vertex +fn vs_main( + @builtin(vertex_index) vi: u32, + @builtin(instance_index) ii: u32 +) -> VSOut { + var out: VSOut; + if (ii >= arrayLength(&particles)) { + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + return out; + } + + let particle = particles[ii]; + let corner = CORNERS[vi]; + + // Current position from state.xyz. + let pos = particle.state.xyz; + + // Base size from target_size.w. + let baseSize = particle.target_size.w; + + // Flash boost during ignition (frames 330–359). + let frame = params.frame; + var flashBoost = 1.0; + if (frame >= 330.0 && frame <= 359.0) { + let flashT = (frame - 330.0) / 29.0; // 0..1 over flash frames + // Sharp flash: peaks at frame 345, fades by 359. + flashBoost = 1.0 + 3.0 * (1.0 - smoothstep(330.0, 345.0, frame)) + + 2.0 * smoothstep(345.0, 359.0, frame); + } + + // Size: base + flash boost + pulse breathing. + let breath = 1.0 + 0.06 * params.pulse; + let halfSize = baseSize * 4.0 * breath * flashBoost; + + let world = pos + + camera.right.xyz * corner.x * halfSize + + camera.up.xyz * corner.y * halfSize; + + out.clip = camera.view_proj * vec4(world, 1.0); + out.uv = corner; + + // Color: violet dust (0.55, 0.32, 1.00) with spectral rim. + let phase = particle.color_phase.w; + let spectralW = fract(params.loop_phase + phase); + var spectralColor: vec3; + var stops = array, 4>( + vec3(0.55, 0.32, 1.00), // violet base + vec3(0.40, 0.60, 1.00), // blue-violet + vec3(0.70, 0.45, 1.00), // magenta-violet + vec3(0.55, 0.32, 1.00) // wrap + ); + let f = spectralW * 4.0; + let i = u32(floor(f)) % 4u; + let frac = f - floor(f); + spectralColor = mix(stops[i], stops[(i + 1u) % 4u], frac); + + // Alpha from state.w (convergence progress + fade). + let alpha = particle.state.w; + + out.color = spectralColor; + out.misc = vec4(baseSize, 0.0, 0.0, alpha); + return out; +} + +@fragment +fn fs_main(in: VSOut) -> @location(0) vec4 { + let d = length(in.uv); + if (d > 1.0) { + discard; + } + + let alpha = in.misc.w; + let core = smoothstep(0.25, 0.0, d); + let halo = pow(max(1.0 - d, 0.0), 2.0); + + // Additive glow: core + halo. + let intensity = core * 1.5 + halo * 0.6; + + // Flash boost during ignition. + let frame = params.frame; + var flash = 0.0; + if (frame >= 330.0 && frame <= 359.0) { + flash = smoothstep(330.0, 345.0, frame) * 2.0; + } + + let color = in.color * (intensity + flash); + + return vec4(color * params.brightness, 1.0); +} +`});this.renderPipeline=t.createRenderPipeline({label:"observatory-birth-render",layout:"auto",vertex:{module:i,entryPoint:"vs_main"},fragment:{module:i,entryPoint:"fs_main",targets:[{format:this.engine.sceneFormat,blend:{color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}}}]},primitive:{topology:"triangle-list"}});const s=this.nodeRenderer.cameraUniformBuffer;this.renderBindGroup=t.createBindGroup({label:"observatory-birth-render-bind",layout:this.renderPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:s}},{binding:2,resource:{buffer:this.particleBuffer}}]})}createHaloPipeline(t){const i=t.createShaderModule({label:"observatory-birth-halo",code:` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Camera { + view_proj: mat4x4, + right: vec4, + up: vec4, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var camera: Camera; +@group(0) @binding(2) var nodes: array; + +struct VSOut { + @builtin(position) clip: vec4, + @location(0) uv: vec2, +}; + +@vertex +fn vs_main( + @builtin(vertex_index) vi: u32, + @builtin(instance_index) ii: u32 +) -> VSOut { + var out: VSOut; + if (ii >= u32(params.node_count)) { + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + return out; + } + + let node = nodes[ii]; + let flags = u32(node.color_flags.w); + let is_target = (flags & 4u) != 0u; // flag 2: is birth target + + if (!is_target) { + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + return out; + } + + // Flash halo: only visible during ignition (frames 330–359). + let frame = params.frame; + if (frame < 330.0 || frame > 359.0) { + out.clip = vec4(0.0, 0.0, 2.0, 1.0); + return out; + } + + // Halo ring: expands during flash, fades by frame 359. + let flashT = (frame - 330.0) / 29.0; // 0..1 + let ringRadius = 0.3 + flashT * 0.5; // expands 0.3 → 0.8 + + // Quad centered on target position. + let pos = node.pos_radius.xyz; + let cornerX = (f32(vi) / 3.0 - 1.0); // -1, 0, 1 (3 unique x) + let cornerY = (f32(vi % 3) / 1.5 - 1.0); // -1, 0, 1 + + // We use 4 vertices for a simple quad (vi 0..3). + let cx = cornerX * ringRadius; + let cy = cornerY * ringRadius; + + let world = pos + + camera.right.xyz * cx + + camera.up.xyz * cy; + + out.clip = camera.view_proj * vec4(world, 1.0); + + // UV for radial fade. + out.uv = vec2(cx / ringRadius, cy / ringRadius); + + return out; +} + +@fragment +fn fs_main(in: VSOut) -> @location(0) vec4 { + let d = length(in.uv); + if (d > 0.7) { + discard; + } + + // Flash: white-hot core, violet rim. + let flashIntensity = 1.0 - smoothstep(0.0, 0.7, d); + let color = vec3(0.7, 0.4, 1.0) * flashIntensity * 2.0; + + // Fade out as flash ends. + let frame = params.frame; + let fadeOut = 1.0 - smoothstep(345.0, 359.0, frame); + + return vec4(color * params.brightness * fadeOut, 1.0); +} +`});this.haloPipeline=t.createRenderPipeline({label:"observatory-birth-halo",layout:"auto",vertex:{module:i,entryPoint:"vs_main"},fragment:{module:i,entryPoint:"fs_main",targets:[{format:this.engine.sceneFormat,blend:{color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}}}]},primitive:{topology:"triangle-list"}});const s=this.nodeRenderer.cameraUniformBuffer;this.haloBindGroup=t.createBindGroup({label:"observatory-birth-halo-bind",layout:this.haloPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:s}},{binding:2,resource:{buffer:this.nodeRenderer.nodeStateBuffer}}]})}createEngravePipeline(t){if(this.engraveStepCount===0||!this.engraveBuffer)return;const e=t.createShaderModule({label:"observatory-birth-engrave",code:ll});this.engravePipeline=t.createRenderPipeline({label:"observatory-birth-engrave-pipeline",layout:"auto",vertex:{module:e,entryPoint:"vs_main"},fragment:{module:e,entryPoint:"fs_main",targets:[{format:this.engine.sceneFormat,blend:{color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}}}]},primitive:{topology:"triangle-list"}}),this.engraveBindGroup=t.createBindGroup({label:"observatory-birth-engrave-bind",layout:this.engravePipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.nodeRenderer.cameraUniformBuffer}},{binding:2,resource:{buffer:this.nodeRenderer.nodeStateBuffer}},{binding:3,resource:{buffer:this.engraveBuffer}}]})}compute(t,e){const i=this.engine.params[9];if(this.active=i===1,!this.active||!this.computePipeline||!this.computeBindGroup)return;const s=t.beginComputePass({label:"observatory-birth-compute"});s.setPipeline(this.computePipeline),s.setBindGroup(0,this.computeBindGroup),s.dispatchWorkgroups(Math.ceil(this.particleCount/64)),s.end()}render(t,e){this.active&&(this.renderPipeline&&this.renderBindGroup&&this.particleCount>0&&(t.setPipeline(this.renderPipeline),t.setBindGroup(0,this.renderBindGroup),t.draw(pp,this.particleCount)),this.haloPipeline&&this.haloBindGroup&&e>=mp&&e<=gp&&(t.setPipeline(this.haloPipeline),t.setBindGroup(0,this.haloBindGroup),t.draw(4,this.nodeRenderer.nodeCountValue)),this.engravePipeline&&this.engraveBindGroup&&this.engraveStepCount>0&&e>=yp&&(t.setPipeline(this.engravePipeline),t.setBindGroup(0,this.engraveBindGroup),t.draw(6,this.engraveStepCount)))}dispose(){var t,e,i,s,n,r,a,o,h,c,u;(t=this.particleBuffer)==null||t.destroy(),this.particleBuffer=null,(i=(e=this.computePipeline)==null?void 0:e.destroy)==null||i.call(e),this.computePipeline=null,this.computeBindGroup=null,(n=(s=this.renderPipeline)==null?void 0:s.destroy)==null||n.call(s),this.renderPipeline=null,this.renderBindGroup=null,(a=(r=this.haloPipeline)==null?void 0:r.destroy)==null||a.call(r),this.haloPipeline=null,this.haloBindGroup=null,(o=this.haloIndexBuffer)==null||o.destroy(),this.haloIndexBuffer=null,(c=(h=this.engravePipeline)==null?void 0:h.destroy)==null||c.call(h),this.engravePipeline=null,this.engraveBindGroup=null,(u=this.engraveBuffer)==null||u.destroy(),this.engraveBuffer=null}}function bp(l){const t=l.hopSlot.toFixed(1),e=l.causeDepth.toFixed(1);return` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var nodes: array; +// 1 u32/node: bits 0-15 hopDepth (0xffff unreached), 16 failure, 17 cause, +// 18 lookalike, 19-21 lookalike k (rescue-plan.ts packing). +@group(0) @binding(2) var wave: array; + +const HOP_SLOT: f32 = ${t}; +const CAUSE_DEPTH: f32 = ${e}; +const TAU: f32 = 6.28318530717958647; + +fn env(f: f32, a0: f32, a1: f32, r0: f32, r1: f32) -> f32 { + return smoothstep(a0, a1, f) * (1.0 - smoothstep(r0, r1, f)); +} + +fn arrival(d: f32) -> f32 { + return min(260.0 + HOP_SLOT * d, 514.0); +} + +@compute @workgroup_size(64) +fn rescue_choreo(@builtin(global_invocation_id) id: vec3) { + let i = id.x; + if (i >= u32(params.node_count)) { + return; + } + if (i >= arrayLength(&wave)) { + return; + } + // Belt-and-braces atop the TS gate: salience-rescue is demo index 2. + if (params.demo_id != 2.0) { + return; + } + + let packed = wave[i]; + let depth_u = packed & 0xffffu; + let d = f32(depth_u); + let is_failure = (packed & 0x10000u) != 0u; + let is_cause = (packed & 0x20000u) != 0u; + let is_look = (packed & 0x40000u) != 0u; + let look_k = f32((packed >> 19u) & 0x7u); + + let f = params.frame; + + var dx = 0.0; + var dy = 0.0; + var dz = 0.0; + var dw = 0.0; + + if (is_failure) { + // Detonation spike, wound simmer, recognition flare as the arc lands. + dw = dw + env(f, 90.0, 96.0, 120.0, 168.0); + dw = dw + 0.35 * env(f, 100.0, 130.0, 600.0, 656.0); + dw = dw + 0.35 * env(f, 552.0, 562.0, 580.0, 640.0); + // Symptom backlight while the cause burns. + dx = dx + 0.4 * env(f, 556.0, 566.0, 620.0, 668.0); + } + if (!is_failure && depth_u >= 1u && depth_u <= 12u) { + // Shockwave blink: crimson concussion, 3 frames/hop of REAL graph distance. + dw = dw + 0.75 * exp(-0.3 * d) + * env(f, 92.0 + 3.0 * d, 96.0 + 3.0 * d, 96.0 + 3.0 * d, 122.0 + 3.0 * d); + } + if (is_look) { + let fk = 138.0 + 28.0 * look_k; + // Searchlight flare — cold pop, sequential, on camera. + dy = dy + env(f, fk - 6.0, fk, fk + 10.0, fk + 26.0); + // Ash residue — the struck-through lookalike stays in frame until the verdict. + dy = dy + 0.15 * smoothstep(fk + 10.0, fk + 26.0, f) * (1.0 - smoothstep(600.0, 656.0, f)); + } + if (!is_failure && depth_u >= 1u && d <= CAUSE_DEPTH) { + let wd = arrival(d); + // Interrogation flicker: 24 integer sine cycles per loop, per-depth phase. + let flicker = 0.75 + 0.25 * sin(TAU * 24.0 * params.loop_phase + 1.7 * d); + dz = dz + env(f, wd - 10.0, wd, wd + 28.0, wd + 64.0) * flicker; + // Scanned ember. + dz = dz + 0.08 * smoothstep(wd + 28.0, wd + 64.0, f) * (1.0 - smoothstep(580.0, 640.0, f)); + } + if (is_cause) { + // Cause ignition rides the EXISTING recall response (render-nodes.wgsl): + // spectral() thin-film band + white-hot core + sprite swell at full intensity. + dx = dx + env(f, 520.0, 546.0, 640.0, 700.0); + } + + // WGSL forbids swizzle stores — reconstruct the FULL vec4; pos/vel/color + // lanes pass through untouched (the force sim owns them). + var node = nodes[i]; + node.demo = vec4(dx, dy, dz, dw); + nodes[i] = node; +} +`}const vp=2;class wp{constructor(t){T(this,"engine");T(this,"nodeRenderer");T(this,"plan");T(this,"pipeline",null);T(this,"bindGroup",null);T(this,"waveBuffer",null);this.engine=t.engine,this.nodeRenderer=t.nodeRenderer,this.plan=t.plan,this.engine.addPass(this)}upload(){var i;const t=this.engine.gpuDevice;if(!t||!this.engine.paramsBuffer||!this.plan.viable||!this.nodeRenderer.nodeStateBuffer||this.nodeRenderer.nodeCountValue===0)return;(i=this.waveBuffer)==null||i.destroy(),this.waveBuffer=t.createBuffer({label:"observatory-rescue-wave",size:Math.max(4,this.plan.waveData.byteLength),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),t.queue.writeBuffer(this.waveBuffer,0,this.plan.waveData.buffer);const e=t.createShaderModule({label:"observatory-rescue-choreo",code:bp(this.plan.consts)});this.pipeline=t.createComputePipeline({label:"observatory-rescue-choreo",layout:"auto",compute:{module:e,entryPoint:"rescue_choreo"}}),this.bindGroup=t.createBindGroup({label:"observatory-rescue-bind",layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.nodeRenderer.nodeStateBuffer}},{binding:2,resource:{buffer:this.waveBuffer}}]})}compute(t){if(this.engine.params[9]!==vp||!this.pipeline||!this.bindGroup)return;const e=this.nodeRenderer.nodeCountValue;if(e===0)return;const i=t.beginComputePass({label:"observatory-rescue-choreo"});i.setPipeline(this.pipeline),i.setBindGroup(0,this.bindGroup),i.dispatchWorkgroups(Math.ceil(e/64)),i.end()}dispose(){var t;(t=this.waveBuffer)==null||t.destroy(),this.waveBuffer=null,this.pipeline=null,this.bindGroup=null}}const _p=4,Mp=90,Sp=138,Ap=28,Tp=260,Ip=514,uh=560,Cp=600,si=65535,zp=48,Bp={causal:0,temporal:1,shared_concepts:2,complementary:3,semantic:4};function cl(l,t){const e=new Hn({seed:t});return hl(l,e.state.rng).data}function Fp(l){const t=new Uint32Array(l.nodes.length);for(const e of l.edges)t[e.sourceIndex]++,t[e.targetIndex]++;return t}function Pp(l,t){const e=l.nodes.length;if(e===0)return-1;const i=Fp(l),s=r=>{const a=l.nodes[r],o=new Set(a.tags.map(f=>f.toLowerCase()));let h=0;(o.has("failure")||o.has("guardrail"))&&(h+=3),(o.has("confusion")||o.has("weak-spot"))&&(h+=2),h+=Math.min(i[r],8)/8;const c=t[r*vt+0],u=t[r*vt+1],d=t[r*vt+2];return Math.sqrt(c*c+u*u+d*d)>=54&&(h+=.5),h},n=[r=>r!==l.centerIndex&&!l.nodes[r].suppressed&&i[r]>=2,r=>r!==l.centerIndex&&!l.nodes[r].suppressed,r=>r!==l.centerIndex,()=>!0];for(const r of n){let a=-1,o=-1/0;for(let h=0;ho&&(o=c,a=h)}if(a>=0)return a}return-1}function kp(l,t){const e=l.nodes.length,i=new Uint16Array(e).fill(si),s=new Int32Array(e).fill(-1);if(t<0||t>=e)return{depths:i,parents:s};const n=Array.from({length:e},()=>[]);for(const a of l.edges){const o=Bp[a.type]??5;n[a.sourceIndex].push({nbr:a.targetIndex,rank:o}),n[a.targetIndex].push({nbr:a.sourceIndex,rank:o})}for(const a of n)a.sort((o,h)=>o.rank-h.rank||o.nbr-h.nbr);i[t]=0;const r=[t];for(let a=0;at.nodes[f].retention<=.45);a.length===0&&(a=r);const o=new Map;let h=1/0,c=-1/0;for(const f of a){const p=s.get(t.nodes[f].id),m=p?Date.parse(p):NaN;Number.isFinite(m)&&(o.set(f,m),mc&&(c=m))}const u=f=>{const p=o.get(f);return p===void 0?0:c===h?1:(c-p)/(c-h)},d=f=>2*(1-t.nodes[f].retention)+.5*Math.min(e[f],6)/6+.5*u(f);return a.sort((f,p)=>{const m=d(f),g=d(p);return g!==m?g-m:e[p]!==e[f]?e[p]-e[f]:f-p}),{index:a[0],depth:e[a[0]]}}return{index:-1,depth:0}}function Rp(l,t,e,i,s){const n=l[e*vt+0],r=l[e*vt+1],a=l[e*vt+2],o=[];for(let h=0;hh.d2-c.d2||h.i-c.i),o.slice(0,_p).map(h=>h.i)}function Hr(l){const t=Math.max(1,l);return Math.min(84,Math.max(14,Math.floor(252/t)))}function Lp(l,t){return Math.min(Tp+t*l,Ip)}function dh(l){return Sp+Ap*l}function de(l){return l.length>64?l.slice(0,64)+"…":l}const as=4;function Pr(l){const t=new Uint32Array(l);return t.fill(si),{viable:!1,failureIndex:-1,causeIndex:-1,lookalikeIndices:[],hopDepths:new Uint16Array(l).fill(si),causeDepth:0,hopSlot:Hr(3),waveData:t,pathData:new Uint32Array(4),pathMetas:[],spineBeats:[],verdict:{headline:"root cause found",causeLabel:"",failureLabel:"",causeDate:"",hops:0,k:0,receipt:""},consts:{hopSlot:Hr(3),causeDepth:3}}}function Op(l,t,e){var R;const i=t.nodes.length;if(i===0)return Pr(0);const s=cl(t,e),n=Pp(t,s);if(n<0)return Pr(i);const{depths:r,parents:a}=kp(t,n),o=Ep(l,t,r,n);if(o.index<0){const I=Pr(i);return I.failureIndex=n,I.hopDepths=r,I}const h=o.index,c=Math.max(1,o.depth),u=Hr(c),d=I=>Lp(I,u),f=Rp(s,i,n,h,t.centerIndex),p=f.length,m=new Uint32Array(i);for(let I=0;I{m[I]|=1<<18|N<<19});const g=[];f.forEach((I,N)=>{g.push({src:n,dst:I,bf:dh(N),kind:Be.probe,beatKind:"probe"})});const x=[];{let I=h;for(;I!==n&&I>=0&&a[I]>=0;)x.push(I),I=a[I]}const y=new Set(x),b=[];for(let I=0;Ic||a[I]<0||b.push(I)}b.sort((I,N)=>r[I]-r[N]||I-N);const v=[...x.slice().reverse(),...b].slice(0,zp);v.sort((I,N)=>r[I]-r[N]||I-N);for(const I of v)g.push({src:a[I],dst:I,bf:d(r[I]),kind:Be.backwardCause,beatKind:"wave"});g.push({src:h,dst:n,bf:uh,kind:Be.backwardCause,beatKind:"arc"});const _=new Uint32Array(Math.max(1,g.length)*as),M=[];g.forEach((I,N)=>{_[N*as+0]=I.src,_[N*as+1]=I.dst,_[N*as+2]=I.bf,_[N*as+3]=I.kind,M.push({sourceIndex:I.src,targetIndex:I.dst,beatFrame:I.bf,kind:I.kind,beatKind:I.beatKind,nodeId:t.nodes[I.dst].id,label:de(t.nodes[I.dst].label)})});const A=de(t.nodes[n].label),S=de(t.nodes[h].label),C=[],z=(I,N,wt,Bt)=>{C.push({sourceIndex:n,targetIndex:n,beatFrame:I,kind:N,beatKind:"rescue",nodeId:Bt,label:wt})};z(Mp,1,`failure: ${A}`,t.nodes[n].id),f.forEach((I,N)=>{z(dh(N),0,`lookalike ✗ · ${de(t.nodes[I].label)}`,t.nodes[I].id)}),z(d(1),1,"reaching backward through time","rescue-wave-start"),c>=2&&d(c)!==d(1)&&z(d(c),1,`scrubbing past · ${c} hops`,"rescue-wave-deep"),z(uh,1,`causal arc · ${S}`,t.nodes[h].id),z(Cp,1,"root cause found","rescue-verdict");const k=((R=l.nodes.find(I=>I.id===t.nodes[h].id))==null?void 0:R.createdAt)??"",U=k?k.slice(0,10):"",W={headline:"root cause found",causeLabel:S,failureLabel:A,causeDate:U,hops:c,k:p,receipt:`${c} hops back · ${U} · vector search: 0 for ${p}`};return{viable:!0,failureIndex:n,causeIndex:h,lookalikeIndices:f,hopDepths:r,causeDepth:c,hopSlot:u,waveData:m,pathData:_,pathMetas:M,spineBeats:C,verdict:W,consts:{hopSlot:u,causeDepth:c}}}const Np=` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var nodes: array; +// 1 u32/node: bits 0-7 rank, 8 isDrifting, 9 isRescued, 10-11 rescue slot k +// (forgetting-plan.ts packing). Non-drifting nodes are exactly 0. +@group(0) @binding(2) var horizon: array; + +fn env(f: f32, a0: f32, a1: f32, r0: f32, r1: f32) -> f32 { + return smoothstep(a0, a1, f) * (1.0 - smoothstep(r0, r1, f)); +} + +@compute @workgroup_size(64) +fn forgetting_choreo(@builtin(global_invocation_id) id: vec3) { + let i = id.x; + if (i >= u32(params.node_count)) { + return; + } + if (i >= arrayLength(&horizon)) { + return; + } + // Belt-and-braces atop the TS gate: forgetting-horizon is demo index 3. + if (params.demo_id != 3.0) { + return; + } + + let packed = horizon[i]; + let is_drifting = (packed & 0x100u) != 0u; + let is_rescued = (packed & 0x200u) != 0u; + let rank01 = f32(packed & 0xffu) / 255.0; + let k = f32((packed >> 10u) & 0x3u); + + let f = params.frame; + // Master release: every lane is exactly 0.0 by frame 712 — the seam wall. + let master = 1.0 - smoothstep(660.0, 712.0, f); + + var dx = 0.0; + var dz = 0.0; + + if (is_drifting) { + let onset = 90.0 + 42.0 * rank01; + // Phase 1 — the drift: dim + fall to the 0.55 plateau, retention-staggered. + let phase1 = 0.55 * smoothstep(onset, onset + 210.0, f); + if (is_rescued) { + let rk = 318.0 + 60.0 * k; + // Snap-back begins 22 frames before the recall ribbon lands at rk. + dz = master * phase1 * (1.0 - smoothstep(rk - 22.0, rk + 6.0, f)); + // Ignition rides the EXISTING recall response (render-nodes.wgsl): + // spectral() thin-film band + white-hot core + sprite swell for free. + dx = master * env(f, rk - 26.0, rk, rk + 60.0, rk + 130.0); + } else { + // Phase 2 — the sink: to exactly 1.0 over 640..660 (the ~6% floor era). + let phase2 = 0.45 * smoothstep(480.0 + 24.0 * rank01, 640.0, f); + dz = master * (phase1 + phase2); + } + } + + // WGSL forbids swizzle stores — reconstruct the FULL vec4; pos/vel/color + // lanes pass through untouched (the force sim owns them). demo.y and + // demo.w are hard 0.0: the rescue/firewall grammars can never fire here. + var node = nodes[i]; + node.demo = vec4(dx, 0.0, dz, 0.0); + nodes[i] = node; +} +`,Dp=3;class Up{constructor(t){T(this,"engine");T(this,"nodeRenderer");T(this,"plan");T(this,"pipeline",null);T(this,"bindGroup",null);T(this,"horizonBuffer",null);this.engine=t.engine,this.nodeRenderer=t.nodeRenderer,this.plan=t.plan,this.engine.addPass(this)}upload(){var i;const t=this.engine.gpuDevice;if(!t||!this.engine.paramsBuffer||!this.plan.viable||!this.nodeRenderer.nodeStateBuffer||this.nodeRenderer.nodeCountValue===0)return;(i=this.horizonBuffer)==null||i.destroy(),this.horizonBuffer=t.createBuffer({label:"observatory-forgetting-horizon",size:Math.max(4,this.plan.horizonData.byteLength),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),t.queue.writeBuffer(this.horizonBuffer,0,this.plan.horizonData.buffer);const e=t.createShaderModule({label:"observatory-forgetting-choreo",code:Np});this.pipeline=t.createComputePipeline({label:"observatory-forgetting-choreo",layout:"auto",compute:{module:e,entryPoint:"forgetting_choreo"}}),this.bindGroup=t.createBindGroup({label:"observatory-forgetting-bind",layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.nodeRenderer.nodeStateBuffer}},{binding:2,resource:{buffer:this.horizonBuffer}}]})}compute(t){if(this.engine.params[9]!==Dp||!this.pipeline||!this.bindGroup)return;const e=this.nodeRenderer.nodeCountValue;if(e===0)return;const i=t.beginComputePass({label:"observatory-forgetting-choreo"});i.setPipeline(this.pipeline),i.setBindGroup(0,this.bindGroup),i.dispatchWorkgroups(Math.ceil(e/64)),i.end()}dispose(){var t;(t=this.horizonBuffer)==null||t.destroy(),this.horizonBuffer=null,this.pipeline=null,this.bindGroup=null}}const Vp=318,Gp=60,ul=3,Wp=132,Hp=60,qp=540,Xp=660;function Yp(l){const t=[];for(let s=0;sl.nodes[s].retention-l.nodes[n].retention||s-n);const e=t.length;if(e===0)return[];const i=Math.min(e,Math.max(Math.min(ul,e),Math.round(.25*e)));return t.slice(0,i)}function Jp(l,t){const e=new Uint32Array(l.nodes.length);for(const n of l.edges)e[n.sourceIndex]++,e[n.targetIndex]++;const i=n=>2*l.nodes[n].retention+Math.min(e[n],8)/8;return t.slice().sort((n,r)=>i(r)-i(n)||n-r).slice(0,Math.min(ul,t.length))}function fh(l){return Vp+Gp*l}const os=4;function Zp(l){return{viable:!1,driftingIndices:[],rescuedIndices:[],horizonData:new Uint32Array(l),pathData:new Uint32Array(4),pathMetas:[],spineBeats:[]}}function Kp(l){const t=l.nodes.length,e=Yp(l);if(t<2||e.length<1)return Zp(t);const i=Jp(l,e),s=e.length,n=new Uint32Array(t);e.forEach((d,f)=>{const p=Math.round(255*f/Math.max(1,s-1));n[d]=p&255|256}),i.forEach((d,f)=>{n[d]|=512|f<<10});const r=new Uint32Array(Math.max(1,i.length)*os),a=[];i.forEach((d,f)=>{const p=fh(f);r[f*os+0]=l.centerIndex,r[f*os+1]=d,r[f*os+2]=p,r[f*os+3]=Be.recall,a.push({sourceIndex:l.centerIndex,targetIndex:d,beatFrame:p,kind:Be.recall,beatKind:"recall",nodeId:l.nodes[d].id,label:de(l.nodes[d].label)})});const o=[],h=(d,f,p,m)=>{o.push({sourceIndex:l.centerIndex,targetIndex:l.centerIndex,beatFrame:d,kind:f,beatKind:"horizon",nodeId:m,label:p})},c=new Set(i),u=e.filter(d=>!c.has(d)).slice(0,3);return u.forEach((d,f)=>{const p=Math.round(l.nodes[d].retention*100);h(Wp+Hp*f,1,`fading: ${de(l.nodes[d].label)} · retention ${p}%`,l.nodes[d].id)}),i.forEach((d,f)=>{h(fh(f),0,`recalled: ${de(l.nodes[d].label)}`,l.nodes[d].id)}),u.length>0&&h(qp,1,"the unrecalled sink · nothing is deleted","horizon-sink"),h(Xp,0,"every memory still retrievable","horizon-retrievable"),{viable:!0,driftingIndices:e,rescuedIndices:i,horizonData:n,pathData:r,pathMetas:a,spineBeats:o}}const jp=` +struct Params { + frame: f32, + loop_phase: f32, + node_count: f32, + edge_count: f32, + path_count: f32, + pulse: f32, + viewport_w: f32, + viewport_h: f32, + brightness: f32, + demo_id: f32, + time: f32, + _pad: f32, +}; + +struct Node { + pos_radius: vec4, + vel_retention: vec4, + color_flags: vec4, + demo: vec4, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var nodes: array; +// 1 u32/node: bits 0-7 shockDelay, 8 isIntruder, 9 isSeverNeighbor, +// 10-13 sever slot k (firewall-plan.ts packing). Every node carries a delay. +@group(0) @binding(2) var fire: array; + +const TAU: f32 = 6.28318530717958647; + +fn env(f: f32, a0: f32, a1: f32, r0: f32, r1: f32) -> f32 { + return smoothstep(a0, a1, f) * (1.0 - smoothstep(r0, r1, f)); +} + +@compute @workgroup_size(64) +fn firewall_choreo(@builtin(global_invocation_id) id: vec3) { + let i = id.x; + if (i >= u32(params.node_count)) { + return; + } + if (i >= arrayLength(&fire)) { + return; + } + // Belt-and-braces atop the TS gate: firewall is demo index 4. + if (params.demo_id != 4.0) { + return; + } + + let packed = fire[i]; + let delay = f32(packed & 0xffu); + let is_intruder = (packed & 0x100u) != 0u; + let is_sever = (packed & 0x200u) != 0u; + let k = f32((packed >> 10u) & 0xfu); + + let f = params.frame; + + var fy = 0.0; + var fw = 0.0; + + if (is_intruder) { + // Intrusion flare: sickly strobe, band (0..1], 36 integer cycles/loop. + // C¹ handoff into the membrane over 330-332 (the rise sweeps the flare + // band exactly once — the condensation read is intentional). + fy = env(f, 90.0, 96.0, 310.0, 332.0) + * (0.55 + 0.45 * sin(TAU * 36.0 * params.loop_phase)); + // Membrane: sustained ring band [2.60..2.90], 12 integer cycles/loop. + fy = fy + env(f, 330.0, 352.0, 620.0, 680.0) + * (2.75 + 0.15 * sin(TAU * 12.0 * params.loop_phase)); + // Source detonation as the front leaves. + fw = env(f, 148.0, 153.0, 162.0, 196.0); + } else { + // Crimson rim as the radial front passes: arrival A = 150 + delay, + // amplitude fades with distance; A ∈ [150, 294] ⇒ all rims dead by 320. + let a = 150.0 + delay; + let amp = 0.9 - 0.45 * (delay / 144.0); + fw = amp * env(f, a - 2.0, a + 3.0, a + 8.0, a + 26.0); + if (is_sever) { + // Node-side receipt of the severed edge; last release 474. + let sk = 345.0 + 21.0 * k; + fw = fw + 0.6 * env(f, sk - 4.0, sk, sk + 6.0, sk + 24.0); + } + } + + // WGSL forbids swizzle stores — reconstruct the FULL vec4; pos/vel/color + // lanes pass through untouched (the force sim owns them). demo.x and + // demo.z are hard 0.0: the recall and horizon grammars can never fire here. + var node = nodes[i]; + node.demo = vec4(0.0, fy, 0.0, fw); + nodes[i] = node; +} +`,Qp=4;class $p{constructor(t){T(this,"engine");T(this,"nodeRenderer");T(this,"plan");T(this,"pipeline",null);T(this,"bindGroup",null);T(this,"fireBuffer",null);this.engine=t.engine,this.nodeRenderer=t.nodeRenderer,this.plan=t.plan,this.engine.addPass(this)}upload(){var i;const t=this.engine.gpuDevice;if(!t||!this.engine.paramsBuffer||!this.plan.viable||!this.nodeRenderer.nodeStateBuffer||this.nodeRenderer.nodeCountValue===0)return;(i=this.fireBuffer)==null||i.destroy(),this.fireBuffer=t.createBuffer({label:"observatory-firewall-fire",size:Math.max(4,this.plan.fireData.byteLength),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),t.queue.writeBuffer(this.fireBuffer,0,this.plan.fireData.buffer);const e=t.createShaderModule({label:"observatory-firewall-choreo",code:jp});this.pipeline=t.createComputePipeline({label:"observatory-firewall-choreo",layout:"auto",compute:{module:e,entryPoint:"firewall_choreo"}}),this.bindGroup=t.createBindGroup({label:"observatory-firewall-bind",layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.nodeRenderer.nodeStateBuffer}},{binding:2,resource:{buffer:this.fireBuffer}}]})}compute(t){if(this.engine.params[9]!==Qp||!this.pipeline||!this.bindGroup)return;const e=this.nodeRenderer.nodeCountValue;if(e===0)return;const i=t.beginComputePass({label:"observatory-firewall-choreo"});i.setPipeline(this.pipeline),i.setBindGroup(0,this.bindGroup),i.dispatchWorkgroups(Math.ceil(e/64)),i.end()}dispose(){var t;(t=this.fireBuffer)==null||t.destroy(),this.fireBuffer=null,this.pipeline=null,this.bindGroup=null}}const tm=90,em=150,im=144,sm=330,nm=345,rm=21,am=6,om=480,hm=["failure","guardrail","confusion"];function lm(l){const t=l.nodes.length;if(t===0)return-1;const e=new Uint32Array(t);for(const n of l.edges)e[n.sourceIndex]++,e[n.targetIndex]++;const i=n=>l.nodes[n].tags.some(r=>hm.includes(r.toLowerCase())),s=[n=>n!==l.centerIndex&&!l.nodes[n].suppressed&&i(n),n=>n!==l.centerIndex&&!l.nodes[n].suppressed&&e[n]<=1,n=>n!==l.centerIndex&&!l.nodes[n].suppressed,n=>n!==l.centerIndex];for(const n of s){let r=-1;for(let a=0;a=0)return r}return-1}function cm(l,t,e){const i=l[e*vt+0],s=l[e*vt+1],n=l[e*vt+2],r=new Array(t);let a=0;for(let h=0;ha&&(a=f)}a<1e-6&&(a=1);const o=new Array(t);for(let h=0;hi-s).slice(0,am)}function ph(l){return nm+rm*l}const hs=4;function dm(l){return{viable:!1,intruderIndex:-1,severedNeighborIndices:[],shockDelays:[],fireData:new Uint32Array(l),pathData:new Uint32Array(4),pathMetas:[],spineBeats:[],verdict:{headline:"threat quarantined",intruderLabel:"",receipt:"memory held in review · Memory PR opened"}}}function fm(l,t){const e=l.nodes.length,i=lm(l);if(e===0||i<0)return dm(e);const s=cl(l,t),n=cm(s,e,i),r=um(l,i),a=new Uint32Array(e);for(let p=0;p{a[p]|=512|m<<10});const o=new Uint32Array(Math.max(1,r.length)*hs),h=[];r.forEach((p,m)=>{const g=ph(m);o[m*hs+0]=i,o[m*hs+1]=p,o[m*hs+2]=g,o[m*hs+3]=Be.probe,h.push({sourceIndex:i,targetIndex:p,beatFrame:g,kind:Be.probe,beatKind:"sever",nodeId:l.nodes[p].id,label:de(l.nodes[p].label)})});const c=de(l.nodes[i].label),u=[],d=(p,m,g)=>{u.push({sourceIndex:i,targetIndex:i,beatFrame:p,kind:1,beatKind:"firewall",nodeId:g,label:m})};return d(tm,`intrusion · ${c}`,l.nodes[i].id),d(em,"immune response · shockwave","firewall-shock"),d(sm,"membrane forming","firewall-membrane"),r.forEach((p,m)=>{d(ph(m),`edge severed ✗ · ${de(l.nodes[p].label)}`,l.nodes[p].id)}),d(om,"threat quarantined","firewall-verdict"),{viable:!0,intruderIndex:i,severedNeighborIndices:r,shockDelays:n,fireData:a,pathData:o,pathMetas:h,spineBeats:u,verdict:{headline:"threat quarantined",intruderLabel:c,receipt:"memory held in review · Memory PR opened"}}}var pm=At(``),mm=At(""),gm=At('
'),ym=At('
LOADING MEMORY FIELD...
'),xm=At('
'),bm=At('
NO MEMORIES IN FIELD
'),vm=At('
'),wm=At("
");function Ey(l,t){Ms(t,!0);let e=lt(t,"seed",3,"vestige-observatory-v1"),i=lt(t,"freezeFrame",3,null),s=lt(t,"capture",3,!1),n=lt(t,"showSwitcher",3,!0),r=lt(t,"embedded",3,!1),a=lt(t,"chrome",3,"full"),o=Pt(null);async function h(K){if(!t.onpick||!M||!D(o))return;const it=D(o).getBoundingClientRect();if(it.width===0||it.height===0)return;const jt=(K.clientX-it.left)/it.width*2-1,Pe=-((K.clientY-it.top)/it.height*2-1),q=await M.pickAt(jt,Pe);q&&t.onpick(q.id)}const c={"recall-path":"RECALL","engram-birth":"BIRTH","salience-rescue":"RESCUE","forgetting-horizon":"HORIZON",firewall:"FIREWALL"};let u=Pt(!s());function d(K){(K.key==="h"||K.key==="H")&&mt(u,!D(u)),K.key==="Escape"&&t.onexit&&t.onexit()}let f=Pt(null),p=Pt(!0),m=Pt(""),g=Pt(0),x=Pt(0),y=Pt(0),b=Pt(0),v=Pt(""),_=Pt(null),M=null,A=null,S=null,C=Pt(null),z=null,k=null,U=Pt(null),W=!1,R=Pt(yh([]));async function I(){mt(p,!0),mt(m,"");try{const K=await bl.graph({max_nodes:200,depth:3,sort:"connected"});mt(f,K,!0),mt(y,K.nodeCount,!0),mt(b,K.edgeCount,!0),mt(v,K.center_id,!0)}catch(K){mt(m,K instanceof Error?K.message:"Failed to load graph data",!0)}finally{mt(p,!1)}}function N(K,it){mt(g,K,!0),mt(x,it,!0)}function wt(K){W=!1,mt(_,K,!0),M=new ip(K)}function Bt(K){var it;(K.state==="unsupported"||K.state==="error")&&((it=t.onfallback)==null||it.call(t,K.reason))}gl(()=>{if(D(_)&&M&&D(f)&&!W){W=!0;const K=t.demo==="engram-birth",it=t.demo==="salience-rescue",jt=t.demo==="forgetting-horizon",Pe=t.demo==="firewall";if(M.upload(D(f),e(),{recallPath:!K&&!it&&!jt&&!Pe}),K){A=new xp({engine:D(_),nodeRenderer:M,seed:e()}),A.upload(e());const q=A.engraveSteps,Ot=[];for(let F=0;F({sourceIndex:0,targetIndex:0,beatFrame:F.startFrame,kind:0,beatKind:"birth",nodeId:`birth-${P}`,label:F.label})),!0)}else if(it){const q=Op(D(f),M.graph,e());mt(C,q,!0),q.viable&&(S=new wp({engine:D(_),nodeRenderer:M,plan:q}),S.upload(),M.setPathSteps(q.pathData,q.pathMetas)),mt(R,q.spineBeats,!0)}else if(jt){const q=Kp(M.graph);q.viable&&(z=new Up({engine:D(_),nodeRenderer:M,plan:q}),z.upload(),M.setPathSteps(q.pathData,q.pathMetas)),mt(R,q.spineBeats,!0)}else if(Pe){const q=fm(M.graph,e());mt(U,q,!0),q.viable&&(k=new $p({engine:D(_),nodeRenderer:M,plan:q}),k.upload(),M.setPathSteps(q.pathData,q.pathMetas)),mt(R,q.spineBeats,!0)}else mt(R,M.pathSteps,!0);D(_).demoClock.reset()}}),mh(()=>{I()});var nt=wm();xl("keydown",yl,d);let ht;var et=rt(nt);let Lt;var ye=rt(et);Hf(ye,{get demo(){return t.demo},get seed(){return e()},get freezeFrame(){return i()},onframe:N,onready:wt,onstatus:Bt}),st(et),vh(et,K=>mt(o,K),()=>D(o));var Gi=ct(et,2);{var hi=K=>{var it=vm(),jt=rt(it);{var Pe=J=>{Sf(J,{get demoMode(){return t.demo},get seed(){return e()},get nodeCount(){return D(y)},get edgeCount(){return D(b)},get centerId(){return D(v)},get frameCount(){return D(g)},get fpsEstimate(){return D(x)},get freezeFrame(){return i()},get loading(){return D(p)},get error(){return D(m)}})};zt(jt,J=>{a()==="full"&&J(Pe)})}var q=ct(jt,2);{var Ot=J=>{var at=pm();wn("click",at,function(...le){var se;(se=t.onexit)==null||se.apply(this,le)}),xt(J,at)};zt(q,J=>{a()==="full"&&t.onexit&&J(Ot)})}var F=ct(q,2);{var P=J=>{var at=gm();bh(at,20,()=>Fa,le=>le,(le,se)=>{var xe=mm(),zs=rt(xe,!0);st(xe),oe(()=>{us(xe,1,`font-mono text-[11px] tracking-widest text-left rounded px-3 py-1.5 border transition-colors + ${se===t.demo?"text-[#05060a] bg-[#5dcaa5] border-[#5dcaa5]":"text-[#5dcaa5]/60 hover:text-[#5dcaa5] bg-[#05060a]/70 border-[#5dcaa5]/20 hover:border-[#5dcaa5]/50"}`),Yr(xe,"title",`Play the ${c[se]??""} moment`),Xt(zs,c[se])}),wn("click",xe,()=>{var Pa;return(Pa=t.ondemochange)==null?void 0:Pa.call(t,se)}),xt(le,xe)}),st(at),xt(J,at)};zt(F,J=>{a()==="full"&&n()&&J(P)})}var E=ct(F,2);{var G=J=>{var at=ym();xt(J,at)};zt(E,J=>{D(p)&&J(G)})}var L=ct(E,2);{var j=J=>{var at=xm(),le=rt(at),se=rt(le,!0);st(le),st(at),oe(()=>Xt(se,D(m))),xt(J,at)};zt(L,J=>{D(m)&&!D(p)&&J(j)})}var Q=ct(L,2);{var ot=J=>{Cf(J,{get steps(){return D(R)},get frame(){return D(g)}})};zt(Q,J=>{a()==="full"&&J(ot)})}var _t=ct(Q,2);{var bt=J=>{ih(J,{get frame(){return D(g)},get verdict(){return D(C).verdict}})};zt(_t,J=>{var at;a()==="full"&&t.demo==="salience-rescue"&&((at=D(C))!=null&&at.viable)&&J(bt)})}var ke=ct(_t,2);{var Wi=J=>{{let at=Xr(()=>({headline:D(U).verdict.headline,causeLabel:D(U).verdict.intruderLabel,receipt:D(U).verdict.receipt}));ih(J,{get frame(){return D(g)},tone:"quarantine",fadeWindow:[480,495,605,620],get verdict(){return D(at)}})}};zt(ke,J=>{var at;a()==="full"&&t.demo==="firewall"&&((at=D(U))!=null&&at.viable)&&J(Wi)})}var ie=ct(ke,2);{var Cs=J=>{var at=bm();xt(J,at)};zt(ie,J=>{!D(p)&&D(f)&&D(f).nodeCount===0&&J(Cs)})}st(it),xt(K,it)};zt(Gi,K=>{D(u)&&K(hi)})}st(nt),oe(()=>{ht=us(nt,1,`${r()?"absolute":"fixed"} inset-0 overflow-hidden bg-[#05060a]`,null,ht,{"cursor-none":s()}),Lt=us(et,1,"absolute inset-0 z-0",null,Lt,{"cursor-crosshair":!!t.onpick&&!s()})}),wn("click",et,h),xt(l,nt),Ss()}xh(["click"]);export{Ni as $,wl as A,Mh as B,V as C,lg as D,We as E,St as F,Oh as G,El as H,vu as I,kl as J,kg as K,_d as L,bg as M,vl as N,_h as O,xa as P,Kt as Q,ta as R,An as S,Ge as T,jr as U,w as V,Tn as W,Rt as X,Ea as Y,Ca as Z,Jg as _,pe as a,ue as a$,U0 as a0,Vt as a1,Qh as a2,te as a3,On as a4,gt as a5,Vg as a6,w0 as a7,Va as a8,Y as a9,Gm as aA,Rh as aB,Er as aC,qm as aD,wg as aE,Ld as aF,Nd as aG,Ud as aH,Dd as aI,Pd as aJ,Gd as aK,_0 as aL,M0 as aM,S0 as aN,A0 as aO,I0 as aP,C0 as aQ,Vm as aR,Sl as aS,Al as aT,Is as aU,Ua as aV,qn as aW,Ol as aX,Sh as aY,vg as aZ,Lr as a_,Ch as aa,Zr as ab,fe as ac,ig as ad,Hm as ae,Wl as af,dd as ag,fs as ah,dt as ai,Ng as aj,v0 as ak,b0 as al,Jr as am,zh as an,Li as ao,Lg as ap,pu as aq,fu as ar,Tl as as,Z as at,ys as au,O as av,tt as aw,P0 as ax,Ii as ay,$t as az,B as b,sc as b$,Rr as b0,Il as b1,he as b2,ag as b3,rg as b4,og as b5,sg as b6,ng as b7,hg as b8,eg as b9,f0 as bA,d0 as bB,Rl as bC,Ll as bD,Nl as bE,Bl as bF,Fl as bG,Pl as bH,Dl as bI,Ul as bJ,Vl as bK,Gl as bL,Ah as bM,Th as bN,Hl as bO,ql as bP,Xl as bQ,Yl as bR,Jl as bS,Zl as bT,Kl as bU,jl as bV,Ql as bW,$l as bX,tc as bY,ec as bZ,ic as b_,Km as ba,Zm as bb,Ra as bc,n0 as bd,a0 as be,Oa as bf,i0 as bg,s0 as bh,r0 as bi,o0 as bj,La as bk,e0 as bl,t0 as bm,$m as bn,Om as bo,Nm as bp,Dm as bq,Jm as br,Ym as bs,Xm as bt,x0 as bu,y0 as bv,g0 as bw,m0 as bx,Na as by,p0 as bz,oa as c,Ut as c$,nc as c0,rc as c1,ac as c2,oc as c3,hc as c4,lc as c5,cc as c6,uc as c7,dc as c8,fc as c9,li as cA,Qm as cB,jm as cC,na as cD,k0 as cE,Ih as cF,of as cG,En as cH,Wg as cI,sy as cJ,iy as cK,Gg as cL,Pu as cM,Qg as cN,Ay as cO,Da as cP,Jd as cQ,ey as cR,$h as cS,$g as cT,Kg as cU,Ty as cV,Ic as cW,zu as cX,Eh as cY,Ui as cZ,dy as c_,pc as ca,mc as cb,gc as cc,yc as cd,vc as ce,wc as cf,_c as cg,Mc as ch,Ce as ci,au as cj,ru as ck,$0 as cl,Q0 as cm,tg as cn,K0 as co,j0 as cp,Z0 as cq,Wa as cr,J0 as cs,X0 as ct,q0 as cu,H0 as cv,W0 as cw,Y0 as cx,G0 as cy,V0 as cz,Oi as d,ge as d$,My as d0,_y as d1,Hd as d2,Ve as d3,sa as d4,wy as d5,Nh as d6,da as d7,ku as d8,fa as d9,vy as dA,Td as dB,ma as dC,mg as dD,dg as dE,Hu as dF,ca as dG,ga as dH,aa as dI,ra as dJ,hy as dK,yg as dL,xg as dM,xy as dN,yy as dO,ya as dP,Zg as dQ,Rn as dR,Yc as dS,Wd as dT,Fg as dU,Pg as dV,Cg as dW,Gn as dX,Mn as dY,Or as dZ,Xn as d_,Xd as da,Kh as db,Dg as dc,Ug as dd,la as de,Hg as df,pa as dg,c0 as dh,h0 as di,Cy as dj,qg as dk,Dh as dl,Vu as dm,Ad as dn,Um as dp,me as dq,Wu as dr,T0 as ds,Ts as dt,uy as du,Bh as dv,Xg as dw,Ig as dx,Bd as dy,_l as dz,qt as e,Pi as e$,mu as e0,Dn as e1,Fh as e2,oi as e3,ni as e4,fy as e5,Uh as e6,Gu as e7,Bu as e8,Fe as e9,ty as eA,$ as eB,Kd as eC,Vh as eD,Gh as eE,Zt as eF,Wn as eG,Id as eH,O0 as eI,N0 as eJ,xc as eK,bc as eL,D0 as eM,fd as eN,As as eO,ly as eP,ny as eQ,ry as eR,ba as eS,ia as eT,Ri as eU,va as eV,Iy as eW,ze as eX,ha as eY,my as eZ,yu as e_,Zh as ea,F0 as eb,Ga as ec,Lo as ed,jh as ee,Sc as ef,Tc as eg,Ac as eh,Rm as ei,el as ej,bd as ek,vd as el,B0 as em,z0 as en,Qr as eo,Pn as ep,Vn as eq,u0 as er,l0 as es,Wm as et,Fn as eu,Sy as ev,gy as ew,Fu as ex,by as ey,ai as ez,Yn as f,Et as f0,cy as f1,Vd as f2,Wh as f3,py as f4,cs as f5,pg as f6,ug as f7,jg as f8,gg as f9,Bi as fA,ky as fB,Ey as fC,Mg as fD,Sg as fE,_g as fF,xs as fG,Rg as fH,Eg as fI,Nn as fJ,pf as fK,Hc as fL,lu as fM,In as fN,gf as fO,Py as fP,By as fQ,nl as fR,xf as fS,bn as fT,Br as fU,bf as fV,Fy as fW,zr as fX,cg as fa,fg as fb,Vi as fc,Lm as fd,wa as fe,Yg as ff,zy as fg,_a as fh,Ma as fi,Yt as fj,L0 as fk,R0 as fl,E0 as fm,Sa as fn,zg as fo,Bg as fp,tl as fq,ay as fr,kn as fs,Og as ft,Tg as fu,Ag as fv,ea as fw,ud as fx,Sn as fy,zi as fz,Kr as g,Ml as h,Te as i,Ed as j,oy as k,bs as l,Lh as m,Gt as n,Di as o,xd as p,wd as q,yd as r,md as s,pd as t,Aa as u,gd as v,ee as w,zl as x,Cl as y,Ln as z}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js.br b/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js.br new file mode 100644 index 0000000..eed0fc4 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js.gz b/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js.gz new file mode 100644 index 0000000..06661e9 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DSmtfx7F.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js b/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js similarity index 81% rename from apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js rename to apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js index 0cc8663..2c74002 100644 --- a/apps/dashboard/build/_app/immutable/chunks/BHDZZvku.js +++ b/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js @@ -1,2 +1,2 @@ -import"./Bzak7iHL.js";import{t as h,a as o,j as f,e as a,r as s,h as c}from"./wpu9U-D0.js";import{s as p}from"./D8mhvFt8.js";import{s as k}from"./LDOJP_6N.js";import{i as _}from"./DKve45Wd.js";import{s as I}from"./60_R_Vbt.js";import{p as P}from"./ByYB047u.js";import{I as H}from"./D7A-gG4Z.js";var q=f('

'),A=f('
'),B=f('

');function M(u,e){let v=P(e,"accent",3,"synapse");var l=B(),m=a(l),i=a(m),b=a(i);H(b,{get name(){return e.icon},size:22,draw:!0}),s(i);var x=c(i,2),d=a(x),g=a(d,!0);s(d);var z=c(d,2);{var w=t=>{var r=q(),n=a(r,!0);s(r),h(()=>p(n,e.subtitle)),o(t,r)};_(z,t=>{e.subtitle&&t(w)})}s(x),s(m);var y=c(m,2);{var j=t=>{var r=A(),n=a(r);k(n,()=>e.children),s(r),o(t,r)};_(y,t=>{e.children&&t(j)})}s(l),h(()=>{I(i,1,`header-tile relative flex items-center justify-center w-11 h-11 rounded-xl shrink-0 +import"./Bzak7iHL.js";import{t as h,a as o,j as f,e as a,r as s,h as c}from"./CW7md74C.js";import{s as p}from"./D90q9c2i.js";import{s as k}from"./EQUhm_ep.js";import{i as _}from"./9-jplUL5.js";import{s as I}from"./Cc0l8Nd4.js";import{p as P}from"./BjbQ7qSx.js";import{I as H}from"./CqwrgJOn.js";var q=f('

'),A=f('
'),B=f('

');function M(u,e){let v=P(e,"accent",3,"synapse");var l=B(),m=a(l),i=a(m),b=a(i);H(b,{get name(){return e.icon},size:22,draw:!0}),s(i);var x=c(i,2),d=a(x),g=a(d,!0);s(d);var z=c(d,2);{var w=t=>{var r=q(),n=a(r,!0);s(r),h(()=>p(n,e.subtitle)),o(t,r)};_(z,t=>{e.subtitle&&t(w)})}s(x),s(m);var y=c(m,2);{var j=t=>{var r=A(),n=a(r);k(n,()=>e.children),s(r),o(t,r)};_(y,t=>{e.children&&t(j)})}s(l),h(()=>{I(i,1,`header-tile relative flex items-center justify-center w-11 h-11 rounded-xl shrink-0 bg-${v()??""}/12 border border-${v()??""}/25 text-${v()??""}-glow`,"svelte-162svzm"),p(g,e.title)}),o(u,l)}export{M as P}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js.br b/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js.br new file mode 100644 index 0000000..edaccb9 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js.gz b/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js.gz new file mode 100644 index 0000000..8250b16 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DTO0IjuV.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js b/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js similarity index 91% rename from apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js rename to apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js index c29aa06..3428164 100644 --- a/apps/dashboard/build/_app/immutable/chunks/CmbJHhgy.js +++ b/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js @@ -1 +1 @@ -import"./Bzak7iHL.js";import{p as ge,o as ke,g as a,t as g,a as f,b as he,s as C,i as c,j as b,e as u,h as _,r as v,u as xe}from"./wpu9U-D0.js";import{d as we,a as V,s as L,e as De}from"./D8mhvFt8.js";import{i as p}from"./DKve45Wd.js";import{s as D,a as j,e as Ae}from"./60_R_Vbt.js";import{s as ee}from"./EqHb-9AZ.js";import{b as ae}from"./g5OnrUYZ.js";import{p as H}from"./ByYB047u.js";import{I as S}from"./D7A-gG4Z.js";var Ee=b(' '),Ie=b(''),qe=b(''),ze=b(''),Ce=b(''),Le=b(' '),Se=b(''),Te=b(''),Fe=b('
'),Me=b('
');function Ne(te,s){ge(s,!0);let k=H(s,"value",15),K=H(s,"placeholder",3,"Select…"),ne=H(s,"class",3,""),o=C(!1),A=C(void 0),h=C(void 0),i=C(-1),T="",U,x=xe(()=>s.options.find(e=>e.value===k()));function W(e){var t,n;k(e.value),(t=s.onChange)==null||t.call(s,e.value),I(),(n=a(A))==null||n.focus()}function se(){a(o)?I():E()}function E(){c(o,!0),c(i,Math.max(0,s.options.findIndex(e=>e.value===k())),!0),requestAnimationFrame(()=>{var e,t;(t=(e=a(h))==null?void 0:e.querySelectorAll('[role="option"]')[a(i)])==null||t.scrollIntoView({block:"nearest"})})}function I(){c(o,!1),c(i,-1)}function le(e){if(e.key==="ArrowDown"||e.key==="Enter"||e.key===" ")e.preventDefault(),a(o)?B(1):E();else if(e.key==="ArrowUp")e.preventDefault(),a(o)?B(-1):E();else if(e.key==="Escape")I();else if(e.key==="Home"&&a(o))e.preventDefault(),c(i,0);else if(e.key==="End"&&a(o))e.preventDefault(),c(i,s.options.length-1);else if(a(o)&&e.key==="Enter"&&a(i)>=0)e.preventDefault(),W(s.options[a(i)]);else if(e.key.length===1&&/\S/.test(e.key)){a(o)||E(),clearTimeout(U),T+=e.key.toLowerCase(),U=setTimeout(()=>T="",600);const t=s.options.findIndex(n=>n.label.toLowerCase().startsWith(T));t>=0&&c(i,t,!0)}}function B(e){const t=s.options.length;c(i,(a(i)+e+t)%t),requestAnimationFrame(()=>{var n,l;(l=(n=a(h))==null?void 0:n.querySelectorAll('[role="option"]')[a(i)])==null||l.scrollIntoView({block:"nearest"})})}ke(()=>{if(!a(o))return;function e(t){var n,l;!((n=a(A))!=null&&n.contains(t.target))&&!((l=a(h))!=null&&l.contains(t.target))&&I()}return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)});var q=Me(),G=u(q);{var re=e=>{var t=Ee(),n=u(t,!0);v(t),g(()=>L(n,s.label)),f(e,t)};p(G,e=>{s.label&&e(re)})}var m=_(G,2);let J;var N=u(m);{var oe=e=>{var t=Ie(),n=u(t);S(n,{get name(){return s.icon},size:15}),v(t),f(e,t)};p(N,e=>{s.icon&&e(oe)})}var z=_(N,2);let O;var P=u(z);{var de=e=>{var t=qe();g(()=>ee(t,`background:${a(x).color??""}`)),f(e,t)};p(P,e=>{var t;(t=a(x))!=null&&t.color&&e(de)})}var ie=_(P);v(z);var F=_(z,2);let Q;var ve=u(F);S(ve,{name:"chevron",size:14}),v(F),v(m),ae(m,e=>c(A,e),()=>a(A));var ce=_(m,2);{var ue=e=>{var t=Fe();Ae(t,23,()=>s.options,n=>n.value,(n,l,R)=>{var y=Te();let X;var Y=u(y);{var fe=r=>{var d=ze(),w=u(d);S(w,{get name(){return a(l).icon},size:15}),v(d),f(r,d)};p(Y,r=>{a(l).icon&&r(fe)})}var Z=_(Y,2);{var be=r=>{var d=Ce();g(()=>ee(d,`background:${a(l).color??""}`)),f(r,d)};p(Z,r=>{a(l).color&&r(be)})}var M=_(Z,2),_e=u(M,!0);v(M);var $=_(M,2);{var me=r=>{var d=Le(),w=u(d,!0);v(d),g(()=>L(w,a(l).badge)),f(r,d)};p($,r=>{a(l).badge!==void 0&&r(me)})}var pe=_($,2);{var ye=r=>{var d=Se(),w=u(d);S(w,{name:"sparkle",size:12}),v(d),f(r,d)};p(pe,r=>{a(l).value===k()&&r(ye)})}v(y),g(()=>{j(y,"aria-selected",a(l).value===k()),X=D(y,1,"dd-option svelte-1fd3ybn",null,X,{"dd-active":a(R)===a(i),"dd-selected":a(l).value===k()}),L(_e,a(l).label)}),De("mouseenter",y,()=>c(i,a(R),!0)),V("click",y,()=>W(a(l))),f(n,y)}),v(t),ae(t,n=>c(h,n),()=>a(h)),g(()=>j(t,"aria-label",s.label??K())),f(e,t)};p(ce,e=>{a(o)&&e(ue)})}v(q),g(()=>{D(q,1,`dd ${ne()??""}`,"svelte-1fd3ybn"),J=D(m,1,"dd-trigger svelte-1fd3ybn",null,J,{"dd-open":a(o)}),j(m,"aria-expanded",a(o)),O=D(z,1,"dd-value svelte-1fd3ybn",null,O,{"dd-placeholder":!a(x)}),L(ie,` ${(a(x)?a(x).label:K())??""}`),Q=D(F,1,"dd-chevron svelte-1fd3ybn",null,Q,{"dd-chevron-open":a(o)})}),V("click",m,se),V("keydown",m,le),f(te,q),he()}we(["click","keydown"]);export{Ne as D}; +import"./Bzak7iHL.js";import{p as ge,x as ke,g as a,t as g,a as f,b as he,s as C,i as c,j as b,e as u,h as _,r as v,u as xe}from"./CW7md74C.js";import{d as we,a as V,s as L,e as De}from"./D90q9c2i.js";import{i as p}from"./9-jplUL5.js";import{s as D,a as j,e as Ae}from"./Cc0l8Nd4.js";import{s as ee}from"./BNUnVJrY.js";import{b as ae}from"./ChcFQRZo.js";import{p as H}from"./BjbQ7qSx.js";import{I as S}from"./CqwrgJOn.js";var Ee=b(' '),Ie=b(''),qe=b(''),ze=b(''),Ce=b(''),Le=b(' '),Se=b(''),Te=b(''),Fe=b('
'),Me=b('
');function Ne(te,s){ge(s,!0);let k=H(s,"value",15),K=H(s,"placeholder",3,"Select…"),ne=H(s,"class",3,""),o=C(!1),A=C(void 0),h=C(void 0),i=C(-1),T="",U,x=xe(()=>s.options.find(e=>e.value===k()));function W(e){var t,n;k(e.value),(t=s.onChange)==null||t.call(s,e.value),I(),(n=a(A))==null||n.focus()}function se(){a(o)?I():E()}function E(){c(o,!0),c(i,Math.max(0,s.options.findIndex(e=>e.value===k())),!0),requestAnimationFrame(()=>{var e,t;(t=(e=a(h))==null?void 0:e.querySelectorAll('[role="option"]')[a(i)])==null||t.scrollIntoView({block:"nearest"})})}function I(){c(o,!1),c(i,-1)}function le(e){if(e.key==="ArrowDown"||e.key==="Enter"||e.key===" ")e.preventDefault(),a(o)?B(1):E();else if(e.key==="ArrowUp")e.preventDefault(),a(o)?B(-1):E();else if(e.key==="Escape")I();else if(e.key==="Home"&&a(o))e.preventDefault(),c(i,0);else if(e.key==="End"&&a(o))e.preventDefault(),c(i,s.options.length-1);else if(a(o)&&e.key==="Enter"&&a(i)>=0)e.preventDefault(),W(s.options[a(i)]);else if(e.key.length===1&&/\S/.test(e.key)){a(o)||E(),clearTimeout(U),T+=e.key.toLowerCase(),U=setTimeout(()=>T="",600);const t=s.options.findIndex(n=>n.label.toLowerCase().startsWith(T));t>=0&&c(i,t,!0)}}function B(e){const t=s.options.length;c(i,(a(i)+e+t)%t),requestAnimationFrame(()=>{var n,l;(l=(n=a(h))==null?void 0:n.querySelectorAll('[role="option"]')[a(i)])==null||l.scrollIntoView({block:"nearest"})})}ke(()=>{if(!a(o))return;function e(t){var n,l;!((n=a(A))!=null&&n.contains(t.target))&&!((l=a(h))!=null&&l.contains(t.target))&&I()}return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)});var q=Me(),G=u(q);{var re=e=>{var t=Ee(),n=u(t,!0);v(t),g(()=>L(n,s.label)),f(e,t)};p(G,e=>{s.label&&e(re)})}var m=_(G,2);let J;var N=u(m);{var oe=e=>{var t=Ie(),n=u(t);S(n,{get name(){return s.icon},size:15}),v(t),f(e,t)};p(N,e=>{s.icon&&e(oe)})}var z=_(N,2);let O;var P=u(z);{var de=e=>{var t=qe();g(()=>ee(t,`background:${a(x).color??""}`)),f(e,t)};p(P,e=>{var t;(t=a(x))!=null&&t.color&&e(de)})}var ie=_(P);v(z);var F=_(z,2);let Q;var ve=u(F);S(ve,{name:"chevron",size:14}),v(F),v(m),ae(m,e=>c(A,e),()=>a(A));var ce=_(m,2);{var ue=e=>{var t=Fe();Ae(t,23,()=>s.options,n=>n.value,(n,l,R)=>{var y=Te();let X;var Y=u(y);{var fe=r=>{var d=ze(),w=u(d);S(w,{get name(){return a(l).icon},size:15}),v(d),f(r,d)};p(Y,r=>{a(l).icon&&r(fe)})}var Z=_(Y,2);{var be=r=>{var d=Ce();g(()=>ee(d,`background:${a(l).color??""}`)),f(r,d)};p(Z,r=>{a(l).color&&r(be)})}var M=_(Z,2),_e=u(M,!0);v(M);var $=_(M,2);{var me=r=>{var d=Le(),w=u(d,!0);v(d),g(()=>L(w,a(l).badge)),f(r,d)};p($,r=>{a(l).badge!==void 0&&r(me)})}var pe=_($,2);{var ye=r=>{var d=Se(),w=u(d);S(w,{name:"sparkle",size:12}),v(d),f(r,d)};p(pe,r=>{a(l).value===k()&&r(ye)})}v(y),g(()=>{j(y,"aria-selected",a(l).value===k()),X=D(y,1,"dd-option svelte-1fd3ybn",null,X,{"dd-active":a(R)===a(i),"dd-selected":a(l).value===k()}),L(_e,a(l).label)}),De("mouseenter",y,()=>c(i,a(R),!0)),V("click",y,()=>W(a(l))),f(n,y)}),v(t),ae(t,n=>c(h,n),()=>a(h)),g(()=>j(t,"aria-label",s.label??K())),f(e,t)};p(ce,e=>{a(o)&&e(ue)})}v(q),g(()=>{D(q,1,`dd ${ne()??""}`,"svelte-1fd3ybn"),J=D(m,1,"dd-trigger svelte-1fd3ybn",null,J,{"dd-open":a(o)}),j(m,"aria-expanded",a(o)),O=D(z,1,"dd-value svelte-1fd3ybn",null,O,{"dd-placeholder":!a(x)}),L(ie,` ${(a(x)?a(x).label:K())??""}`),Q=D(F,1,"dd-chevron svelte-1fd3ybn",null,Q,{"dd-chevron-open":a(o)})}),V("click",m,se),V("keydown",m,le),f(te,q),he()}we(["click","keydown"]);export{Ne as D}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js.br b/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js.br new file mode 100644 index 0000000..2cda4be Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js.gz b/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js.gz new file mode 100644 index 0000000..3384fee Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DUAsElMg.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js.br b/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js.br deleted file mode 100644 index 62a2556..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js.gz b/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js.gz deleted file mode 100644 index c230386..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DcKTNC6e.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js b/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js similarity index 87% rename from apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js rename to apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js index 32ca8e1..607657d 100644 --- a/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js +++ b/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js @@ -1 +1 @@ -import{s as ae}from"./TZu9D97Z.js";import{c as ne,H as $,N as M,r as mt,i as _t,b as L,s as C,p as x,n as ft,f as Nt,g as ut,a as J,d as it,S as $t,P as re,e as oe,h as se,o as Dt,j as q,k as ie,l as qt,m as ce,q as le,t as Kt,u as Pt,v as fe}from"./Bxs5UR9-.js";import{O as X,at as ue}from"./wpu9U-D0.js";import{w as he}from"./D8mhvFt8.js";class wt{constructor(a,e){this.status=a,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${a}`}}toString(){return JSON.stringify(this.body)}}class vt{constructor(a,e){this.status=a,this.location=e}}class yt extends Error{constructor(a,e,r){super(r),this.status=a,this.text=e}}const de=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function pe(t){const a=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${me(t).map(r=>{const n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(n)return a.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return a.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return ct(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ct(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const h=de.exec(c),[,u,w,f,d]=h;return a.push({name:f,matcher:d,optional:!!u,rest:!!w,chained:w?l===1&&s[0]==="":!1}),w?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return ct(c)}).join("")}).join("")}/?$`),params:a}}function ge(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function me(t){return t.slice(1).split("/").filter(ge)}function _e(t,a,e){const r={},n=t.slice(1),o=n.filter(i=>i!==void 0);let s=0;for(let i=0;ih).join("/"),s=0),l===void 0)if(c.rest)l="";else continue;if(!c.matcher||e[c.matcher](l)){r[c.name]=l;const h=a[i+1],u=n[i+1];h&&!h.rest&&h.optional&&u&&c.chained&&(s=0),!h&&!u&&Object.keys(r).length===o.length&&(s=0);continue}if(c.optional&&c.chained){s++;continue}return}if(!s)return r}function ct(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function we({nodes:t,server_loads:a,dictionary:e,matchers:r}){const n=new Set(a);return Object.entries(e).map(([i,[c,l,h]])=>{const{pattern:u,params:w}=pe(i),f={id:i,exec:d=>{const _=u.exec(d);if(_)return _e(_,w,r)},errors:[1,...h||[]].map(d=>t[d]),layouts:[0,...l||[]].map(s),leaf:o(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(i){const c=i<0;return c&&(i=~i),[c,t[i]]}function s(i){return i===void 0?i:[n.has(i),t[i]]}}function Ft(t,a=JSON.parse){try{return a(sessionStorage[t])}catch{}}function It(t,a,e=JSON.stringify){const r=e(a);try{sessionStorage[t]=r}catch{}}function ve(t){return t.filter(a=>a!=null)}function Et(t){return t instanceof wt||t instanceof yt?t.status:500}function ye(t){return t instanceof yt?t.text:"Internal Error"}const{onMount:Ee}=ae,be=new Set(["icon","shortcut icon","apple-touch-icon"]),I=Ft(Kt)??{},B=Ft(qt)??{},P={url:Pt({}),page:Pt({}),navigating:he(null),updated:ne()};function bt(t){I[t]=C()}function ke(t,a){let e=t+1;for(;I[e];)delete I[e],e+=1;for(e=a+1;B[e];)delete B[e],e+=1}function V(t,a=!1){return a?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function Mt(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(L||"/");t&&await t.update()}}function Tt(){}let kt,ht,Q,U,dt,b;const Z=[],tt=[];let v=null;function pt(){var t;(t=v==null?void 0:v.fork)==null||t.then(a=>a==null?void 0:a.discard()),v=null}const G=new Map,Bt=new Set,Vt=new Set,F=new Set;let m={branch:[],error:null,url:null},Ht=!1,et=!1,Ot=!0,H=!1,K=!1,Yt=!1,St=!1,zt,E,R,O;const at=new Set,Ct=new Map;async function He(t,a,e){var o,s,i,c,l;(o=globalThis.__sveltekit_1wncwk)!=null&&o.data&&globalThis.__sveltekit_1wncwk.data,document.URL!==location.href&&(location.href=location.href),b=t,await((i=(s=t.hooks).init)==null?void 0:i.call(s)),kt=we(t),U=document.documentElement,dt=a,ht=t.nodes[0],Q=t.nodes[1],ht(),Q(),E=(c=history.state)==null?void 0:c[$],R=(l=history.state)==null?void 0:l[M],E||(E=R=Date.now(),history.replaceState({...history.state,[$]:E,[M]:R},""));const r=I[E];function n(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}e?(n(),await $e(dt,e)):(await D({type:"enter",url:mt(b.hash?Ke(new URL(location.href)):location.href),replace_state:!0}),n()),Ne()}function Se(){Z.length=0,St=!1}function Wt(t){tt.some(a=>a==null?void 0:a.snapshot)&&(B[t]=tt.map(a=>{var e;return(e=a==null?void 0:a.snapshot)==null?void 0:e.capture()}))}function Gt(t){var a;(a=B[t])==null||a.forEach((e,r)=>{var n,o;(o=(n=tt[r])==null?void 0:n.snapshot)==null||o.restore(e)})}function jt(){bt(E),It(Kt,I),Wt(R),It(qt,B)}async function Jt(t,a,e,r){let n;a.invalidateAll&&pt(),await D({type:"goto",url:mt(t),keepfocus:a.keepFocus,noscroll:a.noScroll,replace_state:a.replaceState,state:a.state,redirect_count:e,nav_token:r,accept:()=>{a.invalidateAll&&(St=!0,n=[...Ct.keys()]),a.invalidate&&a.invalidate.forEach(je)}}),a.invalidateAll&&X().then(X).then(()=>{Ct.forEach(({resource:o},s)=>{var i;n!=null&&n.includes(s)&&((i=o.refresh)==null||i.call(o))})})}async function Re(t){if(t.id!==(v==null?void 0:v.id)){pt();const a={};at.add(a),v={id:t.id,token:a,promise:Qt({...t,preload:a}).then(e=>(at.delete(a),e.type==="loaded"&&e.state.error&&pt(),e)),fork:null}}return v.promise}async function lt(t){var e;const a=(e=await ot(t,!1))==null?void 0:e.route;a&&await Promise.all([...a.layouts,a.leaf].filter(Boolean).map(r=>r[1]()))}async function Xt(t,a,e){var n;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(x,t.props.page),zt=new b.root({target:a,props:{...t.props,stores:P,components:tt},hydrate:e,sync:!1}),await Promise.resolve(),Gt(R),e){const o={from:null,to:{params:m.params,route:{id:((n=m.route)==null?void 0:n.id)??null},url:new URL(location.href),scroll:I[E]??C()},willUnload:!1,type:"enter",complete:Promise.resolve()};F.forEach(s=>s(o))}et=!0}function nt({url:t,params:a,branch:e,status:r,error:n,route:o,form:s}){let i="never";if(L&&(t.pathname===L||t.pathname===L+"/"))i="always";else for(const f of e)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=se(t.pathname,i),t.search=t.search;const c={type:"loaded",state:{url:t,params:a,branch:e,error:n,route:o},props:{constructors:ve(e).map(f=>f.node.component),page:At(x)}};s!==void 0&&(c.props.form=s);let l={},h=!x,u=0;for(let f=0;fi(new URL(s))))return!0;return!1}function xt(t,a){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?a??null:null}function Ue(t,a){if(!t)return new Set(a.searchParams.keys());const e=new Set([...t.searchParams.keys(),...a.searchParams.keys()]);for(const r of e){const n=t.searchParams.getAll(r),o=a.searchParams.getAll(r);n.every(s=>o.includes(s))&&o.every(s=>n.includes(s))&&e.delete(r)}return e}function Ae({error:t,url:a,route:e,params:r}){return{type:"loaded",state:{error:t,url:a,route:e,params:r,branch:[]},props:{page:At(x),constructors:[]}}}async function Qt({id:t,invalidating:a,url:e,params:r,route:n,preload:o}){if((v==null?void 0:v.id)===t)return at.delete(v.token),v.promise;const{errors:s,layouts:i,leaf:c}=n,l=[...i,c];s.forEach(g=>g==null?void 0:g().catch(()=>{})),l.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const h=m.url?t!==rt(m.url):!1,u=m.route?n.id!==m.route.id:!1,w=Ue(m.url,e);let f=!1;const d=l.map(async(g,p)=>{var A;if(!g)return;const y=m.branch[p];return g[1]===(y==null?void 0:y.loader)&&!Le(f,u,h,w,(A=y.universal)==null?void 0:A.uses,r)?y:(f=!0,Rt({loader:g[1],url:e,params:r,route:n,parent:async()=>{var z;const T={};for(let j=0;j{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:xt(o)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return nt({url:e,params:n,branch:[s,i],status:t,error:a,route:null})}catch(s){if(s instanceof vt)return Jt(new URL(s.location,location.href),{},0);throw s}}async function Ie(t){const a=t.href;if(G.has(a))return G.get(a);let e;try{const r=(async()=>{let n=await b.hooks.reroute({url:new URL(t),fetch:async(o,s)=>xe(o,s,t).promise})??t;if(typeof n=="string"){const o=new URL(t);b.hash?o.hash=n:o.pathname=n,n=o}return n})();G.set(a,r),e=await r}catch{G.delete(a);return}return e}async function ot(t,a){if(t&&!_t(t,L,b.hash)){const e=await Ie(t);if(!e)return;const r=Te(e);for(const n of kt){const o=n.exec(r);if(o)return{id:rt(t),invalidating:a,route:n,params:oe(o),url:t}}}}function Te(t){return ie(b.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(L.length))||"/"}function rt(t){return(b.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Zt({url:t,type:a,intent:e,delta:r,event:n,scroll:o}){let s=!1;const i=Ut(m,e,t,a,o??null);r!==void 0&&(i.navigation.delta=r),n!==void 0&&(i.navigation.event=n);const c={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return H||Bt.forEach(l=>l(c)),s?null:i}async function D({type:t,url:a,popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s={},redirect_count:i=0,nav_token:c={},accept:l=Tt,block:h=Tt,event:u}){var j;const w=O;O=c;const f=await ot(a,!1),d=t==="enter"?Ut(m,f,a,t):Zt({url:a,type:t,delta:e==null?void 0:e.delta,intent:f,scroll:e==null?void 0:e.scroll,event:u});if(!d){h(),O===c&&(O=w);return}const _=E,g=R;l(),H=!0,et&&d.navigation.type!=="enter"&&P.navigating.set(ft.current=d.navigation);let p=f&&await Qt(f);if(!p){if(_t(a,L,b.hash))return await V(a,o);p=await te(a,{id:null},await Y(new yt(404,"Not Found",`Not found: ${a.pathname}`),{url:a,params:{},route:{id:null}}),404,o)}if(a=(f==null?void 0:f.url)||a,O!==c)return d.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await D({type:t,url:new URL(p.location,a),popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s,redirect_count:i+1,nav_token:c}),d.fulfil(void 0);return}p=await Lt({status:500,error:await Y(new Error("Redirect loop"),{url:a,params:{},route:{id:null}}),url:a,route:{id:null}})}else p.props.page.status>=400&&await P.updated.check()&&(await Mt(),await V(a,o));if(Se(),bt(_),Wt(g),p.props.page.url.pathname!==a.pathname&&(a.pathname=p.props.page.url.pathname),s=e?e.state:s,!e){const k=o?0:1,W={[$]:E+=k,[M]:R+=k,[$t]:s};(o?history.replaceState:history.pushState).call(history,W,"",a),o||ke(E,R)}const y=f&&(v==null?void 0:v.id)===f.id?v.fork:null;v=null,p.props.page.state=s;let S;if(et){const k=(await Promise.all(Array.from(Vt,N=>N(d.navigation)))).filter(N=>typeof N=="function");if(k.length>0){let N=function(){k.forEach(st=>{F.delete(st)})};k.push(N),k.forEach(st=>{F.add(st)})}m=p.state,p.props.page&&(p.props.page.url=a);const W=y&&await y;W?S=W.commit():(zt.$set(p.props),fe(p.props.page),S=(j=ue)==null?void 0:j()),Yt=!0}else await Xt(p,dt,!1);const{activeElement:A}=document;await S,await X(),await X();let T=null;if(Ot){const k=e?e.scroll:n?C():null;k?scrollTo(k.x,k.y):(T=a.hash&&document.getElementById(ee(a)))?T.scrollIntoView():scrollTo(0,0)}const z=document.activeElement!==A&&document.activeElement!==document.body;!r&&!z&&qe(a,!T),Ot=!0,p.props.page&&Object.assign(x,p.props.page),H=!1,t==="popstate"&&Gt(R),d.fulfil(void 0),d.navigation.to&&(d.navigation.to.scroll=C()),F.forEach(k=>k(d.navigation)),P.navigating.set(ft.current=null)}async function te(t,a,e,r,n){return t.origin===Dt&&t.pathname===location.pathname&&!Ht?await Lt({status:r,error:e,url:t,route:a}):await V(t,n)}function Oe(){let t,a={element:void 0,href:void 0},e;U.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(t),t=setTimeout(()=>{o(c,q.hover)},20)});function r(i){i.defaultPrevented||o(i.composedPath()[0],q.tap)}U.addEventListener("mousedown",r),U.addEventListener("touchstart",r,{passive:!0});const n=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(lt(new URL(c.target.href)),n.unobserve(c.target))},{threshold:0});async function o(i,c){const l=Nt(i,U),h=l===a.element&&(l==null?void 0:l.href)===a.href&&c>=e;if(!l||h)return;const{url:u,external:w,download:f}=ut(l,L,b.hash);if(w||f)return;const d=J(l),_=u&&rt(m.url)===rt(u);if(!(d.reload||_))if(c<=d.preload_data){a={element:l,href:l.href},e=q.tap;const g=await ot(u,!1);if(!g)return;Re(g)}else c<=d.preload_code&&(a={element:l,href:l.href},e=c,lt(u))}function s(){n.disconnect();for(const i of U.querySelectorAll("a")){const{url:c,external:l,download:h}=ut(i,L,b.hash);if(l||h)continue;const u=J(i);u.reload||(u.preload_code===q.viewport&&n.observe(i),u.preload_code===q.eager&<(c))}}F.add(s),s()}function Y(t,a){if(t instanceof wt)return t.body;const e=Et(t),r=ye(t);return b.hooks.handleError({error:t,event:a,status:e,message:r})??{message:r}}function Ce(t,a){Ee(()=>(t.add(a),()=>{t.delete(a)}))}function Ye(t){Ce(Vt,t)}function ze(t,a={}){return t=new URL(mt(t)),t.origin!==Dt?Promise.reject(new Error("goto: invalid URL")):Jt(t,a,0)}function je(t){if(typeof t=="function")Z.push(t);else{const{href:a}=new URL(t,location.href);Z.push(e=>e.href===a)}}function Ne(){var a;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(jt(),!H){const n=Ut(m,void 0,null,"leave"),o={...n.navigation,cancel:()=>{r=!0,n.reject(new Error("navigation cancelled"))}};Bt.forEach(s=>s(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&jt()}),(a=navigator.connection)!=null&&a.saveData||Oe(),U.addEventListener("click",async e=>{if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Nt(e.composedPath()[0],U);if(!r)return;const{url:n,external:o,target:s,download:i}=ut(r,L,b.hash);if(!n)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=J(r);if(!(r instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[h,u]=(b.hash?n.hash.replace(/^#/,""):n.href).split("#"),w=h===it(location);if(o||c.reload&&(!w||!u)){Zt({url:n,type:"link",event:e})?H=!0:e.preventDefault();return}if(u!==void 0&&w){const[,f]=m.url.href.split("#");if(f===u){if(e.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(K=!0,bt(E),t(n),!c.replace_state)return;K=!1}e.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await D({type:"link",url:n,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??n.href===location.href,event:e})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if(((n==null?void 0:n.formTarget)||r.target)==="_blank"||((n==null?void 0:n.formMethod)||r.method)!=="get")return;const i=new URL((n==null?void 0:n.hasAttribute("formaction"))&&(n==null?void 0:n.formAction)||r.action);if(_t(i,L,!1))return;const c=e.target,l=J(c);if(l.reload)return;e.preventDefault(),e.stopPropagation();const h=new FormData(c,n);i.search=new URLSearchParams(h).toString(),D({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:e})}),addEventListener("popstate",async e=>{var r;if(!gt){if((r=e.state)!=null&&r[$]){const n=e.state[$];if(O={},n===E)return;const o=I[n],s=e.state[$t]??{},i=new URL(e.state[re]??location.href),c=e.state[M],l=m.url?it(location)===it(m.url):!1;if(c===R&&(Yt||l)){s!==x.state&&(x.state=s),t(i),I[E]=C(),o&&scrollTo(o.x,o.y),E=n;return}const u=n-E;await D({type:"popstate",url:i,popped:{state:s,scroll:o,delta:u},accept:()=>{E=n,R=c},block:()=>{history.go(-u)},nav_token:O,event:e})}else if(!K){const n=new URL(location.href);t(n),b.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[$]:++E,[M]:R},"",location.href))});for(const e of document.querySelectorAll("link"))be.has(e.rel)&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&P.navigating.set(ft.current=null)});function t(e){m.url=x.url=e,P.page.set(At(x)),P.page.notify()}}async function $e(t,{status:a=200,error:e,node_ids:r,params:n,route:o,server_route:s,data:i,form:c}){Ht=!0;const l=new URL(location.href);let h;({params:n={},route:o={id:null}}=await ot(l,!1)||{}),h=kt.find(({id:f})=>f===o.id);let u,w=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=De(p.uses)),Rt({loader:b.nodes[_],url:l,params:n,route:o,parent:async()=>{const y={};for(let S=0;S{const i=history.state;gt=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),a&&scrollTo(o,s),gt=!1})}else{const o=document.body,s=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),s!==null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex")}const n=getSelection();if(n&&n.type!=="None"){const o=[];for(let s=0;s{if(n.rangeCount===o.length){for(let s=0;s{o=u,s=w});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:t.url,scroll:C()},to:e&&{params:(a==null?void 0:a.params)??null,route:{id:((h=a==null?void 0:a.route)==null?void 0:h.id)??null},url:e,scroll:n},willUnload:!a,type:r,complete:i},fulfil:o,reject:s}}function At(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function Ke(t){const a=new URL(t);return a.hash=decodeURIComponent(t.hash),a}function ee(t){let a;if(b.hash){const[,,e]=t.hash.split("#",3);a=e??""}else a=t.hash.slice(1);return decodeURIComponent(a)}export{He as a,ze as g,Ye as o,P as s}; +import{s as ae}from"./JVtQszIZ.js";import{c as ne,H as $,N as M,r as mt,i as _t,b as L,s as C,p as x,n as ft,f as Nt,g as ut,a as J,d as it,S as $t,P as re,e as oe,h as se,o as Dt,j as q,k as ie,l as qt,m as ce,q as le,t as Kt,u as Pt,v as fe}from"./CaEJGM7b.js";import{Q as X,au as ue}from"./CW7md74C.js";import{w as he}from"./D90q9c2i.js";class wt{constructor(a,e){this.status=a,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${a}`}}toString(){return JSON.stringify(this.body)}}class vt{constructor(a,e){this.status=a,this.location=e}}class yt extends Error{constructor(a,e,r){super(r),this.status=a,this.text=e}}const de=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function pe(t){const a=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${me(t).map(r=>{const n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(n)return a.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return a.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return ct(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ct(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const h=de.exec(c),[,u,w,f,d]=h;return a.push({name:f,matcher:d,optional:!!u,rest:!!w,chained:w?l===1&&s[0]==="":!1}),w?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return ct(c)}).join("")}).join("")}/?$`),params:a}}function ge(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function me(t){return t.slice(1).split("/").filter(ge)}function _e(t,a,e){const r={},n=t.slice(1),o=n.filter(i=>i!==void 0);let s=0;for(let i=0;ih).join("/"),s=0),l===void 0)if(c.rest)l="";else continue;if(!c.matcher||e[c.matcher](l)){r[c.name]=l;const h=a[i+1],u=n[i+1];h&&!h.rest&&h.optional&&u&&c.chained&&(s=0),!h&&!u&&Object.keys(r).length===o.length&&(s=0);continue}if(c.optional&&c.chained){s++;continue}return}if(!s)return r}function ct(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function we({nodes:t,server_loads:a,dictionary:e,matchers:r}){const n=new Set(a);return Object.entries(e).map(([i,[c,l,h]])=>{const{pattern:u,params:w}=pe(i),f={id:i,exec:d=>{const _=u.exec(d);if(_)return _e(_,w,r)},errors:[1,...h||[]].map(d=>t[d]),layouts:[0,...l||[]].map(s),leaf:o(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(i){const c=i<0;return c&&(i=~i),[c,t[i]]}function s(i){return i===void 0?i:[n.has(i),t[i]]}}function Ft(t,a=JSON.parse){try{return a(sessionStorage[t])}catch{}}function It(t,a,e=JSON.stringify){const r=e(a);try{sessionStorage[t]=r}catch{}}function ve(t){return t.filter(a=>a!=null)}function Et(t){return t instanceof wt||t instanceof yt?t.status:500}function ye(t){return t instanceof yt?t.text:"Internal Error"}const{onMount:Ee}=ae,be=new Set(["icon","shortcut icon","apple-touch-icon"]),I=Ft(Kt)??{},z=Ft(qt)??{},P={url:Pt({}),page:Pt({}),navigating:he(null),updated:ne()};function bt(t){I[t]=C()}function ke(t,a){let e=t+1;for(;I[e];)delete I[e],e+=1;for(e=a+1;z[e];)delete z[e],e+=1}function B(t,a=!1){return a?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function Mt(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(L||"/");t&&await t.update()}}function Tt(){}let kt,ht,Q,U,dt,b;const Z=[],tt=[];let v=null;function pt(){var t;(t=v==null?void 0:v.fork)==null||t.then(a=>a==null?void 0:a.discard()),v=null}const G=new Map,zt=new Set,Bt=new Set,F=new Set;let m={branch:[],error:null,url:null},Vt=!1,et=!1,Ot=!0,V=!1,K=!1,Ht=!1,St=!1,Yt,E,R,O;const at=new Set,Ct=new Map;async function Ve(t,a,e){var o,s,i,c,l;(o=globalThis.__sveltekit_1vzggk)!=null&&o.data&&globalThis.__sveltekit_1vzggk.data,document.URL!==location.href&&(location.href=location.href),b=t,await((i=(s=t.hooks).init)==null?void 0:i.call(s)),kt=we(t),U=document.documentElement,dt=a,ht=t.nodes[0],Q=t.nodes[1],ht(),Q(),E=(c=history.state)==null?void 0:c[$],R=(l=history.state)==null?void 0:l[M],E||(E=R=Date.now(),history.replaceState({...history.state,[$]:E,[M]:R},""));const r=I[E];function n(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}e?(n(),await $e(dt,e)):(await D({type:"enter",url:mt(b.hash?Ke(new URL(location.href)):location.href),replace_state:!0}),n()),Ne()}function Se(){Z.length=0,St=!1}function Wt(t){tt.some(a=>a==null?void 0:a.snapshot)&&(z[t]=tt.map(a=>{var e;return(e=a==null?void 0:a.snapshot)==null?void 0:e.capture()}))}function Gt(t){var a;(a=z[t])==null||a.forEach((e,r)=>{var n,o;(o=(n=tt[r])==null?void 0:n.snapshot)==null||o.restore(e)})}function jt(){bt(E),It(Kt,I),Wt(R),It(qt,z)}async function Jt(t,a,e,r){let n;a.invalidateAll&&pt(),await D({type:"goto",url:mt(t),keepfocus:a.keepFocus,noscroll:a.noScroll,replace_state:a.replaceState,state:a.state,redirect_count:e,nav_token:r,accept:()=>{a.invalidateAll&&(St=!0,n=[...Ct.keys()]),a.invalidate&&a.invalidate.forEach(je)}}),a.invalidateAll&&X().then(X).then(()=>{Ct.forEach(({resource:o},s)=>{var i;n!=null&&n.includes(s)&&((i=o.refresh)==null||i.call(o))})})}async function Re(t){if(t.id!==(v==null?void 0:v.id)){pt();const a={};at.add(a),v={id:t.id,token:a,promise:Qt({...t,preload:a}).then(e=>(at.delete(a),e.type==="loaded"&&e.state.error&&pt(),e)),fork:null}}return v.promise}async function lt(t){var e;const a=(e=await ot(t,!1))==null?void 0:e.route;a&&await Promise.all([...a.layouts,a.leaf].filter(Boolean).map(r=>r[1]()))}async function Xt(t,a,e){var n;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(x,t.props.page),Yt=new b.root({target:a,props:{...t.props,stores:P,components:tt},hydrate:e,sync:!1}),await Promise.resolve(),Gt(R),e){const o={from:null,to:{params:m.params,route:{id:((n=m.route)==null?void 0:n.id)??null},url:new URL(location.href),scroll:I[E]??C()},willUnload:!1,type:"enter",complete:Promise.resolve()};F.forEach(s=>s(o))}et=!0}function nt({url:t,params:a,branch:e,status:r,error:n,route:o,form:s}){let i="never";if(L&&(t.pathname===L||t.pathname===L+"/"))i="always";else for(const f of e)(f==null?void 0:f.slash)!==void 0&&(i=f.slash);t.pathname=se(t.pathname,i),t.search=t.search;const c={type:"loaded",state:{url:t,params:a,branch:e,error:n,route:o},props:{constructors:ve(e).map(f=>f.node.component),page:At(x)}};s!==void 0&&(c.props.form=s);let l={},h=!x,u=0;for(let f=0;fi(new URL(s))))return!0;return!1}function xt(t,a){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?a??null:null}function Ue(t,a){if(!t)return new Set(a.searchParams.keys());const e=new Set([...t.searchParams.keys(),...a.searchParams.keys()]);for(const r of e){const n=t.searchParams.getAll(r),o=a.searchParams.getAll(r);n.every(s=>o.includes(s))&&o.every(s=>n.includes(s))&&e.delete(r)}return e}function Ae({error:t,url:a,route:e,params:r}){return{type:"loaded",state:{error:t,url:a,route:e,params:r,branch:[]},props:{page:At(x),constructors:[]}}}async function Qt({id:t,invalidating:a,url:e,params:r,route:n,preload:o}){if((v==null?void 0:v.id)===t)return at.delete(v.token),v.promise;const{errors:s,layouts:i,leaf:c}=n,l=[...i,c];s.forEach(g=>g==null?void 0:g().catch(()=>{})),l.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const h=m.url?t!==rt(m.url):!1,u=m.route?n.id!==m.route.id:!1,w=Ue(m.url,e);let f=!1;const d=l.map(async(g,p)=>{var A;if(!g)return;const y=m.branch[p];return g[1]===(y==null?void 0:y.loader)&&!Le(f,u,h,w,(A=y.universal)==null?void 0:A.uses,r)?y:(f=!0,Rt({loader:g[1],url:e,params:r,route:n,parent:async()=>{var Y;const T={};for(let j=0;j{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:xt(o)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return nt({url:e,params:n,branch:[s,i],status:t,error:a,route:null})}catch(s){if(s instanceof vt)return Jt(new URL(s.location,location.href),{},0);throw s}}async function Ie(t){const a=t.href;if(G.has(a))return G.get(a);let e;try{const r=(async()=>{let n=await b.hooks.reroute({url:new URL(t),fetch:async(o,s)=>xe(o,s,t).promise})??t;if(typeof n=="string"){const o=new URL(t);b.hash?o.hash=n:o.pathname=n,n=o}return n})();G.set(a,r),e=await r}catch{G.delete(a);return}return e}async function ot(t,a){if(t&&!_t(t,L,b.hash)){const e=await Ie(t);if(!e)return;const r=Te(e);for(const n of kt){const o=n.exec(r);if(o)return{id:rt(t),invalidating:a,route:n,params:oe(o),url:t}}}}function Te(t){return ie(b.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(L.length))||"/"}function rt(t){return(b.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Zt({url:t,type:a,intent:e,delta:r,event:n,scroll:o}){let s=!1;const i=Ut(m,e,t,a,o??null);r!==void 0&&(i.navigation.delta=r),n!==void 0&&(i.navigation.event=n);const c={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return V||zt.forEach(l=>l(c)),s?null:i}async function D({type:t,url:a,popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s={},redirect_count:i=0,nav_token:c={},accept:l=Tt,block:h=Tt,event:u}){var j;const w=O;O=c;const f=await ot(a,!1),d=t==="enter"?Ut(m,f,a,t):Zt({url:a,type:t,delta:e==null?void 0:e.delta,intent:f,scroll:e==null?void 0:e.scroll,event:u});if(!d){h(),O===c&&(O=w);return}const _=E,g=R;l(),V=!0,et&&d.navigation.type!=="enter"&&P.navigating.set(ft.current=d.navigation);let p=f&&await Qt(f);if(!p){if(_t(a,L,b.hash))return await B(a,o);p=await te(a,{id:null},await H(new yt(404,"Not Found",`Not found: ${a.pathname}`),{url:a,params:{},route:{id:null}}),404,o)}if(a=(f==null?void 0:f.url)||a,O!==c)return d.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await D({type:t,url:new URL(p.location,a),popped:e,keepfocus:r,noscroll:n,replace_state:o,state:s,redirect_count:i+1,nav_token:c}),d.fulfil(void 0);return}p=await Lt({status:500,error:await H(new Error("Redirect loop"),{url:a,params:{},route:{id:null}}),url:a,route:{id:null}})}else p.props.page.status>=400&&await P.updated.check()&&(await Mt(),await B(a,o));if(Se(),bt(_),Wt(g),p.props.page.url.pathname!==a.pathname&&(a.pathname=p.props.page.url.pathname),s=e?e.state:s,!e){const k=o?0:1,W={[$]:E+=k,[M]:R+=k,[$t]:s};(o?history.replaceState:history.pushState).call(history,W,"",a),o||ke(E,R)}const y=f&&(v==null?void 0:v.id)===f.id?v.fork:null;v=null,p.props.page.state=s;let S;if(et){const k=(await Promise.all(Array.from(Bt,N=>N(d.navigation)))).filter(N=>typeof N=="function");if(k.length>0){let N=function(){k.forEach(st=>{F.delete(st)})};k.push(N),k.forEach(st=>{F.add(st)})}m=p.state,p.props.page&&(p.props.page.url=a);const W=y&&await y;W?S=W.commit():(Yt.$set(p.props),fe(p.props.page),S=(j=ue)==null?void 0:j()),Ht=!0}else await Xt(p,dt,!1);const{activeElement:A}=document;await S,await X(),await X();let T=null;if(Ot){const k=e?e.scroll:n?C():null;k?scrollTo(k.x,k.y):(T=a.hash&&document.getElementById(ee(a)))?T.scrollIntoView():scrollTo(0,0)}const Y=document.activeElement!==A&&document.activeElement!==document.body;!r&&!Y&&qe(a,!T),Ot=!0,p.props.page&&Object.assign(x,p.props.page),V=!1,t==="popstate"&&Gt(R),d.fulfil(void 0),d.navigation.to&&(d.navigation.to.scroll=C()),F.forEach(k=>k(d.navigation)),P.navigating.set(ft.current=null)}async function te(t,a,e,r,n){return t.origin===Dt&&t.pathname===location.pathname&&!Vt?await Lt({status:r,error:e,url:t,route:a}):await B(t,n)}function Oe(){let t,a={element:void 0,href:void 0},e;U.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(t),t=setTimeout(()=>{o(c,q.hover)},20)});function r(i){i.defaultPrevented||o(i.composedPath()[0],q.tap)}U.addEventListener("mousedown",r),U.addEventListener("touchstart",r,{passive:!0});const n=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(lt(new URL(c.target.href)),n.unobserve(c.target))},{threshold:0});async function o(i,c){const l=Nt(i,U),h=l===a.element&&(l==null?void 0:l.href)===a.href&&c>=e;if(!l||h)return;const{url:u,external:w,download:f}=ut(l,L,b.hash);if(w||f)return;const d=J(l),_=u&&rt(m.url)===rt(u);if(!(d.reload||_))if(c<=d.preload_data){a={element:l,href:l.href},e=q.tap;const g=await ot(u,!1);if(!g)return;Re(g)}else c<=d.preload_code&&(a={element:l,href:l.href},e=c,lt(u))}function s(){n.disconnect();for(const i of U.querySelectorAll("a")){const{url:c,external:l,download:h}=ut(i,L,b.hash);if(l||h)continue;const u=J(i);u.reload||(u.preload_code===q.viewport&&n.observe(i),u.preload_code===q.eager&<(c))}}F.add(s),s()}function H(t,a){if(t instanceof wt)return t.body;const e=Et(t),r=ye(t);return b.hooks.handleError({error:t,event:a,status:e,message:r})??{message:r}}function Ce(t,a){Ee(()=>(t.add(a),()=>{t.delete(a)}))}function He(t){Ce(Bt,t)}function Ye(t,a={}){return t=new URL(mt(t)),t.origin!==Dt?Promise.reject(new Error("goto: invalid URL")):Jt(t,a,0)}function je(t){if(typeof t=="function")Z.push(t);else{const{href:a}=new URL(t,location.href);Z.push(e=>e.href===a)}}function Ne(){var a;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(jt(),!V){const n=Ut(m,void 0,null,"leave"),o={...n.navigation,cancel:()=>{r=!0,n.reject(new Error("navigation cancelled"))}};zt.forEach(s=>s(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&jt()}),(a=navigator.connection)!=null&&a.saveData||Oe(),U.addEventListener("click",async e=>{if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Nt(e.composedPath()[0],U);if(!r)return;const{url:n,external:o,target:s,download:i}=ut(r,L,b.hash);if(!n)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=J(r);if(!(r instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[h,u]=(b.hash?n.hash.replace(/^#/,""):n.href).split("#"),w=h===it(location);if(o||c.reload&&(!w||!u)){Zt({url:n,type:"link",event:e})?V=!0:e.preventDefault();return}if(u!==void 0&&w){const[,f]=m.url.href.split("#");if(f===u){if(e.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(K=!0,bt(E),t(n),!c.replace_state)return;K=!1}e.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await D({type:"link",url:n,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??n.href===location.href,event:e})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if(((n==null?void 0:n.formTarget)||r.target)==="_blank"||((n==null?void 0:n.formMethod)||r.method)!=="get")return;const i=new URL((n==null?void 0:n.hasAttribute("formaction"))&&(n==null?void 0:n.formAction)||r.action);if(_t(i,L,!1))return;const c=e.target,l=J(c);if(l.reload)return;e.preventDefault(),e.stopPropagation();const h=new FormData(c,n);i.search=new URLSearchParams(h).toString(),D({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:e})}),addEventListener("popstate",async e=>{var r;if(!gt){if((r=e.state)!=null&&r[$]){const n=e.state[$];if(O={},n===E)return;const o=I[n],s=e.state[$t]??{},i=new URL(e.state[re]??location.href),c=e.state[M],l=m.url?it(location)===it(m.url):!1;if(c===R&&(Ht||l)){s!==x.state&&(x.state=s),t(i),I[E]=C(),o&&scrollTo(o.x,o.y),E=n;return}const u=n-E;await D({type:"popstate",url:i,popped:{state:s,scroll:o,delta:u},accept:()=>{E=n,R=c},block:()=>{history.go(-u)},nav_token:O,event:e})}else if(!K){const n=new URL(location.href);t(n),b.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[$]:++E,[M]:R},"",location.href))});for(const e of document.querySelectorAll("link"))be.has(e.rel)&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&P.navigating.set(ft.current=null)});function t(e){m.url=x.url=e,P.page.set(At(x)),P.page.notify()}}async function $e(t,{status:a=200,error:e,node_ids:r,params:n,route:o,server_route:s,data:i,form:c}){Vt=!0;const l=new URL(location.href);let h;({params:n={},route:o={id:null}}=await ot(l,!1)||{}),h=kt.find(({id:f})=>f===o.id);let u,w=!0;try{const f=r.map(async(_,g)=>{const p=i[g];return p!=null&&p.uses&&(p.uses=De(p.uses)),Rt({loader:b.nodes[_],url:l,params:n,route:o,parent:async()=>{const y={};for(let S=0;S{const i=history.state;gt=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(i,"",t),a&&scrollTo(o,s),gt=!1})}else{const o=document.body,s=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),s!==null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex")}const n=getSelection();if(n&&n.type!=="None"){const o=[];for(let s=0;s{if(n.rangeCount===o.length){for(let s=0;s{o=u,s=w});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:t.url,scroll:C()},to:e&&{params:(a==null?void 0:a.params)??null,route:{id:((h=a==null?void 0:a.route)==null?void 0:h.id)??null},url:e,scroll:n},willUnload:!a,type:r,complete:i},fulfil:o,reject:s}}function At(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function Ke(t){const a=new URL(t);return a.hash=decodeURIComponent(t.hash),a}function ee(t){let a;if(b.hash){const[,,e]=t.hash.split("#",3);a=e??""}else a=t.hash.slice(1);return decodeURIComponent(a)}export{Ve as a,Ye as g,He as o,P as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js.br b/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js.br new file mode 100644 index 0000000..23bea56 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js.gz b/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js.gz new file mode 100644 index 0000000..9d6bf41 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/Dm3aSj4w.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js.br b/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js.br deleted file mode 100644 index a9014f7..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js.gz b/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js.gz deleted file mode 100644 index 25caa92..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DrafHjYM.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js b/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js similarity index 98% rename from apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js rename to apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js index c7c6805..bf58ae0 100644 --- a/apps/dashboard/build/_app/immutable/chunks/C8kRUgax.js +++ b/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js @@ -1 +1 @@ -var du=Object.defineProperty;var hu=(E,i,r)=>i in E?du(E,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):E[i]=r;var o=(E,i,r)=>hu(E,typeof i!="symbol"?i+"":i,r);import{StorageBufferAttribute as It,SpriteNodeMaterial as ru}from"./CfobEeQC.js";import{uniform as h,storage as lt,Fn as R,instanceIndex as W,fract as T,float as t,mx_noise_vec3 as X,vec3 as u,sin as m,cos as b,sqrt as Rt,floor as nt,pow as H,abs as et,clamp as C,vec2 as y,smoothstep as mt,oneMinus as at,mix as M,select as n,cross as is,length as $,min as vu,atan as cs,positionView as bu}from"./BZQzXWp7.js";import{V as ds,A as pu,P as gu,I as fu}from"./C-SOZ1Oi.js";const xu={anchor:0,connection:1,contradiction:2};class Bu{constructor(i,r,g={}){o(this,"count");o(this,"scene");o(this,"renderer");o(this,"bufferPos");o(this,"bufferVel");o(this,"bufferPhase");o(this,"computeNode");o(this,"mesh",null);o(this,"material",null);o(this,"computeInFlight",null);o(this,"uTarget",h(new ds(0,0,0)));o(this,"uTime",h(0));o(this,"uIgnition",h(.2));o(this,"uMode",h(0));o(this,"uContainRadius",h(48));o(this,"uHueShift",h(0));o(this,"uModeTintAmt",h(.25));o(this,"uBurst",h(0));o(this,"uActDim",h(.12));o(this,"uWorld",h(0));o(this,"uPrevWorld",h(0));o(this,"uBlend",h(0));o(this,"worldCount",7);o(this,"uBlast",h(0));o(this,"uBlastTime",h(0));o(this,"uMorphSeed",h(0));o(this,"uChaos",h(0));o(this,"uClash",h(0));o(this,"uFadeNear",h(2));o(this,"uFadeBand",h(7));o(this,"uFogDensity",h(.012));o(this,"uFocus",h(28));o(this,"uFocusRange",h(20));o(this,"uDofDim",h(.3));o(this,"uZoomPeriod",h(9));o(this,"uLambda",h(1.923));o(this,"uZoomOn",h(0));o(this,"uCamVelView",h(new ds(0,0,0)));o(this,"uStreak",h(0));o(this,"uMaxStretch",h(7));o(this,"dreamCount",0);this.renderer=i,this.scene=r,this.count=g.count??15e4;const f=g.spawnRadius??34,q=new Float32Array(this.count*3),D=new Float32Array(this.count*3),c=new Float32Array(this.count);for(let S=0;S{const c=f.element(W),p=q.element(W),B=D.element(W),P=B.mul(12.9898).sin().mul(43758.5453),S=B.mul(78.233).sin().mul(12543.531),L=B.mul(39.346).sin().mul(24634.633),O=T(P),V=T(S),a=T(L),l=O.mul(6.28318),d=V.mul(3.14159),e=this.uContainRadius,w=T(B.mul(3.7)),z=t(.62).add(w.mul(w).mul(.38)),A=t(W),v=R(([s])=>{const x=t(.6),es=X(s.add(u(x,0,0))).sub(X(s.sub(u(x,0,0)))),ms=X(s.add(u(0,x,0))).sub(X(s.sub(u(0,x,0)))),as=X(s.add(u(0,0,x))).sub(X(s.sub(u(0,0,x))));return u(ms.z.sub(as.y),as.x.sub(es.z),es.y.sub(ms.x)).normalize()}),F=u(m(d).mul(b(l)),b(d),m(d).mul(m(l))),G=F.mul(e.mul(z)),tt=F.mul(e.mul(t(.5).add(w.mul(.3)))),N=t(.19),Z=u(m(c.y).sub(c.x.mul(N)),m(c.z).sub(c.y.mul(N)),m(c.x).sub(c.z.mul(N))),_=c.add(Z.mul(e.mul(.12))),j=G,st=u(O.sub(.5).mul(2).mul(e.mul(.8)),V.sub(.5).mul(2).mul(e.mul(.8)),a.sub(.5).mul(2).mul(e.mul(.8))),K=O.mul(6.28318).mul(3).add(a.mul(.6)),it=e.mul(.2).add(e.mul(.8).mul(a)),hs=u(it.mul(b(K)),e.mul(.06).mul(m(B.mul(20))),it.mul(m(K))),rs=t(2.39996323),Wt=A.mul(rs),Dt=Rt(A).mul(e.mul(.0042)),vs=u(Wt.cos().mul(Dt),e.mul(.04).mul(m(B.mul(9))),Wt.sin().mul(Dt)),Y=this.uMorphSeed,xt=this.uChaos,bs=T(Y.mul(.731).add(.13)),ps=T(Y.mul(1.323).add(.51)),gs=T(Y.mul(2.117).add(.27)),yt=t(387),J=T(A.div(yt)),k=nt(A.div(yt)).div(yt),Vt=s=>s.exp().sub(s.mul(-1).exp()).mul(.5),Zt=s=>s.exp().add(s.mul(-1).exp()).mul(.5),I=(s,x)=>y(s.x.mul(x.x).sub(s.y.mul(x.y)),s.x.mul(x.y).add(s.y.mul(x.x))),wt=s=>{const x=s.x.exp();return y(x.mul(b(s.y)),x.mul(m(s.y)))},fs=s=>y(s.x.mul(s.x).add(s.y.mul(s.y)).max(1e-12).log().mul(.5),cs(s.y,s.x)),Ot=(s,x)=>wt(I(y(x,t(0)),fs(s))),xs=s=>y(Zt(s.x).mul(b(s.y)),Vt(s.x).mul(m(s.y))),ys=s=>y(Vt(s.x).mul(b(s.y)),Zt(s.x).mul(m(s.y))),Mt=s=>{const x=s.x.mul(s.x).add(s.y.mul(s.y)).max(1e-6);return y(s.x.div(x),s.y.mul(-1).div(x))},ct=t(2).add(nt(bs.mul(14))),Nt=l,ws=H(et(b(ct.mul(Nt).div(4))),t(2).add(ps.mul(8))).add(H(et(m(ct.mul(Nt).div(4))),t(2).add(gs.mul(8)))).add(1e-4).pow(t(-.5)),Ms=H(et(b(ct.mul(d).div(4))),t(3)).add(H(et(m(ct.mul(d).div(4))),t(3))).add(1e-4).pow(t(-.5)),Tt=e.mul(.85).mul(C(ws.mul(Ms).mul(.5),.1,1.4)),Ts=u(m(d).mul(b(l)).mul(Tt),b(d).mul(Tt),m(d).mul(m(l)).mul(Tt)),kt=t(5),Ht=nt(T(Y.mul(.013).add(A.mul(.00667))).mul(25)),Et=nt(Ht.div(5)),qs=Ht.sub(Et.mul(5)),Cs=J.mul(2).sub(1),Bs=k.mul(1.5708),Lt=y(Cs,Bs),As=wt(y(t(0),Et.mul(6.28318).div(kt))),zs=wt(y(t(0),qs.mul(6.28318).div(kt))),Gt=I(As,Ot(xs(Lt),t(.4))),_t=I(zs,Ot(ys(Lt),t(.4))),jt=this.uTime.mul(.25).add(Y).add(xt.mul(1.5)),Ss=u(Gt.x,_t.x,b(jt).mul(Gt.y).add(m(jt).mul(_t.y))).mul(e.mul(.55)),Kt=Rt(J),Yt=k.mul(6.28318),qt=y(Kt.mul(b(Yt)),Kt.mul(m(Yt))),Q=I(qt,qt),ut=I(Q,qt),dt=Mt(Q),ht=Mt(ut),Ps=y(ut.x.sub(ht.x).add(2.2360679),ut.y.sub(ht.y)),Ct=Mt(Ps),Fs=I(y(t(0),t(1)),y(Q.x.sub(dt.x),Q.y.sub(dt.y))),Is=y(Q.x.add(dt.x),Q.y.add(dt.y)),Rs=I(y(t(0),t(.6667)),y(ut.x.add(ht.x),ut.y.add(ht.y))),Bt=I(Ct,Fs).x,At=I(Ct,Is).x,zt=I(Ct,Rs).x.add(.5),St=Bt.mul(Bt).add(At.mul(At)).add(zt.mul(zt)).max(1e-4),Ws=u(Bt.div(St),At.div(St),zt.div(St).sub(.86)).mul(e.mul(.5)),rt=k.mul(2).sub(1),Jt=Rt(t(1).sub(rt.mul(rt)).max(0)).mul(.9).add(.25),Qt=J.mul(6.28318).add(rt.mul(6).mul(xt.add(.4))),Ds=u(Jt.mul(b(Qt)),rt.mul(1.4),Jt.mul(m(Qt))).mul(e.mul(.5)),Ut=t(2.2).add(xt.mul(2)),vt=J.mul(6.28318).mul(Ut),bt=k.mul(6.28318).mul(Ut),pt=this.uTime.mul(.3).add(Y.mul(6.28318)),Vs=m(vt).mul(b(bt)).add(m(bt).mul(b(pt))).add(m(pt).mul(b(vt))),Zs=b(vt).mul(b(bt)).mul(b(pt)).sub(m(vt).mul(m(bt)).mul(m(pt))),Xt=this.uTime.mul(.15),Os=b(Xt).mul(Vs).add(m(Xt).mul(Zs)),Ns=u(m(k.mul(3.14159)).mul(b(J.mul(6.28318))),b(k.mul(3.14159)),m(k.mul(3.14159)).mul(m(J.mul(6.28318)))).mul(e.mul(.5).add(Os.mul(e.mul(.12)))),Pt=s=>n(s.equal(0),G,n(s.equal(1),tt,n(s.equal(2),_,n(s.equal(3),j,n(s.equal(4),st,n(s.equal(5),hs,n(s.equal(6),vs,n(s.equal(7),Ts,n(s.equal(8),Ss,n(s.equal(9),Ws,n(s.equal(10),Ds,Ns))))))))))),ks=Pt(t(this.uWorld)),Hs=Pt(t(this.uPrevWorld)),Es=mt(t(0),t(1),at(this.uBlend)),Ls=M(Hs,ks,Es),Gs=T(A.mul(.001).add(.5)).greaterThan(.66),Ft=t(this.uWorld).add(5),_s=n(Ft.greaterThan(11),Ft.sub(12),Ft),ot=Pt(_s),$t=this.uTime.mul(.4),ts=b($t),ss=m($t),js=u(ot.x.mul(ts).sub(ot.z.mul(ss)),ot.y,ot.x.mul(ss).add(ot.z.mul(ts))).mul(.52),Ks=this.uTime.div(this.uZoomPeriod).fract(),Ys=this.uTime.div(this.uZoomPeriod).add(.5).fract(),Js=M(t(1),this.uLambda.pow(Ks),this.uZoomOn),Qs=M(t(1),this.uLambda.pow(Ys),this.uZoomOn),Us=Ls.mul(Js),Xs=js.mul(Qs.mul(this.uLambda)),us=M(Us,Xs,Gs.select(t(1),t(0))),$s=c.normalize(),tu=at(T(B.mul(7.3)).mul(.4));p.addAssign($s.mul(this.uBurst.mul(.95).mul(tu))),p.addAssign(us.sub(c).mul(.045));const su=v(c.mul(.045).add(u(0,this.uTime.mul(.2),0))),uu=n(this.uWorld.equal(0),t(.05),n(this.uWorld.equal(5),t(.06),t(0)));p.addAssign(su.mul(uu)),p.addAssign(is(u(0,1,0),c).mul(9e-4).mul(n(this.uWorld.equal(1),t(1),t(0)))),p.addAssign(Z.mul(.012).mul(n(this.uWorld.equal(2),t(1),t(0))));const gt=c.x.div(e.mul(.5)),ft=c.y.div(e.mul(.5)),U=c.z.div(e.mul(.5)),ou=u(U.sub(.7).mul(gt).sub(ft.mul(3.5)),gt.mul(3.5).add(U.sub(.7).mul(ft)),t(.6).add(U.mul(.95)).sub(U.mul(U).mul(U).div(3)).sub(gt.mul(gt).add(ft.mul(ft))));p.addAssign(ou.mul(.008).mul(n(this.uWorld.equal(10),t(1),t(0)))),p.addAssign(is(u(0,1,0),c).mul(.0016).mul(n(this.uWorld.equal(5),t(1),t(0))));const lu=us.normalize().mul(m(this.uTime.mul(1.3).add(B.mul(6.1))).mul(.015));p.addAssign(lu);const os=$(p),nu=t(1.3);p.assign(p.mul(vu(nu,os).div(os.max(1e-4)))),c.addAssign(p),p.mulAssign(.9);const eu=n(this.uWorld.equal(4),t(1.6),t(1)),ls=M(t(.55),t(6),C(this.uBurst,0,1)),mu=nt(c.div(ls)).add(.5).mul(ls),au=C(at(this.uBurst.mul(1.4)),0,.9).mul(eu).min(.9);c.assign(M(c,mu,au));const iu=$(c),ns=this.uContainRadius,cu=c.normalize().mul(ns);c.assign(M(c,cu,iu.greaterThan(ns).select(t(1),t(0))))})().compute(this.count)}buildRender(i,r){const g=new ru({transparent:!0,blending:pu,depthWrite:!1}),f=lt(r,"float",this.count),q=lt(i,"vec3",this.count).element(W);g.positionNode=q;const D=g;{const a=u(this.uCamVelView),l=y(a.x,a.y),d=$(l).max(1e-4),e=T(f.element(W).mul(13.17)).mul(.5).add(.75);D.rotationNode=cs(l.y,l.x);const w=C(d.mul(this.uStreak).mul(e).mul(.6).add(1),t(1),this.uMaxStretch),z=t(1);D.scaleNode=y(z.mul(w),z)}const c=R(([a,l,d,e,w])=>l.add(d.mul(b(e.mul(a).add(w).mul(6.28318))))),p=R(([a])=>{const l=a.div(100),d=H(l.sub(60).max(1e-4),t(-.1332047592)).mul(329.698727446),e=l.lessThanEqual(66).select(t(255),d),w=l.max(1e-4).log().mul(99.4708025861).sub(161.1195681661),z=H(l.sub(60).max(1e-4),t(-.0755148492)).mul(288.1221695283),A=l.lessThanEqual(66).select(w,z),v=l.sub(10).max(1e-4).log().mul(138.5177312231).sub(305.0447927307),F=l.greaterThanEqual(66).select(t(255),l.lessThanEqual(19).select(t(0),v));return C(u(e,A,F).div(255),0,1)}),B=R(()=>{const a=q,l=f.element(W),d=$(a.sub(u(this.uTarget))),e=t(W),w=T(e.mul(.001).add(.5)).greaterThan(.66),z=a.x.mul(.03).add(a.y.mul(.021)).add(a.z.mul(.027)),A=T(l.mul(.41).add(d.mul(.06)).add(z).add(this.uTime.mul(.1)).add(this.uHueShift)),v=this.uClash,F=n(v.equal(0),u(0,.85,1),n(v.equal(1),u(.55,1,0),n(v.equal(2),u(1,.82,0),n(v.equal(3),u(0,1,.6),u(.1,.5,1))))),G=n(v.equal(0),u(.3,.2,1),n(v.equal(1),u(0,.7,.5),n(v.equal(2),u(1,.4,0),n(v.equal(3),u(0,.6,1),u(.5,0,1))))),tt=n(v.equal(0),u(1,.25,0),n(v.equal(1),u(1,0,.55),n(v.equal(2),u(.6,0,1),n(v.equal(3),u(1,.1,.3),u(1,.7,0))))),N=n(v.equal(0),u(1,0,.3),n(v.equal(1),u(1,.45,0),n(v.equal(2),u(1,0,.7),n(v.equal(3),u(1,.5,0),u(1,.2,.4))))),Z=mt(t(0),t(1),A),_=M(F,G,Z),j=M(tt,N,Z),st=M(_,j,w.select(t(1),t(0))),K=n(this.uMode.equal(2),u(1,.08,.32),n(this.uMode.equal(3),u(1,.78,.1),u(.1,.9,1)));return M(st,K,this.uModeTintAmt.mul(.4))}),P=R(()=>{const a=q,l=C($(a).div(this.uContainRadius.max(1e-4)),0,1),d=l.mul(l),e=a.normalize(),w=H(at(et(e.z)),t(4)),z=t(.12).add(d.mul(.6)).add(w.mul(.5)),A=t(W),v=T(A.mul(.001).add(.5)).greaterThan(.66),F=t(.07).add(w.mul(.3)),G=v.select(F,z),tt=this.uTime.div(this.uZoomPeriod).fract(),N=this.uTime.div(this.uZoomPeriod).add(.5).fract(),Z=m(tt.mul(3.14159)),_=m(N.mul(3.14159)),j=Z.add(_).max(1e-4),st=M(t(1),Z.div(j).mul(2).min(1),this.uZoomOn),K=M(t(1),_.div(j).mul(2).min(1),this.uZoomOn),it=v.select(K,st);return G.mul(it)}),S=R(()=>{const a=bu.z.negate(),l=mt(this.uFadeNear,this.uFadeNear.add(this.uFadeBand),a),d=C(this.uFogDensity.mul(a).negate().exp(),.45,1),e=C(a.sub(this.uFocus).abs().div(this.uFocusRange),0,1),w=at(e.mul(this.uDofDim));return l.mul(d).mul(w)}),L=R(()=>{const a=q,l=C(this.uBlast,0,1),d=this.uBlastTime,e=C($(a).div(this.uContainRadius.max(1e-4)),0,1),w=M(t(1600),t(5200),l),z=C(l.mul(1.1).add(.4),0,1.3),A=p(w).mul(z),v=T(e.mul(1.6).sub(d.mul(1.5))),F=c(v,u(.55),u(.55),u(3),u(0,.33,.67));return M(A,F,t(.78))});g.colorNode=R(()=>{const a=C(this.uIgnition.mul(.05).add(.72),0,1.25),l=B().mul(a).mul(P()).mul(this.uActDim),d=mt(t(0),t(.85),C(this.uBlast,0,1)).mul(.6);return M(l,L().mul(P()).mul(this.uActDim),d).mul(S())})(),g.emissiveNode=R(()=>{const a=C(this.uIgnition.mul(.04).add(.85),0,1.35),l=B().mul(a).mul(P()).mul(this.uActDim),d=mt(t(0),t(.85),C(this.uBlast,0,1)).mul(.6);return M(l,L().mul(.85).mul(P()).mul(this.uActDim),d).mul(S())})();const O=new gu(.1,.1),V=new fu(O,g,this.count);V.frustumCulled=!1,this.material=g,this.mesh=V,this.scene.add(this.mesh)}async update(i){const r=Math.max(0,Math.min(i,.05));this.uTime.value+=r,this.uHueShift.value=(this.uHueShift.value+r*.06)%1,this.uBlend.value=Math.max(0,this.uBlend.value-r*1),this.uIgnition.value=Math.max(0,this.uIgnition.value-r*2),this.uBurst.value=Math.max(0,this.uBurst.value-r*.85),this.uBlast.value=Math.max(0,this.uBlast.value-r*.35),this.uBlastTime.value+=r;const g=this.uTime.value/this.uZoomPeriod.value%1,f=this.uZoomOn.value>.5?40-g*16:26+Math.sin(this.uTime.value*.18)*9;this.uFocus.value+=(f-this.uFocus.value)*Math.min(1,r*3),this.computeInFlight&&await this.computeInFlight,this.computeInFlight=this.renderer.computeAsync(this.computeNode).finally(()=>{this.computeInFlight=null}),await this.computeInFlight}transitionTo(i,r,g="II",f=99){this.uTarget.value.copy(r);const q=xu[i]??1;this.uMode.value=q,this.uPrevWorld.value=this.uWorld.value,this.uWorld.value=f%this.worldCount,this.uBlend.value=1,this.uClash.value=f%5,this.uZoomOn.value=f>=2?1:0;const D=f===0?.12:f===1?.2:null,c=g==="I"?.26:1;this.uActDim.value=D??c,this.uIgnition.value=f<=1?.4:g==="I"?1.6:4.5;const p=this.uWorld.value===3;this.uBurst.value=q===2||p?1:.8,this.uBlast.value=f<=1?.25:1,this.uBlastTime.value=0,this.uModeTintAmt.value=q>=2?.7:.22}dreamBeat(){this.dreamCount+=1;const i=7+Math.floor(Math.random()*5);this.uPrevWorld.value=this.uWorld.value,this.uWorld.value=i,this.uBlend.value=1,this.uMorphSeed.value=Math.random()*1e3,this.uClash.value=Math.floor(Math.random()*5),this.uChaos.value=Math.min(1,.25+this.dreamCount*.1),this.uZoomOn.value=1,this.uActDim.value=.85,this.uIgnition.value=3,this.uBurst.value=1,this.uBlast.value=1,this.uBlastTime.value=0;const r=[1,2,3];this.uMode.value=r[Math.floor(Math.random()*r.length)],this.uModeTintAmt.value=.3+Math.random()*.5}setContainRadius(i){this.uContainRadius.value=Math.max(8,i)}setZoom(i){this.uZoomOn.value=i?1:0}setCameraVel(i){this.uCamVelView.value.copy(i)}setStreak(i){this.uStreak.value=i}dispose(){var i,r,g,f;this.mesh&&(this.scene.remove(this.mesh),(i=this.mesh.geometry)==null||i.dispose(),(g=(r=this.mesh).dispose)==null||g.call(r),this.mesh=null),(f=this.material)==null||f.dispose(),this.material=null,this.bufferPos=null,this.bufferVel=null,this.bufferPhase=null}}export{Bu as SemanticComputeStorm}; +var du=Object.defineProperty;var hu=(E,i,r)=>i in E?du(E,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):E[i]=r;var o=(E,i,r)=>hu(E,typeof i!="symbol"?i+"":i,r);import{StorageBufferAttribute as It,SpriteNodeMaterial as ru}from"./DD4_gMN2.js";import{uniform as h,storage as lt,Fn as R,instanceIndex as W,fract as T,float as t,mx_noise_vec3 as X,vec3 as u,sin as m,cos as b,sqrt as Rt,floor as nt,pow as H,abs as et,clamp as C,vec2 as y,smoothstep as mt,oneMinus as at,mix as M,select as n,cross as is,length as $,min as vu,atan as cs,positionView as bu}from"./CjKwt1b1.js";import{V as ds,A as pu,P as gu,I as fu}from"./DSmtfx7F.js";const xu={anchor:0,connection:1,contradiction:2};class Bu{constructor(i,r,g={}){o(this,"count");o(this,"scene");o(this,"renderer");o(this,"bufferPos");o(this,"bufferVel");o(this,"bufferPhase");o(this,"computeNode");o(this,"mesh",null);o(this,"material",null);o(this,"computeInFlight",null);o(this,"uTarget",h(new ds(0,0,0)));o(this,"uTime",h(0));o(this,"uIgnition",h(.2));o(this,"uMode",h(0));o(this,"uContainRadius",h(48));o(this,"uHueShift",h(0));o(this,"uModeTintAmt",h(.25));o(this,"uBurst",h(0));o(this,"uActDim",h(.12));o(this,"uWorld",h(0));o(this,"uPrevWorld",h(0));o(this,"uBlend",h(0));o(this,"worldCount",7);o(this,"uBlast",h(0));o(this,"uBlastTime",h(0));o(this,"uMorphSeed",h(0));o(this,"uChaos",h(0));o(this,"uClash",h(0));o(this,"uFadeNear",h(2));o(this,"uFadeBand",h(7));o(this,"uFogDensity",h(.012));o(this,"uFocus",h(28));o(this,"uFocusRange",h(20));o(this,"uDofDim",h(.3));o(this,"uZoomPeriod",h(9));o(this,"uLambda",h(1.923));o(this,"uZoomOn",h(0));o(this,"uCamVelView",h(new ds(0,0,0)));o(this,"uStreak",h(0));o(this,"uMaxStretch",h(7));o(this,"dreamCount",0);this.renderer=i,this.scene=r,this.count=g.count??15e4;const f=g.spawnRadius??34,q=new Float32Array(this.count*3),D=new Float32Array(this.count*3),c=new Float32Array(this.count);for(let S=0;S{const c=f.element(W),p=q.element(W),B=D.element(W),P=B.mul(12.9898).sin().mul(43758.5453),S=B.mul(78.233).sin().mul(12543.531),L=B.mul(39.346).sin().mul(24634.633),O=T(P),V=T(S),a=T(L),l=O.mul(6.28318),d=V.mul(3.14159),e=this.uContainRadius,w=T(B.mul(3.7)),z=t(.62).add(w.mul(w).mul(.38)),A=t(W),v=R(([s])=>{const x=t(.6),es=X(s.add(u(x,0,0))).sub(X(s.sub(u(x,0,0)))),ms=X(s.add(u(0,x,0))).sub(X(s.sub(u(0,x,0)))),as=X(s.add(u(0,0,x))).sub(X(s.sub(u(0,0,x))));return u(ms.z.sub(as.y),as.x.sub(es.z),es.y.sub(ms.x)).normalize()}),F=u(m(d).mul(b(l)),b(d),m(d).mul(m(l))),G=F.mul(e.mul(z)),tt=F.mul(e.mul(t(.5).add(w.mul(.3)))),N=t(.19),Z=u(m(c.y).sub(c.x.mul(N)),m(c.z).sub(c.y.mul(N)),m(c.x).sub(c.z.mul(N))),_=c.add(Z.mul(e.mul(.12))),j=G,st=u(O.sub(.5).mul(2).mul(e.mul(.8)),V.sub(.5).mul(2).mul(e.mul(.8)),a.sub(.5).mul(2).mul(e.mul(.8))),K=O.mul(6.28318).mul(3).add(a.mul(.6)),it=e.mul(.2).add(e.mul(.8).mul(a)),hs=u(it.mul(b(K)),e.mul(.06).mul(m(B.mul(20))),it.mul(m(K))),rs=t(2.39996323),Wt=A.mul(rs),Dt=Rt(A).mul(e.mul(.0042)),vs=u(Wt.cos().mul(Dt),e.mul(.04).mul(m(B.mul(9))),Wt.sin().mul(Dt)),Y=this.uMorphSeed,xt=this.uChaos,bs=T(Y.mul(.731).add(.13)),ps=T(Y.mul(1.323).add(.51)),gs=T(Y.mul(2.117).add(.27)),yt=t(387),J=T(A.div(yt)),k=nt(A.div(yt)).div(yt),Vt=s=>s.exp().sub(s.mul(-1).exp()).mul(.5),Zt=s=>s.exp().add(s.mul(-1).exp()).mul(.5),I=(s,x)=>y(s.x.mul(x.x).sub(s.y.mul(x.y)),s.x.mul(x.y).add(s.y.mul(x.x))),wt=s=>{const x=s.x.exp();return y(x.mul(b(s.y)),x.mul(m(s.y)))},fs=s=>y(s.x.mul(s.x).add(s.y.mul(s.y)).max(1e-12).log().mul(.5),cs(s.y,s.x)),Ot=(s,x)=>wt(I(y(x,t(0)),fs(s))),xs=s=>y(Zt(s.x).mul(b(s.y)),Vt(s.x).mul(m(s.y))),ys=s=>y(Vt(s.x).mul(b(s.y)),Zt(s.x).mul(m(s.y))),Mt=s=>{const x=s.x.mul(s.x).add(s.y.mul(s.y)).max(1e-6);return y(s.x.div(x),s.y.mul(-1).div(x))},ct=t(2).add(nt(bs.mul(14))),Nt=l,ws=H(et(b(ct.mul(Nt).div(4))),t(2).add(ps.mul(8))).add(H(et(m(ct.mul(Nt).div(4))),t(2).add(gs.mul(8)))).add(1e-4).pow(t(-.5)),Ms=H(et(b(ct.mul(d).div(4))),t(3)).add(H(et(m(ct.mul(d).div(4))),t(3))).add(1e-4).pow(t(-.5)),Tt=e.mul(.85).mul(C(ws.mul(Ms).mul(.5),.1,1.4)),Ts=u(m(d).mul(b(l)).mul(Tt),b(d).mul(Tt),m(d).mul(m(l)).mul(Tt)),kt=t(5),Ht=nt(T(Y.mul(.013).add(A.mul(.00667))).mul(25)),Et=nt(Ht.div(5)),qs=Ht.sub(Et.mul(5)),Cs=J.mul(2).sub(1),Bs=k.mul(1.5708),Lt=y(Cs,Bs),As=wt(y(t(0),Et.mul(6.28318).div(kt))),zs=wt(y(t(0),qs.mul(6.28318).div(kt))),Gt=I(As,Ot(xs(Lt),t(.4))),_t=I(zs,Ot(ys(Lt),t(.4))),jt=this.uTime.mul(.25).add(Y).add(xt.mul(1.5)),Ss=u(Gt.x,_t.x,b(jt).mul(Gt.y).add(m(jt).mul(_t.y))).mul(e.mul(.55)),Kt=Rt(J),Yt=k.mul(6.28318),qt=y(Kt.mul(b(Yt)),Kt.mul(m(Yt))),Q=I(qt,qt),ut=I(Q,qt),dt=Mt(Q),ht=Mt(ut),Ps=y(ut.x.sub(ht.x).add(2.2360679),ut.y.sub(ht.y)),Ct=Mt(Ps),Fs=I(y(t(0),t(1)),y(Q.x.sub(dt.x),Q.y.sub(dt.y))),Is=y(Q.x.add(dt.x),Q.y.add(dt.y)),Rs=I(y(t(0),t(.6667)),y(ut.x.add(ht.x),ut.y.add(ht.y))),Bt=I(Ct,Fs).x,At=I(Ct,Is).x,zt=I(Ct,Rs).x.add(.5),St=Bt.mul(Bt).add(At.mul(At)).add(zt.mul(zt)).max(1e-4),Ws=u(Bt.div(St),At.div(St),zt.div(St).sub(.86)).mul(e.mul(.5)),rt=k.mul(2).sub(1),Jt=Rt(t(1).sub(rt.mul(rt)).max(0)).mul(.9).add(.25),Qt=J.mul(6.28318).add(rt.mul(6).mul(xt.add(.4))),Ds=u(Jt.mul(b(Qt)),rt.mul(1.4),Jt.mul(m(Qt))).mul(e.mul(.5)),Ut=t(2.2).add(xt.mul(2)),vt=J.mul(6.28318).mul(Ut),bt=k.mul(6.28318).mul(Ut),pt=this.uTime.mul(.3).add(Y.mul(6.28318)),Vs=m(vt).mul(b(bt)).add(m(bt).mul(b(pt))).add(m(pt).mul(b(vt))),Zs=b(vt).mul(b(bt)).mul(b(pt)).sub(m(vt).mul(m(bt)).mul(m(pt))),Xt=this.uTime.mul(.15),Os=b(Xt).mul(Vs).add(m(Xt).mul(Zs)),Ns=u(m(k.mul(3.14159)).mul(b(J.mul(6.28318))),b(k.mul(3.14159)),m(k.mul(3.14159)).mul(m(J.mul(6.28318)))).mul(e.mul(.5).add(Os.mul(e.mul(.12)))),Pt=s=>n(s.equal(0),G,n(s.equal(1),tt,n(s.equal(2),_,n(s.equal(3),j,n(s.equal(4),st,n(s.equal(5),hs,n(s.equal(6),vs,n(s.equal(7),Ts,n(s.equal(8),Ss,n(s.equal(9),Ws,n(s.equal(10),Ds,Ns))))))))))),ks=Pt(t(this.uWorld)),Hs=Pt(t(this.uPrevWorld)),Es=mt(t(0),t(1),at(this.uBlend)),Ls=M(Hs,ks,Es),Gs=T(A.mul(.001).add(.5)).greaterThan(.66),Ft=t(this.uWorld).add(5),_s=n(Ft.greaterThan(11),Ft.sub(12),Ft),ot=Pt(_s),$t=this.uTime.mul(.4),ts=b($t),ss=m($t),js=u(ot.x.mul(ts).sub(ot.z.mul(ss)),ot.y,ot.x.mul(ss).add(ot.z.mul(ts))).mul(.52),Ks=this.uTime.div(this.uZoomPeriod).fract(),Ys=this.uTime.div(this.uZoomPeriod).add(.5).fract(),Js=M(t(1),this.uLambda.pow(Ks),this.uZoomOn),Qs=M(t(1),this.uLambda.pow(Ys),this.uZoomOn),Us=Ls.mul(Js),Xs=js.mul(Qs.mul(this.uLambda)),us=M(Us,Xs,Gs.select(t(1),t(0))),$s=c.normalize(),tu=at(T(B.mul(7.3)).mul(.4));p.addAssign($s.mul(this.uBurst.mul(.95).mul(tu))),p.addAssign(us.sub(c).mul(.045));const su=v(c.mul(.045).add(u(0,this.uTime.mul(.2),0))),uu=n(this.uWorld.equal(0),t(.05),n(this.uWorld.equal(5),t(.06),t(0)));p.addAssign(su.mul(uu)),p.addAssign(is(u(0,1,0),c).mul(9e-4).mul(n(this.uWorld.equal(1),t(1),t(0)))),p.addAssign(Z.mul(.012).mul(n(this.uWorld.equal(2),t(1),t(0))));const gt=c.x.div(e.mul(.5)),ft=c.y.div(e.mul(.5)),U=c.z.div(e.mul(.5)),ou=u(U.sub(.7).mul(gt).sub(ft.mul(3.5)),gt.mul(3.5).add(U.sub(.7).mul(ft)),t(.6).add(U.mul(.95)).sub(U.mul(U).mul(U).div(3)).sub(gt.mul(gt).add(ft.mul(ft))));p.addAssign(ou.mul(.008).mul(n(this.uWorld.equal(10),t(1),t(0)))),p.addAssign(is(u(0,1,0),c).mul(.0016).mul(n(this.uWorld.equal(5),t(1),t(0))));const lu=us.normalize().mul(m(this.uTime.mul(1.3).add(B.mul(6.1))).mul(.015));p.addAssign(lu);const os=$(p),nu=t(1.3);p.assign(p.mul(vu(nu,os).div(os.max(1e-4)))),c.addAssign(p),p.mulAssign(.9);const eu=n(this.uWorld.equal(4),t(1.6),t(1)),ls=M(t(.55),t(6),C(this.uBurst,0,1)),mu=nt(c.div(ls)).add(.5).mul(ls),au=C(at(this.uBurst.mul(1.4)),0,.9).mul(eu).min(.9);c.assign(M(c,mu,au));const iu=$(c),ns=this.uContainRadius,cu=c.normalize().mul(ns);c.assign(M(c,cu,iu.greaterThan(ns).select(t(1),t(0))))})().compute(this.count)}buildRender(i,r){const g=new ru({transparent:!0,blending:pu,depthWrite:!1}),f=lt(r,"float",this.count),q=lt(i,"vec3",this.count).element(W);g.positionNode=q;const D=g;{const a=u(this.uCamVelView),l=y(a.x,a.y),d=$(l).max(1e-4),e=T(f.element(W).mul(13.17)).mul(.5).add(.75);D.rotationNode=cs(l.y,l.x);const w=C(d.mul(this.uStreak).mul(e).mul(.6).add(1),t(1),this.uMaxStretch),z=t(1);D.scaleNode=y(z.mul(w),z)}const c=R(([a,l,d,e,w])=>l.add(d.mul(b(e.mul(a).add(w).mul(6.28318))))),p=R(([a])=>{const l=a.div(100),d=H(l.sub(60).max(1e-4),t(-.1332047592)).mul(329.698727446),e=l.lessThanEqual(66).select(t(255),d),w=l.max(1e-4).log().mul(99.4708025861).sub(161.1195681661),z=H(l.sub(60).max(1e-4),t(-.0755148492)).mul(288.1221695283),A=l.lessThanEqual(66).select(w,z),v=l.sub(10).max(1e-4).log().mul(138.5177312231).sub(305.0447927307),F=l.greaterThanEqual(66).select(t(255),l.lessThanEqual(19).select(t(0),v));return C(u(e,A,F).div(255),0,1)}),B=R(()=>{const a=q,l=f.element(W),d=$(a.sub(u(this.uTarget))),e=t(W),w=T(e.mul(.001).add(.5)).greaterThan(.66),z=a.x.mul(.03).add(a.y.mul(.021)).add(a.z.mul(.027)),A=T(l.mul(.41).add(d.mul(.06)).add(z).add(this.uTime.mul(.1)).add(this.uHueShift)),v=this.uClash,F=n(v.equal(0),u(0,.85,1),n(v.equal(1),u(.55,1,0),n(v.equal(2),u(1,.82,0),n(v.equal(3),u(0,1,.6),u(.1,.5,1))))),G=n(v.equal(0),u(.3,.2,1),n(v.equal(1),u(0,.7,.5),n(v.equal(2),u(1,.4,0),n(v.equal(3),u(0,.6,1),u(.5,0,1))))),tt=n(v.equal(0),u(1,.25,0),n(v.equal(1),u(1,0,.55),n(v.equal(2),u(.6,0,1),n(v.equal(3),u(1,.1,.3),u(1,.7,0))))),N=n(v.equal(0),u(1,0,.3),n(v.equal(1),u(1,.45,0),n(v.equal(2),u(1,0,.7),n(v.equal(3),u(1,.5,0),u(1,.2,.4))))),Z=mt(t(0),t(1),A),_=M(F,G,Z),j=M(tt,N,Z),st=M(_,j,w.select(t(1),t(0))),K=n(this.uMode.equal(2),u(1,.08,.32),n(this.uMode.equal(3),u(1,.78,.1),u(.1,.9,1)));return M(st,K,this.uModeTintAmt.mul(.4))}),P=R(()=>{const a=q,l=C($(a).div(this.uContainRadius.max(1e-4)),0,1),d=l.mul(l),e=a.normalize(),w=H(at(et(e.z)),t(4)),z=t(.12).add(d.mul(.6)).add(w.mul(.5)),A=t(W),v=T(A.mul(.001).add(.5)).greaterThan(.66),F=t(.07).add(w.mul(.3)),G=v.select(F,z),tt=this.uTime.div(this.uZoomPeriod).fract(),N=this.uTime.div(this.uZoomPeriod).add(.5).fract(),Z=m(tt.mul(3.14159)),_=m(N.mul(3.14159)),j=Z.add(_).max(1e-4),st=M(t(1),Z.div(j).mul(2).min(1),this.uZoomOn),K=M(t(1),_.div(j).mul(2).min(1),this.uZoomOn),it=v.select(K,st);return G.mul(it)}),S=R(()=>{const a=bu.z.negate(),l=mt(this.uFadeNear,this.uFadeNear.add(this.uFadeBand),a),d=C(this.uFogDensity.mul(a).negate().exp(),.45,1),e=C(a.sub(this.uFocus).abs().div(this.uFocusRange),0,1),w=at(e.mul(this.uDofDim));return l.mul(d).mul(w)}),L=R(()=>{const a=q,l=C(this.uBlast,0,1),d=this.uBlastTime,e=C($(a).div(this.uContainRadius.max(1e-4)),0,1),w=M(t(1600),t(5200),l),z=C(l.mul(1.1).add(.4),0,1.3),A=p(w).mul(z),v=T(e.mul(1.6).sub(d.mul(1.5))),F=c(v,u(.55),u(.55),u(3),u(0,.33,.67));return M(A,F,t(.78))});g.colorNode=R(()=>{const a=C(this.uIgnition.mul(.05).add(.72),0,1.25),l=B().mul(a).mul(P()).mul(this.uActDim),d=mt(t(0),t(.85),C(this.uBlast,0,1)).mul(.6);return M(l,L().mul(P()).mul(this.uActDim),d).mul(S())})(),g.emissiveNode=R(()=>{const a=C(this.uIgnition.mul(.04).add(.85),0,1.35),l=B().mul(a).mul(P()).mul(this.uActDim),d=mt(t(0),t(.85),C(this.uBlast,0,1)).mul(.6);return M(l,L().mul(.85).mul(P()).mul(this.uActDim),d).mul(S())})();const O=new gu(.1,.1),V=new fu(O,g,this.count);V.frustumCulled=!1,this.material=g,this.mesh=V,this.scene.add(this.mesh)}async update(i){const r=Math.max(0,Math.min(i,.05));this.uTime.value+=r,this.uHueShift.value=(this.uHueShift.value+r*.06)%1,this.uBlend.value=Math.max(0,this.uBlend.value-r*1),this.uIgnition.value=Math.max(0,this.uIgnition.value-r*2),this.uBurst.value=Math.max(0,this.uBurst.value-r*.85),this.uBlast.value=Math.max(0,this.uBlast.value-r*.35),this.uBlastTime.value+=r;const g=this.uTime.value/this.uZoomPeriod.value%1,f=this.uZoomOn.value>.5?40-g*16:26+Math.sin(this.uTime.value*.18)*9;this.uFocus.value+=(f-this.uFocus.value)*Math.min(1,r*3),this.computeInFlight&&await this.computeInFlight,this.computeInFlight=this.renderer.computeAsync(this.computeNode).finally(()=>{this.computeInFlight=null}),await this.computeInFlight}transitionTo(i,r,g="II",f=99){this.uTarget.value.copy(r);const q=xu[i]??1;this.uMode.value=q,this.uPrevWorld.value=this.uWorld.value,this.uWorld.value=f%this.worldCount,this.uBlend.value=1,this.uClash.value=f%5,this.uZoomOn.value=f>=2?1:0;const D=f===0?.12:f===1?.2:null,c=g==="I"?.26:1;this.uActDim.value=D??c,this.uIgnition.value=f<=1?.4:g==="I"?1.6:4.5;const p=this.uWorld.value===3;this.uBurst.value=q===2||p?1:.8,this.uBlast.value=f<=1?.25:1,this.uBlastTime.value=0,this.uModeTintAmt.value=q>=2?.7:.22}dreamBeat(){this.dreamCount+=1;const i=7+Math.floor(Math.random()*5);this.uPrevWorld.value=this.uWorld.value,this.uWorld.value=i,this.uBlend.value=1,this.uMorphSeed.value=Math.random()*1e3,this.uClash.value=Math.floor(Math.random()*5),this.uChaos.value=Math.min(1,.25+this.dreamCount*.1),this.uZoomOn.value=1,this.uActDim.value=.85,this.uIgnition.value=3,this.uBurst.value=1,this.uBlast.value=1,this.uBlastTime.value=0;const r=[1,2,3];this.uMode.value=r[Math.floor(Math.random()*r.length)],this.uModeTintAmt.value=.3+Math.random()*.5}setContainRadius(i){this.uContainRadius.value=Math.max(8,i)}setZoom(i){this.uZoomOn.value=i?1:0}setCameraVel(i){this.uCamVelView.value.copy(i)}setStreak(i){this.uStreak.value=i}dispose(){var i,r,g,f;this.mesh&&(this.scene.remove(this.mesh),(i=this.mesh.geometry)==null||i.dispose(),(g=(r=this.mesh).dispose)==null||g.call(r),this.mesh=null),(f=this.material)==null||f.dispose(),this.material=null,this.bufferPos=null,this.bufferVel=null,this.bufferPhase=null}}export{Bu as SemanticComputeStorm}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js.br b/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js.br new file mode 100644 index 0000000..5497482 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js.gz b/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js.gz new file mode 100644 index 0000000..cedc10b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DsCOn7XD.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js b/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js new file mode 100644 index 0000000..6035d7b --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DD4_gMN2.js","./DSmtfx7F.js","./Bzak7iHL.js","./JVtQszIZ.js","./CW7md74C.js","./D90q9c2i.js","./9-jplUL5.js","./DExHDOmW.js","./Cc0l8Nd4.js","./ChcFQRZo.js","./BjbQ7qSx.js","./C-rZhKee.js","./CaEJGM7b.js","./BNUnVJrY.js","./CcUbQ_Wl.js","../assets/ObservatoryStage.CnF5Ezel.css","./CjKwt1b1.js","./CRPZuD1T.js","./DsCOn7XD.js"])))=>i.map(i=>d[i]); +var x=Object.defineProperty;var C=(m,t,e)=>t in m?x(m,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[t]=e;var i=(m,t,e)=>C(m,typeof t!="symbol"?t+"":t,e);import{_ as d}from"./Dp1pzeXC.js";import{V as p,M as w,a as T}from"./DSmtfx7F.js";const f=new p(0,0,0),R=30,l=44;function S(){return typeof navigator<"u"&&"gpu"in navigator}class V{constructor(t){i(this,"container");i(this,"deps");i(this,"renderer");i(this,"scene");i(this,"camera");i(this,"storm");i(this,"post",null);i(this,"booted",!1);i(this,"target",new p(0,0,0));i(this,"flythrough",0);i(this,"prevCamPos",new p);i(this,"camVel",new p);this.container=t}get cameraRef(){return this.camera}async boot(){if(this.booted)return;if(!S())throw new Error("WebGPU not supported");const t=await d(()=>import("./DD4_gMN2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),e=await d(()=>import("./CjKwt1b1.js"),__vite__mapDeps([16,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),s=await d(()=>import("./CRPZuD1T.js"),__vite__mapDeps([17,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),{SemanticComputeStorm:a}=await d(async()=>{const{SemanticComputeStorm:n}=await import("./DsCOn7XD.js");return{SemanticComputeStorm:n}},__vite__mapDeps([18,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);if(this.deps={WebGPURenderer:t.WebGPURenderer,PostProcessing:t.PostProcessing,StormCtor:a,tsl:e,bloomMod:s},!t.WebGPURenderer||!t.Scene||!t.PerspectiveCamera||!t.Color)throw new Error("[cinema] three/webgpu is missing expected exports");const h=Math.max(1,this.container.clientWidth),c=Math.max(1,this.container.clientHeight);this.scene=new t.Scene,this.scene.background=new t.Color(131594),this.camera=new t.PerspectiveCamera(60,h/c,.1,2e3),this.camera.position.set(0,18,60);const o=new this.deps.WebGPURenderer({antialias:!0,alpha:!1});o.setPixelRatio(Math.min(window.devicePixelRatio,2)),o.setSize(h,c),await o.init(),this.container.appendChild(o.domElement),this.renderer=o,this.storm=new this.deps.StormCtor(o,this.scene,{});try{const{pass:n,mrt:b,output:g,emissive:_}=this.deps.tsl,r=n(this.scene,this.camera);if(typeof(r==null?void 0:r.setMRT)!="function"||typeof(r==null?void 0:r.getTextureNode)!="function")throw new Error("three/tsl pass() API mismatch — setMRT/getTextureNode missing");r.setMRT(b({output:g,emissive:_}));const M=r.getTextureNode("output"),P=r.getTextureNode("emissive"),v=this.deps.bloomMod.bloom(P,.6,.65,.35),u=new this.deps.PostProcessing(o);u.outputNode=M.add(v),this.post=u}catch(n){console.warn("[cinema] selective bloom unavailable, rendering without MRT:",n),this.post=null}this.booted=!0}transitionTo(t,e,s="II",a=99){this.booted&&this.storm.transitionTo(t,f,s,a)}dreamBeat(){this.booted&&this.storm.dreamBeat()}setFlythrough(t){this.flythrough=w.clamp(t,0,1),this.booted&&this.storm.setStreak(t)}setStreak(t){this.booted&&this.storm.setStreak(t)}setCameraVel(t){this.booted&&this.storm.setCameraVel(t)}async render(t){if(!this.booted)return;this.camVel.copy(this.camera.position).sub(this.prevCamPos).divideScalar(Math.max(t,.001)),this.prevCamPos.copy(this.camera.position);const e=w.lerp(R,6,this.flythrough),s=this.camera.position.length();if(sl||!Number.isFinite(s)){const n=Math.min(l,Math.max(e,s||l));s>.001?this.camera.position.setLength(n):this.camera.position.set(0,12,n)}this.camera.lookAt(f);const a=this.camVel.clone().applyMatrix3(new T().setFromMatrix4(this.camera.matrixWorldInverse)).negate();this.storm.setCameraVel(a);const h=this.camera.position.length(),c=this.camera.fov*Math.PI/180,o=Math.tan(c/2)*h*.82;this.storm.setContainRadius(o),await this.storm.update(t),this.post?await this.post.renderAsync():await this.renderer.renderAsync(this.scene,this.camera)}resize(){if(!this.booted)return;const t=Math.max(1,this.container.clientWidth),e=Math.max(1,this.container.clientHeight);this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e)}dispose(){var t,e,s,a,h;this.booted&&((t=this.storm)==null||t.dispose(),(s=(e=this.renderer)==null?void 0:e.dispose)==null||s.call(e),(h=(a=this.renderer)==null?void 0:a.domElement)!=null&&h.parentNode&&this.renderer.domElement.parentNode.removeChild(this.renderer.domElement),this.booted=!1)}}export{V as CinemaSandbox,S as isWebGPUSupported}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js.br b/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js.br new file mode 100644 index 0000000..fff3aff Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js.gz b/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js.gz new file mode 100644 index 0000000..5e52ab0 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DsOxZJ9g.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js b/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js new file mode 100644 index 0000000..67d4506 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js @@ -0,0 +1 @@ +import{o as t,q as i,v as c,w as f}from"./CW7md74C.js";import{B as y}from"./DExHDOmW.js";const l=Symbol("NaN");function h(r,e,n){c&&f();var o=new y(r),s=!t();i(()=>{var a=e();a!==a&&(a=l),s&&a!==null&&typeof a=="object"&&(a={}),o.ensure(a,n)})}export{h as k}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js.br b/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js.br new file mode 100644 index 0000000..2aa7bf6 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js.gz b/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js.gz new file mode 100644 index 0000000..31c658e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/DsfUoj8c.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js b/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js deleted file mode 100644 index 6d7e420..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js +++ /dev/null @@ -1 +0,0 @@ -import{D as y,q as u,H as _,F as o,G as t,I as g,J as i,K as l,L as d,M as p,N as m}from"./wpu9U-D0.js";function F(n,r){let s=null,E=t;var a;if(t){s=p;for(var e=m(document.head);e!==null&&(e.nodeType!==g||e.data!==n);)e=i(e);if(e===null)l(!1);else{var f=i(e);e.remove(),d(f)}}t||(a=document.head.appendChild(y()));try{u(()=>r(a),_|o)}finally{E&&(l(!0),d(s))}}export{F as h}; diff --git a/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js.br b/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js.br deleted file mode 100644 index 7c75650..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js.gz b/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js.gz deleted file mode 100644 index e0c61a9..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/DzesjbbJ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js b/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js new file mode 100644 index 0000000..1f92e98 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js @@ -0,0 +1 @@ +import{q as p,E as t}from"./CW7md74C.js";import{B as c}from"./DExHDOmW.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js.br b/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js.br new file mode 100644 index 0000000..e820d83 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js.gz b/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js.gz new file mode 100644 index 0000000..1c1c7cf Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/EQUhm_ep.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js.br b/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js.br deleted file mode 100644 index c593293..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js.gz b/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js.gz deleted file mode 100644 index 1fda5c7..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/EqHb-9AZ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js b/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js new file mode 100644 index 0000000..f5fbd31 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js @@ -0,0 +1 @@ +import{x as u,a3 as n,am as l,R as o,at as c,au as r,Q as i}from"./CW7md74C.js";import{h as f,m,u as _}from"./D90q9c2i.js";function a(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function s(e){n===null&&a(),l&&n.l!==null?d(n).m.push(e):u(()=>{const t=o(e);if(typeof t=="function")return t})}function p(e){n===null&&a(),s(()=>()=>o(e))}function d(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const b=Object.freeze(Object.defineProperty({__proto__:null,flushSync:c,hydrate:f,mount:m,onDestroy:p,onMount:s,settled:r,tick:i,unmount:_,untrack:o},Symbol.toStringTag,{value:"Module"}));export{p as a,s as o,b as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js.br b/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js.br new file mode 100644 index 0000000..859276f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js.gz b/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js.gz new file mode 100644 index 0000000..95696cd Binary files /dev/null and b/apps/dashboard/build/_app/immutable/chunks/JVtQszIZ.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js b/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js deleted file mode 100644 index 28f1b46..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js +++ /dev/null @@ -1 +0,0 @@ -import{q as p,E as t}from"./wpu9U-D0.js";import{B as c}from"./BWk3o_TN.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js.br b/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js.br deleted file mode 100644 index 23ccb63..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js.gz b/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js.gz deleted file mode 100644 index 792b2a5..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/LDOJP_6N.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js b/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js deleted file mode 100644 index 8a212fc..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CfobEeQC.js","./C-SOZ1Oi.js","./Bzak7iHL.js","./TZu9D97Z.js","./wpu9U-D0.js","./D8mhvFt8.js","./DKve45Wd.js","./BWk3o_TN.js","./60_R_Vbt.js","./EqHb-9AZ.js","./CnZzd20v.js","./ByYB047u.js","./Bxs5UR9-.js","./g5OnrUYZ.js","./CcUbQ_Wl.js","./DrafHjYM.js","./BLadwbF7.js","./Dp1pzeXC.js","./D7A-gG4Z.js","../assets/Icon.tTjeJXhC.css","./CmbJHhgy.js","../assets/Dropdown.C2Z-7Phd.css","./CZfHMhLI.js","./BhIgFntf.js","../assets/11.BxoW8Jf1.css","./BZQzXWp7.js","./CLrXVRi2.js","./C8kRUgax.js"])))=>i.map(i=>d[i]); -var x=Object.defineProperty;var C=(m,t,e)=>t in m?x(m,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[t]=e;var i=(m,t,e)=>C(m,typeof t!="symbol"?t+"":t,e);import{_ as d}from"./Dp1pzeXC.js";import{V as p,M as w,a as T}from"./C-SOZ1Oi.js";const f=new p(0,0,0),R=30,l=44;function S(){return typeof navigator<"u"&&"gpu"in navigator}class V{constructor(t){i(this,"container");i(this,"deps");i(this,"renderer");i(this,"scene");i(this,"camera");i(this,"storm");i(this,"post",null);i(this,"booted",!1);i(this,"target",new p(0,0,0));i(this,"flythrough",0);i(this,"prevCamPos",new p);i(this,"camVel",new p);this.container=t}get cameraRef(){return this.camera}async boot(){if(this.booted)return;if(!S())throw new Error("WebGPU not supported");const t=await d(()=>import("./CfobEeQC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),e=await d(()=>import("./BZQzXWp7.js"),__vite__mapDeps([25,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),s=await d(()=>import("./CLrXVRi2.js"),__vite__mapDeps([26,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url),{SemanticComputeStorm:a}=await d(async()=>{const{SemanticComputeStorm:n}=await import("./C8kRUgax.js");return{SemanticComputeStorm:n}},__vite__mapDeps([27,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url);if(this.deps={WebGPURenderer:t.WebGPURenderer,PostProcessing:t.PostProcessing,StormCtor:a,tsl:e,bloomMod:s},!t.WebGPURenderer||!t.Scene||!t.PerspectiveCamera||!t.Color)throw new Error("[cinema] three/webgpu is missing expected exports");const h=Math.max(1,this.container.clientWidth),c=Math.max(1,this.container.clientHeight);this.scene=new t.Scene,this.scene.background=new t.Color(131594),this.camera=new t.PerspectiveCamera(60,h/c,.1,2e3),this.camera.position.set(0,18,60);const o=new this.deps.WebGPURenderer({antialias:!0,alpha:!1});o.setPixelRatio(Math.min(window.devicePixelRatio,2)),o.setSize(h,c),await o.init(),this.container.appendChild(o.domElement),this.renderer=o,this.storm=new this.deps.StormCtor(o,this.scene,{});try{const{pass:n,mrt:b,output:g,emissive:_}=this.deps.tsl,r=n(this.scene,this.camera);if(typeof(r==null?void 0:r.setMRT)!="function"||typeof(r==null?void 0:r.getTextureNode)!="function")throw new Error("three/tsl pass() API mismatch — setMRT/getTextureNode missing");r.setMRT(b({output:g,emissive:_}));const M=r.getTextureNode("output"),P=r.getTextureNode("emissive"),v=this.deps.bloomMod.bloom(P,.6,.65,.35),u=new this.deps.PostProcessing(o);u.outputNode=M.add(v),this.post=u}catch(n){console.warn("[cinema] selective bloom unavailable, rendering without MRT:",n),this.post=null}this.booted=!0}transitionTo(t,e,s="II",a=99){this.booted&&this.storm.transitionTo(t,f,s,a)}dreamBeat(){this.booted&&this.storm.dreamBeat()}setFlythrough(t){this.flythrough=w.clamp(t,0,1),this.booted&&this.storm.setStreak(t)}setStreak(t){this.booted&&this.storm.setStreak(t)}setCameraVel(t){this.booted&&this.storm.setCameraVel(t)}async render(t){if(!this.booted)return;this.camVel.copy(this.camera.position).sub(this.prevCamPos).divideScalar(Math.max(t,.001)),this.prevCamPos.copy(this.camera.position);const e=w.lerp(R,6,this.flythrough),s=this.camera.position.length();if(sl||!Number.isFinite(s)){const n=Math.min(l,Math.max(e,s||l));s>.001?this.camera.position.setLength(n):this.camera.position.set(0,12,n)}this.camera.lookAt(f);const a=this.camVel.clone().applyMatrix3(new T().setFromMatrix4(this.camera.matrixWorldInverse)).negate();this.storm.setCameraVel(a);const h=this.camera.position.length(),c=this.camera.fov*Math.PI/180,o=Math.tan(c/2)*h*.82;this.storm.setContainRadius(o),await this.storm.update(t),this.post?await this.post.renderAsync():await this.renderer.renderAsync(this.scene,this.camera)}resize(){if(!this.booted)return;const t=Math.max(1,this.container.clientWidth),e=Math.max(1,this.container.clientHeight);this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e)}dispose(){var t,e,s,a,h;this.booted&&((t=this.storm)==null||t.dispose(),(s=(e=this.renderer)==null?void 0:e.dispose)==null||s.call(e),(h=(a=this.renderer)==null?void 0:a.domElement)!=null&&h.parentNode&&this.renderer.domElement.parentNode.removeChild(this.renderer.domElement),this.booted=!1)}}export{V as CinemaSandbox,S as isWebGPUSupported}; diff --git a/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js.br b/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js.br deleted file mode 100644 index d7d7852..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js.gz b/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js.gz deleted file mode 100644 index 6441d50..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/Ma4NfFrG.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js.br b/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js.br deleted file mode 100644 index 6cee039..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js.gz b/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js.gz deleted file mode 100644 index 36ae23b..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/P1-U_Xsj.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js b/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js deleted file mode 100644 index f3cc3c8..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js +++ /dev/null @@ -1 +0,0 @@ -import{o as l,a2 as o,al as u,P as n,as as c,at as r,O as i}from"./wpu9U-D0.js";import{h as f,m,u as _}from"./D8mhvFt8.js";function a(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function s(e){o===null&&a(),u&&o.l!==null?d(o).m.push(e):l(()=>{const t=n(e);if(typeof t=="function")return t})}function p(e){o===null&&a(),s(()=>()=>n(e))}function d(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const b=Object.freeze(Object.defineProperty({__proto__:null,flushSync:c,hydrate:f,mount:m,onDestroy:p,onMount:s,settled:r,tick:i,unmount:_,untrack:n},Symbol.toStringTag,{value:"Module"}));export{p as a,s as o,b as s}; diff --git a/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js.br b/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js.br deleted file mode 100644 index 86c1102..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js.gz b/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js.gz deleted file mode 100644 index 86a9647..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/TZu9D97Z.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js.br b/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js.br deleted file mode 100644 index af54f98..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js.gz b/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js.gz deleted file mode 100644 index dd113f9..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/dCAmqaEc.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js b/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js deleted file mode 100644 index 0ca5483..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js +++ /dev/null @@ -1 +0,0 @@ -import{x as S,Q as h,P as k,R as x,S as T}from"./wpu9U-D0.js";function t(r,i){return r===i||(r==null?void 0:r[T])===i}function A(r={},i,a,c){return S(()=>{var f,s;return h(()=>{f=s,s=[],k(()=>{r!==a(...s)&&(i(r,...s),f&&t(a(...f),r)&&i(null,...f))})}),()=>{x(()=>{s&&t(a(...s),r)&&i(null,...s)})}}),r}export{A as b}; diff --git a/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js.br b/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js.br deleted file mode 100644 index 86c4713..0000000 --- a/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js.br +++ /dev/null @@ -1 +0,0 @@ -< dkN_6ߥ`/1'<\8DڢҖ'nc}CK"pCB^+m0_ e<1!070Dt/K`1OzVZ*E3qGP4*> R]\HPhg׉`Nx9%^r;%U]6%`ruN͡h \ No newline at end of file diff --git a/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js.gz b/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js.gz deleted file mode 100644 index 4f31ccd..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/g5OnrUYZ.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js.br b/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js.br deleted file mode 100644 index 6e70ac5..0000000 Binary files a/apps/dashboard/build/_app/immutable/chunks/wpu9U-D0.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js b/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js new file mode 100644 index 0000000..2fa0011 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CufTSTHe.js","../chunks/Bzak7iHL.js","../chunks/JVtQszIZ.js","../chunks/CW7md74C.js","../chunks/D90q9c2i.js","../chunks/9-jplUL5.js","../chunks/DExHDOmW.js","../chunks/Cc0l8Nd4.js","../chunks/EQUhm_ep.js","../chunks/CFefTDKL.js","../chunks/ChcFQRZo.js","../chunks/BjbQ7qSx.js","../chunks/Dm3aSj4w.js","../chunks/CaEJGM7b.js","../chunks/BFpewGai.js","../chunks/C9BpaXFO.js","../chunks/BNUnVJrY.js","../chunks/BGTfzpXY.js","../chunks/CcUbQ_Wl.js","../chunks/C-rZhKee.js","../chunks/CqwrgJOn.js","../assets/Icon.tTjeJXhC.css","../assets/0.BRosXaQv.css","../nodes/1.B0GVM9rf.js","../nodes/2.DUuVc9gS.js","../nodes/3.CA0lgdaC.js","../nodes/4.D2zZxlO6.js","../chunks/D8RjhgN0.js","../chunks/DTO0IjuV.js","../assets/PageHeader.Dmxpik8H.css","../chunks/CaR6YsRq.js","../chunks/DPdYG9yN.js","../nodes/5.DpUpTdqe.js","../assets/5.Tl8-WHJj.css","../nodes/6.Bh8aqm2m.js","../chunks/DUAsElMg.js","../assets/Dropdown.C2Z-7Phd.css","../assets/6.DQ_AfUnN.css","../nodes/7.DomAssdT.js","../chunks/C98jjAli.js","../assets/7.F0TwMZ5M.css","../nodes/8.BAXaOae9.js","../nodes/9.x8O4kluQ.js","../nodes/10.BGBsuJiH.js","../assets/10.g4OzM5ih.css","../nodes/11.CvKWjpIX.js","../chunks/DsfUoj8c.js","../chunks/DSmtfx7F.js","../assets/ObservatoryStage.CnF5Ezel.css","../chunks/C4Tpoo1i.js","../chunks/Dp1pzeXC.js","../assets/11.BxoW8Jf1.css","../nodes/12.CiFT6kL_.js","../nodes/13.H3l2YCsd.js","../nodes/14.CGp2yeqr.js","../assets/14.Bjd0S47S.css","../nodes/15.zPehnIhj.js","../assets/15.BzuIe_Oj.css","../nodes/16.DIZEZ9J2.js","../nodes/17.cONpz_b8.js","../nodes/18.rpGfIdJ2.js","../assets/18.ChjqzJHo.css","../nodes/19.56tMTUyP.js","../assets/19.BnHgRQtR.css","../nodes/20.C9dv6aje.js","../assets/20.C2qtIyf6.css","../nodes/21.VHre2za-.js","../assets/21.CO50G5tF.css","../nodes/22.BiOaW6TI.js","../nodes/23.BCAC1xxA.js","../assets/23.DKhUrxcR.css"])))=>i.map(i=>d[i]); +var W=e=>{throw TypeError(e)};var z=(e,t,r)=>t.has(e)||W("Cannot "+r);var n=(e,t,r)=>(z(e,t,"read from private field"),r?r.call(e):t.get(e)),B=(e,t,r)=>t.has(e)?W("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),F=(e,t,r,i)=>(z(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);import{_ as a}from"../chunks/Dp1pzeXC.js";import{v as J,w as nt,q as mt,E as ut,V as ct,Y as dt,N as lt,M as K,W as pt,O as ft,i as C,ar as vt,g as f,at as ht,ae as Et,ad as gt,p as Pt,a4 as Rt,x as Ot,Q as Tt,f as R,h as yt,a as v,b as At,s as q,c as A,e as Dt,r as It,j as U,u as L,m as Lt,t as Vt}from"../chunks/CW7md74C.js";import{h as bt,m as xt,u as wt,s as kt}from"../chunks/D90q9c2i.js";import"../chunks/Bzak7iHL.js";import{o as jt}from"../chunks/JVtQszIZ.js";import{i as k}from"../chunks/9-jplUL5.js";import{B as Ct}from"../chunks/DExHDOmW.js";import{b as V}from"../chunks/ChcFQRZo.js";import{p as j}from"../chunks/BjbQ7qSx.js";function b(e,t,r){var i;J&&(i=ft,nt());var _=new Ct(e);mt(()=>{var m=t()??null;if(J){var o=ct(i),s=o===pt,d=m!==null;if(s!==d){var x=dt();lt(x),_.anchor=x,K(!1),_.ensure(m,m&&(O=>r(O,m))),K(!0);return}}_.ensure(m,m&&(O=>r(O,m)))},ut)}function St(e){return class extends Mt{constructor(t){super({component:e,...t})}}}var h,c;class Mt{constructor(t){B(this,h);B(this,c);var m;var r=new Map,i=(o,s)=>{var d=gt(s,!1,!1);return r.set(o,d),d};const _=new Proxy({...t.props||{},$$events:{}},{get(o,s){return f(r.get(s)??i(s,Reflect.get(o,s)))},has(o,s){return s===vt?!0:(f(r.get(s)??i(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,d){return C(r.get(s)??i(s,d),d),Reflect.set(o,s,d)}});F(this,c,(t.hydrate?bt:xt)(t.component,{target:t.target,anchor:t.anchor,props:_,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((m=t==null?void 0:t.props)!=null&&m.$$host)||t.sync===!1)&&ht(),F(this,h,_.$$events);for(const o of Object.keys(n(this,c)))o==="$set"||o==="$destroy"||o==="$on"||Et(this,o,{get(){return n(this,c)[o]},set(s){n(this,c)[o]=s},enumerable:!0});n(this,c).$set=o=>{Object.assign(_,o)},n(this,c).$destroy=()=>{wt(n(this,c))}}$set(t){n(this,c).$set(t)}$on(t,r){n(this,h)[t]=n(this,h)[t]||[];const i=(..._)=>r.call(this,..._);return n(this,h)[t].push(i),()=>{n(this,h)[t]=n(this,h)[t].filter(_=>_!==i)}}$destroy(){n(this,c).$destroy()}}h=new WeakMap,c=new WeakMap;const tr={};var Nt=U('
'),Yt=U(" ",1);function Bt(e,t){Pt(t,!0);let r=j(t,"components",23,()=>[]),i=j(t,"data_0",3,null),_=j(t,"data_1",3,null),m=j(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),Ot(()=>{t.stores,t.page,t.constructors,r(),t.form,i(),_(),m(),t.stores.page.notify()});let o=q(!1),s=q(!1),d=q(null);jt(()=>{const u=t.stores.page.subscribe(()=>{f(o)&&(C(s,!0),Tt().then(()=>{C(d,document.title||"untitled page",!0)}))});return C(o,!0),u});const x=L(()=>t.constructors[2]);var O=Yt(),G=R(O);{var Z=u=>{const E=L(()=>t.constructors[0]);var g=A(),D=R(g);b(D,()=>f(E),(P,T)=>{V(T(P,{get data(){return i()},get form(){return t.form},get params(){return t.page.params},children:(l,qt)=>{var H=A(),et=R(H);{var at=y=>{const S=L(()=>t.constructors[1]);var I=A(),M=R(I);b(M,()=>f(S),(N,Y)=>{V(Y(N,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(p,Gt)=>{var Q=A(),st=R(Q);b(st,()=>f(x),(it,_t)=>{V(_t(it,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),w=>r()[2]=w,()=>{var w;return(w=r())==null?void 0:w[2]})}),v(p,Q)},$$slots:{default:!0}}),p=>r()[1]=p,()=>{var p;return(p=r())==null?void 0:p[1]})}),v(y,I)},ot=y=>{const S=L(()=>t.constructors[1]);var I=A(),M=R(I);b(M,()=>f(S),(N,Y)=>{V(Y(N,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),p=>r()[1]=p,()=>{var p;return(p=r())==null?void 0:p[1]})}),v(y,I)};k(et,y=>{t.constructors[2]?y(at):y(ot,!1)})}v(l,H)},$$slots:{default:!0}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)},$=u=>{const E=L(()=>t.constructors[0]);var g=A(),D=R(g);b(D,()=>f(E),(P,T)=>{V(T(P,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)};k(G,u=>{t.constructors[1]?u(Z):u($,!1)})}var tt=yt(G,2);{var rt=u=>{var E=Nt(),g=Dt(E);{var D=P=>{var T=Lt();Vt(()=>kt(T,f(d))),v(P,T)};k(g,P=>{f(s)&&P(D)})}It(E),v(u,E)};k(tt,u=>{f(o)&&u(rt)})}v(e,O),At()}const rr=St(Bt),er=[()=>a(()=>import("../nodes/0.CufTSTHe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),()=>a(()=>import("../nodes/1.B0GVM9rf.js"),__vite__mapDeps([23,1,15,3,4,13,2,12]),import.meta.url),()=>a(()=>import("../nodes/2.DUuVc9gS.js"),__vite__mapDeps([24,1,3,8,6]),import.meta.url),()=>a(()=>import("../nodes/3.CA0lgdaC.js"),__vite__mapDeps([25,1,15,3,2,4,12,13]),import.meta.url),()=>a(()=>import("../nodes/4.D2zZxlO6.js"),__vite__mapDeps([26,1,2,3,4,5,6,27,7,9,19,14,11,18,28,8,20,21,29,30,31]),import.meta.url),()=>a(()=>import("../nodes/5.DpUpTdqe.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,27,16,9,11,28,8,20,21,29,30,12,13,19,14,33]),import.meta.url),()=>a(()=>import("../nodes/6.Bh8aqm2m.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,27,16,11,28,8,20,21,29,35,10,36,30,19,37]),import.meta.url),()=>a(()=>import("../nodes/7.DomAssdT.js"),__vite__mapDeps([38,1,3,4,5,6,7,39,27,19,16,11,13,2,28,8,20,21,29,31,40]),import.meta.url),()=>a(()=>import("../nodes/8.BAXaOae9.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,27,9,16,18,28,8,11,20,21,29,30,31,19]),import.meta.url),()=>a(()=>import("../nodes/9.x8O4kluQ.js"),__vite__mapDeps([42,1,3,4,5,6,7,27,16,9,19,28,8,11,20,21,29,30,31]),import.meta.url),()=>a(()=>import("../nodes/10.BGBsuJiH.js"),__vite__mapDeps([43,1,3,4,5,6,7,27,16,11,14,18,28,8,20,21,29,30,44]),import.meta.url),()=>a(()=>import("../nodes/11.CvKWjpIX.js"),__vite__mapDeps([45,1,2,3,4,5,6,46,7,16,9,11,13,10,47,19,18,48,49,15,50,20,21,35,36,14,51]),import.meta.url),()=>a(()=>import("../nodes/12.CiFT6kL_.js"),__vite__mapDeps([52,1,2,3,4,5,6,46,7,27,16,9,12,13,19,18,11,28,8,20,21,29,30,31]),import.meta.url),()=>a(()=>import("../nodes/13.H3l2YCsd.js"),__vite__mapDeps([53,1,2,3,4,5,6,7,27,19,28,8,11,20,21,29,35,16,10,36,30,31]),import.meta.url),()=>a(()=>import("../nodes/14.CGp2yeqr.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,27,16,9,19,18,28,8,11,20,21,29,30,35,10,36,31,55]),import.meta.url),()=>a(()=>import("../nodes/15.zPehnIhj.js"),__vite__mapDeps([56,1,2,3,4,5,6,7,27,11,28,8,20,21,29,30,17,14,18,19,57]),import.meta.url),()=>a(()=>import("../nodes/16.DIZEZ9J2.js"),__vite__mapDeps([58,1,3,46,6,12,2,4,13,47,5,7,10,11,19,16,18,48]),import.meta.url),()=>a(()=>import("../nodes/17.cONpz_b8.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,27,16,28,8,11,20,21,29,30,19]),import.meta.url),()=>a(()=>import("../nodes/18.rpGfIdJ2.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,39,27,16,9,10,19,11,18,28,8,20,21,29,30,31,61]),import.meta.url),()=>a(()=>import("../nodes/19.56tMTUyP.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,19,16,11,18,28,8,20,21,29,35,10,36,63]),import.meta.url),()=>a(()=>import("../nodes/20.C9dv6aje.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,27,16,11,19,14,17,18,28,8,20,21,29,65]),import.meta.url),()=>a(()=>import("../nodes/21.VHre2za-.js"),__vite__mapDeps([66,1,2,3,4,5,6,7,27,16,19,28,8,11,20,21,29,30,31,18,67]),import.meta.url),()=>a(()=>import("../nodes/22.BiOaW6TI.js"),__vite__mapDeps([68,1,2,3,4,5,6,7,27,16,19,18,28,8,11,20,21,29,30,35,10,36]),import.meta.url),()=>a(()=>import("../nodes/23.BCAC1xxA.js"),__vite__mapDeps([69,1,2,3,4,5,6,7,39,16,9,49,10,13,70]),import.meta.url)],ar=[],or={"/":[3],"/(app)/activation":[4,[2]],"/(app)/blackbox":[5,[2]],"/(app)/contradictions":[6,[2]],"/(app)/dreams":[7,[2]],"/(app)/duplicates":[8,[2]],"/(app)/explore":[9,[2]],"/(app)/feed":[10,[2]],"/(app)/graph":[11,[2]],"/(app)/importance":[12,[2]],"/(app)/intentions":[13,[2]],"/(app)/memories":[14,[2]],"/(app)/memory-prs":[15,[2]],"/(app)/observatory":[16,[2]],"/(app)/patterns":[17,[2]],"/(app)/reasoning":[18,[2]],"/(app)/schedule":[19,[2]],"/(app)/settings":[20,[2]],"/(app)/stats":[21,[2]],"/(app)/timeline":[22,[2]],"/waitlist":[23]},X={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Ft=Object.fromEntries(Object.entries(X.transport).map(([e,t])=>[e,t.decode])),sr=Object.fromEntries(Object.entries(X.transport).map(([e,t])=>[e,t.encode])),ir=!1,_r=(e,t)=>Ft[e](t);export{_r as decode,Ft as decoders,or as dictionary,sr as encoders,ir as hash,X as hooks,tr as matchers,er as nodes,rr as root,ar as server_loads}; diff --git a/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js.br b/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js.br new file mode 100644 index 0000000..9a2fd26 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js.br differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js.gz b/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js.gz new file mode 100644 index 0000000..56e1039 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.DHgAWrC3.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js b/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js deleted file mode 100644 index 36a42cf..0000000 --- a/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BmfNagK9.js","../chunks/Bzak7iHL.js","../chunks/TZu9D97Z.js","../chunks/wpu9U-D0.js","../chunks/D8mhvFt8.js","../chunks/DKve45Wd.js","../chunks/BWk3o_TN.js","../chunks/60_R_Vbt.js","../chunks/LDOJP_6N.js","../chunks/CnZzd20v.js","../chunks/g5OnrUYZ.js","../chunks/ByYB047u.js","../chunks/dCAmqaEc.js","../chunks/Bxs5UR9-.js","../chunks/BhIgFntf.js","../chunks/BLadwbF7.js","../chunks/EqHb-9AZ.js","../chunks/CqMQEF-F.js","../chunks/CcUbQ_Wl.js","../chunks/CZfHMhLI.js","../chunks/D7A-gG4Z.js","../assets/Icon.tTjeJXhC.css","../assets/0.Cf27G70K.css","../nodes/1.MT4EnKSP.js","../nodes/2.DEnQkIHv.js","../nodes/3.C8tBBpzF.js","../nodes/4.BpOpkZuP.js","../chunks/P1-U_Xsj.js","../chunks/BHDZZvku.js","../assets/PageHeader.Dmxpik8H.css","../chunks/DcKTNC6e.js","../chunks/DPdYG9yN.js","../nodes/5.CK5gRe3F.js","../assets/5.Tl8-WHJj.css","../nodes/6.DZyLUVX2.js","../chunks/CmbJHhgy.js","../assets/Dropdown.C2Z-7Phd.css","../assets/6.DQ_AfUnN.css","../nodes/7.yWYTsQ1Q.js","../chunks/DzesjbbJ.js","../assets/7.F0TwMZ5M.css","../nodes/8.D5dP0-E2.js","../nodes/9.Vz-x3Q_x.js","../nodes/10.DYHIt_do.js","../assets/10.g4OzM5ih.css","../nodes/11.Db7dgOeT.js","../chunks/C-SOZ1Oi.js","../chunks/DrafHjYM.js","../chunks/Dp1pzeXC.js","../assets/11.BxoW8Jf1.css","../nodes/12.CO2CXIFj.js","../nodes/13.BQoci-vM.js","../nodes/14.CDp0vmq1.js","../assets/14.Bjd0S47S.css","../nodes/15.C05K0kWE.js","../assets/15.BzuIe_Oj.css","../nodes/16.CrQpRrFW.js","../nodes/17.3ASmJvJ6.js","../assets/17.ChjqzJHo.css","../nodes/18.43xZFMsD.js","../assets/18.BnHgRQtR.css","../nodes/19.BYwd4oWS.js","../assets/19.C2qtIyf6.css","../nodes/20.Di2Q3Va0.js","../assets/20.CO50G5tF.css","../nodes/21.BAlasPHS.js","../nodes/22.C719k-1W.js","../assets/22.DKhUrxcR.css"])))=>i.map(i=>d[i]); -var U=e=>{throw TypeError(e)};var X=(e,t,r)=>t.has(e)||U("Cannot "+r);var n=(e,t,r)=>(X(e,t,"read from private field"),r?r.call(e):t.get(e)),B=(e,t,r)=>t.has(e)?U("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),F=(e,t,r,i)=>(X(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);import{_ as o}from"../chunks/Dp1pzeXC.js";import{G as z,T as nt,q as mt,E as ut,U as ct,X as dt,L as lt,K as J,V as ft,M as pt,i as C,aq as vt,g as p,as as ht,ad as Et,ac as gt,p as Pt,a3 as Rt,o as Ot,O as Tt,f as R,h as yt,a as v,b as At,s as G,c as A,e as Lt,r as Dt,j as Q,u as I,m as It,t as Vt}from"../chunks/wpu9U-D0.js";import{h as bt,m as xt,u as kt,s as wt}from"../chunks/D8mhvFt8.js";import"../chunks/Bzak7iHL.js";import{o as jt}from"../chunks/TZu9D97Z.js";import{i as w}from"../chunks/DKve45Wd.js";import{B as Ct}from"../chunks/BWk3o_TN.js";import{b as V}from"../chunks/g5OnrUYZ.js";import{p as j}from"../chunks/ByYB047u.js";function b(e,t,r){var i;z&&(i=pt,nt());var _=new Ct(e);mt(()=>{var m=t()??null;if(z){var a=ct(i),s=a===ft,d=m!==null;if(s!==d){var x=dt();lt(x),_.anchor=x,J(!1),_.ensure(m,m&&(O=>r(O,m))),J(!0);return}}_.ensure(m,m&&(O=>r(O,m)))},ut)}function St(e){return class extends Mt{constructor(t){super({component:e,...t})}}}var h,c;class Mt{constructor(t){B(this,h);B(this,c);var m;var r=new Map,i=(a,s)=>{var d=gt(s,!1,!1);return r.set(a,d),d};const _=new Proxy({...t.props||{},$$events:{}},{get(a,s){return p(r.get(s)??i(s,Reflect.get(a,s)))},has(a,s){return s===vt?!0:(p(r.get(s)??i(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,d){return C(r.get(s)??i(s,d),d),Reflect.set(a,s,d)}});F(this,c,(t.hydrate?bt:xt)(t.component,{target:t.target,anchor:t.anchor,props:_,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((m=t==null?void 0:t.props)!=null&&m.$$host)||t.sync===!1)&&ht(),F(this,h,_.$$events);for(const a of Object.keys(n(this,c)))a==="$set"||a==="$destroy"||a==="$on"||Et(this,a,{get(){return n(this,c)[a]},set(s){n(this,c)[a]=s},enumerable:!0});n(this,c).$set=a=>{Object.assign(_,a)},n(this,c).$destroy=()=>{kt(n(this,c))}}$set(t){n(this,c).$set(t)}$on(t,r){n(this,h)[t]=n(this,h)[t]||[];const i=(..._)=>r.call(this,..._);return n(this,h)[t].push(i),()=>{n(this,h)[t]=n(this,h)[t].filter(_=>_!==i)}}$destroy(){n(this,c).$destroy()}}h=new WeakMap,c=new WeakMap;const tr={};var Nt=Q('
'),qt=Q(" ",1);function Bt(e,t){Pt(t,!0);let r=j(t,"components",23,()=>[]),i=j(t,"data_0",3,null),_=j(t,"data_1",3,null),m=j(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),Ot(()=>{t.stores,t.page,t.constructors,r(),t.form,i(),_(),m(),t.stores.page.notify()});let a=G(!1),s=G(!1),d=G(null);jt(()=>{const u=t.stores.page.subscribe(()=>{p(a)&&(C(s,!0),Tt().then(()=>{C(d,document.title||"untitled page",!0)}))});return C(a,!0),u});const x=I(()=>t.constructors[2]);var O=qt(),Y=R(O);{var Z=u=>{const E=I(()=>t.constructors[0]);var g=A(),L=R(g);b(L,()=>p(E),(P,T)=>{V(T(P,{get data(){return i()},get form(){return t.form},get params(){return t.page.params},children:(l,Gt)=>{var H=A(),et=R(H);{var at=y=>{const S=I(()=>t.constructors[1]);var D=A(),M=R(D);b(M,()=>p(S),(N,q)=>{V(q(N,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(f,Yt)=>{var K=A(),st=R(K);b(st,()=>p(x),(it,_t)=>{V(_t(it,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),k=>r()[2]=k,()=>{var k;return(k=r())==null?void 0:k[2]})}),v(f,K)},$$slots:{default:!0}}),f=>r()[1]=f,()=>{var f;return(f=r())==null?void 0:f[1]})}),v(y,D)},ot=y=>{const S=I(()=>t.constructors[1]);var D=A(),M=R(D);b(M,()=>p(S),(N,q)=>{V(q(N,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),f=>r()[1]=f,()=>{var f;return(f=r())==null?void 0:f[1]})}),v(y,D)};w(et,y=>{t.constructors[2]?y(at):y(ot,!1)})}v(l,H)},$$slots:{default:!0}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)},$=u=>{const E=I(()=>t.constructors[0]);var g=A(),L=R(g);b(L,()=>p(E),(P,T)=>{V(T(P,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)};w(Y,u=>{t.constructors[1]?u(Z):u($,!1)})}var tt=yt(Y,2);{var rt=u=>{var E=Nt(),g=Lt(E);{var L=P=>{var T=It();Vt(()=>wt(T,p(d))),v(P,T)};w(g,P=>{p(s)&&P(L)})}Dt(E),v(u,E)};w(tt,u=>{p(a)&&u(rt)})}v(e,O),At()}const rr=St(Bt),er=[()=>o(()=>import("../nodes/0.BmfNagK9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),()=>o(()=>import("../nodes/1.MT4EnKSP.js"),__vite__mapDeps([23,1,15,3,4,13,2,12]),import.meta.url),()=>o(()=>import("../nodes/2.DEnQkIHv.js"),__vite__mapDeps([24,1,3,8,6]),import.meta.url),()=>o(()=>import("../nodes/3.C8tBBpzF.js"),__vite__mapDeps([25,1,15,3,2,4,12,13]),import.meta.url),()=>o(()=>import("../nodes/4.BpOpkZuP.js"),__vite__mapDeps([26,1,2,3,4,5,6,27,7,9,19,14,11,18,28,8,20,21,29,30,31]),import.meta.url),()=>o(()=>import("../nodes/5.CK5gRe3F.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,27,16,9,11,28,8,20,21,29,30,12,13,19,14,33]),import.meta.url),()=>o(()=>import("../nodes/6.DZyLUVX2.js"),__vite__mapDeps([34,1,3,4,5,6,7,27,16,11,28,8,20,21,29,35,10,36,30,37]),import.meta.url),()=>o(()=>import("../nodes/7.yWYTsQ1Q.js"),__vite__mapDeps([38,1,3,4,5,6,7,39,27,19,16,11,13,2,28,8,20,21,29,31,40]),import.meta.url),()=>o(()=>import("../nodes/8.D5dP0-E2.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,27,9,16,18,28,8,11,20,21,29,30,31]),import.meta.url),()=>o(()=>import("../nodes/9.Vz-x3Q_x.js"),__vite__mapDeps([42,1,3,4,5,6,7,27,16,9,19,28,8,11,20,21,29,30,31]),import.meta.url),()=>o(()=>import("../nodes/10.DYHIt_do.js"),__vite__mapDeps([43,1,3,4,5,6,7,27,16,11,14,18,28,8,20,21,29,30,44]),import.meta.url),()=>o(()=>import("../nodes/11.Db7dgOeT.js"),__vite__mapDeps([45,46,1,2,3,4,5,6,7,16,9,11,13,10,18,47,15,48,20,21,35,36,19,14,49]),import.meta.url),()=>o(()=>import("../nodes/12.CO2CXIFj.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,27,16,9,12,13,19,18,11,28,8,20,21,29,30,31]),import.meta.url),()=>o(()=>import("../nodes/13.BQoci-vM.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,27,19,28,8,11,20,21,29,35,16,10,36,30,31]),import.meta.url),()=>o(()=>import("../nodes/14.CDp0vmq1.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,27,16,9,19,18,28,8,11,20,21,29,30,35,10,36,31,53]),import.meta.url),()=>o(()=>import("../nodes/15.C05K0kWE.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,27,11,28,8,20,21,29,30,17,14,18,19,55]),import.meta.url),()=>o(()=>import("../nodes/16.CrQpRrFW.js"),__vite__mapDeps([56,1,2,3,4,5,6,7,27,16,28,8,11,20,21,29,30]),import.meta.url),()=>o(()=>import("../nodes/17.3ASmJvJ6.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,39,27,16,9,10,19,11,18,28,8,20,21,29,30,31,58]),import.meta.url),()=>o(()=>import("../nodes/18.43xZFMsD.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,19,16,11,18,28,8,20,21,29,35,10,36,60]),import.meta.url),()=>o(()=>import("../nodes/19.BYwd4oWS.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,27,16,11,19,14,17,18,28,8,20,21,29,62]),import.meta.url),()=>o(()=>import("../nodes/20.Di2Q3Va0.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,27,16,19,28,8,11,20,21,29,30,31,18,64]),import.meta.url),()=>o(()=>import("../nodes/21.BAlasPHS.js"),__vite__mapDeps([65,1,2,3,4,5,6,7,27,16,19,18,28,8,11,20,21,29,30,35,10,36]),import.meta.url),()=>o(()=>import("../nodes/22.C719k-1W.js"),__vite__mapDeps([66,1,2,3,4,5,6,7,39,16,9,47,10,13,67]),import.meta.url)],ar=[],or={"/":[3],"/(app)/activation":[4,[2]],"/(app)/blackbox":[5,[2]],"/(app)/contradictions":[6,[2]],"/(app)/dreams":[7,[2]],"/(app)/duplicates":[8,[2]],"/(app)/explore":[9,[2]],"/(app)/feed":[10,[2]],"/(app)/graph":[11,[2]],"/(app)/importance":[12,[2]],"/(app)/intentions":[13,[2]],"/(app)/memories":[14,[2]],"/(app)/memory-prs":[15,[2]],"/(app)/patterns":[16,[2]],"/(app)/reasoning":[17,[2]],"/(app)/schedule":[18,[2]],"/(app)/settings":[19,[2]],"/(app)/stats":[20,[2]],"/(app)/timeline":[21,[2]],"/waitlist":[22]},W={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Ft=Object.fromEntries(Object.entries(W.transport).map(([e,t])=>[e,t.decode])),sr=Object.fromEntries(Object.entries(W.transport).map(([e,t])=>[e,t.encode])),ir=!1,_r=(e,t)=>Ft[e](t);export{_r as decode,Ft as decoders,or as dictionary,sr as encoders,ir as hash,W as hooks,tr as matchers,er as nodes,rr as root,ar as server_loads}; diff --git a/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js.br b/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js.br deleted file mode 100644 index 35fff68..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js.gz b/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js.gz deleted file mode 100644 index 54e99b8..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.Dg6iMka9.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js b/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js deleted file mode 100644 index c225395..0000000 --- a/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js +++ /dev/null @@ -1 +0,0 @@ -import{a as r}from"../chunks/dCAmqaEc.js";import{w as t}from"../chunks/Bxs5UR9-.js";export{t as load_css,r as start}; diff --git a/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js.br b/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js.br deleted file mode 100644 index bed1076..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js.gz b/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js.gz deleted file mode 100644 index dcc3604..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/start.BvFEq078.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js b/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js new file mode 100644 index 0000000..e679198 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js @@ -0,0 +1 @@ +import{a as r}from"../chunks/Dm3aSj4w.js";import{w as t}from"../chunks/CaEJGM7b.js";export{t as load_css,r as start}; diff --git a/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js.br b/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js.br new file mode 100644 index 0000000..1abb0a9 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js.br differ diff --git a/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js.gz b/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js.gz new file mode 100644 index 0000000..54bf94a Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/start.jEGGTFC6.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js b/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js deleted file mode 100644 index 4397bdd..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js +++ /dev/null @@ -1,86 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as et}from"../chunks/TZu9D97Z.js";import{c as tt,f as ve,a as v,h as s,e as a,r as t,t as F,j as h,p as Ye,n as ce,g as e,b as Qe,s as le,d as kt,i as f,u as Y,m as st}from"../chunks/wpu9U-D0.js";import{s as g,d as Ue,a as ie,e as Ge,b as _t,w as ct,g as vt}from"../chunks/D8mhvFt8.js";import{i as z}from"../chunks/DKve45Wd.js";import{e as Fe,a as Ae,i as Be,s as ee,r as yt}from"../chunks/60_R_Vbt.js";import{s as rt}from"../chunks/LDOJP_6N.js";import{b as wt}from"../chunks/CnZzd20v.js";import{b as $t}from"../chunks/g5OnrUYZ.js";import{s as pe,a as He}from"../chunks/ByYB047u.js";import{s as At,o as Ct,g as nt}from"../chunks/dCAmqaEc.js";import{b as _e}from"../chunks/Bxs5UR9-.js";import{s as pt,b as ut,a as mt,e as Mt,w as it,u as Tt,i as Et,f as St}from"../chunks/BhIgFntf.js";import{i as jt}from"../chunks/BLadwbF7.js";import{s as ft}from"../chunks/EqHb-9AZ.js";import{t as Ie}from"../chunks/CqMQEF-F.js";import{a as qe}from"../chunks/CZfHMhLI.js";import{I as Le}from"../chunks/D7A-gG4Z.js";const Dt=()=>{const n=At;return{page:{subscribe:n.page.subscribe},navigating:{subscribe:n.navigating.subscribe},updated:n.updated}},It={subscribe(n){return Dt().page.subscribe(n)}};var Ft=h('
');function Nt(n){const l=()=>pe(pt,"$suppressedCount",o),[o,i]=He();var b=tt(),M=ve(b);{var k=N=>{var w=Ft(),y=s(a(w),2),p=a(y);t(y),t(w),F(()=>g(p,`Actively forgetting ${l()??""} ${l()===1?"memory":"memories"}`)),v(N,w)};z(M,N=>{l()>0&&N(k)})}v(n,b),i()}var Lt=h(''),Bt=h('
');function Vt(n,l){Ye(l,!1);const o=()=>pe(Ie,"$toasts",i),[i,b]=He(),M={DreamCompleted:"✦",ConsolidationCompleted:"◉",ConnectionDiscovered:"⟷",MemoryPromoted:"↑",MemoryDemoted:"↓",MemorySuppressed:"◬",MemoryUnsuppressed:"◉",Rac1CascadeSwept:"✺",MemoryDeleted:"✕",HookVerdictRecorded:"⚑"};function k(p){return M[p]??"◆"}function N(p){Ie.dismiss(p.id)}function w(p,c){(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),Ie.dismiss(c.id))}jt();var y=Bt();Fe(y,5,o,p=>p.id,(p,c)=>{var T=Lt(),L=s(a(T),2),B=a(L),Z=a(B),Q=a(Z,!0);t(Z);var te=s(Z,2),ue=a(te,!0);t(te),t(B);var u=s(B,2),m=a(u,!0);t(u),t(L),ce(2),t(T),F($=>{Ae(T,"aria-label",`${e(c).title??""}: ${e(c).body??""}. Click to dismiss.`),ft(T,`--toast-color: ${e(c).color??""}; --toast-dwell: ${e(c).dwellMs??""}ms;`),g(Q,$),g(ue,e(c).title),g(m,e(c).body)},[()=>k(e(c).type)]),ie("click",T,()=>N(e(c))),ie("keydown",T,$=>w($,e(c))),Ge("mouseenter",T,()=>Ie.pauseDwell(e(c).id,e(c).dwellMs)),Ge("mouseleave",T,()=>Ie.resumeDwell(e(c).id)),Ge("focus",T,()=>Ie.pauseDwell(e(c).id,e(c).dwellMs)),Ge("blur",T,()=>Ie.resumeDwell(e(c).id)),v(p,T)}),t(y),v(n,y),Qe(),b()}Ue(["click","keydown"]);function Ve(n){const l=n.data;if(!l||typeof l!="object")return null;const o=l.timestamp??l.at??l.occurred_at;if(o==null)return null;if(typeof o=="number")return Number.isFinite(o)?o>1e12?o:o*1e3:null;if(typeof o!="string")return null;const i=Date.parse(o);return Number.isFinite(i)?i:null}const Ze=10,ht=3e4,Rt=Ze*ht;function Ot(n,l){const o=l-Rt,i=new Array(Ze).fill(0);for(const M of n){if(M.type==="Heartbeat")continue;const k=Ve(M);if(k===null||kl)continue;const N=Math.min(Ze-1,Math.floor((k-o)/ht));i[N]+=1}const b=Math.max(1,...i);return i.map(M=>({count:M,ratio:M/b}))}function Pt(n,l){const o=l-864e5;for(const i of n){if(i.type!=="DreamCompleted")continue;return(Ve(i)??l)>=o?i:null}return null}function zt(n){if(!n||!n.data)return null;const l=n.data,o=typeof l.insights_generated=="number"?l.insights_generated:typeof l.insightsGenerated=="number"?l.insightsGenerated:null;return o!==null&&Number.isFinite(o)?o:null}function Kt(n,l){let o=null,i=null;for(const N of n)if(!o&&N.type==="DreamStarted"&&(o=N),!i&&N.type==="DreamCompleted"&&(i=N),o&&i)break;if(!o)return!1;const b=Ve(o)??l,M=l-300*1e3;return b=i}return!1}var Wt=h(' at risk',1),Gt=h('0 at risk',1),Yt=h(' at risk',1),Qt=h(' intentions',1),Ut=h('— intentions'),Xt=h('· insights',1),Zt=h(' Last dream: ',1),Jt=h('No recent dream'),ea=h('
'),ta=h('telemetry unavailable'),aa=h('· fail-open',1),sa=h(' vetoes · appeals ',1),ra=h('
DREAMING...
',1),na=h(''),ia=h('
memories · avg retention
');function la(n,l){Ye(l,!0);const o=()=>pe(mt,"$avgRetention",M),i=()=>pe(Mt,"$eventFeed",M),b=()=>pe(ut,"$memoryCount",M),[M,k]=He(),N=Y(()=>Math.round((o()??0)*100)),w=Y(()=>(o()??0)>=.5);let y=le(null);async function p(){try{const r=await qe.retentionDistribution();if(Array.isArray(r.endangered)&&r.endangered.length>0){f(y,r.endangered.length,!0);return}const d=r.distribution??[];let _=0;for(const V of d){const G=/^(\d+)/.exec(V.range);if(!G)continue;const re=Number.parseInt(G[1],10);Number.isFinite(re)&&re<30&&(_+=V.count??0)}f(y,_,!0)}catch{f(y,null)}}let c=le(null);async function T(){var r;try{const d=await qe.intentions("active");f(c,d.total??((r=d.intentions)==null?void 0:r.length)??0,!0)}catch{f(c,null)}}let L=le(kt(Date.now()));const B=Y(()=>{const r=i(),d=Pt(r,e(L)),_=d?Ve(d)??e(L):null,V=_!==null?e(L)-_:null;return{isDreaming:Kt(r,e(L)),recent:d,recentMsAgo:V,insights:zt(d)}}),Z=Y(()=>Ot(i(),e(L)));let Q=le(null),te=le(!1);async function ue(){try{f(Q,await qe.sanhedrin.telemetry(7),!0),f(te,!1)}catch{f(Q,null),f(te,!0)}}const u=Y(()=>Ht(i(),e(L)));et(()=>{p(),T(),ue();const r=setInterval(()=>{f(L,Date.now(),!0)},1e3),d=setInterval(()=>{p(),T(),ue()},6e4);return()=>{clearInterval(r),clearInterval(d)}});var m=ia();let $;var be=a(m),xe=a(be),Ne=a(xe);let Ce;var S=s(Ne,2);let j;t(xe);var x=s(xe,2),ae=a(x,!0);t(x);var K=s(x,6);let U;var he=a(K);t(K),ce(2),t(be);var A=s(be,4),D=a(A);{var q=r=>{var d=Wt(),_=ve(d),V=a(_,!0);t(_),ce(2),F(()=>g(V,e(y))),v(r,d)},oe=r=>{var d=Gt();ce(2),v(r,d)},E=r=>{var d=Yt();ce(2),v(r,d)};z(D,r=>{e(y)!==null&&e(y)>0?r(q):e(y)===0?r(oe,1):r(E,!1)})}t(A);var X=s(A,4),se=a(X);{var de=r=>{var d=Qt(),_=ve(d);let V;var G=s(_,2);let re;var ne=a(G,!0);t(G),ce(2),F(()=>{V=ee(_,1,"inline-flex h-2 w-2 rounded-full svelte-1kk3799",null,V,{"bg-node-pattern":e(c)>5,"animate-ping-slow":e(c)>5,"bg-muted":e(c)<=5}),re=ee(G,1,"tabular-nums svelte-1kk3799",null,re,{"text-node-pattern":e(c)>5,"text-text":e(c)>0&&e(c)<=5,"text-muted":e(c)===0}),g(ne,e(c))}),v(r,d)},Se=r=>{var d=Ut();v(r,d)};z(se,r=>{e(c)!==null?r(de):r(Se,!1)})}t(X);var J=s(X,4),Me=a(J);{var me=r=>{var d=Zt(),_=s(ve(d),4),V=a(_,!0);t(_);var G=s(_,2);{var re=ne=>{var I=Xt(),C=s(ve(I),2),P=a(C,!0);t(C),ce(2),F(()=>g(P,e(B).insights)),v(ne,I)};z(G,ne=>{e(B).insights!==null&&ne(re)})}F(ne=>g(V,ne),[()=>qt(e(B).recentMsAgo)]),v(r,d)},ge=r=>{var d=Jt();v(r,d)};z(Me,r=>{e(B).recent&&e(B).recentMsAgo!==null?r(me):r(ge,!1)})}t(J);var je=s(J,4),ke=s(a(je),2);Fe(ke,21,()=>e(Z),Be,(r,d)=>{var _=ea();F(V=>ft(_,`height: ${V??""}%; opacity: ${e(d).count===0?.18:.5+e(d).ratio*.5};`),[()=>Math.max(10,e(d).ratio*100)]),v(r,_)}),t(ke),t(je);var De=s(je,4),Oe=s(a(De),2);{var Pe=r=>{var d=ta();v(r,d)},ze=r=>{var d=sa(),_=ve(d),V=a(_,!0);t(_);var G=s(_,6),re=a(G,!0);t(G);var ne=s(G,4);{var I=C=>{var P=aa(),O=s(ve(P),2),Te=a(O,!0);t(O),ce(2),F(()=>g(Te,e(Q).failOpen)),v(C,P)};z(ne,C=>{var P;(P=e(Q))!=null&&P.failOpen&&C(I)})}F(()=>{var C,P,O;g(V,((P=(C=e(Q))==null?void 0:C.byVerdict)==null?void 0:P.VETO)??"—"),g(re,((O=e(Q))==null?void 0:O.appeals)??"—")}),v(r,d)};z(Oe,r=>{e(te)?r(Pe):r(ze,!1)})}t(De);var R=s(De,2);{var H=r=>{var d=ra();ce(2),v(r,d)};z(R,r=>{e(B).isDreaming&&r(H)})}var W=s(R,4);{var fe=r=>{var d=na();v(r,d)};z(W,r=>{e(u)&&r(fe)})}t(m),F(()=>{$=ee(m,1,"ambient-strip relative flex h-9 w-full items-center gap-0 overflow-hidden border-b border-synapse/15 bg-black/40 px-3 text-[11px] text-dim backdrop-blur-md svelte-1kk3799",null,$,{"ambient-flash":e(u)}),Ce=ee(Ne,1,"absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 svelte-1kk3799",null,Ce,{"bg-recall":e(w),"bg-warning":!e(w)}),j=ee(S,1,"relative inline-flex h-2 w-2 rounded-full svelte-1kk3799",null,j,{"bg-recall":e(w),"bg-warning":!e(w)}),g(ae,b()),U=ee(K,1,"svelte-1kk3799",null,U,{"text-recall":e(w),"text-warning":!e(w)}),g(he,`${e(N)??""}%`)}),v(n,m),Qe(),k()}var oa=h(" "),da=h('
  • '),ca=h(' ',1),va=h('

    Appeal recorded.

    '),pa=h('

    No appealable veto in this receipt.

    '),ua=h('
    Claim

    Verdict

    Precedent
      Fix

      Appeal
      '),ma=h('
      ');function fa(n,l){Ye(l,!0);const o=["PASS","NOTE","CAUTION","VETO","APPEALED"];let i=le(null),b=le(""),M=le(!1),k=le(null),N=le(null),w=Y(()=>{var u;return((u=e(i))==null?void 0:u.verdictBar)??(e(b)?"CAUTION":"NOTE")}),y=Y(()=>{var u,m;return((u=e(i))==null?void 0:u.claims.find($=>$.decision==="veto"))??((m=e(i))==null?void 0:m.claims.find($=>$.decision==="appealed"))??null}),p=Y(()=>{var u;return e(y)??((u=e(i))==null?void 0:u.claims[0])??null}),c=Y(()=>!!e(i)||!!e(b));et(()=>{T();const u=window.setInterval(T,4e3);return()=>window.clearInterval(u)});async function T(){var u;try{const m=await qe.sanhedrin.latest();f(i,m.receipt,!0),f(b,""),((u=m.receipt)==null?void 0:u.verdictBar)==="VETO"&&m.receipt.id!==e(N)&&(f(M,!0),f(N,m.receipt.id,!0))}catch(m){f(b,m instanceof Error?m.message:String(m),!0)}}async function L(u){var m;if(!(!e(y)||((m=e(i))==null?void 0:m.verdictBar)!=="VETO")){f(k,u,!0);try{const $=await qe.sanhedrin.appeal(u,void 0,e(y).id,e(i).id);f(i,$.receipt,!0),f(M,!0),f(b,"")}catch($){f(b,$ instanceof Error?$.message:String($),!0)}finally{f(k,null)}}}function B(u){if(!u)return"";const m=new Date(u);return Number.isNaN(m.getTime())?"":m.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Z(u){var m;return(m=u==null?void 0:u.precedent)!=null&&m.length?u.precedent.map($=>$.summary??$.command??"Precedent recorded.").slice(0,3):["No precedent attached."]}var Q=tt(),te=ve(Q);{var ue=u=>{var m=ma(),$=a(m),be=s(a($),2);Fe(be,21,()=>o,Be,(A,D)=>{var q=oa();let oe;var E=a(q,!0);t(q),F(()=>{Ae(q,"aria-current",e(D)===e(w)?"true":void 0),oe=ee(q,1,"svelte-1j425e6",null,oe,{active:e(D)===e(w)}),g(E,e(D))}),v(A,q)}),t(be);var xe=s(be,2),Ne=a(xe);t(xe);var Ce=s(xe,2),S=a(Ce);{var j=A=>{var D=st();F(()=>g(D,e(b))),v(A,D)},x=A=>{var D=st();F(()=>g(D,e(i).summary)),v(A,D)};z(S,A=>{e(b)?A(j):e(i)&&A(x,1)})}t(Ce);var ae=s(Ce,2),K=a(ae,!0);t(ae),t($);var U=s($,2);{var he=A=>{var D=ua(),q=a(D),oe=a(q),E=s(a(oe),2),X=a(E,!0);t(E),t(oe);var se=s(oe,2),de=s(a(se),2),Se=a(de);t(de),t(se);var J=s(se,2),Me=s(a(J),2);Fe(Me,21,()=>Z(e(p)),Be,(R,H)=>{var W=da(),fe=a(W,!0);t(W),F(()=>g(fe,e(H))),v(R,W)}),t(Me),t(J);var me=s(J,2),ge=s(a(me),2),je=a(ge,!0);t(ge),t(me),t(q);var ke=s(q,2),De=s(a(ke),2);{var Oe=R=>{var H=ca(),W=ve(H),fe=a(W,!0);t(W);var r=s(W,2),d=a(r,!0);t(r);var _=s(r,2),V=a(_,!0);t(_),F((G,re,ne)=>{W.disabled=G,g(fe,e(k)==="stale"?"Saving":"Stale"),r.disabled=re,g(d,e(k)==="wrong"?"Saving":"Wrong"),_.disabled=ne,g(V,e(k)==="too_strict"?"Saving":"Too strict")},[()=>!!e(k),()=>!!e(k),()=>!!e(k)]),ie("click",W,()=>L("stale")),ie("click",r,()=>L("wrong")),ie("click",_,()=>L("too_strict")),v(R,H)},Pe=R=>{var H=va();v(R,H)},ze=R=>{var H=pa();v(R,H)};z(De,R=>{e(y)&&e(i).verdictBar==="VETO"?R(Oe):e(i).verdictBar==="APPEALED"?R(Pe,1):R(ze,!1)})}t(ke),t(D),F(()=>{var R,H,W,fe;g(X,((R=e(p))==null?void 0:R.text)??e(i).draftPreview),g(Se,`${((H=e(p))==null?void 0:H.decision)??e(i).overall??""} · ${((W=e(p))==null?void 0:W.evidence_state)??e(w)??""}`),g(je,((fe=e(p))==null?void 0:fe.fix)||"No change required.")}),v(A,D)};z(U,A=>{e(M)&&e(i)&&A(he)})}t(m),F((A,D)=>{ee(m,1,A,"svelte-1j425e6"),Ae($,"aria-expanded",e(M)),g(Ne,`Current verdict: ${e(w)??""}`),g(K,D)},[()=>`verdict-bar tone-${e(w).toLowerCase()}`,()=>{var A;return B((A=e(i))==null?void 0:A.createdAt)}]),ie("click",$,()=>f(M,!e(M))),v(u,m)};z(te,u=>{e(c)&&u(ue)})}v(n,Q),Qe()}Ue(["click"]);const gt="vestige.theme",lt="vestige-theme-light",Re=ct("dark"),Je=ct(!0),ot=_t([Re,Je],([n,l])=>n==="auto"?l?"dark":"light":n);function ha(n){return n==="dark"||n==="light"||n==="auto"}function ga(n){if(ha(n)){Re.set(n);try{localStorage.setItem(gt,n)}catch{}}}function Xe(){const n=vt(Re);ga(n==="dark"?"light":n==="light"?"auto":"dark")}function ba(){if(document.getElementById(lt))return;const n=document.createElement("style");n.id=lt,n.textContent=` -/* Vestige light-mode overrides — injected by theme.ts. - * Activated by [data-theme='light'] on . - * Tokens mirror the real names used in app.css so the cascade stays clean. */ -[data-theme='light'] { - /* Core surface palette (slate scale) */ - --color-void: #f8fafc; /* slate-50 — page background */ - --color-abyss: #f1f5f9; /* slate-100 */ - --color-deep: #e2e8f0; /* slate-200 */ - --color-surface: #f1f5f9; /* slate-100 */ - --color-elevated: #e2e8f0; /* slate-200 */ - --color-subtle: #cbd5e1; /* slate-300 */ - --color-muted: #94a3b8; /* slate-400 */ - --color-dim: #475569; /* slate-600 */ - --color-text: #0f172a; /* slate-900 */ - --color-bright: #020617; /* slate-950 */ -} - -/* Baseline body/html wiring — app.css sets these against the dark - * tokens; we just let the variables do the work. Reassert for clarity. */ -[data-theme='light'] html, -html[data-theme='light'] { - background: var(--color-void); - color: var(--color-text); -} - -/* Glass surfaces — recompose on a light canvas. The original alphas - * are tuned for dark; invert-and-tint for light so panels still read - * as elevated instead of vanishing. */ -[data-theme='light'] .glass { - background: rgba(255, 255, 255, 0.65); - border: 1px solid rgba(99, 102, 241, 0.12); - box-shadow: - inset 0 1px 0 0 rgba(255, 255, 255, 0.6), - 0 4px 24px rgba(15, 23, 42, 0.08); -} -[data-theme='light'] .glass-subtle { - background: rgba(255, 255, 255, 0.55); - border: 1px solid rgba(99, 102, 241, 0.1); - box-shadow: - inset 0 1px 0 0 rgba(255, 255, 255, 0.5), - 0 2px 12px rgba(15, 23, 42, 0.06); -} -[data-theme='light'] .glass-sidebar { - background: rgba(248, 250, 252, 0.82); - border-right: 1px solid rgba(99, 102, 241, 0.14); - box-shadow: - inset -1px 0 0 0 rgba(255, 255, 255, 0.4), - 4px 0 24px rgba(15, 23, 42, 0.08); -} -[data-theme='light'] .glass-panel { - background: rgba(255, 255, 255, 0.75); - border: 1px solid rgba(99, 102, 241, 0.14); - box-shadow: - inset 0 1px 0 0 rgba(255, 255, 255, 0.5), - 0 8px 32px rgba(15, 23, 42, 0.1); -} - -/* Halve glow intensity — neon accents stay recognizable without - * washing out on slate-50. */ -[data-theme='light'] .glow-synapse { - box-shadow: 0 0 10px rgba(99, 102, 241, 0.15), 0 0 30px rgba(99, 102, 241, 0.05); -} -[data-theme='light'] .glow-dream { - box-shadow: 0 0 10px rgba(168, 85, 247, 0.15), 0 0 30px rgba(168, 85, 247, 0.05); -} -[data-theme='light'] .glow-memory { - box-shadow: 0 0 10px rgba(59, 130, 246, 0.15), 0 0 30px rgba(59, 130, 246, 0.05); -} - -/* Ambient orbs are gorgeous on black and blinding on white. Tame them. */ -[data-theme='light'] .ambient-orb { - opacity: 0.18; - filter: blur(100px); -} - -/* Scrollbar recolor for the lighter surface. */ -[data-theme='light'] ::-webkit-scrollbar-thumb { - background: #cbd5e1; -} -[data-theme='light'] ::-webkit-scrollbar-thumb:hover { - background: #94a3b8; -} -`,document.head.appendChild(n)}function dt(n){document.documentElement.dataset.theme=n}let ye=null,Ee=null,we=null,$e=null;function xa(){ye&&Ee&&ye.removeEventListener("change",Ee),$e==null||$e(),we==null||we(),ye=null,Ee=null,$e=null,we=null,ba();let n="dark";try{const l=localStorage.getItem(gt);(l==="dark"||l==="light"||l==="auto")&&(n=l)}catch{}return Re.set(n),ye=window.matchMedia("(prefers-color-scheme: dark)"),Je.set(ye.matches),Ee=l=>Je.set(l.matches),ye.addEventListener("change",Ee),dt(vt(ot)),$e=ot.subscribe(dt),we=Re.subscribe(()=>{}),()=>{ye&&Ee&&ye.removeEventListener("change",Ee),ye=null,Ee=null,$e==null||$e(),we==null||we(),$e=null,we=null}}var ka=h('');function _a(n){const l=()=>pe(Re,"$theme",o),[o,i]=He(),b={dark:"Dark",light:"Light",auto:"Auto (system)"},M={dark:"light",light:"auto",auto:"dark"};let k=Y(l),N=Y(()=>M[e(k)]),w=Y(()=>`Toggle theme: ${b[e(k)]} (click for ${b[e(N)]})`);var y=ka(),p=a(y),c=a(p);let T;var L=s(c,2);let B;var Z=s(L,2);let Q;t(p),t(y),F(()=>{Ae(y,"aria-label",e(w)),Ae(y,"title",e(w)),Ae(y,"data-mode",e(k)),T=ee(c,0,"icon svelte-1cmi4dh",null,T,{active:e(k)==="dark"}),B=ee(L,0,"icon svelte-1cmi4dh",null,B,{active:e(k)==="light"}),Q=ee(Z,0,"icon svelte-1cmi4dh",null,Q,{active:e(k)==="auto"})}),ie("click",y,function(...te){Xe==null||Xe.apply(this,te)}),v(n,y),i()}Ue(["click"]);var ya=h(' '),wa=h('
      '),$a=h(''),Aa=h(' '),Ca=h('
      ',1),Ma=h(''),Ta=h('
      No matches
      '),Ea=h('
      esc
      '),Sa=h(" ",1);function Qa(n,l){Ye(l,!0);const o=()=>pe(It,"$page",w),i=()=>pe(Et,"$isConnected",w),b=()=>pe(ut,"$memoryCount",w),M=()=>pe(mt,"$avgRetention",w),k=()=>pe(Tt,"$uptimeSeconds",w),N=()=>pe(pt,"$suppressedCount",w),[w,y]=He();let p=le(!1),c=le(""),T=le(void 0),L=Y(()=>o().url.pathname.startsWith(_e)?o().url.pathname.slice(_e.length)||"/":o().url.pathname),B=Y(()=>e(L)==="/waitlist"||e(L).startsWith("/waitlist/"));et(()=>{e(B)||it.connect();const S=xa();function j(x){if(e(B))return;if((x.metaKey||x.ctrlKey)&&x.key==="k"){x.preventDefault(),f(p,!e(p)),f(c,""),e(p)&&requestAnimationFrame(()=>{var U;return(U=e(T))==null?void 0:U.focus()});return}if(x.key==="Escape"&&e(p)){f(p,!1);return}if(x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement)return;if(x.key==="/"){x.preventDefault();const U=document.querySelector('input[type="text"]');U==null||U.focus();return}const K={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats",r:"/reasoning",a:"/activation",d:"/dreams",c:"/schedule",p:"/importance",u:"/duplicates",x:"/contradictions",n:"/patterns"}[x.key.toLowerCase()];K&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&(x.preventDefault(),nt(`${_e}${K}`))}return window.addEventListener("keydown",j),()=>{it.disconnect(),window.removeEventListener("keydown",j),S()}}),Ct(S=>{if(!(!document.startViewTransition||window.matchMedia("(prefers-reduced-motion: reduce)").matches))return new Promise(j=>{document.startViewTransition(async()=>{j(),await S.complete})})});const Z=[{href:"/blackbox",label:"Black Box",icon:"blackbox",shortcut:"B"},{href:"/memory-prs",label:"Memory PRs",icon:"memorypr",shortcut:"Q"},{href:"/graph",label:"Graph",icon:"graph",shortcut:"G"},{href:"/reasoning",label:"Reasoning",icon:"reasoning",shortcut:"R"},{href:"/memories",label:"Memories",icon:"memories",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"timeline",shortcut:"T"},{href:"/feed",label:"Feed",icon:"feed",shortcut:"F"},{href:"/explore",label:"Explore",icon:"explore",shortcut:"E"},{href:"/activation",label:"Activation",icon:"activation",shortcut:"A"},{href:"/dreams",label:"Dreams",icon:"dreams",shortcut:"D"},{href:"/schedule",label:"Schedule",icon:"schedule",shortcut:"C"},{href:"/importance",label:"Importance",icon:"importance",shortcut:"P"},{href:"/duplicates",label:"Duplicates",icon:"duplicates",shortcut:"U"},{href:"/contradictions",label:"Contradictions",icon:"contradictions",shortcut:"X"},{href:"/patterns",label:"Patterns",icon:"patterns",shortcut:"N"},{href:"/intentions",label:"Intentions",icon:"intentions",shortcut:"I"},{href:"/stats",label:"Stats",icon:"stats",shortcut:"S"},{href:"/settings",label:"Settings",icon:"settings",shortcut:","}],Q=Z.slice(0,5);function te(S,j){const x=j.startsWith(_e)?j.slice(_e.length)||"/":j;return S==="/graph"?x==="/"||x==="/graph":x.startsWith(S)}let ue=Y(()=>e(c)?Z.filter(S=>S.label.toLowerCase().includes(e(c).toLowerCase())):Z);function u(S){f(p,!1),f(c,""),nt(`${_e}${S}`)}var m=Sa(),$=ve(m);{var be=S=>{var j=tt(),x=ve(j);rt(x,()=>l.children),v(S,j)},xe=S=>{var j=Ca(),x=s(ve(j),6),ae=a(x),K=a(ae),U=a(K),he=a(U);Le(he,{name:"logo",size:18,strokeWidth:1.8}),t(U),ce(2),t(K);var A=s(K,2);Fe(A,21,()=>Z,Be,(I,C)=>{const P=Y(()=>te(e(C).href,o().url.pathname));var O=ya(),Te=a(O),We=a(Te);Le(We,{get name(){return e(C).icon},size:18}),t(Te);var Ke=s(Te,2),bt=a(Ke,!0);t(Ke);var at=s(Ke,2),xt=a(at,!0);t(at),t(O),F(()=>{Ae(O,"href",`${_e??""}${e(C).href??""}`),ee(O,1,`nav-link group flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm - ${e(P)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)] nav-active-border":"text-dim hover:text-text hover:bg-white/[0.03] border border-transparent"}`,"svelte-12qhfyh"),g(bt,e(C).label),g(xt,e(C).shortcut)}),v(I,O)}),t(A);var D=s(A,2),q=a(D),oe=a(q);Le(oe,{name:"command",size:14}),ce(4),t(q),t(D);var E=s(D,2),X=a(E),se=a(X),de=s(se,2),Se=a(de,!0);t(de);var J=s(de,2),Me=a(J);_a(Me),t(J),t(X);var me=s(X,2),ge=a(me),je=a(ge);t(ge);var ke=s(ge,2),De=a(ke);t(ke);var Oe=s(ke,2);{var Pe=I=>{var C=wa(),P=a(C);t(C),F(O=>g(P,`up ${O??""}`),[()=>St(k())]),v(I,C)};z(Oe,I=>{k()>0&&I(Pe)})}t(me);var ze=s(me,2);{var R=I=>{var C=$a(),P=a(C);Nt(P),t(C),v(I,C)};z(ze,I=>{N()>0&&I(R)})}t(E),t(ae);var H=s(ae,2),W=a(H);la(W,{});var fe=s(W,2);fa(fe,{});var r=s(fe,2),d=a(r);rt(d,()=>l.children),t(r),t(H);var _=s(H,2),V=a(_),G=a(V);Fe(G,17,()=>Q,Be,(I,C)=>{const P=Y(()=>te(e(C).href,o().url.pathname));var O=Aa(),Te=a(O);Le(Te,{get name(){return e(C).icon},size:20});var We=s(Te,2),Ke=a(We,!0);t(We),t(O),F(()=>{Ae(O,"href",`${_e??""}${e(C).href??""}`),ee(O,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem] - ${e(P)?"text-synapse-glow":"text-muted"}`),g(Ke,e(C).label)}),v(I,O)});var re=s(G,2);t(V),t(_),t(x);var ne=s(x,2);Vt(ne,{}),F(I=>{Ae(K,"href",`${_e??""}/graph`),ee(se,1,`w-2 h-2 rounded-full ${i()?"bg-recall animate-pulse-glow":"bg-decay"}`),g(Se,i()?"Connected":"Offline"),g(je,`${b()??""} memories`),g(De,`${I??""}% retention`)},[()=>(M()*100).toFixed(0)]),ie("click",q,()=>{f(p,!0),f(c,""),requestAnimationFrame(()=>{var I;return(I=e(T))==null?void 0:I.focus()})}),ie("click",re,()=>{f(p,!0),f(c,""),requestAnimationFrame(()=>{var I;return(I=e(T))==null?void 0:I.focus()})}),v(S,j)};z($,S=>{e(B)?S(be):S(xe,!1)})}var Ne=s($,2);{var Ce=S=>{var j=Ea(),x=a(j),ae=a(x),K=a(ae),U=a(K);Le(U,{name:"search",size:16}),t(K);var he=s(K,2);yt(he),$t(he,E=>f(T,E),()=>e(T)),ce(2),t(ae);var A=s(ae,2),D=a(A);Fe(D,17,()=>e(ue),Be,(E,X)=>{var se=Ma(),de=a(se),Se=a(de);Le(Se,{get name(){return e(X).icon},size:17}),t(de);var J=s(de,2),Me=a(J,!0);t(J);var me=s(J,2),ge=a(me,!0);t(me),t(se),F(()=>{g(Me,e(X).label),g(ge,e(X).shortcut)}),ie("click",se,()=>u(e(X).href)),v(E,se)});var q=s(D,2);{var oe=E=>{var X=Ta();v(E,X)};z(q,E=>{e(ue).length===0&&E(oe)})}t(A),t(x),t(j),ie("keydown",j,E=>{E.key==="Escape"&&f(p,!1)}),ie("click",j,E=>{E.target===E.currentTarget&&f(p,!1)}),ie("keydown",he,E=>{E.key==="Enter"&&e(ue).length>0&&u(e(ue)[0].href)}),wt(he,()=>e(c),E=>f(c,E)),v(S,j)};z(Ne,S=>{e(p)&&!e(B)&&S(Ce)})}v(n,m),Qe(),y()}Ue(["click","keydown"]);export{Qa as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js.br b/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js.br deleted file mode 100644 index 758b7bb..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js.gz b/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js.gz deleted file mode 100644 index 738f852..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/0.BmfNagK9.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js b/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js new file mode 100644 index 0000000..c0cb6e3 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js @@ -0,0 +1,86 @@ +import"../chunks/Bzak7iHL.js";import{o as tt}from"../chunks/JVtQszIZ.js";import{c as at,f as de,a as v,h as s,e as a,r as t,t as F,j as h,p as Qe,n as oe,g as e,b as Ue,s as ne,d as _t,i as f,u as q,m as rt}from"../chunks/CW7md74C.js";import{s as g,d as Xe,a as re,e as Ye,b as yt,w as vt,g as pt}from"../chunks/D90q9c2i.js";import{i as K}from"../chunks/9-jplUL5.js";import{e as De,a as Ce,i as Be,s as te,r as wt}from"../chunks/Cc0l8Nd4.js";import{s as nt}from"../chunks/EQUhm_ep.js";import{b as $t}from"../chunks/CFefTDKL.js";import{b as At}from"../chunks/ChcFQRZo.js";import{s as ce,a as He}from"../chunks/BjbQ7qSx.js";import{s as Ct,o as Mt,g as it}from"../chunks/Dm3aSj4w.js";import{b as ye}from"../chunks/CaEJGM7b.js";import{s as ut,b as mt,a as ft,e as Tt,w as lt,u as Et,i as St,f as jt}from"../chunks/BFpewGai.js";import{i as Dt}from"../chunks/C9BpaXFO.js";import{s as ht}from"../chunks/BNUnVJrY.js";import{t as je}from"../chunks/BGTfzpXY.js";import{a as We}from"../chunks/C-rZhKee.js";import{I as Le}from"../chunks/CqwrgJOn.js";const It=()=>{const n=Ct;return{page:{subscribe:n.page.subscribe},navigating:{subscribe:n.navigating.subscribe},updated:n.updated}},Ft={subscribe(n){return It().page.subscribe(n)}};var Nt=h('
      ');function Lt(n){const l=()=>ce(ut,"$suppressedCount",o),[o,i]=He();var b=at(),T=de(b);{var k=N=>{var A=Nt(),_=s(a(A),2),u=a(_);t(_),t(A),F(()=>g(u,`Actively forgetting ${l()??""} ${l()===1?"memory":"memories"}`)),v(N,A)};K(T,N=>{l()>0&&N(k)})}v(n,b),i()}var Bt=h(''),Vt=h('
      ');function Rt(n,l){Qe(l,!1);const o=()=>ce(je,"$toasts",i),[i,b]=He(),T={DreamCompleted:"✦",ConsolidationCompleted:"◉",ConnectionDiscovered:"⟷",MemoryPromoted:"↑",MemoryDemoted:"↓",MemorySuppressed:"◬",MemoryUnsuppressed:"◉",Rac1CascadeSwept:"✺",MemoryDeleted:"✕",HookVerdictRecorded:"⚑"};function k(u){return T[u]??"◆"}function N(u){je.dismiss(u.id)}function A(u,c){(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),je.dismiss(c.id))}Dt();var _=Vt();De(_,5,o,u=>u.id,(u,c)=>{var E=Bt(),L=s(a(E),2),B=a(L),X=a(B),R=a(X,!0);t(X);var ie=s(X,2),xe=a(ie,!0);t(ie),t(B);var p=s(B,2),m=a(p,!0);t(p),t(L),oe(2),t(E),F(C=>{Ce(E,"aria-label",`${e(c).title??""}: ${e(c).body??""}. Click to dismiss.`),ht(E,`--toast-color: ${e(c).color??""}; --toast-dwell: ${e(c).dwellMs??""}ms;`),g(R,C),g(xe,e(c).title),g(m,e(c).body)},[()=>k(e(c).type)]),re("click",E,()=>N(e(c))),re("keydown",E,C=>A(C,e(c))),Ye("mouseenter",E,()=>je.pauseDwell(e(c).id,e(c).dwellMs)),Ye("mouseleave",E,()=>je.resumeDwell(e(c).id)),Ye("focus",E,()=>je.pauseDwell(e(c).id,e(c).dwellMs)),Ye("blur",E,()=>je.resumeDwell(e(c).id)),v(u,E)}),t(_),v(n,_),Ue(),b()}Xe(["click","keydown"]);function Ve(n){const l=n.data;if(!l||typeof l!="object")return null;const o=l.timestamp??l.at??l.occurred_at;if(o==null)return null;if(typeof o=="number")return Number.isFinite(o)?o>1e12?o:o*1e3:null;if(typeof o!="string")return null;const i=Date.parse(o);return Number.isFinite(i)?i:null}const Je=10,gt=3e4,Ot=Je*gt;function Pt(n,l){const o=l-Ot,i=new Array(Je).fill(0);for(const T of n){if(T.type==="Heartbeat")continue;const k=Ve(T);if(k===null||kl)continue;const N=Math.min(Je-1,Math.floor((k-o)/gt));i[N]+=1}const b=Math.max(1,...i);return i.map(T=>({count:T,ratio:T/b}))}function zt(n,l){const o=l-864e5;for(const i of n){if(i.type!=="DreamCompleted")continue;return(Ve(i)??l)>=o?i:null}return null}function Kt(n){if(!n||!n.data)return null;const l=n.data,o=typeof l.insights_generated=="number"?l.insights_generated:typeof l.insightsGenerated=="number"?l.insightsGenerated:null;return o!==null&&Number.isFinite(o)?o:null}function qt(n,l){let o=null,i=null;for(const N of n)if(!o&&N.type==="DreamStarted"&&(o=N),!i&&N.type==="DreamCompleted"&&(i=N),o&&i)break;if(!o)return!1;const b=Ve(o)??l,T=l-300*1e3;return b=i}return!1}var Gt=h(' at risk',1),Yt=h('0 at risk',1),Qt=h(' at risk',1),Ut=h(' intentions',1),Xt=h('— intentions'),Zt=h('· insights',1),Jt=h(' Last dream: ',1),ea=h('No recent dream'),ta=h('
      '),aa=h('telemetry unavailable'),sa=h('· fail-open',1),ra=h(' vetoes · appeals ',1),na=h('
      DREAMING...
      ',1),ia=h(''),la=h('
      memories · avg retention
      ');function oa(n,l){Qe(l,!0);const o=()=>ce(ft,"$avgRetention",T),i=()=>ce(Tt,"$eventFeed",T),b=()=>ce(mt,"$memoryCount",T),[T,k]=He(),N=q(()=>Math.round((o()??0)*100)),A=q(()=>(o()??0)>=.5);let _=ne(null);async function u(){try{const r=await We.retentionDistribution();if(Array.isArray(r.endangered)&&r.endangered.length>0){f(_,r.endangered.length,!0);return}const d=r.distribution??[];let y=0;for(const V of d){const W=/^(\d+)/.exec(V.range);if(!W)continue;const ee=Number.parseInt(W[1],10);Number.isFinite(ee)&&ee<30&&(y+=V.count??0)}f(_,y,!0)}catch{f(_,null)}}let c=ne(null);async function E(){var r;try{const d=await We.intentions("active");f(c,d.total??((r=d.intentions)==null?void 0:r.length)??0,!0)}catch{f(c,null)}}let L=ne(_t(Date.now()));const B=q(()=>{const r=i(),d=zt(r,e(L)),y=d?Ve(d)??e(L):null,V=y!==null?e(L)-y:null;return{isDreaming:qt(r,e(L)),recent:d,recentMsAgo:V,insights:Kt(d)}}),X=q(()=>Pt(i(),e(L)));let R=ne(null),ie=ne(!1);async function xe(){try{f(R,await We.sanhedrin.telemetry(7),!0),f(ie,!1)}catch{f(R,null),f(ie,!0)}}const p=q(()=>Ht(i(),e(L)));tt(()=>{u(),E(),xe();const r=setInterval(()=>{f(L,Date.now(),!0)},1e3),d=setInterval(()=>{u(),E(),xe()},6e4);return()=>{clearInterval(r),clearInterval(d)}});var m=la();let C;var ge=a(m),ke=a(ge),Ie=a(ke);let Me;var Oe=s(Ie,2);let S;t(ke);var j=s(ke,2),x=a(j,!0);t(j);var Z=s(j,6);let H;var Y=a(Z);t(Z),oe(2),t(ge);var M=s(ge,4),I=a(M);{var P=r=>{var d=Gt(),y=de(d),V=a(y,!0);t(y),oe(2),F(()=>g(V,e(_))),v(r,d)},J=r=>{var d=Yt();oe(2),v(r,d)},be=r=>{var d=Qt();oe(2),v(r,d)};K(I,r=>{e(_)!==null&&e(_)>0?r(P):e(_)===0?r(J,1):r(be,!1)})}t(M);var D=s(M,4),G=a(D);{var le=r=>{var d=Ut(),y=de(d);let V;var W=s(y,2);let ee;var ae=a(W,!0);t(W),oe(2),F(()=>{V=te(y,1,"inline-flex h-2 w-2 rounded-full svelte-1kk3799",null,V,{"bg-node-pattern":e(c)>5,"animate-ping-slow":e(c)>5,"bg-muted":e(c)<=5}),ee=te(W,1,"tabular-nums svelte-1kk3799",null,ee,{"text-node-pattern":e(c)>5,"text-text":e(c)>0&&e(c)<=5,"text-muted":e(c)===0}),g(ae,e(c))}),v(r,d)},ve=r=>{var d=Xt();v(r,d)};K(G,r=>{e(c)!==null?r(le):r(ve,!1)})}t(D);var pe=s(D,4),ue=a(pe);{var Te=r=>{var d=Jt(),y=s(de(d),4),V=a(y,!0);t(y);var W=s(y,2);{var ee=ae=>{var Fe=Zt(),w=s(de(Fe),2),$=a(w,!0);t(w),oe(2),F(()=>g($,e(B).insights)),v(ae,Fe)};K(W,ae=>{e(B).insights!==null&&ae(ee)})}F(ae=>g(V,ae),[()=>Wt(e(B).recentMsAgo)]),v(r,d)},me=r=>{var d=ea();v(r,d)};K(ue,r=>{e(B).recent&&e(B).recentMsAgo!==null?r(Te):r(me,!1)})}t(pe);var fe=s(pe,4),Se=s(a(fe),2);De(Se,21,()=>e(X),Be,(r,d)=>{var y=ta();F(V=>ht(y,`height: ${V??""}%; opacity: ${e(d).count===0?.18:.5+e(d).ratio*.5};`),[()=>Math.max(10,e(d).ratio*100)]),v(r,y)}),t(Se),t(fe);var _e=s(fe,4),Pe=s(a(_e),2);{var ze=r=>{var d=aa();v(r,d)},Ke=r=>{var d=ra(),y=de(d),V=a(y,!0);t(y);var W=s(y,6),ee=a(W,!0);t(W);var ae=s(W,4);{var Fe=w=>{var $=sa(),se=s(de($),2),U=a(se,!0);t(se),oe(2),F(()=>g(U,e(R).failOpen)),v(w,$)};K(ae,w=>{var $;($=e(R))!=null&&$.failOpen&&w(Fe)})}F(()=>{var w,$,se;g(V,(($=(w=e(R))==null?void 0:w.byVerdict)==null?void 0:$.VETO)??"—"),g(ee,((se=e(R))==null?void 0:se.appeals)??"—")}),v(r,d)};K(Pe,r=>{e(ie)?r(ze):r(Ke,!1)})}t(_e);var O=s(_e,2);{var Q=r=>{var d=na();oe(2),v(r,d)};K(O,r=>{e(B).isDreaming&&r(Q)})}var z=s(O,4);{var he=r=>{var d=ia();v(r,d)};K(z,r=>{e(p)&&r(he)})}t(m),F(()=>{C=te(m,1,"ambient-strip relative flex h-9 w-full items-center gap-0 overflow-hidden border-b border-synapse/15 bg-black/40 px-3 text-[11px] text-dim backdrop-blur-md svelte-1kk3799",null,C,{"ambient-flash":e(p)}),Me=te(Ie,1,"absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 svelte-1kk3799",null,Me,{"bg-recall":e(A),"bg-warning":!e(A)}),S=te(Oe,1,"relative inline-flex h-2 w-2 rounded-full svelte-1kk3799",null,S,{"bg-recall":e(A),"bg-warning":!e(A)}),g(x,b()),H=te(Z,1,"svelte-1kk3799",null,H,{"text-recall":e(A),"text-warning":!e(A)}),g(Y,`${e(N)??""}%`)}),v(n,m),Ue(),k()}var da=h(" "),ca=h('
    • '),va=h(' ',1),pa=h('

      Appeal recorded.

      '),ua=h('

      No appealable veto in this receipt.

      '),ma=h('
      Claim

      Verdict

      Precedent
        Fix

        Appeal
        '),fa=h('
        ');function ha(n,l){Qe(l,!0);const o=["PASS","NOTE","CAUTION","VETO","APPEALED"];let i=ne(null),b=ne(""),T=ne(!1),k=ne(null),N=ne(null),A=q(()=>{var p;return((p=e(i))==null?void 0:p.verdictBar)??(e(b)?"CAUTION":"NOTE")}),_=q(()=>{var p,m;return((p=e(i))==null?void 0:p.claims.find(C=>C.decision==="veto"))??((m=e(i))==null?void 0:m.claims.find(C=>C.decision==="appealed"))??null}),u=q(()=>{var p;return e(_)??((p=e(i))==null?void 0:p.claims[0])??null}),c=q(()=>!!e(i)||!!e(b));tt(()=>{E();const p=window.setInterval(E,4e3);return()=>window.clearInterval(p)});async function E(){var p;try{const m=await We.sanhedrin.latest();f(i,m.receipt,!0),f(b,""),((p=m.receipt)==null?void 0:p.verdictBar)==="VETO"&&m.receipt.id!==e(N)&&(f(T,!0),f(N,m.receipt.id,!0))}catch(m){f(b,m instanceof Error?m.message:String(m),!0)}}async function L(p){var m;if(!(!e(_)||((m=e(i))==null?void 0:m.verdictBar)!=="VETO")){f(k,p,!0);try{const C=await We.sanhedrin.appeal(p,void 0,e(_).id,e(i).id);f(i,C.receipt,!0),f(T,!0),f(b,"")}catch(C){f(b,C instanceof Error?C.message:String(C),!0)}finally{f(k,null)}}}function B(p){if(!p)return"";const m=new Date(p);return Number.isNaN(m.getTime())?"":m.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function X(p){var m;return(m=p==null?void 0:p.precedent)!=null&&m.length?p.precedent.map(C=>C.summary??C.command??"Precedent recorded.").slice(0,3):["No precedent attached."]}var R=at(),ie=de(R);{var xe=p=>{var m=fa(),C=a(m),ge=s(a(C),2);De(ge,21,()=>o,Be,(M,I)=>{var P=da();let J;var be=a(P,!0);t(P),F(()=>{Ce(P,"aria-current",e(I)===e(A)?"true":void 0),J=te(P,1,"svelte-1j425e6",null,J,{active:e(I)===e(A)}),g(be,e(I))}),v(M,P)}),t(ge);var ke=s(ge,2),Ie=a(ke);t(ke);var Me=s(ke,2),Oe=a(Me);{var S=M=>{var I=rt();F(()=>g(I,e(b))),v(M,I)},j=M=>{var I=rt();F(()=>g(I,e(i).summary)),v(M,I)};K(Oe,M=>{e(b)?M(S):e(i)&&M(j,1)})}t(Me);var x=s(Me,2),Z=a(x,!0);t(x),t(C);var H=s(C,2);{var Y=M=>{var I=ma(),P=a(I),J=a(P),be=s(a(J),2),D=a(be,!0);t(be),t(J);var G=s(J,2),le=s(a(G),2),ve=a(le);t(le),t(G);var pe=s(G,2),ue=s(a(pe),2);De(ue,21,()=>X(e(u)),Be,(O,Q)=>{var z=ca(),he=a(z,!0);t(z),F(()=>g(he,e(Q))),v(O,z)}),t(ue),t(pe);var Te=s(pe,2),me=s(a(Te),2),fe=a(me,!0);t(me),t(Te),t(P);var Se=s(P,2),_e=s(a(Se),2);{var Pe=O=>{var Q=va(),z=de(Q),he=a(z,!0);t(z);var r=s(z,2),d=a(r,!0);t(r);var y=s(r,2),V=a(y,!0);t(y),F((W,ee,ae)=>{z.disabled=W,g(he,e(k)==="stale"?"Saving":"Stale"),r.disabled=ee,g(d,e(k)==="wrong"?"Saving":"Wrong"),y.disabled=ae,g(V,e(k)==="too_strict"?"Saving":"Too strict")},[()=>!!e(k),()=>!!e(k),()=>!!e(k)]),re("click",z,()=>L("stale")),re("click",r,()=>L("wrong")),re("click",y,()=>L("too_strict")),v(O,Q)},ze=O=>{var Q=pa();v(O,Q)},Ke=O=>{var Q=ua();v(O,Q)};K(_e,O=>{e(_)&&e(i).verdictBar==="VETO"?O(Pe):e(i).verdictBar==="APPEALED"?O(ze,1):O(Ke,!1)})}t(Se),t(I),F(()=>{var O,Q,z,he;g(D,((O=e(u))==null?void 0:O.text)??e(i).draftPreview),g(ve,`${((Q=e(u))==null?void 0:Q.decision)??e(i).overall??""} · ${((z=e(u))==null?void 0:z.evidence_state)??e(A)??""}`),g(fe,((he=e(u))==null?void 0:he.fix)||"No change required.")}),v(M,I)};K(H,M=>{e(T)&&e(i)&&M(Y)})}t(m),F((M,I)=>{te(m,1,M,"svelte-1j425e6"),Ce(C,"aria-expanded",e(T)),g(Ie,`Current verdict: ${e(A)??""}`),g(Z,I)},[()=>`verdict-bar tone-${e(A).toLowerCase()}`,()=>{var M;return B((M=e(i))==null?void 0:M.createdAt)}]),re("click",C,()=>f(T,!e(T))),v(p,m)};K(ie,p=>{e(c)&&p(xe)})}v(n,R),Ue()}Xe(["click"]);const bt="vestige.theme",ot="vestige-theme-light",Re=vt("dark"),et=vt(!0),dt=yt([Re,et],([n,l])=>n==="auto"?l?"dark":"light":n);function ga(n){return n==="dark"||n==="light"||n==="auto"}function ba(n){if(ga(n)){Re.set(n);try{localStorage.setItem(bt,n)}catch{}}}function Ze(){const n=pt(Re);ba(n==="dark"?"light":n==="light"?"auto":"dark")}function xa(){if(document.getElementById(ot))return;const n=document.createElement("style");n.id=ot,n.textContent=` +/* Vestige light-mode overrides — injected by theme.ts. + * Activated by [data-theme='light'] on . + * Tokens mirror the real names used in app.css so the cascade stays clean. */ +[data-theme='light'] { + /* Core surface palette (slate scale) */ + --color-void: #f8fafc; /* slate-50 — page background */ + --color-abyss: #f1f5f9; /* slate-100 */ + --color-deep: #e2e8f0; /* slate-200 */ + --color-surface: #f1f5f9; /* slate-100 */ + --color-elevated: #e2e8f0; /* slate-200 */ + --color-subtle: #cbd5e1; /* slate-300 */ + --color-muted: #94a3b8; /* slate-400 */ + --color-dim: #475569; /* slate-600 */ + --color-text: #0f172a; /* slate-900 */ + --color-bright: #020617; /* slate-950 */ +} + +/* Baseline body/html wiring — app.css sets these against the dark + * tokens; we just let the variables do the work. Reassert for clarity. */ +[data-theme='light'] html, +html[data-theme='light'] { + background: var(--color-void); + color: var(--color-text); +} + +/* Glass surfaces — recompose on a light canvas. The original alphas + * are tuned for dark; invert-and-tint for light so panels still read + * as elevated instead of vanishing. */ +[data-theme='light'] .glass { + background: rgba(255, 255, 255, 0.65); + border: 1px solid rgba(99, 102, 241, 0.12); + box-shadow: + inset 0 1px 0 0 rgba(255, 255, 255, 0.6), + 0 4px 24px rgba(15, 23, 42, 0.08); +} +[data-theme='light'] .glass-subtle { + background: rgba(255, 255, 255, 0.55); + border: 1px solid rgba(99, 102, 241, 0.1); + box-shadow: + inset 0 1px 0 0 rgba(255, 255, 255, 0.5), + 0 2px 12px rgba(15, 23, 42, 0.06); +} +[data-theme='light'] .glass-sidebar { + background: rgba(248, 250, 252, 0.82); + border-right: 1px solid rgba(99, 102, 241, 0.14); + box-shadow: + inset -1px 0 0 0 rgba(255, 255, 255, 0.4), + 4px 0 24px rgba(15, 23, 42, 0.08); +} +[data-theme='light'] .glass-panel { + background: rgba(255, 255, 255, 0.75); + border: 1px solid rgba(99, 102, 241, 0.14); + box-shadow: + inset 0 1px 0 0 rgba(255, 255, 255, 0.5), + 0 8px 32px rgba(15, 23, 42, 0.1); +} + +/* Halve glow intensity — neon accents stay recognizable without + * washing out on slate-50. */ +[data-theme='light'] .glow-synapse { + box-shadow: 0 0 10px rgba(99, 102, 241, 0.15), 0 0 30px rgba(99, 102, 241, 0.05); +} +[data-theme='light'] .glow-dream { + box-shadow: 0 0 10px rgba(168, 85, 247, 0.15), 0 0 30px rgba(168, 85, 247, 0.05); +} +[data-theme='light'] .glow-memory { + box-shadow: 0 0 10px rgba(59, 130, 246, 0.15), 0 0 30px rgba(59, 130, 246, 0.05); +} + +/* Ambient orbs are gorgeous on black and blinding on white. Tame them. */ +[data-theme='light'] .ambient-orb { + opacity: 0.18; + filter: blur(100px); +} + +/* Scrollbar recolor for the lighter surface. */ +[data-theme='light'] ::-webkit-scrollbar-thumb { + background: #cbd5e1; +} +[data-theme='light'] ::-webkit-scrollbar-thumb:hover { + background: #94a3b8; +} +`,document.head.appendChild(n)}function ct(n){document.documentElement.dataset.theme=n}let we=null,Ee=null,$e=null,Ae=null;function ka(){we&&Ee&&we.removeEventListener("change",Ee),Ae==null||Ae(),$e==null||$e(),we=null,Ee=null,Ae=null,$e=null,xa();let n="dark";try{const l=localStorage.getItem(bt);(l==="dark"||l==="light"||l==="auto")&&(n=l)}catch{}return Re.set(n),we=window.matchMedia("(prefers-color-scheme: dark)"),et.set(we.matches),Ee=l=>et.set(l.matches),we.addEventListener("change",Ee),ct(pt(dt)),Ae=dt.subscribe(ct),$e=Re.subscribe(()=>{}),()=>{we&&Ee&&we.removeEventListener("change",Ee),we=null,Ee=null,Ae==null||Ae(),$e==null||$e(),Ae=null,$e=null}}var _a=h('');function ya(n){const l=()=>ce(Re,"$theme",o),[o,i]=He(),b={dark:"Dark",light:"Light",auto:"Auto (system)"},T={dark:"light",light:"auto",auto:"dark"};let k=q(l),N=q(()=>T[e(k)]),A=q(()=>`Toggle theme: ${b[e(k)]} (click for ${b[e(N)]})`);var _=_a(),u=a(_),c=a(u);let E;var L=s(c,2);let B;var X=s(L,2);let R;t(u),t(_),F(()=>{Ce(_,"aria-label",e(A)),Ce(_,"title",e(A)),Ce(_,"data-mode",e(k)),E=te(c,0,"icon svelte-1cmi4dh",null,E,{active:e(k)==="dark"}),B=te(L,0,"icon svelte-1cmi4dh",null,B,{active:e(k)==="light"}),R=te(X,0,"icon svelte-1cmi4dh",null,R,{active:e(k)==="auto"})}),re("click",_,function(...ie){Ze==null||Ze.apply(this,ie)}),v(n,_),i()}Xe(["click"]);var wa=h(' '),$a=h('
        '),Aa=h(''),Ca=h(' '),Ma=h('
        ',1),Ta=h(''),Ea=h('
        No matches
        '),Sa=h('
        esc
        '),ja=h(" ",1);function Ua(n,l){Qe(l,!0);const o=()=>ce(Ft,"$page",A),i=()=>ce(St,"$isConnected",A),b=()=>ce(mt,"$memoryCount",A),T=()=>ce(ft,"$avgRetention",A),k=()=>ce(Et,"$uptimeSeconds",A),N=()=>ce(ut,"$suppressedCount",A),[A,_]=He();let u=ne(!1),c=ne(""),E=ne(void 0),L=q(()=>o().url.pathname.startsWith(ye)?o().url.pathname.slice(ye.length)||"/":o().url.pathname),B=q(()=>e(L)==="/waitlist"||e(L).startsWith("/waitlist/")),X=q(()=>e(L).startsWith("/observatory"));tt(()=>{!e(B)&&!e(X)&<.connect();const S=ka();function j(x){if(e(B)||e(X))return;if((x.metaKey||x.ctrlKey)&&x.key==="k"){x.preventDefault(),f(u,!e(u)),f(c,""),e(u)&&requestAnimationFrame(()=>{var Y;return(Y=e(E))==null?void 0:Y.focus()});return}if(x.key==="Escape"&&e(u)){f(u,!1);return}if(x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement)return;if(x.key==="/"){x.preventDefault();const Y=document.querySelector('input[type="text"]');Y==null||Y.focus();return}const H={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats",r:"/reasoning",a:"/activation",d:"/dreams",c:"/schedule",p:"/importance",u:"/duplicates",x:"/contradictions",n:"/patterns"}[x.key.toLowerCase()];H&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&(x.preventDefault(),it(`${ye}${H}`))}return window.addEventListener("keydown",j),()=>{lt.disconnect(),window.removeEventListener("keydown",j),S()}}),Mt(S=>{if(!(!document.startViewTransition||window.matchMedia("(prefers-reduced-motion: reduce)").matches))return new Promise(j=>{document.startViewTransition(async()=>{j(),await S.complete})})});const R=[{href:"/observatory",label:"Observatory",icon:"sparkle",shortcut:"O"},{href:"/blackbox",label:"Black Box",icon:"blackbox",shortcut:"B"},{href:"/memory-prs",label:"Memory PRs",icon:"memorypr",shortcut:"Q"},{href:"/graph",label:"Graph",icon:"graph",shortcut:"G"},{href:"/reasoning",label:"Reasoning",icon:"reasoning",shortcut:"R"},{href:"/memories",label:"Memories",icon:"memories",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"timeline",shortcut:"T"},{href:"/feed",label:"Feed",icon:"feed",shortcut:"F"},{href:"/explore",label:"Explore",icon:"explore",shortcut:"E"},{href:"/activation",label:"Activation",icon:"activation",shortcut:"A"},{href:"/dreams",label:"Dreams",icon:"dreams",shortcut:"D"},{href:"/schedule",label:"Schedule",icon:"schedule",shortcut:"C"},{href:"/importance",label:"Importance",icon:"importance",shortcut:"P"},{href:"/duplicates",label:"Duplicates",icon:"duplicates",shortcut:"U"},{href:"/contradictions",label:"Contradictions",icon:"contradictions",shortcut:"X"},{href:"/patterns",label:"Patterns",icon:"patterns",shortcut:"N"},{href:"/intentions",label:"Intentions",icon:"intentions",shortcut:"I"},{href:"/stats",label:"Stats",icon:"stats",shortcut:"S"},{href:"/settings",label:"Settings",icon:"settings",shortcut:","}],ie=R.slice(0,5);function xe(S,j){const x=j.startsWith(ye)?j.slice(ye.length)||"/":j;return S==="/graph"?x==="/"||x==="/graph":x.startsWith(S)}let p=q(()=>e(c)?R.filter(S=>S.label.toLowerCase().includes(e(c).toLowerCase())):R);function m(S){f(u,!1),f(c,""),it(`${ye}${S}`)}var C=ja(),ge=de(C);{var ke=S=>{var j=at(),x=de(j);nt(x,()=>l.children),v(S,j)},Ie=S=>{var j=Ma(),x=s(de(j),6),Z=a(x),H=a(Z),Y=a(H),M=a(Y);Le(M,{name:"logo",size:18,strokeWidth:1.8}),t(Y),oe(2),t(H);var I=s(H,2);De(I,21,()=>R,Be,(w,$)=>{const se=q(()=>xe(e($).href,o().url.pathname));var U=wa(),Ne=a(U),Ge=a(Ne);Le(Ge,{get name(){return e($).icon},size:18}),t(Ne);var qe=s(Ne,2),xt=a(qe,!0);t(qe);var st=s(qe,2),kt=a(st,!0);t(st),t(U),F(()=>{Ce(U,"href",`${ye??""}${e($).href??""}`),te(U,1,`nav-link group flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm + ${e(se)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)] nav-active-border":"text-dim hover:text-text hover:bg-white/[0.03] border border-transparent"}`,"svelte-12qhfyh"),g(xt,e($).label),g(kt,e($).shortcut)}),v(w,U)}),t(I);var P=s(I,2),J=a(P),be=a(J);Le(be,{name:"command",size:14}),oe(4),t(J),t(P);var D=s(P,2),G=a(D),le=a(G),ve=s(le,2),pe=a(ve,!0);t(ve);var ue=s(ve,2),Te=a(ue);ya(Te),t(ue),t(G);var me=s(G,2),fe=a(me),Se=a(fe);t(fe);var _e=s(fe,2),Pe=a(_e);t(_e);var ze=s(_e,2);{var Ke=w=>{var $=$a(),se=a($);t($),F(U=>g(se,`up ${U??""}`),[()=>jt(k())]),v(w,$)};K(ze,w=>{k()>0&&w(Ke)})}t(me);var O=s(me,2);{var Q=w=>{var $=Aa(),se=a($);Lt(se),t($),v(w,$)};K(O,w=>{N()>0&&w(Q)})}t(D),t(Z);var z=s(Z,2),he=a(z);oa(he,{});var r=s(he,2);ha(r,{});var d=s(r,2),y=a(d);nt(y,()=>l.children),t(d),t(z);var V=s(z,2),W=a(V),ee=a(W);De(ee,17,()=>ie,Be,(w,$)=>{const se=q(()=>xe(e($).href,o().url.pathname));var U=Ca(),Ne=a(U);Le(Ne,{get name(){return e($).icon},size:20});var Ge=s(Ne,2),qe=a(Ge,!0);t(Ge),t(U),F(()=>{Ce(U,"href",`${ye??""}${e($).href??""}`),te(U,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem] + ${e(se)?"text-synapse-glow":"text-muted"}`),g(qe,e($).label)}),v(w,U)});var ae=s(ee,2);t(W),t(V),t(x);var Fe=s(x,2);Rt(Fe,{}),F(w=>{Ce(H,"href",`${ye??""}/graph`),te(le,1,`w-2 h-2 rounded-full ${i()?"bg-recall animate-pulse-glow":"bg-decay"}`),g(pe,i()?"Connected":"Offline"),g(Se,`${b()??""} memories`),g(Pe,`${w??""}% retention`)},[()=>(T()*100).toFixed(0)]),re("click",J,()=>{f(u,!0),f(c,""),requestAnimationFrame(()=>{var w;return(w=e(E))==null?void 0:w.focus()})}),re("click",ae,()=>{f(u,!0),f(c,""),requestAnimationFrame(()=>{var w;return(w=e(E))==null?void 0:w.focus()})}),v(S,j)};K(ge,S=>{e(B)||e(X)?S(ke):S(Ie,!1)})}var Me=s(ge,2);{var Oe=S=>{var j=Sa(),x=a(j),Z=a(x),H=a(Z),Y=a(H);Le(Y,{name:"search",size:16}),t(H);var M=s(H,2);wt(M),At(M,D=>f(E,D),()=>e(E)),oe(2),t(Z);var I=s(Z,2),P=a(I);De(P,17,()=>e(p),Be,(D,G)=>{var le=Ta(),ve=a(le),pe=a(ve);Le(pe,{get name(){return e(G).icon},size:17}),t(ve);var ue=s(ve,2),Te=a(ue,!0);t(ue);var me=s(ue,2),fe=a(me,!0);t(me),t(le),F(()=>{g(Te,e(G).label),g(fe,e(G).shortcut)}),re("click",le,()=>m(e(G).href)),v(D,le)});var J=s(P,2);{var be=D=>{var G=Ea();v(D,G)};K(J,D=>{e(p).length===0&&D(be)})}t(I),t(x),t(j),re("keydown",j,D=>{D.key==="Escape"&&f(u,!1)}),re("click",j,D=>{D.target===D.currentTarget&&f(u,!1)}),re("keydown",M,D=>{D.key==="Enter"&&e(p).length>0&&m(e(p)[0].href)}),$t(M,()=>e(c),D=>f(c,D)),v(S,j)};K(Me,S=>{e(u)&&!e(B)&&!e(X)&&S(Oe)})}v(n,C),Ue(),_()}Xe(["click","keydown"]);export{Ua as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js.br b/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js.br new file mode 100644 index 0000000..ed6d52e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js.gz b/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js.gz new file mode 100644 index 0000000..7319a95 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/0.CufTSTHe.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js b/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js new file mode 100644 index 0000000..9e1a1ef --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{i as u}from"../chunks/C9BpaXFO.js";import{p as g,f as l,t as v,a as d,b as _,j as x,e as a,r as o,h as $}from"../chunks/CW7md74C.js";import{s as p}from"../chunks/D90q9c2i.js";import{p as m}from"../chunks/CaEJGM7b.js";import{s as b}from"../chunks/Dm3aSj4w.js";const k={get error(){return m.error},get status(){return m.status}};b.updated.check;const i=k;var j=x("

        ",1);function B(f,n){g(n,!1),u();var t=j(),r=l(t),c=a(r,!0);o(r);var e=$(r,2),h=a(e,!0);o(e),v(()=>{var s;p(c,i.status),p(h,(s=i.error)==null?void 0:s.message)}),d(f,t),_()}export{B as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js.br b/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js.br new file mode 100644 index 0000000..5b1bf14 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js.gz b/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js.gz new file mode 100644 index 0000000..f5d7b1b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/1.B0GVM9rf.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js b/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js deleted file mode 100644 index 2a32e99..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as u}from"../chunks/BLadwbF7.js";import{p as g,f as l,t as v,a as d,b as _,j as x,e as a,r as o,h as $}from"../chunks/wpu9U-D0.js";import{s as p}from"../chunks/D8mhvFt8.js";import{p as m}from"../chunks/Bxs5UR9-.js";import{s as b}from"../chunks/dCAmqaEc.js";const k={get error(){return m.error},get status(){return m.status}};b.updated.check;const i=k;var j=x("

        ",1);function B(f,n){g(n,!1),u();var t=j(),r=l(t),c=a(r,!0);o(r);var e=$(r,2),h=a(e,!0);o(e),v(()=>{var s;p(c,i.status),p(h,(s=i.error)==null?void 0:s.message)}),d(f,t),_()}export{B as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js.br b/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js.br deleted file mode 100644 index 1af4c86..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js.gz b/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js.gz deleted file mode 100644 index 27ffe28..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/1.MT4EnKSP.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js b/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js similarity index 92% rename from apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js rename to apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js index 47efa48..f870c87 100644 --- a/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js +++ b/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{p as oe,o as ve,g as e,i as E,e as s,h as v,r,f as ne,t as C,a as u,b as ie,s as W,u as k,j as p,n as X}from"../chunks/wpu9U-D0.js";import{s as F,d as me,a as ue}from"../chunks/D8mhvFt8.js";import{i as P}from"../chunks/DKve45Wd.js";import{e as le,i as ce,s as ae,a as pe}from"../chunks/60_R_Vbt.js";import{a as re,r as se}from"../chunks/P1-U_Xsj.js";import{s as S}from"../chunks/EqHb-9AZ.js";import{p as Z,a as fe,s as ee}from"../chunks/ByYB047u.js";import{w as _e,e as ge,i as xe,c as he}from"../chunks/BhIgFntf.js";import{E as $e}from"../chunks/CcUbQ_Wl.js";import{P as be}from"../chunks/BHDZZvku.js";import{I as te}from"../chunks/D7A-gG4Z.js";import{A as ye}from"../chunks/DcKTNC6e.js";var we=p(' '),Ce=p('
        '),Fe=p('
        ',1),Se=p('
        '),De=p('
        '),ke=p('
        Cognitive Search Pipeline
        ');function Pe(J,M){oe(M,!0);let V=Z(M,"resultCount",3,0),B=Z(M,"durationMs",3,0),R=Z(M,"active",3,!1);const f=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let b=W(-1),y=W(!1),w=W(!1);ve(()=>{R()&&!e(y)&&Q()});function Q(){E(y,!0),E(b,-1),E(w,!1);const o=Math.max(1500,(B()||50)*2),t=o/(f.length+1);f.forEach((n,c)=>{setTimeout(()=>{E(b,c,!0)},t*(c+1))}),setTimeout(()=>{E(w,!0),E(y,!1)},o)}var _=ke(),D=s(_),q=v(s(D),2);{var U=o=>{var t=we(),n=s(t);r(t),C(()=>F(n,`${V()??""} results in ${B()??""}ms`)),u(o,t)};P(q,o=>{e(w)&&o(U)})}r(D);var T=v(D,2);le(T,21,()=>f,ce,(o,t,n)=>{const c=k(()=>n<=e(b)),A=k(()=>n===e(b)&&e(y));var x=Fe(),h=ne(x),d=s(h),O=s(d,!0);r(d);var j=v(d,2),Y=s(j,!0);r(j),r(h);var z=v(h,2);{var G=L=>{var H=Ce();C(()=>S(H,`background: ${n{n{ae(d,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300 +import"../chunks/Bzak7iHL.js";import{p as oe,x as ve,g as e,i as E,e as s,h as v,r,f as ne,t as C,a as u,b as ie,s as W,u as k,j as p,n as X}from"../chunks/CW7md74C.js";import{s as F,d as me,a as ue}from"../chunks/D90q9c2i.js";import{i as P}from"../chunks/9-jplUL5.js";import{e as le,i as ce,s as ae,a as pe}from"../chunks/Cc0l8Nd4.js";import{a as re,r as se}from"../chunks/D8RjhgN0.js";import{s as S}from"../chunks/BNUnVJrY.js";import{p as Z,a as fe,s as ee}from"../chunks/BjbQ7qSx.js";import{w as _e,e as ge,i as xe,c as he}from"../chunks/BFpewGai.js";import{E as $e}from"../chunks/CcUbQ_Wl.js";import{P as be}from"../chunks/DTO0IjuV.js";import{I as te}from"../chunks/CqwrgJOn.js";import{A as ye}from"../chunks/CaR6YsRq.js";var we=p(' '),Ce=p('
        '),Fe=p('
        ',1),Se=p('
        '),De=p('
        '),ke=p('
        Cognitive Search Pipeline
        ');function Pe(J,M){oe(M,!0);let V=Z(M,"resultCount",3,0),B=Z(M,"durationMs",3,0),R=Z(M,"active",3,!1);const f=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let b=W(-1),y=W(!1),w=W(!1);ve(()=>{R()&&!e(y)&&Q()});function Q(){E(y,!0),E(b,-1),E(w,!1);const o=Math.max(1500,(B()||50)*2),t=o/(f.length+1);f.forEach((n,c)=>{setTimeout(()=>{E(b,c,!0)},t*(c+1))}),setTimeout(()=>{E(w,!0),E(y,!1)},o)}var _=ke(),D=s(_),q=v(s(D),2);{var U=o=>{var t=we(),n=s(t);r(t),C(()=>F(n,`${V()??""} results in ${B()??""}ms`)),u(o,t)};P(q,o=>{e(w)&&o(U)})}r(D);var T=v(D,2);le(T,21,()=>f,ce,(o,t,n)=>{const c=k(()=>n<=e(b)),A=k(()=>n===e(b)&&e(y));var x=Fe(),h=ne(x),d=s(h),O=s(d,!0);r(d);var j=v(d,2),Y=s(j,!0);r(j),r(h);var z=v(h,2);{var G=L=>{var H=Ce();C(()=>S(H,`background: ${n{n{ae(d,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300 ${e(A)?"scale-125":""}`),S(d,`background: ${e(c)?e(t).color+"25":"rgba(255,255,255,0.03)"}; border: 1.5px solid ${(e(c)?e(t).color:"rgba(255,255,255,0.06)")??""}; color: ${(e(c)?e(t).color:"#4a4a7a")??""}; diff --git a/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js.br b/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js.br new file mode 100644 index 0000000..ba56140 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js.gz b/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js.gz new file mode 100644 index 0000000..842f4d5 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/10.BGBsuJiH.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js.br b/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js.br deleted file mode 100644 index 24213d5..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js.gz b/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js.gz deleted file mode 100644 index 7b5fa64..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/10.DYHIt_do.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js b/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js new file mode 100644 index 0000000..e787757 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js @@ -0,0 +1,4076 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DsOxZJ9g.js","../chunks/Dp1pzeXC.js","../chunks/DSmtfx7F.js","../chunks/Bzak7iHL.js","../chunks/JVtQszIZ.js","../chunks/CW7md74C.js","../chunks/D90q9c2i.js","../chunks/9-jplUL5.js","../chunks/DExHDOmW.js","../chunks/Cc0l8Nd4.js","../chunks/ChcFQRZo.js","../chunks/BjbQ7qSx.js","../chunks/C-rZhKee.js","../chunks/CaEJGM7b.js","../chunks/BNUnVJrY.js","../chunks/CcUbQ_Wl.js","../assets/ObservatoryStage.CnF5Ezel.css"])))=>i.map(i=>d[i]); +var mo=Object.defineProperty;var _o=(e,t,n)=>t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>_o(e,typeof t!="symbol"?t+"":t,n);import"../chunks/Bzak7iHL.js";import{o as Nr,a as ua}from"../chunks/JVtQszIZ.js";import{s as Ne,d as qi,i as ee,g as b,p as Xn,x as gi,a as Ye,b as Yn,j as Ze,e as oe,h as fe,n as Fn,r as re,t as gt,u as en,c as Or,f as Tn,m as go,l as vo}from"../chunks/CW7md74C.js";import{s as Je,d as pa,a as ht}from"../chunks/D90q9c2i.js";import{i as ut}from"../chunks/9-jplUL5.js";import{k as So}from"../chunks/DsfUoj8c.js";import{e as ei,i as vi,a as mt,r as ai,s as ln,c as Eo}from"../chunks/Cc0l8Nd4.js";import{s as ri}from"../chunks/BNUnVJrY.js";import{b as Ki,a as va}from"../chunks/CFefTDKL.js";import{p as ti,a as xo,s as Mo}from"../chunks/BjbQ7qSx.js";import{b as Sa}from"../chunks/CaEJGM7b.js";import{b as Zi}from"../chunks/ChcFQRZo.js";import{aZ as To,az as bo,a7 as cn,F as Nt,C as be,aB as Fr,a9 as Vn,V as Me,O as Ao,fw as qt,e as Et,z as $n,H as dn,aY as An,aD as Yt,B as Vt,aC as oi,fD as Ro,fE as wo,a8 as yi,fF as yo,aE as Ln,i as Co,E as Po,b as Ke,a3 as Bn,cN as Do,au as tn,aV as Ti,aW as ha,aX as si,U as li,a6 as Br,fG as Lo,aa as Un,by as bi,ba as Uo,bb as Io,bc as jn,er as No,dh as Oo,es as Fo,di as Bo,bd as Ho,be as Go,bf as ko,bg as Vo,bh as zo,bi as Wo,bj as Xo,bk as Yo,bl as qo,bm as Ko,bn as Zo,a_ as jo,a$ as $o,b0 as Qo,x as Li,w as In,y as fi,b1 as Jo,b2 as ni,b3 as es,b4 as ts,b5 as ns,b6 as is,b7 as Hr,ad as as,b8 as rs,b9 as os,ay as Gr,a as nt,ek as ss,eI as ls,el as cs,eT as Ot,at as kt,ai as Rt,a1 as Bt,aA as kr,N as fn,ae as Jt,bH as Ai,bC as Vr,bD as zr,G as Qn,a5 as Wr,P as ma,bE as ds,bF as fs,bG as us,J as Xr,ao as bn,bI as ps,bJ as hs,bK as ms,bL as _s,bM as gs,bN as Yr,af as vs,bO as qr,bP as Kr,bQ as Ui,bR as Ii,bS as Ni,bT as Oi,f as ft,bU as Ea,bV as xa,bW as Ma,bX as Ta,bY as ba,bZ as Aa,b_ as Ra,b$ as wa,c0 as ya,c1 as Ca,c2 as Pa,c3 as Da,c4 as La,c5 as Ua,c6 as Ia,c7 as Na,c8 as Oa,c9 as Fa,ca as Ba,cb as Ha,cc as Ga,cd as Fi,eK as ka,eL as Va,ce as Ss,cf as za,cg as Wa,ch as Xa,bu as ji,bv as $i,bw as Qi,bx as Ji,bz as ea,bA as ta,bB as na,bo as Es,bp as Ya,bq as xs,Y as Si,br as Ms,bs as qa,bt as Ka,A as yt,aS as ia,aT as aa,ap as Ts,an as Zr,fH as Ri,as as Ci,$ as bs,a0 as As,fI as jr,a4 as $r,fJ as Za,ac as Qr,fK as ja,ec as Jr,g as ci,h as zn,a2 as eo,o as wi,cj as Rs,ck as ws,fL as ys,dM as $a,fM as It,e2 as Cs,et as Ps,ds as Ds,aQ as Ls,aP as Us,aO as to,aN as Is,aM as Ns,aL as Os,cD as Fs,dv as Bs,fN as Hs,ak as Gs,al as ks,am as Vs,cC as zs,cB as Ws,dj as Xs,ei as Hn,fd as Nn,eF as Qa,f1 as ra,eO as Ys,M as no,av as Ja,da as qs,aq as Ks,dJ as io,aI as Zs,aF as er,eP as js,I as $s,m as Gn,ex as kn,n as oa,e4 as sa,eS as Qs,ah as tr,fO as nr,f5 as ir,aU as Js,fP as el,fQ as tl,fR as ar,fS as nl,fT as rr,fU as il,fV as al,fW as rl,fC as or,fX as ol}from"../chunks/DSmtfx7F.js";import{N as sl}from"../chunks/CcUbQ_Wl.js";import{b as ll}from"../chunks/C4Tpoo1i.js";import{i as cl}from"../chunks/C9BpaXFO.js";import{_ as dl}from"../chunks/Dp1pzeXC.js";import{I as mn}from"../chunks/CqwrgJOn.js";import{D as fl}from"../chunks/DUAsElMg.js";import{a as Pn}from"../chunks/C-rZhKee.js";import{e as ul}from"../chunks/BFpewGai.js";/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */function ao(){let e=null,t=!1,n=null,i=null;function r(a,o){n(a,o),i=e.requestAnimationFrame(r)}return{start:function(){t!==!0&&n!==null&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(a){n=a},setContext:function(a){e=a}}}function pl(e){const t=new WeakMap;function n(s,u){const d=s.array,m=s.usage,_=d.byteLength,v=e.createBuffer();e.bindBuffer(u,v),e.bufferData(u,d,m),s.onUploadCallback();let h;if(d instanceof Float32Array)h=e.FLOAT;else if(d instanceof Uint16Array)s.isFloat16BufferAttribute?h=e.HALF_FLOAT:h=e.UNSIGNED_SHORT;else if(d instanceof Int16Array)h=e.SHORT;else if(d instanceof Uint32Array)h=e.UNSIGNED_INT;else if(d instanceof Int32Array)h=e.INT;else if(d instanceof Int8Array)h=e.BYTE;else if(d instanceof Uint8Array)h=e.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)h=e.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:v,type:h,bytesPerElement:d.BYTES_PER_ELEMENT,version:s.version,size:_}}function i(s,u,d){const m=u.array,_=u.updateRanges;if(e.bindBuffer(d,s),_.length===0)e.bufferSubData(d,0,m);else{_.sort((h,A)=>h.start-A.start);let v=0;for(let h=1;h<_.length;h++){const A=_[v],R=_[h];R.start<=A.start+A.count+1?A.count=Math.max(A.count,R.start+R.count-A.start):(++v,_[v]=R)}_.length=v+1;for(let h=0,A=_.length;h 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,Pl=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Dl=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Ll=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Ul=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Il=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Nl=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Ol=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Fl=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Bl=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Hl=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Gl=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,kl=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Vl=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,zl=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Wl="gl_FragColor = linearToOutputTexel( gl_FragColor );",Xl=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,Yl=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,ql=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Kl=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Zl=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,jl=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,$l=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Ql=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Jl=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,ec=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,tc=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,nc=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,ic=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,ac=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,rc=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,oc=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,sc=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,lc=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,cc=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,dc=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,fc=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,uc=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,pc=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,hc=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,mc=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,_c=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,gc=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,vc=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,Sc=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,Ec=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,xc=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,Mc=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,Tc=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,bc=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,Ac=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,Rc=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,wc=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,yc=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Cc=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,Pc=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Dc=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Lc=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Uc=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ic=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Nc=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Oc=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,Fc=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Bc=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Hc=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,Gc=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,kc=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Vc=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,zc=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Wc=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Xc=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Yc=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,qc=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Kc=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Zc=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,jc=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,$c=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,Qc=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Jc=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,ed=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,td=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,nd=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,id=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,ad=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,rd=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,od=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,sd=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,ld=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,cd=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,dd=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,fd=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,ud=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const pd=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,hd=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,md=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,_d=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gd=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,vd=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,Sd=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,Ed=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,xd=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,Md=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,Td=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,bd=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,Ad=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Rd=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,wd=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,yd=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,Cd=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Pd=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Dd=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Ld=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Ud=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Id=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Nd=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Od=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Fd=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,Bd=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,Hd=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Gd=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,kd=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Vd=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,zd=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Wd=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,Xd=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Yd=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Xe={alphahash_fragment:hl,alphahash_pars_fragment:ml,alphamap_fragment:_l,alphamap_pars_fragment:gl,alphatest_fragment:vl,alphatest_pars_fragment:Sl,aomap_fragment:El,aomap_pars_fragment:xl,batching_pars_vertex:Ml,batching_vertex:Tl,begin_vertex:bl,beginnormal_vertex:Al,bsdfs:Rl,iridescence_fragment:wl,bumpmap_pars_fragment:yl,clipping_planes_fragment:Cl,clipping_planes_pars_fragment:Pl,clipping_planes_pars_vertex:Dl,clipping_planes_vertex:Ll,color_fragment:Ul,color_pars_fragment:Il,color_pars_vertex:Nl,color_vertex:Ol,common:Fl,cube_uv_reflection_fragment:Bl,defaultnormal_vertex:Hl,displacementmap_pars_vertex:Gl,displacementmap_vertex:kl,emissivemap_fragment:Vl,emissivemap_pars_fragment:zl,colorspace_fragment:Wl,colorspace_pars_fragment:Xl,envmap_fragment:Yl,envmap_common_pars_fragment:ql,envmap_pars_fragment:Kl,envmap_pars_vertex:Zl,envmap_physical_pars_fragment:oc,envmap_vertex:jl,fog_vertex:$l,fog_pars_vertex:Ql,fog_fragment:Jl,fog_pars_fragment:ec,gradientmap_pars_fragment:tc,lightmap_pars_fragment:nc,lights_lambert_fragment:ic,lights_lambert_pars_fragment:ac,lights_pars_begin:rc,lights_toon_fragment:sc,lights_toon_pars_fragment:lc,lights_phong_fragment:cc,lights_phong_pars_fragment:dc,lights_physical_fragment:fc,lights_physical_pars_fragment:uc,lights_fragment_begin:pc,lights_fragment_maps:hc,lights_fragment_end:mc,logdepthbuf_fragment:_c,logdepthbuf_pars_fragment:gc,logdepthbuf_pars_vertex:vc,logdepthbuf_vertex:Sc,map_fragment:Ec,map_pars_fragment:xc,map_particle_fragment:Mc,map_particle_pars_fragment:Tc,metalnessmap_fragment:bc,metalnessmap_pars_fragment:Ac,morphinstance_vertex:Rc,morphcolor_vertex:wc,morphnormal_vertex:yc,morphtarget_pars_vertex:Cc,morphtarget_vertex:Pc,normal_fragment_begin:Dc,normal_fragment_maps:Lc,normal_pars_fragment:Uc,normal_pars_vertex:Ic,normal_vertex:Nc,normalmap_pars_fragment:Oc,clearcoat_normal_fragment_begin:Fc,clearcoat_normal_fragment_maps:Bc,clearcoat_pars_fragment:Hc,iridescence_pars_fragment:Gc,opaque_fragment:kc,packing:Vc,premultiplied_alpha_fragment:zc,project_vertex:Wc,dithering_fragment:Xc,dithering_pars_fragment:Yc,roughnessmap_fragment:qc,roughnessmap_pars_fragment:Kc,shadowmap_pars_fragment:Zc,shadowmap_pars_vertex:jc,shadowmap_vertex:$c,shadowmask_pars_fragment:Qc,skinbase_vertex:Jc,skinning_pars_vertex:ed,skinning_vertex:td,skinnormal_vertex:nd,specularmap_fragment:id,specularmap_pars_fragment:ad,tonemapping_fragment:rd,tonemapping_pars_fragment:od,transmission_fragment:sd,transmission_pars_fragment:ld,uv_pars_fragment:cd,uv_pars_vertex:dd,uv_vertex:fd,worldpos_vertex:ud,background_vert:pd,background_frag:hd,backgroundCube_vert:md,backgroundCube_frag:_d,cube_vert:gd,cube_frag:vd,depth_vert:Sd,depth_frag:Ed,distanceRGBA_vert:xd,distanceRGBA_frag:Md,equirect_vert:Td,equirect_frag:bd,linedashed_vert:Ad,linedashed_frag:Rd,meshbasic_vert:wd,meshbasic_frag:yd,meshlambert_vert:Cd,meshlambert_frag:Pd,meshmatcap_vert:Dd,meshmatcap_frag:Ld,meshnormal_vert:Ud,meshnormal_frag:Id,meshphong_vert:Nd,meshphong_frag:Od,meshphysical_vert:Fd,meshphysical_frag:Bd,meshtoon_vert:Hd,meshtoon_frag:Gd,points_vert:kd,points_frag:Vd,shadow_vert:zd,shadow_frag:Wd,sprite_vert:Xd,sprite_frag:Yd},pe={common:{diffuse:{value:new be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nt},alphaMap:{value:null},alphaMapTransform:{value:new nt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nt}},envmap:{envMap:{value:null},envMapRotation:{value:new nt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nt},normalScale:{value:new Ke(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new be(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 be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nt},alphaTest:{value:0},uvTransform:{value:new nt}},sprite:{diffuse:{value:new be(16777215)},opacity:{value:1},center:{value:new Ke(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nt},alphaMap:{value:null},alphaMapTransform:{value:new nt},alphaTest:{value:0}}},Xt={basic:{uniforms:It([pe.common,pe.specularmap,pe.envmap,pe.aomap,pe.lightmap,pe.fog]),vertexShader:Xe.meshbasic_vert,fragmentShader:Xe.meshbasic_frag},lambert:{uniforms:It([pe.common,pe.specularmap,pe.envmap,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.fog,pe.lights,{emissive:{value:new be(0)}}]),vertexShader:Xe.meshlambert_vert,fragmentShader:Xe.meshlambert_frag},phong:{uniforms:It([pe.common,pe.specularmap,pe.envmap,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.fog,pe.lights,{emissive:{value:new be(0)},specular:{value:new be(1118481)},shininess:{value:30}}]),vertexShader:Xe.meshphong_vert,fragmentShader:Xe.meshphong_frag},standard:{uniforms:It([pe.common,pe.envmap,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.roughnessmap,pe.metalnessmap,pe.fog,pe.lights,{emissive:{value:new be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xe.meshphysical_vert,fragmentShader:Xe.meshphysical_frag},toon:{uniforms:It([pe.common,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.gradientmap,pe.fog,pe.lights,{emissive:{value:new be(0)}}]),vertexShader:Xe.meshtoon_vert,fragmentShader:Xe.meshtoon_frag},matcap:{uniforms:It([pe.common,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.fog,{matcap:{value:null}}]),vertexShader:Xe.meshmatcap_vert,fragmentShader:Xe.meshmatcap_frag},points:{uniforms:It([pe.points,pe.fog]),vertexShader:Xe.points_vert,fragmentShader:Xe.points_frag},dashed:{uniforms:It([pe.common,pe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xe.linedashed_vert,fragmentShader:Xe.linedashed_frag},depth:{uniforms:It([pe.common,pe.displacementmap]),vertexShader:Xe.depth_vert,fragmentShader:Xe.depth_frag},normal:{uniforms:It([pe.common,pe.bumpmap,pe.normalmap,pe.displacementmap,{opacity:{value:1}}]),vertexShader:Xe.meshnormal_vert,fragmentShader:Xe.meshnormal_frag},sprite:{uniforms:It([pe.sprite,pe.fog]),vertexShader:Xe.sprite_vert,fragmentShader:Xe.sprite_frag},background:{uniforms:{uvTransform:{value:new nt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Xe.background_vert,fragmentShader:Xe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new nt}},vertexShader:Xe.backgroundCube_vert,fragmentShader:Xe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xe.cube_vert,fragmentShader:Xe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xe.equirect_vert,fragmentShader:Xe.equirect_frag},distanceRGBA:{uniforms:It([pe.common,pe.displacementmap,{referencePosition:{value:new Me},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xe.distanceRGBA_vert,fragmentShader:Xe.distanceRGBA_frag},shadow:{uniforms:It([pe.lights,pe.fog,{color:{value:new be(0)},opacity:{value:1}}]),vertexShader:Xe.shadow_vert,fragmentShader:Xe.shadow_frag}};Xt.physical={uniforms:It([Xt.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nt},clearcoatNormalScale:{value:new Ke(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nt},sheen:{value:0},sheenColor:{value:new be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nt},transmissionSamplerSize:{value:new Ke},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nt},attenuationDistance:{value:0},attenuationColor:{value:new be(0)},specularColor:{value:new be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nt},anisotropyVector:{value:new Ke},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nt}}]),vertexShader:Xe.meshphysical_vert,fragmentShader:Xe.meshphysical_frag};const ui={r:0,b:0,g:0},_n=new Qr,qd=new Vn;function Kd(e,t,n,i,r,a,o){const s=new be(0);let u=a===!0?0:1,d,m,_=null,v=0,h=null;function A(T){let M=T.isScene===!0?T.background:null;return M&&M.isTexture&&(M=(T.backgroundBlurriness>0?n:t).get(M)),M}function R(T){let M=!1;const C=A(T);C===null?l(s,u):C&&C.isColor&&(l(C,1),M=!0);const D=e.xr.getEnvironmentBlendMode();D==="additive"?i.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(e.autoClear||M)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function c(T,M){const C=A(M);C&&(C.isCubeTexture||C.mapping===Ci)?(m===void 0&&(m=new Bt(new $r(1,1,1),new Ot({name:"BackgroundCubeMaterial",uniforms:Za(Xt.backgroundCube.uniforms),vertexShader:Xt.backgroundCube.vertexShader,fragmentShader:Xt.backgroundCube.fragmentShader,side:Vt,depthTest:!1,depthWrite:!1,fog:!1})),m.geometry.deleteAttribute("normal"),m.geometry.deleteAttribute("uv"),m.onBeforeRender=function(D,F,H){this.matrixWorld.copyPosition(H.matrixWorld)},Object.defineProperty(m.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(m)),_n.copy(M.backgroundRotation),_n.x*=-1,_n.y*=-1,_n.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(_n.y*=-1,_n.z*=-1),m.material.uniforms.envMap.value=C,m.material.uniforms.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,m.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,m.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,m.material.uniforms.backgroundRotation.value.setFromMatrix4(qd.makeRotationFromEuler(_n)),m.material.toneMapped=Et.getTransfer(C.colorSpace)!==ft,(_!==C||v!==C.version||h!==e.toneMapping)&&(m.material.needsUpdate=!0,_=C,v=C.version,h=e.toneMapping),m.layers.enableAll(),T.unshift(m,m.geometry,m.material,0,0,null)):C&&C.isTexture&&(d===void 0&&(d=new Bt(new ma(2,2),new Ot({name:"BackgroundMaterial",uniforms:Za(Xt.background.uniforms),vertexShader:Xt.background.vertexShader,fragmentShader:Xt.background.fragmentShader,side:oi,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=C,d.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,d.material.toneMapped=Et.getTransfer(C.colorSpace)!==ft,C.matrixAutoUpdate===!0&&C.updateMatrix(),d.material.uniforms.uvTransform.value.copy(C.matrix),(_!==C||v!==C.version||h!==e.toneMapping)&&(d.material.needsUpdate=!0,_=C,v=C.version,h=e.toneMapping),d.layers.enableAll(),T.unshift(d,d.geometry,d.material,0,0,null))}function l(T,M){T.getRGB(ui,jr(e)),i.buffers.color.setClear(ui.r,ui.g,ui.b,M,o)}function O(){m!==void 0&&(m.geometry.dispose(),m.material.dispose()),d!==void 0&&(d.geometry.dispose(),d.material.dispose())}return{getClearColor:function(){return s},setClearColor:function(T,M=1){s.set(T),u=M,l(s,u)},getClearAlpha:function(){return u},setClearAlpha:function(T){u=T,l(s,u)},render:R,addToRenderList:c,dispose:O}}function Zd(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=v(null);let a=r,o=!1;function s(g,P,$,V,q){let Z=!1;const j=_(V,$,P);a!==j&&(a=j,d(a.object)),Z=h(g,V,$,q),Z&&A(g,V,$,q),q!==null&&t.update(q,e.ELEMENT_ARRAY_BUFFER),(Z||o)&&(o=!1,M(g,P,$,V),q!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(q).buffer))}function u(){return e.createVertexArray()}function d(g){return e.bindVertexArray(g)}function m(g){return e.deleteVertexArray(g)}function _(g,P,$){const V=$.wireframe===!0;let q=i[g.id];q===void 0&&(q={},i[g.id]=q);let Z=q[P.id];Z===void 0&&(Z={},q[P.id]=Z);let j=Z[V];return j===void 0&&(j=v(u()),Z[V]=j),j}function v(g){const P=[],$=[],V=[];for(let q=0;q=0){const we=q[K];let Ue=Z[K];if(Ue===void 0&&(K==="instanceMatrix"&&g.instanceMatrix&&(Ue=g.instanceMatrix),K==="instanceColor"&&g.instanceColor&&(Ue=g.instanceColor)),we===void 0||we.attribute!==Ue||Ue&&we.data!==Ue.data)return!0;j++}return a.attributesNum!==j||a.index!==V}function A(g,P,$,V){const q={},Z=P.attributes;let j=0;const ie=$.getAttributes();for(const K in ie)if(ie[K].location>=0){let we=Z[K];we===void 0&&(K==="instanceMatrix"&&g.instanceMatrix&&(we=g.instanceMatrix),K==="instanceColor"&&g.instanceColor&&(we=g.instanceColor));const Ue={};Ue.attribute=we,we&&we.data&&(Ue.data=we.data),q[K]=Ue,j++}a.attributes=q,a.attributesNum=j,a.index=V}function R(){const g=a.newAttributes;for(let P=0,$=g.length;P<$;P++)g[P]=0}function c(g){l(g,0)}function l(g,P){const $=a.newAttributes,V=a.enabledAttributes,q=a.attributeDivisors;$[g]=1,V[g]===0&&(e.enableVertexAttribArray(g),V[g]=1),q[g]!==P&&(e.vertexAttribDivisor(g,P),q[g]=P)}function O(){const g=a.newAttributes,P=a.enabledAttributes;for(let $=0,V=P.length;$=0){let Se=q[ie];if(Se===void 0&&(ie==="instanceMatrix"&&g.instanceMatrix&&(Se=g.instanceMatrix),ie==="instanceColor"&&g.instanceColor&&(Se=g.instanceColor)),Se!==void 0){const we=Se.normalized,Ue=Se.itemSize,je=t.get(Se);if(je===void 0)continue;const et=je.buffer,Q=je.type,de=je.bytesPerElement,xe=Q===e.INT||Q===e.UNSIGNED_INT||Se.gpuType===Xr;if(Se.isInterleavedBufferAttribute){const ue=Se.data,Ce=ue.stride,Le=Se.offset;if(ue.isInstancedInterleavedBuffer){for(let Ve=0;Ve0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=n.precision!==void 0?n.precision:"highp";const m=u(d);m!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",m,"instead."),d=m);const _=n.logarithmicDepthBuffer===!0,v=n.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),A=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),R=e.getParameter(e.MAX_TEXTURE_SIZE),c=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),l=e.getParameter(e.MAX_VERTEX_ATTRIBS),O=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),T=e.getParameter(e.MAX_VARYING_VECTORS),M=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),C=A>0,D=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:u,textureFormatReadable:o,textureTypeReadable:s,precision:d,logarithmicDepthBuffer:_,reverseDepthBuffer:v,maxTextures:h,maxVertexTextures:A,maxTextureSize:R,maxCubemapSize:c,maxAttributes:l,maxVertexUniforms:O,maxVaryings:T,maxFragmentUniforms:M,vertexTextures:C,maxSamples:D}}function Qd(e){const t=this;let n=null,i=0,r=!1,a=!1;const o=new Gr,s=new nt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(_,v){const h=_.length!==0||v||i!==0||r;return r=v,i=_.length,h},this.beginShadows=function(){a=!0,m(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(_,v){n=m(_,v,0)},this.setState=function(_,v,h){const A=_.clippingPlanes,R=_.clipIntersection,c=_.clipShadows,l=e.get(_);if(!r||A===null||A.length===0||a&&!c)a?m(null):d();else{const O=a?0:i,T=O*4;let M=l.clippingState||null;u.value=M,M=m(A,v,T,h);for(let C=0;C!==T;++C)M[C]=n[C];l.clippingState=M,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=O}};function d(){u.value!==n&&(u.value=n,u.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function m(_,v,h,A){const R=_!==null?_.length:0;let c=null;if(R!==0){if(c=u.value,A!==!0||c===null){const l=h+R*4,O=v.matrixWorldInverse;s.getNormalMatrix(O),(c===null||c.length0){const d=new Ts(u.height);return d.fromEquirectangularTexture(e,o),t.set(o,d),o.addEventListener("dispose",r),n(d.texture,o.mapping)}else return null}}return o}function r(o){const s=o.target;s.removeEventListener("dispose",r);const u=t.get(s);u!==void 0&&(t.delete(s),u.dispose())}function a(){t=new WeakMap}return{get:i,dispose:a}}const On=4,sr=[.125,.215,.35,.446,.526,.582],Mn=20,Bi=new eo,lr=new be;let Hi=null,Gi=0,ki=0,Vi=!1;const En=(1+Math.sqrt(5))/2,Dn=1/En,cr=[new Me(-En,Dn,0),new Me(En,Dn,0),new Me(-Dn,0,En),new Me(Dn,0,En),new Me(0,En,-Dn),new Me(0,En,Dn),new Me(-1,1,-1),new Me(1,1,-1),new Me(-1,1,1),new Me(1,1,1)];class dr{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,n=0,i=.1,r=100){Hi=this._renderer.getRenderTarget(),Gi=this._renderer.getActiveCubeFace(),ki=this._renderer.getActiveMipmapLevel(),Vi=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(t,i,r,a),n>0&&this._blur(a,0,0,n),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(t,n=null){return this._fromTexture(t,n)}fromCubemap(t,n=null){return this._fromTexture(t,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=pr(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ur(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?T:0,T,T),m.setRenderTarget(r),R&&m.render(A,s),m.render(t,s)}A.geometry.dispose(),A.material.dispose(),m.toneMapping=v,m.autoClear=_,t.background=c}_textureToCubeUV(t,n){const i=this._renderer,r=t.mapping===ci||t.mapping===zn;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=pr()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ur());const a=r?this._cubemapMaterial:this._equirectMaterial,o=new Bt(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=t;const u=this._cubeSize;pi(n,0,0,3*u,2*u),i.setRenderTarget(n),i.render(o,Bi)}_applyPMREM(t){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;aMn&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${c} samples when the maximum is set to ${Mn}`);const l=[];let O=0;for(let F=0;FT-On?r-T+On:0),D=4*(this._cubeSize-M);pi(n,C,D,3*M,2*M),u.setRenderTarget(n),u.render(_,Bi)}}function ef(e){const t=[],n=[],i=[];let r=e;const a=e-On+1+sr.length;for(let o=0;oe-On?u=sr[o-e+On-1]:o===0&&(u=0),i.push(u);const d=1/(s-2),m=-d,_=1+d,v=[m,m,_,m,_,_,m,m,_,_,m,_],h=6,A=6,R=3,c=2,l=1,O=new Float32Array(R*A*h),T=new Float32Array(c*A*h),M=new Float32Array(l*A*h);for(let D=0;D2?0:-1,x=[F,H,0,F+2/3,H,0,F+2/3,H+1,0,F,H,0,F+2/3,H+1,0,F,H+1,0];O.set(x,R*A*D),T.set(v,c*A*D);const g=[D,D,D,D,D,D];M.set(g,l*A*D)}const C=new kt;C.setAttribute("position",new Rt(O,R)),C.setAttribute("uv",new Rt(T,c)),C.setAttribute("faceIndex",new Rt(M,l)),t.push(C),r>On&&r--}return{lodPlanes:t,sizeLods:n,sigmas:i}}function fr(e,t,n){const i=new qt(e,t,n);return i.texture.mapping=Ci,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function pi(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function tf(e,t,n){const i=new Float32Array(Mn),r=new Me(0,1,0);return new Ot({name:"SphericalGaussianBlur",defines:{n:Mn,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_a(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:fn,depthTest:!1,depthWrite:!1})}function ur(){return new Ot({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_a(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:fn,depthTest:!1,depthWrite:!1})}function pr(){return new Ot({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_a(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:fn,depthTest:!1,depthWrite:!1})}function _a(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function nf(e){let t=new WeakMap,n=null;function i(s){if(s&&s.isTexture){const u=s.mapping,d=u===ia||u===aa,m=u===ci||u===zn;if(d||m){let _=t.get(s);const v=_!==void 0?_.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==v)return n===null&&(n=new dr(e)),_=d?n.fromEquirectangular(s,_):n.fromCubemap(s,_),_.texture.pmremVersion=s.pmremVersion,t.set(s,_),_.texture;if(_!==void 0)return _.texture;{const h=s.image;return d&&h&&h.height>0||m&&h&&r(h)?(n===null&&(n=new dr(e)),_=d?n.fromEquirectangular(s):n.fromCubemap(s),_.texture.pmremVersion=s.pmremVersion,t.set(s,_),s.addEventListener("dispose",a),_.texture):null}}}return s}function r(s){let u=0;const d=6;for(let m=0;mt.maxTextureSize&&(C=Math.ceil(M/t.maxTextureSize),M=t.maxTextureSize);const D=new Float32Array(M*C*4*_),F=new Zr(D,M,C,_);F.type=bn,F.needsUpdate=!0;const H=T*4;for(let g=0;g<_;g++){const P=c[g],$=l[g],V=O[g],q=M*C*4*g;for(let Z=0;Z0)return e;const r=t*n;let a=mr[r];if(a===void 0&&(a=new Float32Array(r),mr[r]=a),t!==0){i.toArray(a,0);for(let o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function Tt(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n":" "} ${s}: ${n[o]}`)}return i.join(` +`)}const Mr=new nt;function iu(e){Et._getMatrix(Mr,Et.workingColorSpace,e);const t=`mat3( ${Mr.elements.map(n=>n.toFixed(4))} )`;switch(Et.getTransfer(e)){case Jr:return[t,"LinearTransferOETF"];case ft:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}function Tr(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();if(i&&r==="")return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const o=parseInt(a[1]);return n.toUpperCase()+` + +`+r+` + +`+nu(e.getShaderSource(t),o)}else return r}function au(e,t){const n=iu(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` +`)}function ru(e,t){let n;switch(t){case Os:n="Linear";break;case Ns:n="Reinhard";break;case Is:n="Cineon";break;case to:n="ACESFilmic";break;case Us:n="AgX";break;case Ls:n="Neutral";break;case Ds:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const hi=new Me;function ou(){Et.getLuminanceCoefficients(hi);const e=hi.x.toFixed(4),t=hi.y.toFixed(4),n=hi.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${e}, ${t}, ${n} );`," return dot( weights, rgb );","}"].join(` +`)}function su(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Jn).join(` +`)}function lu(e){const t=[];for(const n in e){const i=e[n];i!==!1&&t.push("#define "+n+" "+i)}return t.join(` +`)}function cu(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function la(e){return e.replace(du,uu)}const fu=new Map;function uu(e,t){let n=Xe[t];if(n===void 0){const i=fu.get(t);if(i!==void 0)n=Xe[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,i);else throw new Error("Can not resolve #include <"+t+">")}return la(n)}const pu=/#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 Rr(e){return e.replace(pu,hu)}function hu(e,t,n,i){let r="";for(let a=parseInt(t);a0&&(c+=` +`),l=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,A].filter(Jn).join(` +`),l.length>0&&(l+=` +`)):(c=[wr(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,A,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 "+m:"",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 "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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(Jn).join(` +`),l=[wr(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,A,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 "+d:"",n.envMap?"#define "+m:"",n.envMap?"#define "+_:"",v?"#define CUBEUV_TEXEL_WIDTH "+v.texelWidth:"",v?"#define CUBEUV_TEXEL_HEIGHT "+v.texelHeight:"",v?"#define CUBEUV_MAX_MIP "+v.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 "+u:"",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_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==cn?"#define TONE_MAPPING":"",n.toneMapping!==cn?Xe.tonemapping_pars_fragment:"",n.toneMapping!==cn?ru("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Xe.colorspace_pars_fragment,au("linearToOutputTexel",n.outputColorSpace),ou(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(Jn).join(` +`)),o=la(o),o=br(o,n),o=Ar(o,n),s=la(s),s=br(s,n),s=Ar(s,n),o=Rr(o),s=Rr(s),n.isRawShaderMaterial!==!0&&(O=`#version 300 es +`,c=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+c,l=["#define varying in",n.glslVersion===$a?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===$a?"":"#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(` +`)+` +`+l);const T=O+c+o,M=O+l+s,C=xr(r,r.VERTEX_SHADER,T),D=xr(r,r.FRAGMENT_SHADER,M);r.attachShader(R,C),r.attachShader(R,D),n.index0AttributeName!==void 0?r.bindAttribLocation(R,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(R,0,"position"),r.linkProgram(R);function F(P){if(e.debug.checkShaderErrors){const $=r.getProgramInfoLog(R).trim(),V=r.getShaderInfoLog(C).trim(),q=r.getShaderInfoLog(D).trim();let Z=!0,j=!0;if(r.getProgramParameter(R,r.LINK_STATUS)===!1)if(Z=!1,typeof e.debug.onShaderError=="function")e.debug.onShaderError(r,R,C,D);else{const ie=Tr(r,C,"vertex"),K=Tr(r,D,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(R,r.VALIDATE_STATUS)+` + +Material Name: `+P.name+` +Material Type: `+P.type+` + +Program Info Log: `+$+` +`+ie+` +`+K)}else $!==""?console.warn("THREE.WebGLProgram: Program Info Log:",$):(V===""||q==="")&&(j=!1);j&&(P.diagnostics={runnable:Z,programLog:$,vertexShader:{log:V,prefix:c},fragmentShader:{log:q,prefix:l}})}r.deleteShader(C),r.deleteShader(D),H=new Ei(r,R),x=cu(r,R)}let H;this.getUniforms=function(){return H===void 0&&F(this),H};let x;this.getAttributes=function(){return x===void 0&&F(this),x};let g=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return g===!1&&(g=r.getProgramParameter(R,eu)),g},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(R),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=tu++,this.cacheKey=t,this.usedTimes=1,this.program=R,this.vertexShader=C,this.fragmentShader=D,this}let xu=0;class Mu{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const n=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(n),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(t);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(t){const n=this.materialCache.get(t);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const n=this.materialCache;let i=n.get(t);return i===void 0&&(i=new Set,n.set(t,i)),i}_getShaderStage(t){const n=this.shaderCache;let i=n.get(t);return i===void 0&&(i=new Tu(t),n.set(t,i)),i}}class Tu{constructor(t){this.id=xu++,this.code=t,this.usedTimes=0}}function bu(e,t,n,i,r,a,o){const s=new Cs,u=new Mu,d=new Set,m=[],_=r.logarithmicDepthBuffer,v=r.vertexTextures;let h=r.precision;const A={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",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 R(x){return d.add(x),x===0?"uv":`uv${x}`}function c(x,g,P,$,V){const q=$.fog,Z=V.geometry,j=x.isMeshStandardMaterial?$.environment:null,ie=(x.isMeshStandardMaterial?n:t).get(x.envMap||j),K=ie&&ie.mapping===Ci?ie.image.height:null,Se=A[x.type];x.precision!==null&&(h=r.getMaxPrecision(x.precision),h!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",h,"instead."));const we=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,Ue=we!==void 0?we.length:0;let je=0;Z.morphAttributes.position!==void 0&&(je=1),Z.morphAttributes.normal!==void 0&&(je=2),Z.morphAttributes.color!==void 0&&(je=3);let et,Q,de,xe;if(Se){const Ge=Xt[Se];et=Ge.vertexShader,Q=Ge.fragmentShader}else et=x.vertexShader,Q=x.fragmentShader,u.update(x),de=u.getVertexShaderID(x),xe=u.getFragmentShaderID(x);const ue=e.getRenderTarget(),Ce=e.state.buffers.depth.getReversed(),Le=V.isInstancedMesh===!0,Ve=V.isBatchedMesh===!0,$e=!!x.map,ze=!!x.matcap,lt=!!ie,w=!!x.aoMap,xt=!!x.lightMap,Fe=!!x.bumpMap,Be=!!x.normalMap,Re=!!x.displacementMap,st=!!x.emissiveMap,Te=!!x.metalnessMap,S=!!x.roughnessMap,f=x.anisotropy>0,G=x.clearcoat>0,B=x.dispersion>0,W=x.iridescence>0,k=x.sheen>0,se=x.transmission>0,ae=f&&!!x.anisotropyMap,le=G&&!!x.clearcoatMap,ye=G&&!!x.clearcoatNormalMap,Y=G&&!!x.clearcoatRoughnessMap,ce=W&&!!x.iridescenceMap,me=W&&!!x.iridescenceThicknessMap,Ae=k&&!!x.sheenColorMap,_e=k&&!!x.sheenRoughnessMap,qe=!!x.specularMap,Oe=!!x.specularColorMap,at=!!x.specularIntensityMap,E=se&&!!x.transmissionMap,X=se&&!!x.thicknessMap,N=!!x.gradientMap,z=!!x.alphaMap,J=x.alphaTest>0,te=!!x.alphaHash,ve=!!x.extensions;let We=cn;x.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(We=e.toneMapping);const it={shaderID:Se,shaderType:x.type,shaderName:x.name,vertexShader:et,fragmentShader:Q,defines:x.defines,customVertexShaderID:de,customFragmentShaderID:xe,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:h,batching:Ve,batchingColor:Ve&&V._colorsTexture!==null,instancing:Le,instancingColor:Le&&V.instanceColor!==null,instancingMorph:Le&&V.morphTexture!==null,supportsVertexTextures:v,outputColorSpace:ue===null?e.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:yi,alphaToCoverage:!!x.alphaToCoverage,map:$e,matcap:ze,envMap:lt,envMapMode:lt&&ie.mapping,envMapCubeUVHeight:K,aoMap:w,lightMap:xt,bumpMap:Fe,normalMap:Be,displacementMap:v&&Re,emissiveMap:st,normalMapObjectSpace:Be&&x.normalMapType===As,normalMapTangentSpace:Be&&x.normalMapType===bs,metalnessMap:Te,roughnessMap:S,anisotropy:f,anisotropyMap:ae,clearcoat:G,clearcoatMap:le,clearcoatNormalMap:ye,clearcoatRoughnessMap:Y,dispersion:B,iridescence:W,iridescenceMap:ce,iridescenceThicknessMap:me,sheen:k,sheenColorMap:Ae,sheenRoughnessMap:_e,specularMap:qe,specularColorMap:Oe,specularIntensityMap:at,transmission:se,transmissionMap:E,thicknessMap:X,gradientMap:N,opaque:x.transparent===!1&&x.blending===Si&&x.alphaToCoverage===!1,alphaMap:z,alphaTest:J,alphaHash:te,combine:x.combine,mapUv:$e&&R(x.map.channel),aoMapUv:w&&R(x.aoMap.channel),lightMapUv:xt&&R(x.lightMap.channel),bumpMapUv:Fe&&R(x.bumpMap.channel),normalMapUv:Be&&R(x.normalMap.channel),displacementMapUv:Re&&R(x.displacementMap.channel),emissiveMapUv:st&&R(x.emissiveMap.channel),metalnessMapUv:Te&&R(x.metalnessMap.channel),roughnessMapUv:S&&R(x.roughnessMap.channel),anisotropyMapUv:ae&&R(x.anisotropyMap.channel),clearcoatMapUv:le&&R(x.clearcoatMap.channel),clearcoatNormalMapUv:ye&&R(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Y&&R(x.clearcoatRoughnessMap.channel),iridescenceMapUv:ce&&R(x.iridescenceMap.channel),iridescenceThicknessMapUv:me&&R(x.iridescenceThicknessMap.channel),sheenColorMapUv:Ae&&R(x.sheenColorMap.channel),sheenRoughnessMapUv:_e&&R(x.sheenRoughnessMap.channel),specularMapUv:qe&&R(x.specularMap.channel),specularColorMapUv:Oe&&R(x.specularColorMap.channel),specularIntensityMapUv:at&&R(x.specularIntensityMap.channel),transmissionMapUv:E&&R(x.transmissionMap.channel),thicknessMapUv:X&&R(x.thicknessMap.channel),alphaMapUv:z&&R(x.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(Be||f),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Z.attributes.uv&&($e||z),fog:!!q,useFog:x.fog===!0,fogExp2:!!q&&q.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:_,reverseDepthBuffer:Ce,skinning:V.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:Ue,morphTextureStride:je,numDirLights:g.directional.length,numPointLights:g.point.length,numSpotLights:g.spot.length,numSpotLightMaps:g.spotLightMap.length,numRectAreaLights:g.rectArea.length,numHemiLights:g.hemi.length,numDirLightShadows:g.directionalShadowMap.length,numPointLightShadows:g.pointShadowMap.length,numSpotLightShadows:g.spotShadowMap.length,numSpotLightShadowsWithMaps:g.numSpotLightShadowsWithMaps,numLightProbes:g.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:e.shadowMap.enabled&&P.length>0,shadowMapType:e.shadowMap.type,toneMapping:We,decodeVideoTexture:$e&&x.map.isVideoTexture===!0&&Et.getTransfer(x.map.colorSpace)===ft,decodeVideoTextureEmissive:st&&x.emissiveMap.isVideoTexture===!0&&Et.getTransfer(x.emissiveMap.colorSpace)===ft,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===Yt,flipSided:x.side===Vt,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionClipCullDistance:ve&&x.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ve&&x.extensions.multiDraw===!0||Ve)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return it.vertexUv1s=d.has(1),it.vertexUv2s=d.has(2),it.vertexUv3s=d.has(3),d.clear(),it}function l(x){const g=[];if(x.shaderID?g.push(x.shaderID):(g.push(x.customVertexShaderID),g.push(x.customFragmentShaderID)),x.defines!==void 0)for(const P in x.defines)g.push(P),g.push(x.defines[P]);return x.isRawShaderMaterial===!1&&(O(g,x),T(g,x),g.push(e.outputColorSpace)),g.push(x.customProgramCacheKey),g.join()}function O(x,g){x.push(g.precision),x.push(g.outputColorSpace),x.push(g.envMapMode),x.push(g.envMapCubeUVHeight),x.push(g.mapUv),x.push(g.alphaMapUv),x.push(g.lightMapUv),x.push(g.aoMapUv),x.push(g.bumpMapUv),x.push(g.normalMapUv),x.push(g.displacementMapUv),x.push(g.emissiveMapUv),x.push(g.metalnessMapUv),x.push(g.roughnessMapUv),x.push(g.anisotropyMapUv),x.push(g.clearcoatMapUv),x.push(g.clearcoatNormalMapUv),x.push(g.clearcoatRoughnessMapUv),x.push(g.iridescenceMapUv),x.push(g.iridescenceThicknessMapUv),x.push(g.sheenColorMapUv),x.push(g.sheenRoughnessMapUv),x.push(g.specularMapUv),x.push(g.specularColorMapUv),x.push(g.specularIntensityMapUv),x.push(g.transmissionMapUv),x.push(g.thicknessMapUv),x.push(g.combine),x.push(g.fogExp2),x.push(g.sizeAttenuation),x.push(g.morphTargetsCount),x.push(g.morphAttributeCount),x.push(g.numDirLights),x.push(g.numPointLights),x.push(g.numSpotLights),x.push(g.numSpotLightMaps),x.push(g.numHemiLights),x.push(g.numRectAreaLights),x.push(g.numDirLightShadows),x.push(g.numPointLightShadows),x.push(g.numSpotLightShadows),x.push(g.numSpotLightShadowsWithMaps),x.push(g.numLightProbes),x.push(g.shadowMapType),x.push(g.toneMapping),x.push(g.numClippingPlanes),x.push(g.numClipIntersection),x.push(g.depthPacking)}function T(x,g){s.disableAll(),g.supportsVertexTextures&&s.enable(0),g.instancing&&s.enable(1),g.instancingColor&&s.enable(2),g.instancingMorph&&s.enable(3),g.matcap&&s.enable(4),g.envMap&&s.enable(5),g.normalMapObjectSpace&&s.enable(6),g.normalMapTangentSpace&&s.enable(7),g.clearcoat&&s.enable(8),g.iridescence&&s.enable(9),g.alphaTest&&s.enable(10),g.vertexColors&&s.enable(11),g.vertexAlphas&&s.enable(12),g.vertexUv1s&&s.enable(13),g.vertexUv2s&&s.enable(14),g.vertexUv3s&&s.enable(15),g.vertexTangents&&s.enable(16),g.anisotropy&&s.enable(17),g.alphaHash&&s.enable(18),g.batching&&s.enable(19),g.dispersion&&s.enable(20),g.batchingColor&&s.enable(21),x.push(s.mask),s.disableAll(),g.fog&&s.enable(0),g.useFog&&s.enable(1),g.flatShading&&s.enable(2),g.logarithmicDepthBuffer&&s.enable(3),g.reverseDepthBuffer&&s.enable(4),g.skinning&&s.enable(5),g.morphTargets&&s.enable(6),g.morphNormals&&s.enable(7),g.morphColors&&s.enable(8),g.premultipliedAlpha&&s.enable(9),g.shadowMapEnabled&&s.enable(10),g.doubleSided&&s.enable(11),g.flipSided&&s.enable(12),g.useDepthPacking&&s.enable(13),g.dithering&&s.enable(14),g.transmission&&s.enable(15),g.sheen&&s.enable(16),g.opaque&&s.enable(17),g.pointsUvs&&s.enable(18),g.decodeVideoTexture&&s.enable(19),g.decodeVideoTextureEmissive&&s.enable(20),g.alphaToCoverage&&s.enable(21),x.push(s.mask)}function M(x){const g=A[x.type];let P;if(g){const $=Xt[g];P=Ri.clone($.uniforms)}else P=x.uniforms;return P}function C(x,g){let P;for(let $=0,V=m.length;$0?i.push(l):h.transparent===!0?r.push(l):n.push(l)}function u(_,v,h,A,R,c){const l=o(_,v,h,A,R,c);h.transmission>0?i.unshift(l):h.transparent===!0?r.unshift(l):n.unshift(l)}function d(_,v){n.length>1&&n.sort(_||Ru),i.length>1&&i.sort(v||yr),r.length>1&&r.sort(v||yr)}function m(){for(let _=t,v=e.length;_=a.length?(o=new Cr,a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function yu(){const 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 Me,color:new be};break;case"SpotLight":n={position:new Me,direction:new Me,color:new be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Me,color:new be,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Me,skyColor:new be,groundColor:new be};break;case"RectAreaLight":n={color:new be,position:new Me,halfWidth:new Me,halfHeight:new Me};break}return e[t.id]=n,n}}}function Cu(){const 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 Ke};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let Pu=0;function Du(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Lu(e){const t=new yu,n=Cu(),i={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 d=0;d<9;d++)i.probe.push(new Me);const r=new Me,a=new Vn,o=new Vn;function s(d){let m=0,_=0,v=0;for(let x=0;x<9;x++)i.probe[x].set(0,0,0);let h=0,A=0,R=0,c=0,l=0,O=0,T=0,M=0,C=0,D=0,F=0;d.sort(Du);for(let x=0,g=d.length;x0&&(e.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=pe.LTC_FLOAT_1,i.rectAreaLTC2=pe.LTC_FLOAT_2):(i.rectAreaLTC1=pe.LTC_HALF_1,i.rectAreaLTC2=pe.LTC_HALF_2)),i.ambient[0]=m,i.ambient[1]=_,i.ambient[2]=v;const H=i.hash;(H.directionalLength!==h||H.pointLength!==A||H.spotLength!==R||H.rectAreaLength!==c||H.hemiLength!==l||H.numDirectionalShadows!==O||H.numPointShadows!==T||H.numSpotShadows!==M||H.numSpotMaps!==C||H.numLightProbes!==F)&&(i.directional.length=h,i.spot.length=R,i.rectArea.length=c,i.point.length=A,i.hemi.length=l,i.directionalShadow.length=O,i.directionalShadowMap.length=O,i.pointShadow.length=T,i.pointShadowMap.length=T,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=O,i.pointShadowMatrix.length=T,i.spotLightMatrix.length=M+C-D,i.spotLightMap.length=C,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=F,H.directionalLength=h,H.pointLength=A,H.spotLength=R,H.rectAreaLength=c,H.hemiLength=l,H.numDirectionalShadows=O,H.numPointShadows=T,H.numSpotShadows=M,H.numSpotMaps=C,H.numLightProbes=F,i.version=Pu++)}function u(d,m){let _=0,v=0,h=0,A=0,R=0;const c=m.matrixWorldInverse;for(let l=0,O=d.length;l=o.length?(s=new Pr(e),o.push(s)):s=o[a],s}function i(){t=new WeakMap}return{get:n,dispose:i}}const Iu=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Nu=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Ou(e,t,n){let i=new Fr;const r=new Ke,a=new Ke,o=new Nt,s=new ss({depthPacking:ls}),u=new cs,d={},m=n.maxTextureSize,_={[oi]:Vt,[Vt]:oi,[Yt]:Yt},v=new Ot({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ke},radius:{value:4}},vertexShader:Iu,fragmentShader:Nu}),h=v.clone();h.defines.HORIZONTAL_PASS=1;const A=new kt;A.setAttribute("position",new Rt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new Bt(A,v),c=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=kr;let l=this.type;this.render=function(D,F,H){if(c.enabled===!1||c.autoUpdate===!1&&c.needsUpdate===!1||D.length===0)return;const x=e.getRenderTarget(),g=e.getActiveCubeFace(),P=e.getActiveMipmapLevel(),$=e.state;$.setBlending(fn),$.buffers.color.setClear(1,1,1,1),$.buffers.depth.setTest(!0),$.setScissorTest(!1);const V=l!==Jt&&this.type===Jt,q=l===Jt&&this.type!==Jt;for(let Z=0,j=D.length;Zm||r.y>m)&&(r.x>m&&(a.x=Math.floor(m/Se.x),r.x=a.x*Se.x,K.mapSize.x=a.x),r.y>m&&(a.y=Math.floor(m/Se.y),r.y=a.y*Se.y,K.mapSize.y=a.y)),K.map===null||V===!0||q===!0){const Ue=this.type!==Jt?{minFilter:ni,magFilter:ni}:{};K.map!==null&&K.map.dispose(),K.map=new qt(r.x,r.y,Ue),K.map.texture.name=ie.name+".shadowMap",K.camera.updateProjectionMatrix()}e.setRenderTarget(K.map),e.clear();const we=K.getViewportCount();for(let Ue=0;Ue0||F.map&&F.alphaTest>0){const $=g.uuid,V=F.uuid;let q=d[$];q===void 0&&(q={},d[$]=q);let Z=q[V];Z===void 0&&(Z=g.clone(),q[V]=Z,F.addEventListener("dispose",C)),g=Z}if(g.visible=F.visible,g.wireframe=F.wireframe,x===Jt?g.side=F.shadowSide!==null?F.shadowSide:F.side:g.side=F.shadowSide!==null?F.shadowSide:_[F.side],g.alphaMap=F.alphaMap,g.alphaTest=F.alphaTest,g.map=F.map,g.clipShadows=F.clipShadows,g.clippingPlanes=F.clippingPlanes,g.clipIntersection=F.clipIntersection,g.displacementMap=F.displacementMap,g.displacementScale=F.displacementScale,g.displacementBias=F.displacementBias,g.wireframeLinewidth=F.wireframeLinewidth,g.linewidth=F.linewidth,H.isPointLight===!0&&g.isMeshDistanceMaterial===!0){const $=e.properties.get(g);$.light=H}return g}function M(D,F,H,x,g){if(D.visible===!1)return;if(D.layers.test(F.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&g===Jt)&&(!D.frustumCulled||i.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,D.matrixWorld);const V=t.update(D),q=D.material;if(Array.isArray(q)){const Z=V.groups;for(let j=0,ie=Z.length;j=1):K.indexOf("OpenGL ES")!==-1&&(ie=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),j=ie>=2);let Se=null,we={};const Ue=e.getParameter(e.SCISSOR_BOX),je=e.getParameter(e.VIEWPORT),et=new Nt().fromArray(Ue),Q=new Nt().fromArray(je);function de(E,X,N,z){const J=new Uint8Array(4),te=e.createTexture();e.bindTexture(E,te),e.texParameteri(E,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(E,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let ve=0;ve"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new Ke,m=new WeakMap;let _;const v=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(S,f){return h?new OffscreenCanvas(S,f):Hs("canvas")}function R(S,f,G){let B=1;const W=Te(S);if((W.width>G||W.height>G)&&(B=G/Math.max(W.width,W.height)),B<1)if(typeof HTMLImageElement<"u"&&S instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&S instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&S instanceof ImageBitmap||typeof VideoFrame<"u"&&S instanceof VideoFrame){const k=Math.floor(B*W.width),se=Math.floor(B*W.height);_===void 0&&(_=A(k,se));const ae=f?A(k,se):_;return ae.width=k,ae.height=se,ae.getContext("2d").drawImage(S,0,0,k,se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+W.width+"x"+W.height+") to ("+k+"x"+se+")."),ae}else return"data"in S&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+W.width+"x"+W.height+")."),S;return S}function c(S){return S.generateMipmaps}function l(S){e.generateMipmap(S)}function O(S){return S.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:S.isWebGL3DRenderTarget?e.TEXTURE_3D:S.isWebGLArrayRenderTarget||S.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function T(S,f,G,B,W=!1){if(S!==null){if(e[S]!==void 0)return e[S];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+S+"'")}let k=f;if(f===e.RED&&(G===e.FLOAT&&(k=e.R32F),G===e.HALF_FLOAT&&(k=e.R16F),G===e.UNSIGNED_BYTE&&(k=e.R8)),f===e.RED_INTEGER&&(G===e.UNSIGNED_BYTE&&(k=e.R8UI),G===e.UNSIGNED_SHORT&&(k=e.R16UI),G===e.UNSIGNED_INT&&(k=e.R32UI),G===e.BYTE&&(k=e.R8I),G===e.SHORT&&(k=e.R16I),G===e.INT&&(k=e.R32I)),f===e.RG&&(G===e.FLOAT&&(k=e.RG32F),G===e.HALF_FLOAT&&(k=e.RG16F),G===e.UNSIGNED_BYTE&&(k=e.RG8)),f===e.RG_INTEGER&&(G===e.UNSIGNED_BYTE&&(k=e.RG8UI),G===e.UNSIGNED_SHORT&&(k=e.RG16UI),G===e.UNSIGNED_INT&&(k=e.RG32UI),G===e.BYTE&&(k=e.RG8I),G===e.SHORT&&(k=e.RG16I),G===e.INT&&(k=e.RG32I)),f===e.RGB_INTEGER&&(G===e.UNSIGNED_BYTE&&(k=e.RGB8UI),G===e.UNSIGNED_SHORT&&(k=e.RGB16UI),G===e.UNSIGNED_INT&&(k=e.RGB32UI),G===e.BYTE&&(k=e.RGB8I),G===e.SHORT&&(k=e.RGB16I),G===e.INT&&(k=e.RGB32I)),f===e.RGBA_INTEGER&&(G===e.UNSIGNED_BYTE&&(k=e.RGBA8UI),G===e.UNSIGNED_SHORT&&(k=e.RGBA16UI),G===e.UNSIGNED_INT&&(k=e.RGBA32UI),G===e.BYTE&&(k=e.RGBA8I),G===e.SHORT&&(k=e.RGBA16I),G===e.INT&&(k=e.RGBA32I)),f===e.RGB&&G===e.UNSIGNED_INT_5_9_9_9_REV&&(k=e.RGB9_E5),f===e.RGBA){const se=W?Jr:Et.getTransfer(B);G===e.FLOAT&&(k=e.RGBA32F),G===e.HALF_FLOAT&&(k=e.RGBA16F),G===e.UNSIGNED_BYTE&&(k=se===ft?e.SRGB8_ALPHA8:e.RGBA8),G===e.UNSIGNED_SHORT_4_4_4_4&&(k=e.RGBA4),G===e.UNSIGNED_SHORT_5_5_5_1&&(k=e.RGB5_A1)}return(k===e.R16F||k===e.R32F||k===e.RG16F||k===e.RG32F||k===e.RGBA16F||k===e.RGBA32F)&&t.get("EXT_color_buffer_float"),k}function M(S,f){let G;return S?f===null||f===li||f===si?G=e.DEPTH24_STENCIL8:f===bn?G=e.DEPTH32F_STENCIL8:f===Ai&&(G=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):f===null||f===li||f===si?G=e.DEPTH_COMPONENT24:f===bn?G=e.DEPTH_COMPONENT32F:f===Ai&&(G=e.DEPTH_COMPONENT16),G}function C(S,f){return c(S)===!0||S.isFramebufferTexture&&S.minFilter!==ni&&S.minFilter!==In?Math.log2(Math.max(f.width,f.height))+1:S.mipmaps!==void 0&&S.mipmaps.length>0?S.mipmaps.length:S.isCompressedTexture&&Array.isArray(S.image)?f.mipmaps.length:1}function D(S){const f=S.target;f.removeEventListener("dispose",D),H(f),f.isVideoTexture&&m.delete(f)}function F(S){const f=S.target;f.removeEventListener("dispose",F),g(f)}function H(S){const f=i.get(S);if(f.__webglInit===void 0)return;const G=S.source,B=v.get(G);if(B){const W=B[f.__cacheKey];W.usedTimes--,W.usedTimes===0&&x(S),Object.keys(B).length===0&&v.delete(G)}i.remove(S)}function x(S){const f=i.get(S);e.deleteTexture(f.__webglTexture);const G=S.source,B=v.get(G);delete B[f.__cacheKey],o.memory.textures--}function g(S){const f=i.get(S);if(S.depthTexture&&(S.depthTexture.dispose(),i.remove(S.depthTexture)),S.isWebGLCubeRenderTarget)for(let B=0;B<6;B++){if(Array.isArray(f.__webglFramebuffer[B]))for(let W=0;W=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+S+" texture units while this GPU supports only "+r.maxTextures),P+=1,S}function q(S){const f=[];return f.push(S.wrapS),f.push(S.wrapT),f.push(S.wrapR||0),f.push(S.magFilter),f.push(S.minFilter),f.push(S.anisotropy),f.push(S.internalFormat),f.push(S.format),f.push(S.type),f.push(S.generateMipmaps),f.push(S.premultiplyAlpha),f.push(S.flipY),f.push(S.unpackAlignment),f.push(S.colorSpace),f.join()}function Z(S,f){const G=i.get(S);if(S.isVideoTexture&&Re(S),S.isRenderTargetTexture===!1&&S.version>0&&G.__version!==S.version){const B=S.image;if(B===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(B.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Q(G,S,f);return}}n.bindTexture(e.TEXTURE_2D,G.__webglTexture,e.TEXTURE0+f)}function j(S,f){const G=i.get(S);if(S.version>0&&G.__version!==S.version){Q(G,S,f);return}n.bindTexture(e.TEXTURE_2D_ARRAY,G.__webglTexture,e.TEXTURE0+f)}function ie(S,f){const G=i.get(S);if(S.version>0&&G.__version!==S.version){Q(G,S,f);return}n.bindTexture(e.TEXTURE_3D,G.__webglTexture,e.TEXTURE0+f)}function K(S,f){const G=i.get(S);if(S.version>0&&G.__version!==S.version){de(G,S,f);return}n.bindTexture(e.TEXTURE_CUBE_MAP,G.__webglTexture,e.TEXTURE0+f)}const Se={[Qo]:e.REPEAT,[$o]:e.CLAMP_TO_EDGE,[jo]:e.MIRRORED_REPEAT},we={[ni]:e.NEAREST,[Jo]:e.NEAREST_MIPMAP_NEAREST,[fi]:e.NEAREST_MIPMAP_LINEAR,[In]:e.LINEAR,[Li]:e.LINEAR_MIPMAP_NEAREST,[$n]:e.LINEAR_MIPMAP_LINEAR},Ue={[os]:e.NEVER,[rs]:e.ALWAYS,[as]:e.LESS,[Hr]:e.LEQUAL,[is]:e.EQUAL,[ns]:e.GEQUAL,[ts]:e.GREATER,[es]:e.NOTEQUAL};function je(S,f){if(f.type===bn&&t.has("OES_texture_float_linear")===!1&&(f.magFilter===In||f.magFilter===Li||f.magFilter===fi||f.magFilter===$n||f.minFilter===In||f.minFilter===Li||f.minFilter===fi||f.minFilter===$n)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(S,e.TEXTURE_WRAP_S,Se[f.wrapS]),e.texParameteri(S,e.TEXTURE_WRAP_T,Se[f.wrapT]),(S===e.TEXTURE_3D||S===e.TEXTURE_2D_ARRAY)&&e.texParameteri(S,e.TEXTURE_WRAP_R,Se[f.wrapR]),e.texParameteri(S,e.TEXTURE_MAG_FILTER,we[f.magFilter]),e.texParameteri(S,e.TEXTURE_MIN_FILTER,we[f.minFilter]),f.compareFunction&&(e.texParameteri(S,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(S,e.TEXTURE_COMPARE_FUNC,Ue[f.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(f.magFilter===ni||f.minFilter!==fi&&f.minFilter!==$n||f.type===bn&&t.has("OES_texture_float_linear")===!1)return;if(f.anisotropy>1||i.get(f).__currentAnisotropy){const G=t.get("EXT_texture_filter_anisotropic");e.texParameterf(S,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(f.anisotropy,r.getMaxAnisotropy())),i.get(f).__currentAnisotropy=f.anisotropy}}}function et(S,f){let G=!1;S.__webglInit===void 0&&(S.__webglInit=!0,f.addEventListener("dispose",D));const B=f.source;let W=v.get(B);W===void 0&&(W={},v.set(B,W));const k=q(f);if(k!==S.__cacheKey){W[k]===void 0&&(W[k]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,G=!0),W[k].usedTimes++;const se=W[S.__cacheKey];se!==void 0&&(W[S.__cacheKey].usedTimes--,se.usedTimes===0&&x(f)),S.__cacheKey=k,S.__webglTexture=W[k].texture}return G}function Q(S,f,G){let B=e.TEXTURE_2D;(f.isDataArrayTexture||f.isCompressedArrayTexture)&&(B=e.TEXTURE_2D_ARRAY),f.isData3DTexture&&(B=e.TEXTURE_3D);const W=et(S,f),k=f.source;n.bindTexture(B,S.__webglTexture,e.TEXTURE0+G);const se=i.get(k);if(k.version!==se.__version||W===!0){n.activeTexture(e.TEXTURE0+G);const ae=Et.getPrimaries(Et.workingColorSpace),le=f.colorSpace===Un?null:Et.getPrimaries(f.colorSpace),ye=f.colorSpace===Un||ae===le?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,f.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,f.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,ye);let Y=R(f.image,!1,r.maxTextureSize);Y=st(f,Y);const ce=a.convert(f.format,f.colorSpace),me=a.convert(f.type);let Ae=T(f.internalFormat,ce,me,f.colorSpace,f.isVideoTexture);je(B,f);let _e;const qe=f.mipmaps,Oe=f.isVideoTexture!==!0,at=se.__version===void 0||W===!0,E=k.dataReady,X=C(f,Y);if(f.isDepthTexture)Ae=M(f.format===Ti,f.type),at&&(Oe?n.texStorage2D(e.TEXTURE_2D,1,Ae,Y.width,Y.height):n.texImage2D(e.TEXTURE_2D,0,Ae,Y.width,Y.height,0,ce,me,null));else if(f.isDataTexture)if(qe.length>0){Oe&&at&&n.texStorage2D(e.TEXTURE_2D,X,Ae,qe[0].width,qe[0].height);for(let N=0,z=qe.length;N0){const J=ja(_e.width,_e.height,f.format,f.type);for(const te of f.layerUpdates){const ve=_e.data.subarray(te*J/_e.data.BYTES_PER_ELEMENT,(te+1)*J/_e.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,N,0,0,te,_e.width,_e.height,1,ce,ve)}f.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,N,0,0,0,_e.width,_e.height,Y.depth,ce,_e.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,N,Ae,_e.width,_e.height,Y.depth,0,_e.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Oe?E&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,N,0,0,0,_e.width,_e.height,Y.depth,ce,me,_e.data):n.texImage3D(e.TEXTURE_2D_ARRAY,N,Ae,_e.width,_e.height,Y.depth,0,ce,me,_e.data)}else{Oe&&at&&n.texStorage2D(e.TEXTURE_2D,X,Ae,qe[0].width,qe[0].height);for(let N=0,z=qe.length;N0){const N=ja(Y.width,Y.height,f.format,f.type);for(const z of f.layerUpdates){const J=Y.data.subarray(z*N/Y.data.BYTES_PER_ELEMENT,(z+1)*N/Y.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,z,Y.width,Y.height,1,ce,me,J)}f.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,Y.width,Y.height,Y.depth,ce,me,Y.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,Ae,Y.width,Y.height,Y.depth,0,ce,me,Y.data);else if(f.isData3DTexture)Oe?(at&&n.texStorage3D(e.TEXTURE_3D,X,Ae,Y.width,Y.height,Y.depth),E&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,Y.width,Y.height,Y.depth,ce,me,Y.data)):n.texImage3D(e.TEXTURE_3D,0,Ae,Y.width,Y.height,Y.depth,0,ce,me,Y.data);else if(f.isFramebufferTexture){if(at)if(Oe)n.texStorage2D(e.TEXTURE_2D,X,Ae,Y.width,Y.height);else{let N=Y.width,z=Y.height;for(let J=0;J>=1,z>>=1}}else if(qe.length>0){if(Oe&&at){const N=Te(qe[0]);n.texStorage2D(e.TEXTURE_2D,X,Ae,N.width,N.height)}for(let N=0,z=qe.length;N0&&X++;const z=Te(ce[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,X,qe,z.width,z.height)}for(let z=0;z<6;z++)if(Y){Oe?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+z,0,0,0,ce[z].width,ce[z].height,Ae,_e,ce[z].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+z,0,qe,ce[z].width,ce[z].height,0,Ae,_e,ce[z].data);for(let J=0;J>k),me=Math.max(1,f.height>>k);W===e.TEXTURE_3D||W===e.TEXTURE_2D_ARRAY?n.texImage3D(W,k,le,ce,me,f.depth,0,se,ae,null):n.texImage2D(W,k,le,ce,me,0,se,ae,null)}n.bindFramebuffer(e.FRAMEBUFFER,S),Be(f)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,B,W,Y.__webglTexture,0,Fe(f)):(W===e.TEXTURE_2D||W>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&W<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,B,W,Y.__webglTexture,k),n.bindFramebuffer(e.FRAMEBUFFER,null)}function ue(S,f,G){if(e.bindRenderbuffer(e.RENDERBUFFER,S),f.depthBuffer){const B=f.depthTexture,W=B&&B.isDepthTexture?B.type:null,k=M(f.stencilBuffer,W),se=f.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,ae=Fe(f);Be(f)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ae,k,f.width,f.height):G?e.renderbufferStorageMultisample(e.RENDERBUFFER,ae,k,f.width,f.height):e.renderbufferStorage(e.RENDERBUFFER,k,f.width,f.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,se,e.RENDERBUFFER,S)}else{const B=f.textures;for(let W=0;W{delete f.__boundDepthTexture,delete f.__depthDisposeCallback,B.removeEventListener("dispose",W)};B.addEventListener("dispose",W),f.__depthDisposeCallback=W}f.__boundDepthTexture=B}if(S.depthTexture&&!f.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");Ce(f.__webglFramebuffer,S)}else if(G){f.__webglDepthbuffer=[];for(let B=0;B<6;B++)if(n.bindFramebuffer(e.FRAMEBUFFER,f.__webglFramebuffer[B]),f.__webglDepthbuffer[B]===void 0)f.__webglDepthbuffer[B]=e.createRenderbuffer(),ue(f.__webglDepthbuffer[B],S,!1);else{const W=S.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,k=f.__webglDepthbuffer[B];e.bindRenderbuffer(e.RENDERBUFFER,k),e.framebufferRenderbuffer(e.FRAMEBUFFER,W,e.RENDERBUFFER,k)}}else if(n.bindFramebuffer(e.FRAMEBUFFER,f.__webglFramebuffer),f.__webglDepthbuffer===void 0)f.__webglDepthbuffer=e.createRenderbuffer(),ue(f.__webglDepthbuffer,S,!1);else{const B=S.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,W=f.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,W),e.framebufferRenderbuffer(e.FRAMEBUFFER,B,e.RENDERBUFFER,W)}n.bindFramebuffer(e.FRAMEBUFFER,null)}function Ve(S,f,G){const B=i.get(S);f!==void 0&&xe(B.__webglFramebuffer,S,S.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),G!==void 0&&Le(S)}function $e(S){const f=S.texture,G=i.get(S),B=i.get(f);S.addEventListener("dispose",F);const W=S.textures,k=S.isWebGLCubeRenderTarget===!0,se=W.length>1;if(se||(B.__webglTexture===void 0&&(B.__webglTexture=e.createTexture()),B.__version=f.version,o.memory.textures++),k){G.__webglFramebuffer=[];for(let ae=0;ae<6;ae++)if(f.mipmaps&&f.mipmaps.length>0){G.__webglFramebuffer[ae]=[];for(let le=0;le0){G.__webglFramebuffer=[];for(let ae=0;ae0&&Be(S)===!1){G.__webglMultisampledFramebuffer=e.createFramebuffer(),G.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let ae=0;ae0)for(let le=0;le0)for(let le=0;le0){if(Be(S)===!1){const f=S.textures,G=S.width,B=S.height;let W=e.COLOR_BUFFER_BIT;const k=S.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,se=i.get(S),ae=f.length>1;if(ae)for(let le=0;le0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&f.__useRenderToTexture!==!1}function Re(S){const f=o.render.frame;m.get(S)!==f&&(m.set(S,f),S.update())}function st(S,f){const G=S.colorSpace,B=S.format,W=S.type;return S.isCompressedTexture===!0||S.isVideoTexture===!0||G!==yi&&G!==Un&&(Et.getTransfer(G)===ft?(B!==tn||W!==An)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",G)),f}function Te(S){return typeof HTMLImageElement<"u"&&S instanceof HTMLImageElement?(d.width=S.naturalWidth||S.width,d.height=S.naturalHeight||S.height):typeof VideoFrame<"u"&&S instanceof VideoFrame?(d.width=S.displayWidth,d.height=S.displayHeight):(d.width=S.width,d.height=S.height),d}this.allocateTextureUnit=V,this.resetTextureUnits=$,this.setTexture2D=Z,this.setTexture2DArray=j,this.setTexture3D=ie,this.setTextureCube=K,this.rebindTextures=Ve,this.setupRenderTarget=$e,this.updateRenderTargetMipmap=ze,this.updateMultisampleRenderTarget=xt,this.setupDepthRenderbuffer=Le,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=Be}function Gu(e,t){function n(i,r=Un){let a;const o=Et.getTransfer(r);if(i===An)return e.UNSIGNED_BYTE;if(i===Vr)return e.UNSIGNED_SHORT_4_4_4_4;if(i===zr)return e.UNSIGNED_SHORT_5_5_5_1;if(i===ds)return e.UNSIGNED_INT_5_9_9_9_REV;if(i===fs)return e.BYTE;if(i===us)return e.SHORT;if(i===Ai)return e.UNSIGNED_SHORT;if(i===Xr)return e.INT;if(i===li)return e.UNSIGNED_INT;if(i===bn)return e.FLOAT;if(i===dn)return e.HALF_FLOAT;if(i===ps)return e.ALPHA;if(i===hs)return e.RGB;if(i===tn)return e.RGBA;if(i===ms)return e.LUMINANCE;if(i===_s)return e.LUMINANCE_ALPHA;if(i===ha)return e.DEPTH_COMPONENT;if(i===Ti)return e.DEPTH_STENCIL;if(i===gs)return e.RED;if(i===Yr)return e.RED_INTEGER;if(i===vs)return e.RG;if(i===qr)return e.RG_INTEGER;if(i===Kr)return e.RGBA_INTEGER;if(i===Ui||i===Ii||i===Ni||i===Oi)if(o===ft)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===Ui)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Ii)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Ni)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Oi)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===Ui)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Ii)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Ni)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Oi)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Ea||i===xa||i===Ma||i===Ta)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(i===Ea)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===xa)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Ma)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Ta)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===ba||i===Aa||i===Ra)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(i===ba||i===Aa)return o===ft?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===Ra)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===wa||i===ya||i===Ca||i===Pa||i===Da||i===La||i===Ua||i===Ia||i===Na||i===Oa||i===Fa||i===Ba||i===Ha||i===Ga)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(i===wa)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===ya)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Ca)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Pa)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Da)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===La)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Ua)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Ia)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Na)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Oa)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Fa)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ba)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Ha)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Ga)return o===ft?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Fi||i===ka||i===Va)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(i===Fi)return o===ft?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===ka)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Va)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Ss||i===za||i===Wa||i===Xa)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(i===Fi)return a.COMPRESSED_RED_RGTC1_EXT;if(i===za)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Wa)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Xa)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===si?e.UNSIGNED_INT_24_8:e[i]!==void 0?e[i]:null}return{convert:n}}const ku={type:"move"};class Wi{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qn,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 Qn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Me,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Me),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Me,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Me),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const n=this._hand;if(n)for(const i of t.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,n,i){let r=null,a=null,o=null;const s=this._targetRay,u=this._grip,d=this._hand;if(t&&n.session.visibilityState!=="visible-blurred"){if(d&&t.hand){o=!0;for(const R of t.hand.values()){const c=n.getJointPose(R,i),l=this._getHandJoint(d,R);c!==null&&(l.matrix.fromArray(c.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,l.jointRadius=c.radius),l.visible=c!==null}const m=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],v=m.position.distanceTo(_.position),h=.02,A=.005;d.inputState.pinching&&v>h+A?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!d.inputState.pinching&&v<=h-A&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=n.getPose(t.gripSpace,i),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));s!==null&&(r=n.getPose(t.targetRaySpace,i),r===null&&a!==null&&(r=a),r!==null&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(ku)))}return s!==null&&(s.visible=r!==null),u!==null&&(u.visible=a!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(t,n){if(t.joints[n.jointName]===void 0){const i=new Qn;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[n.jointName]=i,t.add(i)}return t.joints[n.jointName]}}const Vu=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,zu=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class Wu{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,n,i){if(this.texture===null){const r=new Wr,a=t.properties.get(r);a.__webglTexture=n.texture,(n.depthNear!==i.depthNear||n.depthFar!==i.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=r}}getMesh(t){if(this.texture!==null&&this.mesh===null){const n=t.cameras[0].viewport,i=new Ot({vertexShader:Vu,fragmentShader:zu,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Bt(new ma(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Xu extends Po{constructor(t,n){super();const i=this;let r=null,a=1,o=null,s="local-floor",u=1,d=null,m=null,_=null,v=null,h=null,A=null;const R=new Wu,c=n.getContextAttributes();let l=null,O=null;const T=[],M=[],C=new Ke;let D=null;const F=new Bn;F.viewport=new Nt;const H=new Bn;H.viewport=new Nt;const x=[F,H],g=new Do;let P=null,$=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let de=T[Q];return de===void 0&&(de=new Wi,T[Q]=de),de.getTargetRaySpace()},this.getControllerGrip=function(Q){let de=T[Q];return de===void 0&&(de=new Wi,T[Q]=de),de.getGripSpace()},this.getHand=function(Q){let de=T[Q];return de===void 0&&(de=new Wi,T[Q]=de),de.getHandSpace()};function V(Q){const de=M.indexOf(Q.inputSource);if(de===-1)return;const xe=T[de];xe!==void 0&&(xe.update(Q.inputSource,Q.frame,d||o),xe.dispatchEvent({type:Q.type,data:Q.inputSource}))}function q(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",q),r.removeEventListener("inputsourceschange",Z);for(let Q=0;Q=0&&(M[ue]=null,T[ue].disconnect(xe))}for(let de=0;de=M.length){M.push(xe),ue=Le;break}else if(M[Le]===null){M[Le]=xe,ue=Le;break}if(ue===-1)break}const Ce=T[ue];Ce&&Ce.connect(xe)}}const j=new Me,ie=new Me;function K(Q,de,xe){j.setFromMatrixPosition(de.matrixWorld),ie.setFromMatrixPosition(xe.matrixWorld);const ue=j.distanceTo(ie),Ce=de.projectionMatrix.elements,Le=xe.projectionMatrix.elements,Ve=Ce[14]/(Ce[10]-1),$e=Ce[14]/(Ce[10]+1),ze=(Ce[9]+1)/Ce[5],lt=(Ce[9]-1)/Ce[5],w=(Ce[8]-1)/Ce[0],xt=(Le[8]+1)/Le[0],Fe=Ve*w,Be=Ve*xt,Re=ue/(-w+xt),st=Re*-w;if(de.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(st),Q.translateZ(Re),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert(),Ce[10]===-1)Q.projectionMatrix.copy(de.projectionMatrix),Q.projectionMatrixInverse.copy(de.projectionMatrixInverse);else{const Te=Ve+Re,S=$e+Re,f=Fe-st,G=Be+(ue-st),B=ze*$e/S*Te,W=lt*$e/S*Te;Q.projectionMatrix.makePerspective(f,G,B,W,Te,S),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}}function Se(Q,de){de===null?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(de.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(r===null)return;let de=Q.near,xe=Q.far;R.texture!==null&&(R.depthNear>0&&(de=R.depthNear),R.depthFar>0&&(xe=R.depthFar)),g.near=H.near=F.near=de,g.far=H.far=F.far=xe,(P!==g.near||$!==g.far)&&(r.updateRenderState({depthNear:g.near,depthFar:g.far}),P=g.near,$=g.far),F.layers.mask=Q.layers.mask|2,H.layers.mask=Q.layers.mask|4,g.layers.mask=F.layers.mask|H.layers.mask;const ue=Q.parent,Ce=g.cameras;Se(g,ue);for(let Le=0;Le0&&(c.alphaTest.value=l.alphaTest);const O=t.get(l),T=O.envMap,M=O.envMapRotation;T&&(c.envMap.value=T,gn.copy(M),gn.x*=-1,gn.y*=-1,gn.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(gn.y*=-1,gn.z*=-1),c.envMapRotation.value.setFromMatrix4(Yu.makeRotationFromEuler(gn)),c.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,c.reflectivity.value=l.reflectivity,c.ior.value=l.ior,c.refractionRatio.value=l.refractionRatio),l.lightMap&&(c.lightMap.value=l.lightMap,c.lightMapIntensity.value=l.lightMapIntensity,n(l.lightMap,c.lightMapTransform)),l.aoMap&&(c.aoMap.value=l.aoMap,c.aoMapIntensity.value=l.aoMapIntensity,n(l.aoMap,c.aoMapTransform))}function o(c,l){c.diffuse.value.copy(l.color),c.opacity.value=l.opacity,l.map&&(c.map.value=l.map,n(l.map,c.mapTransform))}function s(c,l){c.dashSize.value=l.dashSize,c.totalSize.value=l.dashSize+l.gapSize,c.scale.value=l.scale}function u(c,l,O,T){c.diffuse.value.copy(l.color),c.opacity.value=l.opacity,c.size.value=l.size*O,c.scale.value=T*.5,l.map&&(c.map.value=l.map,n(l.map,c.uvTransform)),l.alphaMap&&(c.alphaMap.value=l.alphaMap,n(l.alphaMap,c.alphaMapTransform)),l.alphaTest>0&&(c.alphaTest.value=l.alphaTest)}function d(c,l){c.diffuse.value.copy(l.color),c.opacity.value=l.opacity,c.rotation.value=l.rotation,l.map&&(c.map.value=l.map,n(l.map,c.mapTransform)),l.alphaMap&&(c.alphaMap.value=l.alphaMap,n(l.alphaMap,c.alphaMapTransform)),l.alphaTest>0&&(c.alphaTest.value=l.alphaTest)}function m(c,l){c.specular.value.copy(l.specular),c.shininess.value=Math.max(l.shininess,1e-4)}function _(c,l){l.gradientMap&&(c.gradientMap.value=l.gradientMap)}function v(c,l){c.metalness.value=l.metalness,l.metalnessMap&&(c.metalnessMap.value=l.metalnessMap,n(l.metalnessMap,c.metalnessMapTransform)),c.roughness.value=l.roughness,l.roughnessMap&&(c.roughnessMap.value=l.roughnessMap,n(l.roughnessMap,c.roughnessMapTransform)),l.envMap&&(c.envMapIntensity.value=l.envMapIntensity)}function h(c,l,O){c.ior.value=l.ior,l.sheen>0&&(c.sheenColor.value.copy(l.sheenColor).multiplyScalar(l.sheen),c.sheenRoughness.value=l.sheenRoughness,l.sheenColorMap&&(c.sheenColorMap.value=l.sheenColorMap,n(l.sheenColorMap,c.sheenColorMapTransform)),l.sheenRoughnessMap&&(c.sheenRoughnessMap.value=l.sheenRoughnessMap,n(l.sheenRoughnessMap,c.sheenRoughnessMapTransform))),l.clearcoat>0&&(c.clearcoat.value=l.clearcoat,c.clearcoatRoughness.value=l.clearcoatRoughness,l.clearcoatMap&&(c.clearcoatMap.value=l.clearcoatMap,n(l.clearcoatMap,c.clearcoatMapTransform)),l.clearcoatRoughnessMap&&(c.clearcoatRoughnessMap.value=l.clearcoatRoughnessMap,n(l.clearcoatRoughnessMap,c.clearcoatRoughnessMapTransform)),l.clearcoatNormalMap&&(c.clearcoatNormalMap.value=l.clearcoatNormalMap,n(l.clearcoatNormalMap,c.clearcoatNormalMapTransform),c.clearcoatNormalScale.value.copy(l.clearcoatNormalScale),l.side===Vt&&c.clearcoatNormalScale.value.negate())),l.dispersion>0&&(c.dispersion.value=l.dispersion),l.iridescence>0&&(c.iridescence.value=l.iridescence,c.iridescenceIOR.value=l.iridescenceIOR,c.iridescenceThicknessMinimum.value=l.iridescenceThicknessRange[0],c.iridescenceThicknessMaximum.value=l.iridescenceThicknessRange[1],l.iridescenceMap&&(c.iridescenceMap.value=l.iridescenceMap,n(l.iridescenceMap,c.iridescenceMapTransform)),l.iridescenceThicknessMap&&(c.iridescenceThicknessMap.value=l.iridescenceThicknessMap,n(l.iridescenceThicknessMap,c.iridescenceThicknessMapTransform))),l.transmission>0&&(c.transmission.value=l.transmission,c.transmissionSamplerMap.value=O.texture,c.transmissionSamplerSize.value.set(O.width,O.height),l.transmissionMap&&(c.transmissionMap.value=l.transmissionMap,n(l.transmissionMap,c.transmissionMapTransform)),c.thickness.value=l.thickness,l.thicknessMap&&(c.thicknessMap.value=l.thicknessMap,n(l.thicknessMap,c.thicknessMapTransform)),c.attenuationDistance.value=l.attenuationDistance,c.attenuationColor.value.copy(l.attenuationColor)),l.anisotropy>0&&(c.anisotropyVector.value.set(l.anisotropy*Math.cos(l.anisotropyRotation),l.anisotropy*Math.sin(l.anisotropyRotation)),l.anisotropyMap&&(c.anisotropyMap.value=l.anisotropyMap,n(l.anisotropyMap,c.anisotropyMapTransform))),c.specularIntensity.value=l.specularIntensity,c.specularColor.value.copy(l.specularColor),l.specularColorMap&&(c.specularColorMap.value=l.specularColorMap,n(l.specularColorMap,c.specularColorMapTransform)),l.specularIntensityMap&&(c.specularIntensityMap.value=l.specularIntensityMap,n(l.specularIntensityMap,c.specularIntensityMapTransform))}function A(c,l){l.matcap&&(c.matcap.value=l.matcap)}function R(c,l){const O=t.get(l).light;c.referencePosition.value.setFromMatrixPosition(O.matrixWorld),c.nearDistance.value=O.shadow.camera.near,c.farDistance.value=O.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function Ku(e,t,n,i){let r={},a={},o=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function u(O,T){const M=T.program;i.uniformBlockBinding(O,M)}function d(O,T){let M=r[O.id];M===void 0&&(A(O),M=m(O),r[O.id]=M,O.addEventListener("dispose",c));const C=T.program;i.updateUBOMapping(O,C);const D=t.render.frame;a[O.id]!==D&&(v(O),a[O.id]=D)}function m(O){const T=_();O.__bindingPointIndex=T;const M=e.createBuffer(),C=O.__size,D=O.usage;return e.bindBuffer(e.UNIFORM_BUFFER,M),e.bufferData(e.UNIFORM_BUFFER,C,D),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,T,M),M}function _(){for(let O=0;O0&&(M+=C-D),O.__size=M,O.__cache={},this}function R(O){const T={boundary:0,storage:0};return typeof O=="number"||typeof O=="boolean"?(T.boundary=4,T.storage=4):O.isVector2?(T.boundary=8,T.storage=8):O.isVector3||O.isColor?(T.boundary=16,T.storage=12):O.isVector4?(T.boundary=16,T.storage=16):O.isMatrix3?(T.boundary=48,T.storage=48):O.isMatrix4?(T.boundary=64,T.storage=64):O.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",O),T}function c(O){const T=O.target;T.removeEventListener("dispose",c);const M=o.indexOf(T.__bindingPointIndex);o.splice(M,1),e.deleteBuffer(r[T.id]),delete r[T.id],delete a[T.id]}function l(){for(const O in r)e.deleteBuffer(r[O]);o=[],r={},a={}}return{bind:u,update:d,dispose:l}}class Zu{constructor(t={}){const{canvas:n=To(),context:i=null,depth:r=!0,stencil:a=!1,alpha:o=!1,antialias:s=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:d=!1,powerPreference:m="default",failIfMajorPerformanceCaveat:_=!1,reverseDepthBuffer:v=!1}=t;this.isWebGLRenderer=!0;let h;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=i.getContextAttributes().alpha}else h=o;const A=new Uint32Array(4),R=new Int32Array(4);let c=null,l=null;const O=[],T=[];this.domElement=n,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._outputColorSpace=bo,this.toneMapping=cn,this.toneMappingExposure=1;const M=this;let C=!1,D=0,F=0,H=null,x=-1,g=null;const P=new Nt,$=new Nt;let V=null;const q=new be(0);let Z=0,j=n.width,ie=n.height,K=1,Se=null,we=null;const Ue=new Nt(0,0,j,ie),je=new Nt(0,0,j,ie);let et=!1;const Q=new Fr;let de=!1,xe=!1;this.transmissionResolutionScale=1;const ue=new Vn,Ce=new Vn,Le=new Me,Ve=new Nt,$e={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ze=!1;function lt(){return H===null?K:1}let w=i;function xt(p,L){return n.getContext(p,L)}try{const p={alpha:!0,depth:r,stencil:a,antialias:s,premultipliedAlpha:u,preserveDrawingBuffer:d,powerPreference:m,failIfMajorPerformanceCaveat:_};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Ao}`),n.addEventListener("webglcontextlost",z,!1),n.addEventListener("webglcontextrestored",J,!1),n.addEventListener("webglcontextcreationerror",te,!1),w===null){const L="webgl2";if(w=xt(L,p),w===null)throw xt(L)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(p){throw console.error("THREE.WebGLRenderer: "+p.message),p}let Fe,Be,Re,st,Te,S,f,G,B,W,k,se,ae,le,ye,Y,ce,me,Ae,_e,qe,Oe,at,E;function X(){Fe=new af(w),Fe.init(),Oe=new Gu(w,Fe),Be=new $d(w,Fe,t,Oe),Re=new Bu(w,Fe),Be.reverseDepthBuffer&&v&&Re.buffers.depth.setReversed(!0),st=new sf(w),Te=new Au,S=new Hu(w,Fe,Re,Te,Be,Oe,st),f=new Jd(M),G=new nf(M),B=new pl(w),at=new Zd(w,B),W=new rf(w,B,st,at),k=new cf(w,W,B,st),Ae=new lf(w,Be,S),Y=new Qd(Te),se=new bu(M,f,G,Fe,Be,at,Y),ae=new qu(M,Te),le=new wu,ye=new Uu(Fe),me=new Kd(M,f,G,Re,k,h,u),ce=new Ou(M,k,Be),E=new Ku(w,st,Be,Re),_e=new jd(w,Fe,st),qe=new of(w,Fe,st),st.programs=se.programs,M.capabilities=Be,M.extensions=Fe,M.properties=Te,M.renderLists=le,M.shadowMap=ce,M.state=Re,M.info=st}X();const N=new Xu(M,w);this.xr=N,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const p=Fe.get("WEBGL_lose_context");p&&p.loseContext()},this.forceContextRestore=function(){const p=Fe.get("WEBGL_lose_context");p&&p.restoreContext()},this.getPixelRatio=function(){return K},this.setPixelRatio=function(p){p!==void 0&&(K=p,this.setSize(j,ie,!1))},this.getSize=function(p){return p.set(j,ie)},this.setSize=function(p,L,y=!0){if(N.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}j=p,ie=L,n.width=Math.floor(p*K),n.height=Math.floor(L*K),y===!0&&(n.style.width=p+"px",n.style.height=L+"px"),this.setViewport(0,0,p,L)},this.getDrawingBufferSize=function(p){return p.set(j*K,ie*K).floor()},this.setDrawingBufferSize=function(p,L,y){j=p,ie=L,K=y,n.width=Math.floor(p*y),n.height=Math.floor(L*y),this.setViewport(0,0,p,L)},this.getCurrentViewport=function(p){return p.copy(P)},this.getViewport=function(p){return p.copy(Ue)},this.setViewport=function(p,L,y,I){p.isVector4?Ue.set(p.x,p.y,p.z,p.w):Ue.set(p,L,y,I),Re.viewport(P.copy(Ue).multiplyScalar(K).round())},this.getScissor=function(p){return p.copy(je)},this.setScissor=function(p,L,y,I){p.isVector4?je.set(p.x,p.y,p.z,p.w):je.set(p,L,y,I),Re.scissor($.copy(je).multiplyScalar(K).round())},this.getScissorTest=function(){return et},this.setScissorTest=function(p){Re.setScissorTest(et=p)},this.setOpaqueSort=function(p){Se=p},this.setTransparentSort=function(p){we=p},this.getClearColor=function(p){return p.copy(me.getClearColor())},this.setClearColor=function(){me.setClearColor.apply(me,arguments)},this.getClearAlpha=function(){return me.getClearAlpha()},this.setClearAlpha=function(){me.setClearAlpha.apply(me,arguments)},this.clear=function(p=!0,L=!0,y=!0){let I=0;if(p){let U=!1;if(H!==null){const ne=H.texture.format;U=ne===Kr||ne===qr||ne===Yr}if(U){const ne=H.texture.type,he=ne===An||ne===li||ne===Ai||ne===si||ne===Vr||ne===zr,ge=me.getClearColor(),Ee=me.getClearAlpha(),Ie=ge.r,He=ge.g,Pe=ge.b;he?(A[0]=Ie,A[1]=He,A[2]=Pe,A[3]=Ee,w.clearBufferuiv(w.COLOR,0,A)):(R[0]=Ie,R[1]=He,R[2]=Pe,R[3]=Ee,w.clearBufferiv(w.COLOR,0,R))}else I|=w.COLOR_BUFFER_BIT}L&&(I|=w.DEPTH_BUFFER_BIT),y&&(I|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(I)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",z,!1),n.removeEventListener("webglcontextrestored",J,!1),n.removeEventListener("webglcontextcreationerror",te,!1),me.dispose(),le.dispose(),ye.dispose(),Te.dispose(),f.dispose(),G.dispose(),k.dispose(),at.dispose(),E.dispose(),se.dispose(),N.dispose(),N.removeEventListener("sessionstart",zt),N.removeEventListener("sessionend",un),Dt.stop()};function z(p){p.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),C=!0}function J(){console.log("THREE.WebGLRenderer: Context Restored."),C=!1;const p=st.autoReset,L=ce.enabled,y=ce.autoUpdate,I=ce.needsUpdate,U=ce.type;X(),st.autoReset=p,ce.enabled=L,ce.autoUpdate=y,ce.needsUpdate=I,ce.type=U}function te(p){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",p.statusMessage)}function ve(p){const L=p.target;L.removeEventListener("dispose",ve),We(L)}function We(p){it(p),Te.remove(p)}function it(p){const L=Te.get(p).programs;L!==void 0&&(L.forEach(function(y){se.releaseProgram(y)}),p.isShaderMaterial&&se.releaseShaderCache(p))}this.renderBufferDirect=function(p,L,y,I,U,ne){L===null&&(L=$e);const he=U.isMesh&&U.matrixWorld.determinant()<0,ge=$t(p,L,y,I,U);Re.setMaterial(I,he);let Ee=y.index,Ie=1;if(I.wireframe===!0){if(Ee=W.getWireframeAttribute(y),Ee===void 0)return;Ie=2}const He=y.drawRange,Pe=y.attributes.position;let Qe=He.start*Ie,rt=(He.start+He.count)*Ie;ne!==null&&(Qe=Math.max(Qe,ne.start*Ie),rt=Math.min(rt,(ne.start+ne.count)*Ie)),Ee!==null?(Qe=Math.max(Qe,0),rt=Math.min(rt,Ee.count)):Pe!=null&&(Qe=Math.max(Qe,0),rt=Math.min(rt,Pe.count));const St=rt-Qe;if(St<0||St===1/0)return;at.setup(U,I,ge,y,Ee);let _t,tt=_e;if(Ee!==null&&(_t=B.get(Ee),tt=qe,tt.setIndex(_t)),U.isMesh)I.wireframe===!0?(Re.setLineWidth(I.wireframeLinewidth*lt()),tt.setMode(w.LINES)):tt.setMode(w.TRIANGLES);else if(U.isLine){let De=I.linewidth;De===void 0&&(De=1),Re.setLineWidth(De*lt()),U.isLineSegments?tt.setMode(w.LINES):U.isLineLoop?tt.setMode(w.LINE_LOOP):tt.setMode(w.LINE_STRIP)}else U.isPoints?tt.setMode(w.POINTS):U.isSprite&&tt.setMode(w.TRIANGLES);if(U.isBatchedMesh)if(U._multiDrawInstances!==null)tt.renderMultiDrawInstances(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount,U._multiDrawInstances);else if(Fe.get("WEBGL_multi_draw"))tt.renderMultiDraw(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount);else{const De=U._multiDrawStarts,At=U._multiDrawCounts,ot=U._multiDrawCount,Wt=Ee?B.get(Ee).bytesPerElement:1,Cn=Te.get(I).currentProgram.getUniforms();for(let Ft=0;Ft{function ne(){if(I.forEach(function(he){Te.get(he).currentProgram.isReady()&&I.delete(he)}),I.size===0){U(p);return}setTimeout(ne,10)}Fe.get("KHR_parallel_shader_compile")!==null?ne():setTimeout(ne,10)})};let vt=null;function dt(p){vt&&vt(p)}function zt(){Dt.stop()}function un(){Dt.start()}const Dt=new ao;Dt.setAnimationLoop(dt),typeof self<"u"&&Dt.setContext(self),this.setAnimationLoop=function(p){vt=p,N.setAnimationLoop(p),p===null?Dt.stop():Dt.start()},N.addEventListener("sessionstart",zt),N.addEventListener("sessionend",un),this.render=function(p,L){if(L!==void 0&&L.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(C===!0)return;if(p.matrixWorldAutoUpdate===!0&&p.updateMatrixWorld(),L.parent===null&&L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),N.enabled===!0&&N.isPresenting===!0&&(N.cameraAutoUpdate===!0&&N.updateCamera(L),L=N.getCamera()),p.isScene===!0&&p.onBeforeRender(M,p,L,H),l=ye.get(p,T.length),l.init(L),T.push(l),Ce.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse),Q.setFromProjectionMatrix(Ce),xe=this.localClippingEnabled,de=Y.init(this.clippingPlanes,xe),c=le.get(p,O.length),c.init(),O.push(c),N.enabled===!0&&N.isPresenting===!0){const ne=M.xr.getDepthSensingMesh();ne!==null&&Kt(ne,L,-1/0,M.sortObjects)}Kt(p,L,0,M.sortObjects),c.finish(),M.sortObjects===!0&&c.sort(Se,we),ze=N.enabled===!1||N.isPresenting===!1||N.hasDepthSensing()===!1,ze&&me.addToRenderList(c,p),this.info.render.frame++,de===!0&&Y.beginShadows();const y=l.state.shadowsArray;ce.render(y,p,L),de===!0&&Y.endShadows(),this.info.autoReset===!0&&this.info.reset();const I=c.opaque,U=c.transmissive;if(l.setupLights(),L.isArrayCamera){const ne=L.cameras;if(U.length>0)for(let he=0,ge=ne.length;he0&&Zt(I,U,p,L),ze&&me.render(p),pn(c,p,L);H!==null&&F===0&&(S.updateMultisampleRenderTarget(H),S.updateRenderTargetMipmap(H)),p.isScene===!0&&p.onAfterRender(M,p,L),at.resetDefaultState(),x=-1,g=null,T.pop(),T.length>0?(l=T[T.length-1],de===!0&&Y.setGlobalState(M.clippingPlanes,l.state.camera)):l=null,O.pop(),O.length>0?c=O[O.length-1]:c=null};function Kt(p,L,y,I){if(p.visible===!1)return;if(p.layers.test(L.layers)){if(p.isGroup)y=p.renderOrder;else if(p.isLOD)p.autoUpdate===!0&&p.update(L);else if(p.isLight)l.pushLight(p),p.castShadow&&l.pushShadow(p);else if(p.isSprite){if(!p.frustumCulled||Q.intersectsSprite(p)){I&&Ve.setFromMatrixPosition(p.matrixWorld).applyMatrix4(Ce);const he=k.update(p),ge=p.material;ge.visible&&c.push(p,he,ge,y,Ve.z,null)}}else if((p.isMesh||p.isLine||p.isPoints)&&(!p.frustumCulled||Q.intersectsObject(p))){const he=k.update(p),ge=p.material;if(I&&(p.boundingSphere!==void 0?(p.boundingSphere===null&&p.computeBoundingSphere(),Ve.copy(p.boundingSphere.center)):(he.boundingSphere===null&&he.computeBoundingSphere(),Ve.copy(he.boundingSphere.center)),Ve.applyMatrix4(p.matrixWorld).applyMatrix4(Ce)),Array.isArray(ge)){const Ee=he.groups;for(let Ie=0,He=Ee.length;Ie0&&nn(U,L,y),ne.length>0&&nn(ne,L,y),he.length>0&&nn(he,L,y),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function Zt(p,L,y,I){if((y.isScene===!0?y.overrideMaterial:null)!==null)return;l.state.transmissionRenderTarget[I.id]===void 0&&(l.state.transmissionRenderTarget[I.id]=new qt(1,1,{generateMipmaps:!0,type:Fe.has("EXT_color_buffer_half_float")||Fe.has("EXT_color_buffer_float")?dn:An,minFilter:$n,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Et.workingColorSpace}));const ne=l.state.transmissionRenderTarget[I.id],he=I.viewport||P;ne.setSize(he.z*M.transmissionResolutionScale,he.w*M.transmissionResolutionScale);const ge=M.getRenderTarget();M.setRenderTarget(ne),M.getClearColor(q),Z=M.getClearAlpha(),Z<1&&M.setClearColor(16777215,.5),M.clear(),ze&&me.render(y);const Ee=M.toneMapping;M.toneMapping=cn;const Ie=I.viewport;if(I.viewport!==void 0&&(I.viewport=void 0),l.setupLightsView(I),de===!0&&Y.setGlobalState(M.clippingPlanes,I),nn(p,y,I),S.updateMultisampleRenderTarget(ne),S.updateRenderTargetMipmap(ne),Fe.has("WEBGL_multisampled_render_to_texture")===!1){let He=!1;for(let Pe=0,Qe=L.length;Pe0),Pe=!!y.morphAttributes.position,Qe=!!y.morphAttributes.normal,rt=!!y.morphAttributes.color;let St=cn;I.toneMapped&&(H===null||H.isXRRenderTarget===!0)&&(St=M.toneMapping);const _t=y.morphAttributes.position||y.morphAttributes.normal||y.morphAttributes.color,tt=_t!==void 0?_t.length:0,De=Te.get(I),At=l.state.lights;if(de===!0&&(xe===!0||p!==g)){const Pt=p===g&&I.id===x;Y.setState(I,p,Pt)}let ot=!1;I.version===De.__version?(De.needsLights&&De.lightsStateVersion!==At.state.version||De.outputColorSpace!==ge||U.isBatchedMesh&&De.batching===!1||!U.isBatchedMesh&&De.batching===!0||U.isBatchedMesh&&De.batchingColor===!0&&U.colorTexture===null||U.isBatchedMesh&&De.batchingColor===!1&&U.colorTexture!==null||U.isInstancedMesh&&De.instancing===!1||!U.isInstancedMesh&&De.instancing===!0||U.isSkinnedMesh&&De.skinning===!1||!U.isSkinnedMesh&&De.skinning===!0||U.isInstancedMesh&&De.instancingColor===!0&&U.instanceColor===null||U.isInstancedMesh&&De.instancingColor===!1&&U.instanceColor!==null||U.isInstancedMesh&&De.instancingMorph===!0&&U.morphTexture===null||U.isInstancedMesh&&De.instancingMorph===!1&&U.morphTexture!==null||De.envMap!==Ee||I.fog===!0&&De.fog!==ne||De.numClippingPlanes!==void 0&&(De.numClippingPlanes!==Y.numPlanes||De.numIntersection!==Y.numIntersection)||De.vertexAlphas!==Ie||De.vertexTangents!==He||De.morphTargets!==Pe||De.morphNormals!==Qe||De.morphColors!==rt||De.toneMapping!==St||De.morphTargetsCount!==tt)&&(ot=!0):(ot=!0,De.__version=I.version);let Wt=De.currentProgram;ot===!0&&(Wt=an(I,L,U));let Cn=!1,Ft=!1,Zn=!1;const pt=Wt.getUniforms(),Ht=De.uniforms;if(Re.useProgram(Wt.program)&&(Cn=!0,Ft=!0,Zn=!0),I.id!==x&&(x=I.id,Ft=!0),Cn||g!==p){Re.buffers.depth.getReversed()?(ue.copy(p.projectionMatrix),Ro(ue),wo(ue),pt.setValue(w,"projectionMatrix",ue)):pt.setValue(w,"projectionMatrix",p.projectionMatrix),pt.setValue(w,"viewMatrix",p.matrixWorldInverse);const Lt=pt.map.cameraPosition;Lt!==void 0&&Lt.setValue(w,Le.setFromMatrixPosition(p.matrixWorld)),Be.logarithmicDepthBuffer&&pt.setValue(w,"logDepthBufFC",2/(Math.log(p.far+1)/Math.LN2)),(I.isMeshPhongMaterial||I.isMeshToonMaterial||I.isMeshLambertMaterial||I.isMeshBasicMaterial||I.isMeshStandardMaterial||I.isShaderMaterial)&&pt.setValue(w,"isOrthographic",p.isOrthographicCamera===!0),g!==p&&(g=p,Ft=!0,Zn=!0)}if(U.isSkinnedMesh){pt.setOptional(w,U,"bindMatrix"),pt.setOptional(w,U,"bindMatrixInverse");const Pt=U.skeleton;Pt&&(Pt.boneTexture===null&&Pt.computeBoneTexture(),pt.setValue(w,"boneTexture",Pt.boneTexture,S))}U.isBatchedMesh&&(pt.setOptional(w,U,"batchingTexture"),pt.setValue(w,"batchingTexture",U._matricesTexture,S),pt.setOptional(w,U,"batchingIdTexture"),pt.setValue(w,"batchingIdTexture",U._indirectTexture,S),pt.setOptional(w,U,"batchingColorTexture"),U._colorsTexture!==null&&pt.setValue(w,"batchingColorTexture",U._colorsTexture,S));const Gt=y.morphAttributes;if((Gt.position!==void 0||Gt.normal!==void 0||Gt.color!==void 0)&&Ae.update(U,y,Wt),(Ft||De.receiveShadow!==U.receiveShadow)&&(De.receiveShadow=U.receiveShadow,pt.setValue(w,"receiveShadow",U.receiveShadow)),I.isMeshGouraudMaterial&&I.envMap!==null&&(Ht.envMap.value=Ee,Ht.flipEnvMap.value=Ee.isCubeTexture&&Ee.isRenderTargetTexture===!1?-1:1),I.isMeshStandardMaterial&&I.envMap===null&&L.environment!==null&&(Ht.envMapIntensity.value=L.environmentIntensity),Ft&&(pt.setValue(w,"toneMappingExposure",M.toneMappingExposure),De.needsLights&&wn(Ht,Zn),ne&&I.fog===!0&&ae.refreshFogUniforms(Ht,ne),ae.refreshMaterialUniforms(Ht,I,K,ie,l.state.transmissionRenderTarget[p.id]),Ei.upload(w,rn(De),Ht,S)),I.isShaderMaterial&&I.uniformsNeedUpdate===!0&&(Ei.upload(w,rn(De),Ht,S),I.uniformsNeedUpdate=!1),I.isSpriteMaterial&&pt.setValue(w,"center",U.center),pt.setValue(w,"modelViewMatrix",U.modelViewMatrix),pt.setValue(w,"normalMatrix",U.normalMatrix),pt.setValue(w,"modelMatrix",U.matrixWorld),I.isShaderMaterial||I.isRawShaderMaterial){const Pt=I.uniformsGroups;for(let Lt=0,Di=Pt.length;Lt0&&S.useMultisampledRTT(p)===!1?U=Te.get(p).__webglMultisampledFramebuffer:Array.isArray(He)?U=He[y]:U=He,P.copy(p.viewport),$.copy(p.scissor),V=p.scissorTest}else P.copy(Ue).multiplyScalar(K).floor(),$.copy(je).multiplyScalar(K).floor(),V=et;if(y!==0&&(U=on),Re.bindFramebuffer(w.FRAMEBUFFER,U)&&I&&Re.drawBuffers(p,U),Re.viewport(P),Re.scissor($),Re.setScissorTest(V),ne){const Ee=Te.get(p.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+L,Ee.__webglTexture,y)}else if(he){const Ee=Te.get(p.texture),Ie=L;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ee.__webglTexture,y,Ie)}else if(p!==null&&y!==0){const Ee=Te.get(p.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Ee.__webglTexture,y)}x=-1},this.readRenderTargetPixels=function(p,L,y,I,U,ne,he){if(!(p&&p.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Te.get(p).__webglFramebuffer;if(p.isWebGLCubeRenderTarget&&he!==void 0&&(ge=ge[he]),ge){Re.bindFramebuffer(w.FRAMEBUFFER,ge);try{const Ee=p.texture,Ie=Ee.format,He=Ee.type;if(!Be.textureFormatReadable(Ie)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Be.textureTypeReadable(He)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}L>=0&&L<=p.width-I&&y>=0&&y<=p.height-U&&w.readPixels(L,y,I,U,Oe.convert(Ie),Oe.convert(He),ne)}finally{const Ee=H!==null?Te.get(H).__webglFramebuffer:null;Re.bindFramebuffer(w.FRAMEBUFFER,Ee)}}},this.readRenderTargetPixelsAsync=async function(p,L,y,I,U,ne,he){if(!(p&&p.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ge=Te.get(p).__webglFramebuffer;if(p.isWebGLCubeRenderTarget&&he!==void 0&&(ge=ge[he]),ge){const Ee=p.texture,Ie=Ee.format,He=Ee.type;if(!Be.textureFormatReadable(Ie))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Be.textureTypeReadable(He))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(L>=0&&L<=p.width-I&&y>=0&&y<=p.height-U){Re.bindFramebuffer(w.FRAMEBUFFER,ge);const Pe=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Pe),w.bufferData(w.PIXEL_PACK_BUFFER,ne.byteLength,w.STREAM_READ),w.readPixels(L,y,I,U,Oe.convert(Ie),Oe.convert(He),0);const Qe=H!==null?Te.get(H).__webglFramebuffer:null;Re.bindFramebuffer(w.FRAMEBUFFER,Qe);const rt=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await yo(w,rt,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Pe),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,ne),w.deleteBuffer(Pe),w.deleteSync(rt),ne}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(p,L=null,y=0){p.isTexture!==!0&&(Ln("WebGLRenderer: copyFramebufferToTexture function signature has changed."),L=arguments[0]||null,p=arguments[1]);const I=Math.pow(2,-y),U=Math.floor(p.image.width*I),ne=Math.floor(p.image.height*I),he=L!==null?L.x:0,ge=L!==null?L.y:0;S.setTexture2D(p,0),w.copyTexSubImage2D(w.TEXTURE_2D,y,0,0,he,ge,U,ne),Re.unbindTexture()};const Kn=w.createFramebuffer(),Ct=w.createFramebuffer();this.copyTextureToTexture=function(p,L,y=null,I=null,U=0,ne=null){p.isTexture!==!0&&(Ln("WebGLRenderer: copyTextureToTexture function signature has changed."),I=arguments[0]||null,p=arguments[1],L=arguments[2],ne=arguments[3]||0,y=null),ne===null&&(U!==0?(Ln("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ne=U,U=0):ne=0);let he,ge,Ee,Ie,He,Pe,Qe,rt,St;const _t=p.isCompressedTexture?p.mipmaps[ne]:p.image;if(y!==null)he=y.max.x-y.min.x,ge=y.max.y-y.min.y,Ee=y.isBox3?y.max.z-y.min.z:1,Ie=y.min.x,He=y.min.y,Pe=y.isBox3?y.min.z:0;else{const Gt=Math.pow(2,-U);he=Math.floor(_t.width*Gt),ge=Math.floor(_t.height*Gt),p.isDataArrayTexture?Ee=_t.depth:p.isData3DTexture?Ee=Math.floor(_t.depth*Gt):Ee=1,Ie=0,He=0,Pe=0}I!==null?(Qe=I.x,rt=I.y,St=I.z):(Qe=0,rt=0,St=0);const tt=Oe.convert(L.format),De=Oe.convert(L.type);let At;L.isData3DTexture?(S.setTexture3D(L,0),At=w.TEXTURE_3D):L.isDataArrayTexture||L.isCompressedArrayTexture?(S.setTexture2DArray(L,0),At=w.TEXTURE_2D_ARRAY):(S.setTexture2D(L,0),At=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,L.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,L.unpackAlignment);const ot=w.getParameter(w.UNPACK_ROW_LENGTH),Wt=w.getParameter(w.UNPACK_IMAGE_HEIGHT),Cn=w.getParameter(w.UNPACK_SKIP_PIXELS),Ft=w.getParameter(w.UNPACK_SKIP_ROWS),Zn=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,_t.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,_t.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Ie),w.pixelStorei(w.UNPACK_SKIP_ROWS,He),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Pe);const pt=p.isDataArrayTexture||p.isData3DTexture,Ht=L.isDataArrayTexture||L.isData3DTexture;if(p.isDepthTexture){const Gt=Te.get(p),Pt=Te.get(L),Lt=Te.get(Gt.__renderTarget),Di=Te.get(Pt.__renderTarget);Re.bindFramebuffer(w.READ_FRAMEBUFFER,Lt.__webglFramebuffer),Re.bindFramebuffer(w.DRAW_FRAMEBUFFER,Di.__webglFramebuffer);for(let hn=0;hnMath.PI&&(i-=Ut),r<-Math.PI?r+=Ut:r>Math.PI&&(r-=Ut),i<=r?this._spherical.theta=Math.max(i,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+r)/2?Math.max(i,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 a=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),a=o!=this._spherical.radius}if(Mt.setFromSpherical(this._spherical),Mt.applyQuaternion(this._quatInverse),n.copy(this.target).add(Mt),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 o=null;if(this.object.isPerspectiveCamera){const s=Mt.length();o=this._clampDistance(s*this._scale);const u=s-o;this.object.position.addScaledVector(this._dollyDirection,u),this.object.updateMatrixWorld(),a=!!u}else if(this.object.isOrthographicCamera){const s=new Me(this._mouse.x,this._mouse.y,0);s.unproject(this.object);const u=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),a=u!==this.object.zoom;const d=new Me(this._mouse.x,this._mouse.y,0);d.unproject(this.object),this.object.position.sub(d).add(s),this.object.updateMatrixWorld(),o=Mt.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(mi.origin.copy(this.object.position),mi.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(mi.direction))Xi||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Xi||this._lastTargetPosition.distanceToSquared(this.target)>Xi?(this.dispatchEvent(Dr),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ut/60*this.autoRotateSpeed*t:Ut/60/60*this.autoRotateSpeed}_getZoomScale(t){const n=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,n){Mt.setFromMatrixColumn(n,0),Mt.multiplyScalar(-t),this._panOffset.add(Mt)}_panUp(t,n){this.screenSpacePanning===!0?Mt.setFromMatrixColumn(n,1):(Mt.setFromMatrixColumn(n,0),Mt.crossVectors(this.object.up,Mt)),Mt.multiplyScalar(t),this._panOffset.add(Mt)}_pan(t,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;Mt.copy(r).sub(this.target);let a=Mt.length();a*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*a/i.clientHeight,this.object.matrix),this._panUp(2*n*a/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=t-i.left,a=n-i.top,o=i.width,s=i.height;this._mouse.x=r/o*2-1,this._mouse.y=-(a/s)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Ut*this._rotateDelta.x/n.clientHeight),this._rotateUp(Ut*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.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(t){this._panEnd.set(t.clientX,t.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(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let n=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ut*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ut*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ut*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ut*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(t){const n=this._getSecondPointerPosition(t),i=t.pageX-n.x,r=t.pageY-n.y,a=Math.sqrt(i*i+r*r);this._dollyStart.set(0,a)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),r=.5*(t.pageX+i.x),a=.5*(t.pageY+i.y);this._rotateEnd.set(r,a)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Ut*this._rotateDelta.x/n.clientHeight),this._rotateUp(Ut*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panEnd.set(i,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(t){const n=this._getSecondPointerPosition(t),i=t.pageX-n.x,r=t.pageY-n.y,a=Math.sqrt(i*i+r*r);this._dollyEnd.set(0,a),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(t.pageX+n.x)*.5,s=(t.pageY+n.y)*.5;this._updateZoomParameters(o,s)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let n=0;n + varying vec2 vUv; + uniform sampler2D colorTexture; + uniform vec2 invSize; + uniform vec2 direction; + uniform float gaussianCoefficients[KERNEL_RADIUS]; + + void main() { + float weightSum = gaussianCoefficients[0]; + vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum; + for( int i = 1; i < KERNEL_RADIUS; i ++ ) { + float x = float(i); + float w = gaussianCoefficients[i]; + vec2 uvOffset = direction * invSize * x; + vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb; + vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb; + diffuseSum += (sample1 + sample2) * w; + weightSum += 2.0 * w; + } + gl_FragColor = vec4(diffuseSum/weightSum, 1.0); + }`})}getCompositeMaterial(t){return new Ot({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + }`,fragmentShader:`varying vec2 vUv; + uniform sampler2D blurTexture1; + uniform sampler2D blurTexture2; + uniform sampler2D blurTexture3; + uniform sampler2D blurTexture4; + uniform sampler2D blurTexture5; + uniform float bloomStrength; + uniform float bloomRadius; + uniform float bloomFactors[NUM_MIPS]; + uniform vec3 bloomTintColors[NUM_MIPS]; + + float lerpBloomFactor(const in float factor) { + float mirrorFactor = 1.2 - factor; + return mix(factor, mirrorFactor, bloomRadius); + } + + void main() { + gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + + lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + + lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + + lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + + lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); + }`})}}Wn.BlurDirectionX=new Ke(1,0);Wn.BlurDirectionY=new Ke(0,1);function gp(){const t=new Float32Array(6e3),n=new Float32Array(2e3*3);for(let a=0;a<2e3;a++){const o=Math.random()*Math.PI*2,s=Math.acos(2*Math.random()-1),u=600+Math.random()*400;t[a*3]=u*Math.sin(s)*Math.cos(o),t[a*3+1]=u*Math.sin(s)*Math.sin(o),t[a*3+2]=u*Math.cos(s);const d=Math.random();n[a*3]=.55+d*.25,n[a*3+1]=.55+d*.15,n[a*3+2]=.75+d*.25}const i=new kt;i.setAttribute("position",new Rt(t,3)),i.setAttribute("color",new Rt(n,3));const r=new Gn({size:1.6,sizeAttenuation:!0,vertexColors:!0,transparent:!0,opacity:.6,depthWrite:!1,blending:yt});return new kn(i,r)}function vp(e){const t=new Ks;t.background=new be(328975),t.fog=new io(657946,.0035);const n=new Bn(60,e.clientWidth/e.clientHeight,.1,2e3);n.position.set(0,30,80);const i=new Zu({antialias:!0,alpha:!0,powerPreference:"high-performance"});i.setSize(e.clientWidth,e.clientHeight),i.setPixelRatio(Math.min(window.devicePixelRatio,2)),i.toneMapping=to,i.toneMappingExposure=1.25,e.appendChild(i.domElement);const r=new $u(n,i.domElement);r.enableDamping=!0,r.dampingFactor=.05,r.rotateSpeed=.5,r.zoomSpeed=.8,r.minDistance=12,r.maxDistance=180,r.autoRotate=!0,r.autoRotateSpeed=.3;const a=new hp(i);a.addPass(new mp(t,n));const o=new Wn(new Ke(e.clientWidth,e.clientHeight),.55,.6,.2);a.addPass(o);const s=new Zs(2763354,.7);t.add(s);const u=new er(6514417,1.8,240);u.position.set(50,50,50),t.add(u);const d=new er(11032055,1.2,240);d.position.set(-50,-30,-50),t.add(d);const m=gp();t.add(m);const _=new js;_.params.Points={threshold:2};const v=new Ke;return{scene:t,camera:n,renderer:i,controls:r,composer:a,bloomPass:o,raycaster:_,mouse:v,lights:{ambient:s,point1:u,point2:d},starfield:m}}function Sp(e,t){const n=t.clientWidth,i=t.clientHeight;e.camera.aspect=n/i,e.camera.updateProjectionMatrix(),e.renderer.setSize(n,i),e.composer.setSize(n,i)}function Ep(e){e.scene.traverse(t=>{var n;(t instanceof Bt||t instanceof $s)&&((n=t.geometry)==null||n.dispose(),Array.isArray(t.material)?t.material.forEach(i=>i.dispose()):t.material&&t.material.dispose())}),e.renderer.dispose(),e.composer.dispose()}class xp{constructor(t){ke(this,"positions");ke(this,"velocities");ke(this,"running",!0);ke(this,"step",0);ke(this,"repulsionStrength",500);ke(this,"attractionStrength",.01);ke(this,"dampening",.9);ke(this,"baseMaxSteps",300);ke(this,"maxSteps",300);ke(this,"cooldownExtension",0);this.positions=t,this.velocities=new Map;for(const n of t.keys())this.velocities.set(n,new Me)}addNode(t,n){this.positions.set(t,n.clone()),this.velocities.set(t,new Me),this.cooldownExtension=100,this.maxSteps=Math.max(this.maxSteps,this.step+this.cooldownExtension),this.running=!0}removeNode(t){this.positions.delete(t),this.velocities.delete(t)}tick(t){if(!this.running)return;if(this.step>this.maxSteps){this.cooldownExtension>0&&(this.cooldownExtension=0,this.maxSteps=this.baseMaxSteps);return}this.step++;const n=Math.max(.001,1-this.step/this.maxSteps),i=Array.from(this.positions.keys());for(let r=0;r{const r=i;(r.userData.source===t||r.userData.target===t)&&n.push(r)});for(const i of n)this.growingEdges=this.growingEdges.filter(r=>r.line!==i),this.dissolvingEdges.push({line:i,frame:0,totalFrames:40})}animateEdges(t){for(let n=this.growingEdges.length-1;n>=0;n--){const i=this.growingEdges[n];i.frame++;const r=Mp(Math.min(i.frame/i.totalFrames,1)),a=t.get(i.source),o=t.get(i.target);if(!a||!o)continue;const s=a.clone().lerp(o,r),u=i.line.geometry.attributes.position;u.setXYZ(0,a.x,a.y,a.z),u.setXYZ(1,s.x,s.y,s.z),u.needsUpdate=!0;const d=i.line.material;d.opacity=r*.65,i.frame>=i.totalFrames&&(d.opacity=.65,this.growingEdges.splice(n,1))}for(let n=this.dissolvingEdges.length-1;n>=0;n--){const i=this.dissolvingEdges[n];i.frame++;const r=i.frame/i.totalFrames,a=i.line.material;a.opacity=Math.max(0,.65*(1-r)),i.frame>=i.totalFrames&&(this.group.remove(i.line),i.line.geometry.dispose(),i.line.material.dispose(),this.dissolvingEdges.splice(n,1))}}updatePositions(t){this.group.children.forEach(n=>{const i=n;if(this.growingEdges.some(o=>o.line===i)||this.dissolvingEdges.some(o=>o.line===i))return;const r=t.get(i.userData.source),a=t.get(i.userData.target);if(r&&a){const o=i.geometry.attributes.position;o.setXYZ(0,r.x,r.y,r.z),o.setXYZ(1,a.x,a.y,a.z),o.needsUpdate=!0}})}dispose(){this.group.children.forEach(t=>{var i,r;const n=t;(i=n.geometry)==null||i.dispose(),(r=n.material)==null||r.dispose()}),this.growingEdges=[],this.dissolvingEdges=[]}}class bp{constructor(t){ke(this,"starField");ke(this,"neuralParticles");this.starField=this.createStarField(),this.neuralParticles=this.createNeuralParticles(),t.add(this.starField),t.add(this.neuralParticles)}createStarField(){const n=new kt,i=new Float32Array(3e3*3),r=new Float32Array(3e3);for(let o=0;o<3e3;o++)i[o*3]=(Math.random()-.5)*1e3,i[o*3+1]=(Math.random()-.5)*1e3,i[o*3+2]=(Math.random()-.5)*1e3,r[o]=Math.random()*1.5;n.setAttribute("position",new Rt(i,3)),n.setAttribute("size",new Rt(r,1));const a=new Gn({color:6514417,size:.5,transparent:!0,opacity:.4,sizeAttenuation:!0,blending:yt});return new kn(n,a)}createNeuralParticles(){const n=new kt,i=new Float32Array(500*3),r=new Float32Array(500*3);for(let o=0;o<500;o++)i[o*3]=(Math.random()-.5)*100,i[o*3+1]=(Math.random()-.5)*100,i[o*3+2]=(Math.random()-.5)*100,r[o*3]=.4+Math.random()*.3,r[o*3+1]=.3+Math.random()*.2,r[o*3+2]=.8+Math.random()*.2;n.setAttribute("position",new Rt(i,3)),n.setAttribute("color",new Rt(r,3));const a=new Gn({size:.3,vertexColors:!0,transparent:!0,opacity:.4,blending:yt,sizeAttenuation:!0});return new kn(n,a)}animate(t){this.starField.rotation.y+=1e-4,this.starField.rotation.x+=5e-5;const n=this.neuralParticles.geometry.attributes.position;for(let i=0;i=0;r--){const a=this.pulseEffects[r];if(a.intensity-=a.decay,a.intensity<=0){this.pulseEffects.splice(r,1);continue}const o=t.get(a.nodeId);if(o){const s=o.material;s.emissive.lerp(a.color,a.intensity*.3),s.emissiveIntensity=Math.max(s.emissiveIntensity,a.intensity)}}for(let r=this.spawnBursts.length-1;r>=0;r--){const a=this.spawnBursts[r];if(a.age++,a.age>120){this.scene.remove(a.particles),a.particles.geometry.dispose(),a.particles.material.dispose(),this.spawnBursts.splice(r,1);continue}const o=a.particles.geometry.attributes.position,s=a.particles.geometry.attributes.velocity;for(let d=0;d=0;r--){const a=this.rainbowBursts[r];if(a.age++,a.age>a.maxAge){this.scene.remove(a.particles),a.particles.geometry.dispose(),a.particles.material.dispose(),this.rainbowBursts.splice(r,1);continue}const o=a.particles.geometry.attributes.position,s=a.particles.geometry.attributes.velocity;for(let v=0;v=0;r--){const a=this.rippleWaves[r];if(a.age++,a.radius+=a.speed,a.age>a.maxAge){this.rippleWaves.splice(r,1);continue}const o=a.radius,s=3;i.forEach((u,d)=>{if(a.pulsedNodes.has(d))return;const m=u.distanceTo(a.origin);m>=o-s&&m<=o+s&&(a.pulsedNodes.add(d),this.addPulse(d,.8,new be(65489),.03))})}for(let r=this.implosions.length-1;r>=0;r--){const a=this.implosions[r];if(a.age++,a.age>a.maxAge+20){this.scene.remove(a.particles),a.particles.geometry.dispose(),a.particles.material.dispose(),a.flash&&(this.scene.remove(a.flash),a.flash.geometry.dispose(),a.flash.material.dispose()),this.implosions.splice(r,1);continue}if(a.age<=a.maxAge){const o=a.particles.geometry.attributes.position,s=a.particles.geometry.attributes.velocity,u=1+a.age*.02;for(let m=0;ma.maxAge){const o=(a.age-a.maxAge)/20;a.flash.material.opacity=Math.max(0,1-o),a.flash.scale.setScalar(1+o*3)}}for(let r=this.shockwaves.length-1;r>=0;r--){const a=this.shockwaves[r];if(a.age++,a.age>a.maxAge){this.scene.remove(a.mesh),a.mesh.geometry.dispose(),a.mesh.material.dispose(),this.shockwaves.splice(r,1);continue}const o=a.age/a.maxAge;a.mesh.scale.setScalar(1+o*20),a.mesh.material.opacity=.8*(1-o),a.mesh.lookAt(n.position)}for(let r=this.connectionFlashes.length-1;r>=0;r--){const a=this.connectionFlashes[r];if(a.intensity-=.015,a.intensity<=0){this.scene.remove(a.line),a.line.geometry.dispose(),a.line.material.dispose(),this.connectionFlashes.splice(r,1);continue}a.line.material.opacity=a.intensity}for(let r=this.birthOrbs.length-1;r>=0;r--){const a=this.birthOrbs[r];a.age++;const o=a.gestationFrames+a.flightFrames,s=a.sprite.material,u=a.core.material,d=a.getTargetPos();if(d)a.lastTargetPos.copy(d);else if(a.age>a.gestationFrames&&!a.aborted){a.aborted=!0;const m=a.sprite.position;s.color.setRGB(1,.15,.2),u.color.setRGB(1,.6,.6),this.createImplosion(m,new be(16721203)),a.arriveFired=!0,a.age=o+1}if(a.age<=a.gestationFrames){const m=a.age/a.gestationFrames,_=1-Math.pow(1-m,3),v=.85+Math.sin(a.age*.35)*.15,h=.5+_*4.5*v,A=.2+_*1.8*v;a.sprite.scale.set(h,h,1),a.core.scale.set(A,A,1),s.opacity=_*.95,u.opacity=_,s.color.copy(a.color).multiplyScalar(.7+_*.3),a.sprite.position.copy(a.startPos),a.core.position.copy(a.startPos)}else if(a.age<=o){const m=(a.age-a.gestationFrames)/a.flightFrames,_=m<.5?2*m*m:1-Math.pow(-2*m+2,2)/2,v=a.startPos,h=a.lastTargetPos,A=h.x-v.x,R=h.y-v.y,c=h.z-v.z,l=Math.sqrt(A*A+R*R+c*c),O=(v.x+h.x)*.5,T=(v.y+h.y)*.5+30+l*.15,M=(v.z+h.z)*.5,C=1-_,D=C*C,F=2*C*_,H=_*_,x=D*v.x+F*O+H*h.x,g=D*v.y+F*T+H*h.y,P=D*v.z+F*M+H*h.z;a.sprite.position.set(x,g,P),a.core.position.set(x,g,P);const $=1-_*.35;a.sprite.scale.setScalar(5*$),a.core.scale.setScalar(2*$),s.opacity=.95,u.opacity=1,s.color.copy(a.color)}else if(a.arriveFired){const m=a.age-o,_=Math.max(0,1-m/8);s.opacity=.95*_,u.opacity=1*_,a.sprite.scale.setScalar(5*(1+(1-_)*2)),_<=0&&(this.scene.remove(a.sprite),this.scene.remove(a.core),s.dispose(),u.dispose(),this.birthOrbs.splice(r,1))}else{a.arriveFired=!0;try{a.onArrive()}catch(m){console.warn("[birth-orb] onArrive threw",m)}}}}dispose(){for(const t of this.spawnBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.rainbowBursts)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose();for(const t of this.implosions)this.scene.remove(t.particles),t.particles.geometry.dispose(),t.particles.material.dispose(),t.flash&&(this.scene.remove(t.flash),t.flash.geometry.dispose(),t.flash.material.dispose());for(const t of this.shockwaves)this.scene.remove(t.mesh),t.mesh.geometry.dispose(),t.mesh.material.dispose();for(const t of this.connectionFlashes)this.scene.remove(t.line),t.line.geometry.dispose(),t.line.material.dispose();for(const t of this.birthOrbs)this.scene.remove(t.sprite),this.scene.remove(t.core),t.sprite.material.dispose(),t.core.material.dispose();this.pulseEffects=[],this.spawnBursts=[],this.rainbowBursts=[],this.rippleWaves=[],this.implosions=[],this.shockwaves=[],this.connectionFlashes=[],this.birthOrbs=[]}}const Qt={bloomStrength:.8,rotateSpeed:.3,fogColor:328976,fogDensity:.008,nebulaIntensity:0,chromaticIntensity:.002,vignetteRadius:.9,breatheAmplitude:1},sn={bloomStrength:1.8,rotateSpeed:.08,fogColor:656672,fogDensity:.006,nebulaIntensity:1,chromaticIntensity:.005,vignetteRadius:.7,breatheAmplitude:2};class Rp{constructor(){ke(this,"active",!1);ke(this,"transition",0);ke(this,"transitionSpeed",.008);ke(this,"current");ke(this,"auroraHue",0);this.current={...Qt}}setActive(t){this.active=t}update(t,n,i,r,a){const o=this.active?1:0;this.transition+=(o-this.transition)*this.transitionSpeed*60*(1/60),this.transition=Math.max(0,Math.min(1,this.transition));const s=this.transition;this.current.bloomStrength=this.lerp(Qt.bloomStrength,sn.bloomStrength,s),this.current.rotateSpeed=this.lerp(Qt.rotateSpeed,sn.rotateSpeed,s),this.current.fogDensity=this.lerp(Qt.fogDensity,sn.fogDensity,s),this.current.nebulaIntensity=this.lerp(Qt.nebulaIntensity,sn.nebulaIntensity,s),this.current.chromaticIntensity=this.lerp(Qt.chromaticIntensity,sn.chromaticIntensity,s),this.current.vignetteRadius=this.lerp(Qt.vignetteRadius,sn.vignetteRadius,s),this.current.breatheAmplitude=this.lerp(Qt.breatheAmplitude,sn.breatheAmplitude,s),n.strength=this.current.bloomStrength,i.autoRotateSpeed=this.current.rotateSpeed;const u=new be(Qt.fogColor),d=new be(sn.fogColor),m=u.clone().lerp(d,s);if(t.fog=new io(m,this.current.fogDensity),s>.01){this.auroraHue=a*.1%1;const _=new be().setHSL(.75+this.auroraHue*.15,.8,.5),v=new be().setHSL(.55+this.auroraHue*.2,.7,.4);r.point1.color.lerp(_,s*.3),r.point2.color.lerp(v,s*.3)}else r.point1.color.set(6514417),r.point2.color.set(11032055)}lerp(t,n,i){return t+(n-t)*i}}const wp=50,ii=[];function yp(e,t,n){const i=e.tags??[],r=e.type??"";let a=null,o=0;for(const s of t){let u=0;s.type===r&&(u+=2);for(const d of s.tags)i.includes(d)&&(u+=1);u>o&&(o=u,a=s.id)}if(a&&o>0){const s=n.get(a);if(s)return new Me(s.x+(Math.random()-.5)*10,s.y+(Math.random()-.5)*10,s.z+(Math.random()-.5)*10)}return new Me((Math.random()-.5)*40,(Math.random()-.5)*40,(Math.random()-.5)*40)}function Cp(e,t){if(ii.length<=wp)return;const n=ii.shift();e.edgeManager.removeEdgesForNode(n),e.nodeManager.removeNode(n),e.forceSim.removeNode(n),e.onMutation({type:"edgesRemoved",nodeId:n}),e.onMutation({type:"nodeRemoved",nodeId:n});const i=t.findIndex(r=>r.id===n);i!==-1&&t.splice(i,1)}function Pp(e,t,n){var _,v;const{effects:i,nodeManager:r,edgeManager:a,forceSim:o,camera:s,onMutation:u}=t,d=r.positions,m=r.meshMap;switch(e.type){case"MemoryCreated":{const h=e.data;if(!h.id)break;const A={id:h.id,label:(h.content??"").slice(0,60),type:h.node_type??"fact",retention:Math.max(0,Math.min(1,h.retention??.9)),tags:h.tags??[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isCenter:!1},R=yp(A,n,d),c=r.addNode(A,R,{isBirthRitual:!0});o.addNode(h.id,c),ii.push(h.id),Cp(t,n);const l=new be(sl[A.type]||"#00ffd1"),O=l.clone();O.offsetHSL(.15,0,0),i.createBirthOrb(s,l,()=>r.positions.get(A.id),()=>{r.igniteNode(A.id);const T=r.positions.get(A.id)??R,M=r.meshMap.get(A.id);M&&M.scale.multiplyScalar(1.8),i.createRainbowBurst(T,l),i.createShockwave(T,l,s),i.createShockwave(T,O,s),i.createRippleWave(T)}),u({type:"nodeAdded",node:A});break}case"ConnectionDiscovered":{const h=e.data;if(!h.source_id||!h.target_id)break;const A=d.get(h.source_id),R=d.get(h.target_id),c={source:h.source_id,target:h.target_id,weight:h.weight??.5,type:h.connection_type??"semantic"};a.addEdge(c,d),A&&R&&i.createConnectionFlash(A,R,new be(54527)),h.source_id&&m.has(h.source_id)&&i.addPulse(h.source_id,1,new be(54527),.02),h.target_id&&m.has(h.target_id)&&i.addPulse(h.target_id,1,new be(54527),.02),u({type:"edgeAdded",edge:c});break}case"MemoryDeleted":{const h=e.data;if(!h.id)break;const A=d.get(h.id);if(A){const c=new be(16729943);i.createImplosion(A,c)}a.removeEdgesForNode(h.id),r.removeNode(h.id),o.removeNode(h.id);const R=ii.indexOf(h.id);R!==-1&&ii.splice(R,1),u({type:"edgesRemoved",nodeId:h.id}),u({type:"nodeRemoved",nodeId:h.id});break}case"MemoryPromoted":{const h=e.data,A=h==null?void 0:h.id;if(!A)break;const R=h.new_retention??.95;if(m.has(A)){r.growNode(A,R),i.addPulse(A,1.2,new be(65416),.01);const c=d.get(A);c&&(i.createShockwave(c,new be(65416),s),i.createSpawnBurst(c,new be(65416))),u({type:"nodeUpdated",nodeId:A,retention:R})}break}case"MemoryDemoted":{const h=e.data,A=h==null?void 0:h.id;if(!A)break;const R=h.new_retention??.3;m.has(A)&&(r.growNode(A,R),i.addPulse(A,.8,new be(16729943),.03),u({type:"nodeUpdated",nodeId:A,retention:R}));break}case"MemoryUpdated":{const h=e.data,A=h==null?void 0:h.id;if(!A||!m.has(A))break;i.addPulse(A,.6,new be(8490232),.02),h.retention!==void 0&&(r.growNode(A,h.retention),u({type:"nodeUpdated",nodeId:A,retention:h.retention}));break}case"SearchPerformed":{m.forEach((h,A)=>{i.addPulse(A,.6+Math.random()*.4,new be(8490232),.02)});break}case"DreamStarted":{m.forEach((h,A)=>{i.addPulse(A,1,new be(11032055),.005)});break}case"DreamProgress":{const h=(_=e.data)==null?void 0:_.memory_id;h&&m.has(h)&&i.addPulse(h,1.5,new be(12616956),.01);break}case"DreamCompleted":{i.createSpawnBurst(new Me(0,0,0),new be(11032055)),i.createShockwave(new Me(0,0,0),new be(11032055),s);break}case"RetentionDecayed":{const h=(v=e.data)==null?void 0:v.id;h&&m.has(h)&&i.addPulse(h,.8,new be(16729943),.03);break}case"ConsolidationCompleted":{m.forEach((h,A)=>{i.addPulse(A,.4+Math.random()*.3,new be(16758784),.015)});break}case"ActivationSpread":{const h=e.data;if(h.source_id&&h.target_ids){const A=d.get(h.source_id);if(A)for(const R of h.target_ids){const c=d.get(R);c&&i.createConnectionFlash(A,c,new be(1370310))}}break}case"MemorySuppressed":{const h=e.data;if(!h.id)break;const A=d.get(h.id);if(A){i.createImplosion(A,new be(11032055));const R=Math.max(1,h.suppression_count??1),c=Math.min(.4+R*.15,1);i.addPulse(h.id,c,new be(11032055),.04)}break}case"MemoryUnsuppressed":{const h=e.data;if(!h.id)break;const A=d.get(h.id);A&&m.has(h.id)&&(i.createRainbowBurst(A,new be(65416)),i.addPulse(h.id,1,new be(65416),.02));break}case"Rac1CascadeSwept":{const A=e.data.neighbors_affected??0;if(A===0)break;const R=Array.from(m.keys()),c=Math.min(A,R.length,12);for(let l=0;l"u")return Mi;const e=localStorage.getItem(po);if(e===null)return Mi;const t=Number(e);return Number.isFinite(t)?Math.min(da,Math.max(ca,t)):Mi}const xn=kp();function kp(){let e=Ne(!1),t=Ne(qi(new Date)),n=Ne(!1),i=Ne(1),r=Ne(!1),a=Ne(qi(Gp()));return{get temporalEnabled(){return b(e)},set temporalEnabled(o){ee(e,o,!0)},get temporalDate(){return b(t)},set temporalDate(o){ee(t,o,!0)},get temporalPlaying(){return b(n)},set temporalPlaying(o){ee(n,o,!0)},get temporalSpeed(){return b(i)},set temporalSpeed(o){ee(i,o,!0)},get dreamMode(){return b(r)},set dreamMode(o){ee(r,o,!0)},get brightness(){return b(a)},set brightness(o){const s=Math.min(da,Math.max(ca,o));if(ee(a,s,!0),typeof localStorage<"u")try{localStorage.setItem(po,String(s))}catch{}},brightnessMin:ca,brightnessMax:da,brightnessDefault:Mi}}var Vp=Ze('
        ');function zp(e,t){var $;Xn(t,!0);let n=ti(t,"events",19,()=>[]),i=ti(t,"isDreaming",3,!1),r=ti(t,"colorMode",3,"type");gi(()=>{_==null||_.setColorMode(r())});let a,o,s,u=typeof window<"u"&&(($=window.matchMedia)==null?void 0:$.call(window,"(prefers-reduced-motion: reduce)").matches),d=null;function m(V){u=V.matches,o!=null&&o.controls&&(o.controls.autoRotate=!u)}let _,v,h,A,R,c,l,O,T=null,M=[];Nr(()=>{var Z;o=vp(a),u&&(o.controls.autoRotate=!1),typeof window<"u"&&window.matchMedia&&(d=window.matchMedia("(prefers-reduced-motion: reduce)"),(Z=d.addEventListener)==null||Z.call(d,"change",m)),l=Up(o.scene).material,O=Bp(o.composer),h=new bp(o.scene),_=new el,_.colorMode=r(),v=new Tp,A=new Ap(o.scene),c=new Rp;const q=_.createNodes(t.nodes);v.createEdges(t.edges,q),R=new xp(q),M=[...t.nodes],o.scene.add(v.group),o.scene.add(_.group),D(),window.addEventListener("resize",H),a.addEventListener("pointermove",x),a.addEventListener("click",g)}),ua(()=>{var V;cancelAnimationFrame(s),window.removeEventListener("resize",H),(V=d==null?void 0:d.removeEventListener)==null||V.call(d,"change",m),a==null||a.removeEventListener("pointermove",x),a==null||a.removeEventListener("click",g),A==null||A.dispose(),h==null||h.dispose(),_==null||_.dispose(),v==null||v.dispose(),o&&Ep(o)});let C=0;function D(){s=requestAnimationFrame(D);const V=performance.now();C===0&&(C=V);const q=V-C;if(q<16)return;C=V-q%16;const Z=V*.001;R.tick(t.edges),_.updatePositions(),v.updatePositions(_.positions),v.animateEdges(_.positions),h.animate(Z),_.animate(Z,M,o.camera,xn.brightness),c.setActive(i()),c.update(o.scene,o.bloomPass,o.controls,o.lights,Z),Ip(l,Z,c.current.nebulaIntensity,a.clientWidth,a.clientHeight),Hp(O,Z,c.current.nebulaIntensity),F(),A.update(_.meshMap,o.camera,_.positions),o.controls.update(),o.composer.render()}function F(){if(!n()||n().length===0)return;const V=[];for(const Z of n()){if(Z===T)break;V.push(Z)}if(V.length===0)return;if(V.length===n().length&&n().length>=200){console.warn("[vestige] Event horizon overflow: dropping visuals for",V.length,"events"),T=n()[0];return}T=n()[0];const q={effects:A,nodeManager:_,edgeManager:v,forceSim:R,camera:o.camera,onMutation:Z=>{var j;Z.type==="nodeAdded"?M=[...M,Z.node]:Z.type==="nodeRemoved"&&(M=M.filter(ie=>ie.id!==Z.nodeId)),(j=t.onGraphMutation)==null||j.call(t,Z)}};for(let Z=V.length-1;Z>=0;Z--)Pp(V[Z],q,M)}function H(){!a||!o||Sp(o,a)}function x(V){const q=a.getBoundingClientRect();o.mouse.x=(V.clientX-q.left)/q.width*2-1,o.mouse.y=-((V.clientY-q.top)/q.height)*2+1,o.raycaster.setFromCamera(o.mouse,o.camera);const Z=o.raycaster.intersectObjects(_.getMeshes());Z.length>0?(_.hoveredNode=Z[0].object.userData.nodeId,a.style.cursor="pointer"):(_.hoveredNode=null,a.style.cursor="grab")}function g(){var V;if(_.hoveredNode){_.selectedNode=_.hoveredNode,(V=t.onSelect)==null||V.call(t,_.hoveredNode);const q=_.positions.get(_.hoveredNode);q&&o.controls.target.lerp(q.clone(),.5)}}var P=Vp();Zi(P,V=>a=V,()=>a),Ye(e,P),Yn()}var Wp=Ze('
        '),Xp=Ze('
        ');function Yp(e,t){Xn(t,!0);let n=ti(t,"width",3,240),i=ti(t,"height",3,80);function r(c){return t.stability<=0?0:Math.exp(-c/t.stability)}let a=en(()=>{const c=[],l=Math.max(t.stability*3,30),O=4,T=n()-O*2,M=i()-O*2;for(let C=0;C<=50;C++){const D=C/50*l,F=r(D),H=O+C/50*T,x=O+(1-F)*M;c.push(`${C===0?"M":"L"}${H.toFixed(1)},${x.toFixed(1)}`)}return c.join(" ")}),o=en(()=>[{label:"Now",days:0,value:t.retention},{label:"1d",days:1,value:r(1)},{label:"7d",days:7,value:r(7)},{label:"30d",days:30,value:r(30)}]);function s(c){return c>.7?"#10b981":c>.4?"#f59e0b":"#ef4444"}var u=Xp(),d=oe(u),m=oe(d),_=fe(m),v=fe(_),h=fe(v),A=fe(h);Fn(),re(d);var R=fe(d,2);ei(R,21,()=>b(o),vi,(c,l)=>{var O=Wp(),T=oe(O),M=oe(T);re(T);var C=fe(T,2),D=oe(C);re(C),re(O),gt((F,H)=>{Je(M,`${b(l).label??""}:`),ri(C,`color: ${F??""}`),Je(D,`${H??""}%`)},[()=>s(b(l).value),()=>(b(l).value*100).toFixed(0)]),Ye(c,O)}),re(R),re(u),gt(c=>{mt(d,"width",n()),mt(d,"height",i()),mt(d,"viewBox",`0 0 ${n()??""} ${i()??""}`),mt(m,"y1",4+(i()-8)*.5),mt(m,"x2",n()-4),mt(m,"y2",4+(i()-8)*.5),mt(_,"y1",4+(i()-8)*.8),mt(_,"x2",n()-4),mt(_,"y2",4+(i()-8)*.8),mt(v,"d",b(a)),mt(h,"d",`${b(a)??""} L${n()-4},${i()-4} L4,${i()-4} Z`),mt(A,"cy",4+(1-t.retention)*(i()-8)),mt(A,"fill",c)},[()=>s(t.retention)]),Ye(e,u),Yn()}function Ir(e,t,n){const i=n.getTime(),r=new Set,a=new Map,o=e.filter(u=>{const d=new Date(u.createdAt).getTime();if(d<=i){r.add(u.id);const m=i-d,_=1440*60*1e3,v=m<_?.3+.7*(m/_):1;return a.set(u.id,v),!0}return!1}),s=t.filter(u=>r.has(u.source)&&r.has(u.target));return{visibleNodes:o,visibleEdges:s,nodeOpacities:a}}function qp(e){if(e.length===0){const i=new Date;return{oldest:i,newest:i}}let t=1/0,n=-1/0;for(const i of e){const r=new Date(i.createdAt).getTime();rn&&(n=r)}return{oldest:new Date(t),newest:new Date(n)}}var Kp=Ze(`
        `),Zp=Ze('');function jp(e,t){Xn(t,!0);let n=Ne(!1),i=Ne(!1),r=Ne(1),a=Ne(100),o,s=0,u=en(()=>qp(t.nodes)),d=en(()=>{const T=b(u).oldest.getTime(),C=b(u).newest.getTime()-T||1;return new Date(T+b(a)/100*C)});function m(T){return T.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function _(){ee(n,!b(n)),t.onToggle(b(n)),b(n)&&(ee(a,100),t.onDateChange(b(d)))}function v(){ee(i,!b(i)),b(i)?(ee(a,0),s=performance.now(),h()):cancelAnimationFrame(o)}function h(){b(i)&&(o=requestAnimationFrame(T=>{const M=(T-s)/1e3;s=T;const C=b(u).oldest.getTime(),F=(b(u).newest.getTime()-C)/(1440*60*1e3)||1,H=b(r)/F*100;if(ee(a,Math.min(100,b(a)+H*M),!0),t.onDateChange(b(d)),b(a)>=100){ee(i,!1);return}h()}))}function A(){t.onDateChange(b(d))}ua(()=>{ee(i,!1),cancelAnimationFrame(o)});var R=Or(),c=Tn(R);{var l=T=>{var M=Kp(),C=oe(M),D=oe(C),F=oe(D),H=oe(F),x=oe(H,!0);re(H);var g=fe(H,2),P=oe(g);P.value=P.__value=1;var $=fe(P);$.value=$.__value=7;var V=fe($);V.value=V.__value=30,re(g),re(F);var q=fe(F,2),Z=oe(q,!0);re(q);var j=fe(q,2);re(D);var ie=fe(D,2);ai(ie);var K=fe(ie,2),Se=oe(K),we=oe(Se,!0);re(Se);var Ue=fe(Se,2),je=oe(Ue,!0);re(Ue),re(K),re(C),re(M),gt((et,Q,de)=>{Je(x,b(i)?"⏸":"▶"),Je(Z,et),Je(we,Q),Je(je,de)},[()=>m(b(d)),()=>m(b(u).oldest),()=>m(b(u).newest)]),ht("click",H,v),ll(g,()=>b(r),et=>ee(r,et)),ht("click",j,_),ht("input",ie,A),Ki(ie,()=>b(a),et=>ee(a,et)),Ye(T,M)},O=T=>{var M=Zp();ht("click",M,_),Ye(T,M)};ut(c,T=>{b(n)?T(l):T(O,!1)})}Ye(e,R),Yn()}pa(["click","input"]);var $p=Ze('
        '),Qp=Ze('
        FSRS accessibility
        ');function Jp(e,t){Xn(t,!1);const n=["active","dormant","silent","unavailable"];cl();var i=Qp(),r=fe(oe(i),2);ei(r,1,()=>n,a=>a,(a,o)=>{var s=$p(),u=oe(s),d=fe(u,2),m=oe(d,!0);re(d);var _=fe(d,2),v=oe(_,!0);re(_),re(s),gt(h=>{ri(u,`background: ${ar[b(o)]??""}; box-shadow: 0 0 6px ${ar[b(o)]??""}55;`),Je(m,b(o)),Je(v,h)},[()=>{var h;return((h=tl[b(o)].match(/\(([^)]+)\)/))==null?void 0:h[1])??""}]),Ye(a,s)}),re(i),Ye(e,i),Yn()}const wt=new Me,eh=new Me(0,1,0),th=new Me(0,0,0);class nh{constructor(t,n,i,r,a={},o={}){ke(this,"camera");ke(this,"target");ke(this,"positions");ke(this,"path");ke(this,"cb");ke(this,"opts");ke(this,"phase","idle");ke(this,"beatIndex",0);ke(this,"phaseElapsed",0);ke(this,"fromPos",new Me);ke(this,"toPos",new Me);ke(this,"fromTarget",new Me);ke(this,"toTarget",new Me);this.camera=t,this.target=n,this.positions=i,this.path=r,this.cb=a,this.opts={flightSeconds:o.flightSeconds??2.4,dwellSeconds:o.dwellSeconds??3.2,standoff:o.standoff??26,reducedMotion:o.reducedMotion??!1,shots:o.shots??[],centerOnOrigin:o.centerOnOrigin??!1}}shotAt(t){return this.opts.shots[t]??null}flightSecondsAt(t){var n;return((n=this.shotAt(t))==null?void 0:n.flightSeconds)??this.opts.flightSeconds}dwellSecondsAt(t){var n;return((n=this.shotAt(t))==null?void 0:n.dwellSeconds)??this.opts.dwellSeconds}get totalBeats(){return this.path.beats.length}get isRunning(){return this.phase!=="idle"&&this.phase!=="done"}start(){var t,n;if(this.path.beats.length===0){this.phase="done",(n=(t=this.cb).onComplete)==null||n.call(t);return}this.beatIndex=0,this.beginFlightTo(0)}stop(){this.phase="done"}focalPoint(t){return this.opts.centerOnOrigin?th:this.positions.get(t.nodeId)??null}framePosition(t,n,i){const r=this.focalPoint(t);if(!r)return i.copy(this.camera.position);const a=this.shotAt(n);wt.copy(this.camera.position).sub(r),wt.lengthSq()<1e-4&&wt.set(0,.4,1),wt.normalize();let o=.35;a&&(a.angle==="low"?o=-.45:a.angle==="high"&&(o=.7)),wt.addScaledVector(eh,o).normalize();let s=(a==null?void 0:a.standoff)??this.opts.standoff;return a&&(a.move==="push_in"?s*=.7:a.move==="pull_back"?s*=1.5:a.move==="crane"&&(s*=1.8)),this.opts.centerOnOrigin&&(s=Math.max(31,Math.min(43,s))),i.copy(r).addScaledVector(wt,s)}beginFlightTo(t){var o,s;const n=this.path.beats[t],i=this.focalPoint(n),r=this.shotAt(t);this.fromPos.copy(this.camera.position),this.fromTarget.copy(this.target),this.framePosition(n,t,this.toPos),this.toTarget.copy(i??this.target),this.phaseElapsed=0,this.opts.reducedMotion||(r==null?void 0:r.cut)==="hard_cut"||(r==null?void 0:r.cut)==="match_cut"?(this.camera.position.copy(this.toPos),this.target.copy(this.toTarget),this.phase="dwelling",(s=(o=this.cb).onBeat)==null||s.call(o,n,t,r)):this.phase="flying"}update(t){var s,u,d,m,_,v,h,A,R;if(this.phase==="idle"||this.phase==="done")return;const n=Math.max(0,Math.min(t,.05));this.phaseElapsed+=n;const i=this.flightSecondsAt(this.beatIndex),r=this.dwellSecondsAt(this.beatIndex);if(this.phase==="flying"){const c=Math.min(1,this.phaseElapsed/i),l=ih(c);this.camera.position.lerpVectors(this.fromPos,this.toPos,l),this.target.lerpVectors(this.fromTarget,this.toTarget,l),this.applyDutch(this.beatIndex,l),c>=1&&(this.phase="dwelling",this.phaseElapsed=0,(u=(s=this.cb).onBeat)==null||u.call(s,this.path.beats[this.beatIndex],this.beatIndex,this.shotAt(this.beatIndex)))}else if(this.phase==="dwelling"){if(!this.opts.reducedMotion){const c=this.focalPoint(this.path.beats[this.beatIndex]);c&&(this.target.lerp(c,.02),((d=this.shotAt(this.beatIndex))==null?void 0:d.move)==="orbit"&&this.orbitAround(c,n*.35))}if(this.phaseElapsed>=r){const c=this.beatIndex+1;if(c>=this.path.beats.length){this.phase="done",(_=(m=this.cb).onProgress)==null||_.call(m,1),(h=(v=this.cb).onComplete)==null||h.call(v);return}this.beatIndex=c,this.beginFlightTo(c)}}const a=this.path.beats.length>0?1/this.path.beats.length:0,o=this.phase==="flying"?Math.min(1,this.phaseElapsed/i)*.5:.5+Math.min(1,this.phaseElapsed/r)*.5;(R=(A=this.cb).onProgress)==null||R.call(A,Math.min(1,this.beatIndex*a+o*a))}orbitAround(t,n){wt.copy(this.camera.position).sub(t);const i=Math.cos(n),r=Math.sin(n),a=wt.x*i-wt.z*r,o=wt.x*r+wt.z*i;wt.x=a,wt.z=o,this.camera.position.copy(t).add(wt)}applyDutch(t,n){var a;const r=(((a=this.shotAt(t))==null?void 0:a.dutch)??0)*n;wt.set(0,0,-1).applyQuaternion(this.camera.quaternion),this.camera.up.set(0,1,0).applyAxisAngle(wt,r)}}function ih(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}const fa={origin:"Origin",connection:"Connection",contradiction:"Tension",recent:"Now",bridge:"Jump",surprise:"Surprise"};function ah(e,t=90){const n=(e??"").replace(/\s+/g," ").trim();return n.length<=t?n:n.slice(0,t-1).trimEnd()+"…"}function Yi(e){const t=(e??"memory").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function ho(e){return{source:"local-captions",beats:e.beats.map((n,i)=>{var s,u;const r=n.node,a=ah(r.label||`(${Yi(r.type)} memory)`);let o;switch(n.kind){case"origin":o=`We begin at a ${Yi(r.type).toLowerCase()} the graph is centered on — "${a}".`;break;case"contradiction":{o=`This is held in tension with the last memory through ${(s=n.viaEdge)!=null&&s.type?n.viaEdge.type.replace(/_/g," "):"a conflict"}: "${a}".`;break}case"recent":o=`And where the mind is now — a recent memory: "${a}".`;break;case"bridge":o=`Crossing to a separate cluster — "${a}".`;break;default:{const d=((u=n.viaEdge)==null?void 0:u.weight)??0;o=`${d>.66?"strongly":d>.33?"closely":"loosely"} connected from there: a ${Yi(r.type).toLowerCase()} — "${a}".`}}return r.tags&&r.tags.length>0&&i>0&&(o+=` [${r.tags.slice(0,3).join(", ")}]`),{nodeId:n.nodeId,text:o,chip:fa[n.kind]}})}}async function rh(e,t){const n=ho(e);if(!t)return n;let i;try{const r=await Promise.race([t(),new Promise(u=>{i=setTimeout(()=>u(null),6e3)})]),a=Array.isArray(r)?r.filter(u=>!!u&&typeof u.nodeId=="string"&&typeof u.text=="string"&&u.text.trim().length>0):[];if(a.length===0)return n;const o=new Map(a.map(u=>[u.nodeId,u]));return{source:"backend-llm",beats:e.beats.map((u,d)=>{const m=o.get(u.nodeId);if(m){const _=typeof m.chip=="string"&&m.chip.trim()?m.chip:fa[u.kind];return{nodeId:u.nodeId,text:m.text,chip:_}}return n.beats[d]??{nodeId:u.nodeId,text:u.node.label||"(unlabeled memory)",chip:fa[u.kind]}})}}catch{return n}finally{i&&clearTimeout(i)}}function oh(e){const t=(e.type??"").toLowerCase();return t.includes("merge")||t.includes("supersede")||t.includes("duplicate")}function sh(e,t){const n=new Map;for(const i of e)n.set(i,0);for(const i of e){const r=[],a=new Map,o=new Map,s=new Map;for(const _ of e)a.set(_,[]),o.set(_,0),s.set(_,-1);o.set(i,1),s.set(i,0);const u=[i];let d=0;for(;d0;){const _=r.pop();for(const v of a.get(_)??[]){const h=(o.get(v)??0)/(o.get(_)||1)*(1+(m.get(_)??0));m.set(v,(m.get(v)??0)+h)}_!==i&&n.set(_,(n.get(_)??0)+(m.get(_)??0))}}return n}function lh(e,t){const n=new Map;for(const u of e)n.set(u,u);const i=u=>{let d=u;for(;n.get(d)!==d;)d=n.get(d);let m=u;for(;n.get(m)!==d;){const _=n.get(m);n.set(m,d),m=_}return d},r=(u,d)=>{const m=i(u),_=i(d);m!==_&&n.set(m,_)};for(const u of t)n.has(u.source)&&n.has(u.target)&&r(u.source,u.target);const a=new Map,o=new Map;let s=0;for(const u of e){const d=i(u);a.has(d)||a.set(d,s++),o.set(u,a.get(d))}return{clusterOf:o,count:s}}function ch(e,t){var O;const n=e.map(T=>T.id),i=nl(t),r=[...e].sort((T,M)=>rr(T)-rr(M)),a=new Map;r.forEach((T,M)=>a.set(T.id,e.length>1?M/(e.length-1):1));const o=600;let s=n;n.length>o&&(s=[...n].sort((T,M)=>{var C,D;return(((C=i[M])==null?void 0:C.length)??0)-(((D=i[T])==null?void 0:D.length)??0)}).slice(0,o));const u=sh(s,i);let d=0;for(const T of u.values())d=Math.max(d,T);const{clusterOf:m,count:_}=lh(n,t),v=Math.max(1,...e.map(T=>T.suppression_count??0)),h=new Map;let A=n[0]??"",R=-1;for(const T of e){const M=d>0?(u.get(T.id)??0)/d:0;M>R&&(R=M,A=T.id),h.set(T.id,{nodeId:T.id,degree:((O=i[T.id])==null?void 0:O.length)??0,betweenness:M,clusterId:m.get(T.id)??0,recencyRank:a.get(T.id)??0,retention:_i(T.retention??0),suppression:_i((T.suppression_count??0)/v)})}const c=new Map;for(const T of n)c.set(T,new Set((i[T]??[]).map(M=>M.otherId)));const l=t.map(T=>{const M=c.get(T.source),C=c.get(T.target);let D=0;if(M&&C){const[g,P]=M.size{const m=n>1?d/(n-1):0,_=Sh(m),v=t.nodes.get(u.nodeId),h=u.nodeId===t.peakBetweennessId,A=d===n-1,R=d===0;let c={nodeId:u.nodeId,move:"push_in",angle:"eye",cut:"fly",stormMode:"connection",tone:"curious",scoreCue:"motif",act:_,intensity:.6,tension:.3,why:"a connected memory"};return R&&(c={...c,move:"push_in",tone:"curious",tension:.25,stormMode:"anchor",why:"opening on the focal memory"}),(h||v&&v.betweenness>.6)&&(c={...c,move:"orbit",angle:"low",stormMode:"anchor",intensity:.75,tension:.45,tone:"awe",why:"low-angle orbit — the most load-bearing memory in the graph"}),u.kind==="contradiction"&&(c={...c,move:"push_in",angle:"eye",dutch:.28,cut:"hard_cut",stormMode:"contradiction",intensity:1,tension:.95,tone:"tense",scoreCue:"minor_drop",viaEdgeKey:u.viaEdge?`${u.viaEdge.source}->${u.viaEdge.target}`:void 0,why:"two memories in tension — a Dutch two-shot collision"}),u.kind==="surprise"&&(c={...c,move:"orbit",stormMode:"surprise",intensity:.85,tension:.6,tone:"awe",scoreCue:"motif",why:"a surprising, distant-but-plausible connection"}),v&&(v.retention<.35||v.suppression>.5)&&(c={...c,angle:"high",move:"pull_back",tone:"neutral",intensity:.4,why:"a fading memory — high-angle drift"}),u.kind==="recent"&&(c={...c,move:"push_in",tone:"resolved",tension:.4,why:"where the memory is now"}),A&&(c={...c,move:"crane",cut:"fly",stormMode:"anchor",tone:"awe",tension:.5,scoreCue:"major_resolve",why:"crane pull-back over the whole cluster — resolution"}),c}),r=e.beats.some(u=>u.kind==="contradiction")?"man_in_hole":"rags_to_riches";return{source:"deterministic",logline:`A short film about ${((s=e.beats[0])==null?void 0:s.node.label)??"a memory"} — ${n} shots through the graph${r==="man_in_hole"?", through a contradiction and out the other side":""}.`,arc:r,shots:i}}var xh=Ze(''),Mh=Ze(' '),Th=Ze(' '),bh=Ze('WebGPU'),Ah=Ze(' '),Rh=Ze(`
        Director's plan

        `),wh=Ze('
        '),yh=Ze('

        '),Ch=Ze('∞ dreaming'),Ph=Ze(''),Dh=Ze('

        ',1),Lh=Ze(''),Uh=Ze(' ',1);function Ih(e,t){Xn(t,!0);let n=Ne(!1),i=Ne("idle"),r=Ne(""),a=Ne(""),o=Ne(0),s=Ne(0),u=Ne(0),d=Ne(null),m=Ne(!1),_=Ne(!1),v=Ne(!1),h=Ne(!0),A=Ne(""),R=Ne(""),c=Ne("I"),l=Ne(0),O=Ne(""),T=Ne(null),M=Ne(void 0),C=null,D=null,F=null,H=null,x=0,g=0,P=null,$=0,V=Ne(null);const q=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Z=(B,W,k,se)=>B+(W-B)*(1-Math.exp(-k*se)),j={x:0,y:0},ie={yaw:0,pitch:0};let K=0,Se=0,we=0;const Ue=2500,je=.35,et=.22,Q=()=>{we=performance.now()},de=14;function xe(B){const W=new Map,k=B.beats.length;for(let se=0;se1?se/(k-1):.5)*2,ye=Math.sqrt(Math.max(0,1-le*le)),Y=se*2.399963;W.set(B.beats[se].nodeId,new Me(Math.cos(Y)*ye*de,le*de*.5,Math.sin(Y)*ye*de))}return W}function ue(B){if(!(!b(_)||typeof speechSynthesis>"u"))try{speechSynthesis.cancel();const W=new SpeechSynthesisUtterance(B);W.rate=.98,W.pitch=1,speechSynthesis.speak(W)}catch{}}function Ce(B){if(P&&clearInterval(P),ee(r,""),q){ee(r,B,!0);return}let W=0;P=setInterval(()=>{ee(r,B.slice(0,++W),!0),W>=B.length&&P&&(clearInterval(P),P=null)},18)}function Le(B){return B==="surprise"?"connection":B}function Ve(B,W,k){var ae,le;ee(s,W+1);const se=((ae=H==null?void 0:H.beats[W])==null?void 0:ae.text)??B.node.label??"";if(ee(a,((le=H==null?void 0:H.beats[W])==null?void 0:le.chip)??"",!0),Ce(se),ue(se),k&&(ee(R,k.why,!0),ee(c,k.act,!0),ee(l,k.tension,!0)),C&&b(m)){const ye=$e==null?void 0:$e.get(B.nodeId);if(ye){const ce=(k==null?void 0:k.stormMode)??"connection";C.transitionTo(Le(ce),ye,(k==null?void 0:k.act)??"I",W)}const Y=(k==null?void 0:k.tension)??0;C.setFlythrough(q?0:Y*.8)}}let $e=null;async function ze(){var le,ye;if(cancelAnimationFrame(x),xt(),P&&clearInterval(P),D==null||D.stop(),C==null||C.dispose(),C=null,D=null,H=null,$=0,ee(R,""),ee(O,""),ee(T,null),ee(c,"I"),ee(l,0),ee(n,!0),ee(i,"planning"),ee(A,"Planning a path through your memory…"),ee(r,""),ee(a,""),ee(o,0),ee(s,0),F=al(t.nodes,t.edges,t.centerId,7),ee(u,F.beats.length,!0),b(u)===0){ee(A,"Not enough memory to compose a tour yet."),ee(i,"done");return}$e=xe(F);const B=ch(t.nodes,t.edges);ee(T,Eh(F,B),!0),ee(O,b(T).logline,!0);const W=vh(b(T),F);if(ee(c,((le=W[0])==null?void 0:le.act)??"I",!0),ee(l,((ye=W[0])==null?void 0:ye.tension)??0,!0),H=await rh(F,b(v)?st():t.fetchBackendNarration),ee(d,H.source,!0),ee(m,!1),b(M))try{const{CinemaSandbox:Y,isWebGPUSupported:ce}=await dl(async()=>{const{CinemaSandbox:me,isWebGPUSupported:Ae}=await import("../chunks/DsOxZJ9g.js");return{CinemaSandbox:me,isWebGPUSupported:Ae}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);ce()&&(C=new Y(b(M)),await C.boot(),ee(m,!0))}catch(Y){console.warn("[cinema] WebGPU sandbox unavailable, camera-only mode:",Y),C=null,ee(m,!1)}const k=b(M)&&b(M).clientHeight>0?b(M).clientWidth/b(M).clientHeight:16/9,se=(C==null?void 0:C.cameraRef)??new Bn(60,k,.1,2e3),ae=(C==null?void 0:C.target)??new Me;D=new nh(se,ae,$e,F,{onBeat:Ve,onProgress:Y=>ee(o,Y,!0),onComplete:()=>{ee(i,"done"),ee(A,q||!b(m)?"End of tour.":"∞ Dreaming — endless generative figures",!0),w()}},{reducedMotion:q,shots:W,centerOnOrigin:b(m)}),ee(i,"playing"),ee(A,b(m)?"Rendering 150k-particle semantic storm on WebGPU…":"Cinematic flythrough (captions mode).",!0),g=performance.now(),D.start(),lt()}async function lt(){const B=performance.now(),W=Math.max(0,Math.min(.05,(B-g)/1e3));g=B;try{D==null||D.update(W)}catch(se){console.warn("[cinema] director error:",se)}if(!q&&C&&b(m)){const se=C.cameraRef,ae=performance.now()-we>Ue,le=ae?0:j.x*je,ye=ae?0:j.y*et,Y=ae?1.5:9;ie.yaw=Z(ie.yaw,le,Y,W),ie.pitch=Z(ie.pitch,ye,Y,W),ae&&(K=Z(K,0,1.2,W)),Se=Z(Se,K,8,W);const ce=se.position.clone(),me=new ra().setFromVector3(ce);me.theta+=ie.yaw,me.phi=no.clamp(me.phi+ie.pitch,.2,Math.PI-.2),me.radius*=1-Se*.35,ce.setFromSpherical(me),se.position.copy(ce)}const k=C;if(k&&b(m))try{await k.render(W),$=0}catch(se){++$>=3&&C===k&&(console.warn("[cinema] WebGPU render failing, dropping to camera-only:",se),ee(m,!1),k.dispose(),C=null)}x=requestAnimationFrame(lt)}function w(){q||!C||!b(m)||(xt(),q||C==null||C.setFlythrough(.6),C==null||C.dreamBeat(),ee(r,""),ee(a,"Dreaming"),ee(V,setInterval(()=>{if(!C||!b(m)){xt();return}C.dreamBeat()},5500),!0))}function xt(){b(V)&&(clearInterval(b(V)),ee(V,null))}function Fe(){var B;cancelAnimationFrame(x),xt(),P&&clearInterval(P),typeof speechSynthesis<"u"&&speechSynthesis.cancel(),C&&((B=C.setFlythrough)==null||B.call(C,0)),ie.yaw=ie.pitch=0,K=Se=0,D==null||D.stop(),C==null||C.dispose(),C=null,D=null,ee(n,!1),ee(i,"idle"),ee(m,!1)}let Be=Ne(void 0);function Re(B){B.key==="Escape"?(B.preventDefault(),Fe()):(B.key==="h"||B.key==="H")&&(B.preventDefault(),ee(h,!b(h)))}gi(()=>{b(n)&&b(Be)&&b(Be).focus()}),gi(()=>{if(!(typeof document>"u"))return document.body.classList.toggle("cinema-open",b(n)),()=>document.body.classList.remove("cinema-open")}),gi(()=>{if(!b(n)||q||!b(M))return;const B=b(M),W=(Y,ce,me)=>Math.min(me,Math.max(ce,Y));B.style.touchAction="none";const k=Y=>{j.x=Y.clientX/window.innerWidth*2-1,j.y=-(Y.clientY/window.innerHeight)*2+1,Q()},se=Y=>{Y.preventDefault(),K=W(K+Y.deltaY*8e-4,-1,1),Q()};let ae=null;const le=Y=>{if(Y.touches.length===2){const ce=Y.touches[0].clientX-Y.touches[1].clientX,me=Y.touches[0].clientY-Y.touches[1].clientY,Ae=Math.hypot(ce,me);ae!==null&&(K=W(K+(Ae-ae)*.002,-1,1)),ae=Ae,Q()}},ye=()=>{ae=null};return B.addEventListener("pointermove",k,{passive:!0}),B.addEventListener("wheel",se,{passive:!1}),B.addEventListener("touchmove",le,{passive:!0}),B.addEventListener("touchend",ye),()=>{B.removeEventListener("pointermove",k),B.removeEventListener("wheel",se),B.removeEventListener("touchmove",le),B.removeEventListener("touchend",ye)}});function st(){return async()=>{var B,W;if(!F)return null;try{ee(A,"Loading on-device model (first run downloads weights)…");const se=await import("@huggingface/transformers").catch(()=>null);if(!(se!=null&&se.pipeline))return null;const ae=await se.pipeline("text-generation","onnx-community/Qwen2.5-0.5B-Instruct",{device:"webgpu",dtype:"q4"}),le=ho(F);ee(A,"Narrating with the on-device model…");const ye=[];for(const Y of le.beats){const ce=`You are narrating a cinematic tour of an AI's memory graph. In one vivid sentence, narrate this beat: "${Y.text}"`,me=await ae(ce,{max_new_tokens:48,temperature:.7,do_sample:!0}),Ae=(W=(B=me==null?void 0:me[0])==null?void 0:B.generated_text)==null?void 0:W.replace(ce,"").trim();ye.push({nodeId:Y.nodeId,chip:Y.chip,text:Ae&&Ae.length>4?Ae:Y.text})}return ye}catch(k){return console.warn("[cinema] on-device narration failed, using local captions:",k),null}}}ua(Fe);var Te=Uh(),S=Tn(Te),f=fe(S,2);{var G=B=>{var W=Lh(),k=oe(W);Zi(k,Y=>ee(M,Y),()=>b(M));var se=fe(k,2);{var ae=Y=>{var ce=xh();ht("click",ce,()=>ee(h,!0)),Ye(Y,ce)};ut(se,Y=>{b(h)||Y(ae)})}var le=fe(se,2);{var ye=Y=>{var ce=Dh(),me=Tn(ce),Ae=oe(me),_e=oe(Ae);let qe;var Oe=fe(_e,2),at=oe(Oe,!0);re(Oe);var E=fe(Oe,2);{var X=y=>{var I=Mh(),U=oe(I,!0);re(I),gt(()=>Je(U,b(T).source==="deterministic"?"Auteur (local)":"Auteur (AI)")),Ye(y,I)};ut(E,y=>{b(T)&&y(X)})}var N=fe(E,2);{var z=y=>{var I=Th(),U=oe(I,!0);re(I),gt(()=>Je(U,b(d)==="backend-llm"?"AI narration":"Live captions")),Ye(y,I)};ut(N,y=>{b(d)&&y(z)})}var J=fe(N,2);{var te=y=>{var I=bh();Ye(y,I)};ut(J,y=>{b(m)&&y(te)})}var ve=fe(J,2);{var We=y=>{var I=Ah(),U=oe(I);re(I),gt(()=>Je(U,`Act ${b(c)??""}`)),Ye(y,I)};ut(ve,y=>{b(i)==="playing"&&y(We)})}re(Ae);var it=fe(Ae,2),Ge=oe(it),vt=oe(Ge);ai(vt),Fn(),re(Ge);var dt=fe(Ge,2),zt=oe(dt);ai(zt),Fn(),re(dt);var un=fe(dt,2);Zi(un,y=>ee(Be,y),()=>b(Be)),re(it),re(me);var Dt=fe(me,2);{var Kt=y=>{var I=Rh(),U=fe(oe(I),2),ne=oe(U,!0);re(U),re(I),gt(()=>Je(ne,b(O))),Ye(y,I)};ut(Dt,y=>{b(i)==="planning"&&b(O)&&y(Kt)})}var pn=fe(Dt,2),Zt=oe(pn);{var nn=y=>{var I=wh(),U=oe(I,!0);re(I),gt(()=>Je(U,b(a))),Ye(y,I)};ut(Zt,y=>{b(a)&&y(nn)})}var jt=fe(Zt,2),an=oe(jt,!0);re(jt);var rn=fe(jt,2);{var Rn=y=>{var I=yh(),U=oe(I);re(I),gt(()=>Je(U,`▸ ${b(R)??""}`)),Ye(y,I)};ut(rn,y=>{b(R)&&b(i)==="playing"&&y(Rn)})}var $t=fe(rn,2),wn=oe($t);re($t);var yn=fe($t,2),on=oe(yn);{var Kn=y=>{var I=Ch();Ye(y,I)},Ct=y=>{var I=go();gt(()=>Je(I,`Beat ${b(s)??""} / ${b(u)??""}`)),Ye(y,I)};ut(on,y=>{b(i)==="done"&&b(V)?y(Kn):b(u)>0&&y(Ct,1)})}var p=fe(on,2);{var L=y=>{var I=Ph();ht("click",I,ze),Ye(y,I)};ut(p,y=>{b(i)==="done"&&y(L)})}re(yn),re(pn),gt(()=>{qe=ln(_e,1,"cinema-dot svelte-1uwqs3k",null,qe,{active:b(i)==="playing"}),Je(at,b(A)),Je(an,b(r)),ri(wn,`width:${b(o)*100}%; --tension:${b(l)??""}`)}),va(vt,()=>b(_),y=>ee(_,y)),va(zt,()=>b(v),y=>ee(v,y)),ht("click",un,Fe),Ye(Y,ce)};ut(le,Y=>{b(h)&&Y(ye)})}re(W),ht("keydown",W,Re),Ye(B,W)};ut(f,B=>{b(n)&&B(G)})}ht("click",S,ze),Ye(e,Te),Yn()}pa(["click","keydown"]);var Nh=Ze('

        Weaving your memory graph…

        '),Oh=Ze(`

        MCP Backend Offline

        The Vestige MCP server isn't reachable on :3927. + The dashboard is running but has nothing to query.

        Start the backend:
        nohup bash -c 'tail -f /dev/null | VESTIGE_DASHBOARD_ENABLED=true ~/.local/bin/vestige-mcp' > /tmp/vestige.log 2>&1 & +disown
        `),Fh=Ze('

        Your Mind Awaits

        No memories yet — the moment Vestige starts remembering, your constellation will bloom here.

        '),Bh=Ze('

        Your Mind Awaits

        '),Hh=Ze('
        '),Gh=Ze(`
        `),kh=Ze('
        ',1),Vh=Ze(' · · ',1),zh=Ze('
        '),Wh=Ze('
        '),Xh=Ze('
        AhaGraph
        '),Yh=Ze(' '),qh=Ze('
        '),Kh=Ze("
        "),Zh=Ze(`

        Memory Detail

        Retention Forecast
        Explore Connections
        `),jh=Ze('
        '),$h=Ze(`
        `,1);function Em(e,t){Xn(t,!0);const n=()=>Mo(ul,"$eventFeed",i),[i,r]=xo();let a=Ne(null),o=Ne(null),s=Ne(!0),u=Ne(""),d=Ne(!1),m=Ne(""),_=Ne(150);const v=[{value:"50",label:"50 nodes"},{value:"100",label:"100 nodes"},{value:"150",label:"150 nodes"},{value:"200",label:"200 nodes"}];let h=Ne("150");function A(E){ee(_,parseInt(E,10),!0),Z()}let R=Ne(!1),c=Ne(qi(new Date)),l=Ne("type");const O=Object.entries(ol);let T=Ne(0),M=Ne(0),C=Ne(!1),D=Ne("recall-path");const F="vestige-graph-renderer";let H=Ne("classic");function x(E){ee(H,E,!0);try{localStorage.setItem(F,E)}catch{}}function g(E){console.warn(`[graph] WebGPU field unavailable (${E}) — using the classic renderer.`),ee(H,"classic")}let P=en(()=>b(a)?b(R)?Ir(b(a).nodes,b(a).edges,b(c)).visibleNodes:b(a).nodes:[]),$=en(()=>b(a)?b(R)?Ir(b(a).nodes,b(a).edges,b(c)).visibleEdges:b(a).edges:[]);function V(E){if(b(a))switch(E.type){case"nodeAdded":b(a).nodes=[...b(a).nodes,E.node],b(a).nodeCount=b(a).nodes.length,ee(T,b(a).nodeCount,!0);break;case"nodeRemoved":b(a).nodes=b(a).nodes.filter(X=>X.id!==E.nodeId),b(a).nodeCount=b(a).nodes.length,ee(T,b(a).nodeCount,!0);break;case"edgeAdded":b(a).edges=[...b(a).edges,E.edge],b(a).edgeCount=b(a).edges.length,ee(M,b(a).edgeCount,!0);break;case"edgesRemoved":b(a).edges=b(a).edges.filter(X=>X.source!==E.nodeId&&X.target!==E.nodeId),b(a).edgeCount=b(a).edges.length,ee(M,b(a).edgeCount,!0);break;case"nodeUpdated":{const X=b(a).nodes.find(N=>N.id===E.nodeId);X&&(X.retention=E.retention);break}}}Nr(()=>{const E=typeof navigator<"u"&&"gpu"in navigator;let X=null;try{X=localStorage.getItem(F)}catch{}ee(H,E?X==="classic"?"classic":"field":"classic",!0);const N=new URLSearchParams(window.location.search),z=N.get("colorMode");q(z)&&ee(l,z,!0);const J=N.get("center");Z(void 0,J||void 0)});function q(E){return E==="type"||E==="state"||E==="ahagraph"}async function Z(E,X){var N;ee(s,!0),ee(u,"");try{const z=!E&&!X;if(ee(a,await Pn.graph({max_nodes:b(_),depth:3,query:E||void 0,center_id:X||void 0,sort:z?"recent":void 0}),!0),z&&b(a)&&b(a).nodeCount<=1&&b(a).edgeCount===0){const J=await Pn.graph({max_nodes:b(_),depth:3,sort:"connected"});J&&J.nodeCount>b(a).nodeCount&&ee(a,J,!0)}b(a)&&(ee(T,b(a).nodeCount,!0),ee(M,b(a).edgeCount,!0))}catch(z){const J=z instanceof Error?z.message:String(z),te=J.replace(/\/[\w./-]+\.(sqlite|rs|db|toml|lock)\b/g,"[path]").slice(0,200),ve=z instanceof TypeError||/failed to fetch|NetworkError|load failed/i.test(J)||/^API 500:?\s*(Internal Server Error)?\s*$/i.test(J.trim()),We=(((N=b(a))==null?void 0:N.nodeCount)??0)===0&&/not found|404|empty|no memor/i.test(J);ve?ee(u,"OFFLINE"):We?ee(u,"EMPTY"):ee(u,`Failed to load graph: ${te}`)}finally{ee(s,!1)}}async function j(){ee(d,!0);try{await Pn.dream(),await Z()}catch{}finally{ee(d,!1)}}async function ie(E){try{ee(o,await Pn.memories.get(E),!0)}catch{ee(o,null)}}function K(){b(m).trim()&&Z(b(m))}var Se=$h(),we=Tn(Se),Ue=oe(we);{var je=E=>{var X=Nh();Ye(E,X)},et=E=>{var X=Oh(),N=oe(X),z=oe(N),J=oe(z);mn(J,{name:"activation",size:52,strokeWidth:1.2}),re(z);var te=fe(z,8),ve=oe(te),We=fe(ve,2);re(te),re(N),re(X),gt(()=>mt(We,"href",`${Sa??""}/settings`)),ht("click",ve,()=>Z()),Ye(E,X)},Q=E=>{var X=Fh(),N=oe(X),z=oe(N),J=oe(z);mn(J,{name:"graph",size:52,strokeWidth:1.2}),re(z),Fn(4),re(N),re(X),Ye(E,X)},de=E=>{var X=Bh(),N=oe(X),z=oe(N),J=oe(z);mn(J,{name:"graph",size:52,strokeWidth:1.2}),re(z);var te=fe(z,4),ve=oe(te,!0);re(te),re(N),re(X),gt(()=>Je(ve,b(u))),Ye(E,X)},xe=E=>{var X=Or(),N=Tn(X);{var z=te=>{var ve=Hh(),We=oe(ve);or(We,{embedded:!0,chrome:"none",demo:"recall-path",showSwitcher:!1,onpick:ie,onfallback:g}),re(ve),Ye(te,ve)},J=te=>{zp(te,{get nodes(){return b(P)},get edges(){return b($)},get centerId(){return b(a).center_id},get events(){return n()},get isDreaming(){return b(d)},get colorMode(){return b(l)},onSelect:ie,onGraphMutation:V})};ut(N,te=>{b(H)==="field"?te(z):te(J,!1)})}Ye(E,X)};ut(Ue,E=>{b(s)?E(je):b(u)==="OFFLINE"?E(et,1):b(u)==="EMPTY"?E(Q,2):b(u)?E(de,3):b(a)&&E(xe,4)})}var ue=fe(Ue,2),Ce=oe(ue);{var Le=E=>{var X=Gh(),N=oe(X);ai(N);var z=fe(N,2);re(X),ht("keydown",N,J=>J.key==="Enter"&&K()),Ki(N,()=>b(m),J=>ee(m,J)),ht("click",z,K),Ye(E,X)};ut(Ce,E=>{b(H)==="classic"&&E(Le)})}var Ve=fe(Ce,2),$e=oe(Ve),ze=oe($e),lt=fe(ze,2);re($e);var w=fe($e,2);{var xt=E=>{var X=kh(),N=Tn(X),z=oe(N),J=fe(z,2),te=fe(J,2);re(N);var ve=fe(N,2);fl(ve,{get options(){return v},icon:"graph",class:"shrink-0",onChange:A,get value(){return b(h)},set value(dt){ee(h,dt,!0)}});var We=fe(ve,2),it=fe(oe(We),2);ai(it);var Ge=fe(it,2),vt=oe(Ge);re(Ge),re(We),gt((dt,zt)=>{mt(z,"aria-checked",b(l)==="type"),ln(z,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${b(l)==="type"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),mt(J,"aria-checked",b(l)==="state"),ln(J,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${b(l)==="state"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),mt(te,"aria-checked",b(l)==="ahagraph"),ln(te,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${b(l)==="ahagraph"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),mt(We,"title",`Adjust graph brightness (${dt??""}x). Combines with auto distance compensation.`),mt(it,"min",xn.brightnessMin),mt(it,"max",xn.brightnessMax),Je(vt,`${zt??""}x`)},[()=>xn.brightness.toFixed(1),()=>xn.brightness.toFixed(1)]),ht("click",z,()=>ee(l,"type")),ht("click",J,()=>ee(l,"state")),ht("click",te,()=>ee(l,"ahagraph")),Ki(it,()=>xn.brightness,dt=>xn.brightness=dt),Ye(E,X)};ut(w,E=>{b(H)==="classic"&&E(xt)})}var Fe=fe(w,2),Be=oe(Fe),Re=oe(Be);mn(Re,{name:"dreams",size:16}),re(Be);var st=fe(Be);re(Fe);var Te=fe(Fe,2),S=oe(Te);mn(S,{name:"sparkle",size:16}),Fn(),re(Te);var f=fe(Te,2);{var G=E=>{{let X=en(()=>{var N;return((N=b(a))==null?void 0:N.center_id)??""});Ih(E,{get nodes(){return b(P)},get edges(){return b($)},get centerId(){return b(X)}})}};ut(f,E=>{b(P).length>0&&E(G)})}var B=fe(f,2),W=oe(B);mn(W,{name:"pulse",size:16}),re(B),re(Ve),re(ue);var k=fe(ue,2),se=oe(k);{var ae=E=>{var X=Vh(),N=Tn(X),z=oe(N);re(N);var J=fe(N,4),te=oe(J);re(J);var ve=fe(J,4),We=oe(ve);re(ve),gt(()=>{Je(z,`${b(T)??""} nodes`),Je(te,`${b(M)??""} edges`),Je(We,`depth ${b(a).depth??""}`)}),Ye(E,X)};ut(se,E=>{b(a)&&E(ae)})}re(k);var le=fe(k,2);{var ye=E=>{var X=zh(),N=oe(X);Jp(N,{}),re(X),Ye(E,X)};ut(le,E=>{b(H)==="classic"&&b(l)==="state"&&E(ye)})}var Y=fe(le,2);{var ce=E=>{var X=Xh(),N=fe(oe(X),2);ei(N,21,()=>O,vi,(z,J)=>{var te=en(()=>vo(b(J),2));let ve=()=>b(te)[0],We=()=>b(te)[1];var it=Wh(),Ge=oe(it),vt=fe(Ge,2),dt=oe(vt,!0);re(vt),re(it),gt(()=>{ri(Ge,`background: ${We()??""}`),Je(dt,rl[ve()])}),Ye(z,it)}),re(N),re(X),Ye(E,X)};ut(Y,E=>{b(H)==="classic"&&b(l)==="ahagraph"&&E(ce)})}var me=fe(Y,2);{var Ae=E=>{jp(E,{get nodes(){return b(a).nodes},onDateChange:X=>{ee(c,X,!0)},onToggle:X=>{ee(R,X,!0)}})};ut(me,E=>{b(a)&&b(H)==="classic"&&E(Ae)})}var _e=fe(me,2);{var qe=E=>{var X=Zh(),N=oe(X),z=fe(oe(N),2);re(N);var J=fe(N,2),te=oe(J),ve=oe(te),We=oe(ve,!0);re(ve);var it=fe(ve,2);ei(it,17,()=>b(o).tags,vi,(Ct,p)=>{var L=Yh(),y=oe(L,!0);re(L),gt(()=>Je(y,b(p))),Ye(Ct,L)}),re(te);var Ge=fe(te,2),vt=oe(Ge,!0);re(Ge);var dt=fe(Ge,2);ei(dt,21,()=>[{label:"Retention",value:b(o).retentionStrength},{label:"Storage",value:b(o).storageStrength},{label:"Retrieval",value:b(o).retrievalStrength}],vi,(Ct,p)=>{var L=qh(),y=oe(L),I=oe(y),U=oe(I,!0);re(I);var ne=fe(I,2),he=oe(ne);re(ne),re(y);var ge=fe(y,2),Ee=oe(ge);re(ge),re(L),gt(Ie=>{Je(U,b(p).label),Je(he,`${Ie??""}%`),ri(Ee,`width: ${b(p).value*100}%; background: ${b(p).value>.7?"#10b981":b(p).value>.4?"#f59e0b":"#ef4444"}`)},[()=>(b(p).value*100).toFixed(1)]),Ye(Ct,L)}),re(dt);var zt=fe(dt,2),un=fe(oe(zt),2);{let Ct=en(()=>b(o).storageStrength*30);Yp(un,{get retention(){return b(o).retentionStrength},get stability(){return b(Ct)}})}re(zt);var Dt=fe(zt,2),Kt=oe(Dt),pn=oe(Kt);re(Kt);var Zt=fe(Kt,2),nn=oe(Zt);re(Zt);var jt=fe(Zt,2);{var an=Ct=>{var p=Kh(),L=oe(p);re(p),gt(y=>Je(L,`Accessed: ${y??""}`),[()=>new Date(b(o).lastAccessedAt).toLocaleString()]),Ye(Ct,p)};ut(jt,Ct=>{b(o).lastAccessedAt&&Ct(an)})}var rn=fe(jt,2),Rn=oe(rn);re(rn),re(Dt);var $t=fe(Dt,2),wn=oe($t),yn=fe(wn,2);re($t);var on=fe($t,2),Kn=oe(on);mn(Kn,{name:"explore",size:14}),Fn(),re(on),re(J),re(X),gt((Ct,p)=>{Je(We,b(o).nodeType),Je(vt,b(o).content),Je(pn,`Created: ${Ct??""}`),Je(nn,`Updated: ${p??""}`),Je(Rn,`Reviews: ${b(o).reviewCount??0??""}`),mt(on,"href",`${Sa??""}/explore`)},[()=>new Date(b(o).createdAt).toLocaleString(),()=>new Date(b(o).updatedAt).toLocaleString()]),ht("click",z,()=>ee(o,null)),ht("click",wn,()=>{b(o)&&Pn.memories.promote(b(o).id)}),ht("click",yn,()=>{b(o)&&Pn.memories.demote(b(o).id)}),Ye(E,X)};ut(_e,E=>{b(o)&&E(qe)})}re(we);var Oe=fe(we,2);{var at=E=>{var X=jh(),N=oe(X);So(N,()=>b(D),z=>{or(z,{get demo(){return b(D)},ondemochange:J=>ee(D,J,!0),onexit:()=>ee(C,!1),onfallback:J=>{ee(C,!1),g(J)}})}),re(X),Ye(E,X)};ut(Oe,E=>{b(C)&&E(at)})}gt(()=>{mt(ze,"aria-checked",b(H)==="field"),ln(ze,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${b(H)==="field"?"bg-[#5dcaa5]/25 text-[#7fe6c0]":"text-dim hover:text-text"}`),mt(lt,"aria-checked",b(H)==="classic"),ln(lt,1,`min-h-9 px-3 py-1.5 rounded-lg transition ${b(H)==="classic"?"bg-synapse/25 text-synapse-glow":"text-dim hover:text-text"}`),Fe.disabled=b(d),ln(Fe,1,`shrink-0 inline-flex items-center gap-2 min-h-10 px-4 py-2 rounded-xl bg-dream/20 border border-dream/40 text-dream-glow text-sm + hover:bg-dream/30 transition-all backdrop-blur-sm disabled:opacity-50 + ${b(d)?"glow-dream animate-pulse-glow":""}`),ln(Be,1,Eo(b(d)?"breathe":"")),Je(st,` ${b(d)?"Dreaming…":"Dream"}`)}),ht("click",ze,()=>x("field")),ht("click",lt,()=>x("classic")),ht("click",Fe,j),ht("click",Te,()=>ee(C,!0)),ht("click",B,()=>Z()),Ye(e,Se),Yn(),r()}pa(["click","keydown"]);export{Em as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js.br b/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js.br new file mode 100644 index 0000000..59e44f2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js.gz b/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js.gz new file mode 100644 index 0000000..fad7aad Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/11.CvKWjpIX.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js b/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js deleted file mode 100644 index 0f3906a..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js +++ /dev/null @@ -1 +0,0 @@ -import{fB as f}from"../chunks/C-SOZ1Oi.js";export{f as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js.br b/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js.br deleted file mode 100644 index f8e1ced..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js.gz b/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js.gz deleted file mode 100644 index d8df44b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/11.Db7dgOeT.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js b/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js deleted file mode 100644 index 1f39f22..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js +++ /dev/null @@ -1,8 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as Lt}from"../chunks/TZu9D97Z.js";import{G as Zt,T as Ut,aC as Vt,q as Yt,p as Bt,i as F,e as n,t as M,g as t,a as x,h as i,r,b as Dt,u as g,s as H,c as jt,f as Q,au as bt,d as zt,j as _,a9 as Jt,k as Qt,n as St}from"../chunks/wpu9U-D0.js";import{s as k,d as te,a as Ct}from"../chunks/D8mhvFt8.js";import{i as R}from"../chunks/DKve45Wd.js";import{B as ee}from"../chunks/BWk3o_TN.js";import{e as tt,i as nt,a as u}from"../chunks/60_R_Vbt.js";import{a as Ft,r as Et}from"../chunks/P1-U_Xsj.js";import{s as ae}from"../chunks/EqHb-9AZ.js";import{b as re}from"../chunks/CnZzd20v.js";import{g as se}from"../chunks/dCAmqaEc.js";import{b as ne}from"../chunks/Bxs5UR9-.js";import{a as Tt}from"../chunks/CZfHMhLI.js";import{N as oe}from"../chunks/CcUbQ_Wl.js";import{p as ie}from"../chunks/ByYB047u.js";import{P as le}from"../chunks/BHDZZvku.js";import{A as de}from"../chunks/DcKTNC6e.js";import{I as It}from"../chunks/D7A-gG4Z.js";import{s as ce}from"../chunks/DPdYG9yN.js";const ve=Symbol("NaN");function pe(o,C,f){Zt&&Ut();var p=new ee(o),$=!Vt();Yt(()=>{var h=C();h!==h&&(h=ve),$&&h!==null&&typeof h=="object"&&(h={}),p.ensure(h,f)})}function Nt(o){return o==null||!Number.isFinite(o)||o<0?0:o>1?1:o}function me(o){return{novelty:Nt(o==null?void 0:o.novelty),arousal:Nt(o==null?void 0:o.arousal),reward:Nt(o==null?void 0:o.reward),attention:Nt(o==null?void 0:o.attention)}}const Rt={sm:80,md:180,lg:320};function Ot(o){return o&&(o==="sm"||o==="md"||o==="lg")?Rt[o]:Rt.md}const wt=[{key:"novelty",angle:-Math.PI/2},{key:"arousal",angle:0},{key:"reward",angle:Math.PI/2},{key:"attention",angle:Math.PI}];function ue(o){const C=Ot(o);let f;switch(o){case"lg":f=44;break;case"sm":f=4;break;default:f=28}return Math.max(0,C/2-f)}var xe=bt(''),fe=bt(''),ge=bt(''),ye=bt(' ',1),_e=bt('');function $t(o,C){Bt(C,!0);let f=ie(C,"size",3,"md"),p=g(()=>Ot(f())),$=g(()=>f()!=="sm"),h=g(()=>ue(f())),et=g(()=>t(p)/2),at=g(()=>t(p)/2);const Pt={novelty:"Novelty",arousal:"Arousal",reward:"Reward",attention:"Attention"};let I=g(()=>me({novelty:C.novelty,arousal:C.arousal,reward:C.reward,attention:C.attention}));function K(l,d){const s=l*t(h);return[t(et)+Math.cos(d)*s,t(at)+Math.sin(d)*s]}const ot=[.25,.5,.75,1];function it(l){return wt.map(({angle:s})=>K(l,s)).map((s,c)=>`${c===0?"M":"L"}${s[0].toFixed(2)},${s[1].toFixed(2)}`).join(" ")+" Z"}let L=H(0);Lt(()=>{const d=performance.now();let s=0;const c=w=>{const y=Math.min(1,(w-d)/600);F(L,1-Math.pow(1-y,3)),y<1&&(s=requestAnimationFrame(c))};return s=requestAnimationFrame(c),()=>cancelAnimationFrame(s)});let lt=g(()=>{const l=t(L);return wt.map(({key:s,angle:c})=>K(t(I)[s]*l,c)).map((s,c)=>`${c===0?"M":"L"}${s[0].toFixed(2)},${s[1].toFixed(2)}`).join(" ")+" Z"});function kt(l){const d=t(h)+(f()==="lg"?18:12),s=t(et)+Math.cos(l)*d,c=t(at)+Math.sin(l)*d;let w="middle";return Math.abs(Math.cos(l))>.5&&(w=Math.cos(l)>0?"start":"end"),{x:s,y:c,anchor:w}}var j=_e(),dt=n(j);tt(dt,17,()=>ot,nt,(l,d)=>{var s=xe();M(c=>{u(s,"d",c),u(s,"stroke-opacity",t(d)===1?.45:.18),u(s,"stroke-width",t(d)===1?1:.75)},[()=>it(t(d))]),x(l,s)});var Mt=i(dt);tt(Mt,17,()=>wt,nt,(l,d)=>{const s=g(()=>{const[w,y]=K(1,t(d).angle);return{x:w,y}});var c=fe();M(()=>{u(c,"x1",t(et)),u(c,"y1",t(at)),u(c,"x2",t(s).x),u(c,"y2",t(s).y)}),x(l,c)});var G=i(Mt),ct=i(G);{var rt=l=>{var d=jt(),s=Q(d);tt(s,17,()=>wt,nt,(c,w)=>{const y=g(()=>{const[P,pt]=K(t(I)[t(w).key]*t(L),t(w).angle);return{px:P,py:pt}});var N=ge();M(()=>{u(N,"cx",t(y).px),u(N,"cy",t(y).py),u(N,"r",f()==="lg"?3:2.25)}),x(c,N)}),x(l,d)};R(ct,l=>{f()!=="sm"&&l(rt)})}var At=i(ct);{var vt=l=>{var d=jt(),s=Q(d);tt(s,17,()=>wt,nt,(c,w)=>{const y=g(()=>kt(t(w).angle));var N=ye(),P=Q(N),pt=n(P);r(P);var q=i(P),mt=n(q,!0);r(q),M(ut=>{u(P,"x",t(y).x),u(P,"y",t(y).y),u(P,"text-anchor",t(y).anchor),u(P,"font-size",f()==="lg"?12:10),k(pt,`${ut??""}%`),u(q,"x",t(y).x),u(q,"y",t(y).y+(f()==="lg"?14:11)),u(q,"text-anchor",t(y).anchor),u(q,"font-size",f()==="lg"?10:8.5),k(mt,Pt[t(w).key])},[()=>(t(I)[t(w).key]*100).toFixed(0)]),x(c,N)}),x(l,d)};R(At,l=>{t($)&&l(vt)})}r(j),M((l,d,s,c)=>{u(j,"width",t(p)),u(j,"height",t(p)),u(j,"viewBox",`0 0 ${t(p)??""} ${t(p)??""}`),u(j,"aria-label",`Importance radar: novelty ${l??""}%, arousal ${d??""}%, reward ${s??""}%, attention ${c??""}%`),u(G,"d",t(lt)),u(G,"stroke-width",f()==="sm"?1:1.5)},[()=>(t(I).novelty*100).toFixed(0),()=>(t(I).arousal*100).toFixed(0),()=>(t(I).reward*100).toFixed(0),()=>(t(I).attention*100).toFixed(0)]),x(o,j),Dt()}var he=_(' '),we=_('Driven by ',1),be=_('
        Save

        '),ke=_('Weakest channel: ',1),Me=_('
        Skip

        '),Ae=_('
        Composite
        ',1),Se=_(`

        Type some content above to score its importance.

        Composite = 0.25·novelty + 0.30·arousal + 0.25·reward + 0.20·attention. - Threshold for save: 60%.

        `),Ce=_('
        '),Fe=_('
        '),Ie=_(`

        No standout memories yet

        As you capture decisions, wins, and discoveries, the most important ones - will rise to the top here — ranked by retention, reviews, and recency.

        `),Ne=_('· ',1),Pe=_(' '),Ee=_('
        '),Te=_(``),je=_('
        '),ze=_(`

        Test Importance

        Paste any content below. Vestige scores it across 4 channels and - decides whether it is worth saving.

        ⌘/Ctrl + Enter

        Top Important Memories This Week

        Ranked by retention × reviews ÷ age. Click any card to open it.

        `);function ea(o,C){Bt(C,!0);let f=H(""),p=H(null),$=H(!1),h=H(null),et=H(0);async function at(){const e=t(f).trim();if(!(!e||t($))){F($,!0),F(h,null);try{F(p,await Tt.importance(e),!0),Jt(et)}catch(a){F(h,a instanceof Error?a.message:String(a),!0),F(p,null)}finally{F($,!1)}}}function Pt(e){(e.metaKey||e.ctrlKey)&&e.key==="Enter"&&(e.preventDefault(),at())}const I={novelty:.25,arousal:.3,reward:.25,attention:.2},K={novelty:{high:"new information not already in your graph",low:"overlaps heavily with what you already know"},arousal:{high:"emotionally salient — decisions, bugs, or discoveries stick",low:"neutral tone, no strong affect signal"},reward:{high:"high reward value — preferences, wins, or solutions you will revisit",low:"low reward value — transient or incidental detail"},attention:{high:"strong attentional markers (imperatives, questions, urgency)",low:"passive phrasing, no clear attentional hook"}};let ot=g(()=>t(p)?Object.keys(I).map(a=>({key:a,contribution:t(p).channels[a]*I[a]})).sort((a,v)=>v.contribution-a.contribution)[0]:null),it=g(()=>t(p)?Object.keys(I).slice().sort((e,a)=>t(p).channels[e]-t(p).channels[a])[0]:null),L=H(zt([])),lt=H(!0),kt=zt({});function j(e){const a=Math.max(1,(Date.now()-new Date(e.createdAt).getTime())/864e5),v=e.reviewCount??0,m=1/Math.pow(a,.5);return e.retentionStrength*Math.log1p(v+1)*m}async function dt(){F(lt,!0);try{const a=(await Tt.memories.list({limit:"20"})).memories.slice().sort((v,m)=>j(m)-j(v)).slice(0,20);F(L,a,!0),t(L).forEach(async v=>{try{const m=await Tt.importance(v.content);kt[v.id]=m.channels}catch{}})}catch{F(L,[],!0)}finally{F(lt,!1)}}Lt(dt);function Mt(e){se(`${ne}/memories`)}var G=ze(),ct=n(G);le(ct,{icon:"importance",title:"Importance Radar",subtitle:"4-channel importance model: Novelty · Arousal · Reward · Attention",accent:"warning"});var rt=i(ct,2),At=i(n(rt),2),vt=n(At),l=n(vt);Qt(l);var d=i(l,2),s=n(d),c=n(s,!0);r(s);var w=i(s,4);{var y=e=>{var a=he(),v=n(a,!0);r(a),M(()=>k(v,t(h))),x(e,a)};R(w,e=>{t(h)&&e(y)})}r(d),r(vt);var N=i(vt,2),P=n(N);{var pt=e=>{var a=Ae(),v=Q(a),m=i(n(v),2),xt=n(m);de(xt,{get value(){return t(p).composite},scale:100,decimals:0,suffix:"%"}),r(m),r(v);var W=i(v,2);pe(W,()=>t(et),E=>{$t(E,{get novelty(){return t(p).channels.novelty},get arousal(){return t(p).channels.arousal},get reward(){return t(p).channels.reward},get attention(){return t(p).channels.attention},size:"lg"})});var X=i(W,2);{var ft=E=>{var T=be(),B=n(T),Z=n(B);It(Z,{name:"sparkle",size:18}),St(2),r(B);var U=i(B,2),V=n(U),yt=i(V);{var Y=A=>{var J=we(),D=i(Q(J)),st=n(D,!0);r(D);var _t=i(D);M(()=>{k(st,t(ot).key),k(_t,` — ${K[t(ot).key].high??""}.`)}),x(A,J)};R(yt,A=>{t(ot)&&A(Y)})}r(U),r(T),M(A=>k(V,`Composite ${A??""}% > 60% threshold. `),[()=>(t(p).composite*100).toFixed(0)]),x(E,T)},gt=E=>{var T=Me(),B=n(T),Z=n(B);It(Z,{name:"close",size:18}),St(2),r(B);var U=i(B,2),V=n(U),yt=i(V);{var Y=A=>{var J=ke(),D=i(Q(J)),st=n(D,!0);r(D);var _t=i(D);M(()=>{k(st,t(it)),k(_t,` — ${K[t(it)].low??""}.`)}),x(A,J)};R(yt,A=>{t(it)&&A(Y)})}r(U),r(T),M(A=>k(V,`Composite ${A??""}% < 60% threshold. `),[()=>(t(p).composite*100).toFixed(0)]),x(E,T)};R(X,E=>{t(p).composite>.6?E(ft):E(gt,!1)})}x(e,a)},q=e=>{var a=Se(),v=n(a),m=n(v);It(m,{name:"importance",size:36}),r(v),St(4),r(a),x(e,a)};R(P,e=>{t(p)?e(pt):e(q,!1)})}r(N),Ft(N,e=>{var a;return(a=ce)==null?void 0:a(e)}),r(At),r(rt),Ft(rt,e=>{var a;return(a=Et)==null?void 0:a(e)});var mt=i(rt,2),ut=n(mt),qt=i(n(ut),2);r(ut);var Ht=i(ut,2);{var Kt=e=>{var a=Fe();tt(a,20,()=>Array(6),nt,(v,m)=>{var xt=Ce();x(v,xt)}),r(a),x(e,a)},Gt=e=>{var a=Ie(),v=n(a),m=n(v);It(m,{name:"importance",size:40}),r(v),St(4),r(a),x(e,a)},Wt=e=>{var a=je();tt(a,23,()=>t(L),v=>v.id,(v,m,xt)=>{const W=g(()=>kt[t(m).id]);var X=Te(),ft=n(X),gt=n(ft),E=n(gt),T=i(E,2),B=n(T,!0);r(T);var Z=i(T,4),U=n(Z);r(Z);var V=i(Z,2);{var yt=S=>{var z=Ne(),O=i(Q(z),2),ht=n(O);r(O),M(()=>k(ht,`${t(m).reviewCount??""} reviews`)),x(S,z)};R(V,S=>{t(m).reviewCount&&S(yt)})}r(gt);var Y=i(gt,2),A=n(Y,!0);r(Y);var J=i(Y,2);{var D=S=>{var z=Ee();tt(z,21,()=>t(m).tags.slice(0,4),nt,(O,ht)=>{var b=Pe(),Xt=n(b,!0);r(b),M(()=>k(Xt,t(ht))),x(O,b)}),r(z),x(S,z)};R(J,S=>{t(m).tags.length>0&&S(D)})}r(ft);var st=i(ft,2),_t=n(st);{let S=g(()=>{var b;return((b=t(W))==null?void 0:b.novelty)??0}),z=g(()=>{var b;return((b=t(W))==null?void 0:b.arousal)??0}),O=g(()=>{var b;return((b=t(W))==null?void 0:b.reward)??0}),ht=g(()=>{var b;return((b=t(W))==null?void 0:b.attention)??0});$t(_t,{get novelty(){return t(S)},get arousal(){return t(z)},get reward(){return t(O)},get attention(){return t(ht)},size:"sm"})}r(st),r(X),Ft(X,(S,z)=>{var O;return(O=Et)==null?void 0:O(S,z)},()=>({delay:t(xt)*45})),M(S=>{ae(E,`background: ${(oe[t(m).nodeType]||"#8B95A5")??""}`),k(B,t(m).nodeType),k(U,`${S??""}% retention`),k(A,t(m).content)},[()=>(t(m).retentionStrength*100).toFixed(0)]),Ct("click",X,()=>Mt(t(m).id)),x(v,X)}),r(a),x(e,a)};R(Ht,e=>{t(lt)?e(Kt):t(L).length===0?e(Gt,1):e(Wt,!1)})}r(mt),Ft(mt,e=>{var a;return(a=Et)==null?void 0:a(e)}),r(G),M(e=>{s.disabled=e,k(c,t($)?"Scoring…":"Score Importance")},[()=>t($)||!t(f).trim()]),Ct("keydown",l,Pt),re(l,()=>t(f),e=>F(f,e)),Ct("click",s,at),Ct("click",qt,dt),x(o,G),Dt()}te(["keydown","click"]);export{ea as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js.br b/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js.br deleted file mode 100644 index 6805664..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js.gz b/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js.gz deleted file mode 100644 index 2a3ee30..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/12.CO2CXIFj.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js b/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js new file mode 100644 index 0000000..e263010 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js @@ -0,0 +1,8 @@ +import"../chunks/Bzak7iHL.js";import{o as Lt}from"../chunks/JVtQszIZ.js";import{p as Dt,i as S,e as n,t as k,g as t,a as x,h as i,u as g,r,b as Bt,s as O,c as Rt,f as Q,av as bt,d as Tt,j as y,aa as Gt,k as Ut,n as St}from"../chunks/CW7md74C.js";import{s as b,d as Vt,a as Ct}from"../chunks/D90q9c2i.js";import{i as T}from"../chunks/9-jplUL5.js";import{k as Yt}from"../chunks/DsfUoj8c.js";import{e as tt,a as m,i as nt}from"../chunks/Cc0l8Nd4.js";import{a as Ft,r as zt}from"../chunks/D8RjhgN0.js";import{s as Jt}from"../chunks/BNUnVJrY.js";import{b as Qt}from"../chunks/CFefTDKL.js";import{g as te}from"../chunks/Dm3aSj4w.js";import{b as ee}from"../chunks/CaEJGM7b.js";import{a as Nt}from"../chunks/C-rZhKee.js";import{N as ae}from"../chunks/CcUbQ_Wl.js";import{p as re}from"../chunks/BjbQ7qSx.js";import{P as se}from"../chunks/DTO0IjuV.js";import{A as ne}from"../chunks/CaR6YsRq.js";import{I as It}from"../chunks/CqwrgJOn.js";import{s as oe}from"../chunks/DPdYG9yN.js";function Pt(o){return o==null||!Number.isFinite(o)||o<0?0:o>1?1:o}function ie(o){return{novelty:Pt(o==null?void 0:o.novelty),arousal:Pt(o==null?void 0:o.arousal),reward:Pt(o==null?void 0:o.reward),attention:Pt(o==null?void 0:o.attention)}}const $t={sm:80,md:180,lg:320};function Ot(o){return o&&(o==="sm"||o==="md"||o==="lg")?$t[o]:$t.md}const wt=[{key:"novelty",angle:-Math.PI/2},{key:"arousal",angle:0},{key:"reward",angle:Math.PI/2},{key:"attention",angle:Math.PI}];function le(o){const z=Ot(o);let f;switch(o){case"lg":f=44;break;case"sm":f=4;break;default:f=28}return Math.max(0,z/2-f)}var de=bt(''),ce=bt(''),ve=bt(''),pe=bt(' ',1),me=bt('');function jt(o,z){Dt(z,!0);let f=re(z,"size",3,"md"),u=g(()=>Ot(f())),H=g(()=>f()!=="sm"),K=g(()=>le(f())),et=g(()=>t(u)/2),at=g(()=>t(u)/2);const Et={novelty:"Novelty",arousal:"Arousal",reward:"Reward",attention:"Attention"};let C=g(()=>ie({novelty:z.novelty,arousal:z.arousal,reward:z.reward,attention:z.attention}));function q(l,d){const s=l*t(K);return[t(et)+Math.cos(d)*s,t(at)+Math.sin(d)*s]}const ot=[.25,.5,.75,1];function it(l){return wt.map(({angle:s})=>q(l,s)).map((s,c)=>`${c===0?"M":"L"}${s[0].toFixed(2)},${s[1].toFixed(2)}`).join(" ")+" Z"}let $=O(0);Lt(()=>{const d=performance.now();let s=0;const c=h=>{const _=Math.min(1,(h-d)/600);S($,1-Math.pow(1-_,3)),_<1&&(s=requestAnimationFrame(c))};return s=requestAnimationFrame(c),()=>cancelAnimationFrame(s)});let lt=g(()=>{const l=t($);return wt.map(({key:s,angle:c})=>q(t(C)[s]*l,c)).map((s,c)=>`${c===0?"M":"L"}${s[0].toFixed(2)},${s[1].toFixed(2)}`).join(" ")+" Z"});function kt(l){const d=t(K)+(f()==="lg"?18:12),s=t(et)+Math.cos(l)*d,c=t(at)+Math.sin(l)*d;let h="middle";return Math.abs(Math.cos(l))>.5&&(h=Math.cos(l)>0?"start":"end"),{x:s,y:c,anchor:h}}var N=me(),dt=n(N);tt(dt,17,()=>ot,nt,(l,d)=>{var s=de();k(c=>{m(s,"d",c),m(s,"stroke-opacity",t(d)===1?.45:.18),m(s,"stroke-width",t(d)===1?1:.75)},[()=>it(t(d))]),x(l,s)});var Mt=i(dt);tt(Mt,17,()=>wt,nt,(l,d)=>{const s=g(()=>{const[h,_]=q(1,t(d).angle);return{x:h,y:_}});var c=ce();k(()=>{m(c,"x1",t(et)),m(c,"y1",t(at)),m(c,"x2",t(s).x),m(c,"y2",t(s).y)}),x(l,c)});var W=i(Mt),ct=i(W);{var rt=l=>{var d=Rt(),s=Q(d);tt(s,17,()=>wt,nt,(c,h)=>{const _=g(()=>{const[I,pt]=q(t(C)[t(h).key]*t($),t(h).angle);return{px:I,py:pt}});var F=ve();k(()=>{m(F,"cx",t(_).px),m(F,"cy",t(_).py),m(F,"r",f()==="lg"?3:2.25)}),x(c,F)}),x(l,d)};T(ct,l=>{f()!=="sm"&&l(rt)})}var At=i(ct);{var vt=l=>{var d=Rt(),s=Q(d);tt(s,17,()=>wt,nt,(c,h)=>{const _=g(()=>kt(t(h).angle));var F=pe(),I=Q(F),pt=n(I);r(I);var B=i(I),mt=n(B,!0);r(B),k(ut=>{m(I,"x",t(_).x),m(I,"y",t(_).y),m(I,"text-anchor",t(_).anchor),m(I,"font-size",f()==="lg"?12:10),b(pt,`${ut??""}%`),m(B,"x",t(_).x),m(B,"y",t(_).y+(f()==="lg"?14:11)),m(B,"text-anchor",t(_).anchor),m(B,"font-size",f()==="lg"?10:8.5),b(mt,Et[t(h).key])},[()=>(t(C)[t(h).key]*100).toFixed(0)]),x(c,F)}),x(l,d)};T(At,l=>{t(H)&&l(vt)})}r(N),k((l,d,s,c)=>{m(N,"width",t(u)),m(N,"height",t(u)),m(N,"viewBox",`0 0 ${t(u)??""} ${t(u)??""}`),m(N,"aria-label",`Importance radar: novelty ${l??""}%, arousal ${d??""}%, reward ${s??""}%, attention ${c??""}%`),m(W,"d",t(lt)),m(W,"stroke-width",f()==="sm"?1:1.5)},[()=>(t(C).novelty*100).toFixed(0),()=>(t(C).arousal*100).toFixed(0),()=>(t(C).reward*100).toFixed(0),()=>(t(C).attention*100).toFixed(0)]),x(o,N),Bt()}var ue=y(' '),xe=y('Driven by ',1),fe=y('
        Save

        '),ge=y('Weakest channel: ',1),_e=y('
        Skip

        '),ye=y('
        Composite
        ',1),he=y(`

        Type some content above to score its importance.

        Composite = 0.25·novelty + 0.30·arousal + 0.25·reward + 0.20·attention. + Threshold for save: 60%.

        `),we=y('
        '),be=y('
        '),ke=y(`

        No standout memories yet

        As you capture decisions, wins, and discoveries, the most important ones + will rise to the top here — ranked by retention, reviews, and recency.

        `),Me=y('· ',1),Ae=y(' '),Se=y('
        '),Ce=y(``),Fe=y('
        '),Ie=y(`

        Test Importance

        Paste any content below. Vestige scores it across 4 channels and + decides whether it is worth saving.

        ⌘/Ctrl + Enter

        Top Important Memories This Week

        Ranked by retention × reviews ÷ age. Click any card to open it.

        `);function Ue(o,z){Dt(z,!0);let f=O(""),u=O(null),H=O(!1),K=O(null),et=O(0);async function at(){const e=t(f).trim();if(!(!e||t(H))){S(H,!0),S(K,null);try{S(u,await Nt.importance(e),!0),Gt(et)}catch(a){S(K,a instanceof Error?a.message:String(a),!0),S(u,null)}finally{S(H,!1)}}}function Et(e){(e.metaKey||e.ctrlKey)&&e.key==="Enter"&&(e.preventDefault(),at())}const C={novelty:.25,arousal:.3,reward:.25,attention:.2},q={novelty:{high:"new information not already in your graph",low:"overlaps heavily with what you already know"},arousal:{high:"emotionally salient — decisions, bugs, or discoveries stick",low:"neutral tone, no strong affect signal"},reward:{high:"high reward value — preferences, wins, or solutions you will revisit",low:"low reward value — transient or incidental detail"},attention:{high:"strong attentional markers (imperatives, questions, urgency)",low:"passive phrasing, no clear attentional hook"}};let ot=g(()=>t(u)?Object.keys(C).map(a=>({key:a,contribution:t(u).channels[a]*C[a]})).sort((a,v)=>v.contribution-a.contribution)[0]:null),it=g(()=>t(u)?Object.keys(C).slice().sort((e,a)=>t(u).channels[e]-t(u).channels[a])[0]:null),$=O(Tt([])),lt=O(!0),kt=Tt({});function N(e){const a=Math.max(1,(Date.now()-new Date(e.createdAt).getTime())/864e5),v=e.reviewCount??0,p=1/Math.pow(a,.5);return e.retentionStrength*Math.log1p(v+1)*p}async function dt(){S(lt,!0);try{const a=(await Nt.memories.list({limit:"20"})).memories.slice().sort((v,p)=>N(p)-N(v)).slice(0,20);S($,a,!0),t($).forEach(async v=>{try{const p=await Nt.importance(v.content);kt[v.id]=p.channels}catch{}})}catch{S($,[],!0)}finally{S(lt,!1)}}Lt(dt);function Mt(e){te(`${ee}/memories`)}var W=Ie(),ct=n(W);se(ct,{icon:"importance",title:"Importance Radar",subtitle:"4-channel importance model: Novelty · Arousal · Reward · Attention",accent:"warning"});var rt=i(ct,2),At=i(n(rt),2),vt=n(At),l=n(vt);Ut(l);var d=i(l,2),s=n(d),c=n(s,!0);r(s);var h=i(s,4);{var _=e=>{var a=ue(),v=n(a,!0);r(a),k(()=>b(v,t(K))),x(e,a)};T(h,e=>{t(K)&&e(_)})}r(d),r(vt);var F=i(vt,2),I=n(F);{var pt=e=>{var a=ye(),v=Q(a),p=i(n(v),2),xt=n(p);ne(xt,{get value(){return t(u).composite},scale:100,decimals:0,suffix:"%"}),r(p),r(v);var X=i(v,2);Yt(X,()=>t(et),P=>{jt(P,{get novelty(){return t(u).channels.novelty},get arousal(){return t(u).channels.arousal},get reward(){return t(u).channels.reward},get attention(){return t(u).channels.attention},size:"lg"})});var Z=i(X,2);{var ft=P=>{var E=fe(),j=n(E),G=n(j);It(G,{name:"sparkle",size:18}),St(2),r(j);var U=i(j,2),V=n(U),_t=i(V);{var Y=M=>{var J=xe(),L=i(Q(J)),st=n(L,!0);r(L);var yt=i(L);k(()=>{b(st,t(ot).key),b(yt,` — ${q[t(ot).key].high??""}.`)}),x(M,J)};T(_t,M=>{t(ot)&&M(Y)})}r(U),r(E),k(M=>b(V,`Composite ${M??""}% > 60% threshold. `),[()=>(t(u).composite*100).toFixed(0)]),x(P,E)},gt=P=>{var E=_e(),j=n(E),G=n(j);It(G,{name:"close",size:18}),St(2),r(j);var U=i(j,2),V=n(U),_t=i(V);{var Y=M=>{var J=ge(),L=i(Q(J)),st=n(L,!0);r(L);var yt=i(L);k(()=>{b(st,t(it)),b(yt,` — ${q[t(it)].low??""}.`)}),x(M,J)};T(_t,M=>{t(it)&&M(Y)})}r(U),r(E),k(M=>b(V,`Composite ${M??""}% < 60% threshold. `),[()=>(t(u).composite*100).toFixed(0)]),x(P,E)};T(Z,P=>{t(u).composite>.6?P(ft):P(gt,!1)})}x(e,a)},B=e=>{var a=he(),v=n(a),p=n(v);It(p,{name:"importance",size:36}),r(v),St(4),r(a),x(e,a)};T(I,e=>{t(u)?e(pt):e(B,!1)})}r(F),Ft(F,e=>{var a;return(a=oe)==null?void 0:a(e)}),r(At),r(rt),Ft(rt,e=>{var a;return(a=zt)==null?void 0:a(e)});var mt=i(rt,2),ut=n(mt),Ht=i(n(ut),2);r(ut);var Kt=i(ut,2);{var qt=e=>{var a=be();tt(a,20,()=>Array(6),nt,(v,p)=>{var xt=we();x(v,xt)}),r(a),x(e,a)},Wt=e=>{var a=ke(),v=n(a),p=n(v);It(p,{name:"importance",size:40}),r(v),St(4),r(a),x(e,a)},Xt=e=>{var a=Fe();tt(a,23,()=>t($),v=>v.id,(v,p,xt)=>{const X=g(()=>kt[t(p).id]);var Z=Ce(),ft=n(Z),gt=n(ft),P=n(gt),E=i(P,2),j=n(E,!0);r(E);var G=i(E,4),U=n(G);r(G);var V=i(G,2);{var _t=A=>{var R=Me(),D=i(Q(R),2),ht=n(D);r(D),k(()=>b(ht,`${t(p).reviewCount??""} reviews`)),x(A,R)};T(V,A=>{t(p).reviewCount&&A(_t)})}r(gt);var Y=i(gt,2),M=n(Y,!0);r(Y);var J=i(Y,2);{var L=A=>{var R=Se();tt(R,21,()=>t(p).tags.slice(0,4),nt,(D,ht)=>{var w=Ae(),Zt=n(w,!0);r(w),k(()=>b(Zt,t(ht))),x(D,w)}),r(R),x(A,R)};T(J,A=>{t(p).tags.length>0&&A(L)})}r(ft);var st=i(ft,2),yt=n(st);{let A=g(()=>{var w;return((w=t(X))==null?void 0:w.novelty)??0}),R=g(()=>{var w;return((w=t(X))==null?void 0:w.arousal)??0}),D=g(()=>{var w;return((w=t(X))==null?void 0:w.reward)??0}),ht=g(()=>{var w;return((w=t(X))==null?void 0:w.attention)??0});jt(yt,{get novelty(){return t(A)},get arousal(){return t(R)},get reward(){return t(D)},get attention(){return t(ht)},size:"sm"})}r(st),r(Z),Ft(Z,(A,R)=>{var D;return(D=zt)==null?void 0:D(A,R)},()=>({delay:t(xt)*45})),k(A=>{Jt(P,`background: ${(ae[t(p).nodeType]||"#8B95A5")??""}`),b(j,t(p).nodeType),b(U,`${A??""}% retention`),b(M,t(p).content)},[()=>(t(p).retentionStrength*100).toFixed(0)]),Ct("click",Z,()=>Mt(t(p).id)),x(v,Z)}),r(a),x(e,a)};T(Kt,e=>{t(lt)?e(qt):t($).length===0?e(Wt,1):e(Xt,!1)})}r(mt),Ft(mt,e=>{var a;return(a=zt)==null?void 0:a(e)}),r(W),k(e=>{s.disabled=e,b(c,t(H)?"Scoring…":"Score Importance")},[()=>t(H)||!t(f).trim()]),Ct("keydown",l,Et),Qt(l,()=>t(f),e=>S(f,e)),Ct("click",s,at),Ct("click",Ht,dt),x(o,W),Bt()}Vt(["keydown","click"]);export{Ue as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js.br b/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js.br new file mode 100644 index 0000000..84bd120 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js.gz b/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js.gz new file mode 100644 index 0000000..3b61593 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/12.CiFT6kL_.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js.br b/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js.br deleted file mode 100644 index cecfd72..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js.gz b/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js.gz deleted file mode 100644 index 0ffa50a..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js b/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js similarity index 61% rename from apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js rename to apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js index 4b6d8fb..278d493 100644 --- a/apps/dashboard/build/_app/immutable/nodes/13.BQoci-vM.js +++ b/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js @@ -1 +1 @@ -import"../chunks/Bzak7iHL.js";import{o as ke}from"../chunks/TZu9D97Z.js";import{p as Ae,s as C,d as ae,a as o,b as De,g as r,j as d,e as i,i as D,h as l,n as X,r as a,t as y,u as Ie}from"../chunks/wpu9U-D0.js";import{s as u}from"../chunks/D8mhvFt8.js";import{i as S}from"../chunks/DKve45Wd.js";import{e as F,i as q,s as se}from"../chunks/60_R_Vbt.js";import{a as L,r as re}from"../chunks/P1-U_Xsj.js";import{a as ie}from"../chunks/CZfHMhLI.js";import{P as Ne}from"../chunks/BHDZZvku.js";import{D as Oe}from"../chunks/CmbJHhgy.js";import{I as M}from"../chunks/D7A-gG4Z.js";import{A as Te}from"../chunks/DcKTNC6e.js";import{s as ne}from"../chunks/DPdYG9yN.js";var je=d(' intentions'),Ce=d('
        '),Fe=d('
        '),Le=d('

        '),Me=d(' '),Ue=d(' '),Ve=d('

        '),We=d('
        '),Ye=d('
        '),Be=d('
        '),Ee=d(`

        No predictions yet — keep using Vestige and the predictive model will start surfacing what you'll reach for next.

        `),Ge=d(' '),He=d(' '),Je=d('

        '),Xe=d('
        '),qe=d('

        Prospective Memory

        "Remember to do X when Y happens"

        Predicted Needs

        What you might need next
        ');function vt(le,oe){Ae(oe,!0);let I=C(ae([])),U=C(ae([])),N=C(!0),R=C("active");const de={active:"text-synapse-glow bg-synapse/10 border-synapse/30",fulfilled:"text-recall bg-recall/10 border-recall/30",cancelled:"text-dim bg-white/[0.03] border-subtle/20",snoozed:"text-dream-glow bg-dream/10 border-dream/30"},ve={4:"critical",3:"high",2:"normal",1:"low"},ce={4:"text-decay",3:"text-amber-400",2:"text-dim",1:"text-muted"},pe={time:"schedule",context:"graph",event:"pulse",manual:"intentions"},me=[{value:"active",label:"Active",color:"#6366f1"},{value:"fulfilled",label:"Fulfilled",color:"#10b981"},{value:"snoozed",label:"Snoozed",color:"#a78bfa"},{value:"cancelled",label:"Cancelled",color:"#8B95A5"},{value:"all",label:"All",color:"#00D4FF"}];function xe(s){let t;try{const e=JSON.parse(s.trigger_data||"{}");if(typeof e.condition=="string"&&e.condition)t=e.condition;else if(typeof e.topic=="string"&&e.topic)t=e.topic;else if(typeof e.at=="string"&&e.at)try{t=new Date(e.at).toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{t=e.at}else if(typeof e.in_minutes=="number")t=`in ${e.in_minutes} min`;else if(typeof e.inMinutes=="number")t=`in ${e.inMinutes} min`;else if(typeof e.codebase=="string"&&e.codebase){const n=typeof e.filePattern=="string"&&e.filePattern?`/${e.filePattern}`:"";t=`${e.codebase}${n}`}else t=s.trigger_type}catch{t=s.trigger_type}return t.length>40?t.slice(0,37)+"...":t}ke(async()=>{await K()});async function K(){D(N,!0);try{const[s,t]=await Promise.all([ie.intentions(r(R)),ie.predict()]);D(I,s.intentions||[],!0),D(U,t.predictions||[],!0)}catch{}finally{D(N,!1)}}async function ue(s){D(R,s,!0),await K()}function V(s){if(!s)return"";try{return new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}var W=qe(),Q=i(W);Ne(Q,{icon:"intentions",title:"Intentions & Predictions",subtitle:"Prospective memory and the needs Vestige sees coming",accent:"memory",children:(s,t)=>{var e=je(),n=i(e);Te(n,{get value(){return r(I).length}}),X(),a(e),o(s,e)},$$slots:{default:!0}});var Y=l(Q,2),B=i(Y),_e=l(i(B),2);Oe(_e,{get options(){return me},get value(){return r(R)},label:"Status",icon:"filter",onChange:ue}),a(B);var fe=l(B,2);{var ge=s=>{var t=Fe();F(t,20,()=>Array(4),q,(e,n)=>{var _=Ce();o(e,_)}),a(t),o(s,t)},ye=s=>{var t=Le(),e=i(t),n=i(e);M(n,{name:"intentions",size:44,strokeWidth:1.2}),a(e);var _=l(e,2),m=i(_);a(_),a(t),y(()=>u(m,`No ${r(R)==="all"?"":r(R)+" "}intentions yet — say "Remind me…" in conversation and Vestige will hold the thought for you.`)),o(s,t)},he=s=>{var t=We();F(t,23,()=>r(I),e=>e.id,(e,n,_)=>{var m=Ve(),$=i(m),h=i($),O=i(h);{let c=Ie(()=>pe[r(n).trigger_type]||"intentions");M(O,{get name(){return r(c)},size:18})}a(h);var g=l(h,2),k=i(g),T=i(k,!0);a(k);var b=l(k,2),w=i(b),j=i(w,!0);a(w);var z=l(w,2),G=i(z);a(z);var A=l(z,2),x=i(A);a(A);var v=l(A,2);{var f=c=>{var p=Me(),P=i(p);a(p),y(J=>u(P,`deadline: ${J??""}`),[()=>V(r(n).deadline)]),o(c,p)};S(v,c=>{r(n).deadline&&c(f)})}var H=l(v,2);{var Re=c=>{var p=Ue(),P=i(p);a(p),y(J=>u(P,`snoozed until ${J??""}`),[()=>V(r(n).snoozed_until)]),o(c,p)};S(H,c=>{r(n).snoozed_until&&c(Re)})}a(b),a(g);var te=l(g,2),$e=i(te,!0);a(te),a($),a(m),L(m,(c,p)=>{var P;return(P=re)==null?void 0:P(c,p)},()=>({delay:Math.min(r(_)*35,350),y:12})),L(m,c=>{var p;return(p=ne)==null?void 0:p(c)}),y((c,p)=>{u(T,r(n).content),se(w,1,`px-2 py-0.5 text-[10px] rounded-lg border ${(de[r(n).status]||"text-dim bg-white/[0.03] border-subtle/20")??""}`),u(j,r(n).status),se(z,1,`text-[10px] ${(ce[r(n).priority]||"text-muted")??""}`),u(G,`${(ve[r(n).priority]||"normal")??""} priority`),u(x,`${r(n).trigger_type??""}: ${c??""}`),u($e,p)},[()=>xe(r(n)),()=>V(r(n).created_at)]),o(e,m)}),a(t),o(s,t)};S(fe,s=>{r(N)?s(ge):r(I).length===0?s(ye,1):s(he,!1)})}a(Y);var Z=l(Y,2),E=i(Z),ee=i(E),be=i(ee);M(be,{name:"sparkle",size:16}),a(ee),X(4),a(E);var we=l(E,2);{var ze=s=>{var t=Be();F(t,20,()=>Array(3),q,(e,n)=>{var _=Ye();o(e,_)}),a(t),o(s,t)},Pe=s=>{var t=Ee(),e=i(t),n=i(e);M(n,{name:"sparkle",size:40,strokeWidth:1.2}),a(e),X(2),a(t),o(s,t)},Se=s=>{var t=Xe();F(t,21,()=>r(U),q,(e,n,_)=>{var m=Je(),$=i(m),h=i($);h.textContent=_+1;var O=l(h,2),g=i(O),k=i(g,!0);a(g);var T=l(g,2),b=i(T),w=i(b,!0);a(b);var j=l(b,2);{var z=x=>{var v=Ge(),f=i(v);a(v),y(H=>u(f,`${H??""}% retention`),[()=>(Number(r(n).retention)*100).toFixed(0)]),o(x,v)};S(j,x=>{r(n).retention&&x(z)})}var G=l(j,2);{var A=x=>{var v=He(),f=i(v);a(v),y(()=>u(f,`${r(n).predictedNeed??""} need`)),o(x,v)};S(G,x=>{r(n).predictedNeed&&x(A)})}a(T),a(O),a($),a(m),L(m,(x,v)=>{var f;return(f=re)==null?void 0:f(x,v)},()=>({delay:Math.min(_*35,350),y:12})),L(m,x=>{var v;return(v=ne)==null?void 0:v(x)}),y(()=>{u(k,r(n).content),u(w,r(n).nodeType)}),o(e,m)}),a(t),o(s,t)};S(we,s=>{r(N)?s(ze):r(U).length===0?s(Pe,1):s(Se,!1)})}a(Z),a(W),o(le,W),De()}export{vt as component}; +import"../chunks/Bzak7iHL.js";import{o as ke}from"../chunks/JVtQszIZ.js";import{p as Ae,s as C,d as ae,a as o,b as De,j as d,e as r,i as D,g as i,n as X,r as a,h as l,t as y,u as Ie}from"../chunks/CW7md74C.js";import{s as u}from"../chunks/D90q9c2i.js";import{i as S}from"../chunks/9-jplUL5.js";import{e as F,i as q,s as se}from"../chunks/Cc0l8Nd4.js";import{a as L,r as re}from"../chunks/D8RjhgN0.js";import{a as ie}from"../chunks/C-rZhKee.js";import{P as Ne}from"../chunks/DTO0IjuV.js";import{D as Oe}from"../chunks/DUAsElMg.js";import{I as M}from"../chunks/CqwrgJOn.js";import{A as Te}from"../chunks/CaR6YsRq.js";import{s as ne}from"../chunks/DPdYG9yN.js";var je=d(' intentions'),Ce=d('
        '),Fe=d('
        '),Le=d('

        '),Me=d(' '),Ue=d(' '),Ve=d('

        '),We=d('
        '),Ye=d('
        '),Be=d('
        '),Ee=d(`

        No predictions yet — keep using Vestige and the predictive model will start surfacing what you'll reach for next.

        `),Ge=d(' '),He=d(' '),Je=d('

        '),Xe=d('
        '),qe=d('

        Prospective Memory

        "Remember to do X when Y happens"

        Predicted Needs

        What you might need next
        ');function vt(le,oe){Ae(oe,!0);let I=C(ae([])),U=C(ae([])),N=C(!0),R=C("active");const de={active:"text-synapse-glow bg-synapse/10 border-synapse/30",fulfilled:"text-recall bg-recall/10 border-recall/30",cancelled:"text-dim bg-white/[0.03] border-subtle/20",snoozed:"text-dream-glow bg-dream/10 border-dream/30"},ve={4:"critical",3:"high",2:"normal",1:"low"},ce={4:"text-decay",3:"text-amber-400",2:"text-dim",1:"text-muted"},pe={time:"schedule",context:"graph",event:"pulse",manual:"intentions"},me=[{value:"active",label:"Active",color:"#6366f1"},{value:"fulfilled",label:"Fulfilled",color:"#10b981"},{value:"snoozed",label:"Snoozed",color:"#a78bfa"},{value:"cancelled",label:"Cancelled",color:"#8B95A5"},{value:"all",label:"All",color:"#00D4FF"}];function xe(s){let t;try{const e=JSON.parse(s.trigger_data||"{}");if(typeof e.condition=="string"&&e.condition)t=e.condition;else if(typeof e.topic=="string"&&e.topic)t=e.topic;else if(typeof e.at=="string"&&e.at)try{t=new Date(e.at).toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{t=e.at}else if(typeof e.in_minutes=="number")t=`in ${e.in_minutes} min`;else if(typeof e.inMinutes=="number")t=`in ${e.inMinutes} min`;else if(typeof e.codebase=="string"&&e.codebase){const n=typeof e.filePattern=="string"&&e.filePattern?`/${e.filePattern}`:"";t=`${e.codebase}${n}`}else t=s.trigger_type}catch{t=s.trigger_type}return t.length>40?t.slice(0,37)+"...":t}ke(async()=>{await K()});async function K(){D(N,!0);try{const[s,t]=await Promise.all([ie.intentions(i(R)),ie.predict()]);D(I,s.intentions||[],!0),D(U,t.predictions||[],!0)}catch{}finally{D(N,!1)}}async function ue(s){D(R,s,!0),await K()}function V(s){if(!s)return"";try{return new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}var W=qe(),Q=r(W);Ne(Q,{icon:"intentions",title:"Intentions & Predictions",subtitle:"Prospective memory and the needs Vestige sees coming",accent:"memory",children:(s,t)=>{var e=je(),n=r(e);Te(n,{get value(){return i(I).length}}),X(),a(e),o(s,e)},$$slots:{default:!0}});var Y=l(Q,2),B=r(Y),_e=l(r(B),2);Oe(_e,{get options(){return me},get value(){return i(R)},label:"Status",icon:"filter",onChange:ue}),a(B);var fe=l(B,2);{var ge=s=>{var t=Fe();F(t,20,()=>Array(4),q,(e,n)=>{var _=Ce();o(e,_)}),a(t),o(s,t)},ye=s=>{var t=Le(),e=r(t),n=r(e);M(n,{name:"intentions",size:44,strokeWidth:1.2}),a(e);var _=l(e,2),m=r(_);a(_),a(t),y(()=>u(m,`No ${i(R)==="all"?"":i(R)+" "}intentions yet — say "Remind me…" in conversation and Vestige will hold the thought for you.`)),o(s,t)},he=s=>{var t=We();F(t,23,()=>i(I),e=>e.id,(e,n,_)=>{var m=Ve(),$=r(m),h=r($),O=r(h);{let c=Ie(()=>pe[i(n).trigger_type]||"intentions");M(O,{get name(){return i(c)},size:18})}a(h);var g=l(h,2),k=r(g),T=r(k,!0);a(k);var b=l(k,2),w=r(b),j=r(w,!0);a(w);var z=l(w,2),G=r(z);a(z);var A=l(z,2),x=r(A);a(A);var v=l(A,2);{var f=c=>{var p=Me(),P=r(p);a(p),y(J=>u(P,`deadline: ${J??""}`),[()=>V(i(n).deadline)]),o(c,p)};S(v,c=>{i(n).deadline&&c(f)})}var H=l(v,2);{var Re=c=>{var p=Ue(),P=r(p);a(p),y(J=>u(P,`snoozed until ${J??""}`),[()=>V(i(n).snoozed_until)]),o(c,p)};S(H,c=>{i(n).snoozed_until&&c(Re)})}a(b),a(g);var te=l(g,2),$e=r(te,!0);a(te),a($),a(m),L(m,(c,p)=>{var P;return(P=re)==null?void 0:P(c,p)},()=>({delay:Math.min(i(_)*35,350),y:12})),L(m,c=>{var p;return(p=ne)==null?void 0:p(c)}),y((c,p)=>{u(T,i(n).content),se(w,1,`px-2 py-0.5 text-[10px] rounded-lg border ${(de[i(n).status]||"text-dim bg-white/[0.03] border-subtle/20")??""}`),u(j,i(n).status),se(z,1,`text-[10px] ${(ce[i(n).priority]||"text-muted")??""}`),u(G,`${(ve[i(n).priority]||"normal")??""} priority`),u(x,`${i(n).trigger_type??""}: ${c??""}`),u($e,p)},[()=>xe(i(n)),()=>V(i(n).created_at)]),o(e,m)}),a(t),o(s,t)};S(fe,s=>{i(N)?s(ge):i(I).length===0?s(ye,1):s(he,!1)})}a(Y);var Z=l(Y,2),E=r(Z),ee=r(E),be=r(ee);M(be,{name:"sparkle",size:16}),a(ee),X(4),a(E);var we=l(E,2);{var ze=s=>{var t=Be();F(t,20,()=>Array(3),q,(e,n)=>{var _=Ye();o(e,_)}),a(t),o(s,t)},Pe=s=>{var t=Ee(),e=r(t),n=r(e);M(n,{name:"sparkle",size:40,strokeWidth:1.2}),a(e),X(2),a(t),o(s,t)},Se=s=>{var t=Xe();F(t,21,()=>i(U),q,(e,n,_)=>{var m=Je(),$=r(m),h=r($);h.textContent=_+1;var O=l(h,2),g=r(O),k=r(g,!0);a(g);var T=l(g,2),b=r(T),w=r(b,!0);a(b);var j=l(b,2);{var z=x=>{var v=Ge(),f=r(v);a(v),y(H=>u(f,`${H??""}% retention`),[()=>(Number(i(n).retention)*100).toFixed(0)]),o(x,v)};S(j,x=>{i(n).retention&&x(z)})}var G=l(j,2);{var A=x=>{var v=He(),f=r(v);a(v),y(()=>u(f,`${i(n).predictedNeed??""} need`)),o(x,v)};S(G,x=>{i(n).predictedNeed&&x(A)})}a(T),a(O),a($),a(m),L(m,(x,v)=>{var f;return(f=re)==null?void 0:f(x,v)},()=>({delay:Math.min(_*35,350),y:12})),L(m,x=>{var v;return(v=ne)==null?void 0:v(x)}),y(()=>{u(k,i(n).content),u(w,i(n).nodeType)}),o(e,m)}),a(t),o(s,t)};S(we,s=>{i(N)?s(ze):i(U).length===0?s(Pe,1):s(Se,!1)})}a(Z),a(W),o(le,W),De()}export{vt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js.br b/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js.br new file mode 100644 index 0000000..30db7e3 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js.gz b/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js.gz new file mode 100644 index 0000000..c07810f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/13.H3l2YCsd.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js.br b/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js.br deleted file mode 100644 index 459d062..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js.gz b/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js.gz deleted file mode 100644 index 291263d..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js b/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js similarity index 95% rename from apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js rename to apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js index 53090b2..4dc296e 100644 --- a/apps/dashboard/build/_app/immutable/nodes/14.CDp0vmq1.js +++ b/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{o as We}from"../chunks/TZu9D97Z.js";import{p as Ye,s as B,d as $e,i as P,e as s,g as e,r as t,a as l,b as Ge,f as Je,h as v,t as k,u as oe,j as f,au as ne,n as st}from"../chunks/wpu9U-D0.js";import{d as Ke,s as D,a as y}from"../chunks/D8mhvFt8.js";import{i as q}from"../chunks/DKve45Wd.js";import{e as pe,i as Oe,a as V,r as ot,s as Ie}from"../chunks/60_R_Vbt.js";import{a as He,r as nt}from"../chunks/P1-U_Xsj.js";import{s as X}from"../chunks/EqHb-9AZ.js";import{b as it}from"../chunks/CnZzd20v.js";import{a as H}from"../chunks/CZfHMhLI.js";import{N as L}from"../chunks/CcUbQ_Wl.js";import{P as lt}from"../chunks/BHDZZvku.js";import{A as dt}from"../chunks/DcKTNC6e.js";import{D as qe}from"../chunks/CmbJHhgy.js";import{I as Qe}from"../chunks/D7A-gG4Z.js";import{s as ct}from"../chunks/DPdYG9yN.js";const vt={created:{label:"Created",color:"#10b981",glyph:"",kind:"ring"},accessed:{label:"Accessed",color:"#3b82f6",glyph:"",kind:"dot"},promoted:{label:"Promoted",color:"#10b981",glyph:"",kind:"arrow-up"},demoted:{label:"Demoted",color:"#f59e0b",glyph:"",kind:"arrow-down"},edited:{label:"Edited",color:"#facc15",glyph:"",kind:"pencil"},suppressed:{label:"Suppressed",color:"#a855f7",glyph:"",kind:"x"},dreamed:{label:"Dreamed",color:"#c084fc",glyph:"",kind:"star"},reconsolidated:{label:"Reconsolidated",color:"#ec4899",glyph:"",kind:"circle-arrow"}},_e=15;function pt(g){let p=0;for(let m=0;m>>0;return p}function ut(g){let p=g>>>0;return()=>(p=p*1664525+1013904223>>>0,p/4294967296)}function ft(g,p=Date.now(),m){if(!g)return[];const x=ut(pt(g)),S=8+Math.floor(x()*8);if(S<=0)return[];const C=[],E=p-(14+x()*21)*864e5;C.push({action:"created",timestamp:new Date(E).toISOString(),reason:"smart_ingest · prediction-error gate opened",triggered_by:"smart_ingest"});let F=E,i=.5+x()*.2;const N=["accessed","accessed","accessed","accessed","promoted","demoted","edited","dreamed","reconsolidated","suppressed"];for(let z=1;z.5?"search":"deep_reference";break}case"promoted":{const I=i;i=Math.min(1,i+.1),d.old_value=I,d.new_value=i,d.reason="confirmed helpful by user",d.triggered_by="memory(action=promote)";break}case"demoted":{const I=i;i=Math.max(0,i-.15),d.old_value=I,d.new_value=i,d.reason="user flagged as outdated",d.triggered_by="memory(action=demote)";break}case"edited":{d.reason="content refined, FSRS state preserved",d.triggered_by="memory(action=edit)";break}case"suppressed":{const I=i;i=Math.max(0,i-.08),d.old_value=I,d.new_value=i,d.reason="top-down inhibition (Anderson 2025)",d.triggered_by="suppress(dashboard)";break}case"dreamed":{const I=i;i=Math.min(1,i+.05),d.old_value=I,d.new_value=i,d.reason="replayed during dream consolidation",d.triggered_by="dream()";break}case"reconsolidated":{d.reason="edited within 5-min labile window (Nader)",d.triggered_by="reconsolidation-manager";break}case"created":d.triggered_by="smart_ingest";break}C.push(d)}return C.reverse()}function gt(g,p=Date.now()){const m=new Date(g).getTime(),x=Math.max(0,p-m),S=Math.floor(x/1e3);if(S<60)return`${S}s ago`;const C=Math.floor(S/60);if(C<60)return`${C}m ago`;const E=Math.floor(C/60);if(E<24)return`${E}h ago`;const F=Math.floor(E/24);if(F<30)return`${F}d ago`;const i=Math.floor(F/30);return i<12?`${i}mo ago`:`${Math.floor(i/12)}y ago`}function xt(g,p){const m=typeof g=="number"&&Number.isFinite(g),x=typeof p=="number"&&Number.isFinite(p);return!m&&!x?null:!m&&x?`set ${p.toFixed(2)}`:m&&!x?`was ${g.toFixed(2)}`:`${g.toFixed(2)} → ${p.toFixed(2)}`}function mt(g,p){return p||g.length<=_e?{visible:g,hiddenCount:Math.max(0,g.length-_e)}:{visible:g.slice(0,_e),hiddenCount:g.length-_e}}var bt=f('
        '),_t=f('
        '),ht=f('

        Audit trail failed to load.

        '),kt=f('

        No memory selected.

        '),yt=f('

        No audit events recorded yet.

        '),wt=f(''),Mt=f(''),Pt=ne(''),St=ne(''),At=ne(''),Tt=ne(''),Dt=ne(''),Ct=ne(''),Et=f(' '),Ft=f('
        '),Nt=f('
        '),It=f('
      • '),$t=f(''),Ot=f('
          ',1),Rt=f('
          ');function jt(g,p){Ye(p,!0);let m=B($e([])),x=B(!0),S=B(!1),C=B(!1);async function E(_){return ft(_,Date.now())}We(async()=>{if(!p.memoryId){P(m,[],!0),P(x,!1);return}try{P(m,await E(p.memoryId),!0)}catch{P(m,[],!0),P(S,!0)}finally{P(x,!1)}});const F=oe(()=>mt(e(m),e(C))),i=oe(()=>e(F).visible),N=oe(()=>e(F).hiddenCount);var z=Rt(),O=s(z);{var d=_=>{var w=_t();pe(w,20,()=>Array(5),Oe,(Q,Z)=>{var J=bt();l(Q,J)}),t(w),l(_,w)},I=_=>{var w=ht();l(_,w)},he=_=>{var w=kt();l(_,w)},ke=_=>{var w=yt();l(_,w)},ue=_=>{var w=Ot(),Q=Je(w);pe(Q,23,()=>e(i),(R,h)=>R.timestamp+h,(R,h,K)=>{const u=oe(()=>vt[e(h).action]),fe=oe(()=>xt(e(h).old_value,e(h).new_value));var ee=It(),te=s(ee),ye=s(te);{var we=a=>{var r=wt();k(()=>X(r,`background: ${e(u).color??""};`)),l(a,r)},c=a=>{var r=Mt();k(()=>X(r,`border-color: ${e(u).color??""}; background: transparent;`)),l(a,r)},M=a=>{var r=Pt();k(()=>V(r,"stroke",e(u).color)),l(a,r)},A=a=>{var r=St();k(()=>V(r,"stroke",e(u).color)),l(a,r)},n=a=>{var r=At();k(()=>V(r,"stroke",e(u).color)),l(a,r)},W=a=>{var r=Tt();k(()=>V(r,"stroke",e(u).color)),l(a,r)},j=a=>{var r=Dt();k(()=>V(r,"fill",e(u).color)),l(a,r)},ie=a=>{var r=Ct();k(()=>V(r,"stroke",e(u).color)),l(a,r)};q(ye,a=>{e(u).kind==="dot"?a(we):e(u).kind==="ring"?a(c,1):e(u).kind==="arrow-up"?a(M,2):e(u).kind==="arrow-down"?a(A,3):e(u).kind==="pencil"?a(n,4):e(u).kind==="x"?a(W,5):e(u).kind==="star"?a(j,6):e(u).kind==="circle-arrow"&&a(ie,7)})}t(te);var ae=v(te,2),U=s(ae),re=s(U),Y=s(re),Me=s(Y,!0);t(Y);var Pe=v(Y,2);{var ge=a=>{var r=Et(),b=s(r,!0);t(r),k(()=>D(b,e(h).triggered_by)),l(a,r)};q(Pe,a=>{e(h).triggered_by&&a(ge)})}t(re);var le=v(re,2),xe=s(le,!0);t(le),t(U);var se=v(U,2);{var Se=a=>{var r=Ft(),b=s(r);t(r),k(()=>D(b,`retention ${e(fe)??""}`)),l(a,r)};q(se,a=>{e(fe)&&a(Se)})}var me=v(se,2);{var Ae=a=>{var r=Nt(),b=s(r,!0);t(r),k(()=>D(b,e(h).reason)),l(a,r)};q(me,a=>{e(h).reason&&a(Ae)})}t(ae),t(ee),k((a,r)=>{X(ee,`animation-delay: ${e(K)*40}ms;`),X(te,`background: rgba(10,10,26,0.9); box-shadow: 0 0 10px ${e(u).color??""}88; border: 1px solid ${e(u).color??""};`),X(Y,`color: ${e(u).color??""};`),D(Me,e(u).label),V(le,"title",a),D(xe,r)},[()=>new Date(e(h).timestamp).toLocaleString(),()=>gt(e(h).timestamp)]),l(R,ee)}),t(Q);var Z=v(Q,2);{var J=R=>{var h=$t(),K=s(h,!0);t(h),k(()=>D(K,e(C)?"Hide older events":`Show ${e(N)} older event${e(N)===1?"":"s"}…`)),y("click",h,u=>{u.stopPropagation(),P(C,!e(C))}),l(R,h)};q(Z,R=>{e(N)>0&&R(J)})}l(_,w)};q(O,_=>{e(x)?_(d):e(S)?_(I,1):p.memoryId?e(m).length===0?_(ke,3):_(ue,!1):_(he,2)})}t(z),l(g,z),Ge()}Ke(["click"]);var Bt=f(' results'),Lt=f('
          '),zt=f('
          '),Ht=f('

          '),qt=f(' '),Qt=f('

          ',1),Wt=f('
          '),Yt=f('
          Content Audit Trail
          Promote Demote Suppress Delete
          '),Gt=f(''),Jt=f('
          '),Kt=f(`
          >>0;return p}function ut(g){let p=g>>>0;return()=>(p=p*1664525+1013904223>>>0,p/4294967296)}function ft(g,p=Date.now(),m){if(!g)return[];const x=ut(pt(g)),S=8+Math.floor(x()*8);if(S<=0)return[];const C=[],E=p-(14+x()*21)*864e5;C.push({action:"created",timestamp:new Date(E).toISOString(),reason:"smart_ingest · prediction-error gate opened",triggered_by:"smart_ingest"});let F=E,i=.5+x()*.2;const N=["accessed","accessed","accessed","accessed","promoted","demoted","edited","dreamed","reconsolidated","suppressed"];for(let z=1;z.5?"search":"deep_reference";break}case"promoted":{const I=i;i=Math.min(1,i+.1),d.old_value=I,d.new_value=i,d.reason="confirmed helpful by user",d.triggered_by="memory(action=promote)";break}case"demoted":{const I=i;i=Math.max(0,i-.15),d.old_value=I,d.new_value=i,d.reason="user flagged as outdated",d.triggered_by="memory(action=demote)";break}case"edited":{d.reason="content refined, FSRS state preserved",d.triggered_by="memory(action=edit)";break}case"suppressed":{const I=i;i=Math.max(0,i-.08),d.old_value=I,d.new_value=i,d.reason="top-down inhibition (Anderson 2025)",d.triggered_by="suppress(dashboard)";break}case"dreamed":{const I=i;i=Math.min(1,i+.05),d.old_value=I,d.new_value=i,d.reason="replayed during dream consolidation",d.triggered_by="dream()";break}case"reconsolidated":{d.reason="edited within 5-min labile window (Nader)",d.triggered_by="reconsolidation-manager";break}case"created":d.triggered_by="smart_ingest";break}C.push(d)}return C.reverse()}function gt(g,p=Date.now()){const m=new Date(g).getTime(),x=Math.max(0,p-m),S=Math.floor(x/1e3);if(S<60)return`${S}s ago`;const C=Math.floor(S/60);if(C<60)return`${C}m ago`;const E=Math.floor(C/60);if(E<24)return`${E}h ago`;const F=Math.floor(E/24);if(F<30)return`${F}d ago`;const i=Math.floor(F/30);return i<12?`${i}mo ago`:`${Math.floor(i/12)}y ago`}function xt(g,p){const m=typeof g=="number"&&Number.isFinite(g),x=typeof p=="number"&&Number.isFinite(p);return!m&&!x?null:!m&&x?`set ${p.toFixed(2)}`:m&&!x?`was ${g.toFixed(2)}`:`${g.toFixed(2)} → ${p.toFixed(2)}`}function mt(g,p){return p||g.length<=_e?{visible:g,hiddenCount:Math.max(0,g.length-_e)}:{visible:g.slice(0,_e),hiddenCount:g.length-_e}}var bt=f('
          '),_t=f('
          '),ht=f('

          Audit trail failed to load.

          '),kt=f('

          No memory selected.

          '),yt=f('

          No audit events recorded yet.

          '),wt=f(''),Mt=f(''),Pt=ne(''),St=ne(''),At=ne(''),Tt=ne(''),Dt=ne(''),Ct=ne(''),Et=f(' '),Ft=f('
          '),Nt=f('
          '),It=f('
        1. '),$t=f(''),Ot=f('
            ',1),Rt=f('
            ');function jt(g,p){Ye(p,!0);let m=B($e([])),x=B(!0),S=B(!1),C=B(!1);async function E(_){return ft(_,Date.now())}We(async()=>{if(!p.memoryId){P(m,[],!0),P(x,!1);return}try{P(m,await E(p.memoryId),!0)}catch{P(m,[],!0),P(S,!0)}finally{P(x,!1)}});const F=oe(()=>mt(e(m),e(C))),i=oe(()=>e(F).visible),N=oe(()=>e(F).hiddenCount);var z=Rt(),O=s(z);{var d=_=>{var w=_t();pe(w,20,()=>Array(5),Oe,(Q,Z)=>{var J=bt();l(Q,J)}),t(w),l(_,w)},I=_=>{var w=ht();l(_,w)},he=_=>{var w=kt();l(_,w)},ke=_=>{var w=yt();l(_,w)},ue=_=>{var w=Ot(),Q=Je(w);pe(Q,23,()=>e(i),(R,h)=>R.timestamp+h,(R,h,K)=>{const u=oe(()=>vt[e(h).action]),fe=oe(()=>xt(e(h).old_value,e(h).new_value));var ee=It(),te=s(ee),ye=s(te);{var we=a=>{var r=wt();k(()=>X(r,`background: ${e(u).color??""};`)),l(a,r)},c=a=>{var r=Mt();k(()=>X(r,`border-color: ${e(u).color??""}; background: transparent;`)),l(a,r)},M=a=>{var r=Pt();k(()=>V(r,"stroke",e(u).color)),l(a,r)},A=a=>{var r=St();k(()=>V(r,"stroke",e(u).color)),l(a,r)},n=a=>{var r=At();k(()=>V(r,"stroke",e(u).color)),l(a,r)},W=a=>{var r=Tt();k(()=>V(r,"stroke",e(u).color)),l(a,r)},j=a=>{var r=Dt();k(()=>V(r,"fill",e(u).color)),l(a,r)},ie=a=>{var r=Ct();k(()=>V(r,"stroke",e(u).color)),l(a,r)};q(ye,a=>{e(u).kind==="dot"?a(we):e(u).kind==="ring"?a(c,1):e(u).kind==="arrow-up"?a(M,2):e(u).kind==="arrow-down"?a(A,3):e(u).kind==="pencil"?a(n,4):e(u).kind==="x"?a(W,5):e(u).kind==="star"?a(j,6):e(u).kind==="circle-arrow"&&a(ie,7)})}t(te);var ae=v(te,2),U=s(ae),re=s(U),Y=s(re),Me=s(Y,!0);t(Y);var Pe=v(Y,2);{var ge=a=>{var r=Et(),b=s(r,!0);t(r),k(()=>D(b,e(h).triggered_by)),l(a,r)};q(Pe,a=>{e(h).triggered_by&&a(ge)})}t(re);var le=v(re,2),xe=s(le,!0);t(le),t(U);var se=v(U,2);{var Se=a=>{var r=Ft(),b=s(r);t(r),k(()=>D(b,`retention ${e(fe)??""}`)),l(a,r)};q(se,a=>{e(fe)&&a(Se)})}var me=v(se,2);{var Ae=a=>{var r=Nt(),b=s(r,!0);t(r),k(()=>D(b,e(h).reason)),l(a,r)};q(me,a=>{e(h).reason&&a(Ae)})}t(ae),t(ee),k((a,r)=>{X(ee,`animation-delay: ${e(K)*40}ms;`),X(te,`background: rgba(10,10,26,0.9); box-shadow: 0 0 10px ${e(u).color??""}88; border: 1px solid ${e(u).color??""};`),X(Y,`color: ${e(u).color??""};`),D(Me,e(u).label),V(le,"title",a),D(xe,r)},[()=>new Date(e(h).timestamp).toLocaleString(),()=>gt(e(h).timestamp)]),l(R,ee)}),t(Q);var Z=v(Q,2);{var J=R=>{var h=$t(),K=s(h,!0);t(h),k(()=>D(K,e(C)?"Hide older events":`Show ${e(N)} older event${e(N)===1?"":"s"}…`)),y("click",h,u=>{u.stopPropagation(),P(C,!e(C))}),l(R,h)};q(Z,R=>{e(N)>0&&R(J)})}l(_,w)};q(O,_=>{e(x)?_(d):e(S)?_(I,1):p.memoryId?e(m).length===0?_(ke,3):_(ue,!1):_(he,2)})}t(z),l(g,z),Ge()}Ke(["click"]);var Bt=f(' results'),Lt=f('
            '),zt=f('
            '),Ht=f('

            '),qt=f(' '),Qt=f('

            ',1),Wt=f('
            '),Yt=f('
            Content Audit Trail
            Promote Demote Suppress Delete
            '),Gt=f(''),Jt=f('
            '),Kt=f(`
            `);function pa(g,p){Ye(p,!0);let m=B($e([])),x=B(""),S=B(""),C="",E=B(0),F=B(!0),i=B(null),N=$e({}),z;We(()=>O());async function O(){P(F,!0);try{const c={};e(x)&&(c.q=e(x)),e(S)&&(c.node_type=e(S)),e(E)>0&&(c.min_retention=String(e(E)));const M=await H.memories.list(c);P(m,M.memories,!0)}catch{P(m,[],!0)}finally{P(F,!1)}}function d(){clearTimeout(z),z=setTimeout(O,300)}function I(c){return c>.7?"#10b981":c>.4?"#f59e0b":"#ef4444"}const he=[{value:"",label:"All types"},{value:"fact",label:"Fact",color:L.fact},{value:"concept",label:"Concept",color:L.concept},{value:"event",label:"Event",color:L.event},{value:"person",label:"Person",color:L.person},{value:"place",label:"Place",color:L.place},{value:"note",label:"Note",color:L.note},{value:"pattern",label:"Pattern",color:L.pattern},{value:"decision",label:"Decision",color:L.decision}],ke=[{value:"0",label:"Any retention"},{value:"0.3",label:"≥ 30% — fading & up"},{value:"0.5",label:"≥ 50% — half-strength"},{value:"0.7",label:"≥ 70% — well-retained"},{value:"0.9",label:"≥ 90% — core memories"}];let ue=B("0");function _(c){P(E,parseFloat(c),!0),O()}var w=Kt(),Q=s(w);lt(Q,{icon:"memories",title:"Memories",subtitle:"Search, filter, and curate everything Vestige remembers",accent:"memory",children:(c,M)=>{var A=Bt(),n=s(A);dt(n,{get value(){return e(m).length}}),st(),t(A),l(c,A)},$$slots:{default:!0}});var Z=v(Q,2),J=s(Z),R=s(J),h=s(R);Qe(h,{name:"search",size:16}),t(R);var K=v(R,2);ot(K),t(J);var u=v(J,2);qe(u,{get options(){return he},label:"Type",icon:"filter",placeholder:"All types",onChange:O,get value(){return e(S)},set value(c){P(S,c,!0)}});var fe=v(u,2);qe(fe,{get options(){return ke},label:"Retention",icon:"pulse",onChange:_,get value(){return e(ue)},set value(c){P(ue,c,!0)}}),t(Z);var ee=v(Z,2);{var te=c=>{var M=zt();pe(M,20,()=>Array(8),Oe,(A,n)=>{var W=Lt();l(A,W)}),t(M),l(c,M)},ye=c=>{var M=Ht(),A=s(M),n=s(A);Qe(n,{name:"memories",size:48,strokeWidth:1.2}),t(A);var W=v(A,2),j=s(W,!0);t(W),t(M),k(()=>D(j,e(x)||e(S)||e(E)>0?"No memories match these filters yet. Try widening your search.":"No memories yet — once Vestige starts remembering, they will surface here, alive and searchable.")),l(c,M)},we=c=>{var M=Jt();pe(M,23,()=>e(m),A=>A.id,(A,n,W)=>{var j=Gt(),ie=s(j),ae=s(ie),U=s(ae),re=s(U),Y=v(re,2),Me=s(Y,!0);t(Y);var Pe=v(Y,2);pe(Pe,17,()=>e(n).tags.slice(0,3),Oe,(b,T)=>{var $=qt(),de=s($,!0);t($),k(()=>D(de,e(T))),l(b,$)}),t(U);var ge=v(U,2),le=s(ge,!0);t(ge),t(ae);var xe=v(ae,2),se=s(xe),Se=s(se);t(se);var me=v(se,2),Ae=s(me);t(me),t(xe),t(ie);var a=v(ie,2);{var r=b=>{const T=oe(()=>N[e(n).id]??"content");var $=Yt(),de=s($),be=s(de),Te=v(be,2);t(de);var Re=v(de,2);{var Ue=o=>{var G=Qt(),ce=Je(G),ve=s(ce,!0);t(ce);var Le=v(ce,2),Fe=s(Le),Xe=s(Fe);t(Fe);var Ne=v(Fe,2),Ze=s(Ne);t(Ne);var ze=v(Ne,2),et=s(ze);t(ze),t(Le),k((tt,at,rt)=>{D(ve,e(n).content),D(Xe,`Storage: ${tt??""}%`),D(Ze,`Retrieval: ${at??""}%`),D(et,`Created: ${rt??""}`)},[()=>(e(n).storageStrength*100).toFixed(1),()=>(e(n).retrievalStrength*100).toFixed(1),()=>new Date(e(n).createdAt).toLocaleDateString()]),l(o,G)},Ve=o=>{var G=Wt(),ce=s(G);jt(ce,{get memoryId(){return e(n).id}}),t(G),y("click",G,ve=>ve.stopPropagation()),y("keydown",G,ve=>ve.stopPropagation()),l(o,G)};q(Re,o=>{e(T)==="content"?o(Ue):o(Ve,!1)})}var je=v(Re,2),De=s(je),Ce=v(De,2),Ee=v(Ce,2),Be=v(Ee,2);t(je),t($),k(()=>{Ie(be,1,`px-3 py-1.5 rounded-lg cursor-pointer select-none transition ${e(T)==="content"?"bg-synapse/20 text-synapse-glow border border-synapse/40":"bg-white/[0.03] text-dim hover:text-text border border-transparent"}`),Ie(Te,1,`px-3 py-1.5 rounded-lg cursor-pointer select-none transition ${e(T)==="audit"?"bg-synapse/20 text-synapse-glow border border-synapse/40":"bg-white/[0.03] text-dim hover:text-text border border-transparent"}`)}),y("click",be,o=>{o.stopPropagation(),N[e(n).id]="content"}),y("keydown",be,o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),N[e(n).id]="content")}),y("click",Te,o=>{o.stopPropagation(),N[e(n).id]="audit"}),y("keydown",Te,o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),N[e(n).id]="audit")}),y("click",De,o=>{o.stopPropagation(),H.memories.promote(e(n).id)}),y("keydown",De,o=>{o.key==="Enter"&&(o.stopPropagation(),H.memories.promote(e(n).id))}),y("click",Ce,o=>{o.stopPropagation(),H.memories.demote(e(n).id)}),y("keydown",Ce,o=>{o.key==="Enter"&&(o.stopPropagation(),H.memories.demote(e(n).id))}),y("click",Ee,async o=>{o.stopPropagation(),await H.memories.suppress(e(n).id,"dashboard trigger")}),y("keydown",Ee,async o=>{o.key==="Enter"&&(o.stopPropagation(),await H.memories.suppress(e(n).id,"dashboard trigger"))}),y("click",Be,async o=>{o.stopPropagation(),await H.memories.delete(e(n).id),O()}),y("keydown",Be,async o=>{o.key==="Enter"&&(o.stopPropagation(),await H.memories.delete(e(n).id),O())}),l(b,$)};q(a,b=>{var T;((T=e(i))==null?void 0:T.id)===e(n).id&&b(r)})}t(j),He(j,(b,T)=>{var $;return($=nt)==null?void 0:$(b,T)},()=>({delay:Math.min(e(W)*35,350),y:12})),He(j,b=>{var T;return(T=ct)==null?void 0:T(b)}),k((b,T)=>{var $;Ie(j,1,`spotlight-surface text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.04] diff --git a/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js.br b/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js.br new file mode 100644 index 0000000..4b27195 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js.gz b/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js.gz new file mode 100644 index 0000000..9071c9e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/14.CGp2yeqr.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js.br b/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js.br deleted file mode 100644 index 58aed9f..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js.gz b/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js.gz deleted file mode 100644 index a9ad2e6..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js b/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js similarity index 93% rename from apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js rename to apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js index da9ffef..73ea148 100644 --- a/apps/dashboard/build/_app/immutable/nodes/15.C05K0kWE.js +++ b/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js @@ -1,3 +1,3 @@ -import"../chunks/Bzak7iHL.js";import{o as Qe}from"../chunks/TZu9D97Z.js";import{p as Be,s as M,d as Je,o as Ke,t as m,a as c,b as Ue,i as w,g as e,j as u,e as i,h as v,n as Xe,r as a,m as we,u as ye}from"../chunks/wpu9U-D0.js";import{d as Ye,a as j,s as b}from"../chunks/D8mhvFt8.js";import{i as k}from"../chunks/DKve45Wd.js";import{e as C,s as P,a as Ze}from"../chunks/60_R_Vbt.js";import{a as G,r as H}from"../chunks/P1-U_Xsj.js";import{s as et,a as tt}from"../chunks/ByYB047u.js";import{P as st}from"../chunks/BHDZZvku.js";import{I as at}from"../chunks/D7A-gG4Z.js";import{A as rt}from"../chunks/DcKTNC6e.js";import{t as ie}from"../chunks/CqMQEF-F.js";import{a as U}from"../chunks/CZfHMhLI.js";import{m as it}from"../chunks/BhIgFntf.js";var lt=u(" pending"),ot=u(''),nt=u(""),dt=u('

            Loading…

            '),vt=u('

            '),ct=u('
            '),ut=u('
          1. '),pt=u('
              '),_t=u('
              Select a Memory PR to review the diff.
              '),bt=u(' '),ft=u(' '),mt=u(' '),gt=u('
              + 
              '),wt=u('
              '),yt=u('
              Why this opened
              '),zt=u('
              '),ht=u(`
              Agent's reasoning
              `),xt=u(""),kt=u('
              '),Pt=u(' '),$t=u('
              Decided:
              '),Mt=u('

              '),Rt=u(`
              Vestige auto-remembers ordinary context, but opens a Memory PR when the agent tries to rewrite its own brain. Risky writes are quarantine-reviewed: recorded for audit, but held +import"../chunks/Bzak7iHL.js";import{o as Qe}from"../chunks/JVtQszIZ.js";import{p as Be,s as M,d as Je,x as Ke,t as m,a as c,b as Ue,i as w,g as e,j as u,e as i,h as v,n as Xe,r as a,m as we,u as ye}from"../chunks/CW7md74C.js";import{d as Ye,a as j,s as b}from"../chunks/D90q9c2i.js";import{i as k}from"../chunks/9-jplUL5.js";import{e as C,s as P,a as Ze}from"../chunks/Cc0l8Nd4.js";import{a as G,r as H}from"../chunks/D8RjhgN0.js";import{s as et,a as tt}from"../chunks/BjbQ7qSx.js";import{P as st}from"../chunks/DTO0IjuV.js";import{I as at}from"../chunks/CqwrgJOn.js";import{A as rt}from"../chunks/CaR6YsRq.js";import{t as ie}from"../chunks/BGTfzpXY.js";import{a as U}from"../chunks/C-rZhKee.js";import{m as it}from"../chunks/BFpewGai.js";var lt=u(" pending"),ot=u(''),nt=u(""),dt=u('

              Loading…

              '),vt=u('

              '),ct=u('
              '),ut=u('
            • '),pt=u('
                '),_t=u('
                Select a Memory PR to review the diff.
                '),bt=u(' '),ft=u(' '),mt=u(' '),gt=u('
                + 
                '),wt=u('
                '),yt=u('
                Why this opened
                '),zt=u('
                '),ht=u(`
                Agent's reasoning
                `),xt=u(""),kt=u('
                '),Pt=u(' '),$t=u('
                Decided:
                '),Mt=u('

                '),Rt=u(`
                Vestige auto-remembers ordinary context, but opens a Memory PR when the agent tries to rewrite its own brain. Risky writes are quarantine-reviewed: recorded for audit, but held out of retrieval until you decide — influence suspended, history preserved.
                `);function Gt(ze,he){Be(he,!0);const xe=()=>et(it,"$memoryPrEvents",ke),[ke,Pe]=tt();let O=M(Je([])),X=M(0),Y=M("risk_gated"),R=M("pending"),n=M(null),E=M(null),Z=M(!1),ee=M(null);const le=[{id:"fast",label:"Fast",blurb:"Every write auto-lands. No review."},{id:"risk_gated",label:"Risk-Gated",blurb:"Ordinary writes land; risky ones open a PR."},{id:"paranoid",label:"Paranoid",blurb:"Every write waits for approval."}],$e=["pending","promoted","merged","superseded","quarantined","forgotten"],oe={new_fact:"New fact",strengthened_fact:"Strengthened",contradiction_detected:"Contradiction",memory_superseded:"Supersede",edge_added:"New edge",node_decayed:"Decayed",dream_consolidation:"Dream merge"},Me=[{id:"promote",label:"Promote",cls:"promote"},{id:"merge",label:"Merge",cls:"merge"},{id:"supersede",label:"Supersede",cls:"supersede"},{id:"quarantine",label:"Quarantine",cls:"quarantine"},{id:"forget",label:"Forget",cls:"forget"},{id:"ask_agent_why",label:"Ask Agent Why",cls:"why"}];async function T(){w(Z,!0);try{const s=await U.memoryPrs.list(e(R)||void 0,100);w(O,s.prs,!0),w(X,s.pendingCount,!0),w(Y,s.mode,!0),e(n)&&w(n,e(O).find(t=>t.id===e(n).id)??null,!0)}finally{w(Z,!1)}}async function Re(s){var r;const t=await U.memoryPrs.setMode(s);w(Y,t.mode,!0),ie.push({type:"MemoryPromoted",title:"Review mode updated",body:`Memory PR gating is now ${(r=le.find(d=>d.id===s))==null?void 0:r.label}.`,color:"#6366f1",dwellMs:4e3})}async function Ae(s,t){w(ee,`${s.id}:${t}`);try{if(t==="ask_agent_why"){const r=await U.memoryPrs.act(s.id,t);w(E,r.why,!0),w(n,s,!0);return}await U.memoryPrs.act(s.id,t),ie.push({type:"MemoryPromoted",title:`PR ${t}d`,body:s.title,color:Ne(t),dwellMs:4500}),w(E,null),await T()}catch(r){ie.push({type:"MemoryDemoted",title:"Action failed",body:String(r),color:"#f43f5e",dwellMs:5e3})}finally{w(ee,null)}}function Ne(s){switch(s){case"promote":return"#10b981";case"merge":return"#6366f1";case"supersede":return"#38bdf8";case"quarantine":return"#f59e0b";case"forget":return"#f43f5e";default:return"#818cf8"}}function Se(s){w(n,s,!0),w(E,null)}Ke(()=>{xe().length&&T()}),Qe(T);function ne(s){var r;const t=(r=s.diff)==null?void 0:r.node;return(t==null?void 0:t.content)??""}function de(s){var r;const t=(r=s.diff)==null?void 0:r.node;return(t==null?void 0:t.nodeType)??""}function qe(s){var r;const t=(r=s.diff)==null?void 0:r.node;return(t==null?void 0:t.tags)??[]}var te=Rt(),ve=i(te);st(ve,{icon:"memorypr",title:"Memory PRs",subtitle:"Approve changes to the agent's brain like code.",accent:"synapse",children:(s,t)=>{var r=lt();let d;var y=i(r);rt(y,{get value(){return e(X)}}),Xe(),a(r),m(()=>d=P(r,1,"pending-badge svelte-c1wbiz",null,d,{has:e(X)>0})),c(s,r)},$$slots:{default:!0}});var ce=v(ve,2);G(ce,s=>{var t;return(t=H)==null?void 0:t(s)});var Q=v(ce,2);C(Q,21,()=>le,s=>s.id,(s,t)=>{var r=ot();let d;var y=i(r),f=i(y,!0);a(y);var z=v(y,2),A=i(z,!0);a(z),a(r),m(()=>{d=P(r,1,"mode svelte-c1wbiz",null,d,{on:e(Y)===e(t).id}),b(f,e(t).label),b(A,e(t).blurb)}),j("click",r,()=>Re(e(t).id)),c(s,r)}),a(Q),G(Q,s=>{var t;return(t=H)==null?void 0:t(s)});var B=v(Q,2),ue=i(B);C(ue,16,()=>$e,s=>s,(s,t)=>{var r=nt();let d;var y=i(r,!0);a(r),m(()=>{d=P(r,1,"filter svelte-c1wbiz",null,d,{on:e(R)===t}),b(y,t)}),j("click",r,()=>{w(R,t,!0),T()}),c(s,r)});var pe=v(ue,2);let _e;a(B),G(B,s=>{var t;return(t=H)==null?void 0:t(s)});var be=v(B,2),J=i(be),Ce=i(J);{var De=s=>{var t=dt();c(s,t)},Ee=s=>{var t=vt(),r=i(t);{var d=f=>{var z=we(`No pending Memory PRs. The brain is up to date — ordinary writes are landing automatically.`);c(f,z)},y=f=>{var z=we();m(()=>b(z,`No ${(e(R)||"")??""} PRs.`)),c(f,z)};k(r,f=>{e(R)==="pending"?f(d):f(y,!1)})}a(t),c(s,t)},Te=s=>{var t=pt();C(t,21,()=>e(O),r=>r.id,(r,d)=>{var y=ut(),f=i(y);let z;var A=i(f),D=i(A),F=i(D,!0);a(D);var L=v(D,2),I=i(L,!0);a(L),a(A);var N=v(A,2),K=i(N,!0);a(N);var se=v(N,2);{var ae=$=>{var V=ct(),re=i(V);a(V),m(()=>b(re,`⚠ ${e(d).signals.length??""} risk signal${e(d).signals.length>1?"s":""}`)),c($,V)};k(se,$=>{e(d).signals.length&&$(ae)})}a(f),a(y),m(()=>{var $;z=P(f,1,"pr-row svelte-c1wbiz",null,z,{active:(($=e(n))==null?void 0:$.id)===e(d).id}),P(D,1,`pr-kind kind-${e(d).kind??""}`,"svelte-c1wbiz"),b(F,oe[e(d).kind]??e(d).kind),P(L,1,`pr-status st-${e(d).status??""}`,"svelte-c1wbiz"),b(I,e(d).status),b(K,e(d).title)}),j("click",f,()=>Se(e(d))),c(r,y)}),a(t),c(s,t)};k(Ce,s=>{e(Z)?s(De):e(O).length===0?s(Ee,1):s(Te,!1)})}a(J),G(J,s=>{var t;return(t=H)==null?void 0:t(s)});var fe=v(J,2),Fe=i(fe);{var Le=s=>{var t=_t();c(s,t)},Ie=s=>{var t=Mt(),r=i(t),d=i(r),y=i(d,!0);a(d);var f=v(d,2),z=i(f,!0);a(f);var A=v(f,2);{var D=o=>{var l=bt();Ze(l,"href","/blackbox");var p=i(l);at(p,{name:"blackbox",size:13});var _=v(p);a(l),m(g=>b(_,` ${g??""}`),[()=>e(n).run_id.replace("run_","").slice(0,8)]),c(o,l)};k(A,o=>{e(n).run_id&&o(D)})}a(r);var F=v(r,2),L=i(F,!0);a(F);var I=v(F,2),N=i(I),K=i(N);{var se=o=>{var l=ft(),p=i(l);a(l),m(_=>b(p,`type: ${_??""}`),[()=>de(e(n))]),c(o,l)},ae=ye(()=>de(e(n)));k(K,o=>{e(ae)&&o(se)})}var $=v(K,2);C($,16,()=>qe(e(n)),o=>o,(o,l)=>{var p=mt(),_=i(p);a(p),m(()=>b(_,`#${l??""}`)),c(o,p)}),a(N);var V=v(N,2);{var re=o=>{var l=gt(),p=v(i(l),1,!0);a(l),m(_=>b(p,_),[()=>ne(e(n))]),c(o,l)},Ve=ye(()=>ne(e(n)));k(V,o=>{e(Ve)&&o(re)})}a(I);var me=v(I,2);{var We=o=>{var l=yt(),p=v(i(l),2);C(p,17,()=>e(n).signals,_=>_.code,(_,g)=>{var h=wt(),x=i(h),S=i(x,!0);a(x);var q=v(x,2),W=i(q,!0);a(q),a(h),m(()=>{b(S,e(g).code),b(W,e(g).detail)}),c(_,h)}),a(l),c(o,l)};k(me,o=>{e(n).signals.length&&o(We)})}var ge=v(me,2);{var je=o=>{var l=ht(),p=v(i(l),2);C(p,17,()=>e(E),_=>_.code,(_,g)=>{var h=zt(),x=i(h),S=i(x,!0);a(x);var q=v(x,2),W=i(q,!0);a(q),a(h),m(()=>{b(S,e(g).code),b(W,e(g).detail)}),c(_,h)}),a(l),c(o,l)};k(ge,o=>{e(E)&&o(je)})}var Ge=v(ge,2);{var He=o=>{var l=kt();C(l,21,()=>Me,p=>p.id,(p,_)=>{var g=xt(),h=i(g,!0);a(g),m(()=>{P(g,1,`action ${e(_).cls??""}`,"svelte-c1wbiz"),g.disabled=e(ee)===`${e(n).id}:${e(_).id}`,b(h,e(_).label)}),j("click",g,()=>Ae(e(n),e(_).id)),c(p,g)}),a(l),c(o,l)},Oe=o=>{var l=$t(),p=v(i(l)),_=i(p,!0);a(p);var g=v(p,2);{var h=x=>{var S=Pt(),q=i(S);a(S),m(W=>b(q,`· ${W??""}`),[()=>new Date(e(n).decided_at).toLocaleString()]),c(x,S)};k(g,x=>{e(n).decided_at&&x(h)})}a(l),m(()=>b(_,e(n).decision??e(n).status)),c(o,l)};k(Ge,o=>{e(n).status==="pending"?o(He):o(Oe,!1)})}a(t),G(t,o=>{var l;return(l=H)==null?void 0:l(o)}),m(()=>{P(d,1,`pr-kind kind-${e(n).kind??""}`,"svelte-c1wbiz"),b(y,oe[e(n).kind]??e(n).kind),P(f,1,`pr-status st-${e(n).status??""}`,"svelte-c1wbiz"),b(z,e(n).status),b(L,e(n).title)}),c(s,t)};k(Fe,s=>{e(n)?s(Ie,!1):s(Le)})}a(fe),a(be),a(te),m(()=>_e=P(pe,1,"filter svelte-c1wbiz",null,_e,{on:e(R)===""})),j("click",pe,()=>{w(R,""),T()}),c(ze,te),Ue(),Pe()}Ye(["click"]);export{Gt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js.br b/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js.br new file mode 100644 index 0000000..32240e3 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js.gz b/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js.gz new file mode 100644 index 0000000..1f1727e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/15.zPehnIhj.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js b/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js deleted file mode 100644 index bec5d28..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js +++ /dev/null @@ -1,3 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as lt}from"../chunks/TZu9D97Z.js";import{p as Ue,e as r,h as n,r as t,t as A,a as _,g as e,u as z,b as Ve,s as oe,i as S,c as Ye,f as Re,j as y,d as dt,n as Te}from"../chunks/wpu9U-D0.js";import{d as Je,s as d,a as ie,e as qe}from"../chunks/D8mhvFt8.js";import{i as q}from"../chunks/DKve45Wd.js";import{e as te,a as Ce,s as _e,i as pt}from"../chunks/60_R_Vbt.js";import{a as vt,r as ut}from"../chunks/P1-U_Xsj.js";import{s as me}from"../chunks/EqHb-9AZ.js";import{P as ft}from"../chunks/BHDZZvku.js";import{I as X}from"../chunks/D7A-gG4Z.js";import{A as ee}from"../chunks/DcKTNC6e.js";function gt(b,m,$=3){const v={};for(const u of b){v[u]={};for(const f of b)v[u][f]={count:0,topNames:[]}}for(const u of m){const f=u.origin_project;if(v[f])for(const F of u.transferred_to)v[f][F]&&(v[f][F].count+=1,v[f][F].topNames.push(u.name))}const p=Math.max(0,$);for(const u of b)for(const f of b)v[u][f].topNames=v[u][f].topNames.slice(0,p);return v}function xt(b,m){let $=0;for(const v of b){const p=m[v];if(p)for(const u of b){const f=p[u];f&&f.count>$&&($=f.count)}}return $}function _t(b,m){var v;const $=[];for(const p of b)for(const u of b){const f=(v=m[p])==null?void 0:v[u];f&&f.count>0&&$.push({from:p,to:u,count:f.count,topNames:f.topNames})}return $.sort((p,u)=>u.count-p.count)}function mt(b){return b?b.length>12?b.slice(0,11)+"…":b:""}var yt=y('
                '),ht=y(''),bt=y(' '),wt=y('
                '),jt=y('
                Top patterns
                '),kt=y('
                No transfers recorded
                '),Tt=y('
                '),Ct=y('
                No cross-project transfers recorded yet.
                '),At=y('
                '),$t=y(''),Zt=y('
                ');function Pt(b,m){Ue(m,!0);const $=z(()=>gt(m.projects,m.patterns)),v=z(()=>xt(m.projects,e($))||1);let p=oe(null);function u(a){if(a===0)return"background: rgba(255,255,255,0.02); border-color: rgba(99,102,241,0.05);";const s=a/e(v),o=.1+s*.7;if(s<.5)return`background: rgba(99, 102, 241, ${o.toFixed(3)}); border-color: rgba(129, 140, 248, ${(o*.6).toFixed(3)}); box-shadow: 0 0 ${(s*14).toFixed(1)}px rgba(129, 140, 248, ${(s*.45).toFixed(3)});`;{const c=(s-.5)*2,l=Math.round(99+69*c),x=Math.round(102+-17*c),g=Math.round(241+6*c);return`background: rgba(${l}, ${x}, ${g}, ${o.toFixed(3)}); border-color: rgba(192, 132, 252, ${(o*.7).toFixed(3)}); box-shadow: 0 0 ${(6+s*18).toFixed(1)}px rgba(192, 132, 252, ${(s*.55).toFixed(3)});`}}function f(a){if(a===0)return"text-muted";const s=a/e(v);return s>=.5?"text-bright font-semibold":s>=.2?"text-text":"text-dim"}function F(a,s,o){const l=a.currentTarget.getBoundingClientRect();S(p,{from:s,to:o,x:l.left+l.width/2,y:l.top},!0)}function k(){S(p,null)}const K=mt;function ce(a,s){return m.selectedCell!==null&&m.selectedCell.from===a&&m.selectedCell.to===s}const H=z(()=>_t(m.projects,e($)));var B=Zt(),Q=r(B),re=r(Q),U=n(r(re),2),le=n(r(U),4),Ae=r(le,!0);t(le),t(U),t(re);var de=n(re,2),ye=r(de),V=r(ye),pe=r(V),ve=n(r(pe));te(ve,16,()=>m.projects,a=>a,(a,s)=>{var o=yt(),c=r(o),l=r(c),x=r(l,!0);t(l),t(c),t(o),A(g=>{Ce(o,"title",s),d(x,g)},[()=>K(s)]),_(a,o)}),t(pe),t(V);var W=n(V);te(W,20,()=>m.projects,a=>a,(a,s)=>{var o=bt(),c=r(o),l=r(c,!0);t(c);var x=n(c);te(x,16,()=>m.projects,g=>g,(g,w)=>{const h=z(()=>e($)[s][w]),P=z(()=>s===w);var N=ht(),C=r(N),R=r(C),Y=r(R,!0);t(R),t(C),t(N),A((I,Z,T)=>{me(C,`${I??""} ${Z??""} ${e(P)&&e(h).count>0?"border-style: dashed;":""}`),Ce(C,"aria-label",`${e(h).count??""} patterns from ${s??""} to ${w??""}`),_e(R,1,`text-[11px] ${T??""}`),d(Y,e(h).count||"")},[()=>u(e(h).count),()=>ce(s,w)?"outline: 2px solid var(--color-dream-glow); outline-offset: 1px;":"",()=>f(e(h).count)]),ie("click",C,()=>m.onCellClick(s,w)),qe("mouseenter",C,I=>F(I,s,w)),qe("mouseleave",C,k),_(g,N)}),t(o),A(g=>{Ce(c,"title",s),d(l,g)},[()=>K(s)]),_(a,o)}),t(W),t(ye),t(de);var he=n(de,2);{var $e=a=>{const s=z(()=>e($)[e(p).from][e(p).to]);var o=Tt(),c=r(o),l=r(c),x=r(l,!0);t(l);var g=n(l,4),w=r(g,!0);t(g),t(c);var h=n(c,2),P=r(h),N=n(P),C=r(N);t(N),t(h);var R=n(h,2);{var Y=Z=>{var T=jt(),L=n(r(T),2);te(L,17,()=>e(s).topNames,pt,(D,J)=>{var fe=wt(),we=r(fe);t(fe),A(()=>d(we,`· ${e(J)??""}`)),_(D,fe)}),t(T),_(Z,T)},I=Z=>{var T=kt();_(Z,T)};q(R,Z=>{e(s).topNames.length>0?Z(Y):Z(I,!1)})}t(o),A((Z,T)=>{me(o,`left: ${e(p).x??""}px; top: ${e(p).y-12}px; transform: translate(-50%, -100%);`),d(x,Z),d(w,T),d(P,`${e(s).count??""} `),d(C,`${e(s).count===1?"pattern":"patterns"} transferred`)},[()=>K(e(p).from),()=>K(e(p).to)]),_(a,o)};q(he,a=>{e(p)&&a($e)})}t(Q);var be=n(Q,2),ue=r(be),Ze=r(ue);t(ue);var Pe=n(ue,2);{var Ne=a=>{var s=Ct();_(a,s)},i=a=>{var s=Ye(),o=Re(s);te(o,17,()=>e(H),c=>c.from+"->"+c.to,(c,l)=>{var x=$t(),g=r(x),w=r(g),h=r(w),P=r(h,!0);t(h);var N=n(h,4),C=r(N,!0);t(N),t(w);var R=n(w,2);{var Y=T=>{var L=At(),D=r(L,!0);t(L),A(J=>d(D,J),[()=>e(l).topNames.join(" · ")]),_(T,L)};q(R,T=>{e(l).topNames.length>0&&T(Y)})}t(g);var I=n(g,2),Z=r(I,!0);t(I),t(x),A((T,L,D)=>{_e(x,1,`flex w-full items-center justify-between rounded-lg border border-synapse/10 bg-white/[0.02] p-3 transition hover:border-synapse/30 hover:bg-white/[0.04] ${T??""}`),d(P,L),d(C,D),d(Z,e(l).count)},[()=>ce(e(l).from,e(l).to)?"ring-1 ring-dream-glow":"",()=>K(e(l).from),()=>K(e(l).to)]),ie("click",x,()=>m.onCellClick(e(l).from,e(l).to)),_(c,x)}),_(a,s)};q(Pe,a=>{e(H).length===0?a(Ne):a(i,!1)})}t(be),t(B),A(()=>{d(Ae,e(v)),d(Ze,`${e(H).length??""} transfer pair${e(H).length===1?"":"s"} · tap to filter`)}),_(b,B),Ve()}Je(["click"]);var Nt=y(' '),St=y(''),Ft=y(`
                Couldn't load pattern transfers
                `),Mt=y('
                '),Et=y('
                Filtered to
                '),zt=y('
                No matching patterns
                '),Ht=y('
              • '),Rt=y('
                  '),It=y('
                  ',1),Lt=y('
                  ');function Jt(b,m){Ue(m,!0);const $=["ErrorHandling","AsyncConcurrency","Testing","Architecture","Performance","Security"],v={ErrorHandling:"var(--color-decay)",AsyncConcurrency:"var(--color-synapse-glow)",Testing:"var(--color-recall)",Architecture:"var(--color-dream-glow)",Performance:"var(--color-warning)",Security:"var(--color-node-pattern)"};let p=oe("All"),u=oe(dt({projects:[],patterns:[]})),f=oe(!0),F=oe(null),k=oe(null);async function K(){return await new Promise(s=>setTimeout(s,420)),{projects:["vestige","api-gateway","desktop-app","model-runner","game-sim","security-dashboard","benchmark-suite"],patterns:[{name:"Result with thiserror context",category:"ErrorHandling",origin_project:"vestige",transferred_to:["api-gateway","desktop-app","model-runner","security-dashboard"],transfer_count:4,last_used:"2026-04-18T14:22:00Z",confidence:.94},{name:"Axum error middleware with tower-http",category:"ErrorHandling",origin_project:"api-gateway",transferred_to:["vestige","security-dashboard"],transfer_count:2,last_used:"2026-04-17T09:10:00Z",confidence:.88},{name:"Graceful shutdown on SIGINT/SIGTERM",category:"ErrorHandling",origin_project:"vestige",transferred_to:["vestige","desktop-app","security-dashboard"],transfer_count:3,last_used:"2026-04-15T22:01:00Z",confidence:.82},{name:"Python try/except with contextual re-raise",category:"ErrorHandling",origin_project:"benchmark-suite",transferred_to:["model-runner"],transfer_count:1,last_used:"2026-04-10T11:30:00Z",confidence:.7},{name:"Arc> reader/writer split",category:"AsyncConcurrency",origin_project:"vestige",transferred_to:["api-gateway","desktop-app"],transfer_count:2,last_used:"2026-04-14T16:42:00Z",confidence:.91},{name:"tokio::select! for cancellation propagation",category:"AsyncConcurrency",origin_project:"desktop-app",transferred_to:["vestige","security-dashboard"],transfer_count:2,last_used:"2026-04-19T08:05:00Z",confidence:.86},{name:"Bounded mpsc channel with backpressure",category:"AsyncConcurrency",origin_project:"desktop-app",transferred_to:["vestige","api-gateway"],transfer_count:2,last_used:"2026-04-12T13:18:00Z",confidence:.83},{name:"asyncio.gather with return_exceptions",category:"AsyncConcurrency",origin_project:"model-runner",transferred_to:["benchmark-suite"],transfer_count:1,last_used:"2026-04-08T20:45:00Z",confidence:.72},{name:"Property-based tests with proptest",category:"Testing",origin_project:"vestige",transferred_to:["api-gateway","desktop-app"],transfer_count:2,last_used:"2026-04-11T10:22:00Z",confidence:.89},{name:"Snapshot testing with insta",category:"Testing",origin_project:"api-gateway",transferred_to:["vestige"],transfer_count:1,last_used:"2026-04-16T14:00:00Z",confidence:.81},{name:"Vitest + Playwright dashboard harness",category:"Testing",origin_project:"vestige",transferred_to:["api-gateway","desktop-app"],transfer_count:2,last_used:"2026-04-19T18:30:00Z",confidence:.87},{name:"One-variable-at-a-time Kaggle submission",category:"Testing",origin_project:"benchmark-suite",transferred_to:["model-runner","game-sim"],transfer_count:2,last_used:"2026-04-20T07:15:00Z",confidence:.95},{name:"Kaggle pre-flight Input-panel screenshot",category:"Testing",origin_project:"benchmark-suite",transferred_to:["model-runner","game-sim"],transfer_count:2,last_used:"2026-04-20T06:50:00Z",confidence:.98},{name:"SvelteKit 2 + Svelte 5 runes dashboard",category:"Architecture",origin_project:"vestige",transferred_to:["api-gateway","security-dashboard"],transfer_count:2,last_used:"2026-04-19T12:10:00Z",confidence:.92},{name:"glass-panel + cosmic-dark design system",category:"Architecture",origin_project:"vestige",transferred_to:["api-gateway","security-dashboard","desktop-app"],transfer_count:3,last_used:"2026-04-20T09:00:00Z",confidence:.9},{name:"Tauri 2 + Rust/Axum sidecar",category:"Architecture",origin_project:"desktop-app",transferred_to:["security-dashboard"],transfer_count:1,last_used:"2026-04-13T19:44:00Z",confidence:.78},{name:"MCP server with 23 stateful tools",category:"Architecture",origin_project:"vestige",transferred_to:["desktop-app"],transfer_count:1,last_used:"2026-04-17T11:05:00Z",confidence:.85},{name:"USearch HNSW index for vector search",category:"Performance",origin_project:"vestige",transferred_to:["api-gateway"],transfer_count:1,last_used:"2026-04-09T15:20:00Z",confidence:.88},{name:"SQLite WAL mode for concurrent reads",category:"Performance",origin_project:"vestige",transferred_to:["api-gateway","desktop-app","security-dashboard"],transfer_count:3,last_used:"2026-04-18T21:33:00Z",confidence:.93},{name:"vLLM prefix caching at 0.35 mem util",category:"Performance",origin_project:"benchmark-suite",transferred_to:["model-runner"],transfer_count:1,last_used:"2026-04-11T08:00:00Z",confidence:.84},{name:"Cross-encoder rerank at k=30",category:"Performance",origin_project:"vestige",transferred_to:["api-gateway"],transfer_count:1,last_used:"2026-04-14T17:55:00Z",confidence:.79},{name:"Rotated auth token in env var",category:"Security",origin_project:"vestige",transferred_to:["api-gateway","desktop-app","security-dashboard"],transfer_count:3,last_used:"2026-04-16T20:12:00Z",confidence:.96},{name:"Parameterized SQL via rusqlite params!",category:"Security",origin_project:"vestige",transferred_to:["api-gateway"],transfer_count:1,last_used:"2026-04-10T13:40:00Z",confidence:.89},{name:"664-pattern secret scanner",category:"Security",origin_project:"api-gateway",transferred_to:["vestige","security-dashboard","desktop-app"],transfer_count:3,last_used:"2026-04-20T05:30:00Z",confidence:.97},{name:"CSP header with nonce-based script allow",category:"Security",origin_project:"api-gateway",transferred_to:["security-dashboard"],transfer_count:1,last_used:"2026-04-05T16:08:00Z",confidence:.8}]}}async function ce(){S(f,!0),S(F,null);try{S(u,await K(),!0)}catch(i){S(F,i instanceof Error?i.message:"Failed to load pattern transfers",!0),S(u,{projects:[],patterns:[]},!0)}finally{S(f,!1)}}lt(()=>ce());const H=z(()=>e(p)==="All"?e(u).patterns:e(u).patterns.filter(i=>i.category===e(p))),B=z(()=>[...e(k)?e(H).filter(a=>a.origin_project===e(k).from&&a.transferred_to.includes(e(k).to)):e(H)].sort((a,s)=>s.transfer_count-a.transfer_count)),Q=z(()=>e(H).reduce((i,a)=>i+a.transferred_to.length,0)),re=z(()=>e(u).projects.length),U=z(()=>e(H).length);function le(i){S(p,i,!0),S(k,null)}function Ae(i,a){e(k)&&e(k).from===i&&e(k).to===a?S(k,null):S(k,{from:i,to:a},!0)}function de(){S(k,null)}function ye(i){const a=new Date(i).getTime(),s=Date.now(),o=Math.floor((s-a)/864e5);return o<=0?"today":o===1?"1d ago":o<30?`${o}d ago`:`${Math.floor(o/30)}mo ago`}var V=Lt(),pe=r(V);ft(pe,{icon:"patterns",title:"Cross-Project Intelligence",subtitle:"Patterns learned here, applied there — across every tracked project.",accent:"dream",children:(i,a)=>{var s=Ye(),o=Re(s);{var c=l=>{var x=Nt(),g=r(x),w=r(g);ee(w,{get value(){return e(U)}}),t(g);var h=n(g),P=n(h),N=r(P);ee(N,{get value(){return e(Q)}}),t(P);var C=n(P);t(x),A(()=>{d(h,` pattern${e(U)===1?"":"s"} - · `),d(C,` transfer${e(Q)===1?"":"s"}`)}),_(l,x)};q(o,l=>{!e(f)&&!e(F)&&l(c)})}_(i,s)},$$slots:{default:!0}});var ve=n(pe,2),W=r(ve),he=r(W),$e=r(he);X($e,{name:"sparkle",size:13}),Te(),t(he),t(W);var be=n(W,2);te(be,16,()=>$,i=>i,(i,a)=>{var s=St(),o=r(s),c=n(o);t(s),A(()=>{_e(s,1,`lift flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition ${e(p)===a?"bg-synapse/25 text-synapse-glow shadow-[0_0_16px_-4px_var(--color-synapse-glow)]":"text-dim hover:bg-white/[0.04] hover:text-text"}`),_e(o,1,`h-1.5 w-1.5 rounded-full transition-all duration-300 ${e(p)===a?"scale-150":""}`),me(o,`background: ${v[a]??""}; ${e(p)===a?`box-shadow: 0 0 8px ${v[a]};`:""}`),d(c,` ${a??""}`)}),ie("click",s,()=>le(a)),_(i,s)}),t(ve);var ue=n(ve,2);{var Ze=i=>{var a=Ft(),s=r(a),o=r(s);X(o,{name:"contradictions",size:28}),t(s);var c=n(s,4),l=r(c,!0);t(c);var x=n(c,2),g=r(x);X(g,{name:"pulse",size:14}),Te(),t(x),t(a),A(()=>d(l,e(F))),ie("click",x,ce),_(i,a)},Pe=i=>{var a=Mt();_(i,a)},Ne=i=>{var a=It(),s=Re(a),o=r(s),c=r(o);Pt(c,{get projects(){return e(u).projects},get patterns(){return e(H)},get selectedCell(){return e(k)},onCellClick:Ae});var l=n(c,2);{var x=G=>{var M=Et(),E=r(M),j=r(E),ae=r(j);X(ae,{name:"filter",size:13}),t(j);var O=n(j,4),je=r(O,!0);t(O);var se=n(O,4),ne=r(se,!0);t(se),t(E);var ge=n(E,2),xe=r(ge);X(xe,{name:"close",size:12}),Te(),t(ge),t(M),A(()=>{d(je,e(k).from),d(ne,e(k).to)}),ie("click",ge,de),_(G,M)};q(l,G=>{e(k)&&G(x)})}t(o);var g=n(o,2),w=r(g),h=r(w),P=r(h),N=r(P);X(N,{name:"patterns",size:15}),t(P),Te(),t(h);var C=n(h,2),R=r(C);ee(R,{get value(){return e(B).length}});var Y=n(R);t(C),t(w);var I=n(w,2);{var Z=G=>{var M=zt(),E=r(M),j=r(E);X(j,{name:"explore",size:32}),t(E);var ae=n(E,4),O=r(ae,!0);t(ae),t(M),A(()=>d(O,e(k)?"No patterns transferred from this origin to this destination yet — try another cell or clear the filter.":"Nothing in this category yet. Pick another category to explore what travels between projects.")),_(G,M)},T=G=>{var M=Rt();te(M,23,()=>e(B),E=>E.name,(E,j,ae)=>{var O=Ht(),je=r(O),se=r(je),ne=r(se),ge=r(ne,!0);t(ne);var xe=n(ne,2),ke=r(xe),at=r(ke,!0);t(ke);var Oe=n(ke,2),st=r(Oe,!0);t(Oe),t(xe);var De=n(xe,2),Me=r(De),nt=r(Me,!0);t(Me);var Ke=n(Me,4),ot=r(Ke);t(Ke),t(De),t(se);var Be=n(se,2),Ee=r(Be),it=r(Ee);ee(it,{get value(){return e(j).transfer_count}}),t(Ee);var Qe=n(Ee,2),ct=r(Qe);t(Qe),t(Be),t(je),t(O),vt(O,(ze,He)=>{var We;return(We=ut)==null?void 0:We(ze,He)},()=>({y:12,delay:Math.min(e(ae)*45,360)})),A((ze,He)=>{Ce(ne,"title",e(j).name),d(ge,e(j).name),me(ke,`border-color: ${v[e(j).category]??""}66; color: ${v[e(j).category]??""}; background: ${v[e(j).category]??""}1a;`),d(at,e(j).category),d(st,ze),d(nt,e(j).origin_project),d(ot,`${e(j).transferred_to.length??""} - ${e(j).transferred_to.length===1?"project":"projects"}`),d(ct,`${He??""}%`)},[()=>ye(e(j).last_used),()=>(e(j).confidence*100).toFixed(0)]),_(E,O)}),t(M),_(G,M)};q(I,G=>{e(B).length===0?G(Z):G(T,!1)})}t(g),t(s);var L=n(s,2),D=r(L),J=r(D),fe=r(J);ee(fe,{get value(){return e(U)}}),t(J);var we=n(J),Se=n(we),Xe=r(Se);ee(Xe,{get value(){return e(re)}}),t(Se);var Ie=n(Se),Fe=n(Ie),et=r(Fe);ee(et,{get value(){return e(Q)}}),t(Fe);var tt=n(Fe);t(D);var Le=n(D,2),Ge=r(Le),rt=n(Ge);t(Le),t(L),A(()=>{d(Y,` ${e(B).length===1?"pattern":"patterns"}`),d(we,` pattern${e(U)===1?"":"s"} across `),d(Ie,` project${e(re)===1?"":"s"}, `),d(tt,` total transfer${e(Q)===1?"":"s"}`),me(Ge,`background: ${(e(p)==="All"?"var(--color-synapse-glow)":v[e(p)])??""}`),d(rt,` ${(e(p)==="All"?"All categories":e(p))??""}`)}),_(i,a)};q(ue,i=>{e(F)?i(Ze):e(f)?i(Pe,1):i(Ne,!1)})}t(V),A(()=>_e(W,1,`lift rounded-lg px-3 py-1.5 text-xs font-medium transition ${e(p)==="All"?"bg-synapse/25 text-synapse-glow shadow-[0_0_16px_-4px_var(--color-synapse-glow)]":"text-dim hover:bg-white/[0.04] hover:text-text"}`)),ie("click",W,()=>le("All")),_(b,V),Ve()}Je(["click"]);export{Jt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js.br b/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js.br deleted file mode 100644 index 16c0afa..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js.gz b/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js.gz deleted file mode 100644 index b2eb33c..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/16.CrQpRrFW.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js b/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js new file mode 100644 index 0000000..544467f --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{p as f,s as h,d as b,c as v,f as w,a as y,b as _,g as o,u as S,i as P}from"../chunks/CW7md74C.js";import{k as z}from"../chunks/DsfUoj8c.js";import{g as O}from"../chunks/Dm3aSj4w.js";import{b as $}from"../chunks/CaEJGM7b.js";import{fB as j,fC as k}from"../chunks/DSmtfx7F.js";const C=!1,D=!1,B=Object.freeze(Object.defineProperty({__proto__:null,prerender:D,ssr:C},Symbol.toStringTag,{value:"Module"}));function N(i,p){f(p,!0);const e=new URLSearchParams(window.location.search),n=e.get("demo")??"recall-path";let t=h(b(j(n)?n:"recall-path"));const u=e.get("seed")??"vestige-observatory-v1",s=e.get("frame"),m=s!==null&&s!==""?Number(s):null,l=e.get("capture")==="1"&&e.get("hud")!=="1";function g(r){if(r===o(t))return;P(t,r,!0);const a=new URL(window.location.href);a.searchParams.set("demo",r),history.replaceState(history.state,"",a)}var c=v(),d=w(c);z(d,()=>o(t),r=>{{let a=S(()=>m===null);k(r,{get demo(){return o(t)},get seed(){return u},get freezeFrame(){return m},get capture(){return l},get showSwitcher(){return o(a)},ondemochange:g,onexit:()=>O(`${$}/graph`)})}}),y(i,c),_()}export{N as component,B as universal}; diff --git a/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js.br b/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js.br new file mode 100644 index 0000000..1a66837 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js.gz b/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js.gz new file mode 100644 index 0000000..278643e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/16.DIZEZ9J2.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js.br b/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js.br deleted file mode 100644 index 0c90528..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js.gz b/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js.gz deleted file mode 100644 index 93b7671..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js b/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js new file mode 100644 index 0000000..2f166f2 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js @@ -0,0 +1,3 @@ +import"../chunks/Bzak7iHL.js";import{o as ie}from"../chunks/JVtQszIZ.js";import{p as Kt,e as a,h as n,r as e,t as N,a as m,g as t,u as H,b as Qt,s as dt,i as M,c as Ut,f as Ht,j as h,d as de,n as $t}from"../chunks/CW7md74C.js";import{d as Vt,s as d,a as ct,e as Jt}from"../chunks/D90q9c2i.js";import{i as Q}from"../chunks/9-jplUL5.js";import{e as tt,a as kt,s as bt,i as ce}from"../chunks/Cc0l8Nd4.js";import{a as ve,r as pe}from"../chunks/D8RjhgN0.js";import{s as ht}from"../chunks/BNUnVJrY.js";import{P as xe}from"../chunks/DTO0IjuV.js";import{I as W}from"../chunks/CqwrgJOn.js";import{A as X}from"../chunks/CaR6YsRq.js";import{a as ue}from"../chunks/C-rZhKee.js";function fe(w,b,A=3){const x={};for(const u of w){x[u]={};for(const f of w)x[u][f]={count:0,topNames:[]}}for(const u of b){const f=u.origin_project;if(x[f])for(const z of u.transferred_to)x[f][z]&&(x[f][z].count+=1,x[f][z].topNames.push(u.name))}const c=Math.max(0,A);for(const u of w)for(const f of w)x[u][f].topNames=x[u][f].topNames.slice(0,c);return x}function me(w,b){let A=0;for(const x of w){const c=b[x];if(c)for(const u of w){const f=c[u];f&&f.count>A&&(A=f.count)}}return A}function ge(w,b){var x;const A=[];for(const c of w)for(const u of w){const f=(x=b[c])==null?void 0:x[u];f&&f.count>0&&A.push({from:c,to:u,count:f.count,topNames:f.topNames})}return A.sort((c,u)=>u.count-c.count)}function _e(w){return w?w.length>12?w.slice(0,11)+"…":w:""}var be=h('
                  '),he=h(''),ye=h(' '),we=h('
                  '),Ce=h('
                  Top patterns
                  '),je=h('
                  No transfers recorded
                  '),$e=h('
                  '),ke=h('
                  No cross-project transfers recorded yet.
                  '),Ne=h('
                  '),Ae=h(''),Pe=h('
                  ');function Fe(w,b){Kt(b,!0);const A=H(()=>fe(b.projects,b.patterns)),x=H(()=>me(b.projects,t(A))||1);let c=dt(null);function u(s){if(s===0)return"background: rgba(255,255,255,0.02); border-color: rgba(99,102,241,0.05);";const r=s/t(x),o=.1+r*.7;if(r<.5)return`background: rgba(99, 102, 241, ${o.toFixed(3)}); border-color: rgba(129, 140, 248, ${(o*.6).toFixed(3)}); box-shadow: 0 0 ${(r*14).toFixed(1)}px rgba(129, 140, 248, ${(r*.45).toFixed(3)});`;{const p=(r-.5)*2,l=Math.round(99+69*p),g=Math.round(102+-17*p),_=Math.round(241+6*p);return`background: rgba(${l}, ${g}, ${_}, ${o.toFixed(3)}); border-color: rgba(192, 132, 252, ${(o*.7).toFixed(3)}); box-shadow: 0 0 ${(6+r*18).toFixed(1)}px rgba(192, 132, 252, ${(r*.55).toFixed(3)});`}}function f(s){if(s===0)return"text-muted";const r=s/t(x);return r>=.5?"text-bright font-semibold":r>=.2?"text-text":"text-dim"}function z(s,r,o){const l=s.currentTarget.getBoundingClientRect();M(c,{from:r,to:o,x:l.left+l.width/2,y:l.top},!0)}function k(){M(c,null)}const G=_e;function q(s,r){return b.selectedCell!==null&&b.selectedCell.from===s&&b.selectedCell.to===r}const B=H(()=>ge(b.projects,t(A)));var J=Pe(),et=a(J),K=a(et),vt=n(a(K),2),yt=n(a(vt),4),Nt=a(yt,!0);e(yt),e(vt),e(K);var pt=n(K,2),at=a(pt),rt=a(at),st=a(rt),U=n(a(st));tt(U,16,()=>b.projects,s=>s,(s,r)=>{var o=be(),p=a(o),l=a(p),g=a(l,!0);e(l),e(p),e(o),N(_=>{kt(o,"title",r),d(g,_)},[()=>G(r)]),m(s,o)}),e(st),e(rt);var xt=n(rt);tt(xt,20,()=>b.projects,s=>s,(s,r)=>{var o=ye(),p=a(o),l=a(p,!0);e(p);var g=n(p);tt(g,16,()=>b.projects,_=>_,(_,C)=>{const y=H(()=>t(A)[r][C]),I=H(()=>r===C);var P=he(),F=a(P),Y=a(F),V=a(Y,!0);e(Y),e(F),e(P),N((D,T,j)=>{ht(F,`${D??""} ${T??""} ${t(I)&&t(y).count>0?"border-style: dashed;":""}`),kt(F,"aria-label",`${t(y).count??""} patterns from ${r??""} to ${C??""}`),bt(Y,1,`text-[11px] ${j??""}`),d(V,t(y).count||"")},[()=>u(t(y).count),()=>q(r,C)?"outline: 2px solid var(--color-dream-glow); outline-offset: 1px;":"",()=>f(t(y).count)]),ct("click",F,()=>b.onCellClick(r,C)),Jt("mouseenter",F,D=>z(D,r,C)),Jt("mouseleave",F,k),m(_,P)}),e(o),N(_=>{kt(p,"title",r),d(l,_)},[()=>G(r)]),m(s,o)}),e(xt),e(at),e(pt);var At=n(pt,2);{var Pt=s=>{const r=H(()=>t(A)[t(c).from][t(c).to]);var o=$e(),p=a(o),l=a(p),g=a(l,!0);e(l);var _=n(l,4),C=a(_,!0);e(_),e(p);var y=n(p,2),I=a(y),P=n(I),F=a(P);e(P),e(y);var Y=n(y,2);{var V=T=>{var j=Ce(),E=n(a(j),2);tt(E,17,()=>t(r).topNames,ce,(Z,ft)=>{var nt=we(),mt=a(nt);e(nt),N(()=>d(mt,`· ${t(ft)??""}`)),m(Z,nt)}),e(j),m(T,j)},D=T=>{var j=je();m(T,j)};Q(Y,T=>{t(r).topNames.length>0?T(V):T(D,!1)})}e(o),N((T,j)=>{ht(o,`left: ${t(c).x??""}px; top: ${t(c).y-12}px; transform: translate(-50%, -100%);`),d(g,T),d(C,j),d(I,`${t(r).count??""} `),d(F,`${t(r).count===1?"pattern":"patterns"} transferred`)},[()=>G(t(c).from),()=>G(t(c).to)]),m(s,o)};Q(At,s=>{t(c)&&s(Pt)})}e(et);var wt=n(et,2),ut=a(wt),Ft=a(ut);e(ut);var Tt=n(ut,2);{var i=s=>{var r=ke();m(s,r)},v=s=>{var r=Ut(),o=Ht(r);tt(o,17,()=>t(B),p=>p.from+"->"+p.to,(p,l)=>{var g=Ae(),_=a(g),C=a(_),y=a(C),I=a(y,!0);e(y);var P=n(y,4),F=a(P,!0);e(P),e(C);var Y=n(C,2);{var V=j=>{var E=Ne(),Z=a(E,!0);e(E),N(ft=>d(Z,ft),[()=>t(l).topNames.join(" · ")]),m(j,E)};Q(Y,j=>{t(l).topNames.length>0&&j(V)})}e(_);var D=n(_,2),T=a(D,!0);e(D),e(g),N((j,E,Z)=>{bt(g,1,`flex w-full items-center justify-between rounded-lg border border-synapse/10 bg-white/[0.02] p-3 transition hover:border-synapse/30 hover:bg-white/[0.04] ${j??""}`),d(I,E),d(F,Z),d(T,t(l).count)},[()=>q(t(l).from,t(l).to)?"ring-1 ring-dream-glow":"",()=>G(t(l).from),()=>G(t(l).to)]),ct("click",g,()=>b.onCellClick(t(l).from,t(l).to)),m(p,g)}),m(s,r)};Q(Tt,s=>{t(B).length===0?s(i):s(v,!1)})}e(wt),e(J),N(()=>{d(Nt,t(x)),d(Ft,`${t(B).length??""} transfer pair${t(B).length===1?"":"s"} · tap to filter`)}),m(w,J),Qt()}Vt(["click"]);var Te=h(' '),Me=h(''),ze=h(`
                  Couldn't load pattern transfers
                  `),Ee=h('
                  '),Re=h('
                  Filtered to
                  '),Se=h('
                  No matching patterns
                  '),He=h('
                • '),Ie=h('
                    '),De=h('
                    ',1),Oe=h('
                    ');function Xe(w,b){Kt(b,!0);const A=["ErrorHandling","AsyncConcurrency","Testing","Architecture","Performance","Security"],x={ErrorHandling:"var(--color-decay)",AsyncConcurrency:"var(--color-synapse-glow)",Testing:"var(--color-recall)",Architecture:"var(--color-dream-glow)",Performance:"var(--color-warning)",Security:"var(--color-node-pattern)"};let c=dt("All"),u=dt(de({projects:[],patterns:[]})),f=dt(!0),z=dt(null),k=dt(null);async function G(){M(f,!0),M(z,null);try{M(u,await ue.crossProjectPatterns(),!0)}catch(i){M(z,i instanceof Error?i.message:"Failed to load pattern transfers",!0),M(u,{projects:[],patterns:[]},!0)}finally{M(f,!1)}}ie(()=>G());const q=H(()=>t(c)==="All"?t(u).patterns:t(u).patterns.filter(i=>i.category===t(c))),B=H(()=>[...t(k)?t(q).filter(v=>v.origin_project===t(k).from&&v.transferred_to.includes(t(k).to)):t(q)].sort((v,s)=>s.transfer_count-v.transfer_count)),J=H(()=>t(q).reduce((i,v)=>i+v.transferred_to.length,0)),et=H(()=>t(u).projects.length),K=H(()=>t(q).length);function vt(i){M(c,i,!0),M(k,null)}function yt(i,v){t(k)&&t(k).from===i&&t(k).to===v?M(k,null):M(k,{from:i,to:v},!0)}function Nt(){M(k,null)}function pt(i){const v=new Date(i).getTime(),s=Date.now(),r=Math.floor((s-v)/864e5);return r<=0?"today":r===1?"1d ago":r<30?`${r}d ago`:`${Math.floor(r/30)}mo ago`}var at=Oe(),rt=a(at);xe(rt,{icon:"patterns",title:"Cross-Project Intelligence",subtitle:"Patterns learned here, applied there — across every tracked project.",accent:"dream",children:(i,v)=>{var s=Ut(),r=Ht(s);{var o=p=>{var l=Te(),g=a(l),_=a(g);X(_,{get value(){return t(K)}}),e(g);var C=n(g),y=n(C),I=a(y);X(I,{get value(){return t(J)}}),e(y);var P=n(y);e(l),N(()=>{d(C,` pattern${t(K)===1?"":"s"} + · `),d(P,` transfer${t(J)===1?"":"s"}`)}),m(p,l)};Q(r,p=>{!t(f)&&!t(z)&&p(o)})}m(i,s)},$$slots:{default:!0}});var st=n(rt,2),U=a(st),xt=a(U),At=a(xt);W(At,{name:"sparkle",size:13}),$t(),e(xt),e(U);var Pt=n(U,2);tt(Pt,16,()=>A,i=>i,(i,v)=>{var s=Me(),r=a(s),o=n(r);e(s),N(()=>{bt(s,1,`lift flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition ${t(c)===v?"bg-synapse/25 text-synapse-glow shadow-[0_0_16px_-4px_var(--color-synapse-glow)]":"text-dim hover:bg-white/[0.04] hover:text-text"}`),bt(r,1,`h-1.5 w-1.5 rounded-full transition-all duration-300 ${t(c)===v?"scale-150":""}`),ht(r,`background: ${x[v]??""}; ${t(c)===v?`box-shadow: 0 0 8px ${x[v]};`:""}`),d(o,` ${v??""}`)}),ct("click",s,()=>vt(v)),m(i,s)}),e(st);var wt=n(st,2);{var ut=i=>{var v=ze(),s=a(v),r=a(s);W(r,{name:"contradictions",size:28}),e(s);var o=n(s,4),p=a(o,!0);e(o);var l=n(o,2),g=a(l);W(g,{name:"pulse",size:14}),$t(),e(l),e(v),N(()=>d(p,t(z))),ct("click",l,G),m(i,v)},Ft=i=>{var v=Ee();m(i,v)},Tt=i=>{var v=De(),s=Ht(v),r=a(s),o=a(r);Fe(o,{get projects(){return t(u).projects},get patterns(){return t(q)},get selectedCell(){return t(k)},onCellClick:yt});var p=n(o,2);{var l=O=>{var R=Re(),S=a(R),$=a(S),ot=a($);W(ot,{name:"filter",size:13}),e($);var L=n($,4),Ct=a(L,!0);e(L);var lt=n(L,4),it=a(lt,!0);e(lt),e(S);var gt=n(S,2),_t=a(gt);W(_t,{name:"close",size:12}),$t(),e(gt),e(R),N(()=>{d(Ct,t(k).from),d(it,t(k).to)}),ct("click",gt,Nt),m(O,R)};Q(p,O=>{t(k)&&O(l)})}e(r);var g=n(r,2),_=a(g),C=a(_),y=a(C),I=a(y);W(I,{name:"patterns",size:15}),e(y),$t(),e(C);var P=n(C,2),F=a(P);X(F,{get value(){return t(B).length}});var Y=n(F);e(P),e(_);var V=n(_,2);{var D=O=>{var R=Se(),S=a(R),$=a(S);W($,{name:"explore",size:32}),e(S);var ot=n(S,4),L=a(ot,!0);e(ot),e(R),N(()=>d(L,t(k)?"No patterns transferred from this origin to this destination yet — try another cell or clear the filter.":"Nothing in this category yet. Pick another category to explore what travels between projects.")),m(O,R)},T=O=>{var R=Ie();tt(R,23,()=>t(B),S=>S.name,(S,$,ot)=>{var L=He(),Ct=a(L),lt=a(Ct),it=a(lt),gt=a(it,!0);e(it);var _t=n(it,2),jt=a(_t),ae=a(jt,!0);e(jt);var Lt=n(jt,2),re=a(Lt,!0);e(Lt),e(_t);var Gt=n(_t,2),zt=a(Gt),se=a(zt,!0);e(zt);var Bt=n(zt,4),ne=a(Bt);e(Bt),e(Gt),e(lt);var Yt=n(lt,2),Et=a(Yt),oe=a(Et);X(oe,{get value(){return t($).transfer_count}}),e(Et);var Zt=n(Et,2),le=a(Zt);e(Zt),e(Yt),e(Ct),e(L),ve(L,(Rt,St)=>{var qt;return(qt=pe)==null?void 0:qt(Rt,St)},()=>({y:12,delay:Math.min(t(ot)*45,360)})),N((Rt,St)=>{kt(it,"title",t($).name),d(gt,t($).name),ht(jt,`border-color: ${x[t($).category]??""}66; color: ${x[t($).category]??""}; background: ${x[t($).category]??""}1a;`),d(ae,t($).category),d(re,Rt),d(se,t($).origin_project),d(ne,`${t($).transferred_to.length??""} + ${t($).transferred_to.length===1?"project":"projects"}`),d(le,`${St??""}%`)},[()=>pt(t($).last_used),()=>(t($).confidence*100).toFixed(0)]),m(S,L)}),e(R),m(O,R)};Q(V,O=>{t(B).length===0?O(D):O(T,!1)})}e(g),e(s);var j=n(s,2),E=a(j),Z=a(E),ft=a(Z);X(ft,{get value(){return t(K)}}),e(Z);var nt=n(Z),mt=n(nt),Wt=a(mt);X(Wt,{get value(){return t(et)}}),e(mt);var It=n(mt),Mt=n(It),Xt=a(Mt);X(Xt,{get value(){return t(J)}}),e(Mt);var te=n(Mt);e(E);var Dt=n(E,2),Ot=a(Dt),ee=n(Ot);e(Dt),e(j),N(()=>{d(Y,` ${t(B).length===1?"pattern":"patterns"}`),d(nt,` pattern${t(K)===1?"":"s"} across `),d(It,` project${t(et)===1?"":"s"}, `),d(te,` total transfer${t(J)===1?"":"s"}`),ht(Ot,`background: ${(t(c)==="All"?"var(--color-synapse-glow)":x[t(c)])??""}`),d(ee,` ${(t(c)==="All"?"All categories":t(c))??""}`)}),m(i,v)};Q(wt,i=>{t(z)?i(ut):t(f)?i(Ft,1):i(Tt,!1)})}e(at),N(()=>bt(U,1,`lift rounded-lg px-3 py-1.5 text-xs font-medium transition ${t(c)==="All"?"bg-synapse/25 text-synapse-glow shadow-[0_0_16px_-4px_var(--color-synapse-glow)]":"text-dim hover:bg-white/[0.04] hover:text-text"}`)),ct("click",U,()=>vt("All")),m(w,at),Qt()}Vt(["click"]);export{Xe as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js.br b/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js.br new file mode 100644 index 0000000..af365a2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js.gz b/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js.gz new file mode 100644 index 0000000..5f968f8 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/17.cONpz_b8.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js.br b/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js.br deleted file mode 100644 index 0010bc8..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js.gz b/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js.gz deleted file mode 100644 index 468dc18..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js b/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js similarity index 87% rename from apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js rename to apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js index deea646..ea51e83 100644 --- a/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js +++ b/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js @@ -1,2 +1,2 @@ -import"../chunks/Bzak7iHL.js";import{o as Gt}from"../chunks/TZu9D97Z.js";import{p as tt,e as s,g as e,h as a,r as t,n as Z,t as C,a as g,b as st,j as f,u as re,s as he,d as Ht,x as Wt,i as L,ar as Kt,f as ft,au as wt}from"../chunks/wpu9U-D0.js";import{s as o,d as Vt,a as Ye}from"../chunks/D8mhvFt8.js";import{i as D}from"../chunks/DKve45Wd.js";import{e as ce,s as at,a as Y,r as Qt,i as Ae}from"../chunks/60_R_Vbt.js";import{h as Ut}from"../chunks/DzesjbbJ.js";import{a as Xe,r as Yt}from"../chunks/P1-U_Xsj.js";import{s as w}from"../chunks/EqHb-9AZ.js";import{b as Xt}from"../chunks/CnZzd20v.js";import{b as _t}from"../chunks/g5OnrUYZ.js";import{a as Zt}from"../chunks/CZfHMhLI.js";import{p as ue}from"../chunks/ByYB047u.js";import{N as Jt}from"../chunks/CcUbQ_Wl.js";import{P as es}from"../chunks/BHDZZvku.js";import{I as be}from"../chunks/D7A-gG4Z.js";import{A as Ze}from"../chunks/DcKTNC6e.js";import{m as ts,s as ss}from"../chunks/DPdYG9yN.js";var as=f('
                    '),ns=f('

                    '),rs=f("
                    ");function yt(l,v){tt(v,!0);let J=ue(v,"intent",3,"Synthesis"),B=ue(v,"memoriesAnalyzed",3,0),R=ue(v,"evidenceCount",3,0),i=ue(v,"contradictionCount",3,0),G=ue(v,"supersededCount",3,0),E=ue(v,"running",3,!1),H=ue(v,"stageHints",19,()=>({}));const I=[{key:"broad",icon:"◎",label:"Broad Retrieval",base:"Hybrid BM25 + semantic (3x overfetch) then cross-encoder rerank"},{key:"spreading",icon:"⟿",label:"Spreading Activation",base:"Collins & Loftus — expand via graph edges to surface what search missed"},{key:"fsrs",icon:"▲",label:"FSRS Trust Scoring",base:"retention × stability × reps ÷ lapses — which memories have earned trust"},{key:"intent",icon:"◆",label:"Intent Classification",base:"FactCheck / Timeline / RootCause / Comparison / Synthesis"},{key:"supersession",icon:"↗",label:"Temporal Supersession",base:"Newer high-trust memories replace older ones on the same fact"},{key:"contradiction",icon:"⚡",label:"Contradiction Analysis",base:"Only flag conflicts between memories where BOTH have trust > 0.3"},{key:"relation",icon:"⬡",label:"Relation Assessment",base:"Per pair: Supports / Contradicts / Supersedes / Irrelevant"},{key:"template",icon:"❖",label:"Template Reasoning",base:"Build the natural-language reasoning chain you validate"}],ee=re(()=>({broad:B()?`Analyzed ${B()} memories · ${R()} survived ranking`:void 0,intent:J()?`Classified as ${J()}`:void 0,supersession:G()?`${G()} outdated memor${G()===1?"y":"ies"} superseded`:void 0,contradiction:i()?`${i()} real conflict${i()===1?"":"s"} between trusted memories`:"No conflicts between trusted memories"}));function te($,K){return H()[$]??e(ee)[$]??K}var W=rs();let qe;ce(W,23,()=>I,$=>$.key,($,K,V)=>{var O=ns(),se=s(O);{var pe=N=>{var oe=as();C(()=>w(oe,`animation-delay: ${e(V)*140+120}ms;`)),g(N,oe)};D(se,N=>{e(V){w(O,`animation-delay: ${e(V)*140}ms;`),w(M,`animation-delay: ${e(V)*140}ms;`),o(me,e(K).icon),o(Ee,`0${e(V)+1}`),o(we,e(K).label),o(ne,N)},[()=>te(e(K).key,e(K).base)]),g($,O)}),t(W),C(()=>qe=at(W,1,"reasoning-chain space-y-2 svelte-9hm057",null,qe,{running:E()})),g(l,W),st()}const is="#10b981",ls="#f59e0b",et="#ef4444",ht="#8B95A5",bt={primary:{label:"Primary",accent:"synapse",icon:"◈"},supporting:{label:"Supporting",accent:"recall",icon:"◇"},contradicting:{label:"Contradicting",accent:"decay",icon:"⚠"},superseded:{label:"Superseded",accent:"muted",icon:"⊘"}};function os(l){return bt[l]??bt.supporting}function Oe(l){return Number.isFinite(l)?l>75?is:l>=40?ls:et:et}function qt(l){return Number.isFinite(l)?l>75?"HIGH CONFIDENCE":l>=40?"MIXED SIGNAL":"LOW CONFIDENCE":"LOW CONFIDENCE"}function Je(l){return Number.isFinite(l)?Oe(l*100):et}function vs(l){return!Number.isFinite(l)||l<0?0:l>1?1:l}function ds(l){return vs(l)*100}function cs(l){return l?Jt[l]??ht:ht}function us(l,v){if(l==null||typeof l!="string"||l.trim()==="")return"—";const J=new Date(l);if(Number.isNaN(J.getTime()))return l;try{return J.toLocaleDateString(v,{month:"short",day:"numeric",year:"numeric"})}catch{return l}}function ps(l,v=8){return l?l.length>v?l.slice(0,v):l:""}var ms=f(' '),xs=f('

                    Trust
                    FSRS · reps × retention
                    ');function gs(l,v){tt(v,!0);let J=ue(v,"index",3,0);const B=re(()=>ds(v.trust)),R=re(()=>os(v.role)),i=re(()=>ps(v.id)),G=re(()=>cs(v.nodeType));var E=xs();let H;var I=s(E),ee=s(I),te=s(ee),W=s(te),qe=s(W,!0);t(W);var $=a(W,1,!0);t(te);var K=a(te,2);{var V=ne=>{var N=ms(),oe=s(N,!0);t(N),C(()=>{w(N,`color: ${e(G)??""}`),o(oe,v.nodeType)}),g(ne,N)};D(K,ne=>{v.nodeType&&ne(V)})}t(ee);var O=a(ee,2),se=s(O);t(O),t(I);var pe=a(I,2),M=s(pe,!0);t(pe);var P=a(pe,2),me=s(P),ie=a(s(me),2),xe=s(ie);t(ie),t(me);var ae=a(me,2),Ee=s(ae);t(ae),t(P);var le=a(P,2),we=s(le),ge=s(we,!0);t(we),Z(2),t(le),t(E),C((ne,N,oe,r,n)=>{H=at(E,1,"evidence-card glass rounded-xl p-4 space-y-3 transition relative svelte-ksja6x",null,H,{contradicting:v.role==="contradicting",primary:v.role==="primary",superseded:v.role==="superseded"}),w(E,`animation-delay: ${J()*80}ms;`),Y(E,"data-evidence-id",v.id),o(qe,e(R).icon),o($,e(R).label),Y(O,"title",v.id),o(se,`#${e(i)??""}`),o(M,v.preview),w(ie,`color: ${ne??""}`),o(xe,`${N??""}%`),w(Ee,`width: ${e(B)??""}%; background: ${oe??""}; box-shadow: 0 0 8px ${r??""}80;`),o(ge,n)},[()=>Je(v.trust),()=>e(B).toFixed(0),()=>Je(v.trust),()=>Je(v.trust),()=>us(v.date)]),g(l,E),st()}var fs=f(' deep_reference'),_s=f(''),ys=f('
                    Try
                    '),hs=f('
                    Error:
                    '),bs=f('
                    Running cognitive pipeline
                    '),qs=f('

                    Reasoning

                    intent: · analyzed ·
                    '),ws=wt('',1),ks=wt(''),Ss=f('

                    '),Cs=f('

                    Contradictions Detected ()

                    '),Rs=f('
                    '),As=f('

                    Superseded

                    '),Es=f('
                    '),Ns=f('

                    Evolution

                    '),Ts=f('

                    '),js=f('

                    Related Insights

                    '),Fs=f('
                    Confidence
                    %
                    intent: ·
                    Primary Source

                    ·

                    Cognitive Pipeline

                    Evidence

                    primary supporting contradicting superseded
                    ',1),zs=f(`

                    Ask anything. Vestige will run the full reasoning pipeline and show you its work.

                    8-stage pipeline: retrieval → rerank → activation → trust-score → supersession → - contradiction → relations → chain. Zero LLM calls, 100% local.

                    `),Ls=f('
                    ');function ea(l,v){tt(v,!0);async function J(r){var je,$e,Fe;const n=await Zt.deepReference(r,20),k=(Array.isArray(n.evidence)?n.evidence:[]).map(c=>{const j=typeof c.trust=="number"?c.trust:0,ze=j>1?j/100:j,Le=c.role||"supporting";return{id:String(c.id??""),trust:Math.max(0,Math.min(1,ze)),date:String(c.date??""),role:Le,preview:String(c.preview??""),nodeType:c.node_type?String(c.node_type):c.nodeType?String(c.nodeType):void 0}}),_=n.recommended,T={answer_preview:String((_==null?void 0:_.answer_preview)??((je=k[0])==null?void 0:je.preview)??""),memory_id:String((_==null?void 0:_.memory_id)??(($e=k[0])==null?void 0:$e.id)??""),trust_score:(()=>{var j;const c=_==null?void 0:_.trust_score;return typeof c=="number"?c>1?c/100:c:((j=k[0])==null?void 0:j.trust)??0})(),date:String((_==null?void 0:_.date)??((Fe=k[0])==null?void 0:Fe.date)??"")},ke=(Array.isArray(n.contradictions)?n.contradictions:[]).map(c=>({a_id:String(c.a_id??""),b_id:String(c.b_id??""),summary:String(c.summary??c.reason??"Trust-weighted conflict between high-FSRS memories.")})),Ne=(Array.isArray(n.superseded)?n.superseded:[]).map(c=>({old_id:String(c.old_id??""),new_id:String(c.new_id??T.memory_id??""),reason:String(c.reason??"Superseded by newer memory with higher FSRS trust.")})),Se=(Array.isArray(n.evolution)?n.evolution:[]).map(c=>({date:String(c.date??""),summary:String(c.summary??c.preview??""),trust:(()=>{const j=c.trust;return typeof j=="number"?j>1?j/100:j:0})()})),Me=Array.isArray(n.related_insights)?n.related_insights:[],fe=typeof n.confidence=="number"?n.confidence:0,_e=fe>1?Math.round(fe):Math.round(fe*100),Pe=String(n.intent??"Synthesis"),Ie=String(n.reasoning??n.guidance??""),Te=typeof n.memoriesAnalyzed=="number"?n.memoriesAnalyzed:k.length;return{intent:Pe,reasoning:Ie,recommended:T,evidence:k,contradictions:ke,superseded:Ne,evolution:Se,related_insights:Me,confidence:_e,memoriesAnalyzed:Te}}let B=he(""),R=he(!1),i=he(null),G=he(null),E=he(null),H=he(null),I=he(Ht([]));async function ee(){const r=e(B).trim();if(!(!r||e(R))){L(R,!0),L(G,null),L(i,null),L(I,[],!0);try{L(i,await J(r),!0),requestAnimationFrame(()=>requestAnimationFrame(te))}catch(n){L(G,n instanceof Error?n.message:"Unknown error",!0)}finally{L(R,!1)}}}function te(){if(!e(i)||!e(H)||e(i).contradictions.length===0){L(I,[],!0);return}const r=e(H).getBoundingClientRect(),n=[];for(const p of e(i).contradictions){const k=e(H).querySelector(`[data-evidence-id="${p.a_id}"]`),_=e(H).querySelector(`[data-evidence-id="${p.b_id}"]`);if(!k||!_)continue;const T=k.getBoundingClientRect(),Q=_.getBoundingClientRect();n.push({x1:T.left-r.left+T.width/2,y1:T.top-r.top+T.height/2,x2:Q.left-r.left+Q.width/2,y2:Q.top-r.top+Q.height/2})}L(I,n,!0)}function W(r){var n,p;(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),(n=e(E))==null||n.focus(),(p=e(E))==null||p.select())}Gt(()=>{var r;return(r=e(E))==null||r.focus(),window.addEventListener("keydown",W),window.addEventListener("resize",te),()=>{window.removeEventListener("keydown",W),window.removeEventListener("resize",te)}});const qe=["What port does the dev server use?","Should I enable prefix caching with vLLM?","Why did the benchmark score drop after the parser change?","How does FSRS-6 trust scoring work?"];var $=Ls();Ut("q2v96u",r=>{Wt(()=>{Kt.title="Reasoning Theater · Vestige"})});var K=s($);es(K,{icon:"reasoning",title:"Reasoning Theater",subtitle:"Watch Vestige reason — the 8-stage cognitive pipeline runs locally and returns a pre-built answer with trust-scored evidence.",accent:"dream",children:(r,n)=>{var p=fs();g(r,p)},$$slots:{default:!0}});var V=a(K,2),O=s(V),se=s(O),pe=s(se);be(pe,{name:"reasoning",size:20}),t(se);var M=a(se,2);Qt(M),_t(M,r=>L(E,r),()=>e(E));var P=a(M,4),me=s(P,!0);t(P),Xe(P,r=>{var n;return(n=ts)==null?void 0:n(r)}),t(O);var ie=a(O,2);{var xe=r=>{var n=ys(),p=a(s(n),2);ce(p,17,()=>qe,Ae,(k,_)=>{var T=_s(),Q=s(T,!0);t(T),C(()=>o(Q,e(_))),Ye("click",T,()=>{L(B,e(_),!0),ee()}),g(k,T)}),t(n),g(r,n)};D(ie,r=>{!e(i)&&!e(R)&&r(xe)})}t(V);var ae=a(V,2);{var Ee=r=>{var n=hs(),p=a(s(n));t(n),C(()=>o(p,` ${e(G)??""}`)),g(r,n)};D(ae,r=>{e(G)&&r(Ee)})}var le=a(ae,2);{var we=r=>{var n=bs(),p=a(s(n),2);yt(p,{running:!0}),t(n),g(r,n)};D(le,r=>{e(R)&&r(we)})}var ge=a(le,2);{var ne=r=>{const n=re(()=>e(i).confidence),p=re(()=>Oe(e(n)));var k=Fs(),_=ft(k);{var T=u=>{var d=qs(),x=s(d),y=s(x),m=s(y),h=s(m);be(h,{name:"reasoning",size:16}),t(m),Z(),t(y);var F=a(y,2),S=s(F),b=a(s(S)),q=s(b,!0);t(b),t(S);var z=a(S,4),A=s(z);Ze(A,{get value(){return e(i).memoriesAnalyzed}}),Z(),t(z);var U=a(z,4),ve=s(U);t(U),t(F),t(x);var X=a(x,2),Ce=s(X),Re=s(Ce,!0);t(Ce),t(X),Xe(X,ye=>{var de;return(de=ss)==null?void 0:de(ye)}),t(d),Xe(d,ye=>{var de;return(de=Yt)==null?void 0:de(ye)}),C(ye=>{o(q,e(i).intent),w(U,`color: ${e(p)??""}`),o(ve,`${e(n)??""}% ${ye??""}`),w(X,`box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.03), 0 0 32px ${e(p)??""}20, 0 8px 32px rgba(0,0,0,0.4); border-color: ${e(p)??""}35;`),o(Re,e(i).reasoning)},[()=>qt(e(n))]),g(u,d)};D(_,u=>{e(i).reasoning&&u(T)})}var Q=a(_,2),ke=s(Q),De=a(s(ke),2),Ne=s(De),nt=s(Ne);Ze(nt,{get value(){return e(n)}}),Z(),t(Ne),t(De);var Se=a(De,2),Me=s(Se,!0);t(Se);var fe=a(Se,2),_e=a(s(fe)),Pe=s(_e);t(_e),t(fe);var Ie=a(fe,2),Te=s(Ie),je=a(s(Te)),$e=s(je,!0);t(je),t(Te);var Fe=a(Te,4),c=s(Fe);t(Fe),t(Ie),t(ke);var j=a(ke,2),ze=s(j),Le=a(s(ze),2),kt=s(Le);t(Le),t(ze);var Be=a(ze,2),St=s(Be,!0);t(Be);var rt=a(Be,2),Ge=s(rt),it=s(Ge),Ct=a(it);t(Ge);var lt=a(Ge,4),Rt=s(lt,!0);t(lt),t(rt),t(j),t(Q);var He=a(Q,2),We=s(He),ot=s(We),At=s(ot);be(At,{name:"activation",size:15}),t(ot),Z(),t(We);var vt=a(We,2),Et=s(vt);yt(Et,{get intent(){return e(i).intent},get memoriesAnalyzed(){return e(i).memoriesAnalyzed},get evidenceCount(){return e(i).evidence.length},get contradictionCount(){return e(i).contradictions.length},get supersededCount(){return e(i).superseded.length}}),t(vt),t(He);var Ke=a(He,2),Ve=s(Ke),dt=s(Ve),Qe=s(dt),Nt=s(Qe);be(Nt,{name:"memories",size:15}),t(Qe);var ct=a(Qe,2),Tt=s(ct);t(ct),t(dt),Z(2),t(Ve);var Ue=a(Ve,2),ut=s(Ue);ce(ut,19,()=>e(i).evidence,u=>u.id,(u,d,x)=>{gs(u,{get id(){return e(d).id},get trust(){return e(d).trust},get date(){return e(d).date},get role(){return e(d).role},get preview(){return e(d).preview},get nodeType(){return e(d).nodeType},get index(){return e(x)}})});var jt=a(ut,2);{var Ft=u=>{var d=ks(),x=a(s(d));ce(x,17,()=>e(I),Ae,(y,m,h)=>{const F=re(()=>(e(m).x1+e(m).x2)/2),S=re(()=>Math.min(e(m).y1,e(m).y2)-28);var b=ws(),q=ft(b);w(q,`animation-delay: ${h*120+600}ms;`);var z=a(q);w(z,`animation-delay: ${h*120+600}ms;`);var A=a(z);w(A,`animation-delay: ${h*120+700}ms;`),C(()=>{Y(q,"d",`M ${e(m).x1??""} ${e(m).y1??""} Q ${e(F)??""} ${e(S)??""} ${e(m).x2??""} ${e(m).y2??""}`),Y(z,"cx",e(m).x1),Y(z,"cy",e(m).y1),Y(A,"cx",e(m).x2),Y(A,"cy",e(m).y2)}),g(y,b)}),t(d),g(u,d)};D(jt,u=>{e(I).length>0&&u(Ft)})}t(Ue),_t(Ue,u=>L(H,u),()=>e(H)),t(Ke);var pt=a(Ke,2);{var zt=u=>{var d=Cs(),x=s(d),y=s(x),m=s(y);be(m,{name:"contradictions",size:15}),t(y);var h=a(y,2),F=a(s(h));Ze(F,{get value(){return e(i).contradictions.length}}),Z(),t(h),t(x);var S=a(x,2);ce(S,21,()=>e(i).contradictions,Ae,(b,q,z)=>{var A=Ss(),U=a(s(A),2),ve=s(U),X=s(ve),Ce=s(X);t(X);var Re=a(X,4),ye=s(Re);t(Re),t(ve);var de=a(ve,2),Ot=s(de,!0);t(de),t(U);var Mt=a(U,2);Mt.textContent=`pair ${z+1}`,t(A),C((Pt,Bt)=>{o(Ce,`#${Pt??""}`),o(ye,`#${Bt??""}`),o(Ot,e(q).summary)},[()=>e(q).a_id.slice(0,8),()=>e(q).b_id.slice(0,8)]),g(b,A)}),t(S),t(d),g(u,d)};D(pt,u=>{e(i).contradictions.length>0&&u(zt)})}var mt=a(pt,2);{var Lt=u=>{var d=As(),x=s(d),y=a(s(x),2),m=s(y);t(y),t(x);var h=a(x,2);ce(h,21,()=>e(i).superseded,Ae,(F,S)=>{var b=Rs(),q=s(b),z=s(q);t(q);var A=a(q,4),U=s(A);t(A);var ve=a(A,2),X=s(ve,!0);t(ve),t(b),C((Ce,Re)=>{o(z,`#${Ce??""}`),o(U,`#${Re??""}`),o(X,e(S).reason)},[()=>e(S).old_id.slice(0,8),()=>e(S).new_id.slice(0,8)]),g(F,b)}),t(h),t(d),C(()=>o(m,`(${e(i).superseded.length??""})`)),g(u,d)};D(mt,u=>{e(i).superseded.length>0&&u(Lt)})}var xt=a(mt,2),gt=s(xt);{var Dt=u=>{var d=Ns(),x=a(s(d),2);ce(x,21,()=>e(i).evolution,Ae,(y,m)=>{var h=Es(),F=s(h),S=s(F,!0);t(F);var b=a(F,2),q=a(b,2),z=s(q,!0);t(q),t(h),C((A,U)=>{o(S,A),w(b,`background: ${U??""}`),o(z,e(m).summary)},[()=>new Date(e(m).date).toLocaleDateString(void 0,{month:"short",day:"numeric"}),()=>Oe(e(m).trust*100)]),g(y,h)}),t(x),t(d),g(u,d)};D(gt,u=>{e(i).evolution.length>0&&u(Dt)})}var It=a(gt,2);{var $t=u=>{var d=js(),x=s(d),y=s(x),m=s(y);be(m,{name:"sparkle",size:15}),t(y),Z(),t(x);var h=a(x,2);ce(h,21,()=>e(i).related_insights,Ae,(F,S)=>{var b=Ts(),q=a(s(b),1,!0);t(b),C(()=>o(q,e(S))),g(F,b)}),t(h),t(d),g(u,d)};D(It,u=>{e(i).related_insights.length>0&&u($t)})}t(xt),C((u,d,x,y,m)=>{w(ke,`box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.03), 0 0 32px ${e(p)??""}30, 0 8px 32px rgba(0,0,0,0.4); border-color: ${e(p)??""}40;`),w(Ne,`color: ${e(p)??""}; text-shadow: 0 0 24px ${e(p)??""}80;`),w(Se,`color: ${e(p)??""}`),o(Me,u),Y(_e,"width",e(n)/100*220),Y(_e,"fill",e(p)),w(_e,`filter: drop-shadow(0 0 6px ${e(p)??""});`),Y(Pe,"to",e(n)/100*220),o($e,e(i).intent),o(c,`${e(i).memoriesAnalyzed??""} analyzed`),Y(Le,"title",e(i).recommended.memory_id),o(kt,`#${d??""}`),o(St,e(i).recommended.answer_preview),w(it,`background: ${x??""}`),o(Ct,` Trust ${y??""}%`),o(Rt,m),o(Tt,`(${e(i).evidence.length??""})`)},[()=>qt(e(n)),()=>e(i).recommended.memory_id.slice(0,8),()=>Oe(e(i).recommended.trust_score*100),()=>(e(i).recommended.trust_score*100).toFixed(0),()=>new Date(e(i).recommended.date).toLocaleDateString()]),g(r,k)};D(ge,r=>{e(i)&&!e(R)&&r(ne)})}var N=a(ge,2);{var oe=r=>{var n=zs(),p=s(n),k=s(p);be(k,{name:"reasoning",size:44,strokeWidth:1.2}),t(p),Z(4),t(n),g(r,n)};D(N,r=>{!e(i)&&!e(R)&&!e(G)&&r(oe)})}t($),C(r=>{at(se,1,`text-synapse-glow ${e(R)?"breathe":""}`,"svelte-q2v96u"),P.disabled=r,o(me,e(R)?"Reasoning…":"Reason")},[()=>!e(B).trim()||e(R)]),Ye("keydown",M,r=>r.key==="Enter"&&ee()),Xt(M,()=>e(B),r=>L(B,r)),Ye("click",P,ee),g(l,$),st()}Vt(["keydown","click"]);export{ea as component}; +import"../chunks/Bzak7iHL.js";import{o as Gt}from"../chunks/JVtQszIZ.js";import{p as tt,e as s,g as e,h as a,r as t,n as Z,t as C,a as g,b as st,j as f,u as re,s as he,d as Ht,A as Wt,i as L,as as Kt,f as ft,av as wt}from"../chunks/CW7md74C.js";import{s as o,d as Vt,a as Ye}from"../chunks/D90q9c2i.js";import{i as D}from"../chunks/9-jplUL5.js";import{e as ce,s as at,a as Y,r as Qt,i as Re}from"../chunks/Cc0l8Nd4.js";import{h as Ut}from"../chunks/C98jjAli.js";import{a as Xe,r as Yt}from"../chunks/D8RjhgN0.js";import{s as w}from"../chunks/BNUnVJrY.js";import{b as Xt}from"../chunks/CFefTDKL.js";import{b as _t}from"../chunks/ChcFQRZo.js";import{a as Zt}from"../chunks/C-rZhKee.js";import{p as ue}from"../chunks/BjbQ7qSx.js";import{N as Jt}from"../chunks/CcUbQ_Wl.js";import{P as es}from"../chunks/DTO0IjuV.js";import{I as be}from"../chunks/CqwrgJOn.js";import{A as Ze}from"../chunks/CaR6YsRq.js";import{m as ts,s as ss}from"../chunks/DPdYG9yN.js";var as=f('
                    '),ns=f('

                    '),rs=f("
                    ");function yt(l,v){tt(v,!0);let J=ue(v,"intent",3,"Synthesis"),B=ue(v,"memoriesAnalyzed",3,0),A=ue(v,"evidenceCount",3,0),i=ue(v,"contradictionCount",3,0),G=ue(v,"supersededCount",3,0),E=ue(v,"running",3,!1),H=ue(v,"stageHints",19,()=>({}));const I=[{key:"broad",icon:"◎",label:"Broad Retrieval",base:"Hybrid BM25 + semantic (3x overfetch) then cross-encoder rerank"},{key:"spreading",icon:"⟿",label:"Spreading Activation",base:"Collins & Loftus — expand via graph edges to surface what search missed"},{key:"fsrs",icon:"▲",label:"FSRS Trust Scoring",base:"retention × stability × reps ÷ lapses — which memories have earned trust"},{key:"intent",icon:"◆",label:"Intent Classification",base:"FactCheck / Timeline / RootCause / Comparison / Synthesis"},{key:"supersession",icon:"↗",label:"Temporal Supersession",base:"Newer high-trust memories replace older ones on the same fact"},{key:"contradiction",icon:"⚡",label:"Contradiction Analysis",base:"Only flag conflicts between memories where BOTH have trust > 0.3"},{key:"relation",icon:"⬡",label:"Relation Assessment",base:"Per pair: Supports / Contradicts / Supersedes / Irrelevant"},{key:"template",icon:"❖",label:"Template Reasoning",base:"Build the natural-language reasoning chain you validate"}],ee=re(()=>({broad:B()?`Analyzed ${B()} memories · ${A()} survived ranking`:void 0,intent:J()?`Classified as ${J()}`:void 0,supersession:G()?`${G()} outdated memor${G()===1?"y":"ies"} superseded`:void 0,contradiction:i()?`${i()} real conflict${i()===1?"":"s"} between trusted memories`:"No conflicts between trusted memories"}));function te($,K){return H()[$]??e(ee)[$]??K}var W=rs();let qe;ce(W,23,()=>I,$=>$.key,($,K,V)=>{var O=ns(),se=s(O);{var pe=N=>{var oe=as();C(()=>w(oe,`animation-delay: ${e(V)*140+120}ms;`)),g(N,oe)};D(se,N=>{e(V){w(O,`animation-delay: ${e(V)*140}ms;`),w(M,`animation-delay: ${e(V)*140}ms;`),o(me,e(K).icon),o(Ee,`0${e(V)+1}`),o(we,e(K).label),o(ne,N)},[()=>te(e(K).key,e(K).base)]),g($,O)}),t(W),C(()=>qe=at(W,1,"reasoning-chain space-y-2 svelte-9hm057",null,qe,{running:E()})),g(l,W),st()}const is="#10b981",ls="#f59e0b",et="#ef4444",ht="#8B95A5",bt={primary:{label:"Primary",accent:"synapse",icon:"◈"},supporting:{label:"Supporting",accent:"recall",icon:"◇"},contradicting:{label:"Contradicting",accent:"decay",icon:"⚠"},superseded:{label:"Superseded",accent:"muted",icon:"⊘"}};function os(l){return bt[l]??bt.supporting}function Oe(l){return Number.isFinite(l)?l>75?is:l>=40?ls:et:et}function qt(l){return Number.isFinite(l)?l>75?"HIGH CONFIDENCE":l>=40?"MIXED SIGNAL":"LOW CONFIDENCE":"LOW CONFIDENCE"}function Je(l){return Number.isFinite(l)?Oe(l*100):et}function vs(l){return!Number.isFinite(l)||l<0?0:l>1?1:l}function ds(l){return vs(l)*100}function cs(l){return l?Jt[l]??ht:ht}function us(l,v){if(l==null||typeof l!="string"||l.trim()==="")return"—";const J=new Date(l);if(Number.isNaN(J.getTime()))return l;try{return J.toLocaleDateString(v,{month:"short",day:"numeric",year:"numeric"})}catch{return l}}function ps(l,v=8){return l?l.length>v?l.slice(0,v):l:""}var ms=f(' '),xs=f('

                    Trust
                    FSRS · reps × retention
                    ');function gs(l,v){tt(v,!0);let J=ue(v,"index",3,0);const B=re(()=>ds(v.trust)),A=re(()=>os(v.role)),i=re(()=>ps(v.id)),G=re(()=>cs(v.nodeType));var E=xs();let H;var I=s(E),ee=s(I),te=s(ee),W=s(te),qe=s(W,!0);t(W);var $=a(W,1,!0);t(te);var K=a(te,2);{var V=ne=>{var N=ms(),oe=s(N,!0);t(N),C(()=>{w(N,`color: ${e(G)??""}`),o(oe,v.nodeType)}),g(ne,N)};D(K,ne=>{v.nodeType&&ne(V)})}t(ee);var O=a(ee,2),se=s(O);t(O),t(I);var pe=a(I,2),M=s(pe,!0);t(pe);var P=a(pe,2),me=s(P),ie=a(s(me),2),xe=s(ie);t(ie),t(me);var ae=a(me,2),Ee=s(ae);t(ae),t(P);var le=a(P,2),we=s(le),ge=s(we,!0);t(we),Z(2),t(le),t(E),C((ne,N,oe,r,n)=>{H=at(E,1,"evidence-card glass rounded-xl p-4 space-y-3 transition relative svelte-ksja6x",null,H,{contradicting:v.role==="contradicting",primary:v.role==="primary",superseded:v.role==="superseded"}),w(E,`animation-delay: ${J()*80}ms;`),Y(E,"data-evidence-id",v.id),o(qe,e(A).icon),o($,e(A).label),Y(O,"title",v.id),o(se,`#${e(i)??""}`),o(M,v.preview),w(ie,`color: ${ne??""}`),o(xe,`${N??""}%`),w(Ee,`width: ${e(B)??""}%; background: ${oe??""}; box-shadow: 0 0 8px ${r??""}80;`),o(ge,n)},[()=>Je(v.trust),()=>e(B).toFixed(0),()=>Je(v.trust),()=>Je(v.trust),()=>us(v.date)]),g(l,E),st()}var fs=f(' deep_reference'),_s=f(''),ys=f('
                    Try
                    '),hs=f('
                    Error:
                    '),bs=f('
                    Running cognitive pipeline
                    '),qs=f('

                    Reasoning

                    intent: · analyzed ·
                    '),ws=wt('',1),ks=wt(''),Ss=f('

                    '),Cs=f('

                    Contradictions Detected ()

                    '),As=f('
                    '),Rs=f('

                    Superseded

                    '),Es=f('
                    '),Ns=f('

                    Evolution

                    '),Ts=f('

                    '),js=f('

                    Related Insights

                    '),Fs=f('
                    Confidence
                    %
                    intent: ·
                    Primary Source

                    ·

                    Cognitive Pipeline

                    Evidence

                    primary supporting contradicting superseded
                    ',1),zs=f(`

                    Ask anything. Vestige will run the full reasoning pipeline and show you its work.

                    8-stage pipeline: retrieval → rerank → activation → trust-score → supersession → + contradiction → relations → chain. Zero LLM calls, 100% local.

                    `),Ls=f('
                    ');function ea(l,v){tt(v,!0);async function J(r){var je,$e,Fe;const n=await Zt.deepReference(r,20),k=(Array.isArray(n.evidence)?n.evidence:[]).map(c=>{const j=typeof c.trust=="number"?c.trust:0,ze=j>1?j/100:j,Le=c.role||"supporting";return{id:String(c.id??""),trust:Math.max(0,Math.min(1,ze)),date:String(c.date??""),role:Le,preview:String(c.preview??""),nodeType:c.node_type?String(c.node_type):c.nodeType?String(c.nodeType):void 0}}),_=n.recommended,T={answer_preview:String((_==null?void 0:_.answer_preview)??((je=k[0])==null?void 0:je.preview)??""),memory_id:String((_==null?void 0:_.memory_id)??(($e=k[0])==null?void 0:$e.id)??""),trust_score:(()=>{var j;const c=_==null?void 0:_.trust_score;return typeof c=="number"?c>1?c/100:c:((j=k[0])==null?void 0:j.trust)??0})(),date:String((_==null?void 0:_.date)??((Fe=k[0])==null?void 0:Fe.date)??"")},ke=(Array.isArray(n.contradictions)?n.contradictions:[]).map(c=>({a_id:String(c.a_id??""),b_id:String(c.b_id??""),summary:String(c.summary??c.reason??"Trust-weighted conflict between high-FSRS memories.")})),Ne=(Array.isArray(n.superseded)?n.superseded:[]).map(c=>({old_id:String(c.old_id??""),new_id:String(c.new_id??T.memory_id??""),reason:String(c.reason??"Superseded by newer memory with higher FSRS trust.")})),Se=(Array.isArray(n.evolution)?n.evolution:[]).map(c=>({date:String(c.date??""),summary:String(c.summary??c.preview??""),trust:(()=>{const j=c.trust;return typeof j=="number"?j>1?j/100:j:0})()})),Me=Array.isArray(n.related_insights)?n.related_insights:[],fe=typeof n.confidence=="number"?n.confidence:0,_e=fe>1?Math.round(fe):Math.round(fe*100),Pe=String(n.intent??"Synthesis"),Ie=String(n.reasoning??n.guidance??""),Te=typeof n.memoriesAnalyzed=="number"?n.memoriesAnalyzed:k.length;return{intent:Pe,reasoning:Ie,recommended:T,evidence:k,contradictions:ke,superseded:Ne,evolution:Se,related_insights:Me,confidence:_e,memoriesAnalyzed:Te}}let B=he(""),A=he(!1),i=he(null),G=he(null),E=he(null),H=he(null),I=he(Ht([]));async function ee(){const r=e(B).trim();if(!(!r||e(A))){L(A,!0),L(G,null),L(i,null),L(I,[],!0);try{L(i,await J(r),!0),requestAnimationFrame(()=>requestAnimationFrame(te))}catch(n){L(G,n instanceof Error?n.message:"Unknown error",!0)}finally{L(A,!1)}}}function te(){if(!e(i)||!e(H)||e(i).contradictions.length===0){L(I,[],!0);return}const r=e(H).getBoundingClientRect(),n=[];for(const p of e(i).contradictions){const k=e(H).querySelector(`[data-evidence-id="${p.a_id}"]`),_=e(H).querySelector(`[data-evidence-id="${p.b_id}"]`);if(!k||!_)continue;const T=k.getBoundingClientRect(),Q=_.getBoundingClientRect();n.push({x1:T.left-r.left+T.width/2,y1:T.top-r.top+T.height/2,x2:Q.left-r.left+Q.width/2,y2:Q.top-r.top+Q.height/2})}L(I,n,!0)}function W(r){var n,p;(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),(n=e(E))==null||n.focus(),(p=e(E))==null||p.select())}Gt(()=>{var r;return(r=e(E))==null||r.focus(),window.addEventListener("keydown",W),window.addEventListener("resize",te),()=>{window.removeEventListener("keydown",W),window.removeEventListener("resize",te)}});const qe=["What port does the dev server use?","Should I enable prefix caching with vLLM?","Why did the benchmark score drop after the parser change?","How does FSRS-6 trust scoring work?"];var $=Ls();Ut("q2v96u",r=>{Wt(()=>{Kt.title="Reasoning Theater · Vestige"})});var K=s($);es(K,{icon:"reasoning",title:"Reasoning Theater",subtitle:"Watch Vestige reason — the 8-stage cognitive pipeline runs locally and returns a pre-built answer with trust-scored evidence.",accent:"dream",children:(r,n)=>{var p=fs();g(r,p)},$$slots:{default:!0}});var V=a(K,2),O=s(V),se=s(O),pe=s(se);be(pe,{name:"reasoning",size:20}),t(se);var M=a(se,2);Qt(M),_t(M,r=>L(E,r),()=>e(E));var P=a(M,4),me=s(P,!0);t(P),Xe(P,r=>{var n;return(n=ts)==null?void 0:n(r)}),t(O);var ie=a(O,2);{var xe=r=>{var n=ys(),p=a(s(n),2);ce(p,17,()=>qe,Re,(k,_)=>{var T=_s(),Q=s(T,!0);t(T),C(()=>o(Q,e(_))),Ye("click",T,()=>{L(B,e(_),!0),ee()}),g(k,T)}),t(n),g(r,n)};D(ie,r=>{!e(i)&&!e(A)&&r(xe)})}t(V);var ae=a(V,2);{var Ee=r=>{var n=hs(),p=a(s(n));t(n),C(()=>o(p,` ${e(G)??""}`)),g(r,n)};D(ae,r=>{e(G)&&r(Ee)})}var le=a(ae,2);{var we=r=>{var n=bs(),p=a(s(n),2);yt(p,{running:!0}),t(n),g(r,n)};D(le,r=>{e(A)&&r(we)})}var ge=a(le,2);{var ne=r=>{const n=re(()=>e(i).confidence),p=re(()=>Oe(e(n)));var k=Fs(),_=ft(k);{var T=u=>{var d=qs(),x=s(d),y=s(x),m=s(y),h=s(m);be(h,{name:"reasoning",size:16}),t(m),Z(),t(y);var F=a(y,2),S=s(F),b=a(s(S)),q=s(b,!0);t(b),t(S);var z=a(S,4),R=s(z);Ze(R,{get value(){return e(i).memoriesAnalyzed}}),Z(),t(z);var U=a(z,4),ve=s(U);t(U),t(F),t(x);var X=a(x,2),Ce=s(X),Ae=s(Ce,!0);t(Ce),t(X),Xe(X,ye=>{var de;return(de=ss)==null?void 0:de(ye)}),t(d),Xe(d,ye=>{var de;return(de=Yt)==null?void 0:de(ye)}),C(ye=>{o(q,e(i).intent),w(U,`color: ${e(p)??""}`),o(ve,`${e(n)??""}% ${ye??""}`),w(X,`box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.03), 0 0 32px ${e(p)??""}20, 0 8px 32px rgba(0,0,0,0.4); border-color: ${e(p)??""}35;`),o(Ae,e(i).reasoning)},[()=>qt(e(n))]),g(u,d)};D(_,u=>{e(i).reasoning&&u(T)})}var Q=a(_,2),ke=s(Q),De=a(s(ke),2),Ne=s(De),nt=s(Ne);Ze(nt,{get value(){return e(n)}}),Z(),t(Ne),t(De);var Se=a(De,2),Me=s(Se,!0);t(Se);var fe=a(Se,2),_e=a(s(fe)),Pe=s(_e);t(_e),t(fe);var Ie=a(fe,2),Te=s(Ie),je=a(s(Te)),$e=s(je,!0);t(je),t(Te);var Fe=a(Te,4),c=s(Fe);t(Fe),t(Ie),t(ke);var j=a(ke,2),ze=s(j),Le=a(s(ze),2),kt=s(Le);t(Le),t(ze);var Be=a(ze,2),St=s(Be,!0);t(Be);var rt=a(Be,2),Ge=s(rt),it=s(Ge),Ct=a(it);t(Ge);var lt=a(Ge,4),At=s(lt,!0);t(lt),t(rt),t(j),t(Q);var He=a(Q,2),We=s(He),ot=s(We),Rt=s(ot);be(Rt,{name:"activation",size:15}),t(ot),Z(),t(We);var vt=a(We,2),Et=s(vt);yt(Et,{get intent(){return e(i).intent},get memoriesAnalyzed(){return e(i).memoriesAnalyzed},get evidenceCount(){return e(i).evidence.length},get contradictionCount(){return e(i).contradictions.length},get supersededCount(){return e(i).superseded.length}}),t(vt),t(He);var Ke=a(He,2),Ve=s(Ke),dt=s(Ve),Qe=s(dt),Nt=s(Qe);be(Nt,{name:"memories",size:15}),t(Qe);var ct=a(Qe,2),Tt=s(ct);t(ct),t(dt),Z(2),t(Ve);var Ue=a(Ve,2),ut=s(Ue);ce(ut,19,()=>e(i).evidence,u=>u.id,(u,d,x)=>{gs(u,{get id(){return e(d).id},get trust(){return e(d).trust},get date(){return e(d).date},get role(){return e(d).role},get preview(){return e(d).preview},get nodeType(){return e(d).nodeType},get index(){return e(x)}})});var jt=a(ut,2);{var Ft=u=>{var d=ks(),x=a(s(d));ce(x,17,()=>e(I),Re,(y,m,h)=>{const F=re(()=>(e(m).x1+e(m).x2)/2),S=re(()=>Math.min(e(m).y1,e(m).y2)-28);var b=ws(),q=ft(b);w(q,`animation-delay: ${h*120+600}ms;`);var z=a(q);w(z,`animation-delay: ${h*120+600}ms;`);var R=a(z);w(R,`animation-delay: ${h*120+700}ms;`),C(()=>{Y(q,"d",`M ${e(m).x1??""} ${e(m).y1??""} Q ${e(F)??""} ${e(S)??""} ${e(m).x2??""} ${e(m).y2??""}`),Y(z,"cx",e(m).x1),Y(z,"cy",e(m).y1),Y(R,"cx",e(m).x2),Y(R,"cy",e(m).y2)}),g(y,b)}),t(d),g(u,d)};D(jt,u=>{e(I).length>0&&u(Ft)})}t(Ue),_t(Ue,u=>L(H,u),()=>e(H)),t(Ke);var pt=a(Ke,2);{var zt=u=>{var d=Cs(),x=s(d),y=s(x),m=s(y);be(m,{name:"contradictions",size:15}),t(y);var h=a(y,2),F=a(s(h));Ze(F,{get value(){return e(i).contradictions.length}}),Z(),t(h),t(x);var S=a(x,2);ce(S,21,()=>e(i).contradictions,Re,(b,q,z)=>{var R=Ss(),U=a(s(R),2),ve=s(U),X=s(ve),Ce=s(X);t(X);var Ae=a(X,4),ye=s(Ae);t(Ae),t(ve);var de=a(ve,2),Ot=s(de,!0);t(de),t(U);var Mt=a(U,2);Mt.textContent=`pair ${z+1}`,t(R),C((Pt,Bt)=>{o(Ce,`#${Pt??""}`),o(ye,`#${Bt??""}`),o(Ot,e(q).summary)},[()=>e(q).a_id.slice(0,8),()=>e(q).b_id.slice(0,8)]),g(b,R)}),t(S),t(d),g(u,d)};D(pt,u=>{e(i).contradictions.length>0&&u(zt)})}var mt=a(pt,2);{var Lt=u=>{var d=Rs(),x=s(d),y=a(s(x),2),m=s(y);t(y),t(x);var h=a(x,2);ce(h,21,()=>e(i).superseded,Re,(F,S)=>{var b=As(),q=s(b),z=s(q);t(q);var R=a(q,4),U=s(R);t(R);var ve=a(R,2),X=s(ve,!0);t(ve),t(b),C((Ce,Ae)=>{o(z,`#${Ce??""}`),o(U,`#${Ae??""}`),o(X,e(S).reason)},[()=>e(S).old_id.slice(0,8),()=>e(S).new_id.slice(0,8)]),g(F,b)}),t(h),t(d),C(()=>o(m,`(${e(i).superseded.length??""})`)),g(u,d)};D(mt,u=>{e(i).superseded.length>0&&u(Lt)})}var xt=a(mt,2),gt=s(xt);{var Dt=u=>{var d=Ns(),x=a(s(d),2);ce(x,21,()=>e(i).evolution,Re,(y,m)=>{var h=Es(),F=s(h),S=s(F,!0);t(F);var b=a(F,2),q=a(b,2),z=s(q,!0);t(q),t(h),C((R,U)=>{o(S,R),w(b,`background: ${U??""}`),o(z,e(m).summary)},[()=>new Date(e(m).date).toLocaleDateString(void 0,{month:"short",day:"numeric"}),()=>Oe(e(m).trust*100)]),g(y,h)}),t(x),t(d),g(u,d)};D(gt,u=>{e(i).evolution.length>0&&u(Dt)})}var It=a(gt,2);{var $t=u=>{var d=js(),x=s(d),y=s(x),m=s(y);be(m,{name:"sparkle",size:15}),t(y),Z(),t(x);var h=a(x,2);ce(h,21,()=>e(i).related_insights,Re,(F,S)=>{var b=Ts(),q=a(s(b),1,!0);t(b),C(()=>o(q,e(S))),g(F,b)}),t(h),t(d),g(u,d)};D(It,u=>{e(i).related_insights.length>0&&u($t)})}t(xt),C((u,d,x,y,m)=>{w(ke,`box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.03), 0 0 32px ${e(p)??""}30, 0 8px 32px rgba(0,0,0,0.4); border-color: ${e(p)??""}40;`),w(Ne,`color: ${e(p)??""}; text-shadow: 0 0 24px ${e(p)??""}80;`),w(Se,`color: ${e(p)??""}`),o(Me,u),Y(_e,"width",e(n)/100*220),Y(_e,"fill",e(p)),w(_e,`filter: drop-shadow(0 0 6px ${e(p)??""});`),Y(Pe,"to",e(n)/100*220),o($e,e(i).intent),o(c,`${e(i).memoriesAnalyzed??""} analyzed`),Y(Le,"title",e(i).recommended.memory_id),o(kt,`#${d??""}`),o(St,e(i).recommended.answer_preview),w(it,`background: ${x??""}`),o(Ct,` Trust ${y??""}%`),o(At,m),o(Tt,`(${e(i).evidence.length??""})`)},[()=>qt(e(n)),()=>e(i).recommended.memory_id.slice(0,8),()=>Oe(e(i).recommended.trust_score*100),()=>(e(i).recommended.trust_score*100).toFixed(0),()=>new Date(e(i).recommended.date).toLocaleDateString()]),g(r,k)};D(ge,r=>{e(i)&&!e(A)&&r(ne)})}var N=a(ge,2);{var oe=r=>{var n=zs(),p=s(n),k=s(p);be(k,{name:"reasoning",size:44,strokeWidth:1.2}),t(p),Z(4),t(n),g(r,n)};D(N,r=>{!e(i)&&!e(A)&&!e(G)&&r(oe)})}t($),C(r=>{at(se,1,`text-synapse-glow ${e(A)?"breathe":""}`,"svelte-q2v96u"),P.disabled=r,o(me,e(A)?"Reasoning…":"Reason")},[()=>!e(B).trim()||e(A)]),Ye("keydown",M,r=>r.key==="Enter"&&ee()),Xt(M,()=>e(B),r=>L(B,r)),Ye("click",P,ee),g(l,$),st()}Vt(["keydown","click"]);export{ea as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js.br b/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js.br new file mode 100644 index 0000000..48a555f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js.gz b/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js.gz new file mode 100644 index 0000000..da78a83 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/18.rpGfIdJ2.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js b/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js similarity index 96% rename from apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js rename to apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js index 115f2f2..c1ae514 100644 --- a/apps/dashboard/build/_app/immutable/nodes/18.43xZFMsD.js +++ b/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{o as tt}from"../chunks/TZu9D97Z.js";import{p as Ue,e as s,h as n,g as e,c as at,f as st,a as u,t as w,r as t,u as k,b as Qe,s as ue,i as W,j as g,au as Oe,d as rt,n as nt}from"../chunks/wpu9U-D0.js";import{d as Xe,s as p,a as Pe}from"../chunks/D8mhvFt8.js";import{i as N}from"../chunks/DKve45Wd.js";import{a as C,e as X,i as he,s as Ie}from"../chunks/60_R_Vbt.js";import{a as Ke}from"../chunks/CZfHMhLI.js";import{s as Ae}from"../chunks/EqHb-9AZ.js";import{p as it}from"../chunks/ByYB047u.js";import{N as ot}from"../chunks/CcUbQ_Wl.js";import{P as dt}from"../chunks/BHDZZvku.js";import{I as lt}from"../chunks/D7A-gG4Z.js";import{D as vt}from"../chunks/CmbJHhgy.js";const Ge=1440*60*1e3;function pe(x){const v=typeof x=="string"?new Date(x):new Date(x);return v.setHours(0,0,0,0),v}function be(x,v){return Math.floor((pe(x).getTime()-pe(v).getTime())/Ge)}function Ye(x){const v=x.getFullYear(),f=String(x.getMonth()+1).padStart(2,"0"),R=String(x.getDate()).padStart(2,"0");return`${v}-${f}-${R}`}function qe(x,v){if(!v)return"none";const f=new Date(v);if(Number.isNaN(f.getTime()))return"none";const R=be(f,x);return R<0?"overdue":R===0?"today":R<=7?"week":"future"}function ze(x,v){if(!v)return null;const f=new Date(v);return Number.isNaN(f.getTime())?null:be(f,x)}function ct(x){if(x.length===0)return 0;let v=0;for(const f of x)v+=f.retentionStrength??0;return v/x.length}function ut(x){const v=pe(x);return v.setDate(v.getDate()-14),v.setDate(v.getDate()-v.getDay()),v}function pt(x,v){let f=0,R=0,I=0,O=0,A=0,G=0;const E=pe(x);for(const B of v){if(!B.nextReviewAt)continue;const H=new Date(B.nextReviewAt);if(Number.isNaN(H.getTime()))continue;const _=be(H,x);_<0&&f++,_<=0&&R++,_<=7&&I++,_<=30&&O++,_>=0&&(A+=(H.getTime()-E.getTime())/Ge,G++)}const b=G>0?A/G:0;return{overdue:f,dueToday:R,dueThisWeek:I,dueThisMonth:O,avgDays:b}}var xt=Oe(''),gt=Oe(''),mt=Oe(''),ft=g('
                    '),_t=g(' '),ht=g(' '),bt=g('
                    '),yt=g(''),wt=g(" "),kt=g(' '),$t=g('

                    '),St=g('

                    '),Dt=g('

                    '),Tt=g('
                    Avg retention of memories due — last 2 weeks → next 4
                    retention today
                    Overdue Due today Within 7 days Future (8+ days)
                    ');function Rt(x,v){Ue(v,!0);let f=it(v,"anchor",19,()=>new Date),R=k(()=>pe(f())),I=k(()=>ut(f())),O=k(()=>(()=>{const r=new Map;for(const a of v.memories){if(!a.nextReviewAt)continue;const o=new Date(a.nextReviewAt);if(Number.isNaN(o.getTime()))continue;const d=Ye(pe(o)),$=r.get(d);$?$.push(a):r.set(d,[a])}return r})()),A=k(()=>(()=>{const r=[];for(let a=0;a<42;a++){const o=new Date(e(I));o.setDate(o.getDate()+a);const d=Ye(o),$=e(O).get(d)??[],y=be(o,e(R));r.push({date:o,key:d,isToday:y===0,inWindow:y>=-14&&y<=28,memories:$,avgRetention:ct($)})}return r})());function G(r){if(r.memories.length===0)return{bg:"rgba(255,255,255,0.02)",border:"rgba(99,102,241,0.06)",text:"#4a4a7a"};const a=be(r.date,e(R));return a<-1?{bg:"rgba(239,68,68,0.16)",border:"rgba(239,68,68,0.45)",text:"#fca5a5"}:a>=-1&&a<=0?{bg:"rgba(245,158,11,0.18)",border:"rgba(245,158,11,0.5)",text:"#fcd34d"}:a>0&&a<=7?{bg:"rgba(99,102,241,0.16)",border:"rgba(99,102,241,0.45)",text:"#a5b4fc"}:{bg:"rgba(168,85,247,0.08)",border:"rgba(168,85,247,0.2)",text:"#c084fc"}}let E=ue(null),b=k(()=>e(A).find(r=>r.key===e(E))??null);function B(r){W(E,e(E)===r?null:r,!0)}const H=600,_=56;let L=k(()=>(()=>{const r=[],a=e(A).length;for(let o=0;o(()=>{const r=e(L).filter(a=>a.count>0);return r.length===0?"":r.map((a,o)=>`${o===0?"M":"L"} ${a.x.toFixed(1)} ${a.y.toFixed(1)}`).join(" ")})()),xe=k(()=>e(A).findIndex(r=>r.isToday)),ge=k(()=>e(xe)>=0?e(xe)/(e(A).length-1)*H:-1);const we=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ne(r){return r.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"})}var ie=Tt(),oe=s(ie),me=n(s(oe),2);C(me,"viewBox","0 0 600 56");var J=s(me);C(J,"x2",H),C(J,"y1",_-6-.3*(_-12)),C(J,"y2",_-6-.3*(_-12));var de=n(J);C(de,"x2",H),C(de,"y1",_-6-.7*(_-12)),C(de,"y2",_-6-.7*(_-12));var ke=n(de);{var Fe=r=>{var a=xt();C(a,"y2",_),w(()=>{C(a,"x1",e(ge)),C(a,"x2",e(ge))}),u(r,a)};N(ke,r=>{e(ge)>=0&&r(Fe)})}var $e=n(ke);{var Ne=r=>{var a=gt();w(()=>C(a,"d",e(ye))),u(r,a)};N($e,r=>{e(ye)&&r(Ne)})}var Ce=n($e);X(Ce,17,()=>e(L),he,(r,a)=>{var o=at(),d=st(o);{var $=y=>{var D=mt();w(()=>{C(D,"cx",e(a).x),C(D,"cy",e(a).y)}),u(y,D)};N(d,y=>{e(a).count>0&&y($)})}u(r,o)}),t(me),t(oe);var i=n(oe,2);X(i,21,()=>we,he,(r,a)=>{var o=ft(),d=s(o,!0);t(o),w(()=>p(d,e(a))),u(r,o)}),t(i);var l=n(i,2);X(l,21,()=>e(A),r=>r.key,(r,a)=>{const o=k(()=>G(e(a)));var d=yt(),$=s(d),y=s($),D=s(y),fe=s(D,!0);t(D);var V=n(D,2);{var Z=h=>{var c=_t(),T=s(c,!0);t(c),w(Y=>p(T,Y),[()=>e(a).date.toLocaleDateString(void 0,{month:"short"})]),u(h,c)},le=k(()=>e(a).date.getDate()===1);N(V,h=>{e(le)&&h(Z)})}t(y);var ve=n(y,2);{var ce=h=>{var c=bt(),T=s(c),Y=s(T,!0);t(T);var ee=n(T,2);{var Q=te=>{var q=ht(),z=s(q);t(q),w(ae=>p(z,`${ae??""}%`),[()=>(e(a).avgRetention*100).toFixed(0)]),u(te,q)};N(ee,te=>{e(a).avgRetention>0&&te(Q)})}t(c),w(()=>{Ae(T,`color: ${e(o).text??""}`),p(Y,e(a).memories.length)}),u(h,c)};N(ve,h=>{e(a).memories.length>0&&h(ce)})}t($),t(d),w((h,c)=>{d.disabled=e(a).memories.length===0,Ie(d,1,`relative aspect-square rounded-lg p-2 text-left transition-all duration-200 +import"../chunks/Bzak7iHL.js";import{o as tt}from"../chunks/JVtQszIZ.js";import{p as Ue,e as s,h as n,g as e,c as at,f as st,a as u,t as w,r as t,u as k,b as Qe,s as ue,i as W,j as g,av as Oe,d as rt,n as nt}from"../chunks/CW7md74C.js";import{d as Xe,s as p,a as Pe}from"../chunks/D90q9c2i.js";import{i as N}from"../chunks/9-jplUL5.js";import{a as C,e as X,i as he,s as Ie}from"../chunks/Cc0l8Nd4.js";import{a as Ke}from"../chunks/C-rZhKee.js";import{s as Ae}from"../chunks/BNUnVJrY.js";import{p as it}from"../chunks/BjbQ7qSx.js";import{N as ot}from"../chunks/CcUbQ_Wl.js";import{P as dt}from"../chunks/DTO0IjuV.js";import{I as lt}from"../chunks/CqwrgJOn.js";import{D as vt}from"../chunks/DUAsElMg.js";const Ge=1440*60*1e3;function pe(x){const v=typeof x=="string"?new Date(x):new Date(x);return v.setHours(0,0,0,0),v}function be(x,v){return Math.floor((pe(x).getTime()-pe(v).getTime())/Ge)}function Ye(x){const v=x.getFullYear(),f=String(x.getMonth()+1).padStart(2,"0"),R=String(x.getDate()).padStart(2,"0");return`${v}-${f}-${R}`}function qe(x,v){if(!v)return"none";const f=new Date(v);if(Number.isNaN(f.getTime()))return"none";const R=be(f,x);return R<0?"overdue":R===0?"today":R<=7?"week":"future"}function ze(x,v){if(!v)return null;const f=new Date(v);return Number.isNaN(f.getTime())?null:be(f,x)}function ct(x){if(x.length===0)return 0;let v=0;for(const f of x)v+=f.retentionStrength??0;return v/x.length}function ut(x){const v=pe(x);return v.setDate(v.getDate()-14),v.setDate(v.getDate()-v.getDay()),v}function pt(x,v){let f=0,R=0,I=0,O=0,A=0,G=0;const E=pe(x);for(const B of v){if(!B.nextReviewAt)continue;const H=new Date(B.nextReviewAt);if(Number.isNaN(H.getTime()))continue;const _=be(H,x);_<0&&f++,_<=0&&R++,_<=7&&I++,_<=30&&O++,_>=0&&(A+=(H.getTime()-E.getTime())/Ge,G++)}const b=G>0?A/G:0;return{overdue:f,dueToday:R,dueThisWeek:I,dueThisMonth:O,avgDays:b}}var xt=Oe(''),gt=Oe(''),mt=Oe(''),ft=g('
                    '),_t=g(' '),ht=g(' '),bt=g('
                    '),yt=g(''),wt=g(" "),kt=g(' '),$t=g('

                    '),St=g('

                    '),Dt=g('

                    '),Tt=g('
                    Avg retention of memories due — last 2 weeks → next 4
                    retention today
                    Overdue Due today Within 7 days Future (8+ days)
                    ');function Rt(x,v){Ue(v,!0);let f=it(v,"anchor",19,()=>new Date),R=k(()=>pe(f())),I=k(()=>ut(f())),O=k(()=>(()=>{const r=new Map;for(const a of v.memories){if(!a.nextReviewAt)continue;const o=new Date(a.nextReviewAt);if(Number.isNaN(o.getTime()))continue;const d=Ye(pe(o)),$=r.get(d);$?$.push(a):r.set(d,[a])}return r})()),A=k(()=>(()=>{const r=[];for(let a=0;a<42;a++){const o=new Date(e(I));o.setDate(o.getDate()+a);const d=Ye(o),$=e(O).get(d)??[],y=be(o,e(R));r.push({date:o,key:d,isToday:y===0,inWindow:y>=-14&&y<=28,memories:$,avgRetention:ct($)})}return r})());function G(r){if(r.memories.length===0)return{bg:"rgba(255,255,255,0.02)",border:"rgba(99,102,241,0.06)",text:"#4a4a7a"};const a=be(r.date,e(R));return a<-1?{bg:"rgba(239,68,68,0.16)",border:"rgba(239,68,68,0.45)",text:"#fca5a5"}:a>=-1&&a<=0?{bg:"rgba(245,158,11,0.18)",border:"rgba(245,158,11,0.5)",text:"#fcd34d"}:a>0&&a<=7?{bg:"rgba(99,102,241,0.16)",border:"rgba(99,102,241,0.45)",text:"#a5b4fc"}:{bg:"rgba(168,85,247,0.08)",border:"rgba(168,85,247,0.2)",text:"#c084fc"}}let E=ue(null),b=k(()=>e(A).find(r=>r.key===e(E))??null);function B(r){W(E,e(E)===r?null:r,!0)}const H=600,_=56;let L=k(()=>(()=>{const r=[],a=e(A).length;for(let o=0;o(()=>{const r=e(L).filter(a=>a.count>0);return r.length===0?"":r.map((a,o)=>`${o===0?"M":"L"} ${a.x.toFixed(1)} ${a.y.toFixed(1)}`).join(" ")})()),xe=k(()=>e(A).findIndex(r=>r.isToday)),ge=k(()=>e(xe)>=0?e(xe)/(e(A).length-1)*H:-1);const we=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ne(r){return r.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"})}var ie=Tt(),oe=s(ie),me=n(s(oe),2);C(me,"viewBox","0 0 600 56");var J=s(me);C(J,"x2",H),C(J,"y1",_-6-.3*(_-12)),C(J,"y2",_-6-.3*(_-12));var de=n(J);C(de,"x2",H),C(de,"y1",_-6-.7*(_-12)),C(de,"y2",_-6-.7*(_-12));var ke=n(de);{var Fe=r=>{var a=xt();C(a,"y2",_),w(()=>{C(a,"x1",e(ge)),C(a,"x2",e(ge))}),u(r,a)};N(ke,r=>{e(ge)>=0&&r(Fe)})}var $e=n(ke);{var Ne=r=>{var a=gt();w(()=>C(a,"d",e(ye))),u(r,a)};N($e,r=>{e(ye)&&r(Ne)})}var Ce=n($e);X(Ce,17,()=>e(L),he,(r,a)=>{var o=at(),d=st(o);{var $=y=>{var D=mt();w(()=>{C(D,"cx",e(a).x),C(D,"cy",e(a).y)}),u(y,D)};N(d,y=>{e(a).count>0&&y($)})}u(r,o)}),t(me),t(oe);var i=n(oe,2);X(i,21,()=>we,he,(r,a)=>{var o=ft(),d=s(o,!0);t(o),w(()=>p(d,e(a))),u(r,o)}),t(i);var l=n(i,2);X(l,21,()=>e(A),r=>r.key,(r,a)=>{const o=k(()=>G(e(a)));var d=yt(),$=s(d),y=s($),D=s(y),fe=s(D,!0);t(D);var V=n(D,2);{var Z=h=>{var c=_t(),T=s(c,!0);t(c),w(Y=>p(T,Y),[()=>e(a).date.toLocaleDateString(void 0,{month:"short"})]),u(h,c)},le=k(()=>e(a).date.getDate()===1);N(V,h=>{e(le)&&h(Z)})}t(y);var ve=n(y,2);{var ce=h=>{var c=bt(),T=s(c),Y=s(T,!0);t(T);var ee=n(T,2);{var Q=te=>{var q=ht(),z=s(q);t(q),w(ae=>p(z,`${ae??""}%`),[()=>(e(a).avgRetention*100).toFixed(0)]),u(te,q)};N(ee,te=>{e(a).avgRetention>0&&te(Q)})}t(c),w(()=>{Ae(T,`color: ${e(o).text??""}`),p(Y,e(a).memories.length)}),u(h,c)};N(ve,h=>{e(a).memories.length>0&&h(ce)})}t($),t(d),w((h,c)=>{d.disabled=e(a).memories.length===0,Ie(d,1,`relative aspect-square rounded-lg p-2 text-left transition-all duration-200 ${e(a).inWindow?"opacity-100":"opacity-35"} ${e(a).memories.length>0?"hover:scale-[1.03] cursor-pointer":"cursor-default"} ${e(a).isToday?"ring-2 ring-synapse/60 shadow-[0_0_16px_rgba(99,102,241,0.3)]":""} diff --git a/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js.br b/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js.br new file mode 100644 index 0000000..d305150 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js.gz b/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js.gz new file mode 100644 index 0000000..bf52df1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/19.56tMTUyP.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js.br b/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js.br deleted file mode 100644 index f5a023d..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js.gz b/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js.gz deleted file mode 100644 index 6a8b24b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js.br b/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js.br deleted file mode 100644 index 2d00db9..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js.gz b/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js.gz deleted file mode 100644 index 4dca9f4..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js b/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js similarity index 69% rename from apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js rename to apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js index e732e89..340f289 100644 --- a/apps/dashboard/build/_app/immutable/nodes/2.DEnQkIHv.js +++ b/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js @@ -1 +1 @@ -import"../chunks/Bzak7iHL.js";import{c as n,f as m,a as p}from"../chunks/wpu9U-D0.js";import{s as e}from"../chunks/LDOJP_6N.js";function f(a,r){var o=n(),t=m(o);e(t,()=>r.children),p(a,o)}export{f as component}; +import"../chunks/Bzak7iHL.js";import{c as n,f as m,a as p}from"../chunks/CW7md74C.js";import{s as e}from"../chunks/EQUhm_ep.js";function f(a,r){var o=n(),t=m(o);e(t,()=>r.children),p(a,o)}export{f as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js.br b/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js.br new file mode 100644 index 0000000..5ed8e38 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js.gz b/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js.gz new file mode 100644 index 0000000..3f8de16 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/2.DUuVc9gS.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js b/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js similarity index 94% rename from apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js rename to apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js index 13ee522..7c9e3ce 100644 --- a/apps/dashboard/build/_app/immutable/nodes/19.BYwd4oWS.js +++ b/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js @@ -1,2 +1,2 @@ -import"../chunks/Bzak7iHL.js";import{o as ft}from"../chunks/TZu9D97Z.js";import{p as _t,t as $,a as n,b as bt,g as i,j as c,e as t,h as d,s as C,a9 as kt,i as p,f as Fe,r as e,n as m,m as Ie,u as F}from"../chunks/wpu9U-D0.js";import{d as yt,a as I,s as f}from"../chunks/D8mhvFt8.js";import{i as _}from"../chunks/DKve45Wd.js";import{e as fe,s as V,i as _e}from"../chunks/60_R_Vbt.js";import{a as R,r as A}from"../chunks/P1-U_Xsj.js";import{s as Y}from"../chunks/EqHb-9AZ.js";import{a as ht,s as be}from"../chunks/ByYB047u.js";import{a as O}from"../chunks/CZfHMhLI.js";import{a as wt,b as $t,i as St,w as Ct}from"../chunks/BhIgFntf.js";import{f as Dt}from"../chunks/CqMQEF-F.js";import{P as Rt}from"../chunks/BHDZZvku.js";import{I as P}from"../chunks/D7A-gG4Z.js";var At=c(' ',1),Pt=c(' Running...',1),Gt=c('
                    Processed
                    '),jt=c('
                    Decayed
                    '),zt=c('
                    Embedded
                    '),Mt=c('
                    '),Tt=c(' Dreaming...',1),Et=c('
                    '),Ft=c('
                    Insights Discovered:
                    ',1),It=c('
                    Connections found:
                    '),Ot=c('
                    Memories replayed:
                    '),Nt=c('
                    '),Bt=c('
                    '),Kt=c('
                    '),Wt=c('

                    Retention Distribution

                    '),qt=c('
                    '),Ht=c(`
                    Memories
                    Avg Retention
                    WebSocket
                    v2.1
                    Vestige

                    Cognitive Operations

                    Pulse Toast Preview
                    Fire a synthetic event sequence — useful for UI demos
                    Birth Ritual Preview
                    Inject a synthetic memory — switch to Graph to watch the orb fly in
                    FSRS-6 Consolidation
                    Apply spaced-repetition decay, regenerate embeddings, run maintenance
                    Memory Dream Cycle
                    Replay memories, discover hidden connections, synthesize insights

                    Keyboard Shortcuts

                    About

                    Vestige v2.1 "Nuclear Dashboard"
                    Your AI's long-term memory system
                    29 cognitive modules
                    FSRS-6 spaced repetition
                    Nomic Embed v1.5 (256d)
                    Jina Reranker v1 Turbo
                    USearch HNSW (20x FAISS)
                    Local-first, zero cloud
                    Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
                    `);function ds(Oe,Ne){_t(Ne,!0);const b=()=>be(St,"$isConnected",Q),Be=()=>be($t,"$memoryCount",Q),L=()=>be(wt,"$avgRetention",Q),[Q,Ke]=ht(),ke=["fact","concept","pattern","decision","person","place"];let X=C(0);function We(){const s=ke[i(X)%ke.length];kt(X),Ct.injectEvent({type:"MemoryCreated",data:{id:`demo-birth-${Date.now()}`,content:`Demo memory #${i(X)} — ${s}`,node_type:s,tags:["demo","v2.3-birth-ritual"],retention:.9}})}let N=C(!1),j=C(!1),S=C(null),h=C(null),qe=C(null),G=C(null),ye=C(!0),He=C(null);ft(()=>{B()});async function B(){p(ye,!0);try{const[s,r,a]=await Promise.all([O.stats().catch(()=>null),O.health().catch(()=>null),O.retentionDistribution().catch(()=>null)]);p(qe,s,!0),p(He,r,!0),p(G,a,!0)}finally{p(ye,!1)}}async function Je(){p(N,!0),p(S,null);try{p(S,await O.consolidate(),!0),await B()}catch{}finally{p(N,!1)}}async function Ue(){p(j,!0),p(h,null);try{p(h,await O.dream(),!0),await B()}catch{}finally{p(j,!1)}}var Z=Ht(),he=t(Z);Rt(he,{icon:"settings",title:"Settings & System",subtitle:"Tune the cognitive engine, watch the system breathe, and run the rituals that keep memory alive.",accent:"synapse",children:(s,r)=>{var a=At(),x=Fe(a);let k;var u=t(x);let w;var D=d(u,2),y=t(D,!0);e(D),e(x);var l=d(x,2),v=t(l);P(v,{name:"activation",size:13}),m(2),e(l),$(()=>{k=V(x,1,"conn-pill svelte-15kgmsr",null,k,{idle:!b()}),w=V(u,1,"conn-dot w-2 h-2 rounded-full svelte-15kgmsr",null,w,{"ping-host":b(),breathe:!b()}),Y(u,`color:${b()?"var(--color-recall)":"var(--color-decay)"};background:${b()?"var(--color-recall)":"var(--color-decay)"}`),f(y,b()?"Connected":"Offline")}),I("click",l,B),n(s,a)},$$slots:{default:!0}});var ee=d(he,2),K=t(ee),we=t(K),Ve=t(we,!0);e(we),m(2),e(K),R(K,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:0}));var W=d(K,2),te=t(W),Ye=t(te);e(te),m(2),e(W),R(W,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:60}));var q=d(W,2),$e=t(q),se=t($e);let Se;var Ce=d(se,2),Le=t(Ce,!0);e(Ce),e($e),m(2),e(q),R(q,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:120}));var Qe=d(q,2);R(Qe,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:180})),e(ee);var H=d(ee,2),re=t(H),Xe=t(re);P(Xe,{name:"dreams",size:16,class:"text-dream"}),m(),e(re);var ae=d(re,2),De=t(ae),ie=d(t(De),2),Ze=t(ie);P(Ze,{name:"sparkle",size:14}),m(),e(ie),e(De),e(ae);var de=d(ae,2),Re=t(de),le=d(t(Re),2),et=t(le);P(et,{name:"memories",size:14}),m(),e(le),e(Re),e(de);var ve=d(de,2),oe=t(ve),J=d(t(oe),2),tt=t(J);{var st=s=>{var r=Pt();m(),n(s,r)},rt=s=>{var r=Ie("Consolidate");n(s,r)};_(tt,s=>{i(N)?s(st):s(rt,!1)})}e(J),e(oe);var at=d(oe,2);{var it=s=>{var r=Mt(),a=t(r),x=t(a);{var k=l=>{var v=Gt(),o=t(v),g=t(o,!0);e(o),m(2),e(v),$(()=>f(g,i(S).nodesProcessed)),n(l,v)};_(x,l=>{i(S).nodesProcessed!==void 0&&l(k)})}var u=d(x,2);{var w=l=>{var v=jt(),o=t(v),g=t(o,!0);e(o),m(2),e(v),$(()=>f(g,i(S).decayApplied)),n(l,v)};_(u,l=>{i(S).decayApplied!==void 0&&l(w)})}var D=d(u,2);{var y=l=>{var v=zt(),o=t(v),g=t(o,!0);e(o),m(2),e(v),$(()=>f(g,i(S).embeddingsGenerated)),n(l,v)};_(D,l=>{i(S).embeddingsGenerated!==void 0&&l(y)})}e(a),e(r),n(s,r)};_(at,s=>{i(S)&&s(it)})}e(ve);var Ae=d(ve,2),ne=t(Ae),z=d(t(ne),2),dt=t(z);{var lt=s=>{var r=Tt();m(),n(s,r)},vt=s=>{var r=Ie("Dream");n(s,r)};_(dt,s=>{i(j)?s(lt):s(vt,!1)})}e(z),e(ne);var ot=d(ne,2);{var nt=s=>{var r=Nt(),a=t(r);{var x=l=>{var v=Ft(),o=d(Fe(v),2);fe(o,17,()=>i(h).insights,_e,(g,M)=>{var T=Et(),xe=t(T,!0);e(T),$(E=>f(xe,E),[()=>typeof i(M)=="string"?i(M):JSON.stringify(i(M))]),n(g,T)}),n(l,v)},k=F(()=>i(h).insights&&Array.isArray(i(h).insights));_(a,l=>{i(k)&&l(x)})}var u=d(a,2);{var w=l=>{var v=It(),o=d(t(v)),g=t(o,!0);e(o),e(v),$(()=>f(g,i(h).connections_found)),n(l,v)};_(u,l=>{i(h).connections_found!==void 0&&l(w)})}var D=d(u,2);{var y=l=>{var v=Ot(),o=d(t(v)),g=t(o,!0);e(o),e(v),$(()=>f(g,i(h).memories_replayed)),n(l,v)};_(D,l=>{i(h).memories_replayed!==void 0&&l(y)})}e(r),n(s,r)};_(ot,s=>{i(h)&&s(nt)})}e(Ae),e(H),R(H,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:60}));var Pe=d(H,2);{var mt=s=>{var r=Wt(),a=t(r),x=t(a);P(x,{name:"importance",size:16,class:"text-recall"}),m(),e(a);var k=d(a,2),u=t(k);{var w=y=>{var l=Kt();fe(l,21,()=>i(G).distribution,_e,(v,o,g)=>{const M=F(()=>Math.max(...i(G).distribution.map(pe=>pe.count),1)),T=F(()=>i(o).count/i(M)*100),xe=F(()=>g<2?"#ef4444":g<4?"#f59e0b":g<7?"#6366f1":"#10b981");var E=Bt(),ue=t(E),ut=t(ue,!0);e(ue);var Ee=d(ue,2),pt=d(Ee,2);pt.textContent=`${g*10}%`,e(E),$(pe=>{f(ut,i(o).count),Y(Ee,`height: ${pe??""}%; background: ${i(xe)??""}; opacity: 0.7`)},[()=>Math.max(i(T),2)]),n(v,E)}),e(l),n(y,l)},D=F(()=>i(G).distribution&&Array.isArray(i(G).distribution));_(u,y=>{i(D)&&y(w)})}e(k),e(r),R(r,(y,l)=>{var v;return(v=A)==null?void 0:v(y,l)},()=>({delay:120})),n(s,r)};_(Pe,s=>{i(G)&&s(mt)})}var U=d(Pe,2),me=t(U),ct=t(me);P(ct,{name:"command",size:16,class:"text-synapse"}),m(),e(me);var Ge=d(me,2),je=t(Ge);fe(je,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],_e,(s,r)=>{var a=qt(),x=t(a),k=t(x,!0);e(x);var u=d(x,2),w=t(u,!0);e(u),e(a),$(()=>{f(k,r.key),f(w,r.desc)}),n(s,a)}),e(je),e(Ge),e(U),R(U,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:160}));var ce=d(U,2),ge=t(ce),gt=t(ge);P(gt,{name:"logo",size:16,class:"text-memory"}),m(),e(ge);var ze=d(ge,2),Me=t(ze),Te=t(Me),xt=t(Te);P(xt,{name:"logo",size:20,strokeWidth:1.8}),e(Te),m(2),e(Me),m(4),e(ze),e(ce),R(ce,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:200})),e(Z),$(s=>{f(Ve,Be()),Y(te,`color: ${L()>.7?"#10b981":L()>.4?"#f59e0b":"#ef4444"}`),f(Ye,`${s??""}%`),Se=V(se,1,"w-2.5 h-2.5 rounded-full svelte-15kgmsr",null,Se,{"ping-host":b(),breathe:!b()}),Y(se,`color:${b()?"var(--color-recall)":"var(--color-decay)"};background:${b()?"var(--color-recall)":"var(--color-decay)"}`),f(Le,b()?"Online":"Offline"),J.disabled=i(N),z.disabled=i(j),V(z,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2 +import"../chunks/Bzak7iHL.js";import{o as ft}from"../chunks/JVtQszIZ.js";import{p as _t,t as $,a as n,b as bt,g as i,j as c,e as t,h as d,s as C,aa as kt,i as p,f as Fe,r as e,n as m,m as Ie,u as F}from"../chunks/CW7md74C.js";import{d as yt,a as I,s as f}from"../chunks/D90q9c2i.js";import{i as _}from"../chunks/9-jplUL5.js";import{e as fe,s as V,i as _e}from"../chunks/Cc0l8Nd4.js";import{a as R,r as A}from"../chunks/D8RjhgN0.js";import{s as Y}from"../chunks/BNUnVJrY.js";import{a as ht,s as be}from"../chunks/BjbQ7qSx.js";import{a as O}from"../chunks/C-rZhKee.js";import{a as wt,b as $t,i as St,w as Ct}from"../chunks/BFpewGai.js";import{f as Dt}from"../chunks/BGTfzpXY.js";import{P as Rt}from"../chunks/DTO0IjuV.js";import{I as P}from"../chunks/CqwrgJOn.js";var At=c(' ',1),Pt=c(' Running...',1),Gt=c('
                    Processed
                    '),jt=c('
                    Decayed
                    '),zt=c('
                    Embedded
                    '),Mt=c('
                    '),Tt=c(' Dreaming...',1),Et=c('
                    '),Ft=c('
                    Insights Discovered:
                    ',1),It=c('
                    Connections found:
                    '),Ot=c('
                    Memories replayed:
                    '),Nt=c('
                    '),Bt=c('
                    '),Kt=c('
                    '),Wt=c('

                    Retention Distribution

                    '),qt=c('
                    '),Ht=c(`
                    Memories
                    Avg Retention
                    WebSocket
                    v2.1
                    Vestige

                    Cognitive Operations

                    Pulse Toast Preview
                    Fire a synthetic event sequence — useful for UI demos
                    Birth Ritual Preview
                    Inject a synthetic memory — switch to Graph to watch the orb fly in
                    FSRS-6 Consolidation
                    Apply spaced-repetition decay, regenerate embeddings, run maintenance
                    Memory Dream Cycle
                    Replay memories, discover hidden connections, synthesize insights

                    Keyboard Shortcuts

                    About

                    Vestige v2.1 "Nuclear Dashboard"
                    Your AI's long-term memory system
                    29 cognitive modules
                    FSRS-6 spaced repetition
                    Nomic Embed v1.5 (256d)
                    Jina Reranker v1 Turbo
                    USearch HNSW (20x FAISS)
                    Local-first, zero cloud
                    Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
                    `);function ds(Oe,Ne){_t(Ne,!0);const b=()=>be(St,"$isConnected",Q),Be=()=>be($t,"$memoryCount",Q),L=()=>be(wt,"$avgRetention",Q),[Q,Ke]=ht(),ke=["fact","concept","pattern","decision","person","place"];let X=C(0);function We(){const s=ke[i(X)%ke.length];kt(X),Ct.injectEvent({type:"MemoryCreated",data:{id:`demo-birth-${Date.now()}`,content:`Demo memory #${i(X)} — ${s}`,node_type:s,tags:["demo","v2.3-birth-ritual"],retention:.9}})}let N=C(!1),j=C(!1),S=C(null),h=C(null),qe=C(null),G=C(null),ye=C(!0),He=C(null);ft(()=>{B()});async function B(){p(ye,!0);try{const[s,r,a]=await Promise.all([O.stats().catch(()=>null),O.health().catch(()=>null),O.retentionDistribution().catch(()=>null)]);p(qe,s,!0),p(He,r,!0),p(G,a,!0)}finally{p(ye,!1)}}async function Je(){p(N,!0),p(S,null);try{p(S,await O.consolidate(),!0),await B()}catch{}finally{p(N,!1)}}async function Ue(){p(j,!0),p(h,null);try{p(h,await O.dream(),!0),await B()}catch{}finally{p(j,!1)}}var Z=Ht(),he=t(Z);Rt(he,{icon:"settings",title:"Settings & System",subtitle:"Tune the cognitive engine, watch the system breathe, and run the rituals that keep memory alive.",accent:"synapse",children:(s,r)=>{var a=At(),x=Fe(a);let k;var u=t(x);let w;var D=d(u,2),y=t(D,!0);e(D),e(x);var l=d(x,2),v=t(l);P(v,{name:"activation",size:13}),m(2),e(l),$(()=>{k=V(x,1,"conn-pill svelte-15kgmsr",null,k,{idle:!b()}),w=V(u,1,"conn-dot w-2 h-2 rounded-full svelte-15kgmsr",null,w,{"ping-host":b(),breathe:!b()}),Y(u,`color:${b()?"var(--color-recall)":"var(--color-decay)"};background:${b()?"var(--color-recall)":"var(--color-decay)"}`),f(y,b()?"Connected":"Offline")}),I("click",l,B),n(s,a)},$$slots:{default:!0}});var ee=d(he,2),K=t(ee),we=t(K),Ve=t(we,!0);e(we),m(2),e(K),R(K,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:0}));var W=d(K,2),te=t(W),Ye=t(te);e(te),m(2),e(W),R(W,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:60}));var q=d(W,2),$e=t(q),se=t($e);let Se;var Ce=d(se,2),Le=t(Ce,!0);e(Ce),e($e),m(2),e(q),R(q,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:120}));var Qe=d(q,2);R(Qe,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:180})),e(ee);var H=d(ee,2),re=t(H),Xe=t(re);P(Xe,{name:"dreams",size:16,class:"text-dream"}),m(),e(re);var ae=d(re,2),De=t(ae),ie=d(t(De),2),Ze=t(ie);P(Ze,{name:"sparkle",size:14}),m(),e(ie),e(De),e(ae);var de=d(ae,2),Re=t(de),le=d(t(Re),2),et=t(le);P(et,{name:"memories",size:14}),m(),e(le),e(Re),e(de);var ve=d(de,2),oe=t(ve),J=d(t(oe),2),tt=t(J);{var st=s=>{var r=Pt();m(),n(s,r)},rt=s=>{var r=Ie("Consolidate");n(s,r)};_(tt,s=>{i(N)?s(st):s(rt,!1)})}e(J),e(oe);var at=d(oe,2);{var it=s=>{var r=Mt(),a=t(r),x=t(a);{var k=l=>{var v=Gt(),o=t(v),g=t(o,!0);e(o),m(2),e(v),$(()=>f(g,i(S).nodesProcessed)),n(l,v)};_(x,l=>{i(S).nodesProcessed!==void 0&&l(k)})}var u=d(x,2);{var w=l=>{var v=jt(),o=t(v),g=t(o,!0);e(o),m(2),e(v),$(()=>f(g,i(S).decayApplied)),n(l,v)};_(u,l=>{i(S).decayApplied!==void 0&&l(w)})}var D=d(u,2);{var y=l=>{var v=zt(),o=t(v),g=t(o,!0);e(o),m(2),e(v),$(()=>f(g,i(S).embeddingsGenerated)),n(l,v)};_(D,l=>{i(S).embeddingsGenerated!==void 0&&l(y)})}e(a),e(r),n(s,r)};_(at,s=>{i(S)&&s(it)})}e(ve);var Ae=d(ve,2),ne=t(Ae),z=d(t(ne),2),dt=t(z);{var lt=s=>{var r=Tt();m(),n(s,r)},vt=s=>{var r=Ie("Dream");n(s,r)};_(dt,s=>{i(j)?s(lt):s(vt,!1)})}e(z),e(ne);var ot=d(ne,2);{var nt=s=>{var r=Nt(),a=t(r);{var x=l=>{var v=Ft(),o=d(Fe(v),2);fe(o,17,()=>i(h).insights,_e,(g,M)=>{var T=Et(),xe=t(T,!0);e(T),$(E=>f(xe,E),[()=>typeof i(M)=="string"?i(M):JSON.stringify(i(M))]),n(g,T)}),n(l,v)},k=F(()=>i(h).insights&&Array.isArray(i(h).insights));_(a,l=>{i(k)&&l(x)})}var u=d(a,2);{var w=l=>{var v=It(),o=d(t(v)),g=t(o,!0);e(o),e(v),$(()=>f(g,i(h).connections_found)),n(l,v)};_(u,l=>{i(h).connections_found!==void 0&&l(w)})}var D=d(u,2);{var y=l=>{var v=Ot(),o=d(t(v)),g=t(o,!0);e(o),e(v),$(()=>f(g,i(h).memories_replayed)),n(l,v)};_(D,l=>{i(h).memories_replayed!==void 0&&l(y)})}e(r),n(s,r)};_(ot,s=>{i(h)&&s(nt)})}e(Ae),e(H),R(H,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:60}));var Pe=d(H,2);{var mt=s=>{var r=Wt(),a=t(r),x=t(a);P(x,{name:"importance",size:16,class:"text-recall"}),m(),e(a);var k=d(a,2),u=t(k);{var w=y=>{var l=Kt();fe(l,21,()=>i(G).distribution,_e,(v,o,g)=>{const M=F(()=>Math.max(...i(G).distribution.map(pe=>pe.count),1)),T=F(()=>i(o).count/i(M)*100),xe=F(()=>g<2?"#ef4444":g<4?"#f59e0b":g<7?"#6366f1":"#10b981");var E=Bt(),ue=t(E),ut=t(ue,!0);e(ue);var Ee=d(ue,2),pt=d(Ee,2);pt.textContent=`${g*10}%`,e(E),$(pe=>{f(ut,i(o).count),Y(Ee,`height: ${pe??""}%; background: ${i(xe)??""}; opacity: 0.7`)},[()=>Math.max(i(T),2)]),n(v,E)}),e(l),n(y,l)},D=F(()=>i(G).distribution&&Array.isArray(i(G).distribution));_(u,y=>{i(D)&&y(w)})}e(k),e(r),R(r,(y,l)=>{var v;return(v=A)==null?void 0:v(y,l)},()=>({delay:120})),n(s,r)};_(Pe,s=>{i(G)&&s(mt)})}var U=d(Pe,2),me=t(U),ct=t(me);P(ct,{name:"command",size:16,class:"text-synapse"}),m(),e(me);var Ge=d(me,2),je=t(Ge);fe(je,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],_e,(s,r)=>{var a=qt(),x=t(a),k=t(x,!0);e(x);var u=d(x,2),w=t(u,!0);e(u),e(a),$(()=>{f(k,r.key),f(w,r.desc)}),n(s,a)}),e(je),e(Ge),e(U),R(U,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:160}));var ce=d(U,2),ge=t(ce),gt=t(ge);P(gt,{name:"logo",size:16,class:"text-memory"}),m(),e(ge);var ze=d(ge,2),Me=t(ze),Te=t(Me),xt=t(Te);P(xt,{name:"logo",size:20,strokeWidth:1.8}),e(Te),m(2),e(Me),m(4),e(ze),e(ce),R(ce,(s,r)=>{var a;return(a=A)==null?void 0:a(s,r)},()=>({delay:200})),e(Z),$(s=>{f(Ve,Be()),Y(te,`color: ${L()>.7?"#10b981":L()>.4?"#f59e0b":"#ef4444"}`),f(Ye,`${s??""}%`),Se=V(se,1,"w-2.5 h-2.5 rounded-full svelte-15kgmsr",null,Se,{"ping-host":b(),breathe:!b()}),Y(se,`color:${b()?"var(--color-recall)":"var(--color-decay)"};background:${b()?"var(--color-recall)":"var(--color-decay)"}`),f(Le,b()?"Online":"Offline"),J.disabled=i(N),z.disabled=i(j),V(z,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2 ${i(j)?"glow-dream animate-pulse-glow":""}`,"svelte-15kgmsr")},[()=>(L()*100).toFixed(1)]),I("click",ie,function(...s){var r;(r=Dt)==null||r.apply(this,s)}),I("click",le,We),I("click",J,Je),I("click",z,Ue),n(Oe,Z),bt(),Ke()}yt(["click"]);export{ds as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js.br b/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js.br new file mode 100644 index 0000000..c95183f Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js.gz b/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js.gz new file mode 100644 index 0000000..ff6ba59 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/20.C9dv6aje.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js.br b/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js.br deleted file mode 100644 index fdc3112..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js.gz b/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js.gz deleted file mode 100644 index 683ae7f..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js.br b/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js.br deleted file mode 100644 index 4105f13..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js.gz b/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js.gz deleted file mode 100644 index 6a542c2..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js b/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js similarity index 92% rename from apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js rename to apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js index 145180a..fb0162e 100644 --- a/apps/dashboard/build/_app/immutable/nodes/20.Di2Q3Va0.js +++ b/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js @@ -1 +1 @@ -import"../chunks/Bzak7iHL.js";import{o as Rt}from"../chunks/TZu9D97Z.js";import{p as Ct,a as p,b as kt,j as f,e,l as dt,i as D,c as At,f as lt,g as t,h as i,r as a,t as j,s as J,n as K,u as Q}from"../chunks/wpu9U-D0.js";import{d as Mt,s as R,a as Pt}from"../chunks/D8mhvFt8.js";import{i as V}from"../chunks/DKve45Wd.js";import{e as W,i as X}from"../chunks/60_R_Vbt.js";import{a as c,r as C}from"../chunks/P1-U_Xsj.js";import{s as B}from"../chunks/EqHb-9AZ.js";import{a as S}from"../chunks/CZfHMhLI.js";import{P as Dt}from"../chunks/BHDZZvku.js";import{A as U}from"../chunks/DcKTNC6e.js";import{s as Z}from"../chunks/DPdYG9yN.js";import{N as ut}from"../chunks/CcUbQ_Wl.js";var St=f('
                    '),Et=f('
                    '),Ot=f('
                    '),Tt=f('
                    '),Nt=f('
                    '),jt=f('
                    '),Bt=f('

                    '),Ft=f('

                    Retention Distribution

                    Memory Types

                    ',1),Lt=f('
                    Total Memories
                    Avg Retention
                    Due for Review
                    Embedding Coverage
                    ',1),Ht=f('
                    ');function aa(mt,pt){Ct(pt,!0);let _=J(null),h=J(null),b=J(null),ot=J(!0);Rt(async()=>{try{await(async n=>{var o=dt(n,3);D(_,o[0],!0),D(h,o[1],!0),D(b,o[2],!0)})(await Promise.all([S.stats(),S.health(),S.retentionDistribution()]))}catch{}finally{D(ot,!1)}});function tt(n){return{healthy:"#10b981",degraded:"#f59e0b",critical:"#ef4444",empty:"#6b7280"}[n]||"#6b7280"}async function gt(){try{await S.consolidate(),await(async n=>{var o=dt(n,3);D(_,o[0],!0),D(h,o[1],!0),D(b,o[2],!0)})(await Promise.all([S.stats(),S.health(),S.retentionDistribution()]))}catch{}}var at=Ht(),nt=e(at);Dt(nt,{icon:"stats",title:"System Stats",subtitle:"Live health and retention across your memory store",accent:"recall",children:(n,o)=>{var w=At(),$=lt(w);{var E=F=>{var g=St(),O=e(g),L=i(O,2),k=e(L,!0);a(L);var H=i(L,2),et=e(H);a(H),a(g),j((T,Y,rt,q)=>{B(g,`color: ${T??""}`),B(O,`color: ${Y??""}; background: ${rt??""}`),R(k,q),R(et,`v${t(h).version??""}`)},[()=>tt(t(h).status),()=>tt(t(h).status),()=>tt(t(h).status),()=>t(h).status.toUpperCase()]),p(F,g)};V($,F=>{t(h)&&F(E)})}p(n,w)},$$slots:{default:!0}});var xt=i(nt,2);{var ft=n=>{var o=Ot();W(o,20,()=>Array(8),X,(w,$)=>{var E=Et();p(w,E)}),a(o),p(n,o)},_t=n=>{var o=Lt(),w=lt(o),$=e(w),E=e($),F=e(E);U(F,{get value(){return t(_).totalMemories}}),a(E),K(2),a($),c($,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:0})),c($,s=>{var r;return(r=Z)==null?void 0:r(s)});var g=i($,2),O=e(g),L=e(O);U(L,{get value(){return t(_).averageRetention},scale:100,decimals:1,suffix:"%"}),a(O),K(2),a(g),c(g,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:70})),c(g,s=>{var r;return(r=Z)==null?void 0:r(s)});var k=i(g,2),H=e(k),et=e(H);U(et,{get value(){return t(_).dueForReview}}),a(H),K(2),a(k),c(k,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:140})),c(k,s=>{var r;return(r=Z)==null?void 0:r(s)});var T=i(k,2),Y=e(T),rt=e(Y);U(rt,{get value(){return t(_).embeddingCoverage},decimals:0,suffix:"%"}),a(Y),K(2),a(T),c(T,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:210})),c(T,s=>{var r;return(r=Z)==null?void 0:r(s)}),a(w);var q=i(w,2);{var ht=s=>{var r=Ft(),d=lt(r),vt=i(e(d),2);W(vt,21,()=>t(b).distribution,X,(u,l,x)=>{const A=Q(()=>Math.max(...t(b).distribution.map(I=>I.count),1)),N=Q(()=>t(l).count/t(A)*100),y=Q(()=>x<3?"#ef4444":x<5?"#f59e0b":x<7?"#10b981":"#6366f1");var v=Tt(),m=e(v),M=e(m,!0);a(m);var P=i(m,2),z=i(P,2),it=e(z,!0);a(z),a(v),j(()=>{R(M,t(l).count),B(P,`height: ${t(N)??""}%; background: ${t(y)??""}; opacity: 0.7; min-height: 2px`),R(it,t(l).range)}),p(u,v)}),a(vt),a(d),c(d,u=>{var l;return(l=C)==null?void 0:l(u)});var G=i(d,2),ct=i(e(G),2);W(ct,21,()=>Object.entries(t(b).byType),X,(u,l)=>{var x=Q(()=>dt(t(l),2));let A=()=>t(x)[0],N=()=>t(x)[1];var y=Nt(),v=e(y),m=i(v,2),M=e(m,!0);a(m);var P=i(m,2),z=e(P);U(z,{get value(){return N()}}),a(P),a(y),j(()=>{B(v,`background: ${(ut[A()]||"#8B95A5")??""}; box-shadow: 0 0 8px ${(ut[A()]||"#8B95A5")??""}80`),R(M,A())}),p(u,y)}),a(ct),a(G),c(G,u=>{var l;return(l=C)==null?void 0:l(u)});var yt=i(G,2);{var wt=u=>{var l=Bt(),x=e(l),A=i(e(x));a(x);var N=i(x,2);W(N,21,()=>t(b).endangered.slice(0,20),X,(y,v)=>{var m=jt(),M=e(m),P=e(M);a(M);var z=i(M,2),it=e(z);a(z);var I=i(z,2),$t=e(I,!0);a(I),a(m),j(zt=>{R(P,`${zt??""}%`),B(it,`width: ${t(v).retentionStrength*100}%`),R($t,t(v).content)},[()=>(t(v).retentionStrength*100).toFixed(0)]),p(y,m)}),a(N),a(l),c(l,y=>{var v;return(v=C)==null?void 0:v(y)}),j(()=>R(A,` Endangered Memories (${t(b).endangered.length??""})`)),p(u,l)};V(yt,u=>{t(b).endangered.length>0&&u(wt)})}p(s,r)};V(q,s=>{t(b)&&s(ht)})}var st=i(q,2),bt=e(st);a(st),c(st,s=>{var r;return(r=C)==null?void 0:r(s)}),j(()=>B(O,`color: ${t(_).averageRetention>.7?"var(--color-recall)":t(_).averageRetention>.4?"var(--color-warning)":"var(--color-decay)"}`)),Pt("click",bt,gt),p(n,o)};V(xt,n=>{t(ot)?n(ft):t(_)&&t(h)&&n(_t,1)})}a(at),p(mt,at),kt()}Mt(["click"]);export{aa as component}; +import"../chunks/Bzak7iHL.js";import{o as Rt}from"../chunks/JVtQszIZ.js";import{p as Ct,a as p,b as kt,j as f,e,l as dt,i as D,c as At,f as lt,g as t,h as i,r as a,t as j,s as J,n as K,u as Q}from"../chunks/CW7md74C.js";import{d as Mt,s as R,a as Pt}from"../chunks/D90q9c2i.js";import{i as V}from"../chunks/9-jplUL5.js";import{e as W,i as X}from"../chunks/Cc0l8Nd4.js";import{a as c,r as C}from"../chunks/D8RjhgN0.js";import{s as B}from"../chunks/BNUnVJrY.js";import{a as S}from"../chunks/C-rZhKee.js";import{P as Dt}from"../chunks/DTO0IjuV.js";import{A as U}from"../chunks/CaR6YsRq.js";import{s as Z}from"../chunks/DPdYG9yN.js";import{N as ut}from"../chunks/CcUbQ_Wl.js";var St=f('
                    '),Et=f('
                    '),Ot=f('
                    '),Tt=f('
                    '),Nt=f('
                    '),jt=f('
                    '),Bt=f('

                    '),Ft=f('

                    Retention Distribution

                    Memory Types

                    ',1),Lt=f('
                    Total Memories
                    Avg Retention
                    Due for Review
                    Embedding Coverage
                    ',1),Ht=f('
                    ');function aa(mt,pt){Ct(pt,!0);let _=J(null),h=J(null),b=J(null),ot=J(!0);Rt(async()=>{try{await(async n=>{var o=dt(n,3);D(_,o[0],!0),D(h,o[1],!0),D(b,o[2],!0)})(await Promise.all([S.stats(),S.health(),S.retentionDistribution()]))}catch{}finally{D(ot,!1)}});function tt(n){return{healthy:"#10b981",degraded:"#f59e0b",critical:"#ef4444",empty:"#6b7280"}[n]||"#6b7280"}async function gt(){try{await S.consolidate(),await(async n=>{var o=dt(n,3);D(_,o[0],!0),D(h,o[1],!0),D(b,o[2],!0)})(await Promise.all([S.stats(),S.health(),S.retentionDistribution()]))}catch{}}var at=Ht(),nt=e(at);Dt(nt,{icon:"stats",title:"System Stats",subtitle:"Live health and retention across your memory store",accent:"recall",children:(n,o)=>{var w=At(),$=lt(w);{var E=F=>{var g=St(),O=e(g),L=i(O,2),k=e(L,!0);a(L);var H=i(L,2),et=e(H);a(H),a(g),j((T,Y,rt,q)=>{B(g,`color: ${T??""}`),B(O,`color: ${Y??""}; background: ${rt??""}`),R(k,q),R(et,`v${t(h).version??""}`)},[()=>tt(t(h).status),()=>tt(t(h).status),()=>tt(t(h).status),()=>t(h).status.toUpperCase()]),p(F,g)};V($,F=>{t(h)&&F(E)})}p(n,w)},$$slots:{default:!0}});var xt=i(nt,2);{var ft=n=>{var o=Ot();W(o,20,()=>Array(8),X,(w,$)=>{var E=Et();p(w,E)}),a(o),p(n,o)},_t=n=>{var o=Lt(),w=lt(o),$=e(w),E=e($),F=e(E);U(F,{get value(){return t(_).totalMemories}}),a(E),K(2),a($),c($,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:0})),c($,s=>{var r;return(r=Z)==null?void 0:r(s)});var g=i($,2),O=e(g),L=e(O);U(L,{get value(){return t(_).averageRetention},scale:100,decimals:1,suffix:"%"}),a(O),K(2),a(g),c(g,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:70})),c(g,s=>{var r;return(r=Z)==null?void 0:r(s)});var k=i(g,2),H=e(k),et=e(H);U(et,{get value(){return t(_).dueForReview}}),a(H),K(2),a(k),c(k,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:140})),c(k,s=>{var r;return(r=Z)==null?void 0:r(s)});var T=i(k,2),Y=e(T),rt=e(Y);U(rt,{get value(){return t(_).embeddingCoverage},decimals:0,suffix:"%"}),a(Y),K(2),a(T),c(T,(s,r)=>{var d;return(d=C)==null?void 0:d(s,r)},()=>({delay:210})),c(T,s=>{var r;return(r=Z)==null?void 0:r(s)}),a(w);var q=i(w,2);{var ht=s=>{var r=Ft(),d=lt(r),vt=i(e(d),2);W(vt,21,()=>t(b).distribution,X,(u,l,x)=>{const A=Q(()=>Math.max(...t(b).distribution.map(I=>I.count),1)),N=Q(()=>t(l).count/t(A)*100),y=Q(()=>x<3?"#ef4444":x<5?"#f59e0b":x<7?"#10b981":"#6366f1");var v=Tt(),m=e(v),M=e(m,!0);a(m);var P=i(m,2),z=i(P,2),it=e(z,!0);a(z),a(v),j(()=>{R(M,t(l).count),B(P,`height: ${t(N)??""}%; background: ${t(y)??""}; opacity: 0.7; min-height: 2px`),R(it,t(l).range)}),p(u,v)}),a(vt),a(d),c(d,u=>{var l;return(l=C)==null?void 0:l(u)});var G=i(d,2),ct=i(e(G),2);W(ct,21,()=>Object.entries(t(b).byType),X,(u,l)=>{var x=Q(()=>dt(t(l),2));let A=()=>t(x)[0],N=()=>t(x)[1];var y=Nt(),v=e(y),m=i(v,2),M=e(m,!0);a(m);var P=i(m,2),z=e(P);U(z,{get value(){return N()}}),a(P),a(y),j(()=>{B(v,`background: ${(ut[A()]||"#8B95A5")??""}; box-shadow: 0 0 8px ${(ut[A()]||"#8B95A5")??""}80`),R(M,A())}),p(u,y)}),a(ct),a(G),c(G,u=>{var l;return(l=C)==null?void 0:l(u)});var yt=i(G,2);{var wt=u=>{var l=Bt(),x=e(l),A=i(e(x));a(x);var N=i(x,2);W(N,21,()=>t(b).endangered.slice(0,20),X,(y,v)=>{var m=jt(),M=e(m),P=e(M);a(M);var z=i(M,2),it=e(z);a(z);var I=i(z,2),$t=e(I,!0);a(I),a(m),j(zt=>{R(P,`${zt??""}%`),B(it,`width: ${t(v).retentionStrength*100}%`),R($t,t(v).content)},[()=>(t(v).retentionStrength*100).toFixed(0)]),p(y,m)}),a(N),a(l),c(l,y=>{var v;return(v=C)==null?void 0:v(y)}),j(()=>R(A,` Endangered Memories (${t(b).endangered.length??""})`)),p(u,l)};V(yt,u=>{t(b).endangered.length>0&&u(wt)})}p(s,r)};V(q,s=>{t(b)&&s(ht)})}var st=i(q,2),bt=e(st);a(st),c(st,s=>{var r;return(r=C)==null?void 0:r(s)}),j(()=>B(O,`color: ${t(_).averageRetention>.7?"var(--color-recall)":t(_).averageRetention>.4?"var(--color-warning)":"var(--color-decay)"}`)),Pt("click",bt,gt),p(n,o)};V(xt,n=>{t(ot)?n(ft):t(_)&&t(h)&&n(_t,1)})}a(at),p(mt,at),kt()}Mt(["click"]);export{aa as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js.br b/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js.br new file mode 100644 index 0000000..d950c13 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js.gz b/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js.gz new file mode 100644 index 0000000..f9ad379 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/21.VHre2za-.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js b/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js similarity index 85% rename from apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js rename to apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js index 6cb15a2..6f6f72d 100644 --- a/apps/dashboard/build/_app/immutable/nodes/21.BAlasPHS.js +++ b/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js @@ -1,3 +1,3 @@ -import"../chunks/Bzak7iHL.js";import{o as ce}from"../chunks/TZu9D97Z.js";import{p as pe,s as x,d as ue,a as d,b as _e,j as v,e as t,i as u,g as e,n as O,r as a,h as c,u as fe,t as h}from"../chunks/wpu9U-D0.js";import{d as xe,s as y,a as be}from"../chunks/D8mhvFt8.js";import{i as P}from"../chunks/DKve45Wd.js";import{e as w,i as B,s as ge}from"../chunks/60_R_Vbt.js";import{a as he,r as ye}from"../chunks/P1-U_Xsj.js";import{s as q}from"../chunks/EqHb-9AZ.js";import{a as we}from"../chunks/CZfHMhLI.js";import{N as I}from"../chunks/CcUbQ_Wl.js";import{P as ke}from"../chunks/BHDZZvku.js";import{A as G}from"../chunks/DcKTNC6e.js";import{D as $e}from"../chunks/CmbJHhgy.js";import{I as Ae}from"../chunks/D7A-gG4Z.js";var Le=v('
                    memories
                    '),Te=v('
                    '),De=v('
                    '),je=v(`

                    No memories in this window yet — widen the range or come back once Vestige has +import"../chunks/Bzak7iHL.js";import{o as ce}from"../chunks/JVtQszIZ.js";import{p as pe,s as x,d as ue,a as d,b as _e,j as v,e as t,i as u,g as e,n as O,r as a,h as c,u as fe,t as h}from"../chunks/CW7md74C.js";import{d as xe,s as y,a as be}from"../chunks/D90q9c2i.js";import{i as P}from"../chunks/9-jplUL5.js";import{e as w,i as B,s as ge}from"../chunks/Cc0l8Nd4.js";import{a as he,r as ye}from"../chunks/D8RjhgN0.js";import{s as q}from"../chunks/BNUnVJrY.js";import{a as we}from"../chunks/C-rZhKee.js";import{N as I}from"../chunks/CcUbQ_Wl.js";import{P as ke}from"../chunks/DTO0IjuV.js";import{A as G}from"../chunks/CaR6YsRq.js";import{D as $e}from"../chunks/DUAsElMg.js";import{I as Ae}from"../chunks/CqwrgJOn.js";var Le=v('

                    memories
                    '),Te=v('
                    '),De=v('
                    '),je=v(`

                    No memories in this window yet — widen the range or come back once Vestige has been remembering a while.

                    `),Ce=v('
                    '),Ne=v(' '),Oe=v('
                    '),Pe=v('
                    '),Be=v('
                    '),Ie=v('
                    '),Me=v('
                    ');function Ue(J,K){pe(K,!0);let f=x(ue([])),k=x(!0),M=x(14),b=x(null);ce(()=>S());async function S(){u(k,!0);try{const s=await we.timeline(e(M),500);u(f,s.timeline,!0)}catch{u(f,[],!0)}finally{u(k,!1)}}const Q=[{value:"7",label:"Last 7 days"},{value:"14",label:"Last 14 days"},{value:"30",label:"Last 30 days"},{value:"90",label:"Last 90 days"},{value:"365",label:"Last year"}];let E=x("14");function U(s){u(M,parseInt(s,10),!0),S()}let X=fe(()=>e(f).reduce((s,r)=>s+r.count,0));var $=Me(),R=t($);ke(R,{icon:"timeline",title:"Timeline",subtitle:"Watch your memories accumulate, day by day",accent:"synapse",children:(s,r)=>{var l=Le(),m=t(l),i=t(m);G(i,{get value(){return e(X)}}),O(),a(m);var A=c(m,2);$e(A,{get options(){return Q},label:"Range",icon:"schedule",onChange:U,get value(){return e(E)},set value(_){u(E,_,!0)}}),a(l),d(s,l)},$$slots:{default:!0}});var Z=c(R,2);{var ee=s=>{var r=De();w(r,20,()=>Array(7),B,(l,m)=>{var i=Te();d(l,i)}),a(r),d(s,r)},ae=s=>{var r=je(),l=t(r),m=t(l);Ae(m,{name:"timeline",size:48,strokeWidth:1.2}),a(l),O(2),a(r),d(s,r)},te=s=>{var r=Ie(),l=c(t(r),2);w(l,23,()=>e(f),m=>m.date,(m,i,A)=>{var _=Be(),g=c(t(_),2),L=t(g),T=t(L),D=t(T),se=t(D,!0);a(D);var W=c(D,2),re=t(W);G(re,{get value(){return e(i).count}}),O(),a(W),a(T);var z=c(T,2),F=t(z);w(F,17,()=>e(i).memories.slice(0,10),B,(n,o)=>{var p=Ce();h(()=>q(p,`background: ${(I[e(o).nodeType]||"#8B95A5")??""}; opacity: ${.3+e(o).retentionStrength*.7}; box-shadow: 0 0 5px ${(I[e(o).nodeType]||"#8B95A5")??""}66`)),d(n,p)});var ie=c(F,2);{var oe=n=>{var o=Ne(),p=t(o);a(o),h(()=>y(p,`+${e(i).memories.length-10}`)),d(n,o)};P(ie,n=>{e(i).memories.length>10&&n(oe)})}a(z),a(L);var le=c(L,2);{var ne=n=>{var o=Pe();w(o,21,()=>e(i).memories,B,(p,j)=>{var C=Oe(),H=t(C),N=c(H,2),V=t(N),de=t(V,!0);a(V),a(N);var Y=c(N,2),ve=t(Y);a(Y),a(C),h(me=>{q(H,`background: ${(I[e(j).nodeType]||"#8B95A5")??""}`),y(de,e(j).content),y(ve,`${me??""}%`)},[()=>(e(j).retentionStrength*100).toFixed(0)]),d(p,C)}),a(o),d(n,o)};P(le,n=>{e(b)===e(i).date&&n(ne)})}a(g),a(_),he(_,(n,o)=>{var p;return(p=ye)==null?void 0:p(n,o)},()=>({delay:Math.min(e(A)*35,350),y:12})),h(()=>{ge(g,1,`lift w-full text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.04] transition-all duration-200 ${e(b)===e(i).date?"!border-synapse/40 glow-synapse":""}`),y(se,e(i).date)}),be("click",g,()=>u(b,e(b)===e(i).date?null:e(i).date,!0)),d(m,_)}),a(l),a(r),d(s,r)};P(Z,s=>{e(k)?s(ee):e(f).length===0?s(ae,1):s(te,!1)})}a($),d(J,$),_e()}xe(["click"]);export{Ue as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js.br b/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js.br new file mode 100644 index 0000000..46e83db Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js.gz b/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js.gz new file mode 100644 index 0000000..3be000d Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/22.BiOaW6TI.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js.br b/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js.br deleted file mode 100644 index 44eb9a2..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js.gz b/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js.gz deleted file mode 100644 index 8269504..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js b/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js similarity index 95% rename from apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js rename to apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js index 6743212..18f4082 100644 --- a/apps/dashboard/build/_app/immutable/nodes/22.C719k-1W.js +++ b/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{o as it}from"../chunks/TZu9D97Z.js";import{p as ct,s as p,d as mt,t as f,g as a,a as v,b as dt,x as pt,h as s,e as r,i as c,j as h,ar as vt,n as $e,r as o,k as ut}from"../chunks/wpu9U-D0.js";import{d as ht,e as Qe,s as u,a as bt}from"../chunks/D8mhvFt8.js";import{i as We}from"../chunks/DKve45Wd.js";import{e as k,a as Ge,i as P,r as W,s as He}from"../chunks/60_R_Vbt.js";import{h as yt}from"../chunks/DzesjbbJ.js";import{s as gt}from"../chunks/EqHb-9AZ.js";import{b as V}from"../chunks/CnZzd20v.js";import{b as Re}from"../chunks/DrafHjYM.js";import{b as ft}from"../chunks/g5OnrUYZ.js";import{b as Ue}from"../chunks/Bxs5UR9-.js";var qt=h(''),_t=h('
                    '),wt=h("

                    "),kt=h('
                    '),Pt=h('

                    '),xt=h('

                    '),St=h("
                    "),Tt=h('

                    Checking the onboarding notes...

                    '),Ct=h(''),Mt=h(`
                    V Vestige Pro

                    June early access

                    Vestige Pro

                    The paid layer for developers and teams who already trust Vestige as local memory for AI agents. +import"../chunks/Bzak7iHL.js";import{o as it}from"../chunks/JVtQszIZ.js";import{p as ct,s as p,d as mt,t as f,g as a,a as v,b as dt,A as pt,h as s,e as r,i as c,j as h,as as vt,n as $e,r as o,k as ut}from"../chunks/CW7md74C.js";import{d as ht,e as Qe,s as u,a as bt}from"../chunks/D90q9c2i.js";import{i as We}from"../chunks/9-jplUL5.js";import{e as k,a as Ge,i as P,r as W,s as He}from"../chunks/Cc0l8Nd4.js";import{h as yt}from"../chunks/C98jjAli.js";import{s as gt}from"../chunks/BNUnVJrY.js";import{b as V}from"../chunks/CFefTDKL.js";import{b as Re}from"../chunks/C4Tpoo1i.js";import{b as ft}from"../chunks/ChcFQRZo.js";import{b as Ue}from"../chunks/CaEJGM7b.js";var qt=h(''),_t=h('

                    '),wt=h("

                    "),kt=h('
                    '),Pt=h('

                    '),xt=h('

                    '),St=h("
                    "),Tt=h('

                    Checking the onboarding notes...

                    '),Ct=h(''),Mt=h(`
                    V Vestige Pro

                    June early access

                    Vestige Pro

                    The paid layer for developers and teams who already trust Vestige as local memory for AI agents. Sync, backups, team memory, and bot-assisted support come next.

                    Early access

                    Reserve a Pro seat

                    Why Pro exists

                    Two plans. One promise: agent memory you can depend on.

                    Always-on answers

                    The support bot handles the first wave.

                    This is the first support layer: instant onboarding answers before anyone has to write an email. It can run locally from the FAQ now and call a hosted support endpoint later.

                    Onboarding bot

                    May to June

                    The plan is simple.

                    1. May Get Vestige into every MCP, Claude Code, Cursor, local AI, Rust, and self-hosted channel that cares about agent memory.
                    2. June Invite the first Solo Pro and Team Pro users into sync, backups, shared memory, PostgreSQL-backed deployments, and bot-assisted support.
                    3. After Use paid feedback to turn Vestige from a beloved local tool into durable agent-memory infrastructure.
                    `);function Ut(Be,Ee){ct(Ee,!0);let q,G=p(""),j=p(""),I=p("solo"),J=p("sync"),x=p(""),H=p(""),y=p("idle"),_=p(""),S=p(""),T=p(!1),C=p(mt([{role:"bot",content:"Ask me about installing Vestige, whether heavy models are required, Solo vs Team Pro, sync, pricing, or what happens after you join the June list."}]));const Fe=[{value:"Local",label:"SQLite memory, no hosted memory service"},{value:"MCP",label:"Claude Code, Cursor, Cline, Codex, Goose"},{value:"June",label:"Pro sync, backup, team memory early access"}],De=[{name:"Solo Pro",accent:"#22c55e",copy:"Multi-device sync, encrypted backups, managed updates, and a cleaner memory dashboard for developers living inside AI coding agents."},{name:"Team Pro",accent:"#06b6d4",copy:"Shared project memory, admin review, audit trails, PostgreSQL-backed deployments, and async support for engineering teams."}],Oe=["Private by default","Sync without lock-in","Team memory controls","Bot-assisted support"],ze=[{label:"Install",prompt:"How do I install Vestige and connect it to Claude Code?"},{label:"No 20GB?",prompt:"Do I need the Sanhedrin model or 20GB of RAM?"},{label:"Solo vs Team",prompt:"Should I choose Solo Pro or Team Pro?"},{label:"Sync",prompt:"How will Pro sync and backups work?"},{label:"Pricing",prompt:"How much will Vestige Pro cost?"},{label:"Human help",prompt:"When does a human get involved?"}];it(()=>{const t=q.getContext("2d");if(!t)return;const e=t;let l=0,i=0,m=0;const d=Array.from({length:62},(b,w)=>({x:Math.random(),y:Math.random(),vx:(Math.random()-.5)*16e-5,vy:(Math.random()-.5)*16e-5,phase:Math.random()*Math.PI*2,kind:w%5}));function M(){const b=Math.min(window.devicePixelRatio||1,2);i=window.innerWidth,m=window.innerHeight,q.width=Math.floor(i*b),q.height=Math.floor(m*b),q.style.width=`${i}px`,q.style.height=`${m}px`,e.setTransform(b,0,0,b,0,0)}function Me(b){e.clearRect(0,0,i,m);const w=e.createLinearGradient(0,0,i,m);w.addColorStop(0,"#07100f"),w.addColorStop(.45,"#0b1221"),w.addColorStop(1,"#15100a"),e.fillStyle=w,e.fillRect(0,0,i,m),e.strokeStyle="rgba(148, 163, 184, 0.08)",e.lineWidth=1;for(let n=0;n.96)&&(n.vx*=-1),(n.y<.06||n.y>.94)&&(n.vy*=-1);for(let n=0;n{cancelAnimationFrame(l),window.removeEventListener("resize",M)}});function Ne(){const t=["## Vestige Pro waitlist","",`Plan: ${a(I)}`,`Priority: ${a(J)}`,a(x).trim()?`Use case: ${a(x).trim()}`:"Use case:","","Please do not include private email addresses in this public issue."].join(` `);return`https://github.com/samvallad33/vestige/issues/new?title=${encodeURIComponent("Vestige Pro waitlist")}&body=${encodeURIComponent(t)}`}async function Ye(t){if(t.preventDefault(),c(y,"submitting"),c(_,""),a(H).trim()){c(y,"success"),c(_,"You are on the list.");return}if(!a(j).includes("@")){c(y,"error"),c(_,"Enter an email so the early-access invite can reach you.");return}a(G).trim(),a(j).trim(),a(I),a(J),a(x).trim(),new Date().toISOString();{c(y,"success"),c(_,"Email capture is ready for an endpoint. Opening the GitHub waitlist fallback with your email omitted."),window.open(Ne(),"_blank","noopener,noreferrer");return}}function Ke(t){const e=t.toLowerCase();return/(install|setup|onboard|claude|cursor|cline|codex|connect)/.test(e)?["Start with the open-source install:","1. `npm install -g vestige-mcp-server@latest`","2. Claude Code: `claude mcp add vestige vestige-mcp -s user`","3. Codex: `codex mcp add vestige -- vestige-mcp`","Then test it by asking your agent to remember a preference, opening a fresh session, and asking for that preference back."].join(` diff --git a/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js.br b/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js.br new file mode 100644 index 0000000..edff3a1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js.gz b/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js.gz new file mode 100644 index 0000000..5bdda7b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/23.BCAC1xxA.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js b/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js deleted file mode 100644 index f32c7fa..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js +++ /dev/null @@ -1 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/BLadwbF7.js";import{o as r}from"../chunks/TZu9D97Z.js";import{p as t,b as a}from"../chunks/wpu9U-D0.js";import{g as m}from"../chunks/dCAmqaEc.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js.br b/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js.br deleted file mode 100644 index cab233b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js.gz b/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js.gz deleted file mode 100644 index 55534f3..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/3.C8tBBpzF.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js b/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js new file mode 100644 index 0000000..5334280 --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js @@ -0,0 +1 @@ +import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/C9BpaXFO.js";import{o as r}from"../chunks/JVtQszIZ.js";import{p as t,b as a}from"../chunks/CW7md74C.js";import{g as m}from"../chunks/Dm3aSj4w.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js.br b/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js.br new file mode 100644 index 0000000..9b9d686 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js.gz b/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js.gz new file mode 100644 index 0000000..00ef6dc Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/3.CA0lgdaC.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js.br b/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js.br deleted file mode 100644 index 5e59fe8..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js.gz b/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js.gz deleted file mode 100644 index eaa3ab1..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js b/apps/dashboard/build/_app/immutable/nodes/4.D2zZxlO6.js similarity index 94% rename from apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js rename to apps/dashboard/build/_app/immutable/nodes/4.D2zZxlO6.js index 7a9f2b2..49eb9cc 100644 --- a/apps/dashboard/build/_app/immutable/nodes/4.BpOpkZuP.js +++ b/apps/dashboard/build/_app/immutable/nodes/4.D2zZxlO6.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{o as Me,a as Se}from"../chunks/TZu9D97Z.js";import{p as Ae,s as I,d as ue,o as xe,h as y,e as n,t as L,g as e,a as E,c as Ge,f as ke,u as ve,r as c,b as Be,i as p,au as ne,j as Y,n as oe}from"../chunks/wpu9U-D0.js";import{s as j,d as Ce,a as ge}from"../chunks/D8mhvFt8.js";import{i as fe}from"../chunks/DKve45Wd.js";import{a as ye,r as Re}from"../chunks/P1-U_Xsj.js";import{e as pe,a as u,i as he,s as Le,r as be}from"../chunks/60_R_Vbt.js";import{b as Te,a as Oe}from"../chunks/CnZzd20v.js";import{a as _e}from"../chunks/CZfHMhLI.js";import{e as De}from"../chunks/BhIgFntf.js";import{p as J}from"../chunks/ByYB047u.js";import{N as je}from"../chunks/CcUbQ_Wl.js";import{P as Ke}from"../chunks/BHDZZvku.js";import{I as de}from"../chunks/D7A-gG4Z.js";import{A as Ue}from"../chunks/DcKTNC6e.js";import{m as ze}from"../chunks/DPdYG9yN.js";const qe=.93,Ye=.05,we="#8B95A5",He="#818cf8",Ve=140,me=8,Qe=4,We=12;function Xe(a){return!Number.isFinite(a)||a<=0?0:a*qe}function Je(a){return Number.isFinite(a)?a>=Ye:!1}function Ie(a){return!Number.isFinite(a)||atypeof w=="string");S.length!==0&&v.push({source_id:M.source_id,target_ids:S})}return v.reverse()}var st=ne(''),it=ne(''),at=ne(' '),ot=ne(''),nt=ne('');function ct(a,m){Ae(m,!0);let v=J(m,"width",3,900),h=J(m,"height",3,560),M=J(m,"source",3,null),S=J(m,"neighbours",19,()=>[]),w=J(m,"liveBurstKey",3,0),B=J(m,"liveBurst",3,null);const P=22,Z=14;let F=I(ue([])),G=I(ue([])),T=I(ue([])),H=0,K=null,ce=null,$=0;function ee(l,r,x,b){H+=1;const i=H,f=w()>0&&e(F).length>0?40:0,g=x+(Math.random()-.5)*f,_=b+(Math.random()-.5)*f;p(T,[...e(T),{burstId:i,x:g,y:_,radius:P,opacity:.75},{burstId:i,x:g,y:_,radius:P,opacity:.5}],!0);const X={id:`${l.id}::${i}`,label:l.label,nodeType:"source",x:g,y:_,activation:1,isSource:!0,sourceBurstId:i},U=[],C=[],R=H*.37%(Math.PI*2),se=Ze(g,_,r.length,R);r.forEach((z,ie)=>{const ae=se[ie];ae&&(U.push({id:`${z.id}::${i}`,label:z.label,nodeType:z.nodeType,x:ae.x,y:ae.y,activation:$e(ie,r.length),isSource:!1,sourceBurstId:i}),C.push({burstId:i,sourceNodeId:X.id,targetNodeId:`${z.id}::${i}`,drawProgress:0,staggerDelay:et(ie),framesElapsed:0}))}),p(F,[...e(F),X,...U],!0),p(G,[...e(G),...C],!0)}function V(){let l=[];for(const i of e(F)){const f=Xe(i.activation);Je(f)&&l.push({...i,activation:f})}p(F,l,!0);const r=new Set(l.map(i=>i.id));let x=[];for(const i of e(G)){if(!r.has(i.sourceNodeId)||!r.has(i.targetNodeId))continue;const f=i.framesElapsed+1;let g=i.drawProgress;f>=i.staggerDelay&&(g=Math.min(1,g+1/15)),x.push({...i,framesElapsed:f,drawProgress:g})}p(G,x,!0);let b=[];for(const i of e(T)){const f=i.radius+6,g=i.opacity*.96;g<.02||f>Math.max(v(),h())||b.push({...i,radius:f,opacity:g})}p(T,b,!0),K=requestAnimationFrame(V)}function Q(){p(F,[],!0),p(G,[],!0),p(T,[],!0)}xe(()=>{if(!M())return;const l=M().id;l!==ce&&(ce=l,Q(),ee(M(),S(),v()/2,h()/2))}),xe(()=>{if(!B()||w()===0||w()===$)return;$=w();const l=(Math.random()-.5)*120,r=(Math.random()-.5)*120;ee(B().source,B().neighbours,v()/2+l,h()/2+r)}),Me(()=>{K=requestAnimationFrame(V)}),Se(()=>{K!==null&&cancelAnimationFrame(K)});function le(l,r){return tt(l,r)}function te(l){const r=e(F).find(f=>f.id===l.sourceNodeId),x=e(F).find(f=>f.id===l.targetNodeId);if(!r||!x)return null;const b=r.x+(x.x-r.x)*l.drawProgress,i=r.y+(x.y-r.y)*l.drawProgress;return{x1:r.x,y1:r.y,x2:b,y2:i}}var O=nt(),q=y(n(O));pe(q,17,()=>e(T),he,(l,r)=>{var x=st();L(()=>{u(x,"cx",e(r).x),u(x,"cy",e(r).y),u(x,"r",e(r).radius),u(x,"opacity",e(r).opacity)}),E(l,x)});var re=y(q);pe(re,17,()=>e(G),he,(l,r)=>{const x=ve(()=>te(e(r)));var b=Ge(),i=ke(b);{var f=g=>{var _=it();L(()=>{u(_,"x1",e(x).x1),u(_,"y1",e(x).y1),u(_,"x2",e(x).x2),u(_,"y2",e(x).y2),u(_,"opacity",.35*e(r).drawProgress)}),E(g,_)};fe(i,g=>{e(x)&&g(f)})}E(l,b)});var W=y(re);pe(W,17,()=>e(F),l=>l.id,(l,r)=>{const x=ve(()=>le(e(r).nodeType,e(r).isSource)),b=ve(()=>e(r).isSource?P*(.7+.3*e(r).activation):Z*(.5+.8*e(r).activation));var i=ot(),f=n(i),g=y(f),_=y(g),X=y(_);{var U=C=>{var R=at(),se=n(R,!0);c(R),L(z=>{u(R,"x",e(r).x),u(R,"y",e(r).y+e(b)+18),u(R,"opacity",.9*e(r).activation),j(se,z)},[()=>e(r).label.length>40?e(r).label.slice(0,40)+"…":e(r).label]),E(C,R)};fe(X,C=>{e(r).isSource&&e(r).label&&C(U)})}c(i),L(C=>{u(i,"opacity",C),u(f,"cx",e(r).x),u(f,"cy",e(r).y),u(f,"r",e(b)*1.9),u(f,"fill",e(x)),u(f,"opacity",.18*e(r).activation),u(g,"cx",e(r).x),u(g,"cy",e(r).y),u(g,"r",e(b)),u(g,"fill",e(x)),u(_,"cx",e(r).x-e(b)*.3),u(_,"cy",e(r).y-e(b)*.3),u(_,"r",e(b)*.35),u(_,"opacity",.35*e(r).activation)},[()=>Math.min(1,e(r).activation*1.25)]),E(l,i)}),c(O),L(()=>{u(O,"width",v()),u(O,"height",h()),u(O,"viewBox",`0 0 ${v()??""} ${h()??""}`)}),E(a,O),Be()}var lt=Y('
                    · bursts
                    '),dt=Y('

                    Computing activation…

                    '),ut=Y('

                    Activation failed

                    '),ft=Y(`

                    No matching memory

                    Nothing in the graph matches . Try a broader +import"../chunks/Bzak7iHL.js";import{o as Me,a as Se}from"../chunks/JVtQszIZ.js";import{p as Ae,s as I,d as ue,x as xe,h as y,e as n,t as L,g as e,a as E,c as Ge,f as ke,u as ve,r as c,b as Be,i as p,av as ne,j as Y,n as oe}from"../chunks/CW7md74C.js";import{s as j,d as Ce,a as ge}from"../chunks/D90q9c2i.js";import{i as fe}from"../chunks/9-jplUL5.js";import{a as ye,r as Re}from"../chunks/D8RjhgN0.js";import{e as pe,a as u,i as he,s as Le,r as be}from"../chunks/Cc0l8Nd4.js";import{b as Te,a as Oe}from"../chunks/CFefTDKL.js";import{a as _e}from"../chunks/C-rZhKee.js";import{e as De}from"../chunks/BFpewGai.js";import{p as J}from"../chunks/BjbQ7qSx.js";import{N as je}from"../chunks/CcUbQ_Wl.js";import{P as Ke}from"../chunks/DTO0IjuV.js";import{I as de}from"../chunks/CqwrgJOn.js";import{A as Ue}from"../chunks/CaR6YsRq.js";import{m as ze}from"../chunks/DPdYG9yN.js";const qe=.93,Ye=.05,we="#8B95A5",He="#818cf8",Ve=140,me=8,Qe=4,We=12;function Xe(a){return!Number.isFinite(a)||a<=0?0:a*qe}function Je(a){return Number.isFinite(a)?a>=Ye:!1}function Ie(a){return!Number.isFinite(a)||atypeof w=="string");S.length!==0&&v.push({source_id:M.source_id,target_ids:S})}return v.reverse()}var st=ne(''),it=ne(''),at=ne(' '),ot=ne(''),nt=ne('');function ct(a,m){Ae(m,!0);let v=J(m,"width",3,900),h=J(m,"height",3,560),M=J(m,"source",3,null),S=J(m,"neighbours",19,()=>[]),w=J(m,"liveBurstKey",3,0),B=J(m,"liveBurst",3,null);const P=22,Z=14;let F=I(ue([])),G=I(ue([])),T=I(ue([])),H=0,K=null,ce=null,$=0;function ee(l,r,x,b){H+=1;const i=H,f=w()>0&&e(F).length>0?40:0,g=x+(Math.random()-.5)*f,_=b+(Math.random()-.5)*f;p(T,[...e(T),{burstId:i,x:g,y:_,radius:P,opacity:.75},{burstId:i,x:g,y:_,radius:P,opacity:.5}],!0);const X={id:`${l.id}::${i}`,label:l.label,nodeType:"source",x:g,y:_,activation:1,isSource:!0,sourceBurstId:i},U=[],C=[],R=H*.37%(Math.PI*2),se=Ze(g,_,r.length,R);r.forEach((z,ie)=>{const ae=se[ie];ae&&(U.push({id:`${z.id}::${i}`,label:z.label,nodeType:z.nodeType,x:ae.x,y:ae.y,activation:$e(ie,r.length),isSource:!1,sourceBurstId:i}),C.push({burstId:i,sourceNodeId:X.id,targetNodeId:`${z.id}::${i}`,drawProgress:0,staggerDelay:et(ie),framesElapsed:0}))}),p(F,[...e(F),X,...U],!0),p(G,[...e(G),...C],!0)}function V(){let l=[];for(const i of e(F)){const f=Xe(i.activation);Je(f)&&l.push({...i,activation:f})}p(F,l,!0);const r=new Set(l.map(i=>i.id));let x=[];for(const i of e(G)){if(!r.has(i.sourceNodeId)||!r.has(i.targetNodeId))continue;const f=i.framesElapsed+1;let g=i.drawProgress;f>=i.staggerDelay&&(g=Math.min(1,g+1/15)),x.push({...i,framesElapsed:f,drawProgress:g})}p(G,x,!0);let b=[];for(const i of e(T)){const f=i.radius+6,g=i.opacity*.96;g<.02||f>Math.max(v(),h())||b.push({...i,radius:f,opacity:g})}p(T,b,!0),K=requestAnimationFrame(V)}function Q(){p(F,[],!0),p(G,[],!0),p(T,[],!0)}xe(()=>{if(!M())return;const l=M().id;l!==ce&&(ce=l,Q(),ee(M(),S(),v()/2,h()/2))}),xe(()=>{if(!B()||w()===0||w()===$)return;$=w();const l=(Math.random()-.5)*120,r=(Math.random()-.5)*120;ee(B().source,B().neighbours,v()/2+l,h()/2+r)}),Me(()=>{K=requestAnimationFrame(V)}),Se(()=>{K!==null&&cancelAnimationFrame(K)});function le(l,r){return tt(l,r)}function te(l){const r=e(F).find(f=>f.id===l.sourceNodeId),x=e(F).find(f=>f.id===l.targetNodeId);if(!r||!x)return null;const b=r.x+(x.x-r.x)*l.drawProgress,i=r.y+(x.y-r.y)*l.drawProgress;return{x1:r.x,y1:r.y,x2:b,y2:i}}var O=nt(),q=y(n(O));pe(q,17,()=>e(T),he,(l,r)=>{var x=st();L(()=>{u(x,"cx",e(r).x),u(x,"cy",e(r).y),u(x,"r",e(r).radius),u(x,"opacity",e(r).opacity)}),E(l,x)});var re=y(q);pe(re,17,()=>e(G),he,(l,r)=>{const x=ve(()=>te(e(r)));var b=Ge(),i=ke(b);{var f=g=>{var _=it();L(()=>{u(_,"x1",e(x).x1),u(_,"y1",e(x).y1),u(_,"x2",e(x).x2),u(_,"y2",e(x).y2),u(_,"opacity",.35*e(r).drawProgress)}),E(g,_)};fe(i,g=>{e(x)&&g(f)})}E(l,b)});var W=y(re);pe(W,17,()=>e(F),l=>l.id,(l,r)=>{const x=ve(()=>le(e(r).nodeType,e(r).isSource)),b=ve(()=>e(r).isSource?P*(.7+.3*e(r).activation):Z*(.5+.8*e(r).activation));var i=ot(),f=n(i),g=y(f),_=y(g),X=y(_);{var U=C=>{var R=at(),se=n(R,!0);c(R),L(z=>{u(R,"x",e(r).x),u(R,"y",e(r).y+e(b)+18),u(R,"opacity",.9*e(r).activation),j(se,z)},[()=>e(r).label.length>40?e(r).label.slice(0,40)+"…":e(r).label]),E(C,R)};fe(X,C=>{e(r).isSource&&e(r).label&&C(U)})}c(i),L(C=>{u(i,"opacity",C),u(f,"cx",e(r).x),u(f,"cy",e(r).y),u(f,"r",e(b)*1.9),u(f,"fill",e(x)),u(f,"opacity",.18*e(r).activation),u(g,"cx",e(r).x),u(g,"cy",e(r).y),u(g,"r",e(b)),u(g,"fill",e(x)),u(_,"cx",e(r).x-e(b)*.3),u(_,"cy",e(r).y-e(b)*.3),u(_,"r",e(b)*.35),u(_,"opacity",.35*e(r).activation)},[()=>Math.min(1,e(r).activation*1.25)]),E(l,i)}),c(O),L(()=>{u(O,"width",v()),u(O,"height",h()),u(O,"viewBox",`0 0 ${v()??""} ${h()??""}`)}),E(a,O),Be()}var lt=Y('

                    · bursts
                    '),dt=Y('

                    Computing activation…

                    '),ut=Y('

                    Activation failed

                    '),ft=Y(`

                    No matching memory

                    Nothing in the graph matches . Try a broader query or switch on live mode to watch the engine fire its own bursts.

                    `),vt=Y(`

                    Waiting for activation

                    Seed a burst with the search bar above, or enable live mode to overlay bursts from the cognitive engine as they happen.

                    `),pt=Y('
                    Seed

                    '),mt=Y(`
                    Seed Memory
                    '),us=n('
                    Activation path
                    '),_s=n(' '),ys=n('
                    Retrieved
                    '),ws=n(' '),ms=n('
                    Suppressed
                    '),fs=n(" ",1),hs=n('
                    retrieved
                    suppressed
                    trust floor
                    ');function qs(c,w){Ba(w,!0);let X=rs(w,"compact",3,!1);const we={low:"var(--color-recall, #10b981)",medium:"#f59e0b",high:"#f43f5e"};function Ze(){const j=w.receipt.retrieved[0];if(!j)return;const ce=w.receipt.retrieved.join(",");ns(`/graph?center=${encodeURIComponent(j)}&focus=${encodeURIComponent(ce)}`)}var ve=hs();let me,ea;var Y=s(ve),B=s(Y),q=s(B,!0);a(B);var fe=t(B,2);let le;var P=s(fe);a(fe),a(Y);var ne=t(Y,2),he=s(ne),aa=s(he),m=s(aa,!0);a(aa),ye(2),a(he);var Ie=t(he,2),Le=s(Ie),sa=s(Le,!0);a(Le),ye(2),a(Ie);var je=t(Ie,2),De=s(je),ya=s(De);a(De),ye(2),a(je),a(ne);var Ue=t(ne,2);{var wa=j=>{var ce=fs(),Re=Sa(ce);{var ra=T=>{var D=us(),V=t(s(D),2);K(V,16,()=>w.receipt.activation_path,N=>N,(N,Z)=>{var F=ps(),qe=s(F,!0);a(F),_(()=>r(qe,Z)),l(N,F)}),a(D),l(T,D)};k(Re,T=>{w.receipt.activation_path.length&&T(ra)})}var Be=t(Re,2);{var va=T=>{var D=ys(),V=t(s(D),2);K(V,20,()=>w.receipt.retrieved,N=>N,(N,Z)=>{var F=_s(),qe=s(F,!0);a(F),_(Me=>r(qe,Me),[()=>Z.slice(0,8)]),l(N,F)}),a(V),a(D),l(T,D)};k(Be,T=>{w.receipt.retrieved.length&&T(va)})}var ma=t(Be,2);{var He=T=>{var D=ms(),V=t(s(D),2);K(V,21,()=>w.receipt.suppressed,N=>N.id,(N,Z)=>{var F=ws(),qe=s(F);a(F),_((Me,la)=>{_a(F,"title",e(Z).reason),r(qe,`${Me??""} · ${la??""}`)},[()=>e(Z).id.slice(0,8),()=>e(Z).reason.replace("_"," ")]),l(N,F)}),a(V),a(D),l(T,D)};k(ma,T=>{w.receipt.suppressed.length&&T(He)})}l(j,ce)};k(Ue,j=>{X()||j(wa)})}var ie=t(Ue,2),ta=s(ie);Wa(ta,{name:"sparkle",size:14}),ye(),a(ie),a(ve),_(j=>{me=J(ve,1,"receipt svelte-1wdzvwu",null,me,{compact:X()}),ea=_e(ve,"",ea,{"--risk":we[w.receipt.decay_risk]}),r(q,w.receipt.receipt_id),le=_e(fe,"",le,{color:we[w.receipt.decay_risk]}),r(P,`decay: ${w.receipt.decay_risk??""}`),r(m,w.receipt.retrieved.length),r(sa,w.receipt.suppressed.length),r(ya,`${j??""}%`),ie.disabled=!w.receipt.retrieved.length},[()=>(w.receipt.trust_floor*100).toFixed(0)]),Fe("click",ie,Ze),l(c,ve),Ha()}Oa(["click"]);function Ye(c){switch(c){case"mcp.call":return"var(--color-synapse-glow, #818cf8)";case"memory.retrieve":return"var(--color-recall, #10b981)";case"memory.suppress":return"#a78bfa";case"memory.write":return"#38bdf8";case"contradiction.detected":return"#fb7185";case"sanhedrin.veto":return"#f43f5e";case"dream.patch":return"#c084fc";default:return"var(--color-synapse, #6366f1)"}}function Ne(c){switch(c){case"mcp.call":return"Tool Call";case"memory.retrieve":return"Retrieved";case"memory.suppress":return"Suppressed";case"memory.write":return"Wrote";case"contradiction.detected":return"Contradiction";case"sanhedrin.veto":return"Veto";case"dream.patch":return"Dream Patch";default:return c}}function Ma(c){switch(c){case"mcp.call":return"⟐";case"memory.retrieve":return"◉";case"memory.suppress":return"⊘";case"memory.write":return"✎";case"contradiction.detected":return"⚡";case"sanhedrin.veto":return"⛔";case"dream.patch":return"☾";default:return"•"}}function Ea(c){switch(c.type){case"mcp.call":return`${c.tool} · args ${c.argsHash.slice(0,8)}`;case"memory.retrieve":return`${c.ids.length} ${c.ids.length===1?"memory":"memories"} surfaced`;case"memory.suppress":return`${c.id.slice(0,8)} — ${c.reason.replace("_"," ")}`;case"memory.write":return`${c.id.slice(0,8)} — ${c.source}`;case"contradiction.detected":return c.detail;case"sanhedrin.veto":return`"${c.claim}" (conf ${(c.confidence*100).toFixed(0)}%)`;case"dream.patch":return`${c.proposalIds.length} consolidation proposal(s)`;default:return""}}function gs(c){switch(c.type){case"memory.retrieve":return c.ids;case"memory.suppress":case"memory.write":return[c.id];case"contradiction.detected":return c.ids;case"sanhedrin.veto":return c.evidenceIds;case"dream.patch":return c.proposalIds;default:return[]}}function xs(c){return!Number.isFinite(c)||c<=0?"—":new Date(c).toLocaleTimeString(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ua(c,w){return Math.max(0,c-w)}var bs=n(' ',1),ks=n(' '),zs=n('awaiting…'),Cs=n(`

                    No agent runs recorded yet. Make an MCP tool call — every call is +import"../chunks/Bzak7iHL.js";import{o as es}from"../chunks/JVtQszIZ.js";import{p as Ba,e as s,r as a,h as t,n as ye,t as _,a as l,b as Ha,f as Sa,j as n,g as e,s as pe,d as La,x as as,i as R,u as ue}from"../chunks/CW7md74C.js";import{d as Oa,s as r,a as Fe}from"../chunks/D90q9c2i.js";import{i as k}from"../chunks/9-jplUL5.js";import{s as J,e as K,a as _a,r as ss,i as ja}from"../chunks/Cc0l8Nd4.js";import{a as te,r as re}from"../chunks/D8RjhgN0.js";import{s as _e}from"../chunks/BNUnVJrY.js";import{b as ts}from"../chunks/CFefTDKL.js";import{p as rs,s as ua,a as vs}from"../chunks/BjbQ7qSx.js";import{P as ls}from"../chunks/DTO0IjuV.js";import{I as Wa}from"../chunks/CqwrgJOn.js";import{A as Da}from"../chunks/CaR6YsRq.js";import{g as ns}from"../chunks/Dm3aSj4w.js";import{a as Xe}from"../chunks/C-rZhKee.js";import{l as is,t as cs,i as os,d as ds}from"../chunks/BFpewGai.js";var ps=n('

                    '),us=n('
                    Activation path
                    '),_s=n(' '),ys=n('
                    Retrieved
                    '),ws=n(' '),ms=n('
                    Suppressed
                    '),fs=n(" ",1),hs=n('
                    retrieved
                    suppressed
                    trust floor
                    ');function qs(c,w){Ba(w,!0);let X=rs(w,"compact",3,!1);const we={low:"var(--color-recall, #10b981)",medium:"#f59e0b",high:"#f43f5e"};function Ze(){const j=w.receipt.retrieved[0];if(!j)return;const ce=w.receipt.retrieved.join(",");ns(`/graph?center=${encodeURIComponent(j)}&focus=${encodeURIComponent(ce)}`)}var ve=hs();let me,ea;var Y=s(ve),B=s(Y),q=s(B,!0);a(B);var fe=t(B,2);let le;var P=s(fe);a(fe),a(Y);var ne=t(Y,2),he=s(ne),aa=s(he),m=s(aa,!0);a(aa),ye(2),a(he);var Ie=t(he,2),Le=s(Ie),sa=s(Le,!0);a(Le),ye(2),a(Ie);var je=t(Ie,2),De=s(je),ya=s(De);a(De),ye(2),a(je),a(ne);var Ue=t(ne,2);{var wa=j=>{var ce=fs(),Re=Sa(ce);{var ra=T=>{var D=us(),V=t(s(D),2);K(V,16,()=>w.receipt.activation_path,N=>N,(N,Z)=>{var F=ps(),qe=s(F,!0);a(F),_(()=>r(qe,Z)),l(N,F)}),a(D),l(T,D)};k(Re,T=>{w.receipt.activation_path.length&&T(ra)})}var Be=t(Re,2);{var va=T=>{var D=ys(),V=t(s(D),2);K(V,20,()=>w.receipt.retrieved,N=>N,(N,Z)=>{var F=_s(),qe=s(F,!0);a(F),_(Me=>r(qe,Me),[()=>Z.slice(0,8)]),l(N,F)}),a(V),a(D),l(T,D)};k(Be,T=>{w.receipt.retrieved.length&&T(va)})}var ma=t(Be,2);{var He=T=>{var D=ms(),V=t(s(D),2);K(V,21,()=>w.receipt.suppressed,N=>N.id,(N,Z)=>{var F=ws(),qe=s(F);a(F),_((Me,la)=>{_a(F,"title",e(Z).reason),r(qe,`${Me??""} · ${la??""}`)},[()=>e(Z).id.slice(0,8),()=>e(Z).reason.replace("_"," ")]),l(N,F)}),a(V),a(D),l(T,D)};k(ma,T=>{w.receipt.suppressed.length&&T(He)})}l(j,ce)};k(Ue,j=>{X()||j(wa)})}var ie=t(Ue,2),ta=s(ie);Wa(ta,{name:"sparkle",size:14}),ye(),a(ie),a(ve),_(j=>{me=J(ve,1,"receipt svelte-1wdzvwu",null,me,{compact:X()}),ea=_e(ve,"",ea,{"--risk":we[w.receipt.decay_risk]}),r(q,w.receipt.receipt_id),le=_e(fe,"",le,{color:we[w.receipt.decay_risk]}),r(P,`decay: ${w.receipt.decay_risk??""}`),r(m,w.receipt.retrieved.length),r(sa,w.receipt.suppressed.length),r(ya,`${j??""}%`),ie.disabled=!w.receipt.retrieved.length},[()=>(w.receipt.trust_floor*100).toFixed(0)]),Fe("click",ie,Ze),l(c,ve),Ha()}Oa(["click"]);function Ye(c){switch(c){case"mcp.call":return"var(--color-synapse-glow, #818cf8)";case"memory.retrieve":return"var(--color-recall, #10b981)";case"memory.suppress":return"#a78bfa";case"memory.write":return"#38bdf8";case"contradiction.detected":return"#fb7185";case"sanhedrin.veto":return"#f43f5e";case"dream.patch":return"#c084fc";default:return"var(--color-synapse, #6366f1)"}}function Ne(c){switch(c){case"mcp.call":return"Tool Call";case"memory.retrieve":return"Retrieved";case"memory.suppress":return"Suppressed";case"memory.write":return"Wrote";case"contradiction.detected":return"Contradiction";case"sanhedrin.veto":return"Veto";case"dream.patch":return"Dream Patch";default:return c}}function Ma(c){switch(c){case"mcp.call":return"⟐";case"memory.retrieve":return"◉";case"memory.suppress":return"⊘";case"memory.write":return"✎";case"contradiction.detected":return"⚡";case"sanhedrin.veto":return"⛔";case"dream.patch":return"☾";default:return"•"}}function Ea(c){switch(c.type){case"mcp.call":return`${c.tool} · args ${c.argsHash.slice(0,8)}`;case"memory.retrieve":return`${c.ids.length} ${c.ids.length===1?"memory":"memories"} surfaced`;case"memory.suppress":return`${c.id.slice(0,8)} — ${c.reason.replace("_"," ")}`;case"memory.write":return`${c.id.slice(0,8)} — ${c.source}`;case"contradiction.detected":return c.detail;case"sanhedrin.veto":return`"${c.claim}" (conf ${(c.confidence*100).toFixed(0)}%)`;case"dream.patch":return`${c.proposalIds.length} consolidation proposal(s)`;default:return""}}function gs(c){switch(c.type){case"memory.retrieve":return c.ids;case"memory.suppress":case"memory.write":return[c.id];case"contradiction.detected":return c.ids;case"sanhedrin.veto":return c.evidenceIds;case"dream.patch":return c.proposalIds;default:return[]}}function xs(c){return!Number.isFinite(c)||c<=0?"—":new Date(c).toLocaleTimeString(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ua(c,w){return Math.max(0,c-w)}var bs=n(' ',1),ks=n(' '),zs=n('awaiting…'),Cs=n(`

                    No agent runs recorded yet. Make an MCP tool call — every call is recorded here.

                    `),Is=n(' '),Rs=n(' '),Ms=n(' '),Es=n(' '),Ss=n('
                  • '),Ws=n('
                      '),As=n('
                      Loading trace…
                      '),Ps=n('
                      '),Ts=n('
                      Select a run to replay.
                      '),Ns=n(' '),Fs=n(""),Ls=n(' '),js=n(' '),Ds=n('
                      '),Us=n(' '),Bs=n('
                      vs
                      '),Hs=n(' '),Os=n('
                      '),Vs=n('

                      '),$s=n('

                      No memories touched yet.

                      '),Gs=n(' '),Js=n('
                      '),Ks=n('

                      Receipts — proof behind retrievals

                      '),Qs=n('
                    • '),Xs=n('
                      Step

                      Memory pulse — touched this run

                      Event producers — this run

                      • mcp.call · memory.write · memory.retrieve · memory.suppress live
                      • contradiction.detected
                      • dream.patch
                      • sanhedrin.veto

                      Event log

                        ',1),Ys=n('
                        '),Zs=n('
                        '),et=n('
                        trace events

                        Watch the agent think. Watch memory change. Watch the receipt prove why.

                        '),at=n('
                        WebSocket
                        Live runId
                        Last event
                        Events seen
                        ');function ft(c,w){Ba(w,!0);const X=()=>ua(is,"$lastTraceEvent",me),we=()=>ua(os,"$isConnected",me),Ze=()=>ua(ds,"$liveRunId",me),ve=()=>ua(cs,"$traceEvents",me),[me,ea]=vs();let Y=pe(La([])),B=pe(null),q=pe(null),fe=pe(!1),le=pe(null),P=pe(0),ne=pe(!1),he=pe(La([]));const aa=ue(()=>e(q)?e(q).events.slice(0,e(P)+1):[]),m=ue(()=>e(q)&&e(q).events.length?e(q).events[e(P)]:null),Ie=ue(()=>{var i,d;return((d=(i=e(q))==null?void 0:i.events[0])==null?void 0:d.at)??0}),Le=ue(()=>Array.from(new Set(e(aa).flatMap(gs)))),sa=ue(()=>{var i;return((i=e(q))==null?void 0:i.events.some(d=>d.type==="sanhedrin.veto"))??!1}),je=ue(()=>{var i;return((i=e(q))==null?void 0:i.events.some(d=>d.type==="dream.patch"))??!1}),De=ue(()=>{var i;return((i=e(q))==null?void 0:i.events.some(d=>d.type==="contradiction.detected"))??!1});async function ya(){try{const i=await Xe.traces.list(100);R(Y,i.runs,!0),!e(B)&&e(Y).length&&Ue(e(Y)[0].runId)}catch(i){R(le,String(i),!0)}}async function Ue(i){R(B,i,!0),R(fe,!0),R(le,null);try{R(q,await Xe.traces.get(i),!0),R(P,Math.max(0,(e(q).events.length||1)-1),!0),R(he,(await Xe.receipts.listForRun(i,8)).receipts,!0)}catch(d){R(le,String(d),!0),R(q,null)}finally{R(fe,!1)}}function wa(){e(B)&&(window.location.href=Xe.traces.exportUrl(e(B)))}as(()=>{var I;const i=X();if(!i)return;const d=(I=i.data)==null?void 0:I.run_id;d&&d===e(B)&&Xe.traces.get(e(B)).then(M=>{R(q,M,!0),R(P,Math.max(0,M.events.length-1),!0)})}),es(ya);var ie=at(),ta=s(ie);ls(ta,{icon:"blackbox",title:"Agent Black Box",subtitle:"Watch the agent think. Watch memory change. Watch the receipt prove why.",accent:"synapse",children:(i,d)=>{var I=bs(),M=Sa(I);let E;var L=s(M);Wa(L,{name:"sparkle",size:14}),ye(),a(M);var ee=t(M,2),Ee=s(ee);Wa(Ee,{name:"feed",size:14}),ye(),a(ee),_(()=>{E=J(M,1,"mode-toggle svelte-1ayqwv0",null,E,{on:e(ne)}),ee.disabled=!e(B)}),Fe("click",M,()=>R(ne,!e(ne))),Fe("click",ee,wa),l(i,I)},$$slots:{default:!0}});var j=t(ta,2),ce=s(j),Re=t(s(ce),2);let ra;var Be=s(Re);let va;var ma=t(Be);a(Re),a(ce);var He=t(ce,2),T=t(s(He),2),D=s(T,!0);a(T),a(He);var V=t(He,2),N=t(s(V),2),Z=s(N);{var F=i=>{var d=ks();let I;var M=s(d,!0);a(d),_((E,L)=>{I=_e(d,"",I,E),r(M,L)},[()=>{var E,L;return{"--c":Ye((L=(E=X().data)==null?void 0:E.event)==null?void 0:L.type)}},()=>{var E,L;return Ne((L=(E=X().data)==null?void 0:E.event)==null?void 0:L.type)}]),l(i,d)},qe=i=>{var d=zs();l(i,d)};k(Z,i=>{X()?i(F):i(qe,!1)})}a(N),a(V);var Me=t(V,2),la=t(s(Me),2),Va=s(la);Da(Va,{get value(){return ve().length}}),a(la),a(Me),a(j),te(j,i=>{var d;return(d=re)==null?void 0:d(i)});var $a=t(j,2);{var Ga=i=>{var d=Ys(),I=s(d),M=t(s(I),2);{var E=p=>{var y=Cs();l(p,y)},L=p=>{var y=Ws();K(y,21,()=>e(Y),U=>U.runId,(U,f)=>{var ae=Ss(),$=s(ae);let oe;var xe=s($),de=s(xe),Oe=s(de,!0);a(de);var h=t(de,2),Se=s(h,!0);a(h),a(xe);var be=t(xe,2),ke=s(be),We=s(ke);a(ke);var ia=t(ke,2);{var qa=x=>{var g=Is(),Q=s(g);a(g),_(()=>r(Q,`↑${e(f).retrievedCount??""}`)),l(x,g)};k(ia,x=>{e(f).retrievedCount&&x(qa)})}var ca=t(ia,2);{var Ae=x=>{var g=Rs(),Q=s(g);a(g),_(()=>r(Q,`⊘${e(f).suppressedCount??""}`)),l(x,g)};k(ca,x=>{e(f).suppressedCount&&x(Ae)})}var Ve=t(ca,2);{var Pe=x=>{var g=Ms(),Q=s(g);a(g),_(()=>r(Q,`✎${e(f).writeCount??""}`)),l(x,g)};k(Ve,x=>{e(f).writeCount&&x(Pe)})}var oa=t(Ve,2);{var da=x=>{var g=Es(),Q=s(g);a(g),_(()=>r(Q,`⛔${e(f).vetoCount??""}`)),l(x,g)};k(oa,x=>{e(f).vetoCount&&x(da)})}a(be),a($),a(ae),_(x=>{oe=J($,1,"run-row svelte-1ayqwv0",null,oe,{active:e(f).runId===e(B)}),r(Oe,x),r(Se,e(f).firstTool??"—"),r(We,`${e(f).eventCount??""} ev`)},[()=>e(f).runId.replace("run_","").slice(0,10)]),Fe("click",$,()=>Ue(e(f).runId)),l(U,ae)}),a(y),l(p,y)};k(M,p=>{e(Y).length===0?p(E):p(L,!1)})}a(I),te(I,p=>{var y;return(y=re)==null?void 0:y(p)});var ee=t(I,2),Ee=s(ee);{var fa=p=>{var y=As();l(p,y)},na=p=>{var y=Ps(),U=s(y,!0);a(y),_(()=>r(U,e(le))),l(p,y)},ha=p=>{var y=Ts();l(p,y)},ge=p=>{var y=Xs(),U=Sa(y),f=s(U),ae=s(f),$=t(s(ae)),oe=s($,!0);a($);var xe=t($);a(ae);var de=t(ae,2);{var Oe=o=>{var v=Ns(),b=s(v);a(v),_(u=>r(b,`+${u??""}ms`),[()=>Ua(e(m).at,e(Ie))]),l(o,v)};k(de,o=>{e(m)&&o(Oe)})}a(f);var h=t(f,2);ss(h);var Se=t(h,2);K(Se,21,()=>e(q).events,ja,(o,v,b)=>{var u=Fs();let z,se;_((G,ze,Te)=>{z=J(u,1,"tick svelte-1ayqwv0",null,z,{past:b<=e(P)}),_a(u,"title",G),_a(u,"aria-label",ze),se=_e(u,"",se,Te)},[()=>Ne(e(v).type),()=>`Step ${b+1}: ${Ne(e(v).type)}`,()=>({"--c":Ye(e(v).type)})]),Fe("click",u,()=>R(P,b,!0)),l(o,u)}),a(Se),a(U),te(U,o=>{var v;return(v=re)==null?void 0:v(o)});var be=t(U,2);{var ke=o=>{var v=Vs();let b;var u=s(v),z=s(u),se=s(z,!0);a(z);var G=t(z,2),ze=s(G,!0);a(G);var Te=t(G,2),$e=s(Te,!0);a(Te),a(u);var Ge=t(u,2),Je=s(Ge,!0);a(Ge);var ba=t(Ge,2);{var pa=S=>{var C=Ds();K(C,20,()=>e(m).ids,W=>W,(W,H)=>{var O=js();let A;var Ce=s(O),Ke=s(Ce,!0);a(Ce);var Ca=t(Ce,2);{var Ia=Qe=>{var Ra=Ls(),Ya=s(Ra);a(Ra),_(Za=>r(Ya,`${Za??""}%`),[()=>(e(m).activation[H]*100).toFixed(0)]),l(Qe,Ra)};k(Ca,Qe=>{e(m).activation[H]!=null&&Qe(Ia)})}a(O),_(Qe=>{A=_e(O,"",A,{"--a":e(m).activation[H]??0}),r(Ke,Qe)},[()=>H.slice(0,8)]),l(W,O)}),a(C),l(S,C)},ka=S=>{var C=Bs(),W=s(C),H=s(W);a(W);var O=t(W,4);K(O,16,()=>e(m).ids.filter(A=>A!==e(m).winnerId),A=>A,(A,Ce)=>{var Ke=Us(),Ca=s(Ke,!0);a(Ke),_(Ia=>r(Ca,Ia),[()=>Ce.slice(0,8)]),l(A,Ke)}),a(C),_(A=>r(H,`kept ${A??""}`),[()=>{var A;return(A=e(m).winnerId)==null?void 0:A.slice(0,8)}]),l(S,C)},za=S=>{var C=Os();K(C,20,()=>e(m).evidenceIds,W=>W,(W,H)=>{var O=Hs(),A=s(O,!0);a(O),_(Ce=>r(A,Ce),[()=>H.slice(0,8)]),l(W,O)}),a(C),l(S,C)};k(ba,S=>{e(m).type==="memory.retrieve"?S(pa):e(m).type==="contradiction.detected"?S(ka,1):e(m).type==="sanhedrin.veto"&&S(za,2)})}a(v),te(v,S=>{var C;return(C=re)==null?void 0:C(S)}),_((S,C,W,H,O)=>{b=_e(v,"",b,S),r(se,C),r(ze,W),r($e,H),r(Je,O)},[()=>({"--c":Ye(e(m).type)}),()=>Ma(e(m).type),()=>Ne(e(m).type),()=>xs(e(m).at),()=>Ea(e(m))]),l(o,v)};k(be,o=>{e(m)&&o(ke)})}var We=t(be,2),ia=t(s(We),2);{var qa=o=>{var v=$s();l(o,v)},ca=o=>{var v=Js();K(v,20,()=>e(Le),b=>b,(b,u)=>{var z=Gs(),se=s(z,!0);a(z),_(G=>r(se,G),[()=>u.slice(0,8)]),l(b,z)}),a(v),l(o,v)};k(ia,o=>{e(Le).length===0?o(qa):o(ca,!1)})}a(We),te(We,o=>{var v;return(v=re)==null?void 0:v(o)});var Ae=t(We,2),Ve=t(s(Ae),2),Pe=t(s(Ve),2);let oa;var da=t(s(Pe),2),x=s(da,!0);a(da),a(Pe);var g=t(Pe,2);let Q;var Aa=t(s(g),2),Ka=s(Aa,!0);a(Aa),a(g);var ga=t(g,2);let Pa;var Ta=t(s(ga),2),Qa=s(Ta,!0);a(Ta),a(ga),a(Ve),a(Ae),te(Ae,o=>{var v;return(v=re)==null?void 0:v(o)});var Na=t(Ae,2);{var Xa=o=>{var v=Ks(),b=t(s(v),2);K(b,21,()=>e(he).slice(0,2),u=>u.receipt_id,(u,z)=>{qs(u,{get receipt(){return e(z)}})}),a(b),a(v),te(v,u=>{var z;return(z=re)==null?void 0:z(u)}),l(o,v)};k(Na,o=>{e(he).length&&o(Xa)})}var xa=t(Na,2),Fa=t(s(xa),2);K(Fa,21,()=>e(q).events,ja,(o,v,b)=>{var u=Qs();let z,se;var G=s(u),ze=s(G),Te=s(ze,!0);a(ze);var $e=t(ze,2),Ge=s($e,!0);a($e);var Je=t($e,2),ba=s(Je,!0);a(Je);var pa=t(Je,2),ka=s(pa);a(pa),a(G),a(u),_((za,S,C,W,H)=>{z=J(u,1,"log-row svelte-1ayqwv0",null,z,{active:b===e(P),dim:b>e(P)}),se=_e(u,"",se,za),r(Te,S),r(Ge,C),r(ba,W),r(ka,`+${H??""}ms`)},[()=>({"--c":Ye(e(v).type)}),()=>Ma(e(v).type),()=>Ne(e(v).type),()=>Ea(e(v)),()=>Ua(e(v).at,e(Ie))]),Fe("click",G,()=>R(P,b,!0)),l(o,u)}),a(Fa),a(xa),te(xa,o=>{var v;return(v=re)==null?void 0:v(o)}),_(o=>{r(oe,e(P)+1),r(xe,` / ${e(q).events.length??""}`),_a(h,"max",o),oa=J(Pe,1,"producer svelte-1ayqwv0",null,oa,{ok:e(De)}),r(x,e(De)?"fired this run":"no contradiction in this run"),Q=J(g,1,"producer caveat svelte-1ayqwv0",null,Q,{ok:e(je)}),r(Ka,e(je)?"fired this run":"No dream run in this trace"),Pa=J(ga,1,"producer caveat svelte-1ayqwv0",null,Pa,{ok:e(sa)}),r(Qa,e(sa)?"fired this run":"No veto producer connected (optional Sanhedrin hook, off by default)")},[()=>Math.max(0,e(q).events.length-1)]),ts(h,()=>e(P),o=>R(P,o)),l(p,y)};k(Ee,p=>{e(fe)?p(fa):e(le)?p(na,1):e(q)?p(ge,!1):p(ha,2)})}a(ee),a(d),l(i,d)},Ja=i=>{var d=et(),I=s(d),M=s(I);let E;var L=t(M,2),ee=s(L,!0);a(L),a(I);var Ee=t(I,2);{var fa=ge=>{const p=ue(()=>{var h;return(h=X().data)==null?void 0:h.event});var y=Zs();let U;var f=s(y),ae=s(f,!0);a(f);var $=t(f,2),oe=s($),xe=s(oe,!0);a(oe);var de=t(oe,2),Oe=s(de,!0);a(de),a($),a(y),_((h,Se,be,ke)=>{U=_e(y,"",U,h),r(ae,Se),r(xe,be),r(Oe,ke)},[()=>{var h;return{"--c":Ye((h=e(p))==null?void 0:h.type)}},()=>{var h;return Ma((h=e(p))==null?void 0:h.type)},()=>{var h;return Ne((h=e(p))==null?void 0:h.type)},()=>Ea(e(p))]),l(ge,y)};k(Ee,ge=>{X()&&ge(fa)})}var na=t(Ee,2),ha=s(na);Da(ha,{get value(){return ve().length}}),ye(2),a(na),ye(2),a(d),te(d,ge=>{var p;return(p=re)==null?void 0:p(ge)}),_(()=>{E=J(M,1,"dot big svelte-1ayqwv0",null,E,{live:we()}),r(ee,Ze()??"awaiting run…")}),l(i,d)};k($a,i=>{e(ne)?i(Ja,!1):i(Ga)})}a(ie),_(()=>{ra=J(Re,1,"spine-value svelte-1ayqwv0",null,ra,{live:we()}),va=J(Be,1,"dot svelte-1ayqwv0",null,va,{live:we()}),r(ma,` ${we()?"Connected":"Offline"}`),r(D,Ze()??"—")}),l(c,ie),Ha(),ea()}Oa(["click"]);export{ft as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/5.DpUpTdqe.js.br b/apps/dashboard/build/_app/immutable/nodes/5.DpUpTdqe.js.br new file mode 100644 index 0000000..ee70088 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/5.DpUpTdqe.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/5.DpUpTdqe.js.gz b/apps/dashboard/build/_app/immutable/nodes/5.DpUpTdqe.js.gz new file mode 100644 index 0000000..256c7f1 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/5.DpUpTdqe.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js b/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js new file mode 100644 index 0000000..e29acdb --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js @@ -0,0 +1,2 @@ +import"../chunks/Bzak7iHL.js";import{o as Te}from"../chunks/JVtQszIZ.js";import{p as de,e as a,h as i,f as kt,t as S,g as t,i as y,a as g,u as O,r as s,n as V,b as ve,s as P,j as w,av as Ut,d as Pe}from"../chunks/CW7md74C.js";import{d as ue,a as U,e as mt,s as h}from"../chunks/D90q9c2i.js";import{i as L}from"../chunks/9-jplUL5.js";import{e as ct,a as c,i as Yt,s as Le}from"../chunks/Cc0l8Nd4.js";import{a as ot,r as lt}from"../chunks/D8RjhgN0.js";import{s as q}from"../chunks/BNUnVJrY.js";import{p as $t}from"../chunks/BjbQ7qSx.js";import{P as ze}from"../chunks/DTO0IjuV.js";import{D as ie}from"../chunks/DUAsElMg.js";import{I as Ht}from"../chunks/CqwrgJOn.js";import{A as nt}from"../chunks/CaR6YsRq.js";import{a as Be}from"../chunks/C-rZhKee.js";const pe=.7,me=.5,Ye="#ef4444",$e="#f59e0b",He="#fde047";function Vt(p){return p>pe?Ye:p>me?$e:He}function fe(p){return p>pe?"strong":p>me?"moderate":"mild"}const oe="#8b5cf6",Ve={fact:"#3b82f6",concept:"#8b5cf6",event:"#f59e0b",person:"#10b981",place:"#06b6d4",note:"#6b7280",pattern:"#ec4899",decision:"#ef4444"};function le(p){return p?Ve[p]??oe:oe}const ne=5,Ue=9;function Xe(p){if(!Number.isFinite(p))return ne;const f=p<0?0:p>1?1:p;return ne+f*Ue}const We=.12;function ce(p,f){return f==null||f===p?1:We}function ht(p,f=60){return p==null||typeof p!="string"||f<=0?"":p.length<=f?p:p.slice(0,f-1)+"…"}function qe(p){if(!p||p.length===0)return 0;let f=0;for(const b of p)f+=Math.abs((b.trust_a??0)-(b.trust_b??0));return f/p.length}var Ke=Ut('',1),Qe=Ut(' '),Je=Ut('',1),Ze=w('
                        '),ts=w('
                        '),es=w('
                        '),ss=w('
                        topic:
                        '),as=w('
                        SEVERITYstrong (>0.7)moderate (0.5-0.7)mild (0.3-0.5)
                        ');function rs(p,f){de(f,!0);let b=$t(f,"focusedPairIndex",3,null),C=$t(f,"width",3,800),F=$t(f,"height",3,600);const G=O(()=>{const v=C()/2,r=F()/2,j=Math.min(C(),F())*.38;return{cx:v,cy:r,R:j}}),K=O(()=>{const v=[],r=[],j=f.contradictions.length||1;return f.contradictions.forEach((e,o)=>{const l=o/j*Math.PI*2-Math.PI/2,n=.18+e.similarity*.22,m=l-n,u=l+n,T=t(G).R+Math.sin(o*2.3)*18,B=t(G).R+Math.cos(o*1.7)*18,_={x:t(G).cx+Math.cos(m)*T,y:t(G).cy+Math.sin(m)*T,trust:e.trust_a,preview:e.memory_a_preview,type:e.memory_a_type,created:e.memory_a_created,tags:e.memory_a_tags,memoryId:e.memory_a_id,pairIndex:o,side:"a"},I={x:t(G).cx+Math.cos(u)*B,y:t(G).cy+Math.sin(u)*B,trust:e.trust_b,preview:e.memory_b_preview,type:e.memory_b_type,created:e.memory_b_created,tags:e.memory_b_tags,memoryId:e.memory_b_id,pairIndex:o,side:"b"};v.push(_,I);const Y=(_.x+I.x)/2,R=(_.y+I.y)/2,D=.55-e.similarity*.25,$=Y+(t(G).cx-Y)*D,H=R+(t(G).cy-R)*D,_t=1+Math.min(e.trust_a,e.trust_b)*4;r.push({pairIndex:o,path:`M ${_.x.toFixed(1)} ${_.y.toFixed(1)} Q ${$.toFixed(1)} ${H.toFixed(1)} ${I.x.toFixed(1)} ${I.y.toFixed(1)}`,color:Vt(e.similarity),thickness:_t,severity:fe(e.similarity),topic:e.topic,similarity:e.similarity,dateDiff:e.date_diff_days,aPoint:_,bPoint:I,midX:$,midY:H})}),{nodes:v,arcs:r}});let A=P(null),N=P(null),X=P(0),dt=P(0);function bt(v){const r=v.currentTarget.getBoundingClientRect();y(X,v.clientX-r.left),y(dt,v.clientY-r.top)}function at(v){f.onSelectPair&&f.onSelectPair(b()===v?null:v)}function wt(){var v;(v=f.onSelectPair)==null||v.call(f,null)}var z=as(),E=a(z),vt=i(a(E)),rt=i(vt),Q=i(rt),ft=i(Q);ct(ft,17,()=>t(K).arcs,v=>v.pairIndex,(v,r)=>{const j=O(()=>ce(t(r).pairIndex,b())),e=O(()=>b()===t(r).pairIndex);var o=Ke(),l=kt(o),n=i(l),m=i(n);S(u=>{c(l,"d",t(r).path),c(l,"stroke",t(r).color),c(l,"stroke-width",t(r).thickness*3),c(l,"stroke-opacity",.08*t(j)),c(n,"d",t(r).path),c(n,"stroke",t(r).color),c(n,"stroke-width",t(r).thickness*(t(e)?1.6:1)),c(n,"stroke-opacity",(t(e)?1:.72)*t(j)),c(n,"aria-label",`contradiction ${t(r).pairIndex+1}: ${t(r).topic??""}`),c(m,"d",t(r).path),c(m,"stroke",t(r).color),c(m,"stroke-width",u),c(m,"stroke-opacity",.85*t(j)),q(m,`animation-duration: ${4+t(r).pairIndex%5}s`)},[()=>Math.max(1,t(r).thickness*.6)]),U("click",n,u=>{u.stopPropagation(),at(t(r).pairIndex)}),mt("mouseenter",n,()=>y(N,t(r),!0)),mt("mouseleave",n,()=>y(N,null)),U("keydown",n,u=>{u.key==="Enter"&&at(t(r).pairIndex)}),g(v,o)});var ut=i(ft);ct(ut,19,()=>t(K).nodes,(v,r)=>v.memoryId+"-"+v.side+"-"+r,(v,r)=>{const j=O(()=>ce(t(r).pairIndex,b())),e=O(()=>b()===t(r).pairIndex),o=O(()=>Xe(t(r).trust)),l=O(()=>le(t(r).type));var n=Je(),m=kt(n),u=i(m),T=i(u);{var B=_=>{var I=Qe(),Y=a(I,!0);s(I),S(R=>{c(I,"x",t(r).x),c(I,"y",t(r).y-t(o)-8),h(Y,R)},[()=>ht(t(r).preview,40)]),g(_,I)};L(T,_=>{t(e)&&_(B)})}S(_=>{c(m,"cx",t(r).x),c(m,"cy",t(r).y),c(m,"r",t(o)*2.2),c(m,"fill",t(l)),c(m,"opacity",.12*t(j)),c(u,"cx",t(r).x),c(u,"cy",t(r).y),c(u,"r",t(o)),c(u,"fill",t(l)),c(u,"opacity",t(j)),c(u,"stroke-opacity",t(e)?.85:.25),c(u,"stroke-width",t(e)?2:1),c(u,"aria-label",`memory ${_??""}`)},[()=>ht(t(r).preview,40)]),mt("mouseenter",u,()=>y(A,t(r),!0)),mt("mouseleave",u,()=>y(A,null)),U("click",u,_=>{_.stopPropagation(),at(t(r).pairIndex)}),U("keydown",u,_=>{_.key==="Enter"&&at(t(r).pairIndex)}),g(v,n)}),V(),s(E);var xt=i(E,2);{var jt=v=>{var r=es(),j=a(r),e=a(j),o=i(e,2),l=a(o,!0);s(o);var n=i(o,2),m=a(n);s(n),s(j);var u=i(j,2),T=a(u,!0);s(u);var B=i(u,2);{var _=R=>{var D=Ze(),$=a(D);s(D),S(()=>h($,`created ${t(A).created??""}`)),g(R,D)};L(B,R=>{t(A).created&&R(_)})}var I=i(B,2);{var Y=R=>{var D=ts(),$=a(D,!0);s(D),S(H=>h($,H),[()=>t(A).tags.slice(0,4).join(" · ")]),g(R,D)};L(I,R=>{t(A).tags&&t(A).tags.length>0&&R(Y)})}s(r),S((R,D,$,H)=>{q(r,`left: ${R??""}px; top: ${D??""}px;`),q(e,`background: ${$??""}`),h(l,t(A).type??"memory"),h(m,`trust ${H??""}%`),h(T,t(A).preview)},[()=>Math.max(0,Math.min(t(X)+12,C()-240)),()=>Math.max(0,Math.min(t(dt)-8,F()-120)),()=>le(t(A).type),()=>(t(A).trust*100).toFixed(0)]),g(v,r)},Mt=v=>{var r=ss(),j=a(r),e=a(j),o=i(e,2),l=a(o);s(o),s(j);var n=i(j,2),m=i(a(n)),u=a(m,!0);s(m),s(n);var T=i(n,2),B=a(T);s(T),s(r),S((_,I,Y)=>{q(r,`left: ${_??""}px; top: ${I??""}px;`),q(e,`background: ${t(N).color??""}`),h(l,`${t(N).severity??""} conflict`),h(u,t(N).topic),h(B,`similarity ${Y??""}% · ${t(N).dateDiff??""}d apart`)},[()=>Math.max(0,Math.min(t(X)+12,C()-240)),()=>Math.max(0,Math.min(t(dt)-8,F()-120)),()=>(t(N).similarity*100).toFixed(0)]),g(v,r)};L(xt,v=>{t(A)?v(jt):t(N)&&v(Mt,1)})}s(z),S(()=>{q(z,`aspect-ratio: ${C()??""} / ${F()??""};`),c(E,"width",C()),c(E,"height",F()),c(E,"viewBox",`0 0 ${C()??""} ${F()??""}`),c(vt,"width",C()),c(vt,"height",F()),c(rt,"cx",t(G).cx),c(rt,"cy",t(G).cy),c(rt,"r",t(G).R),c(Q,"cx",t(G).cx),c(Q,"cy",t(G).cy)}),U("mousemove",E,bt),mt("mouseleave",E,()=>{y(A,null),y(N,null)}),U("click",E,wt),g(p,z),ve()}ue(["mousemove","click","keydown"]);var is=w(' in view'),os=w(`
                        Couldn't load contradictions
                        `),ls=w('
                        '),ns=w('
                        ',1),cs=w('
                        No contradictions found — your memory agrees with itself.
                        Pairs appear here when two trusted memories about the same topic make opposing claims.
                        '),ds=w(''),vs=w('

                        No contradictions match this filter.

                        '),us=w('
                        No pairs visible.
                        '),ps=w(' '),ms=w('
                        '),fs=w(' '),xs=w('
                        '),_s=w('
                        Full memory A
                        Full memory B
                        '),ys=w(''),gs=w('
                        average trust delta
                        visible in current filter
                        strong conflicts
                        ',1),ks=w('
                        ');function Cs(p,f){de(f,!0);let b=P(Pe([])),C=P(0),F=P(0),G=P(!0),K=P(null);async function A(){y(G,!0),y(K,null);try{const e=await Be.contradictions();y(b,e.contradictions,!0),y(C,e.total,!0),y(F,e.memoriesAnalyzed,!0)}catch(e){y(K,e instanceof Error?e.message:"Failed to load contradictions",!0),y(b,[],!0),y(C,0),y(F,0)}finally{y(G,!1)}}Te(()=>A());let N=P("all"),X=P("");const dt=O(()=>Array.from(new Set(t(b).map(e=>e.topic))).sort()),bt=[{value:"all",label:"All contradictions",icon:"contradictions"},{value:"recent",label:"Recent (last 7 days)",icon:"timeline"},{value:"high-trust",label:"High trust (>60%)",icon:"importance"},{value:"topic",label:"By topic",icon:"filter"}],at=O(()=>[{value:"",label:"All topics"},...t(dt).map(e=>({value:e,label:e,badge:t(b).filter(o=>o.topic===e).length}))]);function wt(e){y(N,e,!0),y(E,null)}const z=O(()=>{switch(t(N)){case"recent":{const e=Date.now(),o=10080*60*1e3;return t(b).filter(l=>{const n=l.memory_a_created?new Date(l.memory_a_created).getTime():0,m=l.memory_b_created?new Date(l.memory_b_created).getTime():0;return e-Math.max(n,m)<=o})}case"high-trust":return t(b).filter(e=>Math.min(e.trust_a,e.trust_b)>.6);case"topic":return t(X)?t(b).filter(e=>e.topic===t(X)):t(b);case"all":default:return t(b)}});let E=P(null);function vt(e){y(E,e,!0)}const rt=O(()=>qe(t(b))),Q=O(()=>{const e=new Map(t(b).map((o,l)=>[o.memory_a_id+"|"+o.memory_b_id,l]));return t(z).map(o=>({orig:e.get(o.memory_a_id+"|"+o.memory_b_id)??0,c:o}))});function ft(e){y(E,t(E)===e?null:e,!0)}var ut=ks(),xt=a(ut);ze(xt,{icon:"contradictions",title:"Contradiction Constellation",subtitle:"Where your memory disagrees with itself",accent:"warning",children:(e,o)=>{var l=is(),n=a(l);nt(n,{get value(){return t(z).length}}),V(),s(l),g(e,l)},$$slots:{default:!0}});var jt=i(xt,2);{var Mt=e=>{var o=os(),l=i(a(o),2),n=a(l,!0);s(l);var m=i(l,2);s(o),S(()=>h(n,t(K))),U("click",m,A),g(e,o)},v=e=>{var o=ns(),l=kt(o);ct(l,20,()=>Array(4),Yt,(n,m)=>{var u=ls();g(n,u)}),s(l),V(2),g(e,o)},r=e=>{var o=cs(),l=a(o),n=a(l);Ht(n,{name:"sparkle",size:26,draw:!0}),s(l),V(4),s(o),g(e,o)},j=e=>{var o=gs(),l=kt(o),n=a(l),m=a(n),u=a(m);nt(u,{get value(){return t(C)}}),s(m);var T=i(m,2),B=a(T);s(T),s(n),ot(n,(d,x)=>{var k;return(k=lt)==null?void 0:k(d,x)},()=>({delay:0,y:12}));var _=i(n,2),I=a(_),Y=a(I);nt(Y,{get value(){return t(rt)},decimals:2}),s(I),V(2),s(_),ot(_,(d,x)=>{var k;return(k=lt)==null?void 0:k(d,x)},()=>({delay:60,y:12}));var R=i(_,2),D=a(R),$=a(D);nt($,{get value(){return t(z).length}}),s(D),V(2),s(R),ot(R,(d,x)=>{var k;return(k=lt)==null?void 0:k(d,x)},()=>({delay:120,y:12}));var H=i(R,2),_t=a(H),Xt=i(a(_t),2),xe=a(Xt);{let d=O(()=>t(z).filter(x=>x.similarity>.7).length);nt(xe,{get value(){return t(d)}})}s(Xt),s(_t),V(2),s(H),ot(H,(d,x)=>{var k;return(k=lt)==null?void 0:k(d,x)},()=>({delay:180,y:12})),s(l);var It=i(l,2),Wt=a(It);ie(Wt,{get options(){return bt},get value(){return t(N)},label:"Lens",icon:"filter",onChange:wt});var qt=i(Wt,2);{var _e=d=>{ie(d,{get options(){return t(at)},label:"Topic",icon:"contradictions",placeholder:"All topics",get value(){return t(X)},set value(x){y(X,x,!0)}})};L(qt,d=>{t(N)==="topic"&&d(_e)})}var ye=i(qt,2);{var ge=d=>{var x=ds(),k=a(x);Ht(k,{name:"close",size:13}),V(),s(x),U("click",x,()=>y(E,null)),g(d,x)};L(ye,d=>{t(E)!==null&&d(ge)})}s(It);var Kt=i(It,2),Rt=a(Kt),ke=a(Rt);{var he=d=>{var x=vs(),k=a(x),M=a(k);Ht(M,{name:"contradictions",size:44,strokeWidth:1.2}),s(k),V(2),s(x),g(d,x)},be=d=>{rs(d,{get contradictions(){return t(z)},get focusedPairIndex(){return t(E)},onSelectPair:vt,width:800,height:600})};L(ke,d=>{t(z).length===0?d(he):d(be,!1)})}s(Rt);var Et=i(Rt,2),Gt=a(Et),Qt=i(a(Gt),2),we=a(Qt);nt(we,{get value(){return t(Q).length}}),s(Qt),s(Gt);var Jt=i(Gt,2);{var je=d=>{var x=us();g(d,x)};L(Jt,d=>{t(Q).length===0&&d(je)})}var Me=i(Jt,2);ct(Me,19,()=>t(Q),d=>d.c.memory_a_id+"|"+d.c.memory_b_id,(d,x,k)=>{const M=O(()=>t(x).c),Zt=O(()=>t(E)===t(k));var it=ys(),At=a(it),te=a(At),yt=i(te,2),Ie=a(yt,!0);s(yt);var ee=i(yt,2),Re=a(ee);s(ee),s(At);var Ot=i(At,2),Ee=a(Ot,!0);s(Ot);var Dt=i(Ot,2),Nt=a(Dt),St=i(a(Nt),2),Ge=a(St,!0);s(St);var se=i(St,2),Ae=a(se);s(se),s(Nt);var ae=i(Nt,2),Ct=i(a(ae),2),Oe=a(Ct,!0);s(Ct);var re=i(Ct,2),De=a(re);s(re),s(ae),s(Dt);var Ne=i(Dt,2);{var Se=J=>{var Z=_s(),W=i(a(Z),2),Ft=a(W,!0);s(W);var gt=i(W,2);{var Tt=tt=>{var et=ms();ct(et,21,()=>t(M).memory_a_tags,Yt,(Lt,zt)=>{var st=ps(),Bt=a(st,!0);s(st),S(()=>h(Bt,t(zt))),g(Lt,st)}),s(et),g(tt,et)};L(gt,tt=>{t(M).memory_a_tags&&t(M).memory_a_tags.length>0&&tt(Tt)})}var pt=i(gt,4),Pt=a(pt,!0);s(pt);var Ce=i(pt,2);{var Fe=tt=>{var et=xs();ct(et,21,()=>t(M).memory_b_tags,Yt,(Lt,zt)=>{var st=fs(),Bt=a(st,!0);s(st),S(()=>h(Bt,t(zt))),g(Lt,st)}),s(et),g(tt,et)};L(Ce,tt=>{t(M).memory_b_tags&&t(M).memory_b_tags.length>0&&tt(Fe)})}s(Z),S(()=>{h(Ft,t(M).memory_a_preview),h(Pt,t(M).memory_b_preview)}),g(J,Z)};L(Ne,J=>{t(Zt)&&J(Se)})}s(it),ot(it,(J,Z)=>{var W;return(W=lt)==null?void 0:W(J,Z)},()=>({delay:Math.min(t(k)*35,350),y:10})),S((J,Z,W,Ft,gt,Tt,pt,Pt)=>{Le(it,1,`w-full text-left p-3 rounded-xl border transition lift + ${t(Zt)?"bg-synapse/10 border-synapse/40 shadow-[0_0_12px_rgba(99,102,241,0.18)]":"border-subtle/20 hover:border-synapse/30 hover:bg-white/[0.02]"}`),q(te,`background: ${J??""}`),q(yt,`color: ${Z??""}`),h(Ie,W),h(Re,`${Ft??""}% sim · ${t(M).date_diff_days??""}d`),h(Ee,t(M).topic),h(Ge,gt),h(Ae,`${Tt??""}%`),h(Oe,pt),h(De,`${Pt??""}%`)},[()=>Vt(t(M).similarity),()=>Vt(t(M).similarity),()=>fe(t(M).similarity),()=>(t(M).similarity*100).toFixed(0),()=>ht(t(M).memory_a_preview),()=>(t(M).trust_a*100).toFixed(0),()=>ht(t(M).memory_b_preview),()=>(t(M).trust_b*100).toFixed(0)]),U("click",it,()=>ft(t(k))),g(d,it)}),s(Et),ot(Et,(d,x)=>{var k;return(k=lt)==null?void 0:k(d,x)},()=>({delay:120,y:16})),s(Kt),S(d=>h(B,`contradictions among the ${d??""} most recent memories`),[()=>t(F).toLocaleString()]),g(e,o)};L(jt,e=>{t(K)?e(Mt):t(G)?e(v,1):t(b).length===0?e(r,2):e(j,!1)})}s(ut),g(p,ut),ve()}ue(["click"]);export{Cs as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js.br b/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js.br new file mode 100644 index 0000000..5fa8b4c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js.gz b/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js.gz new file mode 100644 index 0000000..0e3c82e Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/6.Bh8aqm2m.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js b/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js deleted file mode 100644 index d551f42..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js +++ /dev/null @@ -1,2 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{p as st,e as s,h as i,f as Ke,t as F,g as e,i as E,a as w,u as M,r as a,n as ee,b as it,s as te,j as S,au as Ye}from"../chunks/wpu9U-D0.js";import{d as ot,a as W,e as ye,s as k}from"../chunks/D8mhvFt8.js";import{i as B}from"../chunks/DKve45Wd.js";import{e as ue,a as n,s as St,i as Qe}from"../chunks/60_R_Vbt.js";import{a as le,r as me}from"../chunks/P1-U_Xsj.js";import{s as q}from"../chunks/EqHb-9AZ.js";import{p as $e}from"../chunks/ByYB047u.js";import{P as Rt}from"../chunks/BHDZZvku.js";import{D as Je}from"../chunks/CmbJHhgy.js";import{I as Ze}from"../chunks/D7A-gG4Z.js";import{A as ce}from"../chunks/DcKTNC6e.js";const nt=.7,lt=.5,Tt="#ef4444",At="#f59e0b",Et="#fde047";function Be(m){return m>nt?Tt:m>lt?At:Et}function mt(m){return m>nt?"strong":m>lt?"moderate":"mild"}const et="#8b5cf6",Dt={fact:"#3b82f6",concept:"#8b5cf6",event:"#f59e0b",person:"#10b981",place:"#06b6d4",note:"#6b7280",pattern:"#ec4899",decision:"#ef4444"};function tt(m){return m?Dt[m]??et:et}const rt=5,Ot=9;function Ct(m){if(!Number.isFinite(m))return rt;const v=m<0?0:m>1?1:m;return rt+v*Ot}const Ft=.12;function at(m,v){return v==null||v===m?1:Ft}function he(m,v=60){return m==null||typeof m!="string"||v<=0?"":m.length<=v?m:m.slice(0,v-1)+"…"}function Nt(m){if(!m||m.length===0)return 0;const v=new Set;for(const u of m)u.memory_a_id&&v.add(u.memory_a_id),u.memory_b_id&&v.add(u.memory_b_id);return v.size}function Gt(m){if(!m||m.length===0)return 0;let v=0;for(const u of m)v+=Math.abs((u.trust_a??0)-(u.trust_b??0));return v/m.length}var Pt=Ye('',1),Lt=Ye(' '),$t=Ye('',1),Bt=S('
                        '),Yt=S('
                        '),zt=S('
                        '),Vt=S('
                        topic:
                        '),Ht=S('
                        SEVERITYstrong (>0.7)moderate (0.5-0.7)mild (0.3-0.5)
                        ');function Ut(m,v){st(v,!0);let u=$e(v,"focusedPairIndex",3,null),D=$e(v,"width",3,800),O=$e(v,"height",3,600);const R=M(()=>{const d=D()/2,r=O()/2,g=Math.min(D(),O())*.38;return{cx:d,cy:r,R:g}}),fe=M(()=>{const d=[],r=[],g=v.contradictions.length||1;return v.contradictions.forEach((l,p)=>{const j=p/g*Math.PI*2-Math.PI/2,y=.18+l.similarity*.22,f=j-y,_=j+y,G=e(R).R+Math.sin(p*2.3)*18,L=e(R).R+Math.cos(p*1.7)*18,b={x:e(R).cx+Math.cos(f)*G,y:e(R).cy+Math.sin(f)*G,trust:l.trust_a,preview:l.memory_a_preview,type:l.memory_a_type,created:l.memory_a_created,tags:l.memory_a_tags,memoryId:l.memory_a_id,pairIndex:p,side:"a"},h={x:e(R).cx+Math.cos(_)*L,y:e(R).cy+Math.sin(_)*L,trust:l.trust_b,preview:l.memory_b_preview,type:l.memory_b_type,created:l.memory_b_created,tags:l.memory_b_tags,memoryId:l.memory_b_id,pairIndex:p,side:"b"};d.push(b,h);const $=(b.x+h.x)/2,I=(b.y+h.y)/2,A=.55-l.similarity*.25,z=$+(e(R).cx-$)*A,V=I+(e(R).cy-I)*A,ve=1+Math.min(l.trust_a,l.trust_b)*4;r.push({pairIndex:p,path:`M ${b.x.toFixed(1)} ${b.y.toFixed(1)} Q ${z.toFixed(1)} ${V.toFixed(1)} ${h.x.toFixed(1)} ${h.y.toFixed(1)}`,color:Be(l.similarity),thickness:ve,severity:mt(l.similarity),topic:l.topic,similarity:l.similarity,dateDiff:l.date_diff_days,aPoint:b,bPoint:h,midX:z,midY:V})}),{nodes:d,arcs:r}});let T=te(null),P=te(null),Y=te(0),N=te(0);function we(d){const r=d.currentTarget.getBoundingClientRect();E(Y,d.clientX-r.left),E(N,d.clientY-r.top)}function re(d){v.onSelectPair&&v.onSelectPair(u()===d?null:d)}function je(){var d;(d=v.onSelectPair)==null||d.call(v,null)}var ae=Ht(),C=s(ae),de=i(s(C)),H=i(de),se=i(H),ie=i(se);ue(ie,17,()=>e(fe).arcs,d=>d.pairIndex,(d,r)=>{const g=M(()=>at(e(r).pairIndex,u())),l=M(()=>u()===e(r).pairIndex);var p=Pt(),j=Ke(p),y=i(j),f=i(y);F(_=>{n(j,"d",e(r).path),n(j,"stroke",e(r).color),n(j,"stroke-width",e(r).thickness*3),n(j,"stroke-opacity",.08*e(g)),n(y,"d",e(r).path),n(y,"stroke",e(r).color),n(y,"stroke-width",e(r).thickness*(e(l)?1.6:1)),n(y,"stroke-opacity",(e(l)?1:.72)*e(g)),n(y,"aria-label",`contradiction ${e(r).pairIndex+1}: ${e(r).topic??""}`),n(f,"d",e(r).path),n(f,"stroke",e(r).color),n(f,"stroke-width",_),n(f,"stroke-opacity",.85*e(g)),q(f,`animation-duration: ${4+e(r).pairIndex%5}s`)},[()=>Math.max(1,e(r).thickness*.6)]),W("click",y,_=>{_.stopPropagation(),re(e(r).pairIndex)}),ye("mouseenter",y,()=>E(P,e(r),!0)),ye("mouseleave",y,()=>E(P,null)),W("keydown",y,_=>{_.key==="Enter"&&re(e(r).pairIndex)}),w(d,p)});var oe=i(ie);ue(oe,19,()=>e(fe).nodes,(d,r)=>d.memoryId+"-"+d.side+"-"+r,(d,r)=>{const g=M(()=>at(e(r).pairIndex,u())),l=M(()=>u()===e(r).pairIndex),p=M(()=>Ct(e(r).trust)),j=M(()=>tt(e(r).type));var y=$t(),f=Ke(y),_=i(f),G=i(_);{var L=b=>{var h=Lt(),$=s(h,!0);a(h),F(I=>{n(h,"x",e(r).x),n(h,"y",e(r).y-e(p)-8),k($,I)},[()=>he(e(r).preview,40)]),w(b,h)};B(G,b=>{e(l)&&b(L)})}F(b=>{n(f,"cx",e(r).x),n(f,"cy",e(r).y),n(f,"r",e(p)*2.2),n(f,"fill",e(j)),n(f,"opacity",.12*e(g)),n(_,"cx",e(r).x),n(_,"cy",e(r).y),n(_,"r",e(p)),n(_,"fill",e(j)),n(_,"opacity",e(g)),n(_,"stroke-opacity",e(l)?.85:.25),n(_,"stroke-width",e(l)?2:1),n(_,"aria-label",`memory ${b??""}`)},[()=>he(e(r).preview,40)]),ye("mouseenter",_,()=>E(T,e(r),!0)),ye("mouseleave",_,()=>E(T,null)),W("click",_,b=>{b.stopPropagation(),re(e(r).pairIndex)}),W("keydown",_,b=>{b.key==="Enter"&&re(e(r).pairIndex)}),w(d,y)}),ee(),a(C);var _e=i(C,2);{var Me=d=>{var r=zt(),g=s(r),l=s(g),p=i(l,2),j=s(p,!0);a(p);var y=i(p,2),f=s(y);a(y),a(g);var _=i(g,2),G=s(_,!0);a(_);var L=i(_,2);{var b=I=>{var A=Bt(),z=s(A);a(A),F(()=>k(z,`created ${e(T).created??""}`)),w(I,A)};B(L,I=>{e(T).created&&I(b)})}var h=i(L,2);{var $=I=>{var A=Yt(),z=s(A,!0);a(A),F(V=>k(z,V),[()=>e(T).tags.slice(0,4).join(" · ")]),w(I,A)};B(h,I=>{e(T).tags&&e(T).tags.length>0&&I($)})}a(r),F((I,A,z,V)=>{q(r,`left: ${I??""}px; top: ${A??""}px;`),q(l,`background: ${z??""}`),k(j,e(T).type??"memory"),k(f,`trust ${V??""}%`),k(G,e(T).preview)},[()=>Math.max(0,Math.min(e(Y)+12,D()-240)),()=>Math.max(0,Math.min(e(N)-8,O()-120)),()=>tt(e(T).type),()=>(e(T).trust*100).toFixed(0)]),w(d,r)},be=d=>{var r=Vt(),g=s(r),l=s(g),p=i(l,2),j=s(p);a(p),a(g);var y=i(g,2),f=i(s(y)),_=s(f,!0);a(f),a(y);var G=i(y,2),L=s(G);a(G),a(r),F((b,h,$)=>{q(r,`left: ${b??""}px; top: ${h??""}px;`),q(l,`background: ${e(P).color??""}`),k(j,`${e(P).severity??""} conflict`),k(_,e(P).topic),k(L,`similarity ${$??""}% · ${e(P).dateDiff??""}d apart`)},[()=>Math.max(0,Math.min(e(Y)+12,D()-240)),()=>Math.max(0,Math.min(e(N)-8,O()-120)),()=>(e(P).similarity*100).toFixed(0)]),w(d,r)};B(_e,d=>{e(T)?d(Me):e(P)&&d(be,1)})}a(ae),F(()=>{q(ae,`aspect-ratio: ${D()??""} / ${O()??""};`),n(C,"width",D()),n(C,"height",O()),n(C,"viewBox",`0 0 ${D()??""} ${O()??""}`),n(de,"width",D()),n(de,"height",O()),n(H,"cx",e(R).cx),n(H,"cy",e(R).cy),n(H,"r",e(R).R),n(se,"cx",e(R).cx),n(se,"cy",e(R).cy)}),W("mousemove",C,we),ye("mouseleave",C,()=>{E(T,null),E(P,null)}),W("click",C,je),w(m,ae),it()}ot(["mousemove","click","keydown"]);var Wt=S(' in view'),qt=S(''),Xt=S('

                        No contradictions match this filter.

                        '),Kt=S('
                        No pairs visible.
                        '),Qt=S(' '),Jt=S('
                        '),Zt=S(' '),er=S('
                        '),tr=S('
                        Full memory A
                        Full memory B
                        '),rr=S(''),ar=S('
                        average trust delta
                        visible in current filter
                        strong conflicts
                        ');function ur(m,v){st(v,!0);const u=[{memory_a_id:"a1",memory_b_id:"b1",memory_a_preview:"Dev server runs on port 3000 (default Vite config)",memory_b_preview:"Dev server moved to port 3002 to avoid conflict",memory_a_type:"fact",memory_b_type:"decision",memory_a_created:"2026-01-14",memory_b_created:"2026-03-22",memory_a_tags:["dev","vite"],memory_b_tags:["dev","vite","decision"],trust_a:.42,trust_b:.91,similarity:.88,date_diff_days:67,topic:"dev server port"},{memory_a_id:"a2",memory_b_id:"b2",memory_a_preview:"Prompt variation helps at higher sampling temperatures",memory_b_preview:"Prompt variation reduced accuracy in the latest benchmark run",memory_a_type:"concept",memory_b_type:"fact",memory_a_created:"2026-03-30",memory_b_created:"2026-04-03",memory_a_tags:["research","prompting"],memory_b_tags:["research","prompting","evidence"],trust_a:.35,trust_b:.88,similarity:.92,date_diff_days:4,topic:"prompt diversity"},{memory_a_id:"a3",memory_b_id:"b3",memory_a_preview:"Use min_p=0.05 for long-form sampling",memory_b_preview:"min_p scheduling failed at high sampling temperatures",memory_a_type:"pattern",memory_b_type:"fact",memory_a_created:"2026-04-01",memory_b_created:"2026-04-05",memory_a_tags:["sampling"],memory_b_tags:["sampling"],trust_a:.58,trust_b:.74,similarity:.81,date_diff_days:4,topic:"min_p sampling"},{memory_a_id:"a4",memory_b_id:"b4",memory_a_preview:"LoRA rank 16 is enough for domain adaptation",memory_b_preview:"LoRA rank 32 consistently outperforms rank 16 on math",memory_a_type:"concept",memory_b_type:"fact",memory_a_created:"2026-02-10",memory_b_created:"2026-04-12",memory_a_tags:["lora","training"],memory_b_tags:["lora","training","nemotron"],trust_a:.48,trust_b:.76,similarity:.74,date_diff_days:61,topic:"LoRA rank"},{memory_a_id:"a5",memory_b_id:"b5",memory_a_preview:"Team prefers Rust for backend services",memory_b_preview:"Project chose Axum + Rust for the dashboard backend",memory_a_type:"note",memory_b_type:"decision",memory_a_created:"2026-01-05",memory_b_created:"2026-02-18",memory_a_tags:["preference","backend"],memory_b_tags:["backend","decision"],trust_a:.81,trust_b:.88,similarity:.42,date_diff_days:44,topic:"backend language"},{memory_a_id:"a6",memory_b_id:"b6",memory_a_preview:"Warm-start from checkpoint saves 8h of training",memory_b_preview:"Warm-start code never loaded the PEFT adapter correctly",memory_a_type:"pattern",memory_b_type:"fact",memory_a_created:"2026-03-11",memory_b_created:"2026-04-16",memory_a_tags:["training","warm-start"],memory_b_tags:["training","warm-start","bug-fix"],trust_a:.55,trust_b:.93,similarity:.79,date_diff_days:36,topic:"warm-start correctness"},{memory_a_id:"a7",memory_b_id:"b7",memory_a_preview:"Three.js force-directed graph runs fine at 5k nodes",memory_b_preview:"WebGL graph stutters above 2k nodes on M1 MacBook Air",memory_a_type:"fact",memory_b_type:"fact",memory_a_created:"2025-12-02",memory_b_created:"2026-03-29",memory_a_tags:["vestige","graph","perf"],memory_b_tags:["vestige","graph","perf"],trust_a:.39,trust_b:.72,similarity:.67,date_diff_days:117,topic:"graph performance"},{memory_a_id:"a8",memory_b_id:"b8",memory_a_preview:"Submit benchmark runs with a 16384 token budget",memory_b_preview:"Latest baseline improved when token budget increased to 32768",memory_a_type:"pattern",memory_b_type:"event",memory_a_created:"2026-04-04",memory_b_created:"2026-04-10",memory_a_tags:["benchmark","tokens"],memory_b_tags:["benchmark","baseline"],trust_a:.31,trust_b:.85,similarity:.73,date_diff_days:6,topic:"token budget"},{memory_a_id:"a9",memory_b_id:"b9",memory_a_preview:"FSRS-6 parameters require ~1k reviews to train",memory_b_preview:"FSRS-6 default parameters work fine out of the box",memory_a_type:"concept",memory_b_type:"concept",memory_a_created:"2026-01-22",memory_b_created:"2026-02-28",memory_a_tags:["fsrs","training"],memory_b_tags:["fsrs"],trust_a:.62,trust_b:.54,similarity:.57,date_diff_days:37,topic:"FSRS parameter tuning"},{memory_a_id:"a10",memory_b_id:"b10",memory_a_preview:"Tailwind 4 requires explicit CSS import only",memory_b_preview:"Tailwind 4 config still supports tailwind.config.js",memory_a_type:"fact",memory_b_type:"fact",memory_a_created:"2026-01-30",memory_b_created:"2026-02-14",memory_a_tags:["tailwind","config"],memory_b_tags:["tailwind","config"],trust_a:.47,trust_b:.33,similarity:.85,date_diff_days:15,topic:"Tailwind 4 config"},{memory_a_id:"a11",memory_b_id:"b11",memory_a_preview:"Dataset API silently ignores invalid source slugs",memory_b_preview:"Dataset API throws an error when source slug is invalid",memory_a_type:"fact",memory_b_type:"concept",memory_a_created:"2026-04-07",memory_b_created:"2026-02-20",memory_a_tags:["api","bug-fix"],memory_b_tags:["api"],trust_a:.89,trust_b:.28,similarity:.91,date_diff_days:46,topic:"API validation"},{memory_a_id:"a12",memory_b_id:"b12",memory_a_preview:"USearch HNSW is 20x faster than FAISS for embeddings",memory_b_preview:"FAISS IVF is the fastest vector index at scale",memory_a_type:"fact",memory_b_type:"concept",memory_a_created:"2026-02-01",memory_b_created:"2025-11-15",memory_a_tags:["vectors","perf"],memory_b_tags:["vectors","perf"],trust_a:.78,trust_b:.36,similarity:.69,date_diff_days:78,topic:"vector index perf"},{memory_a_id:"a13",memory_b_id:"b13",memory_a_preview:"Leaderboard scores weight by top-10 consistency",memory_b_preview:"Leaderboard uses single-best-episode scoring",memory_a_type:"fact",memory_b_type:"fact",memory_a_created:"2026-04-18",memory_b_created:"2026-04-10",memory_a_tags:["leaderboard","scoring"],memory_b_tags:["leaderboard","scoring"],trust_a:.64,trust_b:.52,similarity:.82,date_diff_days:8,topic:"leaderboard scoring"},{memory_a_id:"a14",memory_b_id:"b14",memory_a_preview:"Release notes were planned for 8am ET",memory_b_preview:"Release notes moved to 9am ET after schedule review",memory_a_type:"decision",memory_b_type:"decision",memory_a_created:"2026-03-01",memory_b_created:"2026-04-15",memory_a_tags:["cadence","content"],memory_b_tags:["cadence","content"],trust_a:.5,trust_b:.81,similarity:.58,date_diff_days:45,topic:"posting cadence"},{memory_a_id:"a15",memory_b_id:"b15",memory_a_preview:"Dream cycle consolidates ~50 memories per run",memory_b_preview:"Dream cycle replays closer to 120 memories in practice",memory_a_type:"fact",memory_b_type:"fact",memory_a_created:"2026-02-15",memory_b_created:"2026-04-08",memory_a_tags:["vestige","dream"],memory_b_tags:["vestige","dream"],trust_a:.44,trust_b:.79,similarity:.76,date_diff_days:52,topic:"dream cycle count"},{memory_a_id:"a16",memory_b_id:"b16",memory_a_preview:"Never commit API keys to git; use .env files",memory_b_preview:"Environment secrets should live in a 1Password vault",memory_a_type:"pattern",memory_b_type:"pattern",memory_a_created:"2025-10-11",memory_b_created:"2026-03-20",memory_a_tags:["security","secrets"],memory_b_tags:["security","secrets"],trust_a:.72,trust_b:.64,similarity:.48,date_diff_days:160,topic:"secret storage"}];let D=te("all"),O=te("");const R=M(()=>Array.from(new Set(u.map(t=>t.topic))).sort()),fe=[{value:"all",label:"All contradictions",icon:"contradictions"},{value:"recent",label:"Recent (last 7 days)",icon:"timeline"},{value:"high-trust",label:"High trust (>60%)",icon:"importance"},{value:"topic",label:"By topic",icon:"filter"}],T=M(()=>[{value:"",label:"All topics"},...e(R).map(t=>({value:t,label:t,badge:u.filter(o=>o.topic===t).length}))]);function P(t){E(D,t,!0),E(N,null)}const Y=M(()=>{switch(e(D)){case"recent":{const t=new Date("2026-04-20").getTime(),o=10080*60*1e3;return u.filter(c=>{const x=c.memory_a_created?new Date(c.memory_a_created).getTime():0,xe=c.memory_b_created?new Date(c.memory_b_created).getTime():0;return t-Math.max(x,xe)<=o})}case"high-trust":return u.filter(t=>Math.min(t.trust_a,t.trust_b)>.6);case"topic":return e(O)?u.filter(t=>t.topic===e(O)):u;case"all":default:return u}});let N=te(null);function we(t){E(N,t,!0)}const re=47,je=M(()=>Nt(u)),ae=M(()=>Gt(u)),C=M(()=>{const t=new Map(u.map((o,c)=>[o.memory_a_id+"|"+o.memory_b_id,c]));return e(Y).map(o=>({orig:t.get(o.memory_a_id+"|"+o.memory_b_id)??0,c:o}))});function de(t){E(N,e(N)===t?null:t,!0)}var H=ar(),se=s(H);Rt(se,{icon:"contradictions",title:"Contradiction Constellation",subtitle:"Where your memory disagrees with itself",accent:"warning",children:(t,o)=>{var c=Wt(),x=s(c);ce(x,{get value(){return e(Y).length}}),ee(),a(c),w(t,c)},$$slots:{default:!0}});var ie=i(se,2),oe=s(ie),_e=s(oe),Me=s(_e);ce(Me,{value:re}),a(_e);var be=i(_e,2),d=s(be);a(be),a(oe),le(oe,(t,o)=>{var c;return(c=me)==null?void 0:c(t,o)},()=>({delay:0,y:12}));var r=i(oe,2),g=s(r),l=s(g);ce(l,{get value(){return e(ae)},decimals:2}),a(g),ee(2),a(r),le(r,(t,o)=>{var c;return(c=me)==null?void 0:c(t,o)},()=>({delay:60,y:12}));var p=i(r,2),j=s(p),y=s(j);ce(y,{get value(){return e(Y).length}}),a(j),ee(2),a(p),le(p,(t,o)=>{var c;return(c=me)==null?void 0:c(t,o)},()=>({delay:120,y:12}));var f=i(p,2),_=s(f),G=i(s(_),2),L=s(G);{let t=M(()=>e(Y).filter(o=>o.similarity>.7).length);ce(L,{get value(){return e(t)}})}a(G),a(_),ee(2),a(f),le(f,(t,o)=>{var c;return(c=me)==null?void 0:c(t,o)},()=>({delay:180,y:12})),a(ie);var b=i(ie,2),h=s(b);Je(h,{get options(){return fe},get value(){return e(D)},label:"Lens",icon:"filter",onChange:P});var $=i(h,2);{var I=t=>{Je(t,{get options(){return e(T)},label:"Topic",icon:"contradictions",placeholder:"All topics",get value(){return e(O)},set value(o){E(O,o,!0)}})};B($,t=>{e(D)==="topic"&&t(I)})}var A=i($,2);{var z=t=>{var o=qt(),c=s(o);Ze(c,{name:"close",size:13}),ee(),a(o),W("click",o,()=>E(N,null)),w(t,o)};B(A,t=>{e(N)!==null&&t(z)})}a(b);var V=i(b,2),ve=s(V),ct=s(ve);{var dt=t=>{var o=Xt(),c=s(o),x=s(c);Ze(x,{name:"contradictions",size:44,strokeWidth:1.2}),a(c),ee(2),a(o),w(t,o)},_t=t=>{Ut(t,{get contradictions(){return e(Y)},get focusedPairIndex(){return e(N)},onSelectPair:we,width:800,height:600})};B(ct,t=>{e(Y).length===0?t(dt):t(_t,!1)})}a(ve);var Ie=i(ve,2),Se=s(Ie),ze=i(s(Se),2),vt=s(ze);ce(vt,{get value(){return e(C).length}}),a(ze),a(Se);var Ve=i(Se,2);{var pt=t=>{var o=Kt();w(t,o)};B(Ve,t=>{e(C).length===0&&t(pt)})}var yt=i(Ve,2);ue(yt,19,()=>e(C),t=>t.c.memory_a_id+"|"+t.c.memory_b_id,(t,o,c)=>{const x=M(()=>e(o).c),xe=M(()=>e(N)===e(c));var ne=rr(),Re=s(ne),He=s(Re),ge=i(He,2),ut=s(ge,!0);a(ge);var Ue=i(ge,2),ft=s(Ue);a(Ue),a(Re);var Te=i(Re,2),bt=s(Te,!0);a(Te);var Ae=i(Te,2),Ee=s(Ae),De=i(s(Ee),2),xt=s(De,!0);a(De);var We=i(De,2),gt=s(We);a(We),a(Ee);var qe=i(Ee,2),Oe=i(s(qe),2),kt=s(Oe,!0);a(Oe);var Xe=i(Oe,2),ht=s(Xe);a(Xe),a(qe),a(Ae);var wt=i(Ae,2);{var jt=X=>{var K=tr(),U=i(s(K),2),Ce=s(U,!0);a(U);var ke=i(U,2);{var Fe=Q=>{var J=Jt();ue(J,21,()=>e(x).memory_a_tags,Qe,(Ge,Pe)=>{var Z=Qt(),Le=s(Z,!0);a(Z),F(()=>k(Le,e(Pe))),w(Ge,Z)}),a(J),w(Q,J)};B(ke,Q=>{e(x).memory_a_tags&&e(x).memory_a_tags.length>0&&Q(Fe)})}var pe=i(ke,4),Ne=s(pe,!0);a(pe);var Mt=i(pe,2);{var It=Q=>{var J=er();ue(J,21,()=>e(x).memory_b_tags,Qe,(Ge,Pe)=>{var Z=Zt(),Le=s(Z,!0);a(Z),F(()=>k(Le,e(Pe))),w(Ge,Z)}),a(J),w(Q,J)};B(Mt,Q=>{e(x).memory_b_tags&&e(x).memory_b_tags.length>0&&Q(It)})}a(K),F(()=>{k(Ce,e(x).memory_a_preview),k(Ne,e(x).memory_b_preview)}),w(X,K)};B(wt,X=>{e(xe)&&X(jt)})}a(ne),le(ne,(X,K)=>{var U;return(U=me)==null?void 0:U(X,K)},()=>({delay:Math.min(e(c)*35,350),y:10})),F((X,K,U,Ce,ke,Fe,pe,Ne)=>{St(ne,1,`w-full text-left p-3 rounded-xl border transition lift - ${e(xe)?"bg-synapse/10 border-synapse/40 shadow-[0_0_12px_rgba(99,102,241,0.18)]":"border-subtle/20 hover:border-synapse/30 hover:bg-white/[0.02]"}`),q(He,`background: ${X??""}`),q(ge,`color: ${K??""}`),k(ut,U),k(ft,`${Ce??""}% sim · ${e(x).date_diff_days??""}d`),k(bt,e(x).topic),k(xt,ke),k(gt,`${Fe??""}%`),k(kt,pe),k(ht,`${Ne??""}%`)},[()=>Be(e(x).similarity),()=>Be(e(x).similarity),()=>mt(e(x).similarity),()=>(e(x).similarity*100).toFixed(0),()=>he(e(x).memory_a_preview),()=>(e(x).trust_a*100).toFixed(0),()=>he(e(x).memory_b_preview),()=>(e(x).trust_b*100).toFixed(0)]),W("click",ne,()=>de(e(c))),w(t,ne)}),a(Ie),le(Ie,(t,o)=>{var c;return(c=me)==null?void 0:c(t,o)},()=>({delay:120,y:16})),a(V),a(H),F(t=>k(d,`contradictions across ${t??""} memories`),[()=>e(je).toLocaleString()]),w(m,H),it()}ot(["click"]);export{ur as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js.br b/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js.br deleted file mode 100644 index b0f809c..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js.gz b/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js.gz deleted file mode 100644 index 89cd895..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/6.DZyLUVX2.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js b/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js similarity index 90% rename from apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js rename to apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js index d9d4f58..e5603e0 100644 --- a/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js +++ b/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{p as Se,e as r,r as a,h as l,g as e,c as Fe,f as ge,a as m,u as _,t as N,b as Me,n as U,j as x,au as Le,x as ze,ar as Ge,s as he,i as le,m as Ie}from"../chunks/wpu9U-D0.js";import{s as b,d as Ae,a as fe}from"../chunks/D8mhvFt8.js";import{i as F}from"../chunks/DKve45Wd.js";import{e as xe,a as W,s as we,r as Ye,b as Ve}from"../chunks/60_R_Vbt.js";import{h as Be}from"../chunks/DzesjbbJ.js";import{a as ye,r as Ee}from"../chunks/P1-U_Xsj.js";import{a as We}from"../chunks/CZfHMhLI.js";import{s as re}from"../chunks/EqHb-9AZ.js";import{p as Xe}from"../chunks/ByYB047u.js";import{b as Ue}from"../chunks/Bxs5UR9-.js";import{P as Je}from"../chunks/BHDZZvku.js";import{I as ke}from"../chunks/D7A-gG4Z.js";import{m as Te}from"../chunks/DPdYG9yN.js";const Pe=5,je=["Replay","Cross-reference","Strengthen","Prune","Transfer"];function He(o){if(!Number.isFinite(o))return 1;const v=Math.floor(o);return v<1?1:v>Pe?Pe:v}const Ke=.3,Qe=.7;function Ze(o){const v=qe(o);return v>Qe?"high":v1?1:o}function $e(o){return o==null||!Number.isFinite(o)||o<0?"0ms":o<1e3?`${Math.round(o)}ms`:`${(o/1e3).toFixed(2)}s`}function et(o){const v=qe(o);return`${Math.round(v*100)}%`}function tt(o,v=""){return`${v}/memories/${o}`}function st(o,v=2){return!o||o.length===0?[]:o.slice(0,Math.max(0,v))}function at(o,v=2){return o?Math.max(0,o.length-v):0}function rt(o){return o?o.length>8?o.slice(0,8):o:""}var nt=x('
                        Episodic hippocampus
                        Semantic cortex
                        ',1),vt=Le(''),it=x('
                        '),lt=x(''),ot=x('Replaying memories'),ct=x('New connections found: '),dt=x('Strengthened: '),ut=x('Compressed: '),ft=x('Connections persisted: Insights: ',1),mt=x('
                        ');function pt(o,v){Se(v,!0);const P=[{num:1,name:"Replay",color:"#818cf8",desc:"Hippocampal replay: tagged memories surface for consolidation."},{num:2,name:"Cross-reference",color:"#a855f7",desc:"Semantic proximity check — new edges discovered across memories."},{num:3,name:"Strengthen",color:"#c084fc",desc:"Co-activated memories strengthen; FSRS stability grows."},{num:4,name:"Prune",color:"#ef4444",desc:"Low-retention redundant memories compressed or released."},{num:5,name:"Transfer",color:"#10b981",desc:"Episodic → semantic consolidation (hippocampus → cortex)."}];let c=_(()=>He(v.stage)),p=_(()=>P[e(c)-1]),q=_(()=>{if(!v.dreamResult)return 8;const t=v.dreamResult.memoriesReplayed??8;return Math.max(6,Math.min(12,t))}),Z=_(()=>{var s;if(!v.dreamResult)return 5;const t=((s=v.dreamResult.stats)==null?void 0:s.newConnectionsFound)??5;return Math.max(3,Math.min(e(q),t))}),$=_(()=>{var s;if(!v.dreamResult)return Math.ceil(e(q)*.5);const t=((s=v.dreamResult.stats)==null?void 0:s.memoriesStrengthened)??Math.ceil(e(q)*.5);return Math.max(1,Math.min(e(q),t))}),ee=_(()=>{var s;if(!v.dreamResult)return Math.ceil(e(q)*.25);const t=((s=v.dreamResult.stats)==null?void 0:s.memoriesCompressed)??Math.ceil(e(q)*.25);return Math.max(1,Math.min(Math.floor(e(q)/2),t))});function I(t,s=0){const i=Math.sin((t+1)*9301+49297+s*233)*233280;return i-Math.floor(i)}let te=_(()=>{const t=[],s=Math.ceil(Math.sqrt(e(q))),i=Math.ceil(e(q)/s);for(let n=0;n{const t=[],s=e(te).length;for(let i=0;i{var s=nt();U(4),m(t,s)};F(h,t=>{e(c)===5&&t(M)})}var A=l(h,2);xe(A,23,()=>e(G),(t,s)=>t.a+"-"+t.b+"-"+s,(t,s,i)=>{const n=_(()=>e(te)[e(s).a]),u=_(()=>e(te)[e(s).b]);var d=Fe(),D=ge(d);{var K=j=>{const Q=_(()=>L(e(n))),ue=_(()=>J(e(n))),pe=_(()=>L(e(u))),be=_(()=>J(e(u)));var z=vt();N(()=>{W(z,"x1",e(Q)),W(z,"y1",e(ue)),W(z,"x2",e(pe)),W(z,"y2",e(be)),W(z,"stroke",e(p).color),W(z,"stroke-width",e(c)===2?.25:e(c)===3?.35:.2),W(z,"stroke-opacity",e(c)<2?0:e(c)===4?.25:e(c)===5?.15:.6),W(z,"stroke-dasharray",e(c)===2?"1.2 0.8":"none"),re(z,`--edge-delay: ${e(i)*80}ms`)}),m(j,z)};F(D,j=>{e(n)&&e(u)&&j(K)})}m(t,d)}),a(A);var w=l(A,2);xe(w,17,()=>e(te),t=>t.id,(t,s)=>{var i=it();let n;N((u,d,D,K,j)=>{n=we(i,1,"memory-card svelte-1cq1ntk",null,n,{"is-pulsing":e(c)===3&&e(s).strengthened,"is-pruning":e(c)===4&&e(s).pruned,"is-transferring":e(c)===5,"semantic-side":e(c)===5&&e(s).transferIsSemantic}),re(i,` +import"../chunks/Bzak7iHL.js";import{p as Se,e as r,r as a,h as l,g as e,c as Fe,f as ge,a as m,u as _,t as N,b as Me,n as U,j as x,av as Le,A as ze,as as Ae,s as he,i as le,m as Ie}from"../chunks/CW7md74C.js";import{s as b,d as Ge,a as fe}from"../chunks/D90q9c2i.js";import{i as F}from"../chunks/9-jplUL5.js";import{e as xe,a as W,s as we,r as Ye,b as Ve}from"../chunks/Cc0l8Nd4.js";import{h as Be}from"../chunks/C98jjAli.js";import{a as ye,r as Ee}from"../chunks/D8RjhgN0.js";import{a as We}from"../chunks/C-rZhKee.js";import{s as re}from"../chunks/BNUnVJrY.js";import{p as Xe}from"../chunks/BjbQ7qSx.js";import{b as Ue}from"../chunks/CaEJGM7b.js";import{P as Je}from"../chunks/DTO0IjuV.js";import{I as ke}from"../chunks/CqwrgJOn.js";import{m as Te}from"../chunks/DPdYG9yN.js";const Pe=5,je=["Replay","Cross-reference","Strengthen","Prune","Transfer"];function He(o){if(!Number.isFinite(o))return 1;const v=Math.floor(o);return v<1?1:v>Pe?Pe:v}const Ke=.3,Qe=.7;function Ze(o){const v=qe(o);return v>Qe?"high":v1?1:o}function $e(o){return o==null||!Number.isFinite(o)||o<0?"0ms":o<1e3?`${Math.round(o)}ms`:`${(o/1e3).toFixed(2)}s`}function et(o){const v=qe(o);return`${Math.round(v*100)}%`}function tt(o,v=""){return`${v}/memories/${o}`}function st(o,v=2){return!o||o.length===0?[]:o.slice(0,Math.max(0,v))}function at(o,v=2){return o?Math.max(0,o.length-v):0}function rt(o){return o?o.length>8?o.slice(0,8):o:""}var nt=x('
                        Episodic hippocampus
                        Semantic cortex
                        ',1),vt=Le(''),it=x('
                        '),lt=x(''),ot=x('Replaying memories'),ct=x('New connections found: '),dt=x('Strengthened: '),ut=x('Compressed: '),ft=x('Connections persisted: Insights: ',1),mt=x('
                        ');function pt(o,v){Se(v,!0);const P=[{num:1,name:"Replay",color:"#818cf8",desc:"Hippocampal replay: tagged memories surface for consolidation."},{num:2,name:"Cross-reference",color:"#a855f7",desc:"Semantic proximity check — new edges discovered across memories."},{num:3,name:"Strengthen",color:"#c084fc",desc:"Co-activated memories strengthen; FSRS stability grows."},{num:4,name:"Prune",color:"#ef4444",desc:"Low-retention redundant memories compressed or released."},{num:5,name:"Transfer",color:"#10b981",desc:"Episodic → semantic consolidation (hippocampus → cortex)."}];let c=_(()=>He(v.stage)),p=_(()=>P[e(c)-1]),q=_(()=>{if(!v.dreamResult)return 8;const t=v.dreamResult.memoriesReplayed??8;return Math.max(6,Math.min(12,t))}),Z=_(()=>{var s;if(!v.dreamResult)return 5;const t=((s=v.dreamResult.stats)==null?void 0:s.newConnectionsFound)??5;return Math.max(3,Math.min(e(q),t))}),$=_(()=>{var s;if(!v.dreamResult)return Math.ceil(e(q)*.5);const t=((s=v.dreamResult.stats)==null?void 0:s.memoriesStrengthened)??Math.ceil(e(q)*.5);return Math.max(1,Math.min(e(q),t))}),ee=_(()=>{var s;if(!v.dreamResult)return Math.ceil(e(q)*.25);const t=((s=v.dreamResult.stats)==null?void 0:s.memoriesCompressed)??Math.ceil(e(q)*.25);return Math.max(1,Math.min(Math.floor(e(q)/2),t))});function I(t,s=0){const i=Math.sin((t+1)*9301+49297+s*233)*233280;return i-Math.floor(i)}let te=_(()=>{const t=[],s=Math.ceil(Math.sqrt(e(q))),i=Math.ceil(e(q)/s);for(let n=0;n{const t=[],s=e(te).length;for(let i=0;i{var s=nt();U(4),m(t,s)};F(h,t=>{e(c)===5&&t(M)})}var G=l(h,2);xe(G,23,()=>e(A),(t,s)=>t.a+"-"+t.b+"-"+s,(t,s,i)=>{const n=_(()=>e(te)[e(s).a]),u=_(()=>e(te)[e(s).b]);var d=Fe(),D=ge(d);{var K=j=>{const Q=_(()=>L(e(n))),ue=_(()=>J(e(n))),pe=_(()=>L(e(u))),be=_(()=>J(e(u)));var z=vt();N(()=>{W(z,"x1",e(Q)),W(z,"y1",e(ue)),W(z,"x2",e(pe)),W(z,"y2",e(be)),W(z,"stroke",e(p).color),W(z,"stroke-width",e(c)===2?.25:e(c)===3?.35:.2),W(z,"stroke-opacity",e(c)<2?0:e(c)===4?.25:e(c)===5?.15:.6),W(z,"stroke-dasharray",e(c)===2?"1.2 0.8":"none"),re(z,`--edge-delay: ${e(i)*80}ms`)}),m(j,z)};F(D,j=>{e(n)&&e(u)&&j(K)})}m(t,d)}),a(G);var w=l(G,2);xe(w,17,()=>e(te),t=>t.id,(t,s)=>{var i=it();let n;N((u,d,D,K,j)=>{n=we(i,1,"memory-card svelte-1cq1ntk",null,n,{"is-pulsing":e(c)===3&&e(s).strengthened,"is-pruning":e(c)===4&&e(s).pruned,"is-transferring":e(c)===5,"semantic-side":e(c)===5&&e(s).transferIsSemantic}),re(i,` left: ${u??""}%; top: ${d??""}%; opacity: ${D??""}; @@ -10,5 +10,5 @@ import"../chunks/Bzak7iHL.js";import{p as Se,e as r,r as a,h as l,g as e,c as Fe color: ${e(p).color??""}; border: 1.5px solid ${e(p).color??""}; box-shadow: 0 0 16px color-mix(in srgb, ${e(p).color??""} 40%, transparent); - `),b(y,e(p).num),b(H,e(p).name),b(E,e(p).desc),b(X,`Stage ${e(p).num??""} / 5`),re(C,`--stage-color: ${e(p).color??""}`),W(C,"aria-label",`Dream stage ${e(p).num??""} — ${e(p).name??""}`)}),m(o,ve),Me()}var gt=x(' novel'),xt=x(' '),bt=x(' '),_t=x('
                        Sources
                        '),ht=x('

                        Novelty
                        Confidence
                        ');function yt(o,v){Se(v,!0);let P=Xe(v,"index",3,0),c=_(()=>qe(v.insight.noveltyScore)),p=_(()=>qe(v.insight.confidence)),q=_(()=>Ze(v.insight.noveltyScore)),Z=_(()=>e(q)==="high"),$=_(()=>e(q)==="low"),ee=_(()=>st(v.insight.sourceMemories,2)),I=_(()=>at(v.insight.sourceMemories,2));const te={connection:"#818cf8",pattern:"#ec4899",contradiction:"#ef4444",synthesis:"#c084fc",emergence:"#f59e0b",cluster:"#06b6d4"};let G=_(()=>{var w;return te[((w=v.insight.type)==null?void 0:w.toLowerCase())??""]??"#a855f7"});var L=ht();let J;var ne=r(L),se=r(ne),ve=r(se,!0);a(se);var ie=l(se,2);{var f=w=>{var O=gt();m(w,O)};F(ie,w=>{e(Z)&&w(f)})}a(ne);var g=l(ne,2),y=r(g,!0);a(g);var R=l(g,2),k=r(R),H=l(r(k),2),S=r(H,!0);a(H),a(k);var E=l(k,2),T=r(E);a(E),a(R);var X=l(R,2),C=l(r(X),2),h=r(C,!0);a(C),a(X);var M=l(X,2);{var A=w=>{var O=_t(),ae=r(O),oe=l(r(ae));{var ce=Y=>{var V=xt(),B=r(V);a(V),N(()=>b(B,`(+${e(I)??""})`)),m(Y,V)};F(oe,Y=>{e(I)>0&&Y(ce)})}a(ae);var de=l(ae,2);xe(de,20,()=>e(ee),Y=>Y,(Y,V)=>{var B=bt(),me=r(B,!0);a(B),N((t,s)=>{W(B,"href",t),W(B,"title",`Open memory ${V??""}`),b(me,s)},[()=>tt(V,Ue),()=>rt(V)]),m(Y,B)}),a(de),a(O),m(w,O)};F(M,w=>{e(ee).length>0&&w(A)})}a(L),N((w,O)=>{J=we(L,1,"insight-card glass-panel rounded-xl p-4 space-y-3 svelte-1y17hsl",null,J,{"high-novelty":e(Z),"low-novelty":e($)}),re(L,`--insight-color: ${e(G)??""}; --enter-delay: ${P()*60}ms`),re(se,`background: ${e(G)??""}22; color: ${e(G)??""}; border: 1px solid ${e(G)??""}55`),b(ve,v.insight.type??"insight"),b(y,v.insight.insight),b(S,w),re(T,`width: ${e(c)*100}%; background: linear-gradient(90deg, ${e(G)??""}, var(--color-dream-glow))`),re(C,`color: ${e(p)>.7?"#10b981":e(p)>.4?"#f59e0b":"#ef4444"}`),b(h,O)},[()=>e(c).toFixed(2),()=>et(e(p))]),m(o,L),Me()}var kt=x(' Consolidating'),wt=x(' Cycle complete'),qt=x(' Dreaming...',1),St=x(' Dream Now',1),Mt=x('
                        '),Rt=x('
                        '),Ct=x(`

                        Nothing's been dreamt yet.

                        Run a consolidation cycle and watch your episodic memories replay, - cross-reference, and crystallize into lasting semantic knowledge.

                        `),Dt=x(''),Nt=x('
                        '),It=x('
                        Replayed
                        Connections Found
                        Connections Persisted
                        Insights
                        Duration
                        '),Et=x('
                        ',1),Tt=x('
                        ');function Ut(o,v){Se(v,!0);let P=he(null),c=he(1),p=he(!1),q=he(null),Z=_(()=>e(P)!==null),$=_(()=>{const f=e(P);return f?[...f.insights].sort((g,y)=>(y.noveltyScore??0)-(g.noveltyScore??0)):[]});async function ee(){if(!e(p)){le(p,!0),le(q,null);try{const f=await We.dream();le(P,f,!0),le(c,1)}catch(f){le(q,f instanceof Error?f.message:"Dream failed",!0)}finally{le(p,!1)}}}function I(f){le(c,He(f),!0)}function te(f){const g=Number(f.currentTarget.value);I(g)}var G=Tt();Be("1fv2vo0",f=>{ze(()=>{Ge.title="Dream Cinema · Vestige"})});var L=r(G);Je(L,{icon:"dreams",title:"Dream Cinema",subtitle:"Scrub through Vestige's 5-stage consolidation cycle. Replay, cross-reference, strengthen, prune, transfer. Watch episodic become semantic.",accent:"dream",children:(f,g)=>{var y=Mt(),R=r(y);{var k=h=>{var M=kt();m(h,M)},H=h=>{var M=wt();m(h,M)};F(R,h=>{e(p)?h(k):e(Z)&&h(H,1)})}var S=l(R,2);let E;var T=r(S);{var X=h=>{var M=qt();U(2),m(h,M)},C=h=>{var M=St(),A=ge(M),w=r(A);ke(w,{name:"sparkle",size:16}),a(A),U(2),m(h,M)};F(T,h=>{e(p)?h(X):h(C,!1)})}a(S),ye(S,h=>{var M;return(M=Te)==null?void 0:M(h)}),a(y),N(()=>{S.disabled=e(p),E=we(S,1,"dream-button svelte-1fv2vo0",null,E,{"is-dreaming":e(p)})}),fe("click",S,ee),m(f,y)},$$slots:{default:!0}});var J=l(L,2);{var ne=f=>{var g=Rt(),y=r(g);ke(y,{name:"contradictions",size:16});var R=l(y,2),k=r(R,!0);a(R),a(g),ye(g,H=>{var S;return(S=Ee)==null?void 0:S(H)}),N(()=>b(k,e(q))),m(f,g)};F(J,f=>{e(q)&&f(ne)})}var se=l(J,2);{var ve=f=>{var g=Ct(),y=r(g),R=r(y);ke(R,{name:"dreams",size:52,draw:!0}),a(y);var k=l(y,6),H=r(k),S=r(H);ke(S,{name:"sparkle",size:16}),a(H),U(2),a(k),ye(k,E=>{var T;return(T=Te)==null?void 0:T(E)}),a(g),ye(g,E=>{var T;return(T=Ee)==null?void 0:T(E)}),fe("click",k,ee),m(f,g)},ie=f=>{var g=Et(),y=ge(g),R=r(y),k=r(R),H=r(k);a(k);var S=l(k,2),E=r(S),T=l(E,2);a(S),a(R);var X=l(R,2),C=r(X);Ye(C);var h=l(C,2);xe(h,22,()=>je,t=>t,(t,s,i)=>{var n=Dt();let u;var d=l(r(n),2),D=r(d);a(d),a(n),N(()=>{u=we(n,1,"tick svelte-1fv2vo0",null,u,{active:e(c)===e(i)+1,passed:e(c)>e(i)+1}),n.disabled=e(p),b(D,`${e(i)+1}. ${s??""}`)}),fe("click",n,()=>I(e(i)+1)),m(t,n)}),a(h),a(X),a(y);var M=l(y,2),A=r(M);pt(A,{get stage(){return e(c)},get dreamResult(){return e(P)}});var w=l(A,2),O=r(w),ae=l(r(O),2),oe=r(ae);a(ae),a(O);var ce=l(O,2),de=r(ce);{var Y=t=>{var s=Nt(),i=r(s);{var n=d=>{var D=Ie("Dreaming...");m(d,D)},u=d=>{var D=Ie("No insights generated this cycle.");m(d,D)};F(i,d=>{e(p)?d(n):d(u,!1)})}a(s),m(t,s)},V=t=>{var s=Fe(),i=ge(s);xe(i,19,()=>e($),(n,u)=>{var d;return u+"-"+(((d=n.insight)==null?void 0:d.slice(0,32))??"")},(n,u,d)=>{yt(n,{get insight(){return e(u)},get index(){return e(d)}})}),m(t,s)};F(de,t=>{e($).length===0?t(Y):t(V,!1)})}a(ce),a(w),a(M);var B=l(M,2);{var me=t=>{var s=It(),i=r(s),n=r(i),u=r(n,!0);a(n),U(2),a(i);var d=l(i,2),D=r(d),K=r(D,!0);a(D),U(2),a(d);var j=l(d,2),Q=r(j),ue=r(Q,!0);a(Q),U(2),a(j);var pe=l(j,2),be=r(pe),z=r(be,!0);a(be),U(2),a(pe);var Re=l(pe,2),Ce=r(Re),Oe=r(Ce,!0);a(Ce),U(2),a(Re),a(s),N(_e=>{var De,Ne;b(u,e(P).memoriesReplayed??0),b(K,((De=e(P).stats)==null?void 0:De.newConnectionsFound)??0),b(ue,e(P).connectionsPersisted??0),b(z,((Ne=e(P).stats)==null?void 0:Ne.insightsGenerated)??0),b(Oe,_e)},[()=>{var _e;return $e((_e=e(P).stats)==null?void 0:_e.durationMs)}]),m(t,s)};F(B,t=>{e(P)&&t(me)})}N(()=>{b(H,`Stage ${e(c)??""} · ${je[e(c)-1]??""}`),E.disabled=e(c)<=1||e(p),T.disabled=e(c)>=5||e(p),Ve(C,e(c)),C.disabled=e(p),b(oe,`${e($).length??""} total · by novelty`)}),fe("click",E,()=>I(e(c)-1)),fe("click",T,()=>I(e(c)+1)),fe("input",C,te),m(f,g)};F(se,f=>{!e(Z)&&!e(p)?f(ve):f(ie,!1)})}a(G),m(o,G),Me()}Ae(["click","input"]);export{Ut as component}; + `),b(y,e(p).num),b(H,e(p).name),b(E,e(p).desc),b(X,`Stage ${e(p).num??""} / 5`),re(C,`--stage-color: ${e(p).color??""}`),W(C,"aria-label",`Dream stage ${e(p).num??""} — ${e(p).name??""}`)}),m(o,ve),Me()}var gt=x(' novel'),xt=x(' '),bt=x(' '),_t=x('
                        Sources
                        '),ht=x('

                        Novelty
                        Confidence
                        ');function yt(o,v){Se(v,!0);let P=Xe(v,"index",3,0),c=_(()=>qe(v.insight.noveltyScore)),p=_(()=>qe(v.insight.confidence)),q=_(()=>Ze(v.insight.noveltyScore)),Z=_(()=>e(q)==="high"),$=_(()=>e(q)==="low"),ee=_(()=>st(v.insight.sourceMemories,2)),I=_(()=>at(v.insight.sourceMemories,2));const te={connection:"#818cf8",pattern:"#ec4899",contradiction:"#ef4444",synthesis:"#c084fc",emergence:"#f59e0b",cluster:"#06b6d4"};let A=_(()=>{var w;return te[((w=v.insight.type)==null?void 0:w.toLowerCase())??""]??"#a855f7"});var L=ht();let J;var ne=r(L),se=r(ne),ve=r(se,!0);a(se);var ie=l(se,2);{var f=w=>{var O=gt();m(w,O)};F(ie,w=>{e(Z)&&w(f)})}a(ne);var g=l(ne,2),y=r(g,!0);a(g);var R=l(g,2),k=r(R),H=l(r(k),2),S=r(H,!0);a(H),a(k);var E=l(k,2),T=r(E);a(E),a(R);var X=l(R,2),C=l(r(X),2),h=r(C,!0);a(C),a(X);var M=l(X,2);{var G=w=>{var O=_t(),ae=r(O),oe=l(r(ae));{var ce=Y=>{var V=xt(),B=r(V);a(V),N(()=>b(B,`(+${e(I)??""})`)),m(Y,V)};F(oe,Y=>{e(I)>0&&Y(ce)})}a(ae);var de=l(ae,2);xe(de,20,()=>e(ee),Y=>Y,(Y,V)=>{var B=bt(),me=r(B,!0);a(B),N((t,s)=>{W(B,"href",t),W(B,"title",`Open memory ${V??""}`),b(me,s)},[()=>tt(V,Ue),()=>rt(V)]),m(Y,B)}),a(de),a(O),m(w,O)};F(M,w=>{e(ee).length>0&&w(G)})}a(L),N((w,O)=>{J=we(L,1,"insight-card glass-panel rounded-xl p-4 space-y-3 svelte-1y17hsl",null,J,{"high-novelty":e(Z),"low-novelty":e($)}),re(L,`--insight-color: ${e(A)??""}; --enter-delay: ${P()*60}ms`),re(se,`background: ${e(A)??""}22; color: ${e(A)??""}; border: 1px solid ${e(A)??""}55`),b(ve,v.insight.type??"insight"),b(y,v.insight.insight),b(S,w),re(T,`width: ${e(c)*100}%; background: linear-gradient(90deg, ${e(A)??""}, var(--color-dream-glow))`),re(C,`color: ${e(p)>.7?"#10b981":e(p)>.4?"#f59e0b":"#ef4444"}`),b(h,O)},[()=>e(c).toFixed(2),()=>et(e(p))]),m(o,L),Me()}var kt=x(' Consolidating'),wt=x(' Cycle complete'),qt=x(' Dreaming...',1),St=x(' Dream Now',1),Mt=x('
                        '),Rt=x('
                        '),Ct=x(`

                        Nothing's been dreamt yet.

                        Run a consolidation cycle and watch your episodic memories replay, + cross-reference, and crystallize into lasting semantic knowledge.

                        `),Dt=x(''),Nt=x('
                        '),It=x('
                        Replayed
                        Connections Found
                        Connections Persisted
                        Insights
                        Duration
                        '),Et=x('
                        ',1),Tt=x('
                        ');function Ut(o,v){Se(v,!0);let P=he(null),c=he(1),p=he(!1),q=he(null),Z=_(()=>e(P)!==null),$=_(()=>{const f=e(P);return f?[...f.insights].sort((g,y)=>(y.noveltyScore??0)-(g.noveltyScore??0)):[]});async function ee(){if(!e(p)){le(p,!0),le(q,null);try{const f=await We.dream();le(P,f,!0),le(c,1)}catch(f){le(q,f instanceof Error?f.message:"Dream failed",!0)}finally{le(p,!1)}}}function I(f){le(c,He(f),!0)}function te(f){const g=Number(f.currentTarget.value);I(g)}var A=Tt();Be("1fv2vo0",f=>{ze(()=>{Ae.title="Dream Cinema · Vestige"})});var L=r(A);Je(L,{icon:"dreams",title:"Dream Cinema",subtitle:"Scrub through Vestige's 5-stage consolidation cycle. Replay, cross-reference, strengthen, prune, transfer. Watch episodic become semantic.",accent:"dream",children:(f,g)=>{var y=Mt(),R=r(y);{var k=h=>{var M=kt();m(h,M)},H=h=>{var M=wt();m(h,M)};F(R,h=>{e(p)?h(k):e(Z)&&h(H,1)})}var S=l(R,2);let E;var T=r(S);{var X=h=>{var M=qt();U(2),m(h,M)},C=h=>{var M=St(),G=ge(M),w=r(G);ke(w,{name:"sparkle",size:16}),a(G),U(2),m(h,M)};F(T,h=>{e(p)?h(X):h(C,!1)})}a(S),ye(S,h=>{var M;return(M=Te)==null?void 0:M(h)}),a(y),N(()=>{S.disabled=e(p),E=we(S,1,"dream-button svelte-1fv2vo0",null,E,{"is-dreaming":e(p)})}),fe("click",S,ee),m(f,y)},$$slots:{default:!0}});var J=l(L,2);{var ne=f=>{var g=Rt(),y=r(g);ke(y,{name:"contradictions",size:16});var R=l(y,2),k=r(R,!0);a(R),a(g),ye(g,H=>{var S;return(S=Ee)==null?void 0:S(H)}),N(()=>b(k,e(q))),m(f,g)};F(J,f=>{e(q)&&f(ne)})}var se=l(J,2);{var ve=f=>{var g=Ct(),y=r(g),R=r(y);ke(R,{name:"dreams",size:52,draw:!0}),a(y);var k=l(y,6),H=r(k),S=r(H);ke(S,{name:"sparkle",size:16}),a(H),U(2),a(k),ye(k,E=>{var T;return(T=Te)==null?void 0:T(E)}),a(g),ye(g,E=>{var T;return(T=Ee)==null?void 0:T(E)}),fe("click",k,ee),m(f,g)},ie=f=>{var g=Et(),y=ge(g),R=r(y),k=r(R),H=r(k);a(k);var S=l(k,2),E=r(S),T=l(E,2);a(S),a(R);var X=l(R,2),C=r(X);Ye(C);var h=l(C,2);xe(h,22,()=>je,t=>t,(t,s,i)=>{var n=Dt();let u;var d=l(r(n),2),D=r(d);a(d),a(n),N(()=>{u=we(n,1,"tick svelte-1fv2vo0",null,u,{active:e(c)===e(i)+1,passed:e(c)>e(i)+1}),n.disabled=e(p),b(D,`${e(i)+1}. ${s??""}`)}),fe("click",n,()=>I(e(i)+1)),m(t,n)}),a(h),a(X),a(y);var M=l(y,2),G=r(M);pt(G,{get stage(){return e(c)},get dreamResult(){return e(P)}});var w=l(G,2),O=r(w),ae=l(r(O),2),oe=r(ae);a(ae),a(O);var ce=l(O,2),de=r(ce);{var Y=t=>{var s=Nt(),i=r(s);{var n=d=>{var D=Ie("Dreaming...");m(d,D)},u=d=>{var D=Ie("No insights generated this cycle.");m(d,D)};F(i,d=>{e(p)?d(n):d(u,!1)})}a(s),m(t,s)},V=t=>{var s=Fe(),i=ge(s);xe(i,19,()=>e($),(n,u)=>{var d;return u+"-"+(((d=n.insight)==null?void 0:d.slice(0,32))??"")},(n,u,d)=>{yt(n,{get insight(){return e(u)},get index(){return e(d)}})}),m(t,s)};F(de,t=>{e($).length===0?t(Y):t(V,!1)})}a(ce),a(w),a(M);var B=l(M,2);{var me=t=>{var s=It(),i=r(s),n=r(i),u=r(n,!0);a(n),U(2),a(i);var d=l(i,2),D=r(d),K=r(D,!0);a(D),U(2),a(d);var j=l(d,2),Q=r(j),ue=r(Q,!0);a(Q),U(2),a(j);var pe=l(j,2),be=r(pe),z=r(be,!0);a(be),U(2),a(pe);var Re=l(pe,2),Ce=r(Re),Oe=r(Ce,!0);a(Ce),U(2),a(Re),a(s),N(_e=>{var De,Ne;b(u,e(P).memoriesReplayed??0),b(K,((De=e(P).stats)==null?void 0:De.newConnectionsFound)??0),b(ue,e(P).connectionsPersisted??0),b(z,((Ne=e(P).stats)==null?void 0:Ne.insightsGenerated)??0),b(Oe,_e)},[()=>{var _e;return $e((_e=e(P).stats)==null?void 0:_e.durationMs)}]),m(t,s)};F(B,t=>{e(P)&&t(me)})}N(()=>{b(H,`Stage ${e(c)??""} · ${je[e(c)-1]??""}`),E.disabled=e(c)<=1||e(p),T.disabled=e(c)>=5||e(p),Ve(C,e(c)),C.disabled=e(p),b(oe,`${e($).length??""} total · by novelty`)}),fe("click",E,()=>I(e(c)-1)),fe("click",T,()=>I(e(c)+1)),fe("input",C,te),m(f,g)};F(se,f=>{!e(Z)&&!e(p)?f(ve):f(ie,!1)})}a(A),m(o,A),Me()}Ge(["click","input"]);export{Ut as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js.br b/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js.br new file mode 100644 index 0000000..fe1c90c Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js.gz b/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js.gz new file mode 100644 index 0000000..40e3e93 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/7.DomAssdT.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js.br b/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js.br deleted file mode 100644 index e98fae1..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js.gz b/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js.gz deleted file mode 100644 index 328c4e4..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/7.yWYTsQ1Q.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js b/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js new file mode 100644 index 0000000..84be3dd --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js @@ -0,0 +1,3 @@ +import"../chunks/Bzak7iHL.js";import{o as Fe,a as Ee}from"../chunks/JVtQszIZ.js";import{p as De,c as Ie,f as Ne,g as e,a as u,b as Ae,u as B,e as i,r,h as l,t as N,i as D,j as p,s as Y,d as _e,n as me}from"../chunks/CW7md74C.js";import{d as Me,s as x,a as q}from"../chunks/D90q9c2i.js";import{i as O}from"../chunks/9-jplUL5.js";import{e as oe,i as Se,s as ge,a as ne,r as Le}from"../chunks/Cc0l8Nd4.js";import{a as ye,r as Pe}from"../chunks/D8RjhgN0.js";import{b as je}from"../chunks/CFefTDKL.js";import{s as le}from"../chunks/BNUnVJrY.js";import{N as Be}from"../chunks/CcUbQ_Wl.js";import{P as Oe}from"../chunks/DTO0IjuV.js";import{I as We}from"../chunks/CqwrgJOn.js";import{A as we}from"../chunks/CaR6YsRq.js";import{s as ze}from"../chunks/DPdYG9yN.js";import{a as He}from"../chunks/C-rZhKee.js";function Te(n){return n>=.92?"near-identical":n>=.8?"strong":"weak"}function be(n){const a=Te(n);return a==="near-identical"?"var(--color-decay)":a==="strong"?"var(--color-warning)":"#fde047"}function Ke(n){const a=Te(n);return a==="near-identical"?"Near-identical":a==="strong"?"Strong match":"Weak match"}function Ue(n){return n>.7?"#10b981":n>.4?"#f59e0b":"#ef4444"}function Ye(n){if(!n||n.length===0)return null;let a=n[0],c=Number.isFinite(a.retention)?a.retention:-1/0;for(let f=1;fc&&(a=y,c=k)}return a}function ke(n){return n.map(a=>a.id).slice().sort().join("|")}function qe(n,a=80){if(!n)return"";const c=n.trim().replace(/\s+/g," ");return c.length<=a?c:c.slice(0,a)+"…"}function Ce(n){if(!n||typeof n!="string")return"";const a=new Date(n);return Number.isNaN(a.getTime())?"":a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Ge(n,a=4){return Array.isArray(n)?n.slice(0,a):[]}var Je=p('WINNER'),Qe=p(' '),Ve=p('
                        '),Xe=p('

                        '),Ze=p(''),$e=p('
                        ');function et(n,a){De(a,!0);let c=Y(!1);const f=B(()=>Ye(a.memories)),y=B(()=>e(f)?a.memories.filter(A=>A.id!==e(f).id).map(A=>A.id):[]);function k(){a.onMerge&&e(f)&&a.onMerge(e(f).id,e(y))}var S=Ie(),G=Ne(S);{var W=A=>{var J=$e(),_=i(J),z=i(_),H=i(z),I=i(H),de=i(I);r(I);var L=l(I,2),ee=i(L,!0);r(L);var K=l(L,2),Q=i(K);r(K),r(H);var T=l(H,2),te=i(T);r(T),r(z);var V=l(z,2),X=i(V);r(V),r(_);var Z=l(_,2);oe(Z,21,()=>a.memories,b=>b.id,(b,d)=>{var C=Xe(),t=i(C),s=l(t,2),o=i(s),v=i(o),h=i(v,!0);r(v);var m=l(v,2);{var g=w=>{var M=Je();u(w,M)};O(m,w=>{e(d).id===e(f).id&&w(g)})}var $=l(m,2);oe($,17,()=>Ge(e(d).tags,4),Se,(w,M)=>{var j=Qe(),xe=i(j,!0);r(j),N(()=>x(xe,e(M))),u(w,j)}),r(o);var F=l(o,2),pe=i(F,!0);r(F);var P=l(F,2);{var se=w=>{var M=Ve(),j=i(M,!0);r(M),N(xe=>x(j,xe),[()=>Ce(e(d).createdAt)]),u(w,M)},fe=B(()=>Ce(e(d).createdAt));O(P,w=>{e(fe)&&w(se)})}r(s);var U=l(s,2),E=i(U),ie=i(E);r(E);var he=l(E,2),Re=i(he);r(he),r(U),r(C),N((w,M,j)=>{ge(C,1,`group flex items-start gap-3 rounded-xl border border-synapse/5 bg-white/[0.02] p-3 transition-all duration-200 hover:border-synapse/20 hover:bg-white/[0.04] ${e(d).id===e(f).id?"ring-1 ring-recall/30":""}`),le(t,`background: ${(Be[e(d).nodeType]||"#8B95A5")??""}`),ne(t,"title",e(d).nodeType),x(h,e(d).nodeType),ge(F,1,`text-sm text-text leading-relaxed ${e(c)?"whitespace-pre-wrap":""}`),x(pe,w),le(ie,`width: ${e(d).retention*100}%; background: ${M??""}`),x(Re,`${j??""}%`)},[()=>e(c)?e(d).content:qe(e(d).content),()=>Ue(e(d).retention),()=>(e(d).retention*100).toFixed(0)]),u(b,C)}),r(Z);var ae=l(Z,2),re=i(ae);{var ve=b=>{var d=Ze();N(C=>ne(d,"title",`Merge all into highest-retention memory (${C??""}%)`),[()=>(e(f).retention*100).toFixed(0)]),q("click",d,k),u(b,d)};O(re,b=>{a.onMerge&&b(ve)})}var R=l(re,2),ce=i(R,!0);r(R);var ue=l(R,2);r(ae),r(J),N((b,d,C,t,s,o,v)=>{le(I,`color: ${b??""}`),x(de,`${d??""}%`),x(ee,C),x(Q,`· ${a.memories.length??""} memories`),ne(T,"aria-valuenow",t),le(te,`width: ${s??""}%; background: ${o??""}; box-shadow: 0 0 12px ${v??""}66`),ge(V,1,`flex-shrink-0 rounded-full border px-3 py-1 text-xs font-medium ${a.suggestedAction==="merge"?"border-recall/40 bg-recall/10 text-recall":"border-dream-glow/40 bg-dream/10 text-dream-glow"}`),x(X,`Suggested: ${a.suggestedAction==="merge"?"Merge":"Review"}`),ne(R,"aria-expanded",e(c)),x(ce,e(c)?"Collapse":"Review")},[()=>be(a.similarity),()=>(a.similarity*100).toFixed(1),()=>Ke(a.similarity),()=>Math.round(a.similarity*100),()=>(a.similarity*100).toFixed(1),()=>be(a.similarity),()=>be(a.similarity)]),q("click",R,()=>D(c,!e(c))),q("click",ue,function(...b){var d;(d=a.onDismiss)==null||d.apply(this,b)}),u(A,J)};O(G,A=>{a.memories.length>0&&e(f)&&A(W)})}u(n,S),Ae()}Me(["click"]);var tt=p(' Live',1),at=p(' Detecting…',1),rt=p(' Error',1),st=p(' ',1),it=p(`
                        Couldn't detect duplicates
                        `),nt=p('
                        '),lt=p('
                        '),ot=p('
                        No duplicates found — your memory is clean.
                        '),dt=p('
                        '),vt=p('
                        '),ct=p('
                        '),ut=p('
                        ');function Mt(n,a){De(a,!0);let c=Y(.8),f=Y(_e([])),y=Y(_e(new Set)),k=Y(!0),S=Y(null),G;async function W(){D(k,!0),D(S,null);try{const t=await He.duplicates(e(c));D(f,t.clusters,!0);const s=new Set(e(f).map(v=>ke(v.memories))),o=new Set;for(const v of e(y))s.has(v)&&o.add(v);D(y,o,!0)}catch(t){D(S,t instanceof Error?t.message:"Failed to detect duplicates",!0),D(f,[],!0)}finally{D(k,!1)}}function A(){clearTimeout(G),G=setTimeout(W,250)}function J(t){const s=new Set(e(y));s.add(t),D(y,s,!0)}const _=B(()=>e(f).map(t=>({c:t,key:ke(t.memories)})).filter(({key:t})=>!e(y).has(t))),z=B(()=>e(_).reduce((t,{c:s})=>t+s.memories.length,0)),H=50,I=B(()=>e(_).length>H),de=B(()=>e(I)?e(_).slice(0,H):e(_));Fe(()=>W()),Ee(()=>clearTimeout(G));var L=ut(),ee=i(L);Oe(ee,{icon:"duplicates",title:"Memory Hygiene — Duplicate Detection",subtitle:"Cosine-similarity clustering over embeddings. Inspect each cluster, expand to review, and dismiss false positives (hidden for this session only). To actually merge a cluster, run the MCP dedup tool — it keeps the highest-retention winner.",accent:"synapse",children:(t,s)=>{var o=tt();me(2),u(t,o)},$$slots:{default:!0}});var K=l(ee,2),Q=i(K),T=l(i(Q),2);Le(T);var te=l(T,2),V=i(te);r(te),r(Q);var X=l(Q,2),Z=i(X);{var ae=t=>{var s=at();me(2),u(t,s)},re=t=>{var s=rt();me(2),u(t,s)},ve=t=>{var s=st(),o=l(Ne(s),2),v=i(o);we(v,{get value(){return e(_).length}});var h=l(v),m=l(h);we(m,{get value(){return e(z)}});var g=l(m);r(o),N(()=>{x(h,` ${e(_).length===1?"cluster":"clusters"}, `),x(g,` potential duplicate${e(z)===1?"":"s"}`)}),u(t,s)};O(Z,t=>{e(k)?t(ae):e(S)?t(re,1):t(ve,!1)})}r(X);var R=l(X,2);r(K);var ce=l(K,2);{var ue=t=>{var s=it(),o=l(i(s),2),v=i(o,!0);r(o);var h=l(o,2);r(s),N(()=>x(v,e(S))),q("click",h,W),u(t,s)},b=t=>{var s=lt();oe(s,20,()=>Array(3),Se,(o,v)=>{var h=nt();u(o,h)}),r(s),u(t,s)},d=t=>{var s=ot(),o=i(s),v=i(o);We(v,{name:"sparkle",size:26,draw:!0}),r(o);var h=l(o,4),m=i(h);r(h),r(s),N(g=>x(m,`Nothing clusters above ${g??""}% similarity. Lower the threshold to + surface looser matches.`),[()=>(e(c)*100).toFixed(0)]),u(t,s)},C=t=>{var s=ct(),o=i(s);{var v=m=>{var g=dt(),$=i(g);r(g),N(()=>x($,`Showing first 50 of ${e(_).length??""} clusters. Raise the + threshold to narrow results.`)),u(m,g)};O(o,m=>{e(I)&&m(v)})}var h=l(o,2);oe(h,19,()=>e(de),({c:m,key:g})=>g,(m,g,$)=>{let F=()=>e(g).c,pe=()=>e(g).key;var P=vt(),se=i(P),fe=i(se);et(fe,{get similarity(){return F().similarity},get memories(){return F().memories},get suggestedAction(){return F().suggestedAction},onDismiss:()=>J(pe())}),r(se),r(P),ye(P,(U,E)=>{var ie;return(ie=Pe)==null?void 0:ie(U,E)},()=>({delay:Math.min(e($)*40,400),y:14})),ye(P,U=>{var E;return(E=ze)==null?void 0:E(U)}),u(m,P)}),r(s),u(t,s)};O(ce,t=>{e(S)?t(ue):e(k)?t(b,1):e(_).length===0?t(d,2):t(C,!1)})}r(L),N(t=>{x(V,`${t??""}%`),R.disabled=e(k)},[()=>(e(c)*100).toFixed(0)]),q("input",T,A),je(T,()=>e(c),t=>D(c,t)),q("click",R,W),u(n,L),Ae()}Me(["input","click"]);export{Mt as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js.br b/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js.br new file mode 100644 index 0000000..ff8e6e2 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js.gz b/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js.gz new file mode 100644 index 0000000..73d0943 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/8.BAXaOae9.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js b/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js deleted file mode 100644 index 1d60119..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js +++ /dev/null @@ -1,3 +0,0 @@ -import"../chunks/Bzak7iHL.js";import{o as Re,a as Fe}from"../chunks/TZu9D97Z.js";import{p as Ae,c as Ne,f as De,g as e,a as u,b as Me,u as O,e as s,r,h as o,t as M,i as A,j as m,s as V,d as ye,n as xe}from"../chunks/wpu9U-D0.js";import{d as Ce,s as f,a as X}from"../chunks/D8mhvFt8.js";import{i as Y}from"../chunks/DKve45Wd.js";import{e as ce,i as Se,s as he,a as le,r as Pe}from"../chunks/60_R_Vbt.js";import{a as _e,r as Ze}from"../chunks/P1-U_Xsj.js";import{b as Ee}from"../chunks/CnZzd20v.js";import{s as de}from"../chunks/EqHb-9AZ.js";import{N as Ie}from"../chunks/CcUbQ_Wl.js";import{P as Be}from"../chunks/BHDZZvku.js";import{I as je}from"../chunks/D7A-gG4Z.js";import{A as we}from"../chunks/DcKTNC6e.js";import{s as He}from"../chunks/DPdYG9yN.js";function Le(n){return n>=.92?"near-identical":n>=.8?"strong":"weak"}function be(n){const a=Le(n);return a==="near-identical"?"var(--color-decay)":a==="strong"?"var(--color-warning)":"#fde047"}function Oe(n){const a=Le(n);return a==="near-identical"?"Near-identical":a==="strong"?"Strong match":"Weak match"}function ze(n){return n>.7?"#10b981":n>.4?"#f59e0b":"#ef4444"}function Ue(n){if(!n||n.length===0)return null;let a=n[0],d=Number.isFinite(a.retention)?a.retention:-1/0;for(let v=1;vd&&(a=w,d=k)}return a}function We(n,a){return n.filter(d=>d.similarity>=a)}function ke(n){return n.map(a=>a.id).slice().sort().join("|")}function Ke(n,a=80){if(!n)return"";const d=n.trim().replace(/\s+/g," ");return d.length<=a?d:d.slice(0,a)+"…"}function Te(n){if(!n||typeof n!="string")return"";const a=new Date(n);return Number.isNaN(a.getTime())?"":a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Ge(n,a=4){return Array.isArray(n)?n.slice(0,a):[]}var Ve=m('WINNER'),Xe=m(' '),Ye=m('
                        '),qe=m('

                        '),Je=m('
                        ');function Qe(n,a){Ae(a,!0);let d=V(!1);const v=O(()=>Ue(a.memories)),w=O(()=>e(v)?a.memories.filter(y=>y.id!==e(v).id).map(y=>y.id):[]);function k(){a.onMerge&&e(v)&&a.onMerge(e(v).id,e(w))}var C=Ne(),q=De(C);{var ue=y=>{var J=Je(),z=s(J),Q=s(z),_=s(Q),P=s(_),ie=s(P);r(P);var U=o(P,2),ve=s(U,!0);r(U);var W=o(U,2),se=s(W);r(W),r(_);var Z=o(_,2),$=s(Z);r(Z),r(Q);var S=o(Q,2),ne=s(S);r(S),r(z);var ee=o(z,2);ce(ee,21,()=>a.memories,T=>T.id,(T,c)=>{var L=qe(),I=s(L),B=o(I,2),j=s(B),t=s(j),i=s(t,!0);r(t);var l=o(t,2);{var p=h=>{var D=Ve();u(h,D)};Y(l,h=>{e(c).id===e(v).id&&h(p)})}var b=o(l,2);ce(b,17,()=>Ge(e(c).tags,4),Se,(h,D)=>{var H=Xe(),fe=s(H,!0);r(H),M(()=>f(fe,e(D))),u(h,H)}),r(j);var g=o(j,2),x=s(g,!0);r(g);var ae=o(g,2);{var re=h=>{var D=Ye(),H=s(D,!0);r(D),M(fe=>f(H,fe),[()=>Te(e(c).createdAt)]),u(h,D)},oe=O(()=>Te(e(c).createdAt));Y(ae,h=>{e(oe)&&h(re)})}r(B);var R=o(B,2),G=s(R),ge=s(G);r(G);var F=o(G,2),N=s(F);r(F),r(R),r(L),M((h,D,H)=>{he(L,1,`group flex items-start gap-3 rounded-xl border border-synapse/5 bg-white/[0.02] p-3 transition-all duration-200 hover:border-synapse/20 hover:bg-white/[0.04] ${e(c).id===e(v).id?"ring-1 ring-recall/30":""}`),de(I,`background: ${(Ie[e(c).nodeType]||"#8B95A5")??""}`),le(I,"title",e(c).nodeType),f(i,e(c).nodeType),he(g,1,`text-sm text-text leading-relaxed ${e(d)?"whitespace-pre-wrap":""}`),f(x,h),de(ge,`width: ${e(c).retention*100}%; background: ${D??""}`),f(N,`${H??""}%`)},[()=>e(d)?e(c).content:Ke(e(c).content),()=>ze(e(c).retention),()=>(e(c).retention*100).toFixed(0)]),u(T,L)}),r(ee);var K=o(ee,2),te=s(K),E=o(te,2),me=s(E,!0);r(E);var pe=o(E,2);r(K),r(J),M((T,c,L,I,B,j,t,i)=>{de(P,`color: ${T??""}`),f(ie,`${c??""}%`),f(ve,L),f(se,`· ${a.memories.length??""} memories`),le(Z,"aria-valuenow",I),de($,`width: ${B??""}%; background: ${j??""}; box-shadow: 0 0 12px ${t??""}66`),he(S,1,`flex-shrink-0 rounded-full border px-3 py-1 text-xs font-medium ${a.suggestedAction==="merge"?"border-recall/40 bg-recall/10 text-recall":"border-dream-glow/40 bg-dream/10 text-dream-glow"}`),f(ne,`Suggested: ${a.suggestedAction==="merge"?"Merge":"Review"}`),le(te,"title",`Merge all into highest-retention memory (${i??""}%)`),le(E,"aria-expanded",e(d)),f(me,e(d)?"Collapse":"Review")},[()=>be(a.similarity),()=>(a.similarity*100).toFixed(1),()=>Oe(a.similarity),()=>Math.round(a.similarity*100),()=>(a.similarity*100).toFixed(1),()=>be(a.similarity),()=>be(a.similarity),()=>(e(v).retention*100).toFixed(0)]),X("click",te,k),X("click",E,()=>A(d,!e(d))),X("click",pe,function(...T){var c;(c=a.onDismiss)==null||c.apply(this,T)}),u(y,J)};Y(q,y=>{a.memories.length>0&&e(v)&&y(ue)})}u(n,C),Me()}Ce(["click"]);var $e=m(' Live',1),et=m(' Detecting…',1),tt=m(' Error',1),at=m(' ',1),rt=m(`
                        Couldn't detect duplicates
                        `),it=m('
                        '),st=m('
                        '),nt=m('
                        No duplicates found — your memory is clean.
                        '),ot=m('
                        '),lt=m('
                        '),dt=m('
                        '),ct=m('
                        ');function At(n,a){Ae(a,!0);let d=V(.8),v=V(ye([])),w=V(ye(new Set)),k=V(!0),C=V(null),q;async function ue(t){return await new Promise(l=>setTimeout(l,450)),{clusters:We([{similarity:.96,suggestedAction:"merge",memories:[{id:"m-001",content:"BUG FIX: Harmony parser dropped `final` channel tokens when tool call followed. Root cause: 5-layer fallback missed the final channel marker when channel switched mid-stream. Solution: added final-channel detector before tool-call pop. Files: src/parser/harmony.rs",nodeType:"fact",tags:["bug-fix","benchmark-suite","parser"],retention:.91,createdAt:"2026-04-12T14:22:00Z"},{id:"m-002",content:"Fixed Harmony parser final-channel bug — 5-layer fallback was missing the final channel marker when a tool call followed. Added detector before tool pop.",nodeType:"fact",tags:["bug-fix","benchmark-suite"],retention:.64,createdAt:"2026-04-13T09:15:00Z"},{id:"m-003",content:"Harmony parser: final channel dropped on tool-call. Patched the fallback stack.",nodeType:"note",tags:["parser"],retention:.38,createdAt:"2026-04-14T11:02:00Z"}]},{similarity:.88,suggestedAction:"merge",memories:[{id:"m-004",content:"DECISION: Use vLLM prefix caching at 0.35 gpu_memory_utilization for benchmark suite submissions. Alternatives considered: sglang (slower cold start), TensorRT-LLM (deployment friction).",nodeType:"decision",tags:["vllm","benchmark-suite","inference"],retention:.84,createdAt:"2026-04-05T18:44:00Z"},{id:"m-005",content:"Chose vLLM with prefix caching (0.35 mem util) over sglang and TensorRT-LLM for benchmark suite inference.",nodeType:"decision",tags:["vllm","benchmark-suite"],retention:.72,createdAt:"2026-04-06T10:30:00Z"}]},{similarity:.83,suggestedAction:"review",memories:[{id:"m-006",content:"Release process prefers one change per benchmark submission — stacking changes destroyed signal in a prior run.",nodeType:"pattern",tags:["methodology","benchmark-suite"],retention:.88,createdAt:"2026-04-04T22:10:00Z"},{id:"m-007",content:"One-variable-at-a-time rule: never stack multiple changes per submission. Paper 2603.27844 proves +/-2 points is noise.",nodeType:"pattern",tags:["kaggle","methodology"],retention:.67,createdAt:"2026-04-08T16:20:00Z"},{id:"m-008",content:"Lesson: stacking many changes in one benchmark run hid the causal signal. Always isolate variables.",nodeType:"note",tags:["methodology"],retention:.42,createdAt:"2026-04-15T08:55:00Z"}]},{similarity:.78,suggestedAction:"review",memories:[{id:"m-009",content:"Dimensional Illusion performance: 7-minute flow poi set, LED config Parthenos overcook preset, tempo 128 BPM.",nodeType:"event",tags:["dimensional-illusion","poi","performance"],retention:.76,createdAt:"2026-03-28T19:45:00Z"},{id:"m-010",content:"Dimensional Illusion set: 7 min, Parthenos LED overcook, 128 BPM.",nodeType:"event",tags:["dimensional-illusion","poi"],retention:.51,createdAt:"2026-04-02T12:12:00Z"}]},{similarity:.76,suggestedAction:"review",memories:[{id:"m-011",content:"Vestige v2.0.7 shipped active forgetting via Anderson 2025 top-down inhibition + Davis Rac1 cascade. Suppress compounds, reversible 24h.",nodeType:"fact",tags:["vestige","release","active-forgetting"],retention:.93,createdAt:"2026-04-17T03:22:00Z"},{id:"m-012",content:"Active Forgetting feature: compounds on each suppress, 24h reversible labile window, violet implosion animation in graph view.",nodeType:"concept",tags:["vestige","active-forgetting"],retention:.81,createdAt:"2026-04-18T09:07:00Z"}]}],t)}}async function y(){A(k,!0),A(C,null);try{const t=await ue(e(d));A(v,t.clusters,!0);const i=new Set(e(v).map(p=>ke(p.memories))),l=new Set;for(const p of e(w))i.has(p)&&l.add(p);A(w,l,!0)}catch(t){A(C,t instanceof Error?t.message:"Failed to detect duplicates",!0),A(v,[],!0)}finally{A(k,!1)}}function J(){clearTimeout(q),q=setTimeout(y,250)}function z(t){const i=new Set(e(w));i.add(t),A(w,i,!0)}function Q(t,i,l){console.log("Merge cluster",t,{winnerId:i,loserIds:l}),z(t)}const _=O(()=>e(v).map(t=>({c:t,key:ke(t.memories)})).filter(({key:t})=>!e(w).has(t))),P=O(()=>e(_).reduce((t,{c:i})=>t+i.memories.length,0)),ie=50,U=O(()=>e(_).length>ie),ve=O(()=>e(U)?e(_).slice(0,ie):e(_));Re(()=>y()),Fe(()=>clearTimeout(q));var W=ct(),se=s(W);Be(se,{icon:"duplicates",title:"Memory Hygiene — Duplicate Detection",subtitle:"Cosine-similarity clustering over embeddings. Merges reinforce the winner's FSRS state; losers inherit into the merged node. Dismissed clusters are hidden for this session only.",accent:"synapse",children:(t,i)=>{var l=$e();xe(2),u(t,l)},$$slots:{default:!0}});var Z=o(se,2),$=s(Z),S=o(s($),2);Pe(S);var ne=o(S,2),ee=s(ne);r(ne),r($);var K=o($,2),te=s(K);{var E=t=>{var i=et();xe(2),u(t,i)},me=t=>{var i=tt();xe(2),u(t,i)},pe=t=>{var i=at(),l=o(De(i),2),p=s(l);we(p,{get value(){return e(_).length}});var b=o(p),g=o(b);we(g,{get value(){return e(P)}});var x=o(g);r(l),M(()=>{f(b,` ${e(_).length===1?"cluster":"clusters"}, `),f(x,` potential duplicate${e(P)===1?"":"s"}`)}),u(t,i)};Y(te,t=>{e(k)?t(E):e(C)?t(me,1):t(pe,!1)})}r(K);var T=o(K,2);r(Z);var c=o(Z,2);{var L=t=>{var i=rt(),l=o(s(i),2),p=s(l,!0);r(l);var b=o(l,2);r(i),M(()=>f(p,e(C))),X("click",b,y),u(t,i)},I=t=>{var i=st();ce(i,20,()=>Array(3),Se,(l,p)=>{var b=it();u(l,b)}),r(i),u(t,i)},B=t=>{var i=nt(),l=s(i),p=s(l);je(p,{name:"sparkle",size:26,draw:!0}),r(l);var b=o(l,4),g=s(b);r(b),r(i),M(x=>f(g,`Nothing clusters above ${x??""}% similarity. Lower the threshold to - surface looser matches.`),[()=>(e(d)*100).toFixed(0)]),u(t,i)},j=t=>{var i=dt(),l=s(i);{var p=g=>{var x=ot(),ae=s(x);r(x),M(()=>f(ae,`Showing first 50 of ${e(_).length??""} clusters. Raise the - threshold to narrow results.`)),u(g,x)};Y(l,g=>{e(U)&&g(p)})}var b=o(l,2);ce(b,19,()=>e(ve),({c:g,key:x})=>x,(g,x,ae)=>{let re=()=>e(x).c,oe=()=>e(x).key;var R=lt(),G=s(R),ge=s(G);Qe(ge,{get similarity(){return re().similarity},get memories(){return re().memories},get suggestedAction(){return re().suggestedAction},onDismiss:()=>z(oe()),onMerge:(F,N)=>Q(oe(),F,N)}),r(G),r(R),_e(R,(F,N)=>{var h;return(h=Ze)==null?void 0:h(F,N)},()=>({delay:Math.min(e(ae)*40,400),y:14})),_e(R,F=>{var N;return(N=He)==null?void 0:N(F)}),u(g,R)}),r(i),u(t,i)};Y(c,t=>{e(C)?t(L):e(k)?t(I,1):e(_).length===0?t(B,2):t(j,!1)})}r(W),M(t=>{f(ee,`${t??""}%`),T.disabled=e(k)},[()=>(e(d)*100).toFixed(0)]),X("input",S,J),Ee(S,()=>e(d),t=>A(d,t)),X("click",T,y),u(n,W),Me()}Ce(["input","click"]);export{At as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js.br b/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js.br deleted file mode 100644 index 32163d9..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js.gz b/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js.gz deleted file mode 100644 index deb4cf4..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/8.D5dP0-E2.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js.br b/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js.br deleted file mode 100644 index 6c8cc49..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js.gz b/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js.gz deleted file mode 100644 index b4a338b..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js b/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js similarity index 95% rename from apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js rename to apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js index b927b0e..92915ab 100644 --- a/apps/dashboard/build/_app/immutable/nodes/9.Vz-x3Q_x.js +++ b/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js @@ -1,4 +1,4 @@ -import"../chunks/Bzak7iHL.js";import{p as Ue,s as j,d as Ve,g as e,a as v,b as Ge,e as a,h as r,i as h,j as _,r as t,n as ke,k as Je,t as k,f as Se,c as Le,u as de,l as We,m as Te}from"../chunks/wpu9U-D0.js";import{d as Xe,a as B,s as p}from"../chunks/D8mhvFt8.js";import{i as $}from"../chunks/DKve45Wd.js";import{e as W,i as X,r as Fe,s as Y}from"../chunks/60_R_Vbt.js";import{a as $e,r as Ye}from"../chunks/P1-U_Xsj.js";import{s as le}from"../chunks/EqHb-9AZ.js";import{b as ve}from"../chunks/CnZzd20v.js";import{a as Z}from"../chunks/CZfHMhLI.js";import{P as Ze}from"../chunks/BHDZZvku.js";import{I as ee}from"../chunks/D7A-gG4Z.js";import{A as Ne}from"../chunks/DcKTNC6e.js";import{s as et}from"../chunks/DPdYG9yN.js";var tt=_(''),at=_('
                        Source

                        '),rt=_('
                        Target

                        '),st=_(`
                        Target Memory
                        '),at=_('
                        Source

                        '),rt=_('
                        Target

                        '),st=_(`
                        Target Memory
                        `,1),it=_('
                        '),nt=_('
                        '),ot=_(' '),dt=_(' '),lt=_(' '),vt=_(' '),ct=_(' '),pt=_('

                        '),xt=_('

                        Connections Found

                        '),mt=_('

                        No connections surfaced yet

                        '),ut=_('
                        '),_t=_('
                        '),ft=_('
                        '),bt=_(`
                        Source Memory

                        Importance Scorer

                        4-channel neuroscience scoring: novelty, arousal, reward, attention

                        `);function Et(ze,Ie){Ue(Ie,!0);let U=j(""),V=j(""),A=j(null),C=j(null),D=j(Ve([])),N=j("associations"),O=j(!1),G=j(""),H=j(null);const ce={associations:{icon:"activation",desc:"Spreading activation — find related memories via graph traversal"},chains:{icon:"reasoning",desc:"Build reasoning path from source to target memory"},bridges:{icon:"explore",desc:"Find connecting memories between two concepts"}};async function pe(){if(e(U).trim()){h(O,!0);try{const s=await Z.search(e(U),1);s.results.length>0&&(h(A,s.results[0],!0),await te())}catch{}finally{h(O,!1)}}}async function xe(){if(e(V).trim()){h(O,!0);try{const s=await Z.search(e(V),1);s.results.length>0&&(h(C,s.results[0],!0),e(A)&&await te())}catch{}finally{h(O,!1)}}}async function te(){if(e(A)){h(O,!0);try{const s=(e(N)==="chains"||e(N)==="bridges")&&e(C)?e(C).id:void 0,n=await Z.explore(e(A).id,e(N),s);h(D,n.results||n.nodes||n.chain||n.bridges||[],!0)}catch{h(D,[],!0)}finally{h(O,!1)}}}async function Me(){e(G).trim()&&h(H,await Z.importance(e(G)),!0)}function Ee(s){h(N,s,!0),e(A)&&te()}var ae=bt(),me=a(ae);Ze(me,{icon:"explore",title:"Explore Connections",subtitle:"Traverse the memory graph — spreading activation, reasoning chains, and conceptual bridges.",accent:"synapse"});var re=r(me,2);W(re,20,()=>["associations","chains","bridges"],X,(s,n)=>{var x=tt(),f=a(x),S=a(f);ee(S,{get name(){return ce[n].icon},size:22}),t(f);var y=r(f,2),c=a(y,!0);t(y);var o=r(y,2),m=a(o,!0);t(o),t(x),k(b=>{Y(x,1,`lift flex flex-col items-center gap-1 p-3 rounded-xl text-sm transition diff --git a/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js.br b/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js.br new file mode 100644 index 0000000..7620d5b Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js.gz b/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js.gz new file mode 100644 index 0000000..63c28cc Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/9.x8O4kluQ.js.gz differ diff --git a/apps/dashboard/build/_app/version.json b/apps/dashboard/build/_app/version.json index fdf4b42..838a406 100644 --- a/apps/dashboard/build/_app/version.json +++ b/apps/dashboard/build/_app/version.json @@ -1 +1 @@ -{"version":"2.2.1"} \ No newline at end of file +{"version":"2.3.0"} \ No newline at end of file diff --git a/apps/dashboard/build/_app/version.json.br b/apps/dashboard/build/_app/version.json.br index bf883c7..123fc63 100644 --- a/apps/dashboard/build/_app/version.json.br +++ b/apps/dashboard/build/_app/version.json.br @@ -1 +1 @@ - {"version":"2.2.1"} \ No newline at end of file + {"version":"2.3.0"} \ No newline at end of file diff --git a/apps/dashboard/build/_app/version.json.gz b/apps/dashboard/build/_app/version.json.gz index b3c3a1a..d5a79f0 100644 Binary files a/apps/dashboard/build/_app/version.json.gz and b/apps/dashboard/build/_app/version.json.gz differ diff --git a/apps/dashboard/build/index.html b/apps/dashboard/build/index.html index bc8e358..0112959 100644 --- a/apps/dashboard/build/index.html +++ b/apps/dashboard/build/index.html @@ -11,19 +11,19 @@ - - - - - - - + + + + + + + - - - - + + + + Vestige @@ -31,7 +31,7 @@