Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: character pages, demo hub, rider build fixes, RSS + listings updates
nirholasa4b06d5b6fb6
diff --git a/api/agents.js b/api/agents.jsindex a6f64b391..e85ab3322 100644--- a/api/agents.js+++ b/api/agents.js@@ -250,6 +250,13 @@ export async function handleGetOne(req, res, id) {await healStaleAvatarId(row);+ const [chatRow] = await sql`+ SELECT COUNT(*)::int AS total+ FROM usage_events+ WHERE agent_id = ${id} AND kind = 'llm'+ `;+ row.chat_count = chatRow?.total ?? 0;+// Public fields if not owner; full record if owner. Auth on a public GET// is best-effort — anonymous viewers still get the public projection.const auth = await resolveAuth(req).catch(() => null);@@ -431,6 +438,9 @@ function decorate(row, isOwner = true) {id: row.id,name: row.name,description: row.description,+ author_name: row.author_name || null,+ author_avatar: row.author_avatar || null,+ chat_count: row.chat_count ?? 0,avatar_id: row.avatar_id,avatar_visibility: avatarVisibility,avatar_model_url: avatarModelUrl,diff --git a/api/characters.js b/api/characters.jsnew file mode 100644index 000000000..193da1422--- /dev/null+++ b/api/characters.js@@ -0,0 +1,106 @@+/**+ * GET /api/characters — paginated feed of published agent characters.+ *+ * Query params:+ * limit=<int> — page size, default 24, max 60+ * cursor=<iso> — created_at ISO for keyset pagination+ * q=<text> — name/description substring search+ * sort=<field> — "chats" | "new" (default "new")+ */++import { sql } from './_lib/db.js';+import { cors, json, method, wrap, error } from './_lib/http.js';+import { limits, clientIp } from './_lib/rate-limit.js';+import { publicUrl } from './_lib/r2.js';++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;+ if (!method(req, res, ['GET'])) return;++ const rl = await limits.publicIp(clientIp(req));+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');++ const url = new URL(req.url, 'http://x');+ const limit = Math.min(Math.max(parseInt(url.searchParams.get('limit') || '24', 10), 1), 60);+ const cursor = url.searchParams.get('cursor') || null;+ const q = (url.searchParams.get('q') || '').trim().slice(0, 80);+ const sort = url.searchParams.get('sort') === 'chats' ? 'chats' : 'new';++ const cursorDate = cursor ? new Date(cursor) : null;++ const rows = await sql`+ SELECT+ i.id,+ i.name,+ i.description,+ i.meta,+ i.created_at,+ i.avatar_id,+ u.display_name AS author_name,+ u.username AS author_username,+ u.avatar_url AS author_avatar,+ a.thumbnail_key AS avatar_thumbnail_key,+ a.visibility AS avatar_visibility,+ COALESCE((+ SELECT COUNT(*)::int+ FROM usage_events ue+ WHERE ue.agent_id = i.id AND ue.kind = 'llm'+ ), 0) AS chat_count+ FROM agent_identities i+ LEFT JOIN users u ON i.user_id = u.id+ LEFT JOIN avatars a ON a.id = i.avatar_id AND a.deleted_at IS NULL+ WHERE i.deleted_at IS NULL+ AND i.is_published = true+ AND i.description IS NOT NULL+ AND length(trim(i.name)) > 0+ ${q ? sql`AND (i.name ILIKE ${'%' + q + '%'} OR i.description ILIKE ${'%' + q + '%'})` : sql``}+ ${cursorDate ? sql`AND i.created_at < ${cursorDate}` : sql``}+ ORDER BY+ ${sort === 'chats' ? sql`chat_count DESC, i.created_at DESC` : sql`i.created_at DESC`}+ LIMIT ${limit + 1}+ `;++ const hasMore = rows.length > limit;+ const items = rows.slice(0, limit).map(row => {+ const meta = row.meta || {};+ const avatarThumbnail =+ row.avatar_thumbnail_key && (row.avatar_visibility === 'public' || row.avatar_visibility === 'unlisted')+ ? publicUrl(row.avatar_thumbnail_key)+ : null;++ const imageUrl =+ meta.profile_image_url ||+ meta.thumbnail_url ||+ meta.avatar_url ||+ avatarThumbnail ||+ null;++ const token = meta.token || null;++ return {+ id: row.id,+ name: row.name,+ description: row.description,+ image_url: imageUrl,+ author_name: row.author_name || null,+ author_username: row.author_username || null,+ author_avatar: row.author_avatar || null,+ chat_count: row.chat_count,+ token: token+ ? {+ symbol: token.symbol || null,+ mint: token.mint || null,+ market_cap_usd: token.market_cap_usd ?? token.usd_market_cap ?? null,+ price_usd: token.price_usd ?? null,+ change_24h_percent: token.change_24h_percent ?? null,+ holders: token.holders ?? 0,+ }+ : null,+ created_at: row.created_at,+ };+ });++ const nextCursor = hasMore ? items[items.length - 1].created_at : null;++ return json(res, 200, { characters: items, next_cursor: nextCursor });+});diff --git a/data/rss/items.json b/data/rss/items.jsonindex d368de10c..abd2ec1f8 100644--- a/data/rss/items.json+++ b/data/rss/items.json@@ -1,6 +1,22 @@{"_readme": "Curated RSS items for https://three.ws/rss/announcements.xml. Edit this file to control exactly what HackerNoon (and any RSS reader) sees. Each entry needs: id (stable slug), title, date (ISO 8601), body_html. Optional: link, author, summary, tags. Items are served newest-first by date; cap is 50. Seeded from data/archives/trythreews_tweets_2026-05-16.json on 2026-05-16 (35 entries). Re-run scripts/seed-rss-from-archive.mjs to refresh from a newer scrape.","items": [+ {+ "id": "partnered-with-hackernoon",+ "title": "three.ws Partners with HackerNoon",+ "date": "2026-05-17T21:00:00.000Z",+ "link": "https://three.ws/news/partnered-with-hackernoon",+ "author": "three.ws",+ "summary": "three.ws has partnered with HackerNoon, bringing on-chain 3D agent coverage to one of the world's largest tech publications. Every three.ws announcement now auto-imports into HackerNoon via our RSS feed at https://three.ws/rss/announcements.xml.",+ "body_html": "<p><strong>three.ws has partnered with <a href=\"https://hackernoon.com/u/three-ws\" rel=\"noopener\">HackerNoon</a></strong>, making HackerNoon the canonical media home for three.ws updates, technical write-ups, and product announcements.</p>\n<p>HackerNoon is one of the world's largest independent tech publications, read by millions of developers, founders, and builders monthly. The partnership gives three.ws a direct publishing channel into that audience without relying on social-media algorithms.</p>\n<h2>How it works</h2>\n<p>HackerNoon pulls every new post automatically from the three.ws RSS feed at <a href=\"https://three.ws/rss/announcements.xml\" rel=\"noopener\">three.ws/rss/announcements.xml</a>. Each item lands in the three.ws HackerNoon drafts queue, is reviewed, then published — all with canonical URLs pointing back to <a href=\"https://three.ws\" rel=\"noopener\">three.ws</a> so search attribution stays with the source.</p>\n<h2>Read us on HackerNoon</h2>\n<ul>\n<li>HackerNoon profile: <a href=\"https://hackernoon.com/u/three-ws\" rel=\"noopener\">hackernoon.com/u/three-ws</a></li>\n<li>RSS feed: <a href=\"https://three.ws/rss/announcements.xml\" rel=\"noopener\">three.ws/rss/announcements.xml</a></li>\n<li>News index: <a href=\"https://three.ws/news/\" rel=\"noopener\">three.ws/news/</a></li>\n</ul>\n<h2>About three.ws</h2>\n<p>three.ws is the open-source platform for 3D AI agents on-chain. A single <code><agent-3d></code> tag deploys a browser-native 3D character with a Solana NFT identity, an ERC-8004 wallet, and native x402 / HTTP 402 payments in USDC. The full stack is at <a href=\"https://github.com/nirholas/three.ws\" rel=\"noopener\">github.com/nirholas/three.ws</a>.</p>\n<h2>Related</h2>\n<ul>\n<li><a href=\"https://three.ws/docs/syndication\">News-feed syndication & partners</a></li>\n<li><a href=\"https://three.ws/docs/listings\">All listings & distribution channels</a></li>\n</ul>",+ "tags": [+ "partnership",+ "media",+ "hackernoon",+ "content",+ "press"+ ]+ },{"id": "listed-on-bnb-chain-dappbay","title": "three.ws Listed on BNB Chain's Dappbay Directory",diff --git a/docs/listings.md b/docs/listings.mdindex 1ddde77b0..93371b2a1 100644--- a/docs/listings.md+++ b/docs/listings.md@@ -31,6 +31,16 @@ Dappbay is BNB Chain's official dApp directory. The listing is about distributio---+## Media & Content Partners++| Partner | Status | Links |+|---|---|---|+| **HackerNoon** | Live | [hackernoon.com/u/three-ws](https://hackernoon.com/u/three-ws) — three.ws posts auto-import from the RSS feed. Announcement: [three.ws Partners with HackerNoon](/news/partnered-with-hackernoon) |++HackerNoon is one of the world's largest independent tech publications, read by millions of developers and founders monthly. Every three.ws announcement is pulled automatically from [`three.ws/rss/announcements.xml`](https://three.ws/rss/announcements.xml) into the HackerNoon drafts queue, then published with canonical URLs pointing back to three.ws. See [syndication setup](/docs/syndication#hackernoon) for technical details.++---+## Open SourceThe full stack is on GitHub:diff --git a/pretext-demo.html b/pretext-demo.htmldeleted file mode 100644index 2cae1dc8c..000000000--- a/pretext-demo.html+++ /dev/null@@ -1,635 +0,0 @@-<!DOCTYPE html>-<html lang="en">-<head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>three.ws — Give Your AI a Body</title>- <link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>- <style>- *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }-- :root {- --gold: #ffd76a;- --gold-dim: rgba(255,215,106,0.55);- --bg: #07080f;- }-- html, body {- width: 100%; height: 100%;- background: var(--bg);- color: rgba(255,255,255,0.72);- font-family: 'Inter', sans-serif;- overflow: hidden;- }-- /* ── header ── */- header {- position: fixed;- top: 0; left: 0; right: 0;- z-index: 200;- display: flex;- align-items: center;- justify-content: space-between;- padding: 0.9rem clamp(1rem, 4vw, 2.5rem);- background: linear-gradient(to bottom, rgba(7,8,15,0.82) 0%, transparent 100%);- backdrop-filter: blur(12px);- -webkit-backdrop-filter: blur(12px);- }-- .site-header-brand {- font-family: 'Space Grotesk', 'Inter', sans-serif;- font-size: 1.1rem;- font-weight: 700;- line-height: 1;- margin: 0;- }-- .site-header-brand a {- color: #fff;- display: inline-flex;- align-items: center;- gap: 0.45rem;- text-decoration: none;- }-- .site-header-brand .wordmark-logo {- width: 22px;- height: 22px;- display: inline-block;- }-- .site-header-brand .wordmark-dot {- width: 8px;- height: 8px;- border-radius: 50%;- background: linear-gradient(135deg, var(--gold), #ff8f4d);- box-shadow: 0 0 12px rgba(255,143,77,0.6);- display: inline-block;- }-- /* ── scene ── */- #scene {- position: fixed;- inset: 0;- overflow: hidden;- }-- /* background glows */- .glow-a {- position: absolute;- width: 600px; height: 600px;- border-radius: 50%;- background: radial-gradient(circle, rgba(255,175,60,0.06) 0%, transparent 70%);- top: -100px; left: 50%;- transform: translateX(-50%);- pointer-events: none;- }- .glow-b {- position: absolute;- width: 400px; height: 400px;- border-radius: 50%;- background: radial-gradient(circle, rgba(120,80,220,0.07) 0%, transparent 70%);- bottom: 10%; right: 10%;- pointer-events: none;- }- .glow-c {- position: absolute;- width: 300px; height: 300px;- border-radius: 50%;- background: radial-gradient(circle, rgba(60,180,220,0.06) 0%, transparent 70%);- bottom: 5%; left: 8%;- pointer-events: none;- }-- /* ── 3D model — centered, tall ── */- #mv-wrap {- position: absolute;- top: 50%; left: 50%;- transform: translate(-50%, -50%);- /* size set by JS on resize */- pointer-events: none;- z-index: 5;- }-- model-viewer {- display: block;- width: 100%;- height: 100%;- background: transparent;- --progress-bar-color: transparent;- --progress-mask: transparent;- }-- /* model glow ring */- #mv-glow {- position: absolute;- inset: 0;- border-radius: 50%;- background: radial-gradient(ellipse at 50% 80%, rgba(255,175,60,0.12) 0%, transparent 65%);- pointer-events: none;- z-index: 4;- }-- /* ── pretext text stage ── */- #text-stage {- position: absolute;- inset: 0;- overflow: hidden;- z-index: 6;- pointer-events: none;- user-select: none;- -webkit-user-select: none;- }-- .txt-line {- position: absolute;- white-space: pre;- font-family: 'Inter', sans-serif;- color: rgba(255,255,255,0.55);- pointer-events: none;- line-height: 1;- }-- .txt-hl {- position: absolute;- white-space: pre;- font-family: 'Space Grotesk', 'Inter', sans-serif;- font-weight: 700;- color: #fff;- letter-spacing: -0.02em;- pointer-events: none;- line-height: 1;- }-- .txt-eyebrow {- position: absolute;- white-space: pre;- font-family: 'Space Grotesk', 'Inter', sans-serif;- font-weight: 600;- color: var(--gold);- letter-spacing: 0.12em;- text-transform: uppercase;- pointer-events: none;- }-- .txt-accent {- position: absolute;- white-space: pre;- font-family: 'Inter', sans-serif;- font-weight: 300;- color: rgba(255,215,106,0.5);- font-style: italic;- pointer-events: none;- }-- /* ── orbs ── */- .orb {- position: absolute;- border-radius: 50%;- z-index: 3;- will-change: transform;- pointer-events: auto;- cursor: grab;- }-- /* ── bottom badge ── */- .bottom-badge {- position: fixed;- bottom: 1.5rem;- left: 50%;- transform: translateX(-50%);- z-index: 100;- display: flex;- align-items: center;- gap: 0.5rem;- background: rgba(255,255,255,0.04);- border: 1px solid rgba(255,255,255,0.08);- backdrop-filter: blur(10px);- padding: 0.4rem 0.9rem;- border-radius: 999px;- font-size: 0.72rem;- color: rgba(255,255,255,0.35);- font-family: 'Space Grotesk', 'Inter', sans-serif;- pointer-events: none;- white-space: nowrap;- }-- .bottom-badge-dot {- width: 6px; height: 6px;- border-radius: 50%;- background: var(--gold);- box-shadow: 0 0 6px rgba(255,215,106,0.8);- animation: pulse 2s ease-in-out infinite;- }-- @keyframes pulse {- 0%, 100% { opacity: 1; transform: scale(1); }- 50% { opacity: 0.5; transform: scale(0.75); }- }-- #err {- position: fixed;- top: 0; left: 0; right: 0;- background: #c0392b;- color: #fff;- font: 13px monospace;- padding: 12px;- z-index: 9999;- white-space: pre-wrap;- display: none;- }- </style>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <script defer src="/footer-newsletter.js"></script>- </head>-<body>--<div id="err"></div>--<!-- header -->-<header class="site-header">- <h1 class="site-header-brand">- <a href="/" aria-label="three.ws home"><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span class="wordmark-dot" aria-hidden="true"></span>three.ws</a>- </h1>- <div id="nav-container"></div>-</header>-<script src="/nav.js"></script>--<!-- scene -->-<div id="scene">- <div class="glow-a"></div>- <div class="glow-b"></div>- <div class="glow-c"></div>- <div id="mv-wrap">- <model-viewer- id="mv"- src="/animations/robotexpressive.glb"- auto-rotate- auto-rotate-delay="0"- rotation-per-second="8deg"- interaction-prompt="none"- camera-controls="false"- disable-zoom- shadow-intensity="0.4"- exposure="0.9"- environment-image="neutral"- camera-orbit="0deg 82deg 3.2m"- field-of-view="38deg"- ></model-viewer>- <div id="mv-glow"></div>- </div>- <div id="text-stage"></div>-</div>--<div class="bottom-badge">- <div class="bottom-badge-dot"></div>- pretext · zero DOM reads · text flows around your agent in real time-</div>--<script type="module">- function showErr(e) {- const el = document.getElementById('err');- el.style.display = 'block';- el.textContent = String(e?.stack || e);- console.error(e);- }- window.addEventListener('unhandledrejection', e => showErr(e.reason));-- import('@chenglou/pretext').then(lib => {- try { main(lib); } catch(e) { showErr(e); }- }).catch(showErr);-- function main({ prepareWithSegments, layoutNextLine, layoutWithLines, walkLineRanges }) {-- // ── copy ──────────────────────────────────────────────────────────────- const EYEBROW = 'THE 3D LAYER FOR ONCHAIN AI AGENTS';- const HL_LINE1 = 'Give your';- const HL_LINE2 = 'AI a body.';- const BODY_TEXT = `Born in 3D. Raised on-chain. Yours forever.--Your AI has been a chatbox long enough. Give it a body, a personality, and a permanent home open to every human, app, and agent that comes looking.--Drop any GLB into the browser and your agent appears as a fully rendered 3D avatar — animated, reactive, and ready to embed anywhere you can drop a script tag.--Connect any LLM via MCP or A2A — Claude, GPT, Gemini, or your own. Built-in empathy layer for real-time emotion. No SDK on the consumer side. No vendor lock-in.--Register your agent on 20+ EVM chains via ERC-8004 — a verifiable, CREATE2-deterministic identity discoverable by any A2A or MCP client. Your agent. Your keys.--The interface is not the chatbox. The interface is the agent itself, rendered in three dimensions, moving through a persistent space, leaving a trail of actions a supervisor can audit.--Autonomous agents on Solana act at four hundred milliseconds finality. They swap tokens, manage liquidity, respond to on-chain events — all without human latency in the loop. The 3D body is the signal layer. You watch. You decide when to step in.--This is the final interface. Not a dashboard. Not a feed. A world where your agents live, move, and work — visible, auditable, yours.`;-- const ACCENT_LINES = [- 'glTF 2.0 · GLB · ERC-8004 · A2A · MCP',- 'Solana · EVM · 20+ chains',- ];-- // ── fonts ──────────────────────────────────────────────────────────────- const BODY_FONT = '15px "Inter", sans-serif';- const BODY_LH = 25;- const HL_FAMILY = '"Space Grotesk", "Inter", sans-serif';- const EY_FONT = `600 11px ${HL_FAMILY}`;- const AC_FONT = `300 13px "Inter", sans-serif`;-- // ── DOM ────────────────────────────────────────────────────────────────- const mv = document.getElementById('mv');- const mvWrap = document.getElementById('mv-wrap');- const stage = document.getElementById('text-stage');-- // ── model viewer sizing ────────────────────────────────────────────────- function sizeModel() {- const W = window.innerWidth, H = window.innerHeight;- const mh = Math.round(H * 0.78);- const mw = Math.round(Math.min(mh * 0.58, W * 0.38));- mvWrap.style.width = mw + 'px';- mvWrap.style.height = mh + 'px';- }- sizeModel();- window.addEventListener('resize', sizeModel);-- // ── orbs ───────────────────────────────────────────────────────────────- const ORB_DEFS = [- { fx: 0.10, fy: 0.20, r: 55, vx: 18, vy: 12, rgb: [255,175,60] },- { fx: 0.85, fy: 0.25, r: 45, vx: -15, vy: 20, rgb: [100,130,255] },- { fx: 0.12, fy: 0.70, r: 50, vx: 20, vy: -14, rgb: [160,80,220] },- { fx: 0.88, fy: 0.72, r: 40, vx: -18, vy: -16, rgb: [60,200,180] },- ];-- const scene = document.getElementById('scene');- const orbEls = ORB_DEFS.map(d => {- const el = document.createElement('div');- el.className = 'orb';- const [r,g,b] = d.rgb;- el.style.background = `radial-gradient(circle at 35% 35%, rgba(${r},${g},${b},0.28), rgba(${r},${g},${b},0.08) 55%, transparent 72%)`;- el.style.boxShadow = `0 0 40px 10px rgba(${r},${g},${b},0.14), 0 0 90px 30px rgba(${r},${g},${b},0.05)`;- scene.appendChild(el);- return el;- });-- const orbs = ORB_DEFS.map(d => ({- x: d.fx * window.innerWidth,- y: d.fy * window.innerHeight,- r: d.r, vx: d.vx, vy: d.vy, paused: false,- }));-- // ── drag ───────────────────────────────────────────────────────────────- let drag = null, pMove = null, pDown = null;-- scene.addEventListener('pointerdown', e => {- const hit = hitOrb(e.clientX, e.clientY);- if (hit < 0) return;- drag = { i: hit, ox: orbs[hit].x, oy: orbs[hit].y, px: e.clientX, py: e.clientY };- orbs[hit].paused = true;- e.preventDefault();- });- window.addEventListener('pointermove', e => { pMove = { x: e.clientX, y: e.clientY }; });- window.addEventListener('pointerup', e => {- if (!drag) return;- orbs[drag.i].paused = false;- orbs[drag.i].vx = (e.clientX - drag.px) * 4;- orbs[drag.i].vy = (e.clientY - drag.py) * 4;- drag = null;- });-- function hitOrb(px, py) {- for (let i = orbs.length - 1; i >= 0; i--) {- const o = orbs[i];- const dx = px - o.x, dy = py - o.y;- if (dx*dx + dy*dy <= o.r * o.r * 1.2) return i;- }- return -1;- }-- // ── layout helpers ─────────────────────────────────────────────────────- const MIN_SLOT = 40;-- function carveSlots(base, blocked) {- let slots = [base];- for (const b of blocked) {- const next = [];- for (const s of slots) {- if (b.right <= s.left || b.left >= s.right) { next.push(s); continue; }- if (b.left > s.left) next.push({ left: s.left, right: b.left });- if (b.right < s.right) next.push({ left: b.right, right: s.right });- }- slots = next;- }- return slots.filter(s => s.right - s.left >= MIN_SLOT);- }-- // ── column layout ──────────────────────────────────────────────────────- function layoutCol(prepared, startCursor, rX, rY, rW, rH, lh, circObs, rectObs) {- let cursor = startCursor, y = rY;- const lines = [];- let done = false;- while (y + lh <= rY + rH && !done) {- const blocked = [];- for (const o of circObs) {- const t = y, b = y + lh, vp = 4, hp = 10;- const cy = o.cy, cx = o.cx, r = o.r;- const top = t - vp, bot = b + vp;- if (top >= cy + r || bot <= cy - r) continue;- const minDy = cy >= top && cy <= bot ? 0 : cy < top ? top - cy : cy - bot;- if (minDy >= r) continue;- const dx = Math.sqrt(r*r - minDy*minDy);- blocked.push({ left: cx - dx - hp, right: cx + dx + hp });- }- for (const rect of rectObs) {- if (y + lh <= rect.y || y >= rect.y + rect.h) continue;- blocked.push({ left: rect.x, right: rect.x + rect.w });- }- const slots = carveSlots({ left: rX, right: rX + rW }, blocked);- if (!slots.length) { y += lh; continue; }- for (const slot of slots.sort((a, b) => a.left - b.left)) {- const ln = layoutNextLine(prepared, cursor, slot.right - slot.left);- if (!ln) { done = true; break; }- lines.push({ x: Math.round(slot.left), y: Math.round(y), text: ln.text });- cursor = ln.end;- }- y += lh;- }- return { lines, cursor };- }-- // ── pools ──────────────────────────────────────────────────────────────- const pools = { body: [], hl: [], ey: [], ac: [] };-- function sync(pool, n, tag, cls) {- while (pool.length < n) {- const el = document.createElement(tag);- el.className = cls;- stage.appendChild(el);- pool.push(el);- }- for (let i = 0; i < pool.length; i++) pool[i].style.display = i < n ? '' : 'none';- }-- function applyLines(pool, lines, font, lh) {- for (let i = 0; i < lines.length; i++) {- const el = pool[i], ln = lines[i];- el.textContent = ln.text;- el.style.left = ln.x + 'px';- el.style.top = ln.y + 'px';- el.style.font = font;- el.style.lineHeight = lh + 'px';- }- }-- // ── pretext prepare ────────────────────────────────────────────────────- const prepBody = prepareWithSegments(BODY_TEXT, BODY_FONT);- const prepEy = prepareWithSegments(EYEBROW, EY_FONT);- const prepAc = ACCENT_LINES.map(t => prepareWithSegments(t, AC_FONT));-- // ── headline fit (two fixed lines, find largest px that fits left col) ─- let hlCache2 = null;- function fitHL2(maxW, maxPx) {- const key = `${maxW}|${maxPx}`;- if (hlCache2?.key === key) return hlCache2;- let lo = 20, hi = maxPx, best = lo;- while (lo <= hi) {- const sz = (lo + hi) >> 1;- const font = `700 ${sz}px ${HL_FAMILY}`;- const p1 = prepareWithSegments(HL_LINE1, font);- const p2 = prepareWithSegments(HL_LINE2, font);- let fits = true;- walkLineRanges(p1, maxW, ln => { if (ln.end.graphemeIndex !== 0) fits = false; });- walkLineRanges(p2, maxW, ln => { if (ln.end.graphemeIndex !== 0) fits = false; });- if (fits) { best = sz; lo = sz + 1; } else { hi = sz - 1; }- }- const lh = Math.round(best * 1.08);- hlCache2 = { key, sz: best, lh, font: `700 ${best}px ${HL_FAMILY}` };- return hlCache2;- }-- // ── frame loop ─────────────────────────────────────────────────────────- let lastT = null;-- function frame(now) {- requestAnimationFrame(frame);-- if (pMove) {- if (drag) {- orbs[drag.i].x = drag.ox + (pMove.x - drag.px);- orbs[drag.i].y = drag.oy + (pMove.y - drag.py);- }- pMove = null;- }-- const dt = lastT === null ? 0 : Math.min((now - lastT) / 1000, 0.05);- lastT = now;- const W = window.innerWidth, H = window.innerHeight;-- // physics- for (let i = 0; i < orbs.length; i++) {- const o = orbs[i];- if (o.paused || (drag && drag.i === i)) continue;- o.x += o.vx * dt; o.y += o.vy * dt;- if (o.x - o.r < 0) { o.x = o.r; o.vx = Math.abs(o.vx); }- if (o.x + o.r > W) { o.x = W - o.r; o.vx = -Math.abs(o.vx); }- if (o.y - o.r < 0) { o.y = o.r; o.vy = Math.abs(o.vy); }- if (o.y + o.r > H) { o.y = H - o.r; o.vy = -Math.abs(o.vy); }- }- for (let i = 0; i < orbs.length; i++) {- for (let j = i + 1; j < orbs.length; j++) {- const a = orbs[i], b = orbs[j];- const dx = b.x - a.x, dy = b.y - a.y;- const d = Math.sqrt(dx*dx + dy*dy), min = a.r + b.r;- if (d < min && d > 0.01) {- const ov = (min - d) / 2, nx = dx/d, ny = dy/d;- if (!a.paused) { a.x -= nx*ov; a.y -= ny*ov; }- if (!b.paused) { b.x += nx*ov; b.y += ny*ov; }- }- }- }- for (let i = 0; i < orbs.length; i++) {- const o = orbs[i];- orbEls[i].style.width = o.r*2 + 'px';- orbEls[i].style.height = o.r*2 + 'px';- orbEls[i].style.transform = `translate(${Math.round(o.x-o.r)}px,${Math.round(o.y-o.r)}px)`;- }-- // ── layout ────────────────────────────────────────────────────────────- const G = W < 700 ? 16 : 52;- const totalW = W - G * 2;-- // model rect — one getBoundingClientRect per frame- const mvRect = mvWrap.getBoundingClientRect();- const modelPadH = 28, modelPadV = 0;- const modelObs = {- x: mvRect.left - modelPadH,- y: mvRect.top - modelPadV,- w: mvRect.width + modelPadH * 2,- h: mvRect.height + modelPadV * 2,- };-- // orb obstacles (inline circle math)- const circObs = orbs.map(o => ({ cx: o.x, cy: o.y, r: o.r }));-- // ── headline: left of model ──────────────────────────────────────────- const leftColW = Math.round(mvRect.left - G - 16);- const hlMaxW = Math.max(leftColW, 120);- const hlFit = fitHL2(hlMaxW, 80);- const hlCenterY = Math.round(mvRect.top + mvRect.height * 0.28);- const hlTotalH = hlFit.lh * 2;- const hlTop = hlCenterY - hlTotalH / 2;- const hl1 = { x: G, y: Math.round(hlTop), text: HL_LINE1 };- const hl2 = { x: G, y: Math.round(hlTop + hlFit.lh), text: HL_LINE2 };-- // ── eyebrow: above headline ──────────────────────────────────────────- const eyTop = Math.round(hlTop - 28);- const eyR = layoutWithLines(prepEy, hlMaxW, 14);- const eyLines = eyR.lines.map((l, i) => ({ x: G, y: eyTop + i * 16, text: l.text }));-- // ── body: full-width, flows around model + orbs ──────────────────────- // Use the entire viewport height (skip header ~60px)- const bodyTop = 68;- const bodyH = H - bodyTop - 16;- const zero = { segmentIndex: 0, graphemeIndex: 0 };- const { lines: bodyLines } = layoutCol(- prepBody, zero,- G, bodyTop, totalW, bodyH,- BODY_LH,- circObs, [modelObs],- );-- // ── accent strip: below model ────────────────────────────────────────- const acTop = Math.round(mvRect.bottom + 14);- const acLines = [];- for (let qi = 0; qi < prepAc.length; qi++) {- const r = layoutWithLines(prepAc[qi], totalW, 18);- for (const l of r.lines) acLines.push({ x: G, y: acTop + qi * 22, text: l.text });- }-- // ── commit ───────────────────────────────────────────────────────────- sync(pools.hl, 2, 'div', 'txt-hl');- sync(pools.body, bodyLines.length, 'div', 'txt-line');- sync(pools.ey, eyLines.length, 'div', 'txt-eyebrow');- sync(pools.ac, acLines.length, 'div', 'txt-accent');-- // headline — set manually, not via applyLines (different font per line could differ later)- for (const [idx, ln] of [[0, hl1], [1, hl2]]) {- const el = pools.hl[idx];- el.textContent = ln.text;- el.style.left = ln.x + 'px';- el.style.top = ln.y + 'px';- el.style.font = hlFit.font;- el.style.lineHeight = hlFit.lh + 'px';- }-- applyLines(pools.body, bodyLines, BODY_FONT, BODY_LH);- applyLines(pools.ey, eyLines, EY_FONT, 14);- applyLines(pools.ac, acLines, AC_FONT, 18);- }-- requestAnimationFrame(frame);- }-</script>-- <div id="footer-container"></div>- <script src="/footer.js"></script>-</body>-</html>diff --git a/public/character.html b/public/character.htmlnew file mode 100644index 000000000..2a8587e28--- /dev/null+++ b/public/character.html@@ -0,0 +1,75 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />+ <title>Character — three.ws</title>+ <meta name="description" content="Character profile on three.ws" />+ <link rel="icon" href="/favicon.ico" />+ <link rel="stylesheet" href="/src/character.css" />+</head>+<body>++<nav class="ch-nav">+ <a class="ch-nav-brand" href="/">three.ws</a>+ <div class="ch-nav-actions">+ <a class="ch-btn-ghost" href="/login">Log in</a>+ <a class="ch-btn-primary" href="/login?signup=1">Sign up</a>+ </div>+</nav>++<div class="ch-shell ch-loading">++ <!-- Hero -->+ <section class="ch-hero">+ <div class="ch-hero-top">+ <!-- Avatar -->+ <img id="ch-avatar-img" class="ch-avatar" src="" alt="" style="display:none" />+ <div id="ch-avatar-ph" class="ch-avatar-placeholder" style="display:none"></div>++ <!-- Name + creator + stats -->+ <div class="ch-hero-info">+ <h1 id="ch-name" class="ch-name ch-skeleton" style="min-width:140px;min-height:28px"> </h1>+ <div id="ch-creator" class="ch-creator" style="margin-top:6px"></div>+ </div>++ <div class="ch-stats">+ <div class="ch-stat-bubble">+ <span id="ch-stat-chats" class="ch-stat-num">—</span>+ <span class="ch-stat-label">Chats</span>+ </div>+ <div class="ch-stat-bubble">+ <span id="ch-stat-holders" class="ch-stat-num">—</span>+ <span class="ch-stat-label">Holders</span>+ </div>+ </div>+ </div>++ <p id="ch-desc" class="ch-desc"></p>++ <div class="ch-cta">+ <a id="ch-chat-btn" class="ch-chat-btn" href="#">Chat</a>+ </div>+ </section>++ <!-- Token card -->+ <section class="ch-section">+ <div class="ch-token-card">+ <div id="ch-token-section">+ <p class="ch-no-token">Loading…</p>+ </div>+ </div>+ </section>++ <!-- Memes gallery -->+ <section class="ch-section">+ <h2 class="ch-gallery-title">Memes Gallery</h2>+ <div id="ch-memes-grid" class="ch-gallery-grid"></div>+ </section>++ <div class="ch-bottom-pad"></div>+</div>++<script type="module" src="/src/character.js"></script>+</body>+</html>diff --git a/public/characters.html b/public/characters.htmlnew file mode 100644index 000000000..1f42ab587--- /dev/null+++ b/public/characters.html@@ -0,0 +1,49 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />+ <title>Characters — three.ws</title>+ <meta name="description" content="Discover AI characters on three.ws. Chat, trade, and create." />+ <link rel="icon" href="/favicon.ico" />+ <link rel="canonical" href="https://three.ws/characters" />+ <meta property="og:title" content="Characters — three.ws" />+ <meta property="og:description" content="Discover AI characters. Chat, trade, create." />+ <meta property="og:url" content="https://three.ws/characters" />+ <meta property="og:image" content="https://three.ws/og-image.png" />+ <link rel="stylesheet" href="/src/characters.css" />+</head>+<body>++<nav class="chs-nav">+ <a class="chs-nav-brand" href="/">three.ws</a>+ <div class="chs-nav-right">+ <a class="chs-btn-ghost" href="/login">Log in</a>+ <a class="chs-btn-primary" href="/login?signup=1">Sign up</a>+ </div>+</nav>++<div class="chs-header">+ <h1 class="chs-title">Characters</h1>+ <div class="chs-controls">+ <input id="chs-search" class="chs-search" type="search" placeholder="Search characters…" autocomplete="off" />+ <div class="chs-sort">+ <button class="chs-sort-btn active" data-sort="new">New</button>+ <button class="chs-sort-btn" data-sort="chats">Top</button>+ </div>+ </div>+</div>++<div id="chs-grid" class="chs-grid">+ <!-- cards injected by characters.js -->+</div>++<div id="chs-load-more" class="chs-load-more" style="display:none">+ <button id="chs-load-btn" class="chs-load-btn">Load more</button>+</div>++<div class="chs-bottom-pad"></div>++<script type="module" src="/src/characters.js"></script>+</body>+</html>diff --git a/public/demos/3d-home.html b/public/demos/3d-home.htmlnew file mode 100644index 000000000..b0117749a--- /dev/null+++ b/public/demos/3d-home.html@@ -0,0 +1,395 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>three.ws — Give Your AI a Body</title>+ <meta name="robots" content="noindex" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <style>+ :root { color-scheme: dark; }+ *, *::before, *::after { box-sizing: border-box; }+ html, body { height: 100%; margin: 0; overflow: hidden; }+ body {+ background: #04050d;+ color: #eee;+ font: 15px/1.5 'Inter', -apple-system, system-ui, sans-serif;+ }++ /* ── Layout ──────────────────────────────────────────────── */+ .hero {+ display: grid;+ grid-template-columns: 1fr 1.15fr;+ height: 100vh;+ }+ @media (max-width: 768px) {+ .hero { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }+ .scene-col { min-height: 55vw; }+ }++ /* ── Left column ─────────────────────────────────────────── */+ .text-col {+ display: flex;+ flex-direction: column;+ justify-content: center;+ padding: 60px 52px 60px 56px;+ position: relative;+ z-index: 2;+ background: linear-gradient(to right, #04050d 70%, transparent);+ }++ .eyebrow {+ display: inline-flex; align-items: center; gap: 9px;+ font-size: 11px; font-weight: 600;+ letter-spacing: 0.17em; text-transform: uppercase;+ color: #d6ff3d; margin-bottom: 24px;+ font-family: 'Space Grotesk', 'Inter', sans-serif;+ }+ .eyebrow-dot {+ width: 7px; height: 7px; border-radius: 50%;+ background: #d6ff3d;+ box-shadow: 0 0 8px rgba(214,255,61,0.7);+ animation: blink 2.2s ease-in-out infinite;+ }+ @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.25} }++ .hero-title {+ font-family: 'Space Grotesk', 'Inter', sans-serif;+ font-size: clamp(36px, 4.2vw, 66px);+ font-weight: 800;+ letter-spacing: -0.03em;+ line-height: 1.04;+ margin: 0 0 20px;+ color: #fff;+ }+ .hero-title em { color: #d6ff3d; font-style: normal; }++ .hero-sub {+ color: #5a5d72;+ font-size: 15.5px;+ line-height: 1.68;+ max-width: 40ch;+ margin: 0 0 44px;+ }++ /* ── 3D physical CTA buttons ─────────────────────────────── */+ .cta-row { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }++ .btn-3d {+ display: inline-flex; align-items: center; gap: 10px;+ padding: 16px 32px; border: none; border-radius: 14px;+ font: 700 15px/1 'Inter', inherit;+ cursor: pointer; text-decoration: none;+ transform: translateY(0);+ transition: filter 0.12s;+ user-select: none;+ }+ .btn-primary {+ background: linear-gradient(160deg, #e2ff5a, #c8ef2c);+ color: #0a0b0f;+ box-shadow: 0 8px 0 0 #7a9600, 0 10px 28px rgba(214,255,61,0.28);+ }+ .btn-primary:hover { filter: brightness(1.07); }+ .btn-ghost {+ background: rgba(255,255,255,0.05);+ color: #bbb;+ border: 1.5px solid rgba(255,255,255,0.1);+ box-shadow: 0 5px 0 0 rgba(255,255,255,0.04), 0 7px 18px rgba(0,0,0,0.4);+ }++ /* Physical landing animation — fired from JS when avatar touches 3D button */+ @keyframes btn-land {+ 0% { transform: translateY(0); box-shadow: 0 8px 0 0 #7a9600, 0 10px 28px rgba(214,255,61,0.28); }+ 13% { transform: translateY(9px); box-shadow: 0 0 0 0 #7a9600, 0 4px 14px rgba(214,255,61,0.50); }+ 30% { transform: translateY(-3px); box-shadow: 0 11px 0 0 #7a9600, 0 14px 32px rgba(214,255,61,0.26); }+ 50% { transform: translateY(2px); box-shadow: 0 6px 0 0 #7a9600, 0 8px 22px rgba(214,255,61,0.20); }+ 68% { transform: translateY(-1px); box-shadow: 0 9px 0 0 #7a9600, 0 11px 26px rgba(214,255,61,0.24); }+ 84% { transform: translateY(0.5px); box-shadow: 0 7.5px 0 0 #7a9600, 0 10px 27px rgba(214,255,61,0.26); }+ 100% { transform: translateY(0); box-shadow: 0 8px 0 0 #7a9600, 0 10px 28px rgba(214,255,61,0.28); }+ }+ .btn-primary.landed {+ animation: btn-land 0.78s cubic-bezier(0.22, 1, 0.36, 1) forwards;+ }++ /* ── Right column: 3D scene ──────────────────────────────── */+ .scene-col { position: relative; }+ .scene-col canvas {+ display: block; width: 100%; height: 100%;+ }++ /* Nav */+ .nav-bar {+ position: fixed; top: 0; left: 0; right: 0; z-index: 20;+ display: flex; align-items: center; gap: 16px;+ padding: 14px 28px;+ background: rgba(4,5,13,0.6); backdrop-filter: blur(14px);+ border-bottom: 1px solid rgba(255,255,255,0.04);+ }+ .nav-bar .brand {+ font: 700 15px/1 'Space Grotesk', 'Inter', sans-serif;+ color: #fff; text-decoration: none;+ display: flex; align-items: center; gap: 7px;+ }+ .brand-dot {+ width: 8px; height: 8px; border-radius: 50%;+ background: linear-gradient(135deg, #d6ff3d, #aacc00);+ box-shadow: 0 0 10px rgba(214,255,61,0.6);+ }+ .nav-bar a.nav-link { color: #5a5d72; text-decoration: none; font-size: 13px; }+ .nav-bar a.nav-link:hover { color: #d6ff3d; }+ .nav-spacer { flex: 1; }+ </style>+ </head>+ <body>+ <div class="nav-bar">+ <a href="/" class="brand">+ <img src="/three.svg" width="20" height="20" alt="" />+ <span class="brand-dot"></span>+ three.ws+ </a>+ <div class="nav-spacer"></div>+ <a href="/demos/" class="nav-link">← lab</a>+ </div>++ <section class="hero" style="padding-top: 52px;">+ <!-- Left: copy + CTAs -->+ <div class="text-col">+ <div class="eyebrow">+ <span class="eyebrow-dot"></span>+ <span>The 3D layer for onchain AI agents</span>+ </div>+ <h1 class="hero-title">+ Give your AI<br />a <em>body.</em>+ </h1>+ <p class="hero-sub">+ Born in 3D. Raised on-chain. Yours forever.+ Your AI has been a chatbox long enough —+ give it a body, a personality, and a permanent home.+ </p>+ <div class="cta-row">+ <a href="/create" class="btn-3d btn-primary" id="cta-primary">+ <span>Build your agent — free</span>+ <span>→</span>+ </a>+ <a href="#" class="btn-3d btn-ghost">+ <span>Watch it live</span>+ <span style="opacity:.4">↓</span>+ </a>+ </div>+ </div>++ <!-- Right: WebGL scene -->+ <div class="scene-col">+ <canvas id="c"></canvas>+ </div>+ </section>++ <script type="module">+ import * as THREE from 'three';+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';+ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';++ const canvas = document.getElementById('c');+ const ctaPrimary = document.getElementById('cta-primary');++ // ── Renderer ──────────────────────────────────────────────────────+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.1;+ renderer.shadowMap.enabled = true;+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;++ const scene = new THREE.Scene();+ scene.fog = new THREE.FogExp2(0x02030a, 0.024);++ const pmrem = new THREE.PMREMGenerator(renderer);+ scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;++ // ── Camera ────────────────────────────────────────────────────────+ const camera = new THREE.PerspectiveCamera(40, 1, 0.05, 80);+ camera.position.set(0.5, 2.8, 8.0);+ camera.lookAt(0, 0.9, 0);++ const controls = new OrbitControls(camera, canvas);+ controls.target.set(0, 0.9, 0);+ controls.enableDamping = true;+ controls.dampingFactor = 0.07;+ controls.minDistance = 2;+ controls.maxDistance = 22;+ controls.maxPolarAngle = Math.PI / 2 - 0.02;+ controls.update();++ function resize() {+ const w = canvas.clientWidth, h = canvas.clientHeight;+ if (!w || !h) return;+ renderer.setSize(w, h, false);+ camera.aspect = w / h;+ camera.updateProjectionMatrix();+ }+ new ResizeObserver(resize).observe(canvas);+ resize();++ // ── Star skybox ───────────────────────────────────────────────────+ const skyC = document.createElement('canvas');+ skyC.width = 2048; skyC.height = 1024;+ const sc = skyC.getContext('2d');+ sc.fillStyle = '#02030b'; sc.fillRect(0, 0, 2048, 1024);+ const neb = sc.createRadialGradient(900,400,0,900,400,600);+ neb.addColorStop(0,'rgba(40,20,90,0.15)'); neb.addColorStop(1,'rgba(0,0,0,0)');+ sc.fillStyle = neb; sc.fillRect(0,0,2048,1024);+ for (let i=0;i<2000;i++){+ const x=Math.random()*2048,y=Math.random()*1024,r=Math.random()*1.2+0.2,a=Math.random()*0.8+0.15;+ const t=Math.random();+ sc.fillStyle=t>0.7?`rgba(160,200,255,${a})`:t>0.45?`rgba(255,220,180,${a})`:`rgba(255,255,255,${a})`;+ sc.beginPath();sc.arc(x,y,r,0,Math.PI*2);sc.fill();+ }+ scene.add(new THREE.Mesh(+ new THREE.SphereGeometry(70,32,16),+ new THREE.MeshBasicMaterial({map:new THREE.CanvasTexture(skyC),side:THREE.BackSide})+ ));++ // ── Lights ────────────────────────────────────────────────────────+ scene.add(new THREE.AmbientLight(0x4050aa, 0.18));+ const key = new THREE.DirectionalLight(0xfff4dc, 2.2);+ key.position.set(4,9,6); key.castShadow=true;+ key.shadow.mapSize.setScalar(2048);+ key.shadow.camera.left=-7;key.shadow.camera.right=7;+ key.shadow.camera.top=7;key.shadow.camera.bottom=-2;+ key.shadow.camera.near=1;key.shadow.camera.far=22;+ scene.add(key);+ const rim=new THREE.DirectionalLight(0x2040ff,1.1);rim.position.set(-5,3,-5);scene.add(rim);+ const glow=new THREE.PointLight(0xd6ff3d,0.8,9);glow.position.set(0,1.5,0);scene.add(glow);+ const pf=new THREE.PointLight(0xff2060,0.5,16);pf.position.set(-7,2,2);scene.add(pf);+ const cf=new THREE.PointLight(0x00e5ff,0.4,16);cf.position.set(7,2,-3);scene.add(cf);++ // ── Tron floor ────────────────────────────────────────────────────+ const gC=document.createElement('canvas');gC.width=gC.height=512;+ const gx=gC.getContext('2d');+ gx.fillStyle='#04050f';gx.fillRect(0,0,512,512);+ gx.strokeStyle='#0d0f22';gx.lineWidth=1;+ for(let i=0;i<=512;i+=32){gx.beginPath();gx.moveTo(i,0);gx.lineTo(i,512);gx.stroke();gx.beginPath();gx.moveTo(0,i);gx.lineTo(512,i);gx.stroke();}+ gx.strokeStyle='#1a2a6c';gx.lineWidth=2;+ for(let i=0;i<=512;i+=128){gx.beginPath();gx.moveTo(i,0);gx.lineTo(i,512);gx.stroke();gx.beginPath();gx.moveTo(0,i);gx.lineTo(512,i);gx.stroke();}+ const gTex=new THREE.CanvasTexture(gC);+ gTex.wrapS=gTex.wrapT=THREE.RepeatWrapping;gTex.repeat.set(14,14);+ const floor=new THREE.Mesh(new THREE.PlaneGeometry(32,32),new THREE.MeshStandardMaterial({map:gTex,roughness:0.08,metalness:0.6}));+ floor.rotation.x=-Math.PI/2;floor.receiveShadow=true;scene.add(floor);++ // ── 3D Button ─────────────────────────────────────────────────────+ const base=new THREE.Mesh(new THREE.CylinderGeometry(2.05,2.25,0.85,64),new THREE.MeshStandardMaterial({color:0x0a0b1a,roughness:0.25,metalness:0.92}));+ base.position.y=0.425;base.castShadow=true;base.receiveShadow=true;scene.add(base);++ const ledRing=new THREE.Mesh(new THREE.TorusGeometry(1.88,0.045,8,80),new THREE.MeshStandardMaterial({color:0xd6ff3d,emissive:0xd6ff3d,emissiveIntensity:1.0,roughness:0.2,metalness:0}));+ ledRing.position.y=0.84;ledRing.rotation.x=Math.PI/2;scene.add(ledRing);++ // Cap texture: "GET STARTED"+ const cc=document.createElement('canvas');cc.width=cc.height=512;+ const cx2=cc.getContext('2d');+ const cg=cx2.createRadialGradient(256,256,0,256,256,222);+ cg.addColorStop(0,'#eeff66');cg.addColorStop(0.65,'#d6ff3d');cg.addColorStop(1,'#aecf20');+ cx2.fillStyle=cg;cx2.beginPath();cx2.arc(256,256,222,0,Math.PI*2);cx2.fill();+ cx2.fillStyle='rgba(8,9,15,0.88)';cx2.font='bold 58px -apple-system,system-ui,sans-serif';+ cx2.textAlign='center';cx2.textBaseline='middle';+ cx2.fillText('GET',256,210);cx2.fillText('STARTED',256,290);++ const CAP_H=0.38,CAP_HALF=0.19,BASE_TOP=0.85;+ const CAP_REST=BASE_TOP+CAP_HALF,BTN_TOP=BASE_TOP+CAP_H;+ const capSide=new THREE.MeshStandardMaterial({color:0xc8ef38,emissive:0xd6ff3d,emissiveIntensity:0.12,roughness:0.4,metalness:0});+ const capTop=new THREE.MeshStandardMaterial({map:new THREE.CanvasTexture(cc),emissive:0xd6ff3d,emissiveIntensity:0.08,roughness:0.35,metalness:0});+ const cap=new THREE.Mesh(new THREE.CylinderGeometry(1.74,1.74,CAP_H,64),[capSide,capTop,capSide]);+ cap.position.y=CAP_REST;cap.castShadow=true;cap.receiveShadow=true;scene.add(cap);++ // ── Spring physics + squash-stretch ───────────────────────────────+ let sY=0,sV=0,springing=false;+ function triggerSpring(){+ sY=-0.88;sV=0;springing=true;+ capSide.emissiveIntensity=0.8;capTop.emissiveIntensity=0.6;+ ledRing.material.emissiveIntensity=3.5;glow.intensity=7.0;+ // Sync DOM CTA button+ ctaPrimary.classList.remove('landed');+ void ctaPrimary.offsetWidth;+ ctaPrimary.classList.add('landed');+ }+ function updateSpring(dt){+ if(!springing)return;+ sV+=(-270*sY-9*sV)*dt;sY+=sV*dt;+ const s=Math.max(0.04,1+sY),xz=1+(1-s)*0.19;+ cap.scale.set(xz,s,xz);cap.position.y=BASE_TOP+CAP_HALF*s;+ const m=Math.abs(sY);+ capSide.emissiveIntensity=0.12+m*0.55;capTop.emissiveIntensity=0.08+m*0.4;+ ledRing.material.emissiveIntensity=1.0+m*2.5;glow.intensity=0.8+m*5.5;+ if(m<0.003&&Math.abs(sV)<0.003){+ springing=false;sY=0;sV=0;cap.scale.set(1,1,1);cap.position.y=CAP_REST;+ capSide.emissiveIntensity=0.12;capTop.emissiveIntensity=0.08;+ ledRing.material.emissiveIntensity=1.0;glow.intensity=0.8;+ }+ }++ // ── Particles ─────────────────────────────────────────────────────+ const pool=[];+ function burst(y){+ const N=90,pos=new Float32Array(N*3),vel=[];+ for(let i=0;i<N;i++){const a=Math.random()*Math.PI*2;pos[i*3]=Math.cos(a)*Math.random()*0.4;pos[i*3+1]=y;pos[i*3+2]=Math.sin(a)*Math.random()*0.4;vel.push({x:Math.cos(a)*(1.5+Math.random()*3),y:1.5+Math.random()*4.5,z:Math.sin(a)*(1.5+Math.random()*3)});}+ const geo=new THREE.BufferGeometry();geo.setAttribute('position',new THREE.BufferAttribute(pos,3));+ const mat=new THREE.PointsMaterial({color:0xd6ff3d,size:0.07,transparent:true});+ const pts=new THREE.Points(geo,mat);scene.add(pts);pool.push({pts,geo,mat,vel,age:0,life:1.4});+ }+ function updateParticles(dt){+ for(let i=pool.length-1;i>=0;i--){+ const p=pool[i];p.age+=dt;+ if(p.age>=p.life){scene.remove(p.pts);p.geo.dispose();p.mat.dispose();pool.splice(i,1);continue;}+ const buf=p.geo.attributes.position.array;+ for(let j=0;j<p.vel.length;j++){buf[j*3]+=p.vel[j].x*dt;buf[j*3+1]+=p.vel[j].y*dt;buf[j*3+2]+=p.vel[j].z*dt;p.vel[j].y-=9.8*dt;}+ p.geo.attributes.position.needsUpdate=true;p.mat.opacity=1-p.age/p.life;+ }+ }++ // ── Avatar ────────────────────────────────────────────────────────+ let avatar=null,mixer=null,rootBone=null,baseRootPos=null,fallAction=null;+ const FALL_DUR=2.933,LAND_AT=2.35,DROP_FROM=BTN_TOP+3.8;+ let seqT=0,landed=false;++ function runSeq(){seqT=0;landed=false;if(avatar)avatar.position.set(0,DROP_FROM,0);fallAction?.reset().play();}+ function updateSeq(dt){+ if(!avatar)return;seqT+=dt;+ if(seqT<=LAND_AT){const p=seqT/LAND_AT;avatar.position.y=DROP_FROM+(BTN_TOP-DROP_FROM)*(p*p);}+ else{avatar.position.y=cap.position.y+CAP_HALF*cap.scale.y;if(!landed){landed=true;triggerSpring();burst(BTN_TOP);}}+ if(seqT>=FALL_DUR+1.2)runSeq();+ }++ new GLTFLoader().load('/avatars/cz.glb',gltf=>{+ avatar=gltf.scene;+ avatar.traverse(n=>{if(n.isMesh){n.castShadow=true;n.receiveShadow=true;}if(!rootBone&&/^(Hips|Root|mixamorig:?Hips)$/i.test(n.name))rootBone=n;});+ avatar.rotation.y=Math.PI;scene.add(avatar);+ mixer=new THREE.AnimationMixer(avatar);+ fetch('/animations/clips/jumpdown3.json').then(r=>r.json()).then(json=>{+ fallAction=mixer.clipAction(THREE.AnimationClip.parse(json));+ fallAction.setLoop(THREE.LoopOnce,1);fallAction.clampWhenFinished=true;+ if(rootBone)baseRootPos=rootBone.position.clone();+ const _r=renderer.render.bind(renderer);+ renderer.render=(sc,cam)=>{+ try{if(rootBone&&baseRootPos)rootBone.position.copy(baseRootPos);}catch(_){}+ _r(sc,cam);+ };+ runSeq();+ });+ });++ // ── Render loop ───────────────────────────────────────────────────+ const clock=new THREE.Clock();+ (function tick(){+ requestAnimationFrame(tick);+ try {+ const dt=Math.min(clock.getDelta(),0.05);+ controls.update();+ mixer?.update(dt);+ updateSpring(dt);updateSeq(dt);updateParticles(dt);+ renderer.render(scene,camera);+ } catch(_) {}+ })();+ </script>+ </body>+</html>diff --git a/public/demos/button-jump.html b/public/demos/button-jump.htmlnew file mode 100644index 000000000..fabd34333--- /dev/null+++ b/public/demos/button-jump.html@@ -0,0 +1,452 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>button · three.ws</title>+ <meta name="robots" content="noindex" />+ <style>+ *, *::before, *::after { box-sizing: border-box; }+ html, body { height: 100%; margin: 0; background: #02030a; overflow: hidden; }+ canvas { display: block; width: 100%; height: 100%; }+ .hint {+ position: fixed; bottom: 22px; left: 50%;+ transform: translateX(-50%);+ color: #1e2030; font: 12px/1 -apple-system, system-ui, sans-serif;+ letter-spacing: 0.08em; pointer-events: none; z-index: 2;+ }+ </style>+ </head>+ <body>+ <canvas id="c"></canvas>+ <div class="hint">drag to orbit · scroll to zoom</div>++ <script type="module">+ import * as THREE from 'three';+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';+ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';++ // ── Renderer ─────────────────────────────────────────────────────────+ const canvas = document.getElementById('c');+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.1;+ renderer.shadowMap.enabled = true;+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;++ const scene = new THREE.Scene();+ scene.fog = new THREE.FogExp2(0x02030a, 0.022);++ const pmrem = new THREE.PMREMGenerator(renderer);+ scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;++ // ── Camera & controls ─────────────────────────────────────────────────+ const camera = new THREE.PerspectiveCamera(42, 1, 0.05, 120);+ camera.position.set(1.2, 3.2, 9.0);++ const controls = new OrbitControls(camera, canvas);+ controls.target.set(0, 1.0, -1.0);+ controls.enableDamping = true;+ controls.dampingFactor = 0.07;+ controls.minDistance = 2;+ controls.maxDistance = 40;+ controls.maxPolarAngle = Math.PI / 2 - 0.02;+ controls.update();++ function resize() {+ renderer.setSize(window.innerWidth, window.innerHeight, false);+ camera.aspect = window.innerWidth / window.innerHeight;+ camera.updateProjectionMatrix();+ }+ window.addEventListener('resize', resize);+ resize();++ // ── Star-field skybox sphere ──────────────────────────────────────────+ const skyC = document.createElement('canvas');+ skyC.width = 2048; skyC.height = 1024;+ const skyCtx = skyC.getContext('2d');+ skyCtx.fillStyle = '#02030b';+ skyCtx.fillRect(0, 0, 2048, 1024);+ // Nebula smear+ const neb = skyCtx.createRadialGradient(900, 400, 0, 900, 400, 600);+ neb.addColorStop(0, 'rgba(40,20,90,0.18)');+ neb.addColorStop(0.5, 'rgba(10,5,40,0.08)');+ neb.addColorStop(1, 'rgba(0,0,0,0)');+ skyCtx.fillStyle = neb; skyCtx.fillRect(0, 0, 2048, 1024);+ const neb2 = skyCtx.createRadialGradient(1600, 700, 0, 1600, 700, 400);+ neb2.addColorStop(0, 'rgba(0,40,80,0.12)');+ neb2.addColorStop(1, 'rgba(0,0,0,0)');+ skyCtx.fillStyle = neb2; skyCtx.fillRect(0, 0, 2048, 1024);+ // Stars+ for (let i = 0; i < 2400; i++) {+ const x = Math.random() * 2048, y = Math.random() * 1024;+ const r = Math.random() * 1.3 + 0.2;+ const a = Math.random() * 0.85 + 0.15;+ const tint = Math.random();+ const col = tint > 0.75+ ? `rgba(160,200,255,${a})` // blue+ : tint > 0.5+ ? `rgba(255,220,180,${a})` // warm+ : `rgba(255,255,255,${a})`;+ skyCtx.fillStyle = col;+ skyCtx.beginPath(); skyCtx.arc(x, y, r, 0, Math.PI * 2); skyCtx.fill();+ }+ const skyTex = new THREE.CanvasTexture(skyC);+ scene.add(new THREE.Mesh(+ new THREE.SphereGeometry(80, 32, 16),+ new THREE.MeshBasicMaterial({ map: skyTex, side: THREE.BackSide }),+ ));+ scene.background = new THREE.Color(0x02030b);++ // ── Lights ───────────────────────────────────────────────────────────+ scene.add(new THREE.AmbientLight(0x4050aa, 0.2));++ const key = new THREE.DirectionalLight(0xfff4dc, 2.2);+ key.position.set(4, 9, 6);+ key.castShadow = true;+ key.shadow.mapSize.setScalar(2048);+ key.shadow.camera.left = -10; key.shadow.camera.right = 10;+ key.shadow.camera.top = 10; key.shadow.camera.bottom = -3;+ key.shadow.camera.near = 1; key.shadow.camera.far = 25;+ scene.add(key);++ const rim = new THREE.DirectionalLight(0x2040ff, 1.2);+ rim.position.set(-6, 4, -6);+ scene.add(rim);++ const glow = new THREE.PointLight(0xd6ff3d, 0.8, 10);+ glow.position.set(0, 1.5, 0);+ scene.add(glow);++ // Coloured accent fill lights+ const pinkFill = new THREE.PointLight(0xff2060, 0.6, 18);+ pinkFill.position.set(-8, 2, 2);+ scene.add(pinkFill);++ const cyanFill = new THREE.PointLight(0x00e5ff, 0.5, 18);+ cyanFill.position.set(8, 2, -4);+ scene.add(cyanFill);++ // ── Reflective tron-grid floor ────────────────────────────────────────+ const gridC = document.createElement('canvas');+ gridC.width = gridC.height = 512;+ const gc = gridC.getContext('2d');+ gc.fillStyle = '#04050f';+ gc.fillRect(0, 0, 512, 512);+ // Fine grid+ gc.strokeStyle = '#0d0f22'; gc.lineWidth = 1;+ for (let i = 0; i <= 512; i += 32) {+ gc.beginPath(); gc.moveTo(i,0); gc.lineTo(i,512); gc.stroke();+ gc.beginPath(); gc.moveTo(0,i); gc.lineTo(512,i); gc.stroke();+ }+ // Neon accent lines every 128px+ gc.lineWidth = 2;+ gc.strokeStyle = '#1a2a6c';+ for (let i = 0; i <= 512; i += 128) {+ gc.beginPath(); gc.moveTo(i,0); gc.lineTo(i,512); gc.stroke();+ gc.beginPath(); gc.moveTo(0,i); gc.lineTo(512,i); gc.stroke();+ }+ const gridTex = new THREE.CanvasTexture(gridC);+ gridTex.wrapS = gridTex.wrapT = THREE.RepeatWrapping;+ gridTex.repeat.set(18, 18);++ const floor = new THREE.Mesh(+ new THREE.PlaneGeometry(40, 40),+ new THREE.MeshStandardMaterial({+ map: gridTex, roughness: 0.08, metalness: 0.6, envMapIntensity: 1.4,+ }),+ );+ floor.rotation.x = -Math.PI / 2;+ floor.receiveShadow = true;+ scene.add(floor);++ // Glowing floor perimeter strips+ const stripMat = new THREE.MeshStandardMaterial({+ color: 0x2040ff, emissive: 0x2040ff, emissiveIntensity: 1.2,+ roughness: 0.1, metalness: 0,+ });+ [[0, -12, 20, 0], [0, 12, 20, 0], [-10, 0, 0, 20], [10, 0, 0, 20]].forEach(([x, z, w, h]) => {+ const m = new THREE.Mesh(new THREE.PlaneGeometry(w || 0.06, h || 0.06), stripMat);+ m.rotation.x = -Math.PI / 2; m.position.set(x, 0.005, z); scene.add(m);+ });++ // ── Background arches / rings ──────────────────────────────────────────+ const ringMat = new THREE.MeshStandardMaterial({+ color: 0x1a2050, emissive: 0x1a2050, emissiveIntensity: 0.6,+ roughness: 0.3, metalness: 0.8, wireframe: false,+ });+ [+ { r: 5.5, tube: 0.06, x: 0, y: 5, z: -9, ry: 0 },+ { r: 3.5, tube: 0.05, x: -7, y: 4, z: -6, ry: 0.5 },+ { r: 2.8, tube: 0.04, x: 8, y: 3.5,z: -5, ry: -0.4 },+ ].forEach(({ r, tube, x, y, z, ry }) => {+ const ring = new THREE.Mesh(new THREE.TorusGeometry(r, tube, 8, 80), ringMat.clone());+ ring.position.set(x, y, z); ring.rotation.y = ry;+ scene.add(ring);+ });++ // Floating shard panels (translucent dark rectangles)+ const shardMat = new THREE.MeshStandardMaterial({+ color: 0x0a0d20, roughness: 0.1, metalness: 0.5,+ transparent: true, opacity: 0.35, side: THREE.DoubleSide,+ });+ [+ { x: -10, y: 4, z: -7, ry: 0.6, w: 3, h: 5 },+ { x: 10, y: 3, z: -6, ry: -0.5, w: 2.5, h: 4 },+ { x: 3, y: 6, z: -11, ry: 0.1, w: 6, h: 3 },+ ].forEach(({ x, y, z, ry, w, h }) => {+ const s = new THREE.Mesh(new THREE.PlaneGeometry(w, h), shardMat.clone());+ s.position.set(x, y, z); s.rotation.y = ry;+ scene.add(s);+ });++ // ── Helper: build a physical 3D button ───────────────────────────────+ function makeCapTex(l1, l2, accent) {+ const c = document.createElement('canvas');+ c.width = c.height = 512;+ const ctx = c.getContext('2d');+ const isMain = accent === 0xd6ff3d;+ const fg = isMain ? '#d6ff3d' : (accent === 0x3060ff ? '#3060ff' : '#ff3060');+ const g = ctx.createRadialGradient(256,256,0,256,256,222);+ g.addColorStop(0, isMain ? '#eeff66' : (accent === 0x3060ff ? '#4070ff' : '#ff4070'));+ g.addColorStop(0.65, fg);+ g.addColorStop(1, isMain ? '#aecf20' : (accent === 0x3060ff ? '#1030aa' : '#aa1030'));+ ctx.fillStyle = g;+ ctx.beginPath(); ctx.arc(256,256,222,0,Math.PI*2); ctx.fill();+ ctx.fillStyle = 'rgba(4,5,15,0.85)';+ ctx.font = 'bold 58px -apple-system, system-ui, sans-serif';+ ctx.textAlign = 'center'; ctx.textBaseline = 'middle';+ ctx.fillText(l1, 256, l2 ? 210 : 256);+ if (l2) ctx.fillText(l2, 256, 290);+ return new THREE.CanvasTexture(c);+ }++ function buildButton({ x, z, ry = 0, l1, l2, accent, sc = 1 }) {+ const g = new THREE.Group();+ g.position.set(x, 0, z); g.rotation.y = ry; g.scale.setScalar(sc);+ const baseMesh = new THREE.Mesh(+ new THREE.CylinderGeometry(2.05, 2.25, 0.85, 64),+ new THREE.MeshStandardMaterial({ color: 0x0a0b1a, roughness: 0.25, metalness: 0.92 }),+ );+ baseMesh.position.y = 0.425; baseMesh.castShadow = true; baseMesh.receiveShadow = true;+ g.add(baseMesh);++ const ledColor = new THREE.Color(accent);+ const ledRing = new THREE.Mesh(+ new THREE.TorusGeometry(1.88, 0.045, 8, 80),+ new THREE.MeshStandardMaterial({+ color: ledColor, emissive: ledColor, emissiveIntensity: 1.0,+ roughness: 0.2, metalness: 0,+ }),+ );+ ledRing.position.y = 0.84; ledRing.rotation.x = Math.PI / 2;+ g.add(ledRing);++ const CAP_H = 0.38, CAP_HALF = 0.19, BASE_TOP = 0.85;+ const capTex = makeCapTex(l1, l2, accent);+ const sideMat = new THREE.MeshStandardMaterial({+ color: new THREE.Color(accent).multiplyScalar(0.8),+ emissive: new THREE.Color(accent), emissiveIntensity: 0.1,+ roughness: 0.4, metalness: 0,+ });+ const topMat = new THREE.MeshStandardMaterial({+ map: capTex, emissive: new THREE.Color(accent), emissiveIntensity: 0.07,+ roughness: 0.35, metalness: 0,+ });+ const cap = new THREE.Mesh(+ new THREE.CylinderGeometry(1.74, 1.74, CAP_H, 64),+ [sideMat, topMat, sideMat],+ );+ cap.position.y = BASE_TOP + CAP_HALF;+ cap.castShadow = true; cap.receiveShadow = true;+ g.add(cap);+ scene.add(g);+ return { group: g, cap, ledRing, sideMat, topMat, CAP_H, CAP_HALF, BASE_TOP };+ }++ // ── Buttons ──────────────────────────────────────────────────────────+ const gs = buildButton({ x:0, z:0, l1:'GET', l2:'STARTED', accent:0xd6ff3d });+ buildButton({ x:6.5, z:-5, ry:-0.4, l1:'LEARN', l2:'MORE', accent:0x3060ff, sc:0.78 });+ buildButton({ x:-5.5,z:-4, ry: 0.4, l1:'SIGN', l2:'UP', accent:0xff3060, sc:0.68 });++ const CAP_REST = gs.BASE_TOP + gs.CAP_HALF;+ const BTN_TOP = gs.BASE_TOP + gs.CAP_H;++ // ── Spring physics ────────────────────────────────────────────────────+ let springY = 0, springV = 0, springing = false;++ function triggerSpring() {+ springY = -0.88; springV = 0; springing = true;+ gs.sideMat.emissiveIntensity = 0.8;+ gs.topMat.emissiveIntensity = 0.6;+ gs.ledRing.material.emissiveIntensity = 3.5;+ glow.intensity = 7.0;+ }++ function updateSpring(dt) {+ if (!springing) return;+ // Lower damping (9 vs 15) for more elastic overshoot+ springV += (-270 * springY - 9 * springV) * dt;+ springY += springV * dt;+ const s = Math.max(0.04, 1 + springY);++ // Volume preservation: Y compression → XZ bulge, Y overshoot → XZ pinch+ // Factor 0.19 gives ~1.16x bulge at full squish, ~0.98x pinch at overshoot+ const xz = 1 + (1 - s) * 0.19;++ gs.cap.scale.set(xz, s, xz);+ gs.cap.position.y = gs.BASE_TOP + gs.CAP_HALF * s;++ const mag = Math.abs(springY);+ gs.sideMat.emissiveIntensity = 0.10 + mag * 0.6;+ gs.topMat.emissiveIntensity = 0.07 + mag * 0.45;+ gs.ledRing.material.emissiveIntensity = 1.0 + mag * 3.0;+ glow.intensity = 0.8 + mag * 6.0;+ if (mag < 0.003 && Math.abs(springV) < 0.003) {+ springing = false; springY = 0; springV = 0;+ gs.cap.scale.set(1, 1, 1); gs.cap.position.y = CAP_REST;+ gs.sideMat.emissiveIntensity = 0.10; gs.topMat.emissiveIntensity = 0.07;+ gs.ledRing.material.emissiveIntensity = 1.0; glow.intensity = 0.8;+ }+ }++ // ── Particles ─────────────────────────────────────────────────────────+ const pool = [];+ function burst(y) {+ const N = 100;+ const pos = new Float32Array(N * 3);+ const vel = [];+ for (let i = 0; i < N; i++) {+ const a = Math.random() * Math.PI * 2;+ pos[i*3] = Math.cos(a) * Math.random() * 0.4;+ pos[i*3+1] = y;+ pos[i*3+2] = Math.sin(a) * Math.random() * 0.4;+ vel.push({+ x: Math.cos(a) * (1.5 + Math.random() * 3.5),+ y: 1.5 + Math.random() * 5.0,+ z: Math.sin(a) * (1.5 + Math.random() * 3.5),+ });+ }+ const geo = new THREE.BufferGeometry();+ geo.setAttribute('position', new THREE.BufferAttribute(pos, 3));+ const mat = new THREE.PointsMaterial({ color: 0xd6ff3d, size: 0.08, transparent: true });+ const pts = new THREE.Points(geo, mat);+ scene.add(pts);+ pool.push({ pts, geo, mat, vel, age: 0, life: 1.5 });+ }++ function updateParticles(dt) {+ for (let i = pool.length - 1; i >= 0; i--) {+ const p = pool[i]; p.age += dt;+ if (p.age >= p.life) {+ scene.remove(p.pts); p.geo.dispose(); p.mat.dispose();+ pool.splice(i, 1); continue;+ }+ const buf = p.geo.attributes.position.array;+ for (let j = 0; j < p.vel.length; j++) {+ buf[j*3] += p.vel[j].x * dt;+ buf[j*3+1] += p.vel[j].y * dt;+ buf[j*3+2] += p.vel[j].z * dt;+ p.vel[j].y -= 9.8 * dt;+ }+ p.geo.attributes.position.needsUpdate = true;+ p.mat.opacity = 1 - p.age / p.life;+ }+ }++ // ── Avatar ────────────────────────────────────────────────────────────+ const gltfLoader = new GLTFLoader();+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;+ let fallAction = null;++ async function boot() {+ const gltf = await new Promise((ok, fail) =>+ gltfLoader.load('/avatars/cz.glb', ok, undefined, fail));+ avatar = gltf.scene;+ avatar.traverse(n => {+ if (n.isMesh) { n.castShadow = true; n.receiveShadow = true; }+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name))+ rootBone = n;+ });+ avatar.rotation.y = Math.PI;+ scene.add(avatar);++ mixer = new THREE.AnimationMixer(avatar);+ const r = await fetch('/animations/clips/jumpdown3.json');+ const clip = THREE.AnimationClip.parse(await r.json());+ fallAction = mixer.clipAction(clip);+ fallAction.setLoop(THREE.LoopOnce, 1);+ fallAction.clampWhenFinished = true;++ // Pin root bone before each draw so root motion can't fight our Y path+ if (rootBone) baseRootPos = rootBone.position.clone();+ const _render = renderer.render.bind(renderer);+ renderer.render = (sc, cam) => {+ try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}+ _render(sc, cam);+ };++ runSequence();+ }++ // ── Sequence ──────────────────────────────────────────────────────────+ const FALL_DUR = 2.933;+ const LAND_AT = 2.35; // seconds into clip when feet visually touch the cap+ const DROP_FROM = BTN_TOP + 3.8;+ let seqT = 0, landed = false;++ function runSequence() {+ seqT = 0; landed = false;+ if (avatar) avatar.position.set(0, DROP_FROM, 0);+ fallAction.reset().play();+ }++ function updateSeq(dt) {+ if (!avatar) return;+ seqT += dt;++ if (seqT <= LAND_AT) {+ // Accelerating fall — quadratic ease-in so it feels like gravity+ const p = seqT / LAND_AT;+ avatar.position.y = DROP_FROM + (BTN_TOP - DROP_FROM) * (p * p);+ } else {+ // Feet on the button — track the squishing cap+ avatar.position.y = gs.cap.position.y + gs.CAP_HALF * gs.cap.scale.y;+ if (!landed) {+ landed = true;+ triggerSpring();+ burst(BTN_TOP);+ }+ }++ if (seqT >= FALL_DUR + 1.2) runSequence();+ }++ // ── Render loop ───────────────────────────────────────────────────────+ const clock = new THREE.Clock();+ let elapsed = 0;+ (function animate() {+ requestAnimationFrame(animate);+ const dt = Math.min(clock.getDelta(), 0.05);+ elapsed += dt;+ controls.update();+ mixer?.update(dt);+ updateSpring(dt);+ updateSeq(dt);+ updateParticles(dt);+ // Slowly rotate background rings for atmosphere+ scene.children.forEach(c => {+ if (c.geometry?.type === 'TorusGeometry' && c !== gs.ledRing) {+ c.rotation.z += dt * 0.08;+ }+ });+ renderer.render(scene, camera);+ })();++ boot().catch(console.error);+ </script>+ </body>+</html>diff --git a/public/demos/button.html b/public/demos/button.htmlnew file mode 100644index 000000000..fabd34333--- /dev/null+++ b/public/demos/button.html@@ -0,0 +1,452 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>button · three.ws</title>+ <meta name="robots" content="noindex" />+ <style>+ *, *::before, *::after { box-sizing: border-box; }+ html, body { height: 100%; margin: 0; background: #02030a; overflow: hidden; }+ canvas { display: block; width: 100%; height: 100%; }+ .hint {+ position: fixed; bottom: 22px; left: 50%;+ transform: translateX(-50%);+ color: #1e2030; font: 12px/1 -apple-system, system-ui, sans-serif;+ letter-spacing: 0.08em; pointer-events: none; z-index: 2;+ }+ </style>+ </head>+ <body>+ <canvas id="c"></canvas>+ <div class="hint">drag to orbit · scroll to zoom</div>++ <script type="module">+ import * as THREE from 'three';+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';+ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';++ // ── Renderer ─────────────────────────────────────────────────────────+ const canvas = document.getElementById('c');+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.1;+ renderer.shadowMap.enabled = true;+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;++ const scene = new THREE.Scene();+ scene.fog = new THREE.FogExp2(0x02030a, 0.022);++ const pmrem = new THREE.PMREMGenerator(renderer);+ scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;++ // ── Camera & controls ─────────────────────────────────────────────────+ const camera = new THREE.PerspectiveCamera(42, 1, 0.05, 120);+ camera.position.set(1.2, 3.2, 9.0);++ const controls = new OrbitControls(camera, canvas);+ controls.target.set(0, 1.0, -1.0);+ controls.enableDamping = true;+ controls.dampingFactor = 0.07;+ controls.minDistance = 2;+ controls.maxDistance = 40;+ controls.maxPolarAngle = Math.PI / 2 - 0.02;+ controls.update();++ function resize() {+ renderer.setSize(window.innerWidth, window.innerHeight, false);+ camera.aspect = window.innerWidth / window.innerHeight;+ camera.updateProjectionMatrix();+ }+ window.addEventListener('resize', resize);+ resize();++ // ── Star-field skybox sphere ──────────────────────────────────────────+ const skyC = document.createElement('canvas');+ skyC.width = 2048; skyC.height = 1024;+ const skyCtx = skyC.getContext('2d');+ skyCtx.fillStyle = '#02030b';+ skyCtx.fillRect(0, 0, 2048, 1024);+ // Nebula smear+ const neb = skyCtx.createRadialGradient(900, 400, 0, 900, 400, 600);+ neb.addColorStop(0, 'rgba(40,20,90,0.18)');+ neb.addColorStop(0.5, 'rgba(10,5,40,0.08)');+ neb.addColorStop(1, 'rgba(0,0,0,0)');+ skyCtx.fillStyle = neb; skyCtx.fillRect(0, 0, 2048, 1024);+ const neb2 = skyCtx.createRadialGradient(1600, 700, 0, 1600, 700, 400);+ neb2.addColorStop(0, 'rgba(0,40,80,0.12)');+ neb2.addColorStop(1, 'rgba(0,0,0,0)');+ skyCtx.fillStyle = neb2; skyCtx.fillRect(0, 0, 2048, 1024);+ // Stars+ for (let i = 0; i < 2400; i++) {+ const x = Math.random() * 2048, y = Math.random() * 1024;+ const r = Math.random() * 1.3 + 0.2;+ const a = Math.random() * 0.85 + 0.15;+ const tint = Math.random();+ const col = tint > 0.75+ ? `rgba(160,200,255,${a})` // blue+ : tint > 0.5+ ? `rgba(255,220,180,${a})` // warm+ : `rgba(255,255,255,${a})`;+ skyCtx.fillStyle = col;+ skyCtx.beginPath(); skyCtx.arc(x, y, r, 0, Math.PI * 2); skyCtx.fill();+ }+ const skyTex = new THREE.CanvasTexture(skyC);+ scene.add(new THREE.Mesh(+ new THREE.SphereGeometry(80, 32, 16),+ new THREE.MeshBasicMaterial({ map: skyTex, side: THREE.BackSide }),+ ));+ scene.background = new THREE.Color(0x02030b);++ // ── Lights ───────────────────────────────────────────────────────────+ scene.add(new THREE.AmbientLight(0x4050aa, 0.2));++ const key = new THREE.DirectionalLight(0xfff4dc, 2.2);+ key.position.set(4, 9, 6);+ key.castShadow = true;+ key.shadow.mapSize.setScalar(2048);+ key.shadow.camera.left = -10; key.shadow.camera.right = 10;+ key.shadow.camera.top = 10; key.shadow.camera.bottom = -3;+ key.shadow.camera.near = 1; key.shadow.camera.far = 25;+ scene.add(key);++ const rim = new THREE.DirectionalLight(0x2040ff, 1.2);+ rim.position.set(-6, 4, -6);+ scene.add(rim);++ const glow = new THREE.PointLight(0xd6ff3d, 0.8, 10);+ glow.position.set(0, 1.5, 0);+ scene.add(glow);++ // Coloured accent fill lights+ const pinkFill = new THREE.PointLight(0xff2060, 0.6, 18);+ pinkFill.position.set(-8, 2, 2);+ scene.add(pinkFill);++ const cyanFill = new THREE.PointLight(0x00e5ff, 0.5, 18);+ cyanFill.position.set(8, 2, -4);+ scene.add(cyanFill);++ // ── Reflective tron-grid floor ────────────────────────────────────────+ const gridC = document.createElement('canvas');+ gridC.width = gridC.height = 512;+ const gc = gridC.getContext('2d');+ gc.fillStyle = '#04050f';+ gc.fillRect(0, 0, 512, 512);+ // Fine grid+ gc.strokeStyle = '#0d0f22'; gc.lineWidth = 1;+ for (let i = 0; i <= 512; i += 32) {+ gc.beginPath(); gc.moveTo(i,0); gc.lineTo(i,512); gc.stroke();+ gc.beginPath(); gc.moveTo(0,i); gc.lineTo(512,i); gc.stroke();+ }+ // Neon accent lines every 128px+ gc.lineWidth = 2;+ gc.strokeStyle = '#1a2a6c';+ for (let i = 0; i <= 512; i += 128) {+ gc.beginPath(); gc.moveTo(i,0); gc.lineTo(i,512); gc.stroke();+ gc.beginPath(); gc.moveTo(0,i); gc.lineTo(512,i); gc.stroke();+ }+ const gridTex = new THREE.CanvasTexture(gridC);+ gridTex.wrapS = gridTex.wrapT = THREE.RepeatWrapping;+ gridTex.repeat.set(18, 18);++ const floor = new THREE.Mesh(+ new THREE.PlaneGeometry(40, 40),+ new THREE.MeshStandardMaterial({+ map: gridTex, roughness: 0.08, metalness: 0.6, envMapIntensity: 1.4,+ }),+ );+ floor.rotation.x = -Math.PI / 2;+ floor.receiveShadow = true;+ scene.add(floor);++ // Glowing floor perimeter strips+ const stripMat = new THREE.MeshStandardMaterial({+ color: 0x2040ff, emissive: 0x2040ff, emissiveIntensity: 1.2,+ roughness: 0.1, metalness: 0,+ });+ [[0, -12, 20, 0], [0, 12, 20, 0], [-10, 0, 0, 20], [10, 0, 0, 20]].forEach(([x, z, w, h]) => {+ const m = new THREE.Mesh(new THREE.PlaneGeometry(w || 0.06, h || 0.06), stripMat);+ m.rotation.x = -Math.PI / 2; m.position.set(x, 0.005, z); scene.add(m);+ });++ // ── Background arches / rings ──────────────────────────────────────────+ const ringMat = new THREE.MeshStandardMaterial({+ color: 0x1a2050, emissive: 0x1a2050, emissiveIntensity: 0.6,+ roughness: 0.3, metalness: 0.8, wireframe: false,+ });+ [+ { r: 5.5, tube: 0.06, x: 0, y: 5, z: -9, ry: 0 },+ { r: 3.5, tube: 0.05, x: -7, y: 4, z: -6, ry: 0.5 },+ { r: 2.8, tube: 0.04, x: 8, y: 3.5,z: -5, ry: -0.4 },+ ].forEach(({ r, tube, x, y, z, ry }) => {+ const ring = new THREE.Mesh(new THREE.TorusGeometry(r, tube, 8, 80), ringMat.clone());+ ring.position.set(x, y, z); ring.rotation.y = ry;+ scene.add(ring);+ });++ // Floating shard panels (translucent dark rectangles)+ const shardMat = new THREE.MeshStandardMaterial({+ color: 0x0a0d20, roughness: 0.1, metalness: 0.5,+ transparent: true, opacity: 0.35, side: THREE.DoubleSide,+ });+ [+ { x: -10, y: 4, z: -7, ry: 0.6, w: 3, h: 5 },+ { x: 10, y: 3, z: -6, ry: -0.5, w: 2.5, h: 4 },+ { x: 3, y: 6, z: -11, ry: 0.1, w: 6, h: 3 },+ ].forEach(({ x, y, z, ry, w, h }) => {+ const s = new THREE.Mesh(new THREE.PlaneGeometry(w, h), shardMat.clone());+ s.position.set(x, y, z); s.rotation.y = ry;+ scene.add(s);+ });++ // ── Helper: build a physical 3D button ───────────────────────────────+ function makeCapTex(l1, l2, accent) {+ const c = document.createElement('canvas');+ c.width = c.height = 512;+ const ctx = c.getContext('2d');+ const isMain = accent === 0xd6ff3d;+ const fg = isMain ? '#d6ff3d' : (accent === 0x3060ff ? '#3060ff' : '#ff3060');+ const g = ctx.createRadialGradient(256,256,0,256,256,222);+ g.addColorStop(0, isMain ? '#eeff66' : (accent === 0x3060ff ? '#4070ff' : '#ff4070'));+ g.addColorStop(0.65, fg);+ g.addColorStop(1, isMain ? '#aecf20' : (accent === 0x3060ff ? '#1030aa' : '#aa1030'));+ ctx.fillStyle = g;+ ctx.beginPath(); ctx.arc(256,256,222,0,Math.PI*2); ctx.fill();+ ctx.fillStyle = 'rgba(4,5,15,0.85)';+ ctx.font = 'bold 58px -apple-system, system-ui, sans-serif';+ ctx.textAlign = 'center'; ctx.textBaseline = 'middle';+ ctx.fillText(l1, 256, l2 ? 210 : 256);+ if (l2) ctx.fillText(l2, 256, 290);+ return new THREE.CanvasTexture(c);+ }++ function buildButton({ x, z, ry = 0, l1, l2, accent, sc = 1 }) {+ const g = new THREE.Group();+ g.position.set(x, 0, z); g.rotation.y = ry; g.scale.setScalar(sc);+ const baseMesh = new THREE.Mesh(+ new THREE.CylinderGeometry(2.05, 2.25, 0.85, 64),+ new THREE.MeshStandardMaterial({ color: 0x0a0b1a, roughness: 0.25, metalness: 0.92 }),+ );+ baseMesh.position.y = 0.425; baseMesh.castShadow = true; baseMesh.receiveShadow = true;+ g.add(baseMesh);++ const ledColor = new THREE.Color(accent);+ const ledRing = new THREE.Mesh(+ new THREE.TorusGeometry(1.88, 0.045, 8, 80),+ new THREE.MeshStandardMaterial({+ color: ledColor, emissive: ledColor, emissiveIntensity: 1.0,+ roughness: 0.2, metalness: 0,+ }),+ );+ ledRing.position.y = 0.84; ledRing.rotation.x = Math.PI / 2;+ g.add(ledRing);++ const CAP_H = 0.38, CAP_HALF = 0.19, BASE_TOP = 0.85;+ const capTex = makeCapTex(l1, l2, accent);+ const sideMat = new THREE.MeshStandardMaterial({+ color: new THREE.Color(accent).multiplyScalar(0.8),+ emissive: new THREE.Color(accent), emissiveIntensity: 0.1,+ roughness: 0.4, metalness: 0,+ });+ const topMat = new THREE.MeshStandardMaterial({+ map: capTex, emissive: new THREE.Color(accent), emissiveIntensity: 0.07,+ roughness: 0.35, metalness: 0,+ });+ const cap = new THREE.Mesh(+ new THREE.CylinderGeometry(1.74, 1.74, CAP_H, 64),+ [sideMat, topMat, sideMat],+ );+ cap.position.y = BASE_TOP + CAP_HALF;+ cap.castShadow = true; cap.receiveShadow = true;+ g.add(cap);+ scene.add(g);+ return { group: g, cap, ledRing, sideMat, topMat, CAP_H, CAP_HALF, BASE_TOP };+ }++ // ── Buttons ──────────────────────────────────────────────────────────+ const gs = buildButton({ x:0, z:0, l1:'GET', l2:'STARTED', accent:0xd6ff3d });+ buildButton({ x:6.5, z:-5, ry:-0.4, l1:'LEARN', l2:'MORE', accent:0x3060ff, sc:0.78 });+ buildButton({ x:-5.5,z:-4, ry: 0.4, l1:'SIGN', l2:'UP', accent:0xff3060, sc:0.68 });++ const CAP_REST = gs.BASE_TOP + gs.CAP_HALF;+ const BTN_TOP = gs.BASE_TOP + gs.CAP_H;++ // ── Spring physics ────────────────────────────────────────────────────+ let springY = 0, springV = 0, springing = false;++ function triggerSpring() {+ springY = -0.88; springV = 0; springing = true;+ gs.sideMat.emissiveIntensity = 0.8;+ gs.topMat.emissiveIntensity = 0.6;+ gs.ledRing.material.emissiveIntensity = 3.5;+ glow.intensity = 7.0;+ }++ function updateSpring(dt) {+ if (!springing) return;+ // Lower damping (9 vs 15) for more elastic overshoot+ springV += (-270 * springY - 9 * springV) * dt;+ springY += springV * dt;+ const s = Math.max(0.04, 1 + springY);++ // Volume preservation: Y compression → XZ bulge, Y overshoot → XZ pinch+ // Factor 0.19 gives ~1.16x bulge at full squish, ~0.98x pinch at overshoot+ const xz = 1 + (1 - s) * 0.19;++ gs.cap.scale.set(xz, s, xz);+ gs.cap.position.y = gs.BASE_TOP + gs.CAP_HALF * s;++ const mag = Math.abs(springY);+ gs.sideMat.emissiveIntensity = 0.10 + mag * 0.6;+ gs.topMat.emissiveIntensity = 0.07 + mag * 0.45;+ gs.ledRing.material.emissiveIntensity = 1.0 + mag * 3.0;+ glow.intensity = 0.8 + mag * 6.0;+ if (mag < 0.003 && Math.abs(springV) < 0.003) {+ springing = false; springY = 0; springV = 0;+ gs.cap.scale.set(1, 1, 1); gs.cap.position.y = CAP_REST;+ gs.sideMat.emissiveIntensity = 0.10; gs.topMat.emissiveIntensity = 0.07;+ gs.ledRing.material.emissiveIntensity = 1.0; glow.intensity = 0.8;+ }+ }++ // ── Particles ─────────────────────────────────────────────────────────+ const pool = [];+ function burst(y) {+ const N = 100;+ const pos = new Float32Array(N * 3);+ const vel = [];+ for (let i = 0; i < N; i++) {+ const a = Math.random() * Math.PI * 2;+ pos[i*3] = Math.cos(a) * Math.random() * 0.4;+ pos[i*3+1] = y;+ pos[i*3+2] = Math.sin(a) * Math.random() * 0.4;+ vel.push({+ x: Math.cos(a) * (1.5 + Math.random() * 3.5),+ y: 1.5 + Math.random() * 5.0,+ z: Math.sin(a) * (1.5 + Math.random() * 3.5),+ });+ }+ const geo = new THREE.BufferGeometry();+ geo.setAttribute('position', new THREE.BufferAttribute(pos, 3));+ const mat = new THREE.PointsMaterial({ color: 0xd6ff3d, size: 0.08, transparent: true });+ const pts = new THREE.Points(geo, mat);+ scene.add(pts);+ pool.push({ pts, geo, mat, vel, age: 0, life: 1.5 });+ }++ function updateParticles(dt) {+ for (let i = pool.length - 1; i >= 0; i--) {+ const p = pool[i]; p.age += dt;+ if (p.age >= p.life) {+ scene.remove(p.pts); p.geo.dispose(); p.mat.dispose();+ pool.splice(i, 1); continue;+ }+ const buf = p.geo.attributes.position.array;+ for (let j = 0; j < p.vel.length; j++) {+ buf[j*3] += p.vel[j].x * dt;+ buf[j*3+1] += p.vel[j].y * dt;+ buf[j*3+2] += p.vel[j].z * dt;+ p.vel[j].y -= 9.8 * dt;+ }+ p.geo.attributes.position.needsUpdate = true;+ p.mat.opacity = 1 - p.age / p.life;+ }+ }++ // ── Avatar ────────────────────────────────────────────────────────────+ const gltfLoader = new GLTFLoader();+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;+ let fallAction = null;++ async function boot() {+ const gltf = await new Promise((ok, fail) =>+ gltfLoader.load('/avatars/cz.glb', ok, undefined, fail));+ avatar = gltf.scene;+ avatar.traverse(n => {+ if (n.isMesh) { n.castShadow = true; n.receiveShadow = true; }+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name))+ rootBone = n;+ });+ avatar.rotation.y = Math.PI;+ scene.add(avatar);++ mixer = new THREE.AnimationMixer(avatar);+ const r = await fetch('/animations/clips/jumpdown3.json');+ const clip = THREE.AnimationClip.parse(await r.json());+ fallAction = mixer.clipAction(clip);+ fallAction.setLoop(THREE.LoopOnce, 1);+ fallAction.clampWhenFinished = true;++ // Pin root bone before each draw so root motion can't fight our Y path+ if (rootBone) baseRootPos = rootBone.position.clone();+ const _render = renderer.render.bind(renderer);+ renderer.render = (sc, cam) => {+ try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}+ _render(sc, cam);+ };++ runSequence();+ }++ // ── Sequence ──────────────────────────────────────────────────────────+ const FALL_DUR = 2.933;+ const LAND_AT = 2.35; // seconds into clip when feet visually touch the cap+ const DROP_FROM = BTN_TOP + 3.8;+ let seqT = 0, landed = false;++ function runSequence() {+ seqT = 0; landed = false;+ if (avatar) avatar.position.set(0, DROP_FROM, 0);+ fallAction.reset().play();+ }++ function updateSeq(dt) {+ if (!avatar) return;+ seqT += dt;++ if (seqT <= LAND_AT) {+ // Accelerating fall — quadratic ease-in so it feels like gravity+ const p = seqT / LAND_AT;+ avatar.position.y = DROP_FROM + (BTN_TOP - DROP_FROM) * (p * p);+ } else {+ // Feet on the button — track the squishing cap+ avatar.position.y = gs.cap.position.y + gs.CAP_HALF * gs.cap.scale.y;+ if (!landed) {+ landed = true;+ triggerSpring();+ burst(BTN_TOP);+ }+ }++ if (seqT >= FALL_DUR + 1.2) runSequence();+ }++ // ── Render loop ───────────────────────────────────────────────────────+ const clock = new THREE.Clock();+ let elapsed = 0;+ (function animate() {+ requestAnimationFrame(animate);+ const dt = Math.min(clock.getDelta(), 0.05);+ elapsed += dt;+ controls.update();+ mixer?.update(dt);+ updateSpring(dt);+ updateSeq(dt);+ updateParticles(dt);+ // Slowly rotate background rings for atmosphere+ scene.children.forEach(c => {+ if (c.geometry?.type === 'TorusGeometry' && c !== gs.ledRing) {+ c.rotation.z += dt * 0.08;+ }+ });+ renderer.render(scene, camera);+ })();++ boot().catch(console.error);+ </script>+ </body>+</html>diff --git a/public/demos/create-v2.html b/public/demos/create-v2.htmlnew file mode 100644index 000000000..3591a59dd--- /dev/null+++ b/public/demos/create-v2.html@@ -0,0 +1,486 @@+<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>Create avatar v2 demo · three.ws</title>+ <meta name="robots" content="noindex" />+ <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <style>+ :root {+ color-scheme: dark;+ --accent: #d6ff3d;+ --accent-ink: #0a0a0a;+ --bg: #05060a;+ --panel: #0f1018;+ --border: #1e1f2b;+ --text: #eee;+ --muted: #8a8d98;+ }+ * { box-sizing: border-box; }+ html, body { margin: 0; padding: 0; }+ body {+ font: 15px/1.55 -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;+ color: var(--text);+ background: var(--bg);+ min-height: 100vh;+ }+ body::before {+ content: '';+ position: fixed;+ inset: 0;+ z-index: -1;+ pointer-events: none;+ background:+ radial-gradient(800px 500px at 50% -100px, rgba(106,92,255,.12) 0, transparent 70%),+ radial-gradient(600px 400px at 50% 110%, rgba(214,255,61,.05) 0, transparent 70%),+ #05060a;+ }++ /* ── demo banner ─────────────────────────────────────────────── */+ .demo-banner {+ background: rgba(214,255,61,.08);+ border-bottom: 1px solid rgba(214,255,61,.2);+ padding: 8px 20px;+ text-align: center;+ font-size: 12px;+ color: rgba(214,255,61,.8);+ letter-spacing: 0.03em;+ }+ .demo-banner a { color: inherit; text-underline-offset: 2px; }++ /* ── stage ───────────────────────────────────────────────────── */+ main.stage {+ max-width: 1100px;+ margin: 0 auto;+ padding: 52px 24px 80px;+ }++ /* ── hero heading ────────────────────────────────────────────── */+ .hero {+ text-align: center;+ margin-bottom: 40px;+ }+ .hero h1 {+ font-size: clamp(22px, 4vw, 30px);+ font-weight: 600;+ letter-spacing: -0.02em;+ margin: 0 0 10px;+ }+ .hero-sub {+ color: var(--muted);+ font-size: 14px;+ margin: 0 0 24px;+ max-width: 52ch;+ margin-left: auto;+ margin-right: auto;+ line-height: 1.6;+ }++ /* ── stats strip ─────────────────────────────────────────────── */+ .stats-strip {+ display: flex;+ justify-content: center;+ gap: 28px;+ flex-wrap: wrap;+ margin-bottom: 44px;+ }+ .stat {+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 2px;+ }+ .stat-num {+ font-size: 20px;+ font-weight: 700;+ letter-spacing: -0.03em;+ color: var(--text);+ font-variant-numeric: tabular-nums;+ }+ .stat-num.loading { color: var(--muted); font-size: 16px; }+ .stat-label {+ font-size: 11px;+ color: var(--muted);+ text-transform: uppercase;+ letter-spacing: 0.08em;+ }+ .stats-divider {+ width: 1px;+ height: 32px;+ background: var(--border);+ align-self: center;+ }++ /* ── layout: featured + row ──────────────────────────────────── */+ .create-layout {+ display: grid;+ grid-template-columns: 1fr 1fr;+ grid-template-rows: auto auto;+ gap: 16px;+ max-width: 840px;+ margin: 0 auto;+ }++ /* ── base card ───────────────────────────────────────────────── */+ .create-card {+ position: relative;+ display: flex;+ flex-direction: column;+ padding: 22px 22px 20px;+ border-radius: 18px;+ background: var(--panel);+ border: 1.5px solid var(--border);+ cursor: pointer;+ text-align: left;+ color: inherit;+ font: inherit;+ transition: border-color .18s, transform .18s, box-shadow .18s;+ }+ .create-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }+ .create-card:hover {+ transform: translateY(-2px);+ border-color: #2c2d3d;+ box-shadow: 0 14px 36px rgba(0,0,0,.45);+ }++ /* featured card spans both columns in row 1 */+ .create-card.featured {+ grid-column: 1 / -1;+ flex-direction: row;+ gap: 28px;+ padding: 28px;+ border-color: rgba(214,255,61,.35);+ background:+ radial-gradient(500px 260px at 20% -20px, rgba(214,255,61,.07) 0, transparent 70%),+ var(--panel);+ }+ .create-card.featured:hover { border-color: rgba(214,255,61,.6); }++ .create-card.featured .card-preview {+ width: 220px;+ height: 220px;+ flex-shrink: 0;+ }+ .create-card.featured .card-body {+ flex: 1;+ display: flex;+ flex-direction: column;+ justify-content: center;+ }++ /* small card: no separate .card-body wrapper needed */+ .card-preview {+ width: 100%;+ height: 180px;+ border-radius: 12px;+ background: radial-gradient(circle at 50% 30%, rgba(214,255,61,.06) 0, transparent 60%), rgba(255,255,255,.02);+ border: 1px solid var(--border);+ margin-bottom: 16px;+ overflow: hidden;+ flex-shrink: 0;+ }+ .card-preview model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }+ .card-preview--icon {+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .card-preview--icon svg {+ width: 48px;+ height: 48px;+ color: rgba(255,255,255,.35);+ }++ /* ── badges row ──────────────────────────────────────────────── */+ .card-badges {+ display: flex;+ gap: 6px;+ align-items: center;+ margin-bottom: 10px;+ flex-wrap: wrap;+ }+ .badge {+ padding: 2px 8px;+ border-radius: 20px;+ font-size: 10.5px;+ font-weight: 600;+ letter-spacing: 0.05em;+ }+ .badge-recommended {+ background: rgba(214,255,61,.12);+ border: 1px solid rgba(214,255,61,.35);+ color: var(--accent);+ text-transform: uppercase;+ }+ .badge-time {+ background: rgba(255,255,255,.05);+ border: 1px solid var(--border);+ color: var(--muted);+ }++ /* ── card text ───────────────────────────────────────────────── */+ .card-title {+ font-size: 17px;+ font-weight: 600;+ margin: 0 0 6px;+ letter-spacing: -0.01em;+ line-height: 1.25;+ }+ .featured .card-title { font-size: 20px; }++ .card-subtitle {+ font-size: 13px;+ color: var(--muted);+ margin: 0 0 6px;+ line-height: 1.55;+ flex: 1;+ }++ .card-destination {+ font-size: 12px;+ color: rgba(214,255,61,.65);+ margin: 0 0 16px;+ display: flex;+ align-items: center;+ gap: 5px;+ }+ .card-destination::before {+ content: '→';+ font-size: 11px;+ }++ /* ── CTA button ──────────────────────────────────────────────── */+ .card-cta {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 9px 16px;+ border-radius: 10px;+ background: rgba(255,255,255,.06);+ border: 1px solid var(--border);+ color: var(--text);+ font: inherit;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ transition: background .15s, border-color .15s;+ align-self: flex-start;+ text-decoration: none;+ }+ .create-card:hover .card-cta,+ .create-card.featured .card-cta {+ background: var(--accent);+ border-color: transparent;+ color: var(--accent-ink);+ }++ /* ── integrations strip ──────────────────────────────────────── */+ .integrations {+ max-width: 840px;+ margin: 28px auto 0;+ display: flex;+ align-items: center;+ gap: 8px;+ flex-wrap: wrap;+ justify-content: center;+ }+ .integrations-label {+ font-size: 11px;+ color: var(--muted);+ letter-spacing: 0.05em;+ text-transform: uppercase;+ margin-right: 4px;+ }+ .int-badge {+ padding: 4px 12px;+ border-radius: 20px;+ font-size: 11.5px;+ font-weight: 500;+ border: 1px solid var(--border);+ color: var(--muted);+ background: rgba(255,255,255,.025);+ }++ /* ── mobile ──────────────────────────────────────────────────── */+ @media (max-width: 640px) {+ main.stage { padding: 32px 16px 60px; }+ .create-layout { grid-template-columns: 1fr; }+ .create-card.featured {+ flex-direction: column;+ grid-column: auto;+ }+ .create-card.featured .card-preview {+ width: 100%;+ height: 200px;+ }+ .stats-strip { gap: 16px; }+ .stats-divider { display: none; }+ }+ </style>+</head>+<body>+ <div class="demo-banner">+ Design demo — <a href="/create">view current /create page</a> · <a href="/demos">all demos</a>+ </div>++ <main class="stage">+ <div class="hero">+ <h1>Create your avatar</h1>+ <p class="hero-sub">Pick a path — you'll have a rigged, talking 3D avatar ready to embed, speak, or deploy as an AI agent.</p>+ </div>++ <div class="stats-strip" id="stats-strip">+ <div class="stat">+ <span class="stat-num loading" id="stat-avatars">—</span>+ <span class="stat-label">avatars created</span>+ </div>+ <div class="stats-divider"></div>+ <div class="stat">+ <span class="stat-num loading" id="stat-agents">—</span>+ <span class="stat-label">AI agents embodied</span>+ </div>+ <div class="stats-divider"></div>+ <div class="stat">+ <span class="stat-num">190+</span>+ <span class="stat-label">countries</span>+ </div>+ </div>++ <div class="create-layout" role="group" aria-label="Choose avatar creation method">++ <!-- Featured: Template (recommended) -->+ <div class="create-card featured" id="card-template" role="button" tabindex="0" aria-label="Start with a template — recommended">+ <div class="card-preview">+ <model-viewer+ src="/avatars/default.glb"+ alt="Customizable 3D avatar template"+ auto-rotate+ auto-rotate-delay="0"+ rotation-per-second="18deg"+ interaction-prompt="none"+ disable-zoom disable-pan disable-tap+ shadow-intensity="0.5"+ shadow-softness="0.8"+ exposure="0.95"+ environment-image="neutral"+ camera-orbit="10deg 78deg auto"+ loading="eager"+ ></model-viewer>+ </div>+ <div class="card-body">+ <div class="card-badges">+ <span class="badge badge-recommended">Recommended</span>+ <span class="badge badge-time">~5 min</span>+ </div>+ <h2 class="card-title">Start with a template</h2>+ <p class="card-subtitle">Choose a ready-made character and customize skin, hair, outfit, and accessories in the browser. No download required.</p>+ <p class="card-destination">Talk in realtime · embed in any site · export as GLB</p>+ <span class="card-cta">+ Open editor+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>+ </span>+ </div>+ </div>++ <!-- Selfie to avatar -->+ <div class="create-card" id="card-selfie" role="button" tabindex="0" aria-label="Create from a selfie">+ <div class="card-preview">+ <model-viewer+ src="/avatars/cz.glb"+ alt="Photo-realistic selfie avatar"+ auto-rotate+ auto-rotate-delay="0"+ rotation-per-second="22deg"+ interaction-prompt="none"+ disable-zoom disable-pan disable-tap+ shadow-intensity="0.4"+ shadow-softness="0.8"+ exposure="0.95"+ environment-image="neutral"+ camera-orbit="-10deg 80deg auto"+ loading="lazy"+ ></model-viewer>+ </div>+ <div class="card-badges">+ <span class="badge badge-time">~1 min</span>+ </div>+ <h2 class="card-title">Selfie to avatar</h2>+ <p class="card-subtitle">Three photos — front, left, right. three.ws generates a rigged avatar that looks like you.</p>+ <p class="card-destination">Photorealistic · fully rigged · lip-sync ready</p>+ <span class="card-cta">+ Take 3 photos+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>+ </span>+ </div>++ <!-- Upload GLB -->+ <div class="create-card" id="card-upload" role="button" tabindex="0" aria-label="Upload a GLB file">+ <div class="card-preview card-preview--icon">+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <polyline points="16 16 12 12 8 16"/>+ <line x1="12" y1="12" x2="12" y2="21"/>+ <path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"/>+ </svg>+ </div>+ <div class="card-badges">+ <span class="badge badge-time">Instant</span>+ </div>+ <h2 class="card-title">Upload your GLB</h2>+ <p class="card-subtitle">Drop any glTF 2.0 <code style="font-size:11px;opacity:.7">.glb</code> file. Works with Blender, Unity, or any 3D tool export.</p>+ <p class="card-destination">Import · animate · deploy</p>+ <span class="card-cta">+ Choose file+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>+ </span>+ </div>++ </div>++ <!-- integrations strip -->+ <div class="integrations">+ <span class="integrations-label">Works with</span>+ <span class="int-badge">OpenAI Realtime</span>+ <span class="int-badge">ERC-8004 agents</span>+ <span class="int-badge">Solana</span>+ <span class="int-badge">WebGL / Three.js</span>+ <span class="int-badge">Unreal Engine</span>+ </div>+ </main>++ <script type="module">+ // Fetch real totals from /api/explore+ try {+ const res = await fetch('/api/explore?limit=1');+ if (res.ok) {+ const data = await res.json();+ const t = data.totals;+ if (t) {+ const fmt = n => n >= 1000 ? `${(n/1000).toFixed(1)}k+` : `${n}+`;+ const avatarEl = document.getElementById('stat-avatars');+ const agentEl = document.getElementById('stat-agents');+ if (avatarEl && t.avatars != null) {+ avatarEl.textContent = fmt(t.avatars);+ avatarEl.classList.remove('loading');+ }+ if (agentEl && t.agents != null) {+ agentEl.textContent = fmt(t.agents);+ agentEl.classList.remove('loading');+ }+ }+ }+ } catch (_) {}++ // Keyboard nav for cards+ document.querySelectorAll('.create-card').forEach(card => {+ card.addEventListener('keydown', e => {+ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); card.click(); }+ });+ });+ </script>+</body>+</html>diff --git a/public/demos/gemini-jump.html b/public/demos/gemini-jump.htmlnew file mode 100644index 000000000..8c350cf51--- /dev/null+++ b/public/demos/gemini-jump.html@@ -0,0 +1,155 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>Tactile button (Gemini concept) · three.ws lab</title>+ <meta name="robots" content="noindex" />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <style>+ :root { color-scheme: dark; }+ *, *::before, *::after { box-sizing: border-box; }+ html, body { height: 100%; margin: 0; }+ body {+ background: #05060a;+ color: #eee;+ font: 15px/1.5 -apple-system, system-ui, sans-serif;+ overflow-x: hidden;+ }+ .crumb { padding: 14px 24px 0; font-size: 13px; }+ .crumb a { color: #8a8d98; text-decoration: none; }+ .crumb a:hover { color: #d6ff3d; }++ .stage-wrap {+ position: relative;+ width: 100vw;+ height: calc(100vh - 60px);+ min-height: 540px;+ overflow: hidden;+ }+ #stage-canvas {+ display: block;+ width: 100%;+ height: 100%;+ }++ /* Loading + status pill */+ .loading-veil {+ position: absolute; inset: 0;+ display: flex; align-items: center; justify-content: center;+ background: rgba(8,9,15,0.6); pointer-events: none;+ transition: opacity 0.4s;+ }+ .loading-veil.hidden { opacity: 0; }+ .spinner {+ width: 10px; height: 10px; border-radius: 50%;+ background: #d6ff3d; margin-right: 10px;+ animation: pulse 0.8s ease-in-out infinite;+ }+ @keyframes pulse { 0%,100%{opacity:.25} 50%{opacity:1} }+ .loading-veil span { font-size: 13px; color: #8a8d98; }+ .status-pill {+ position: absolute; top: 14px; right: 14px;+ background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);+ padding: 4px 10px; border-radius: 999px;+ font-size: 11px; color: #8a8d98; font-family: ui-monospace, monospace;+ pointer-events: none;+ }++ /* Floating headline + CTA */+ .overlay {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ justify-content: center;+ align-items: flex-start;+ padding: 0 8vw;+ pointer-events: none;+ }+ .eyebrow {+ display: inline-flex; align-items: center; gap: 8px;+ font-size: 11.5px; letter-spacing: 0.15em; text-transform: uppercase;+ color: #d6ff3d; margin-bottom: 14px;+ }+ .eyebrow-dot {+ display: inline-block; width: 6px; height: 6px;+ border-radius: 50%; background: #d6ff3d;+ }+ .title {+ font-size: clamp(34px, 5.4vw, 64px);+ font-weight: 700; letter-spacing: -0.025em;+ line-height: 1.04; margin: 0 0 18px;+ max-width: 14ch;+ }+ .title em { color: #d6ff3d; font-style: normal; }+ .sub {+ color: #8a8d98; font-size: 16px; line-height: 1.55;+ max-width: 42ch; margin: 0 0 28px;+ }++ /* Heavy CTA with DOM-side depth (matches the 3D button feel) */+ #trigger-btn {+ pointer-events: auto;+ background: #d6ff3d;+ color: #0a0b0f;+ border: none;+ padding: 16px 32px;+ font: 700 16px/1 inherit;+ border-radius: 30px;+ cursor: pointer;+ transition: transform 0.1s ease, filter 0.15s;+ box-shadow: 0 8px 0 0 rgba(160, 200, 0, 1);+ }+ #trigger-btn:hover { filter: brightness(1.06); }+ #trigger-btn:active {+ transform: translateY(8px);+ box-shadow: 0 0 0 0 rgba(160, 200, 0, 1);+ }++ .hint {+ position: absolute;+ bottom: 18px;+ left: 0; right: 0;+ text-align: center;+ font-size: 12px;+ color: #4a4b5a;+ }+ </style>+ </head>+ <body>+ <header><div id="nav-container"></div></header>+ <p class="crumb"><a href="/demos/">← lab</a></p>++ <div class="stage-wrap">+ <canvas id="stage-canvas"></canvas>++ <div class="overlay">+ <div class="eyebrow">+ <span class="eyebrow-dot"></span>+ <span>three.ws · tactile concept</span>+ </div>+ <h1 class="title">Click. <em>Watch it land.</em></h1>+ <p class="sub">+ A heavy 3D button, a real avatar with a real jump clip, and a+ volume-preserving squish on impact. Shockwave ring optional —+ but it's there.+ </p>+ <button id="trigger-btn" type="button">Trigger jump →</button>+ </div>++ <div class="loading-veil" id="loading-veil">+ <div class="spinner"></div>+ <span>loading avatar…</span>+ </div>+ <div class="status-pill" id="status"></div>++ <p class="hint">Click the button to send the avatar in</p>+ </div>++ <script src="/nav.js" defer></script>+ <script type="module" src="/src/gemini-jump.js"></script>+ </body>+</html>diff --git a/public/demos/index.html b/public/demos/index.htmlindex 86950ee3e..280a967e8 100644--- a/public/demos/index.html+++ b/public/demos/index.html@@ -111,6 +111,21 @@<p>Live read of on-chain agent identities across Base, Ethereum, Polygon, and testnets via <code>agent0-sdk</code>. No keys, no signer.</p><span class="demo-status live">Live</span></a>+ <a class="demo-card" href="/demos/button-jump.html">+ <h2>Avatar button jump</h2>+ <p>A 3D avatar runs up and leaps onto a physical button. Spring physics squish and bounce the button on impact, then the sequence loops.</p>+ <span class="demo-status beta">Beta</span>+ </a>+ <a class="demo-card" href="/demos/gemini-jump.html">+ <h2>Tactile button (Gemini concept)</h2>+ <p>Heavy 3D cylinder button living in the scene next to the avatar. Volume-preserving squish, elastic recoil, shockwave torus, cinematic spotlight. GSAP via ESM.</p>+ <span class="demo-status beta">Beta</span>+ </a>+ <a class="demo-card" href="/demos/create-v2.html">+ <h2>Create page v2</h2>+ <p>Redesigned /create chooser: featured recommended card, distinct 3D previews, time badges, destination hints, live stats from /api/explore, and integration strip.</p>+ <span class="demo-status beta">Beta</span>+ </a></div><p class="warning">diff --git a/rider/build/build.js b/rider/build/build.jsindex effbedf1b..52cd37a1a 100644--- a/rider/build/build.js+++ b/rider/build/build.js@@ -1,4 +1,4 @@-!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!_[e])return;for(var n in _[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(f[n]=t[n]);0==--y&&0===v&&S()}(e,n),t&&t(e,n)};var n,r=!0,i="de1d5348b83d960dd5aa",o={},a=[],s=[];function c(e){var t=C[e];if(!t)return k;var r=function(r){return t.hot.active?(C[r]?-1===C[r].parents.indexOf(e)&&C[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),k(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return k[e]},set:function(t){k[e]=t}}};for(var o in k)Object.prototype.hasOwnProperty.call(k,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&d("prepare"),v++,k.e(e).then(t,(function(e){throw t(),e}));function t(){v--,"prepare"===h&&(b[e]||x(e),0===v&&0===y&&S())}},r.t=function(e,t){return 1&t&&(e=r(e)),k.t(e,-2&t)},r}function l(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(f={})[t]=e[t],d("ready");break;case"ready":R(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:A,apply:T,status:function(e){if(!e)return h;u.push(e)},addStatusHandler:function(e){u.push(e)},removeStatusHandler:function(e){var t=u.indexOf(e);t>=0&&u.splice(t,1)},data:o[t]};return n=void 0,r}var u=[],h="idle";function d(e){h=e;for(var t=0;t<u.length;t++)u[t].call(null,e)}var p,f,m,g,y=0,v=0,b={},_={},w={};function E(e){return+e+""===e?+e:e}function A(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,d("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=k.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return d(M()?"ready":"idle"),null;_={},b={},w=e.c,m=e.h,d("prepare");var t=new Promise((function(e,t){p={resolve:e,reject:t}}));f={};return x(0),"prepare"===h&&0===v&&0===y&&S(),t}));var t}function x(e){w[e]?(_[e]=!0,y++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=k.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):b[e]=!0}function S(){d("ready");var e=p;if(p=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,c,l,u,h;function p(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((u=C[o])&&(!u.hot._selfAccepted||u.hot._selfInvalidated)){if(u.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(u.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<u.parents.length;s++){var c=u.parents[s],l=C[c];if(l){if(l.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([c]),moduleId:o,parentId:c};-1===t.indexOf(c)&&(l.hot._acceptedDependencies[o]?(n[c]||(n[c]=[]),y(n[c],[o])):(delete n[c],t.push(c),r.push({chain:a.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}M();var v={},b=[],_={},A=function(){console.warn("[HMR] unexpected require("+S.moduleId+") to disposed module")};for(var x in f)if(Object.prototype.hasOwnProperty.call(f,x)){var S;h=E(x),S=f[x]?p(h):{type:"disposed",moduleId:x};var T=!1,R=!1,I=!1,P="";switch(S.chain&&(P="\nUpdate propagation: "+S.chain.join(" -> ")),S.type){case"self-declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+S.moduleId+P));break;case"declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+S.moduleId+" in "+S.parentId+P));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(S),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+P));break;case"accepted":r.onAccepted&&r.onAccepted(S),R=!0;break;case"disposed":r.onDisposed&&r.onDisposed(S),I=!0;break;default:throw new Error("Unexception type "+S.type)}if(T)return d("abort"),Promise.reject(T);if(R)for(h in _[h]=f[h],y(b,S.outdatedModules),S.outdatedDependencies)Object.prototype.hasOwnProperty.call(S.outdatedDependencies,h)&&(v[h]||(v[h]=[]),y(v[h],S.outdatedDependencies[h]));I&&(y(b,[S.moduleId]),_[h]=A)}var O,N=[];for(c=0;c<b.length;c++)h=b[c],C[h]&&C[h].hot._selfAccepted&&_[h]!==A&&!C[h].hot._selfInvalidated&&N.push({module:h,parents:C[h].parents.slice(),errorHandler:C[h].hot._selfAccepted});d("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var D,L,F=b.slice();for(;F.length>0;)if(h=F.pop(),u=C[h]){var j={},U=u.hot._disposeHandlers;for(l=0;l<U.length;l++)(s=U[l])(j);for(o[h]=j,u.hot.active=!1,delete C[h],delete v[h],l=0;l<u.children.length;l++){var B=C[u.children[l]];B&&((O=B.parents.indexOf(h))>=0&&B.parents.splice(O,1))}}for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=C[h]))for(L=v[h],l=0;l<L.length;l++)D=L[l],(O=u.children.indexOf(D))>=0&&u.children.splice(O,1);d("apply"),void 0!==m&&(i=m,m=void 0);for(h in f=void 0,_)Object.prototype.hasOwnProperty.call(_,h)&&(e[h]=_[h]);var V=null;for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=C[h])){L=v[h];var H=[];for(c=0;c<L.length;c++)if(D=L[c],s=u.hot._acceptedDependencies[D]){if(-1!==H.indexOf(s))continue;H.push(s)}for(c=0;c<H.length;c++){s=H[c];try{s(L)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:L[c],error:e}),r.ignoreErrored||V||(V=e)}}}for(c=0;c<N.length;c++){var z=N[c];h=z.module,a=z.parents,n=h;try{k(h)}catch(e){if("function"==typeof z.errorHandler)try{z.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||V||(V=t),V||(V=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||V||(V=e)}}if(V)return d("fail"),Promise.reject(V);if(g)return t(r).then((function(e){return b.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return d("idle"),new Promise((function(e){e(b)}))}(t=t||{})}function M(){if(g)return f||(f={}),g.forEach(R),g=void 0,!0}function R(t){Object.prototype.hasOwnProperty.call(f,t)||(f[t]=e[t])}var C={};function k(t){if(C[t])return C[t].exports;var n=C[t]={i:t,l:!1,exports:{},hot:l(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,c(t)),n.l=!0,n.exports}k.m=e,k.c=C,k.d=function(e,t,n){k.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},k.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},k.t=function(e,t){if(1&t&&(e=k(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(k.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)k.d(n,r,function(t){return e[t]}.bind(null,r));return n},k.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return k.d(t,"a",t),t},k.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},k.p="",k.h=function(){return i},c(41)(k.s=41)}([function(e,t){const n={OFF:"#111",WHITE:"#f0f0f0",DARKRED:"#5A354B",RED:"#f971c3",BRIGHTRED:"#ffd3ee",DARKBLUE:"#2B4D4C",BLUE:"#6ff9ea",BRIGHTBLUE:"#d7fdf9",YELLOW:"#fff568",UI_ACCENT:"#08bfa2",UI_ACCENT2:"#f01978"};n.schemes={default:{name:"Super Medium",off:"#111",primary:n.RED,primarybright:n.BRIGHTRED,secondary:n.BLUE,secondarybright:n.BRIGHTBLUE,tertiary:n.YELLOW},blue:{name:"Star Warrior",off:"#111",primary:"#1e4482",primarybright:"#0B4BB3",secondary:"#c27727",secondarybright:"#FFD840",tertiary:"#d7fdf9"},purple:{name:"Galactic Royal",off:"#111",primary:"#6A39B3",primarybright:"#B685FF",secondary:"#FAF239",secondarybright:"#FFFC9E",tertiary:"#50FFF2"},green:{name:"Space Joker",off:"#111",primary:"#779E37",primarybright:"#C0FF59",secondary:"#6A39B3",secondarybright:"#B685FF",tertiary:"#FAFAFA"},yellow:{name:"Solar Flare",off:"#111",primary:"#C2C04C",primarybright:"#FAF761",secondary:"#E03A3E",secondarybright:"#FA7578",tertiary:"#278ECC"},red:{name:"Trail Blazer",off:"#111",primary:"#E03A3E",primarybright:"#FA7578",secondary:"#DADADA",secondarybright:"#EFEFEF",tertiary:"#666"},rgb:{name:"Mint Choco",off:"#111",primary:"#34eb89",primarYBRIGht:"#40fb95",secondary:"#34ebd8",secondarybright:"#40fbeA",tertiary:"#eb3434"},cheetah:{name:"Cheetah SoL",off:"#111",primary:"#c27727",primarYBright:"#e68319",secondary:"#635c54",secondarybright:"#8a857f",tertiary:"#ebebeb"},black:{name:"Ash Nova",off:"#111",primary:"#555",primarybright:"#808080",secondary:"#FFF",secondarybright:"#FFF",tertiary:"#B8B8B8"}},n.options=Object.keys(n.schemes),"undefined"==typeof localStorage?n.initial="default":n.initial=n.schemes[localStorage.getItem("colorScheme")||"blue"],e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&p())}function p(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,,function(e,t){var n;e.exports.getS3FileUrl=function(e,t){return`https://previews.three.ws/${e}-${t}?v=2`},console.line=(n={},function(e,t,r,i){i=i||"#FFF",n[r=r||"default"]||(n[r]=document.createElement("a-entity"),n[r].setAttribute("line","color",i||"#FFF"),n[r].setAttribute("id",r),AFRAME.scenes[0].appendChild(n[r])),n[r].setAttribute("line","start",e.clone()),n[r].setAttribute("line","end",t.clone())}),console.vec3=function(){const e={},t={primitive:"box",width:.05,height:.05,depth:.05},n={shader:"flat"};return function(r,i,o){o=o||"#FFF",e[i=i||"default"]||(e[i]=document.createElement("a-entity"),n.color=o||"#FFF",e[i].setAttribute("geometry",t),e[i].setAttribute("material",n),e[i].setAttribute("id",i),e[i].setAttribute("text",{align:"center",value:i,side:"double"}),AFRAME.scenes[0].appendChild(e[i])),e[i].object3D.position.copy(r)}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return l})),n.d(t,"__awaiter",(function(){return u})),n.d(t,"__generator",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return f})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return g})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return v})),n.d(t,"__asyncDelegator",(function(){return b})),n.d(t,"__asyncValues",(function(){return _})),n.d(t,"__makeTemplateObject",(function(){return w})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return A}));+!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!_[e])return;for(var n in _[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(f[n]=t[n]);0==--y&&0===v&&S()}(e,n),t&&t(e,n)};var n,r=!0,i="b6816b72f4b52c110a25",o={},a=[],s=[];function c(e){var t=C[e];if(!t)return k;var r=function(r){return t.hot.active?(C[r]?-1===C[r].parents.indexOf(e)&&C[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),k(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return k[e]},set:function(t){k[e]=t}}};for(var o in k)Object.prototype.hasOwnProperty.call(k,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&d("prepare"),v++,k.e(e).then(t,(function(e){throw t(),e}));function t(){v--,"prepare"===h&&(b[e]||x(e),0===v&&0===y&&S())}},r.t=function(e,t){return 1&t&&(e=r(e)),k.t(e,-2&t)},r}function l(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(f={})[t]=e[t],d("ready");break;case"ready":R(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:A,apply:T,status:function(e){if(!e)return h;u.push(e)},addStatusHandler:function(e){u.push(e)},removeStatusHandler:function(e){var t=u.indexOf(e);t>=0&&u.splice(t,1)},data:o[t]};return n=void 0,r}var u=[],h="idle";function d(e){h=e;for(var t=0;t<u.length;t++)u[t].call(null,e)}var p,f,m,g,y=0,v=0,b={},_={},w={};function E(e){return+e+""===e?+e:e}function A(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,d("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=k.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return d(M()?"ready":"idle"),null;_={},b={},w=e.c,m=e.h,d("prepare");var t=new Promise((function(e,t){p={resolve:e,reject:t}}));f={};return x(0),"prepare"===h&&0===v&&0===y&&S(),t}));var t}function x(e){w[e]?(_[e]=!0,y++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=k.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):b[e]=!0}function S(){d("ready");var e=p;if(p=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,c,l,u,h;function p(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((u=C[o])&&(!u.hot._selfAccepted||u.hot._selfInvalidated)){if(u.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(u.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<u.parents.length;s++){var c=u.parents[s],l=C[c];if(l){if(l.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([c]),moduleId:o,parentId:c};-1===t.indexOf(c)&&(l.hot._acceptedDependencies[o]?(n[c]||(n[c]=[]),y(n[c],[o])):(delete n[c],t.push(c),r.push({chain:a.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}M();var v={},b=[],_={},A=function(){console.warn("[HMR] unexpected require("+S.moduleId+") to disposed module")};for(var x in f)if(Object.prototype.hasOwnProperty.call(f,x)){var S;h=E(x),S=f[x]?p(h):{type:"disposed",moduleId:x};var T=!1,R=!1,I=!1,P="";switch(S.chain&&(P="\nUpdate propagation: "+S.chain.join(" -> ")),S.type){case"self-declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+S.moduleId+P));break;case"declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+S.moduleId+" in "+S.parentId+P));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(S),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+P));break;case"accepted":r.onAccepted&&r.onAccepted(S),R=!0;break;case"disposed":r.onDisposed&&r.onDisposed(S),I=!0;break;default:throw new Error("Unexception type "+S.type)}if(T)return d("abort"),Promise.reject(T);if(R)for(h in _[h]=f[h],y(b,S.outdatedModules),S.outdatedDependencies)Object.prototype.hasOwnProperty.call(S.outdatedDependencies,h)&&(v[h]||(v[h]=[]),y(v[h],S.outdatedDependencies[h]));I&&(y(b,[S.moduleId]),_[h]=A)}var O,N=[];for(c=0;c<b.length;c++)h=b[c],C[h]&&C[h].hot._selfAccepted&&_[h]!==A&&!C[h].hot._selfInvalidated&&N.push({module:h,parents:C[h].parents.slice(),errorHandler:C[h].hot._selfAccepted});d("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var D,L,F=b.slice();for(;F.length>0;)if(h=F.pop(),u=C[h]){var j={},U=u.hot._disposeHandlers;for(l=0;l<U.length;l++)(s=U[l])(j);for(o[h]=j,u.hot.active=!1,delete C[h],delete v[h],l=0;l<u.children.length;l++){var B=C[u.children[l]];B&&((O=B.parents.indexOf(h))>=0&&B.parents.splice(O,1))}}for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=C[h]))for(L=v[h],l=0;l<L.length;l++)D=L[l],(O=u.children.indexOf(D))>=0&&u.children.splice(O,1);d("apply"),void 0!==m&&(i=m,m=void 0);for(h in f=void 0,_)Object.prototype.hasOwnProperty.call(_,h)&&(e[h]=_[h]);var V=null;for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=C[h])){L=v[h];var H=[];for(c=0;c<L.length;c++)if(D=L[c],s=u.hot._acceptedDependencies[D]){if(-1!==H.indexOf(s))continue;H.push(s)}for(c=0;c<H.length;c++){s=H[c];try{s(L)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:L[c],error:e}),r.ignoreErrored||V||(V=e)}}}for(c=0;c<N.length;c++){var z=N[c];h=z.module,a=z.parents,n=h;try{k(h)}catch(e){if("function"==typeof z.errorHandler)try{z.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||V||(V=t),V||(V=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||V||(V=e)}}if(V)return d("fail"),Promise.reject(V);if(g)return t(r).then((function(e){return b.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return d("idle"),new Promise((function(e){e(b)}))}(t=t||{})}function M(){if(g)return f||(f={}),g.forEach(R),g=void 0,!0}function R(t){Object.prototype.hasOwnProperty.call(f,t)||(f[t]=e[t])}var C={};function k(t){if(C[t])return C[t].exports;var n=C[t]={i:t,l:!1,exports:{},hot:l(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,c(t)),n.l=!0,n.exports}k.m=e,k.c=C,k.d=function(e,t,n){k.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},k.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},k.t=function(e,t){if(1&t&&(e=k(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(k.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)k.d(n,r,function(t){return e[t]}.bind(null,r));return n},k.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return k.d(t,"a",t),t},k.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},k.p="",k.h=function(){return i},c(41)(k.s=41)}([function(e,t){const n={OFF:"#111",WHITE:"#f0f0f0",DARKRED:"#5A354B",RED:"#f971c3",BRIGHTRED:"#ffd3ee",DARKBLUE:"#2B4D4C",BLUE:"#6ff9ea",BRIGHTBLUE:"#d7fdf9",YELLOW:"#fff568",UI_ACCENT:"#08bfa2",UI_ACCENT2:"#f01978"};n.schemes={default:{name:"Super Medium",off:"#111",primary:n.RED,primarybright:n.BRIGHTRED,secondary:n.BLUE,secondarybright:n.BRIGHTBLUE,tertiary:n.YELLOW},blue:{name:"Star Warrior",off:"#111",primary:"#1e4482",primarybright:"#0B4BB3",secondary:"#c27727",secondarybright:"#FFD840",tertiary:"#d7fdf9"},purple:{name:"Galactic Royal",off:"#111",primary:"#6A39B3",primarybright:"#B685FF",secondary:"#FAF239",secondarybright:"#FFFC9E",tertiary:"#50FFF2"},green:{name:"Space Joker",off:"#111",primary:"#779E37",primarybright:"#C0FF59",secondary:"#6A39B3",secondarybright:"#B685FF",tertiary:"#FAFAFA"},yellow:{name:"Solar Flare",off:"#111",primary:"#C2C04C",primarybright:"#FAF761",secondary:"#E03A3E",secondarybright:"#FA7578",tertiary:"#278ECC"},red:{name:"Trail Blazer",off:"#111",primary:"#E03A3E",primarybright:"#FA7578",secondary:"#DADADA",secondarybright:"#EFEFEF",tertiary:"#666"},rgb:{name:"Mint Choco",off:"#111",primary:"#34eb89",primarYBRIGht:"#40fb95",secondary:"#34ebd8",secondarybright:"#40fbeA",tertiary:"#eb3434"},cheetah:{name:"Cheetah SoL",off:"#111",primary:"#c27727",primarYBright:"#e68319",secondary:"#635c54",secondarybright:"#8a857f",tertiary:"#ebebeb"},black:{name:"Ash Nova",off:"#111",primary:"#555",primarybright:"#808080",secondary:"#FFF",secondarybright:"#FFF",tertiary:"#B8B8B8"}},n.options=Object.keys(n.schemes),"undefined"==typeof localStorage?n.initial="default":n.initial=n.schemes[localStorage.getItem("colorScheme")||"blue"],e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&p())}function p(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,,function(e,t){var n;e.exports.getS3FileUrl=function(e,t){return`https://previews.three.ws/${e}-${t}?v=2`},console.line=(n={},function(e,t,r,i){i=i||"#FFF",n[r=r||"default"]||(n[r]=document.createElement("a-entity"),n[r].setAttribute("line","color",i||"#FFF"),n[r].setAttribute("id",r),AFRAME.scenes[0].appendChild(n[r])),n[r].setAttribute("line","start",e.clone()),n[r].setAttribute("line","end",t.clone())}),console.vec3=function(){const e={},t={primitive:"box",width:.05,height:.05,depth:.05},n={shader:"flat"};return function(r,i,o){o=o||"#FFF",e[i=i||"default"]||(e[i]=document.createElement("a-entity"),n.color=o||"#FFF",e[i].setAttribute("geometry",t),e[i].setAttribute("material",n),e[i].setAttribute("id",i),e[i].setAttribute("text",{align:"center",value:i,side:"double"}),AFRAME.scenes[0].appendChild(e[i])),e[i].object3D.position.copy(r)}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return l})),n.d(t,"__awaiter",(function(){return u})),n.d(t,"__generator",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return f})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return g})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return v})),n.d(t,"__asyncDelegator",(function(){return b})),n.d(t,"__asyncValues",(function(){return _})),n.d(t,"__makeTemplateObject",(function(){return w})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return A}));/*! *****************************************************************************Copyright (c) Microsoft Corporation. All rights reserved.Licensed under the Apache License, Version 2.0 (the "License"); you may not use@@ -357,7 +357,7 @@ function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;v* See the License for the specific language governing permissions and* limitations under the License.*/-i.registerVersion("firebase","7.19.0","app"),e.exports=i},function(e,t){e.exports="#define T time * 0.06\nvarying vec2 uvs;\nuniform float time;\nuniform float thickness;\nvoid main() {\n uvs.xy = uv.xy;\n vec3 pos = position;\n\n pos.x *= thickness + sin(T) * ((0.1 + uv.x) * 16.0 + uv.y * 4.9) * thickness * 0.005;\n pos.z *= thickness + cos(T) * ((0.1 + uv.x) * 13.0 + uv.y * 14.9) * thickness * 0.005;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.04\n\nvoid main() {\n vec2 uv = uvs;\n uv += T * 0.05;\n vec3 col = texture2D(src, uv).xyz;\n float core = step(0.125, uvs.x);\n gl_FragColor = vec4(col * color, mix(1.0, 0.07, core));\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.03\n\nvoid main() {\n vec3 col = texture2D(src, uvs * vec2(1.0, 0.7) + vec2(T * 0.01, T * 0.05)).xyz;\n gl_FragColor = vec4(col * color, 0.4 * uvs.y);\n}\n"},function(e,t){e.exports=function(e){if(e.converted)return e;e.map&&(e=e.map),e.version=e.versions[0].hash,e.directDownload=e.versions[0].downloadURL,e.coverURL=e.versions[0].coverURL.replace(/^https?:\/\/[^/]+\//,"https://eu.cdn.beatsaver.com/");let t=e.versions[0].diffs;e.metadata.characteristics={};for(const n of t)void 0===e.metadata.characteristics[n.characteristic]&&(e.metadata.characteristics[n.characteristic]={}),e.metadata.characteristics[n.characteristic][n.difficulty]=n;return e.metadata.characteristics=JSON.stringify(e.metadata.characteristics),e.converted=!0,e}},,,,,,,,,,,,function(e,t,n){function r(e){e.keys().forEach(e)}console.time=()=>{},console.timeEnd=()=>{},n(42),n(43),n(44),n(45),n(46),n(47),n(49),n(50),AFRAME.log=()=>{},n(52),n(54),n(55),n(56),n(57),n(58),r(n(59)),r(n(197)),n(201),n(208),e.hot.accept(),"http:"!==window.location.protocol||window.location.host.startsWith("localhost")||window.location.replace("https:"+location.href.substring(location.protocol.length))},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,o=n.normal.array,a=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,_=e.groups;0===_.length&&(_=[{start:0,count:r.length}]);for(var w=0,E=_.length;w<E;++w)for(var A=O=(P=_[w]).start,x=O+P.count;A<x;A+=3)N(r[A+0],r[A+1],r[A+2]);var S,T,M,R=new THREE.Vector3,C=new THREE.Vector3,k=new THREE.Vector3,I=new THREE.Vector3;for(w=0,E=_.length;w<E;++w){var P,O;for(A=O=(P=_[w]).start,x=O+P.count;A<x;A+=3)D(r[A+0]),D(r[A+1]),D(r[A+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function N(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(a,2*e),g.fromArray(a,2*t),y.fromArray(a,2*n);var r=p.x-d.x,o=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,_=f.z-d.z,w=g.x-m.x,E=y.x-m.x,A=g.y-m.y,x=y.y-m.y,S=1/(w*x-E*A);v.set((x*r-A*o)*S,(x*s-A*c)*S,(x*h-A*_)*S),b.set((w*o-E*r)*S,(w*c-E*s)*S,(w*_-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function D(e){k.fromArray(o,3*e),I.copy(k),T=l[e],R.copy(T),R.sub(k.multiplyScalar(k.dot(T))).normalize(),C.crossVectors(I,T),M=C.dot(u[e]),S=M<0?-1:1,c[4*e]=R.x,c[4*e+1]=R.y,c[4*e+2]=R.z,c[4*e+3]=S}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),o={},a={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){var m=e[l].index;if(p>0){m=m.clone();for(var g=0;g<m.count;++g)m.setX(g,m.getX(g)+p)}f.push(m),p+=e[l].attributes.position.count}var y=this.mergeBufferAttributes(f);if(!y)return null;s.index=y}for(var h in o){var v=this.mergeBufferAttributes(o[h]);if(!v)return null;s.addAttribute(h,v)}for(var h in a){var b=a[h][0].length;if(0===b)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<b;++l){var _=[];for(g=0;g<a[h].length;++g)_.push(a[h][g][l]);var w=this.mergeBufferAttributes(_);if(!w)return null;s.morphAttributes[h].push(w)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,o=0;o<e.length;++o){var a=e[o];if(a.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return null;i+=a.array.length}for(var s=new t(i),c=0,l=0;l<e.length;++l)s.set(e[l].array,c),c+=e[l].array.length;return new THREE.BufferAttribute(s,n,r)},toTrianglesDrawMode:function(e,t){if(t===THREE.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===THREE.TriangleFanDrawMode||t===THREE.TriangleStripDrawMode){var n=e.getIndex();if(null===n){var r=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var o=0;o<i.count;o++)r.push(o);e.setIndex(r),n=e.getIndex()}var a=n.count-2,s=[];if(t===THREE.TriangleFanDrawMode)for(o=1;o<=a;o++)s.push(n.getX(0)),s.push(n.getX(o)),s.push(n.getX(o+1));else for(o=0;o<a;o++)o%2==0?(s.push(n.getX(o)),s.push(n.getX(o+1)),s.push(n.getX(o+2))):(s.push(n.getX(o+2)),s.push(n.getX(o+1)),s.push(n.getX(o)));s.length/3!==a&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(s),c.clearGroups(),c}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const n={childList:!0,attributes:!0,subtree:!0};AFRAME.registerComponent("aabb-collider",{schema:{collideNonVisible:{default:!1},debug:{default:!1},enabled:{default:!0},interval:{default:80},objects:{default:""}},init:function(){this.centerDifferenceVec3=new THREE.Vector3,this.clearedIntersectedEls=[],this.closestIntersectedEl=null,this.boundingBox=new THREE.Box3,this.boxCenter=new THREE.Vector3,this.boxHelper=new THREE.BoxHelper,this.boxMax=new THREE.Vector3,this.boxMin=new THREE.Vector3,this.hitClosestClearEventDetail={},this.hitClosestEventDetail={},this.intersectedEls=[],this.objectEls=[],this.newIntersectedEls=[],this.prevCheckTime=void 0,this.previousIntersectedEls=[],this.setDirty=this.setDirty.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.hitStartEventDetail={intersectedEls:this.newIntersectedEls}},play:function(){this.observer.observe(this.el.sceneEl,n),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty)},remove:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},tick:function(e){const t=this.boundingBox,n=this.centerDifferenceVec3,r=this.clearedIntersectedEls,i=this.el,o=this.intersectedEls,a=this.newIntersectedEls,s=this.objectEls,c=this.prevCheckTime,l=this.previousIntersectedEls;let u,h,d;if(this.data.enabled&&!(c&&e-c<this.data.interval)){for(this.prevCheckTime=e,this.dirty&&this.refreshObjects(),t.setFromObject(i.object3D),this.boxMin.copy(t.min),this.boxMax.copy(t.max),t.getCenter(this.boxCenter),this.data.debug&&(this.boxHelper.setFromObject(i.object3D),this.boxHelper.parent||i.sceneEl.object3D.add(this.boxHelper)),function(e,t){e.length=0;for(let n=0;n<t.length;n++)e[n]=t[n]}(l,o),o.length=0,d=0;d<s.length;d++)if(s[d]!==this.el)if(this.data.collideNonVisible||s[d].getAttribute("visible"))this.isIntersecting(s[d])&&o.push(s[d]);else if(this.data.debug){const e=s[d].object3D.boxHelper;e&&(i.sceneEl.object3D.remove(e),s[d].object3D.boxHelper=null)}for(a.length=0,d=0;d<o.length;d++)-1===l.indexOf(o[d])&&a.push(o[d]);for(r.length=0,d=0;d<l.length;d++)-1===o.indexOf(l[d])&&(l[d].hasAttribute("aabb-collider")||l[d].emit("hitend"),r.push(l[d]));for(d=0;d<a.length;d++)a[d]!==this.el&&(a[d].hasAttribute("aabb-collider")||a[d].emit("hitstart"));for(d=0;d<o.length;d++)o[d]!==this.el&&(n.copy(o[d].object3D.boundingBoxCenter).sub(this.boxCenter),(void 0===u||n.length()<u)&&(u=n.length(),h=o[d]));!o.length&&this.closestIntersectedEl?(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear"),this.closestIntersectedEl=null,i.emit("hitclosestclear",this.hitClosestClearEventDetail)):h!==this.closestIntersectedEl&&(this.closestIntersectedEl&&(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear",this.hitClosestClearEventDetail)),h&&(h.emit("hitclosest"),this.closestIntersectedEl=h,this.hitClosestEventDetail.el=h,i.emit("hitclosest",this.hitClosestEventDetail))),r.length&&i.emit("hitend"),a.length&&i.emit("hitstart",this.hitStartEventDetail)}},isIntersecting:function(){const e=new THREE.Box3;return function(t){let n;t.dataset.aabbColliderDynamic&&(e.setFromObject(t.object3D),n=e,t.object3D.boundingBoxCenter=t.object3D.boundingBoxCenter||new THREE.Vector3,n.getCenter(t.object3D.boundingBoxCenter)),t.dataset.aabbColliderDynamic||(t.object3D.aabbBox||(t.object3D.aabbBox=(new THREE.Box3).setFromObject(t.object3D),t.object3D.boundingBoxCenter=new THREE.Vector3,t.object3D.aabbBox.getCenter(t.object3D.boundingBoxCenter)),n=t.object3D.aabbBox),this.data.debug&&(t.object3D.boxHelper||(t.object3D.boxHelper=new THREE.BoxHelper(t.object3D,new THREE.Color(Math.random(),Math.random(),Math.random())),t.sceneEl.object3D.add(t.object3D.boxHelper)),t.object3D.boxHelper.setFromObject(t.object3D));const r=n.min,i=n.max;return this.boxMin.x<=i.x&&this.boxMax.x>=r.x&&this.boxMin.y<=i.y&&this.boxMax.y>=r.y&&this.boxMin.z<=i.z&&this.boxMax.z>=r.z}}(),setDirty:function(){this.dirty=!0},refreshObjects:function(){const e=this.data;this.objectEls=e.objects?this.el.sceneEl.querySelectorAll(e.objects):this.el.sceneEl.children,this.dirty=!1}})},function(e,t){var n=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function r(e,t,r,i){const o=1/i,a=1/r;return n[0].set(o*t,a*e+a),n[1].set(o*t,a*e),n[2].set(o*t+o,a*e),n[3].set(o*t+o,a*e+a),n}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const e=this.data,t=r(e.row-1,e.column-1,e.totalRows,e.totalColumns),n=this.el.getObject3D("mesh").geometry;var i=new Float32Array([t[0].x,t[0].y,t[3].x,t[3].y,t[1].x,t[1].y,t[2].x,t[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(i,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const e=this.canvas=document.createElement("canvas");e.id=this.data.canvasId,e.height=this.data.canvasHeight,e.width=this.data.canvasWidth,this.ctx=e.getContext("2d"),document.body.appendChild(e),this.data.debug&&(e.style.left=0,e.style.top=0,e.style.position="fixed",e.style.zIndex=9999999999)},drawTexture:function(e,t,n,i,o){const a=this.canvas,s=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,n)});const c=o||a.height/s.numRows,l=i||a.width/s.numColumns;return this.ctx.drawImage(e,l*t,l*n,l,c),r(t,n,s.numRows,s.numColumns)}}),e.exports.getGridUvs=r},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var n={};AFRAME.registerComponent("audioanalyser",{schema:{buffer:{default:!1},beatDetectionDecay:{default:.99},beatDetectionMinVolume:{default:15},beatDetectionThrottle:{default:250},cache:{default:!1},enabled:{default:!0},enableBeatDetection:{default:!0},enableLevels:{default:!0},enableWaveform:{default:!0},enableVolume:{default:!0},fftSize:{default:2048},smoothingTimeConstant:{default:.8},src:{parse:function(e){return e.constructor!==String?e:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):e}},unique:{default:!1}},init:function(){this.audioEl=null,this.levels=null,this.waveform=null,this.volume=0,this.xhr=null,this.initContext()},update:function(e){var t=this.analyser,n=this.data;e.fftSize===n.fftSize&&e.smoothingTimeConstant===n.smoothingTimeConstant||(t.fftSize=n.fftSize,t.smoothingTimeConstant=n.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),n.src&&this.refreshSource()},tick:function(e,t){var n,r=this.data;if(r.enabled){if((r.enableLevels||r.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),r.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),r.enableVolume||r.enableBeatDetection){for(var i=0,o=0;o<this.levels.length;o++)i+=this.levels[o];this.volume=i/this.levels.length}r.enableBeatDetection&&(n=this.volume,this.beatCutOff||(this.beatCutOff=n),n>this.beatCutOff&&n>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*n,this.beatTime=0):this.beatTime<=this.data.beatDetectionThrottle?this.beatTime+=t:(this.beatCutOff*=this.data.beatDetectionDecay,this.beatCutOff=Math.max(this.beatCutOff,this.data.beatDetectionMinVolume)))}},initContext:function(){var e,t=this.data;this.context=new(window.webkitAudioContext||window.AudioContext),e=this.analyser=this.context.createAnalyser(),(this.gainNode=this.context.createGain()).connect(e),e.connect(this.context.destination),e.fftSize=t.fftSize,e.smoothingTimeConstant=t.smoothingTimeConstant,this.levels=new Uint8Array(e.frequencyBinCount),this.waveform=new Uint8Array(e.fftSize)},refreshSource:function(){this.analyser;var e=this.data;e.buffer&&e.src.constructor===String?this.getBufferSource().then(e=>{this.source=e,this.source.connect(this.gainNode)}):(this.source=this.getMediaSource(),this.source.connect(this.gainNode))},suspendContext:function(){this.context.suspend()},resumeContext:function(){this.context.resume()},fetchAudioBuffer:function(e){return n[e]?n[e].constructor===Promise?n[e]:Promise.resolve(n[e]):(this.data.cache||Object.keys(n).forEach((function(e){delete n[e]})),n[e]=new Promise(t=>{const r=this.xhr=new XMLHttpRequest;r.open("GET",e),r.responseType="arraybuffer",r.addEventListener("load",()=>{function i(r){n[e]=r,t(r)}const o=this.context.decodeAudioData(r.response,i);o&&o.constructor===Promise&&o.then(i).catch(console.error)}),r.send()}),n[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=n[e.src],this.el.emit("audioanalyserbuffersource",t,!1),t}).catch(console.error)},getMediaSource:function(){const e={};return function(){const t=this.data.src.constructor===String?this.data.src:this.data.src.src;if(e[t])return e[t];this.data.src.constructor===String?(this.audio=document.createElement("audio"),this.audio.crossOrigin="anonymous",this.audio.setAttribute("src",this.data.src)):this.audio=this.data.src;const n=this.context.createMediaElementSource(this.audio);return e[t]=n,n}}()})},function(e,t){var n=AFRAME.utils.styleParser;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("event-set",{schema:{default:"",parse:function(e){return n.parse(e)}},multiple:!0,init:function(){this.eventHandler=null,this.eventName=null},update:function(e){this.removeEventListener(),this.updateEventListener(),this.addEventListener()},remove:function(){this.removeEventListener()},pause:function(){this.removeEventListener()},play:function(){this.addEventListener()},updateEventListener:function(){var e,t,n,r=this.data,i=this.el;e=r._event||this.id,t=r._target,n=t?i.sceneEl.querySelector(t):i,this.eventName=e;const o=()=>{var e;for(e in r)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,n,e,r[e])};isNaN(r._delay)?this.eventHandler=o:this.eventHandler=()=>{setTimeout(o,parseFloat(r._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,n){THREE.BufferGeometryUtils||n(48),AFRAME.registerComponent("geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=this;this.geometry=new THREE.Geometry,this.mesh=new THREE.Mesh(this.geometry),this.el.setObject3D("mesh",this.mesh),this.faceIndex={},this.vertexIndex={},this.el.object3D.traverse((function(t){"Mesh"===t.type&&t!==e.mesh&&(e.faceIndex[t.parent.uuid]=[e.geometry.faces.length,e.geometry.faces.length+t.geometry.faces.length-1],e.vertexIndex[t.parent.uuid]=[e.geometry.vertices.length,e.geometry.vertices.length+t.geometry.vertices.length-1],t.parent.updateMatrix(),e.geometry.merge(t.geometry,t.parent.matrix),e.data.preserveOriginal||t.parent.remove(t))}))}}),AFRAME.registerComponent("buffer-geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=[];this.el.sceneEl.object3D.updateMatrixWorld(),this.el.object3D.traverse((function(t){"Mesh"===t.type&&t.el!==self.el&&(t.geometry.applyMatrix(t.matrixWorld),e.push(t.geometry.clone()),t.parent.remove(t))}));const t=THREE.BufferGeometryUtils.mergeBufferGeometries(e);this.mesh=new THREE.Mesh(t),this.el.setObject3D("mesh",this.mesh)}})},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,o=n.normal.array,a=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,_=e.groups;0===_.length&&(_=[{start:0,count:r.length}]);h=0;for(var w=_.length;h<w;++h)for(var E=P=(I=_[h]).start,A=P+I.count;E<A;E+=3)O(r[E+0],r[E+1],r[E+2]);var x,S,T,M=new THREE.Vector3,R=new THREE.Vector3,C=new THREE.Vector3,k=new THREE.Vector3;for(h=0,w=_.length;h<w;++h){var I,P;for(E=P=(I=_[h]).start,A=P+I.count;E<A;E+=3)N(r[E+0]),N(r[E+1]),N(r[E+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function O(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(a,2*e),g.fromArray(a,2*t),y.fromArray(a,2*n);var r=p.x-d.x,o=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,_=f.z-d.z,w=g.x-m.x,E=y.x-m.x,A=g.y-m.y,x=y.y-m.y,S=1/(w*x-E*A);v.set((x*r-A*o)*S,(x*s-A*c)*S,(x*h-A*_)*S),b.set((w*o-E*r)*S,(w*c-E*s)*S,(w*_-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function N(e){C.fromArray(o,3*e),k.copy(C),S=l[e],M.copy(S),M.sub(C.multiplyScalar(C.dot(S))).normalize(),R.crossVectors(k,S),T=R.dot(u[e]),x=T<0?-1:1,c[4*e]=M.x,c[4*e+1]=M.y,c[4*e+2]=M.z,c[4*e+3]=x}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),o={},a={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.morphAttributes[h])}if(s.userData&&(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData)),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){for(var m=e[l].index,g=0;g<m.count;++g)f.push(m.getX(g)+p);p+=e[l].attributes.position.count}s.setIndex(f)}for(var h in o){var y=this.mergeBufferAttributes(o[h]);if(!y)return null;s.addAttribute(h,y)}for(var h in a){var v=a[h][0].length;if(0===v)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<v;++l){var b=[];for(g=0;g<a[h].length;++g)b.push(a[h][g][l]);var _=this.mergeBufferAttributes(b);if(!_)return null;s.morphAttributes[h].push(_)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,o=0;o<e.length;++o){var a=e[o];if(a.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return null;i+=a.array.length}var s=new t(i),c=0;for(o=0;o<e.length;++o)s.set(e[o].array,c),c+=e[o].array.length;return new THREE.BufferAttribute(s,n,r)}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("haptics",{schema:{actuatorIndex:{default:0},dur:{default:100},enabled:{default:!0},events:{type:"array"},eventsFrom:{type:"string"},force:{default:1}},multiple:!0,init:function(){this.data;var e=this;this.callPulse=function(){e.pulse()};var t=function(){e.gamepad=e.el.components["tracked-controls"].controller,e.gamepad.gamepad&&(e.gamepad=e.gamepad.gamepad),e.gamepad&&e.gamepad.hapticActuators&&e.gamepad.hapticActuators.length&&e.addEventListeners()};this.el.components["tracked-controls"]&&this.el.components["tracked-controls"].controller?t():this.el.addEventListener("controllerconnected",(function(){t()}))},remove:function(){this.removeEventListeners()},pulse:function(e,t){var n=this.data;n.enabled&&this.gamepad&&this.gamepad.hapticActuators&&this.gamepad.hapticActuators[n.actuatorIndex].pulse(e||n.force,t||n.dur)},addEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.addEventListener(n.events[e],this.callPulse)},removeEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.removeEventListener(n.events[e],this.callPulse)}})},function(e,t){var n=[],r=new THREE.Vector3;function i(e,t,i){var o,a,s,c,l,h,d=Math.ceil(t/e.columns);for(a=e.marginColumn,s=e.marginRow,i&&(a=e.margin,s=e.margin),l=u(e.align,d),c=u(e.align,e.columns),h=0;h<d;h++)for(o=0;o<e.columns;o++)r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=(o-c)*a),0===e.plane.indexOf("y")&&(r.y=(o-c)*a),1===e.plane.indexOf("y")&&(r.y=(h-l)*s),1===e.plane.indexOf("z")&&(r.z=(h-l)*s),f(r);return n}function o(e,t){var i,o;for(i=0;i<t;i++)o=isNaN(e.angle)?i*(2*Math.PI)/t:i*e.angle*.01745329252,r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=e.radius*Math.cos(o)),0===e.plane.indexOf("y")&&(r.y=e.radius*Math.cos(o)),1===e.plane.indexOf("y")&&(r.y=e.radius*Math.sin(o)),1===e.plane.indexOf("z")&&(r.z=e.radius*Math.sin(o)),f(r);return n}function a(e,t){return e.columns=t,i(e,t,!0)}function s(e,t){return p(1,0,0,0,1,0,0,0,1,-1,0,0,0,-1,0,0,0,-1),h(e.radius/2),n}function c(e,t){var r=(1+Math.sqrt(5))/2,i=1/r,o=2-r,a=-1*i,s=-1*o;return p(-1,o,0,-1,s,0,0,-1,o,0,-1,s,0,1,o,0,1,s,1,o,0,1,s,0,i,i,i,i,i,a,i,a,i,i,a,a,o,0,1,o,0,-1,a,i,i,a,i,a,a,a,i,a,a,a,s,0,1,s,0,-1),h(e.radius/2),n}function l(e,t){var r=Math.sqrt(3),i=-1/Math.sqrt(3);return p(0,0,r+i,-1,0,i,1,0,i,0,2*Math.sqrt(2/3),0),h(e.radius/2),n}function u(e,t){switch(e){case"start":return t-1;case"center":return(t-1)/2;case"end":return 0}}function h(e){var t;for(t=0;t<n.length;t++)n[t]=n[t]*e}function d(e,t,n){var r,i,o;if(n)for(i=0;i<e.length;i++)null!=(r=e[i].getAttribute(n))&&(o=3*parseInt(r,10),e[i].object3D.position.set(t[o],t[o+1],t[o+2]));else for(i=0;i<t.length;i+=3){if(!e[i/3])return;e[i/3].object3D.position.set(t[i],t[i+1],t[i+2])}}function p(){var e;for(e=0;e<arguments.length;e++)n.push(e)}function f(e){n.push(e.x),n.push(e.y),n.push(e.z)}AFRAME.registerComponent("layout",{schema:{angle:{type:"number",default:!1,min:0,max:360,if:{type:["circle"]}},columns:{default:1,min:0,if:{type:["box"]}},margin:{default:1,min:0,if:{type:["box","line"]}},marginColumn:{default:1,min:0,if:{type:["box"]}},marginRow:{default:1,min:0,if:{type:["box"]}},orderAttribute:{default:""},plane:{default:"xy"},radius:{default:1,min:0,if:{type:["circle","cube","dodecahedron","pyramid"]}},reverse:{default:!1},type:{default:"line",oneOf:["box","circle","cube","dodecahedron","line","pyramid"]},fill:{default:!0,if:{type:["circle"]}},align:{default:"end",oneOf:["start","center","end"]}},init:function(){var e=this,t=this.el;this.children=t.getChildEntities(),this.initialPositions=[],this.children.forEach((function(t){if(t.hasLoaded)return n();function n(){e.initialPositions.push(t.object3D.position.x),e.initialPositions.push(t.object3D.position.y),e.initialPositions.push(t.object3D.position.z)}t.addEventListener("loaded",n)})),this.handleChildAttached=this.handleChildAttached.bind(this),this.handleChildDetached=this.handleChildDetached.bind(this),t.addEventListener("child-attached",this.handleChildAttached),t.addEventListener("child-detached",this.handleChildDetached),t.addEventListener("layoutrefresh",this.update.bind(this))},update:function(e){var t,r,u,h=this.children,p=this.data,f=this.el;switch(r=h.length,p.type){case"box":u=i;break;case"circle":u=o;break;case"cube":u=s;break;case"dodecahedron":u=c;break;case"pyramid":u=l;break;default:u=a}t=f.getDOMAttribute("layout"),n.length=0,n=u(p,r,"string"==typeof t?-1!==t.indexOf("margin"):"margin"in t),p.reverse&&n.reverse(),d(h,n,p.orderAttribute)},remove:function(){this.el.removeEventListener("child-attached",this.handleChildAttached),this.el.removeEventListener("child-detached",this.handleChildDetached),d(this.children,this.initialPositions)},handleChildAttached:function(e){var t=this.el;e.detail.el.parentNode===t&&(this.children.push(e.detail.el),this.update())},handleChildDetached:function(e){-1!==this.children.indexOf(e.detail.el)&&(this.children.splice(this.children.indexOf(e.detail.el),1),this.initialPositions.splice(this.children.indexOf(e.detail.el),1),this.update())}}),e.exports.getBoxPositions=i,e.exports.getCirclePositions=o,e.exports.getLinePositions=a,e.exports.getCubePositions=s,e.exports.getDodecahedronPositions=c,e.exports.getPyramidPositions=l},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerPrimitive("a-log",{defaultComponents:{geometry:{primitive:"plane",height:5},log:{},material:{color:"#111",shader:"flat",side:"double"},text:{color:"lightgreen",baseline:"top",align:"center",height:5}},mappings:{channel:"log.channel"}}),AFRAME.registerSystem("log",{schema:{console:{default:!0}},init:function(){var e=this.data,t=this.logs=[],n=this.loggers=[];AFRAME.log=function(r,i){t.push([r,i]),n.forEach((function(e){e.receiveLog(r,i)})),e.console&&console.log("[log:"+(i||"")+"] "+r)}},registerLogger:function(e){this.loggers.push(e),this.logs.forEach((function(t){e.receiveLog.apply(e,t)}))},unregisterLogger:function(e){this.loggers.splice(this.loggers.indexOf(e),1)}}),AFRAME.registerComponent("log",{schema:{channel:{type:"string"},filter:{type:"string"},max:{default:100},showErrors:{default:!0}},init:function(){this.logs=[],this.system.registerLogger(this)},play:function(){var e=this;this.el.sceneEl.addEventListener("log",(function(t){t.detail&&e.receiveLog(t.detail.message,t.detail.channel)})),window.onerror=function(t,n,r,i,o){e.receiveLog("Error: "+t)}},receiveLog:function(e,t){var n=this.data;"string"!=typeof e&&(e=JSON.stringify(e)),n.channel&&t&&n.channel!==t||n.filter&&-1===e.indexOf(n.filter)||(this.logs.push(e),n.max&&this.logs.length>n.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})},function(e,t,n){n(53),AFRAME.registerComponent("orbit-controls",{dependencies:["camera"],schema:{autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},initialPosition:{type:"vec3"},keyPanSpeed:{default:7},minAzimuthAngle:{type:"number",default:1/0},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:1e3},maxPolarAngle:{default:AFRAME.utils.device.isMobile()?90:120},minDistance:{default:1},minPolarAngle:{default:0},minZoom:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},target:{type:"vec3"},zoomSpeed:{default:.5}},init:function(){var e,t=this.el;this.controls=new THREE.OrbitControls(t.getObject3D("camera"),t.sceneEl.renderer.domElement),e=new THREE.Vector3,t.sceneEl.addEventListener("enter-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!1,t.hasAttribute("look-controls")&&(t.setAttribute("look-controls","enabled",!0),e.copy(t.getObject3D("camera").position),t.getObject3D("camera").position.set(0,0,0)))}),t.sceneEl.addEventListener("exit-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!0,t.getObject3D("camera").position.copy(e),t.hasAttribute("look-controls")&&t.setAttribute("look-controls","enabled",!1))}),document.body.style.cursor="grab",document.addEventListener("mousedown",()=>{document.body.style.cursor="grabbing"}),document.addEventListener("mouseup",()=>{document.body.style.cursor="grab"}),this.target=new THREE.Vector3,t.getObject3D("camera").position.copy(this.data.initialPosition)},update:function(e){var t=this.controls,n=this.data;t.target=this.target.copy(n.target),t.autoRotate=n.autoRotate,t.autoRotateSpeed=n.autoRotateSpeed,t.dampingFactor=n.dampingFactor,t.enabled=n.enabled,t.enableDamping=n.enableDamping,t.enableKeys=n.enableKeys,t.enablePan=n.enablePan,t.enableRotate=n.enableRotate,t.enableZoom=n.enableZoom,t.keyPanSpeed=n.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(n.maxPolarAngle),t.maxDistance=n.maxDistance,t.minDistance=n.minDistance,t.minPolarAngle=THREE.Math.degToRad(n.minPolarAngle),t.minZoom=n.minZoom,t.panSpeed=n.panSpeed,t.rotateSpeed=n.rotateSpeed,t.screenSpacePanning=n.screenSpacePanning,t.zoomSpeed=n.zoomSpeed},tick:function(){var e=this.controls;this.data.enabled&&e.enabled&&(e.enableDamping||e.autoRotate)&&this.controls.update()}})},function(e,t){THREE.OrbitControls=function(e,t){var n,r,i,o,a;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){s.target0.copy(s.target),s.position0.copy(s.object.position),s.zoom0=s.object.zoom},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(c),s.update(),d=h.NONE},this.update=(n=new THREE.Vector3,r=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),i=r.clone().inverse(),o=new THREE.Vector3,a=new THREE.Quaternion,function(){var e=s.object.position;return n.copy(e).sub(s.target),n.applyQuaternion(r),f.setFromVector3(n),s.autoRotate&&d===h.NONE&&C(2*Math.PI/60/60*s.autoRotateSpeed),f.theta+=m.theta,f.phi+=m.phi,f.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,f.theta)),f.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=g,f.radius=Math.max(s.minDistance,Math.min(s.maxDistance,f.radius)),s.target.add(y),n.setFromSpherical(f),n.applyQuaternion(i),e.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(m.theta*=1-s.dampingFactor,m.phi*=1-s.dampingFactor):m.set(0,0,0),g=1,y.set(0,0,0),!!(v||o.distanceToSquared(s.object.position)>p||8*(1-a.dot(s.object.quaternion))>p)&&(s.dispatchEvent(c),o.copy(s.object.position),a.copy(s.object.quaternion),v=!1,!0)}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",G,!1),s.domElement.removeEventListener("mousedown",F,!1),s.domElement.removeEventListener("wheel",B,!1),s.domElement.removeEventListener("touchstart",H,!1),s.domElement.removeEventListener("touchend",q,!1),s.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",V,!1)};var s=this,c={type:"change"},l={type:"start"},u={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,f=new THREE.Spherical,m=new THREE.Spherical,g=1,y=new THREE.Vector3,v=!1,b=new THREE.Vector2,_=new THREE.Vector2,w=new THREE.Vector2,E=new THREE.Vector2,A=new THREE.Vector2,x=new THREE.Vector2,S=new THREE.Vector2,T=new THREE.Vector2,M=new THREE.Vector2;function R(){return Math.pow(.95,s.zoomSpeed)}function C(e){m.theta-=e}function k(e){m.phi-=e}var I,P=(I=new THREE.Vector3,function(e,t){I.setFromMatrixColumn(t,0),I.multiplyScalar(-e),y.add(I)}),O=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),y.add(e)}}(),N=function(){var e=new THREE.Vector3;return function(t,n){var r=s.domElement===document?s.domElement.body:s.domElement;if(s.object.isPerspectiveCamera){var i=s.object.position;e.copy(i).sub(s.target);var o=e.length();o*=Math.tan(s.object.fov/2*Math.PI/180),P(2*t*o/r.clientHeight,s.object.matrix),O(2*n*o/r.clientHeight,s.object.matrix)}else s.object.isOrthographicCamera?(P(t*(s.object.right-s.object.left)/s.object.zoom/r.clientWidth,s.object.matrix),O(n*(s.object.top-s.object.bottom)/s.object.zoom/r.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)}}();function D(e){s.object.isPerspectiveCamera?g/=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function L(e){s.object.isPerspectiveCamera?g*=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function F(e){if(!1!==s.enabled){switch(e.preventDefault(),e.button){case s.mouseButtons.ORBIT:if(!1===s.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case s.mouseButtons.ZOOM:if(!1===s.enableZoom)return;!function(e){S.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case s.mouseButtons.PAN:if(!1===s.enablePan)return;!function(e){E.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",U,!1),s.dispatchEvent(l))}}function j(e){if(!1!==s.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===s.enableRotate)return;!function(e){_.set(e.clientX,e.clientY),w.subVectors(_,b);var t=s.domElement===document?s.domElement.body:s.domElement;C(2*Math.PI*w.x/t.clientWidth*s.rotateSpeed),k(2*Math.PI*w.y/t.clientHeight*s.rotateSpeed),b.copy(_),s.update()}(e);break;case h.DOLLY:if(!1===s.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),M.subVectors(T,S),M.y>0?D(R()):M.y<0&&L(R()),S.copy(T),s.update()}(e);break;case h.PAN:if(!1===s.enablePan)return;!function(e){A.set(e.clientX,e.clientY),x.subVectors(A,E),N(x.x,x.y),E.copy(A),s.update()}(e)}}function U(e){!1!==s.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),s.dispatchEvent(u),d=h.NONE)}function B(e){!1===s.enabled||!1===s.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),s.dispatchEvent(l),function(e){e.deltaY<0?L(R()):e.deltaY>0&&D(R()),s.update()}(e),s.dispatchEvent(u))}function V(e){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(e){switch(e.keyCode){case s.keys.UP:N(0,s.keyPanSpeed),s.update();break;case s.keys.BOTTOM:N(0,-s.keyPanSpeed),s.update();break;case s.keys.LEFT:N(s.keyPanSpeed,0),s.update();break;case s.keys.RIGHT:N(-s.keyPanSpeed,0),s.update()}}(e)}function H(e){if(!1!==s.enabled){switch(e.touches.length){case 1:if(!1===s.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===s.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);S.set(0,r)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===s.enablePan)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&s.dispatchEvent(l)}}function z(e){if(!1!==s.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===s.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){_.set(e.touches[0].pageX,e.touches[0].pageY),w.subVectors(_,b);var t=s.domElement===document?s.domElement.body:s.domElement;C(2*Math.PI*w.x/t.clientWidth*s.rotateSpeed),k(2*Math.PI*w.y/t.clientHeight*s.rotateSpeed),b.copy(_),s.update()}(e);break;case 2:if(!1===s.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);T.set(0,r),M.subVectors(T,S),M.y>0?L(R()):M.y<0&&D(R()),S.copy(T),s.update()}(e);break;case 3:if(!1===s.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY),x.subVectors(A,E),N(x.x,x.y),E.copy(A),s.update()}(e);break;default:d=h.NONE}}function q(e){!1!==s.enabled&&(s.dispatchEvent(u),d=h.NONE)}function G(e){!1!==s.enabled&&e.preventDefault()}s.domElement.addEventListener("contextmenu",G,!1),s.domElement.addEventListener("mousedown",F,!1),s.domElement.addEventListener("wheel",B,!1),s.domElement.addEventListener("touchstart",H,!1),s.domElement.addEventListener("touchend",q,!1),s.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",V,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t){AFRAME.registerComponent("proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,o=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){var r=o.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(t){var r=n.data;r.enabled&&(r.captureBubbles||t.target===e)&&n.el.emit(r.as||r.event,t.detail?t.detail:null,!1)}))}})},function(e,t){AFRAME.registerSystem("render-order",{schema:{type:"array"},init:function(){this.el.renderer.sortObjects=!0},update:function(){for(this.order={},i=0;i<this.data.length;i++)this.order[this.data[i]]=i}}),AFRAME.registerComponent("render-order",{schema:{type:"string"},multiple:!0,init:function(){this.set=this.set.bind(this),this.el.addEventListener("object3dset",e=>{"nonrecursive"!==this.id&&e.detail.object.traverse(this.set)})},update:function(){"nonrecursive"===this.id?this.set(this.el.object3D):this.el.object3D.traverse(this.set)},set:function(e){isNaN(this.data)?e.renderOrder=this.system.order[this.data]:e.renderOrder=parseFloat(this.data)}}),AFRAME.registerComponent("render-order-recursive",{init:function(){this.el.addEventListener("child-attached",e=>{e.detail.el.setAttribute("render-order",this.el.getAttribute("render-order"))})}})},function(e,t,n){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r={};e.exports.select=function(e,t,n){return r[t]||(r[t]=new Function("state","item","return "+c(t)+";")),r[t](e,n)};var i=/\.([A-Za-z][\w_-]*)/g,o=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,a=/^([\(]?)([A-Za-z][\w_-]*)/g,s=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(i,'["$1"]')).replace(a,'$1state["$2"]')).replace(o,'$1$2$3state["$4"]')).replace(s,"item")}function l(){var e=arguments;return function(){var t;for(t=0;t<e.length;t++)e[t].apply(this,arguments)}}e.exports.generateExpression=c,e.exports.clearObject=function(e){for(var t in e)delete e[t]},e.exports.composeHandlers=function(){var e,t,n,r=arguments;for(n={},t=0;t<r.length;t++)for(e in r[t])e in n?n[e].constructor===Array?n[e].push(r[t][e]):n[e]=[n[e],r[t][e]]:n[e]=r[t][e];for(e in n)n[e].constructor===Array&&(n[e]=l.apply(this,n[e]));return n},e.exports.composeFunctions=l;var u=["||","&&","!=","!==","==","===",">","<","<=",">="],h=/\s+/,d=/\(|\)|\!/g;function p(e){return-1===(e=function(e){return 0===e.indexOf("!!")?e.replace("!!",""):0===e.indexOf("!")?e.replace("!",""):e}(e.trim())).indexOf(".")?e:e.substring(0,e.indexOf("."))}e.exports.parseKeysToWatch=function(e,t,n){var r,i;for(i=m(t,h),r=0;r<i.length;r++)if(-1===u.indexOf(i[r])&&!i[r].startsWith("'")&&-1===e.indexOf(i[r])){if(n&&"item"===i[r])continue;e.push(p(i[r]).replace(d,""))}return e};var f={};function m(e,t){return f[t]||(f[t]={}),f[t][e]||(f[t][e]=e.split(t)),f[t][e]}e.exports.split=m,e.exports.copyArray=function(e,t){var n;for(e.length=0,n=0;n<t.length;n++)e[n]=t[n]}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n(2);var i,o,a=n(3),s=n(0),c=n(4).wrapArray,l={initialState:{},nonBindedStateKeys:[],handlers:{},computeState:function(){}};AFRAME.registerState=function(e){AFRAME.utils.extend(l,e)},AFRAME.registerSystem("state",{init:function(){var e,t=this;for(e in this.arrays=[],this.dirtyArrays=[],this.diff={},this.state=AFRAME.utils.clone(l.initialState),this.subscriptions=[],this.initEventHandlers(),this.state)this.state[e]&&this.state[e].constructor===Array&&(this.arrays.push(e),this.state[e].__dirty=!0,c(this.state[e]));this.lastState=AFRAME.utils.clone(this.state),this.eventDetail={lastState:this.lastState,state:this.state},this.el.addEventListener("loaded",(function(){var e;for(l.computeState(t.state,"@@INIT"),e=0;e<t.subscriptions.length;e++)t.subscriptions[e].onStateUpdate(t.state)}))},dispatch:(o=[],function(e,t){var n,r;for(r in l.handlers[e](this.state,t),l.computeState(this.state,e,t),this.diff)delete this.diff[r];for(a(this.lastState,this.state,this.diff,l.nonBindedStateKeys),this.dirtyArrays.length=0,n=0;n<this.arrays.length;n++)this.state[this.arrays[n]].__dirty&&this.dirtyArrays.push(this.arrays[n]);for(o.length=0,n=0;n<this.subscriptions.length;n++){if("bind-for"===this.subscriptions[n].name){if(!this.state[this.subscriptions[n].keysToWatch[0]].__dirty)continue}else if(!this.shouldUpdate(this.subscriptions[n].keysToWatch,this.diff,this.dirtyArrays))continue;-1===o.indexOf(this.subscriptions[n])&&o.push(this.subscriptions[n])}for(n=0;n<o.length;n++)o[n].onStateUpdate();for(r in this.state)this.state[r]&&this.state[r].constructor===Array&&(this.state[r].__dirty=!1);this.copyState(this.lastState,this.state),this.eventDetail.action=e,this.eventDetail.payload=t,this.el.emit("stateupdate",this.eventDetail)}),copyState:function(e,t,n){var r;for(r in t)if(n||-1===l.nonBindedStateKeys.indexOf(r))if(t[r]&&t[r].constructor===Object){if(!(r in e)){e[r]=AFRAME.utils.clone(t[r]);continue}this.copyState(e[r],t[r],!0)}else e[r]=t[r]},subscribe:function(e){this.subscriptions.push(e)},unsubscribe:function(e){this.subscriptions.splice(this.subscriptions.indexOf(e),1)},shouldUpdate:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]in t||-1!==n.indexOf(e[r]))return!0;return!1},initEventHandlers:function(){var e,t=[];for(e in n=n.bind(this),l.handlers)-1===t.indexOf(e)&&(t.push(e),n(e));function n(e){var t=this;this.el.addEventListener(e,(function(n){t.dispatch(e,n.detail)}))}},renderTemplate:(i=/{{\s*(\w*\.)?([\w.]+)\s*}}/g,function(e,t,n){var o,a;if(a=e,t)for(;o=i.exec(e);)a=a.replace(o[0],"object"===(void 0===t?"undefined":r(t))?s.select(t,o[2])||"":t);return n?a:document.createRange().createContextualFragment(a)}),select:s.select}),AFRAME.registerComponent("bind",{schema:{default:{},parse:function(e){var t,n,r,i;if(e.constructor===Object)return e;if(-1===e.indexOf(":"))return e;for(t={},r=s.split(e,";"),n=0;n<r.length;n++)t[(i=s.split(r[n].trim(),":"))[0]]=i[1].trim();return t}},multiple:!0,init:function(){var e;this.data,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system=this.el.sceneEl.systems.state,this.id&&(e=s.split(this.id,"__")[0]),this.isNamespacedBind=this.id&&e in AFRAME.components&&!AFRAME.components[e].isSingleProp||e in AFRAME.systems,this.lastData={},this.updateObj={},this.system.subscribe(this),this.onStateUpdate=this.onStateUpdate.bind(this)},update:function(){var e,t=this.data;if(this.keysToWatch.length=0,"string"==typeof t)s.parseKeysToWatch(this.keysToWatch,t);else for(e in t)s.parseKeysToWatch(this.keysToWatch,t[e]);this.onStateUpdate()},onStateUpdate:function(){var e,t,n,i,o=!1,a=this.el;if(a.parentNode){if(this.isNamespacedBind&&s.clearObject(this.updateObj),n=this.system.state,"object"!==r(this.data)){try{i=s.select(n,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"!==(void 0===i?"undefined":r(i))&&"object"!==r(this.lastData)&&this.lastData===i)return;return AFRAME.utils.entity.setComponentProperty(a,this.id,i),void(this.lastData=i)}for(e in this.data){t=this.data[e].trim();try{i=s.select(n,t)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+t+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"===(void 0===i?"undefined":r(i))||"object"===r(this.lastData[e])||this.lastData[e]!==i){if(e in AFRAME.components&&void 0===i)return void a.removeAttribute(e);this.isNamespacedBind?this.updateObj[e]=i:AFRAME.utils.entity.setComponentProperty(a,e,i),this.lastData[e]=i}}for(o in this.updateObj);this.isNamespacedBind&&o&&a.setAttribute(this.id,this.updateObj)}},remove:function(){this.system.unsubscribe(this)}}),AFRAME.registerComponent("bind-toggle",{schema:{type:"string"},multiple:!0,init:function(){this.system=this.el.sceneEl.systems.state,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system.subscribe(this),this.onStateUpdate()},update:function(){this.keysToWatch.length=0,s.parseKeysToWatch(this.keysToWatch,this.data)},onStateUpdate:function(){var e,t,n=this.el;e=this.system.state;try{t=s.select(e,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}t?n.setAttribute(this.id,""):n.removeAttribute(this.id)},remove:function(){this.system.unsubscribe(this)}}),e.exports={composeFunctions:s.composeFunctions,composeHandlers:s.composeHandlers,select:s.select}},function(e,t,n){"use strict";var r,i,o=n(0);AFRAME.registerComponent("bind-for",{schema:{delay:{default:0},for:{type:"string",default:"item"},in:{type:"string"},key:{type:"string"},pool:{default:0},template:{type:"string"},updateInPlace:{default:!1}},init:function(){this.system=this.el.sceneEl.systems.state,this.onStateUpdate=this.onStateUpdate.bind(this),this.keysToWatch=[],this.renderedKeys=[],this.system.subscribe(this),this.el.children[0]&&"TEMPLATE"===this.el.children[0].tagName?this.template=this.el.children[0].innerHTML.trim():this.template=document.querySelector(this.data.template).innerHTML.trim();for(var e=0;e<this.data.pool;e++)this.el.appendChild(this.generateFromTemplate(null,e))},update:function(){this.keysToWatch[0]=o.split(this.data.in,".")[0],this.onStateUpdate()},onStateUpdateNaive:(i=[],function(){var e,t=this.data,n=this.el;try{e=o.select(this.system.state,t.in)}catch(e){throw new Error("[aframe-state-component] Key '"+t.in+"' not found in state. #"+n.getAttribute("id")+"["+this.attrName+"]")}i.length=0;for(var r=0;r<e.length;r++){var a=e[r];i.push(t.key?a[t.key].toString():a.toString())}for(var s=this.getElsToRemove(i,this.renderedKeys),c=0;c<s.length;c++)s[c].parentNode.removeChild(s[c]);e.length&&this.renderItems(e,i,0)}),renderItems:function(e,t,n){var r,i=this,o=this.data,a=this.el,s=e[n],c=o.key?s[o.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(c))r=this.generateFromTemplate(s,n),a.appendChild(r),this.renderedKeys.push(c);else{if(e.length&&e[0].constructor===String){var l=o.key?s[o.key].toString():s.toString();(r=a.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n)}else{var u=this.getBindForKey(s,n);r=a.querySelector('[data-bind-for-key="'+u+'"]')}r.emit("bindforupdate",s,!1)}e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItems(e,t,n+1)}),this.data.delay):this.renderItems(e,t,n+1))},onStateUpdateInPlace:function(){var e=[];return function(){var t,n,r=this.data,i=this.el;try{t=o.select(this.system.state,r.in)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+r.in+"' not found in state. #"+i.getAttribute("id")+"["+this.attrName+"]")}e.length=0;for(var a=0;a<t.length;a++){var s=t[a];n=r.key?s[r.key].toString():s.toString(),e.push(n)}for(var c=this.getElsToRemove(e,this.renderedKeys),l=0;l<c.length;l++)c[l].object3D.visible=!1,c[l].setAttribute("data-bind-for-active","false"),c[l].removeAttribute("data-bind-for-key"),c[l].removeAttribute("data-bind-for-value"),c[l].emit("bindfordeactivate",null,!1),c[l].pause();t.length&&this.renderItemsInPlace(t,e,0)}}(),renderItemsInPlace:function(e,t,n){var r,i=this,o=this.data,a=this.el,s=e[n],c=this.getBindForKey(s,n),l=o.key?s[o.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(l)){if(a.querySelector(':scope > [data-bind-for-active="false"]'))(r=a.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),r.setAttribute("data-bind-for-value",l),r.object3D.visible=!0,r.play(),r.setAttribute("data-bind-for-active","true"),r.emit("bindforupdateinplace",s,!1);else{var u=this.generateFromTemplate(s,n);u.addEventListener("loaded",(function(){u.emit("bindforupdateinplace",s,!1)})),a.appendChild(u)}this.renderedKeys.push(l)}else-1!==t.indexOf(l)&&(e.length&&e[0].constructor===String?(r=a.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n):r=a.querySelector('[data-bind-for-key="'+c+'"]'),r.emit("bindforupdateinplace",s,!1));e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItemsInPlace(e,t,n+1)}),this.data.delay):this.renderItemsInPlace(e,t,n+1))},generateFromTemplate:function(e,t){var n=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var r=this.el.children[this.el.children.length-1];if(!e)return r.setAttribute("data-bind-for-key",""),r.setAttribute("data-bind-for-active","false"),r;var i=this.getBindForKey(e,t);return r.setAttribute("data-bind-for-key",i),n.key||r.setAttribute("data-bind-for-value",e),r.setAttribute("data-bind-for-active","true"),r},getElsToRemove:(r=[],function(e,t){var n=this.data,i=this.el;r.length=0;for(var o=0;o<i.children.length;o++)if("TEMPLATE"!==i.children[o].tagName){var a=n.key?i.children[o].getAttribute("data-bind-for-key"):i.children[o].getAttribute("data-bind-for-value");-1===e.indexOf(a)&&-1!==t.indexOf(a)&&(r.push(i.children[o]),t.splice(t.indexOf(a),1))}return r}),getBindForKey:function(e,t){return this.data.key?e[this.data.key].toString():t.toString()},onStateUpdate:function(){this.data.updateInPlace?this.onStateUpdateInPlace():this.onStateUpdateNaive()}}),AFRAME.registerComponent("bind-item",{schema:{type:"string"},multiple:!0,init:function(){this.itemData=null,this.keysToWatch=[],this.prevValues={};var e=this.rootEl=this.el.closest("[data-bind-for-key]");if(!e)throw new Error("bind-item component must be attached to entity under a bind-for item.");e.addEventListener("bindforupdateinplace",this.updateInPlace.bind(this)),e.addEventListener("bindfordeactivate",this.deactivate.bind(this)),this.el.sceneEl.systems.state.subscribe(this)},update:function(){this.parseSelector()},updateInPlace:function(e){var t=this.propertyMap;if("false"!==this.rootEl.getAttribute("data-bind-for-active"))for(var n in e&&(this.itemData=e.detail),t){var r=this.select(this.itemData,t[n]);r!==this.prevValues[n]&&(AFRAME.utils.entity.setComponentProperty(this.el,n,r),this.prevValues[n]=r)}},onStateUpdate:function(){this.updateInPlace()},select:function(e,t){return o.select(this.el.sceneEl.systems.state.state,t,e)},deactivate:function(){this.prevValues={}},parseSelector:function(){var e=this.propertyMap={};this.keysToWatch.length=0;var t=o.split(this.id,"__")[0];if(!(t in AFRAME.components)||AFRAME.components[t].isSingleProp)e[this.id]=this.data,o.parseKeysToWatch(this.keysToWatch,this.data,!0);else for(var n=o.split(this.data,";"),r=0;r<n.length;r++){var i=o.split(n[r],":");e[this.id+"."+i[0].trim()]=i[1].trim(),o.parseKeysToWatch(this.keysToWatch,i[1].trim(),!0)}}})},function(e,t,n){"use strict";var r;e.exports=(r=[],function(e,t,n,i){var o,a,s,c,l,u,h;for(l in c=n||{},r.length=0,e)r.push(l);if(!t)return c;for(s in t)-1===r.indexOf(s)&&r.push(s);for(u=0;u<r.length;u++)l=r[u],i&&-1!==i.indexOf(l)||(o=e[l],a=t[l],((h=o&&a&&o.constructor===Object&&a.constructor===Object)&&!AFRAME.utils.deepEqual(o,a)||!h&&o!==a)&&(c[l]=a));return c})},function(e,t,n){"use strict";var r=["push","pop","shift","unshift","splice"];function i(e,t){var n=e[t];e[t]=function(){n.apply(e,arguments),e.__dirty=!0}}e.exports.wrapArray=function(e){var t;if(!e.__wrapped){for(t=0;t<r.length;t++)i(e,r[t]);e.__wrapped=!0}}}])},e.exports=r()},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("slice9",{schema:{width:{default:1,min:0},height:{default:1,min:0},left:{default:0,min:0},right:{default:0,min:0},bottom:{default:0,min:0},top:{default:0,min:0},side:{default:"front",oneOf:["front","back","double"]},padding:{default:.1,min:.01},color:{type:"color",default:"#fff"},opacity:{default:1,min:0,max:1},transparent:{default:!0},debug:{default:!1},src:{type:"map"}},multiple:!1,init:function(){var e=this.data,t=this.material=new THREE.MeshBasicMaterial({color:e.color,opacity:e.opacity,transparent:e.transparent,wireframe:e.debug}),n=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,3,3);new THREE.TextureLoader;this.plane=new THREE.Mesh(n,t),this.el.setObject3D("mesh",this.plane),this.textureSrc=null},updateMap:function(){var e=this.data.src;if(e){if(e===this.textureSrc)return;return this.textureSrc=e,void this.el.sceneEl.systems.material.loadTexture(e,{src:e},t.bind(this))}function t(e){this.material.map=e,this.material.needsUpdate=!0,this.regenerateMesh()}this.material.map&&t(null)},regenerateMesh:function(){var e=this.data,t=this.geometry.attributes.position.array,n=this.geometry.attributes.uv.array,r=this.material.map.image;if(r){var i={left:e.left/r.width,right:e.right/r.width,top:e.top/r.height,bottom:e.bottom/r.height};d(1,i.left,1),d(2,i.right,1),d(4,0,i.bottom),d(5,i.left,i.bottom),d(6,i.right,i.bottom),d(7,1,i.bottom),d(8,0,i.top),d(9,i.left,i.top),d(10,i.right,i.top),d(11,1,i.top),d(13,i.left,0),d(14,i.right,0);var o=e.width/2,a=e.height/2,s=-o+e.padding,c=o-e.padding,l=a-e.padding,u=-a+e.padding;h(0,-o,a),h(1,s,a),h(2,c,a),h(3,o,a),h(4,-o,l),h(5,s,l),h(6,c,l),h(7,o,l),h(8,-o,u),h(9,s,u),h(10,c,u),h(11,o,u),h(13,s,-a),h(14,c,-a),h(12,-o,-a),h(15,o,-a),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0}function h(e,n,r){t[3*e]=n,t[3*e+1]=r}function d(e,t,r){n[2*e]=t,n[2*e+1]=r}},update:function(e){var t=this.data;this.material.color.setStyle(t.color),this.material.opacity=t.opacity,this.material.transparent=t.transparent,this.material.wireframe=t.debug,this.material.side=function(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}(t.side);var n=AFRAME.utils.diff(t,e);"src"in n?this.updateMap():("width"in n||"height"in n||"padding"in n||"left"in n||"top"in n||"bottom"in n||"right"in n)&&this.regenerateMesh()},remove:function(){},pause:function(){},play:function(){}})},function(e,t){var n=[0,90,180,270],r=["right","up","left","down"],i={NULL:{START:"thumbstart",END:"thumbend"}};r.forEach(e=>{i[e]={},i[e].START="thumb"+e+"start",i[e].END="thumb"+e+"end"});AFRAME.registerComponent("thumb-controls",{schema:{thresholdAngle:{default:89.5},thresholdPad:{default:.05},thresholdStick:{default:.75}},init:function(){var e=this.el;this.onTrackpadDown=this.onTrackpadDown.bind(this),this.onTrackpadUp=this.onTrackpadUp.bind(this),this.directionStick="",this.directionTrackpad="",e.components["tracked-controls"]&&(this.axis=e.components["tracked-controls"].axis),this.type="STICK",e.addEventListener("controllerconnected",t=>{this.axis=e.components["tracked-controls"].axis,"oculus-touch-controls"!==t.detail.name&&"windows-motion-controls"!==t.detail.name?this.type="PAD":this.type="STICK"})},play:function(){var e=this.el;e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("touchpaddown",this.onTrackpadDown),e.addEventListener("touchpadup",this.onTrackpadUp)},pause:function(){var e=this.el;e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("touchpaddown",this.onTrackpadDown),e.removeEventListener("touchpadup",this.onTrackpadUp)},onTrackpadDown:function(){var e,t=this.el;this.getDistance()<this.data.thresholdPad||(e=this.getDirection())&&(this.directionTrackpad=e,t.emit(i.NULL.START,null,!1),t.emit(i[this.directionTrackpad].START,null,!1))},onTrackpadUp:function(){var e=this.el;this.directionTrackpad&&(e.emit(i.NULL.END,null,!1),e.emit(i[this.directionTrackpad].END,null,!1),this.directionTrackpad="")},tick:function(){var e,t=this.el;if("PAD"!==this.type){if(!this.directionStick&&this.getDistance()>this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(i.NULL.START,null,!1),void t.emit(i[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()<this.data.thresholdStick&&(t.emit(i.NULL.END,null,!1),t.emit(i[this.directionStick].END,null,!1),this.directionStick="")}},getDistance:function(){var e=this.axis;return this.axis?"PAD"===this.type?Math.sqrt(e[1]*e[1]+e[0]*e[0]):Math.sqrt(e[3]*e[3]+e[2]*e[2]):0},getDirection:function(){var e,t,i,o,a;for(e=this.getAngle(),o=this.data.thresholdAngle/2,i=0;i<n.length;i++){if((a=n[i]+o)>360&&(a-=360),(t=n[i]-o)<0&&(e>=360+t&&e<=360||e>=0&&e<=a))return r[i];if(e>=t&&e<=a)return r[i]}},getAngle:function(){var e,t=this.axis;return this.axis?((e="PAD"===this.type?Math.atan2(-t[1],t[0]):Math.atan2(-t[3],t[2]))<0&&(e=2*Math.PI+e),THREE.Math.radToDeg(e)):0}}),AFRAME.registerComponent("thumb-controls-debug",{dependencies:["thumb-controls"],schema:{controllerType:{type:"string"},hand:{type:"string"},enabled:{default:!1}},init:function(){var e,t,n,r,i=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var o=function(){i.components["tracked-controls"].handleAxes=()=>{},n={axis:t=[0,0,0]},i.components["tracked-controls"].axis=t,i.components["thumb-controls"].axis=t};i.components["tracked-controls"]?o():this.el.addEventListener("controllerconnected",(function(){o()})),(r=this.createCanvas()).addEventListener("click",r=>{"vive-controls"===this.data.controllerType?e?i.emit("trackpadup"):i.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1)),e=!e}),r.addEventListener("mousemove",o=>{var a;e&&(a=r.getBoundingClientRect(),t[0]=(o.clientX-a.left)/240*2-1,t[1]=(o.clientY-a.top)/240*2-1,i.emit("axismove",n,!1))}),r.addEventListener("mouseleave",r=>{e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1))})}},createCanvas:function(){var e,t;return(e=document.createElement("canvas")).classList.add("debugThumb"),e.height=240,e.width=240,e.style.bottom=0,e.style.borderRadius="250px",e.style.opacity=.5,e.style.position="fixed",e.style.zIndex=999999999,"left"===this.data.hand?e.style.left=0:e.style.right=0,(t=e.getContext("2d")).fillStyle="#333",t.fillRect(0,0,240,240),document.body.appendChild(e),e}})},function(e,t,n){var r={"./active-item.js":60,"./agent-dance.js":61,"./agent-picker.js":62,"./beat-cut-fx.js":63,"./beat-generator.js":16,"./beat-hit-sound.js":64,"./beat.js":24,"./blade.js":65,"./check-vr.js":66,"./console-shortcuts.js":67,"./controller.js":68,"./copy-texture.js":69,"./cursor-laser.js":70,"./cursor-mesh.js":71,"./curve-follow-rig-reset.js":72,"./cutfx-shader.js":73,"./debug-beat-generator.js":76,"./debug-beat-positioning.js":77,"./debug-controller.js":78,"./debug-cursor.js":79,"./debug-intro.js":80,"./debug-song-time.js":81,"./debug-state.js":82,"./delayed-proxy-event.js":83,"./desktop-input.js":84,"./difficulty-background.js":85,"./difficulty-filter.js":86,"./difficulty-text.js":87,"./follow-position.js":88,"./follow-z.js":89,"./gameover.js":90,"./gpu-preloader.js":91,"./gradient-shader.js":92,"./hand-swapper.js":94,"./handstar-shader.js":95,"./haptics-wall.js":98,"./haptics-weapon.js":99,"./headfist.js":100,"./history.js":101,"./intro-song.js":102,"./keyboard-raycastable.js":103,"./leaderboard.js":104,"./materials.js":110,"./menu-controls.js":125,"./menu-difficulty-select.js":126,"./menu-genre.js":127,"./menu-midsection.js":128,"./menu-mode.js":129,"./menu-playlist-button.js":130,"./menu-playlist.js":131,"./menu-selected-challenge-image.js":132,"./menu-slide-animation.js":133,"./multiplayer.js":134,"./multiplier-ring.js":138,"./no-frustum-cull.js":139,"./panel-shader.js":140,"./pause.js":143,"./pauser.js":144,"./play-sound.js":145,"./player-height.js":147,"./plume.js":148,"./punch.js":149,"./raycaster-target.js":150,"./recenter.js":151,"./ring.js":152,"./score-texts.js":155,"./search-thumbnail-atlas.js":156,"./search.js":157,"./song-info-positioner.js":160,"./song-preview.js":161,"./song-progress-info.js":162,"./song.js":163,"./stage-colors.js":164,"./stage-lasers.js":165,"./stars.js":166,"./stats-param.js":167,"./stepback.js":168,"./sub-object.js":169,"./super-keyboard.js":170,"./supercurve-color.js":171,"./supercurve-shader.js":172,"./supercurve.js":175,"./supercutfx-shader.js":178,"./supercutfx.js":179,"./tail.js":180,"./text-counter.js":181,"./text-geometry.js":241,"./text-truncate.js":182,"./text-uppercase.js":183,"./toggle-pause-play.js":184,"./trail.js":185,"./tunnels.js":186,"./vertex-colors-buffer.js":187,"./victory-accuracy-ring.js":188,"./victory-rank.js":189,"./visible-raycastable.js":190,"./wall-shader.js":191,"./wall.js":194,"./weapon-particles.js":195,"./zip-loader.js":196};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=59},function(e,t,n){if(AFRAME.registerComponent("active-item",{dependencies:["material"],schema:{active:{default:!1},opacity:{default:1}},init:function(){this.defaultOpacity=this.el.getAttribute("material").opacity,this.materialObj={opacity:this.data.opacity}},update:function(){var e=this.el;this.data.active?(e.setAttribute("material",this.materialObj),e.object3D.visible=!0):(e.setAttribute("material","opacity",this.defaultOpacity),e.components.animation__mouseleave&&setTimeout(()=>{e.emit("mouseleave",null,!1)}))}}),AFRAME.registerComponent("active-text-color",{dependencies:["text"],schema:{active:{default:!1},color:{default:"#333"}},init:function(){this.defaultColor=this.el.getAttribute("text").color},update:function(){var e=this.el;this.data.active?e.setAttribute("text","color",this.data.color):e.setAttribute("text","color",this.defaultColor)}}),window.AFRAME){const t=["active-item","active-text-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["dance","rumba","capoeira","thriller","wave","celebrate","taunt","silly","jump","pray","reaction","sitclap","sitlaugh","kiss","angry","defeated","falling","dying","idle"];if(AFRAME.registerComponent("agent-dance",{schema:{base:{default:"assets/clips/"},initial:{default:"dance"}},init:function(){this.clips={},this.currentAction=null;const e=this.el,t=()=>{const t=e.getObject3D("mesh");t&&(this.mixer=new THREE.AnimationMixer(t),this.play(this.data.initial),this.buildUI())};e.getObject3D("mesh")?t():e.addEventListener("model-loaded",t),this.onKeyDown=e=>{if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t="1234567890".indexOf(e.key);t>=0&&r[t]&&(this.play(r[t]),this.ui&&(this.ui.value=r[t]))},window.addEventListener("keydown",this.onKeyDown)},remove:function(){window.removeEventListener("keydown",this.onKeyDown),this.ui&&this.ui.remove()},play:function(e){if(!this.mixer)return;const t=e=>{const t=this.mixer.clipAction(e);t.reset().play(),this.currentAction&&this.currentAction!==t&&this.currentAction.crossFadeTo(t,.3,!1),this.currentAction=t};this.clips[e]?t(this.clips[e]):fetch(this.data.base+e+".json").then(e=>e.ok?e.json():null).then(n=>{if(!n)return;const r=THREE.AnimationClip.parse(n);this.clips[e]=r,t(r)}).catch(()=>{})},buildUI:function(){const e=document.createElement("select");e.style.cssText="position:fixed;top:10px;left:10px;z-index:9999998;background:rgba(0,0,0,0.7);color:#fff;font-family:monospace;padding:6px;border:1px solid #444;border-radius:4px;",e.title="Agent animation (1-0 keys also work)",r.forEach((t,n)=>{const r=document.createElement("option");r.value=t;const i=n<10?`[${(n+1)%10}] `:"";r.textContent=i+t,t===this.data.initial&&(r.selected=!0),e.appendChild(r)}),e.addEventListener("change",()=>this.play(e.value)),document.body.appendChild(e),this.ui=e},tick:function(e,t){this.mixer&&this.mixer.update(t/1e3)}}),window.AFRAME){const t=["agent-dance"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=[{id:"cz",name:"CZ",url:"assets/avatars/cz.glb"}];function i(e){return String(e).replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]))}function o(e){return"three.ws"===window.location.hostname?e:e.replace(/^https:\/\/pub-2534e921bf9c4314addcd4d8a6e98b7b\.r2\.dev/,"/r2-proxy")}if(AFRAME.registerSystem("agent-picker",{init:function(){this.agents=r.slice(),this.currentId=null,this.companionEl=null,this.searchQuery="";const e=()=>{this.companionEl=document.querySelector("#agentCompanion"),this.companionEl&&(this.buildOverlay(),this.applyInitialSelection(),this.wireSceneEvents(),this.wirePostMessage(),this.fetchPublicAvatars())};this.sceneEl.hasLoaded?e():this.sceneEl.addEventListener("loaded",e)},fetchPublicAvatars:function(e=""){const t=new URL("https://three.ws/api/explore");t.searchParams.set("only3d","1"),t.searchParams.set("limit","40"),e&&t.searchParams.set("q",e),fetch(t.toString()).then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e.items))return;const t=e.items.filter(e=>e.glbUrl).map(e=>({id:`${e.kind}-${e.agentId||e.name}-${e.sortDate}`,name:e.name||"Untitled",url:o(e.glbUrl),owner:e.ownerShort||""}));this.agents=r.concat(t),this.renderList()}).catch(()=>{})},buildOverlay:function(){if(document.getElementById("agentPicker"))return;const e=document.createElement("div");e.id="agentPicker",e.innerHTML='\n <style>\n #agentPicker {\n position: fixed; top: 12px; right: 12px; z-index: 9999;\n font-family: system-ui, sans-serif; user-select: none;\n transition: opacity 0.3s;\n }\n #agentPicker.playing { opacity: 0; pointer-events: none; }\n #agentPicker .ap-toggle {\n background: rgba(8, 10, 24, 0.85); color: #cfd6ff;\n border: 1px solid rgba(120, 140, 255, 0.4); border-radius: 8px;\n padding: 8px 14px; font-size: 12px; letter-spacing: 0.08em;\n cursor: pointer; backdrop-filter: blur(6px);\n }\n #agentPicker .ap-toggle:hover { background: rgba(40, 50, 100, 0.9); }\n #agentPicker .ap-panel {\n margin-top: 8px; background: rgba(8, 10, 24, 0.92);\n border: 1px solid rgba(120, 140, 255, 0.3); border-radius: 8px;\n padding: 8px; width: 260px; display: none;\n backdrop-filter: blur(6px);\n }\n #agentPicker.open .ap-panel { display: block; }\n #agentPicker .ap-search {\n width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.4);\n color: #cfd6ff; border: 1px solid rgba(120, 140, 255, 0.3);\n border-radius: 6px; padding: 6px 8px; font-size: 12px;\n margin-bottom: 6px; outline: none;\n }\n #agentPicker .ap-list { max-height: 320px; overflow-y: auto; }\n #agentPicker .ap-item {\n display: flex; align-items: center; gap: 10px;\n padding: 8px 10px; border-radius: 6px; cursor: pointer;\n color: #cfd6ff; font-size: 13px;\n }\n #agentPicker .ap-item:hover { background: rgba(80, 100, 200, 0.25); }\n #agentPicker .ap-item.active { background: rgba(80, 100, 200, 0.4); }\n #agentPicker .ap-dot {\n width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;\n background: linear-gradient(135deg, #6699ff, #ff4488);\n }\n #agentPicker .ap-name {\n flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n }\n #agentPicker .ap-owner { color: #6677aa; font-size: 10px; }\n #agentPicker .ap-empty { padding: 10px; color: #6677aa; font-size: 12px; text-align: center; }\n </style>\n <button class="ap-toggle" type="button">AGENT</button>\n <div class="ap-panel">\n <input class="ap-search" type="text" placeholder="Search avatars on three.ws..." />\n <div class="ap-list"></div>\n </div>\n ',document.body.appendChild(e);const t=e.querySelector(".ap-toggle"),n=e.querySelector(".ap-search");let r;t.addEventListener("click",()=>e.classList.toggle("open")),n.addEventListener("input",()=>{clearTimeout(r),this.searchQuery=n.value.trim(),r=setTimeout(()=>this.fetchPublicAvatars(this.searchQuery),300)}),this.overlayEl=e,this.listEl=e.querySelector(".ap-list")},renderList:function(){this.listEl&&(this.listEl.innerHTML="",this.agents.length?this.agents.forEach(e=>{const t=document.createElement("div");t.className="ap-item"+(e.id===this.currentId?" active":""),t.dataset.id=e.id,t.innerHTML=`\n <span class="ap-dot"></span>\n <span class="ap-name">${i(e.name)}</span>\n ${e.owner?`<span class="ap-owner">${i(e.owner)}</span>`:""}\n `,t.addEventListener("click",()=>{this.selectAgent(e.id),this.overlayEl.classList.remove("open")}),this.listEl.appendChild(t)}):this.listEl.innerHTML='<div class="ap-empty">No avatars found.</div>')},applyInitialSelection:function(){const e=new URLSearchParams(window.location.search).get("agent");e&&this.agents.some(t=>t.id===e)?this.selectAgent(e):this.selectAgent(this.agents[0].id),this.renderList()},selectAgent:function(e){let t;"string"==typeof e?t=this.agents.find(t=>t.id===e):e&&e.url&&(t=e,this.agents.some(e=>e.id===t.id)||this.agents.push(t)),t&&this.companionEl&&(this.currentId=t.id,this.companionEl.setAttribute("gltf-model",t.url),this.renderList(),this.sceneEl.emit("agentchanged",{agentId:t.id,url:t.url}))},wireSceneEvents:function(){const e=()=>this.overlayEl&&this.overlayEl.classList.remove("playing");this.sceneEl.addEventListener("songstartfade",()=>this.overlayEl&&this.overlayEl.classList.add("playing")),this.sceneEl.addEventListener("cleargame",e),this.sceneEl.addEventListener("gameover",e),this.sceneEl.addEventListener("songcomplete",e)},wirePostMessage:function(){window.addEventListener("message",e=>{const t=e.data;t&&"rider:setAgent"===t.type&&(t.url?this.selectAgent({id:t.agentId||"external-"+Date.now(),name:t.name||"Agent",url:t.url}):t.agentId&&this.selectAgent(t.agentId))})}}),window.AFRAME){const t=[],n=[],r=["agent-picker"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Vector3,i={right:0,upright:45,up:90,upleft:135,left:180,downleft:225,down:270,downright:315},o={right:new THREE.Vector2(0,1),upright:new THREE.Vector2(-.5,.5),up:new THREE.Vector2(-1,0),upleft:new THREE.Vector2(-.5,-.5),left:new THREE.Vector2(0,-1),downleft:new THREE.Vector2(.5,-.5),down:new THREE.Vector2(1,0),downright:new THREE.Vector2(.5,.5)};function a(e,t){e.x+=(Math.random()-.5)*t,e.y+=(Math.random()-.5)*t,e.z+=(Math.random()-.5)*t}if(AFRAME.registerComponent("beat-cut-fx",{schema:{color:{type:"string"},type:{oneOf:["beat","dot","mine"],default:"beat"}},init:function(){this.breaking=!1,this.fx=null,this.fxpool=null,this.pieces=[],this.pool=null,this.returnToPoolTimer=500,this.el.addEventListener("model-loaded",this.setupModel.bind(this)),this.el.addEventListener("explode",this.explode.bind(this),!1)},update:function(){const e=this.el.sceneEl,t=this.data.color;"beat"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components["pool__beat-broken-"+t],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):"dot"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components[`pool__beat-broken-${t}-dot`],this.poolPunch=e.components[`pool__punch-broken-${t}-dot`],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):(this.material=e.systems.materials.minePieces,this.poolBeat=e.components["pool__beat-broken-mine"],this.poolBeatFx=e.components["pool__beat-fx-mine"],this.poolPunchFx=e.components["pool__punch-fx-mine"])},setupModel:function(e){const t=e.detail.model;this.pieces=t.children;for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.restPosition=t.position.clone(),t.restRotation=t.rotation.clone(),t.posVelocity=new THREE.Vector3,t.rotVelocity=new THREE.Vector3,t.material=this.material}},explode:function(e){const t=e.detail.direction,n=e.detail.gameMode,s=e.detail.correctHit,c=e.detail.position,l=e.detail.rotation;let u=e.detail.beatDirection;if(c&&l&&t&&this.data.color===e.detail.color){if(this.el.object3D.position.copy(c),"classic"===n&&"mine"!==this.data.type){const e="dot"===this.data.type;e&&(u=Math.abs(t.x)>Math.abs(t.y)?"right":"down"),t.z*=.01,r.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t<this.pieces.length;t++){let n=this.pieces[t];if(n.posVelocity.copy(r),n.rotation.z=THREE.Math.degToRad(i[u]),s){let r=t%2==0?-.001:.001;n.posVelocity.x+=o[u].x*r,n.posVelocity.y+=o[u].y*r,!e||t<2?(a(n.posVelocity,.002),a(n.rotVelocity,.004)):(n.posVelocity.copy(this.pieces[t-2].posVelocity),n.rotVelocity.copy(this.pieces[t-2].rotVelocity))}else n.posVelocity.y+=.001,n.rotVelocity.z+=.01}}else for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];s?(t.posVelocity.copy(t.position).normalize().multiplyScalar(.002),t.posVelocity.z=-.004,a(t.posVelocity,.001),a(t.rotVelocity,.01)):(t.posVelocity.y+=.001,t.posVelocity.z-=.001)}this.pool=this["classic"===n?"poolBeat":"poolPunch"],null===this.fx&&(this.fxpool=this["classic"===n?"poolBeatFx":"poolPunchFx"],this.fx=this.fxpool.requestEntity()),this.fx&&(this.fx.play(),this.fx.object3D.position.copy(c),this.fx.object3D.rotation.copy(l),this.fx.emit("explode")),this.returnToPoolTimer=500,this.breaking=!0,this.el.play()}},returnToPool:function(){for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.position.copy(t.restPosition),t.rotation.copy(t.restRotation),t.posVelocity.set(0,0,0),t.rotVelocity.set(0,0,0),t.scale.set(1,1,1)}this.fx&&(this.fxpool.returnEntity(this.fx),this.fx=null),this.pool.returnEntity(this.el),this.breaking=!1},tick:function(e,t){if(this.breaking)if(this.returnToPoolTimer-=t,this.returnToPoolTimer<=0)this.returnToPool();else for(let e=0;e<this.pieces.length;e++){const n=this.pieces[e];n.position.addScaledVector(n.posVelocity,t),n.rotation.set(n.rotation.x+n.rotVelocity.x*t,n.rotation.y+n.rotVelocity.y*t,n.rotation.z+n.rotVelocity.z*t),"mine"!==this.data.type?(this.returnToPoolTimer<250&&n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97),n.posVelocity.y-=3e-6*t):(n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97))}}}),window.AFRAME){const t=["beat-cut-fx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("beat-hit-sound",{directionsToSounds:{up:"",down:"",upleft:"left",upright:"right",downleft:"left",downright:"right",left:"left",right:"right"},init:function(){this.currentBeatEl=null,this.currentCutDirection="",this.processSound=this.processSound.bind(this),this.sourceCreatedCallback.bind(this);for(let e=1;e<=10;e++)this.el.setAttribute("sound__beathit"+e,{poolSize:8,positional:!1,src:"#hitSound"+e,volume:.185}),this.el.setAttribute(`sound__beathit${e}left`,{poolSize:8,positional:!1,src:`#hitSound${e}left`,volume:.185}),this.el.setAttribute(`sound__beathit${e}right`,{poolSize:8,positional:!1,src:`#hitSound${e}right`,volume:.185})},play:function(){for(let e=1;e<=10;e++)this.el.components["sound__beathit"+e].loaded||(this.el.setAttribute("sound__beathit"+e,"src",""),this.el.setAttribute("sound__beathit"+e,"src","#hitSound"+e)),this.el.components[`sound__beathit${e}left`].loaded||(this.el.setAttribute(`sound__beathit${e}left`,"src",""),this.el.setAttribute(`sound__beathit${e}left`,"src",`#hitSound${e}left`)),this.el.components[`sound__beathit${e}right`].loaded||(this.el.setAttribute(`sound__beathit${e}right`,"src",""),this.el.setAttribute(`sound__beathit${e}right`,"src",`#hitSound${e}right`))},playSound:function(e,t,n){const r=1+Math.floor(10*Math.random()),i=this.directionsToSounds[n||"up"];this.el.components[`sound__beathit${r}${i}`].playSound(this.processSound)},processSound:function(e){e.detune=0},sourceCreatedCallback:function(e){const t=this.getLayer(this.currentBeatEl.object3D.position.y);"bottom"===t?e.detune.setValueAtTime(-400,0):"top"===t&&e.detune.setValueAtTime(200,0),"down"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(-400,1),"up"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(400,1)},getLayer:function(e){return 1===e?"bottom":1.7===e?"top":"middle"}}),window.AFRAME){const t=["beat-hit-sound"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("blade",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.data;this.bladeHandle=e.querySelector(".bladeHandleHelper").object3D,this.bladeTip=e.querySelector(".bladeTipHelper").object3D,this.rigEl=document.getElementById("curveFollowRig"),this.strokeDirectionVector=new THREE.Vector3,this.strokeSpeed=0,this.bladeBottomPosition=new THREE.Vector3,this.bladeTipPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeWorldPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeEl=this.el.querySelector(".blade")},update:function(e){!e.enabled&&this.data.enabled&&this.bladeEl.emit("drawblade")},tickBeatSystem:function(e,t){this.data.enabled&&this.updateVelocity(t)},updateVelocity:function(e){const t=this.bladeTipPositions,n=this.bladeWorldPositions;this.data;n[2].copy(n[0]),n[3].copy(n[1]),this.bladeTip.getWorldPosition(n[0]),this.bladeHandle.getWorldPosition(n[1]),t[2].copy(n[0]),this.rigEl.object3D.worldToLocal(t[2]),this.strokeDirectionVector.copy(t[2]).sub(t[0]);const r=this.strokeDirectionVector.length();this.strokeSpeed=r/(e/1e3),this.strokeDirectionVector.z=0,this.strokeDirectionVector.normalize();const i=t.shift();t.push(i)},checkCollision:function(){const e=new THREE.Box3,t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],n=new THREE.Triangle;return function(r){if(this.strokeSpeed<1)return!1;for(let e=0;e<3;e++)t[e].copy(this.bladeWorldPositions[e]),r.blockEl.object3D.worldToLocal(t[e]),t[e].multiplyScalar(1.75);return n.set(t[0],t[1],t[2]),e.copy(r.bbox),e.expandByScalar(.02),"left"!==r.horizontalPosition&&"right"!==r.horizontalPosition||e.expandByScalar(.07),!!e.intersectsTriangle(n)||(t[3].copy(this.bladeWorldPositions[3]),r.blockEl.object3D.worldToLocal(t[3]),n.set(t[2],t[3],t[0]),!!e.intersectsTriangle(n))}}(),createDebugCube:function(e,t){const n=new THREE.BoxGeometry(.05,.05,.05),r=new THREE.Mesh(n,new THREE.MeshBasicMaterial({color:t,side:THREE.DoubleSide}));r.position.copy(e),this.el.sceneEl.object3D.add(r)}}),window.AFRAME){const t=["blade"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerSystem("check-vr",{init:function(){AFRAME.utils.device.isMobile()&&(document.getElementById("vrButton").style.display="none"),setTimeout(()=>{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],n=[],r=["check-vr"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("console-shortcuts",{play:function(){window.$=e=>document.querySelector(e),window.$$=e=>document.querySelectorAll(e),window.$$$=e=>document.querySelector(`[${e}]`).getAttribute(e),window.$$$$=e=>document.querySelector(`[${e}]`).components[e],window.scene=this.el,window.state=this.el.systems.state.state}}),window.AFRAME){const t=["console-shortcuts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("controller",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){const e=this.el,t=this.data;this.controllerType="",e.addEventListener("controllerconnected",e=>{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const n={hand:t.hand,model:!1};e.setAttribute("daydream-controls",n),e.setAttribute("oculus-go-controls",n),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",n),e.setAttribute("vive-focus-controls",n),e.setAttribute("windows-motion-controls",n),e.setAttribute("generic-tracked-controller-controls",n)},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown"],upEvents:["triggerup","gripup","abuttonup","bbuttonup","xbuttonup","ybuttonup"]}},"vive-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"windows-motion-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}}),window.AFRAME){const t=["controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("copy-texture",{dependencies:["geometry","material"],schema:{from:{type:"selector"}},init:function(){this.data.from.addEventListener("materialtextureloaded",()=>{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,n=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(n.map=t.getObject3D("mesh").material.map,n.map&&(n.map.needsUpdate=!0,n.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-laser",{dependencies:["geometry"],schema:{enabled:{default:!0}},init:function(){const e=this.el;this.weaponEl=this.el.closest(".weapon");const t=this.el.getAttribute("geometry");e.object3D.position.z=-1*t.height/2,this.originalSize=t.height,this.currentLength=t.height},update:function(){this.el.object3D.visible=this.data.enabled},tick:function(){const e=this.el;if(!this.data.enabled)return;const t=this.weaponEl.components.cursor;if(!t)return;if(!t.intersectedEl)return e.object3D.position.z=-24.98,e.object3D.scale.x=.75,e.getObject3D("mesh").scale.y=50,void(this.currentLength=1);const n=this.weaponEl.components.raycaster.intersections[0];n&&(e.object3D.scale.x=1,e.object3D.position.z=-n.distance/2,e.getObject3D("mesh").scale.y=this.currentLength=n.distance)}}),window.AFRAME){const t=["cursor-laser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-mesh",{schema:{active:{default:!0},cursorEl:{type:"selector"}},init:function(){this.scenePivotEl=document.getElementById("scenePivot")},update:function(){this.el.object3D.visible=this.data.active},tick:function(){var e,t,n=this.data.cursorEl,r=this.el,i=this.scenePivotEl;this.data.active&&n.components.cursor&&((t=n.components.cursor.intersectedEl)?(r.object3D.visible=!0,(e=n.components.raycaster.getIntersection(t))&&(r.object3D.position.copy(e.point),i&&r.object3D.rotation.copy(i.object3D.rotation))):r.object3D.visible=!1)}}),window.AFRAME){const t=["cursor-mesh"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("curve-follow-rig-reset",{schema:{isVictory:{type:"string"}},init:function(){this.el.sceneEl.addEventListener("cleargame",()=>{this.reset()})},update:function(e){const t=this.data;this.el;!e.isVictory&&t.isVictory&&this.reset()},reset:function(){this.el.components["supercurve-follow"].curveProgress=0,this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0)}}),window.AFRAME){const t=["curve-follow-rig-reset"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("cutfxShader",{schema:{src:{type:"map",is:"uniform",default:"#cutfxImg"},color:{type:"color",is:"uniform",default:"#fff"},progress:{type:"number",is:"uniform"},transparent:{default:!0},blending:{default:"additive"},side:{default:"double"},depthTest:{default:!1},depthWrite:{default:!1}},vertexShader:n(74),fragmentShader:n(75)}),window.AFRAME){const t=[],n=["cutfxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float progress;\n\nvoid main() {\n vec3 col = color;\n float alpha = smoothstep(progress, 1.0, texture2D(src, uvs).a);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("debug-beat-generator",{dependencies:["beat-generator"],schema:{beatEnabled:{default:!1},stageEnabled:{default:!1}},init:function(){this.beatLoader=this.el.components["beat-generator"],this.selectedBeat={color:"red",position:"middleCenterLeft",type:"arrow",orientation:"up"},this.beats={},this.onKeyDown=this.onKeyDown.bind(this),(this.data.stageEnabled||AFRAME.utils.getUrlParameter("debugstage"))&&this.addDebugStageControls(),(this.data.beatEnabled||"gameplay"===AFRAME.utils.getUrlParameter("debugstate").trim())&&(window.addEventListener("keydown",this.onKeyDown),this.addDebugBeatControls())},spawn:function(){var e=this;Object.keys(this.beats).forEach((function(t){e.generateBeat(e.beats[t])}))},generateBeat:function(e){var t;"wall"!==e.type?(t="mine"===e.type?3:"red"===e.color?0:1,this.beatLoader.generateBeat({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_lineLayer:this.beatLoader.positionHumanized[e.position].layer,_cutDirection:"dot"===e.type?8:this.beatLoader.orientationsHumanized.indexOf(e.orientation),_type:t})):this.generateWall(e)},generateWall:function(e){this.beatLoader.bpm=90,this.beatLoader.generateWall({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_width:1,_duration:3})},onKeyDown:function(e){switch(e.keyCode){case 32:this.spawn()}},addDebugBeatControls:function(){const e=document.createElement("div"),t=this;var n;function r(t){const n=document.createElement("div");return n.id=t,n.style.marginBottom="20px",n.style.width="500px",n.style.display="inline-block",e.appendChild(n),n}function i(e,n,r){const i=document.createElement("div"),o=r||function(){const e=i.parentElement.querySelectorAll(".button");for(let t=0;t<e.length;t++)e[t].style.background="#000";i.style.background="#66f",t.selectedBeat[i.parentElement.id]=this.id,t["selected"+i.parentElement.id.charAt(0).toUpperCase()+i.parentElement.id.slice(1)+"El"]=this};return i.classList.add("button"),i.id=e,i.style.width="100px",i.style.height="30px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.margin="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.lineHeight="30px",i.style.cursor="pointer",i.style.display="inline-block",i.innerHTML=e,n.appendChild(i),i.addEventListener("click",o),i}e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.padding="10px",e.style.width="500px",e.style.height="600px",document.body.appendChild(e),function(){const t=r("type");i("arrow",t),i("dot",t),i("mine",t),i("wall",t),e.appendChild(t)}(),function(){const t=r("color");i("blue",t),i("red",t),e.appendChild(t)}(),function(){const t=r("orientation");i("top",t),i("left",t),i("right",t),i("down",t),e.appendChild(t)}(),(n=i("Set Beat",e,(function(){var e="mine"!==t.selectedBeat.type?" "+t.selectedBeat.color:"",n="arrow"!==t.selectedBeat.type?"":" "+t.selectedBeat.orientation;t.selectedBeat={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color},t.selectedPositionEl&&(t.selectedPositionEl.innerHTML=t.selectedBeat.type+e+n,t.beats[t.selectedPositionEl.id]={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color})}))).style.width="460px",n.style.bottomMargin="10px",function(){const e=r("position");i("topLeft",e),i("topCenterLeft",e),i("topCenterRight",e),i("topRight",e),i("middleLeft",e),i("middleCenterLeft",e),i("middleCenterRight",e),i("middleRight",e),i("bottomLeft",e),i("bottomCenterLeft",e),i("bottomCenterRight",e),i("bottomRight",e)}(),function(n,r){const o=i("Spawn (Space Bar)",e,()=>{t.spawn()});o.style.width="460px",o.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,n,r)=>{const i=document.createElement("div");i.style.position="absolute",i.id="stagecontrol"+t,i.style.width="100px",i.style.height="30px",i.style.top="element"===r?"20px":"70px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.cursor="pointer",i.style.left=20+120*t+"px",i.innerHTML=n,"element"===r?i.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",i.style.background="#66f",e=t}):i.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(i)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,n)=>{t(n,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,n)=>{t(n,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["left","middleleft","middleright","right"],i=["bottom","middle","top"];if(AFRAME.registerComponent("debug-beat-positioning",{play:function(){let e=AFRAME.utils.getUrlParameter("debugbeatpositioning");e&&("punch"!==e&&"classic"!==e&&(e="classic"),this.el.emit("debugbeatpositioning"),setTimeout(()=>{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),r.forEach(n=>{i.forEach(r=>{let i=t.requestBeat("punch"===e?"dot":"arrow","red"),o=Math.random()<.5?"left":"right";i.components.beat.onGenerate(.001,n,r,o),i.object3D.renderOrder=9999,i.play(),i=t.requestBeat("dot","blue"),o=Math.random()<.5?"down":"up",i.components.beat.onGenerate(.0015,n,r,o),i.object3D.renderOrder=9999,i.play()})});const n=scene.components.pool__wall.requestEntity();n.components.wall.onGenerate(.0015,"left",4,4,!0),n.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-controller",{init:function(){var e,t;AFRAME.utils.getUrlParameter("debug")&&(console.log("%c debug-controller enabled ","background: #111; color: red"),e=document.getElementById("rightHand"),t=document.getElementById("leftHand"),e.setAttribute("tracked-controls","autoHide",!1),e.object3D.visible=!0,t.object3D.visible=!0,t.setAttribute("tracked-controls","autoHide",!1),AFRAME.utils.getUrlParameter("headfist")||(window.addEventListener("click",t=>{t.isTrusted&&(e.emit("triggerdown"),e.emit("triggerup"))}),"oculus"===AFRAME.utils.getUrlParameter("debug")?(e.emit("controllerconnected",{name:"oculus-touch-controls"}),t.emit("controllerconnected",{name:"oculus-touch-controls"}),e.setAttribute("controller","controllerType","oculus-touch-controls"),t.setAttribute("controller","controllerType","oculus-touch-controls")):(e.emit("controllerconnected",{name:"vive-controls"}),t.emit("controllerconnected",{name:"vive-controls"}),e.setAttribute("controller","controllerType","vive-controls"),t.setAttribute("controller","controllerType","vive-controls")),this.el.emit("enter-vr",null,!1),document.addEventListener("keydown",n=>{var r,i,o,a;n.shiftKey&&(32!==n.keyCode?81!==n.keyCode?(78===n.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===n.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===n.keyCode&&t.emit("menudown"),n.ctrlKey?(o=t.getAttribute("position"),72===n.keyCode&&(o.x-=.02),74===n.keyCode&&(o.y-=.02),75===n.keyCode&&(o.y+=.02),76===n.keyCode&&(o.x+=.02),59!==n.keyCode&&186!==n.keyCode||(o.z-=.01),222===n.keyCode&&(o.z+=.01),t.setAttribute("position",AFRAME.utils.clone(o))):(r=e.getAttribute("position"),72===n.keyCode&&(r.x-=.02),74===n.keyCode&&(r.y-=.02),75===n.keyCode&&(r.y+=.02),76===n.keyCode&&(r.x+=.02),59!==n.keyCode&&186!==n.keyCode||(r.z-=.02),222===n.keyCode&&(r.z+=.02),e.setAttribute("position",AFRAME.utils.clone(r))),n.ctrlKey?(a=t.getAttribute("rotation"),89===n.keyCode&&(a.x-=10),79===n.keyCode&&(a.x+=10),85===n.keyCode&&(a.y-=10),73===n.keyCode&&(a.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(a))):(i=e.getAttribute("rotation"),89===n.keyCode&&(i.x-=10),79===n.keyCode&&(i.x+=10),85===n.keyCode&&(i.y-=10),73===n.keyCode&&(i.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(i)))):this.isSecondaryTriggerDown?(t.emit("triggerup"),this.isSecondaryTriggerDown=!1):(t.emit("triggerdown"),this.isSecondaryTriggerDown=!0):this.isTriggerDown?(e.emit("triggerup"),this.isTriggerDown=!1):(e.emit("triggerdown"),this.isTriggerDown=!0))})))},play:function(){var e,t;if(this.bounds=document.body.getBoundingClientRect(),!AFRAME.utils.getUrlParameter("debug"))return;if(AFRAME.utils.getUrlParameter("headfist"))return;e=document.getElementById("rightHand"),(t=document.getElementById("leftHand")).object3D.position.set(-.2,1.5,-.5),e.object3D.position.set(.2,1.5,-.5),t.setAttribute("rotation",{x:35,y:0,z:0});const n=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===n?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===n?(e.querySelector(".punch").removeAttribute("bind__visible"),e.querySelector(".punch").object3D.visible=!0,e.querySelector(".punch").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1):"ride"===n&&(e.querySelector(".handStar").removeAttribute("bind__visible"),e.querySelector(".handStar").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1)})},onMouseMove:function(){const e=new THREE.Vector3,t=new THREE.Vector2,n=new THREE.Vector3;return function(r){const i=this.bounds,o=this.el.sceneEl.camera,a=r.clientX-i.left,s=r.clientY-i.top;t.x=a/i.width*2-1,t.y=-s/i.height*2-1,document.getElementById("camera").object3D.getWorldPosition(n),e.set(t.x,t.y,.5).unproject(o).sub(n).normalize();const c=document.getElementById("rightHand").object3D.position,l=-n.z/e.z;o.getWorldPosition(c).add(e.multiplyScalar(l)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-cursor",{init:function(){},log:function(e,t,n){t.id?console.log(`%c[${e}] ${t.id}`,"color: "+n):(console.log(`%c[${e}]`,"color: "+n),console.log(t))}}),window.AFRAME){const t=["debug-cursor"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=AFRAME.utils.getUrlParameter("skipintro");if(AFRAME.registerComponent("debug-intro",{play:function(){r&&document.getElementById("startButton").emit("click")}}),window.AFRAME){const t=["debug-intro"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-song-time",{dependencies:["song"],init:function(){AFRAME.utils.getUrlParameter("debug-song-time")&&setInterval(()=>{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-state",{play:function(){const e=AFRAME.utils.getUrlParameter("debugstate").trim();e&&setTimeout(()=>{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("delayed-proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1},delay:{default:0,type:"int"}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,o=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){setTimeout(()=>{var r=o.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)},r.delay)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(r){setTimeout(()=>{var t=n.data;t.enabled&&(t.captureBubbles||r.target===e)&&n.el.emit(t.as||t.event,r.detail?r.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=.6,i=.5;if(AFRAME.registerComponent("desktop-input",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){this.target=new THREE.Vector3("right"===this.data.hand?.25:-.25,1.4,0),this.lungeUntil=0,this.hasController=!1,this.el.addEventListener("controllerconnected",()=>{this.hasController=!0}),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onContextMenu=e=>e.preventDefault(),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mousedown",this.onMouseDown),window.addEventListener("contextmenu",this.onContextMenu)},remove:function(){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("contextmenu",this.onContextMenu)},onMouseMove:function(e){const t=e.clientX/window.innerWidth*2-1,n=e.clientY/window.innerHeight*2-1;this.target.x=("right"===this.data.hand?.25:-.25)+t*r,this.target.y=1.4-n*i},onMouseDown:function(e){const t="right"===this.data.hand,n=2===e.button||e.shiftKey;t&&n||(t||n)&&(this.lungeUntil=performance.now()+140,this.el.emit("triggerdown",null,!1),setTimeout(()=>this.el.emit("triggerup",null,!1),140))},tick:function(){if(this.hasController)return;const e=this.el.object3D,t=performance.now()<this.lungeUntil;e.position.x+=.35*(this.target.x-e.position.x),e.position.y+=.35*(this.target.y-e.position.y);const n=t?-.6:this.target.z;e.position.z+=.5*(n-e.position.z)}}),window.AFRAME){const t=["desktop-input"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-background",{schema:{enabled:{type:!1}},update:function(){this.data.enabled?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable")}}),window.AFRAME){const t=["difficulty-background"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-filter",{events:{click:function(e){this.el.sceneEl.emit("difficultyfilter",e.target.parentNode.dataset.difficultyFilter)}}}),window.AFRAME){const t=["difficulty-filter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-text",{schema:{id:{value:"Standard-Easy"}},update:function(){this.el.setAttribute("text","value",this.data.id.replace("Standard-","").replace("-","\n"))}}),window.AFRAME){const t=["difficulty-text"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-position",{schema:{target:{type:"selector"}},tick:function(){this.el.object3D.position.copy(this.data.target.object3D.position)}}),window.AFRAME){const t=["follow-position"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-z",{schema:{offset:{type:"vec3"},target:{type:"selector"}},tick:function(){this.data.target&&(this.el.object3D.position.copy(this.data.offset),this.el.object3D.position.z+=this.data.target.object3D.position.z)}}),window.AFRAME){const t=["follow-z"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("gameover",{schema:{isGameOver:{default:!1}},init:function(){this.beatContainer=document.getElementById("beatContainer"),this.gameOverEls=document.querySelectorAll("[animation__gameover]")},update:function(e){this.data;!e.isGameOver&&this.data.isGameOver&&(this.triggerAnimations(),this.countDown=1),e.isGameOver&&!this.data.isGameOver&&this.reset()},tick:function(e,t){this.data.isGameOver&&this.countDown>=0&&(this.beatContainer.object3D.position.z=1.5*-Math.pow(1-this.countDown,2),this.countDown-=t/1e3)},reset:function(){this.beatContainer.object3D.position.z=0,this.el.sceneEl.setAttribute("stage-colors","color","blue")},triggerAnimations:function(){for(let e=0;e<this.gameOverEls.length;e++)this.gameOverEls[e].emit("gameover",null,!1);this.el.emit("textglowoff",null,!1),this.el.emit("bgcolorgameover",null,!1)}}),window.AFRAME){const t=["gameover"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){let r=0;if(AFRAME.registerComponent("gpu-preloader",{dependencies:["materials"],play:function(){setTimeout(()=>{this.preloadFromSelector("#mainLogo"),this.preloadFromSelector("#prevArrow"),this.preloadFromSelector("#stepback"),this.preloadFromSelector(".difficultyBackground"),this.preloadFromSelector(".genreIcon"),this.preloadFromSelector(".merkababloom"),this.preloadFromSelector(".searchResultBackground"),this.preloadMaterialsComponentTextures(),this.preloadKeyboard(),this.preloadSlice(),this.preloadEnvMap(),this.preloadFXs()},1e3)},preloadFromSelector:function(e){const t=document.querySelector(e);this.preloadTexture(t.getObject3D("mesh").material.map)},preloadMaterialsComponentTextures:function(){const e=this.el.systems.materials.textureList;for(var t=0;t<e.length;t++)this.preloadTexture(e[t])},preloadKeyboard:function(){const e=document.getElementById("keyboard").components["super-keyboard"];this.preloadTexture(e.kbImg.getObject3D("mesh").material.map),this.preloadTexture(e.keyColorPlane.getObject3D("mesh").material.map)},preloadSlice:function(){const e=document.getElementById("searchPrevPage");this.preloadTexture(e.components.slice9.material.map)},preloadEnvMap:function(){const e=document.querySelector("#wallContainer [wall]");this.preloadTexture(e.components.material.material.uniforms.environment.value)},preloadFXs:function(){const e=document.querySelector("#rigContainer [mixin~=blueBeatFX]");this.preloadTexture(e.components.material.material.uniforms.src.value);const t=document.querySelector("#rigContainer [mixin~=mineFX]");this.preloadTexture(t.components.material.material.map)},preloadTexture:function(e){e&&e.image?e.image.complete?this.el.renderer.setTexture2D(e,r++%8):console.warn("[gpu-preloader] Error preloading, image not loaded",e):console.warn("[gpu-preloader] Error preloading texture",e)}}),window.AFRAME){const t=["gpu-preloader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("gradientShader",{schema:{color1:{type:"color",is:"uniform"},color2:{type:"color",is:"uniform"}},vertexShader:n(17),fragmentShader:n(93)}),window.AFRAME){const t=[],n=["gradientShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nuniform vec3 color1;\nuniform vec3 color2;\n\nvoid main () {\n float mixDistance = distance(uvs, vec2(0.5, 0));\n float alphaDistance = min(1., (0.5 - distance(uvs, vec2(0.5))) * 2.5);\n gl_FragColor = vec4(mix(color1, color2, pow(mixDistance, 2.4)), alphaDistance);\n}\n"},function(e,t,n){const r=["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown","trackpaddown"];if(AFRAME.registerComponent("hand-swapper",{schema:{enabled:{default:!1}},init:function(){this.swapHand=this.swapHand.bind(this),r.forEach(e=>{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("handStar",{schema:{colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},colorTertiary:{type:"color",is:"uniform",default:i.a.initial.tertiary},pulse:{type:"number",is:"uniform",default:0},transparent:{default:!0},side:{default:"back"},depthTest:{default:!1}},vertexShader:n(96),fragmentShader:n(97)}),window.AFRAME){const t=[],n=["handStar"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\n\nvoid main() {\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vec3 worldNormal = normalize(mat3(modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz) * normal);\n vec3 viewVector = normalize(vWorldPosition - cameraPosition);\n fresnel = 0.08 * pow(0.4 + dot(viewVector, worldNormal), 6.0 + pulse);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += (fresnel * pulse) * 0.1;\n gl_FragColor = vec4 (col, clamp(fresnel, 0.0, 1.0));\n}\n"},function(e,t,n){if(AFRAME.registerComponent("haptics-wall",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isHittingWall=!1,e.setAttribute("haptics__wall",{dur:50,force:.15}),this.checkIfHittingWall=this.checkIfHittingWall.bind(this),e.addEventListener("mouseenter",this.checkIfHittingWall),e.addEventListener("mouseleave",this.checkIfHittingWall),this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),50)},checkIfHittingWall:function(){const e=this.el.components.raycaster__game.intersectedEls;this.isHittingWall=!1;for(let t=0;t<e.length;t++)if(e[t].components.wall)return void(this.isHittingWall=!0)},tick:function(){this.data.enabled&&this.isHittingWall&&this.el.components.haptics__wall.pulse()}}),window.AFRAME){const t=["haptics-wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("haptics-weapons",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isColliding=!1,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),100),e.setAttribute("haptics__weapon",{dur:100,force:.075}),e.addEventListener("mouseenter",t=>{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const n=t.detail.intersectedEl;n.classList.contains("blade")&&n!==e?(this.isColliding=!0,this.el.components.haptics__weapon.pulse()):this.isColliding=!1}),e.addEventListener("mouseleave",e=>{this.isColliding=!1})},tick:function(){this.isColliding&&this.data.enabled&&this.el.components.haptics__weapon.pulse()}}),window.AFRAME){const t=["haptics-weapons"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=!!AFRAME.utils.getUrlParameter("headfist");if(AFRAME.registerComponent("headfist",{schema:{hand:{type:"string"},isPlaying:{default:!1}},init:function(){console.log("[headfist] "+r),r&&(this.camera=document.getElementById("camera").object3D,this.originalParent=this.el.object3D.parent)},update:function(){const e=this.el;if(r&&this.camera)return this.data.isPlaying?(this.camera.add(e.object3D),e.object3D.rotation.set(-5,0,0),e.object3D.position.set("right"===this.data.hand?.175:-.175,.15,-.2),e.components["tracked-controls"].pause(),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].pause(),void(e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].pause())):void(e.object3D.parent!==this.originalParent&&(console.log("[headfist] Detach."),this.originalParent.add(e.object3D),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].play(),e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].play()))}}),window.AFRAME){const t=["headfist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("history",{schema:{challengeId:{type:"string"},songName:{type:"string"},songSubName:{type:"string"}},update:function(){const e=this.data;history.pushState("",e.songName,updateQueryParam(window.location.href,"challenge",e.challengeId)),document.title="Super Saber - "+e.songName}}),window.AFRAME){const t=["history"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("intro-song",{schema:{isPlaying:{default:!0},isSearching:{default:!1}},init:function(){this.analyserEl=document.getElementById("audioAnalyser"),this.audio=document.getElementById("introSong"),this.timeout=null},update:function(e){const t=this.audio;this.el.sceneEl.isPlaying&&(!e.isSearching&&this.data.isSearching||(!e.isPlaying&&this.data.isPlaying&&(this.analyserEl.components.audioanalyser.resumeContext(),this.analyserEl.setAttribute("audioanalyser","src",t),this.fadeInAudio()),e.isPlaying&&!this.data.isPlaying&&t.pause()))},pause:function(){this.audio.pause()},play:function(){this.fadeInAudio()},fadeInAudio:function(){if(AFRAME.utils.getUrlParameter("mute"))return;const e=this.analyserEl.components.audioanalyser.context,t=this.analyserEl.components.audioanalyser.gainNode;t.gain.setValueAtTime(0,e.currentTime),this.audio.play(),t.gain.linearRampToValueAtTime(.5,e.currentTime+.5)}}),window.AFRAME){const t=["intro-song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("keyboard-raycastable",{dependencies:["super-keyboard"],schema:{condition:{default:""}},play:function(){this.el.components["super-keyboard"].kbImg.setAttribute("bind-toggle__raycastable",this.data.condition)}}),window.AFRAME){const t=["keyboard-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(25),i=n(105);n(107);const o=/(fuc)|(ass)|(nig)|(shit)|(retard)/gi;if(AFRAME.registerComponent("leaderboard",{schema:{apiKey:{type:"string"},authDomain:{type:"string"},databaseURL:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},challengeId:{default:""},difficulty:{default:""},beatmapCharacteristic:{default:""},inVR:{default:!1},gameMode:{type:"string"},menuSelectedChallengeId:{default:""},isVictory:{default:!1}},init:function(){this.qualifyingIndex=void 0,this.scores=[],this.eventDetail={scores:this.scores},this.addEventDetail={scoreData:void 0,index:void 0},this.username=localStorage.getItem("threewsusername")||"Super Zealot",this.el.addEventListener("leaderboardusername",e=>{this.username=e.detail.value,localStorage.setItem("threewsusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this))},update:function(e){!r.apps.length&&this.data.apiKey&&(r.initializeApp({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.firestore=r.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores")),!e.isVictory&&this.data.isVictory&&this.checkLeaderboardQualify(),this.data.difficulty&&e.difficulty!==this.data.difficulty||this.data.menuSelectedChallengeId&&e.menuSelectedChallengeId!==this.data.menuSelectedChallengeId?this.fetchScores(this.data.menuSelectedChallengeId):this.data.challengeId&&e.challengeId!==this.data.challengeId&&this.fetchScores(this.data.challengeId)},addScore:function(){const e=this.el.sceneEl.systems.state.state;if(!e.isVictory||!e.inVR)return;const t={accuracy:e.score.accuracy,challengeId:e.challenge.id,gameMode:this.data.gameMode,score:e.score.score,username:this.username,difficulty:this.data.difficulty||e.challenge.difficulty,time:new Date};i.includes(this.username.toLowerCase())||this.username.match(o)||this.db.add(t),this.addEventDetail.scoreData=t,this.el.emit("leaderboardscoreadded",this.addEventDetail,!1)},fetchScores:function(e){if("ride"===this.data.gameMode)return;const t=this.el.sceneEl.systems.state.state;this.db.where("challengeId","==",e).where("difficulty","==",t.menuSelectedChallenge.id?t.menuSelectedChallenge.difficulty:t.challenge.difficulty).where("gameMode","==",this.data.gameMode).orderBy("score","desc").orderBy("time","asc").limit(10).get().then(t=>{this.eventDetail.challengeId=e,this.scores.length=0,t.empty||t.forEach(e=>this.scores.push(e.data())),this.el.sceneEl.emit("leaderboard",this.eventDetail,!1)}).catch(e=>{console.error("[firestore]",e)})},checkLeaderboardQualify:function(){const e=this.el.sceneEl.systems.state.state.score.score;if(!AFRAME.utils.getUrlParameter("dot")){if(this.scores.length<10)return this.qualifyingIndex=this.scores.length,void this.el.sceneEl.emit("leaderboardqualify",this.scores.length,!1);for(let t=0;t<this.scores.length;t++)if(e>this.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){e.exports=n(106)},function(e){e.exports=JSON.parse('["2 girls 1 cup","2g1c","4r5e","5h1t","5hit","5ht","666","@$$","a s s","a s shole","a55","a55hole","a_s_s","abbo","abeed","abuse","acrotomophilia","addicts","aeolus","africoon","ahole","alabama hot pocket","alaskan pipeline","alligator bait","alligatorbait","amcik","anal","analannie","analprobe","analsex","andskota","anilingus","anus","apeshit","ar5e","arabush","arabushs","areola","areole","argie","arian","armo","armos","aroused","arrse","arschloch","arse","arsehole","aryan","ash0le","ash0les","asholes","ass monkey","ass","ass-fucker","ass-hat","ass-pirate","assbag","assbagger","assbandit","assbang","assbanged","assbanger","assbangs","assbite","assblaster","assclown","asscock","asscowboy","asscracker","asses","assface","assfuck","assfucker","assfukka","assgoblin","assh0le","assh0lez","asshat","asshead","assho1e","asshole","assholes","assholz","asshopper","asshore","assjacker","assjockey","asskiss","asskisser","assklown","asslick","asslicker","asslover","assman","assmaster","assmonkey","assmunch","assmuncher","assnigger","asspacker","asspirate","asspuppies","assrammer","assranger","assshit","assshole","asssucker","asswad","asswhole","asswhore","asswipe","asswipes","auto erotic","autoerotic","ayir","azazel","azz","azzhole","b a s t a r d","b i t c h","b o o b","b!+ch","b!tch","b!tchin","b*tch","b00b","b00bies","b00biez","b00bs","b00bz","b17ch","b1tch","b7ch","babeland","babes","baby batter","baby juice","backdoor","backdoorman","badfuck","bagging","ball gag","ball gravy","ball kicking","ball licking","ball sack","ball sucking","ballbag","balllicker","ballsack","bampot","bangbro","bangbros","banger","banging","bareback","barely legal","barelylegal","barenaked","barf","barface","barfface","bassterd","bassterds","bastard","bastardo","bastards","bastardz","basterds","basterdz","bastinado","bawdy","bazongas","bazooms","bbw","bdsm","beaner","beaners","beaney","beaneys","beardedclam","beastality","beastial","beastiality","beastility","beatch","beatoff","beatyourmeat","beaver cleaver","beaver lips","beaver","beeyotch","bellend","beotch","bestial","bestiality","bi curious","bi+ch","bi7ch","biatch","bicurious","big black","big breasts","big knockers","big tits","bigass","bigbastard","bigbreasts","bigbutt","bigtits","bimbo","bimbos","bint","birdlock","bitch","bitchass","bitched","bitcher","bitchers","bitches","bitchez","bitchin","bitching","bitchslap","bitchtit","bitchy","biteme","black cock","blackcock","blackman","blackout","blacks","blonde action","blonde on blonde action","blonde on blonde","bloody","blow j","blow job","blow your l","blow your load","blowjob","blowjobs","blue waffle","bluegum","bluegums","blumpkin","bo ob","bo obs","boang","boche","boches","bodily","boffing","bogan","bohunk","boink","boiolas","bollick","bollock","bollocks","bollok","bollox","bombers","bombing","bomd","bondage","boned","boner","boners","bong","boob","boobies","boobs","booby","boobz","boody","booger","bookie","boong","boonga","boongas","boongs","boonie","boonies","booobs","boooobs","booooobs","booooooobs","bootee","bootlip","bootlips","booty call","booty","bootycall","boozer","boozy","bosch","bosche","bosches","boschs","bosomy","bounty bar","bounty bars","bountybar","brea5t","breastjob","breastlover","breastman","brothel","brown showers","brunette action","btch","buceta","buddhahead","buddhaheads","buffies","bugger","buggered","buggery","bukkake","bule","bules","bullcrap","bulldike","bulldyke","bullet vibe","bullshit","bullshits","bullshitted","bullturds","bumblefuck","bumfuck","bung hole","bung","bunga","bungas","bunghole","bunny fucker","burr head","burr heads","burrhead","burrheads","butchbabes","butchdike","butchdyke","butt plug","butt-pirate","buttbang","buttcheeks","buttface","buttfuck","buttfucker","buttfuckers","butthead","butthole","buttman","buttmuch","buttmunch","buttmuncher","buttons","buttpirate","buttplug","buttstain","buttwipe","byatch","c u n t","c-0-c-k","c-o-c-k","c-u-n-t","c.0.c.k","c.o.c.k.","c.u.n.t","c0ck","c0cks","c0cksucker","c0k","cabron","caca","cacker","cahone","camel jockey","camel jockeys","camel toe","cameljockey","cameltoe","camgirl","camslut","camwhore","carpet muncher","carpetmuncher","carruth","cawk","cawks","cazzo","cervix","chav","cheese eating surrender monkey","cheese eating surrender monkies","cheeseeating surrender monkey","cheeseeating surrender monkies","cheesehead","cheeseheads","cherrypopper","chickslick","china swede","china swedes","chinaman","chinamen","chinaswede","chinaswedes","chinc","chincs","ching chong","ching chongs","chinga","chingchong","chingchongs","chink","chinks","chinky","choad","chocolate rosebuds","chode","chodes","chonkies","chonky","chonkys","chraa","christ killer","christ killers","chug","chugs","chuj","chunger","chungers","chunkies","chunkys","chute","cipa","circlejerk","cl1t","clamdigger","clamdiver","clamps","clansman","clansmen","clanswoman","clanswomen","cleveland steamer","climax","clit","clitface","clitfuck","clitoris","clitorus","clits","clitty","clogwog","clover clamps","clusterfuck","cnts","cntz","cnut","cocain","cocaine","cock","cock-head","cock-sucker","cockbite","cockblock","cockblocker","cockburger","cockcowboy","cockface","cockfight","cockfucker","cockhead","cockholster","cockknob","cockknocker","cocklicker","cocklover","cockmonkey","cockmunch","cockmuncher","cocknob","cocknose","cocknugget","cockqueen","cockrider","cocks","cockshit","cocksman","cocksmith","cocksmoker","cocksucer","cocksuck","cocksucked","cocksucker","cocksucking","cocksucks","cocksuka","cocksukka","cocktease","cocky","cohee","coital","coitus","cok","cokmuncher","coksucka","commie","condom","coochie","coochy","coolie","coolies","cooly","coon ass","coon asses","coon","coonass","coonasses","coondog","coons","cooter","coprolagnia","coprophilia","copulate","corksucker","cornhole","cowgirl","cox","cra5h","crabs","crackcocain","cracker","crackpipe","crackwhore","crap","crapola","crapper","crappy","crash","creampie","crotch","crotchjockey","crotchmonkey","crotchrot","cum","cumbubble","cumdumpster","cumfest","cumjockey","cumm","cummer","cummin","cumming","cumquat","cumqueen","cums","cumshot","cumshots","cumslut","cumstain","cumtart","cunilingus","cunillingus","cunn","cunnie","cunnilingus","cunntt","cunny","cunt","cunteyed","cuntface","cuntfuck","cuntfucker","cunthole","cunthunter","cuntlick","cuntlicker","cuntlicking","cuntrag","cunts","cuntslut","cuntsucker","cuntz","curry muncher","curry munchers","currymuncher","currymunchers","cushi","cushis","cyalis","cyberfuc","cyberfuck","cyberfucked","cyberfucker","cyberfuckers","cyberfucking","cybersex","cyberslimer","d0ng","d0uch3","d0uche","d1ck","d1ld0","d1ldo","d4mn","dago","dagos","dahmer","damm","dammit","damn","damnation","damned","damnit","darkey","darkeys","darkie","darkies","darky","date rape","daterape","datnigga","dawgie style","dawgie-style","daygo","deapthroat","deep throat","deep throating","deepaction","deepthroat","deepthroating","defecate","deggo","dego","degos","demon","dendrophilia","destroyyourpussy","deth","diaper head","diaper heads","diaperhead","diaperheads","dick pic","dick","dick-ish","dickbag","dickbeaters","dickbrain","dickdipper","dickface","dickflipper","dickforbrains","dickfuck","dickhead","dickheads","dickhole","dickish","dickjuice","dickless","dicklick","dicklicker","dickman","dickmilk","dickpic","dickripper","dicks","dicksipper","dickslap","dickwad","dickweasel","dickweed","dickwhipper","dickwod","dickzipper","diddle","dike","dild0","dild0s","dildo","dildos","dilf","diligaf","dilld0","dilld0s","dillweed","dimwit","dingle","dingleberries","dingleberry","dink","dinks","dipship","dipshit","dipstick","dirsa","dirty pillows","dirty sanchez","dix","dixiedike","dixiedyke","dlck","dog style","dog-fucker","doggie style","doggie","doggie-style","doggiestyle","doggin","dogging","doggy style","doggy-style","doggystyle","dolcett","domination","dominatricks","dominatrics","dominatrix","dommes","dong","donkey punch","donkeypunch","donkeyribber","doochbag","doodoo","doofus","dookie","doosh","dot head","dot heads","dothead","dotheads","double dong","double penetration","doubledong","doublepenetration","douch3","douche bag","douche","douche-fag","douchebag","douchebags","douchewaffle","douchey","dp action","dp","dpaction","dragqueen","dragqween","dripdick","drug","dry hump","dryhump","duche","dudette","dumass","dumb ass","dumbass","dumbasses","dumbbitch","dumbfuck","dumbshit","dummy","dumshit","dune coon","dune coons","dupa","dvda","dyefly","dyke","dykes","dziwka","earotics","easyslut","eat my ass","eat my","eatballs","eatme","eatmyass","eatpussy","ecchi","ejackulate","ejaculate","ejaculated","ejaculates","ejaculating","ejaculatings","ejaculation","ejaculations","ejakulate","ekrem","ekto","enculer","enema","enlargement","erect","erection","ero","erotic","erotism","escort","esqua","essohbee","ethical slut","evl","excrement","exkwew","explosion","extacy","extasy","f u c k e r","f u c k e","f u c k","f u k","f*ck","f-u-c-k","f.u.c.k","f4nny","f_u_c_k","facefucker","fack","faeces","faen","fag","fag1t","fagbag","faget","fagfucker","fagg","fagg1t","fagged","fagging","faggit","faggitt","faggot","faggotcock","faggs","fagit","fagot","fagots","fags","fagt","fagtard","fagz","faig","faigs","faigt","fanculo","fannybandit","fannyflaps","fannyfucker","fanyy","fartknocker","farty","fastfuck","fatah","fatass","fatfuck","fatfucker","fatso","fck","fckcum","fckd","fcuk","fcuker","fcuking","fecal","feces","feck","fecker","feg","felatio","felch","felcher","felching","fellate","fellatio","feltch","feltcher","feltching","female squirting","femalesquirtin","femalesquirting","femdom","fetish","ficken","figging","fingerbang","fingerfood","fingerfuck","fingerfucked","fingerfucker","fingerfuckers","fingerfucking","fingerfucks","fingering","fisted","fister","fistfuck","fistfucked","fistfucker","fistfuckers","fistfucking","fistfuckings","fistfucks","fisting","fisty","fitt","flamer","flange","flasher","flikker","flipping the bird","floo","floozy","flydie","flydye","foad","fok","fondle","foobar","fook","fooker","foot fetish","footaction","footfetish","footfuck","footfucker","footjob","footlicker","footstar","foreskin","forni","fornicate","fotze","foursome","fourtwenty","freakfuck","freakyfucker","freefuck","freex","frigg","frigga","frotting","fubar","fucck","fuck buttons","fuck","fuck-tard","fucka","fuckable","fuckass","fuckbag","fuckbook","fuckboy","fuckbrain","fuckbuddy","fuckbutt","fuckd","fucked","fuckedup","fucker","fuckers","fuckersucker","fuckface","fuckfest","fuckfreak","fuckfriend","fuckhead","fuckheads","fuckher","fuckhole","fuckin","fuckina","fucking","fuckingbitch","fuckings","fuckingshitmotherfucker","fuckinnuts","fuckinright","fuckit","fuckknob","fuckme","fuckmehard","fuckmonkey","fuckn","fucknugget","fucknut","fucknuts","fucknutt","fucknutz","fuckoff","fuckpig","fuckr","fucks","fuckstick","fucktard","fucktards","fuckup","fuckwad","fuckwhit","fuckwhore","fuckwit","fuckwitt","fuckyou","fudge packer","fudgepacker","fugly","fuk","fukah","fuken","fuker","fukin","fuking","fukk","fukkah","fukken","fukker","fukkin","fuks","fuktard","fuktards","fukwhit","fukwit","funeral","funfuck","fungus","futanari","futkretzn","fuuck","fux","fux0r","fvck","fvk","fxck","g-spot","g00k","gae","gai","gang bang","gangbang","gangbanged","gangbanger","gangbangs","gangsta","ganja","gator bait","gatorbait","gay sex","gayboy","gaygirl","gaylord","gaymuthafuckinwhore","gays","gaysex","gayz","geezer","geni","genital","genitals","getiton","gey","gfy","ghay","ghey","giant cock","gigolo","ginzo","ginzos","gipp","gippo","gippos","gipps","girl on top","girl on","girls gone wild","givehead","glans","glazeddonut","goatcx","goatse","gob","god dammit","god damn","god damnit","god-dam","god-damned","godam","godammit","godamn","godamnit","goddam","goddamit","goddamm","goddammit","goddamn","goddamned","goddamnes","goddamnit","goddamnmuthafucker","gokkun","golden shower","goldenshower","golliwog","golliwogs","gonad","gonads","gonorrehea","gonzagas","goo girl","gooch","goodpoop","gook eye","gook eyes","gook","gookeye","gookeyes","gookies","gooks","gooky","gora","goras","goregasm","gotohell","goy","goyim","greaseball","greaseballs","gringo","gringos","groe","groid","groids","grope","gross","grostulation","group sex","gspot","gstring","gtfo","gub","gubba","gubbas","gubs","guido","guiena","guineas","guizi","gummer","guro","gwailo","gwailos","gweilo","gweilos","gyopo","gyopos","gyp","gyped","gypo","gypos","gypp","gypped","gyppie","gyppies","gyppo","gyppos","gyppy","gyppys","gypsys","h e l l","h o m","h00r","h0ar","h0m0","h0mo","h0r","h0re","h4x0r","hadji","hadjis","hairyback","hairybacks","haji","hajis","hajji","hajjis","half breed","half caste","halfbreed","halfcaste","hamas","hand job","handjob","haole","haoles","hapa","hard core","hardcore","hardcoresex","hardon","harem","he11","headfuck","hebe","hebes","heeb","heebs","hell","hells","helvete","henhouse","hentai","heroin","herp","herpes","herpy","heshe","hijacker","hijacking","hillbillies","hillbilly","hindoo","hiscock","hitler","hitlerism","hitlerist","ho","hobag","hodgie","hoe","hoer","hoes","holestuffer","hom0","homey","homicide","homo","homobangers","homodumbshit","homoey","honger","honkers","honkey","honkeys","honkie","honkies","honky","hooch","hooker","hookers","hoor","hoore","hootch","hooter","hooters","hore","hori","horis","hork","horndawg","horndog","horney","horniest","horny","horseshit","hosejob","hoser","hot carl","hot chick","hotcarl","hotdamn","hotpussy","hotsex","hottotrot","how to kill","how to murder","huevon","huge fat","hugefat","hui","hummer","humped","humper","humpher","humphim","humpin","humping","husky","hussy","hustler","hymen","hymie","hymies","iblowu","ike","ikes","ikey","ikeymo","ikeymos","ikwe","illegal","illegals","inbred","incest","indon","indons","injun","injuns","insest","intercourse","interracial","intheass","inthebuff","israels","j3rk0ff","jack off","jack-off","jackass","jackhole","jackoff","jackshit","jacktheripper","jail bait","jailbait","jap","japcrap","japie","japies","japs","jebus","jelly donut","jerk off","jerk","jerk-off","jerk0ff","jerked","jerkoff","jerries","jerry","jesuschrist","jewed","jewess","jig","jiga","jigaboo","jigaboos","jigarooni","jigaroonis","jigg","jigga","jiggabo","jiggaboo","jiggabos","jiggas","jigger","jiggerboo","jiggers","jiggs","jiggy","jigs","jihad","jijjiboo","jijjiboos","jimfish","jisim","jism","jiss","jiz","jizim","jizin","jizjuice","jizm","jizn","jizz","jizzd","jizzed","jizzim","jizzin","jizzn","jizzum","jugg","juggs","jugs","jungle bunnies","jungle bunny","junglebunny","junkie","junky","kacap","kacapas","kacaps","kaffer","kaffir","kaffre","kafir","kanake","kanker","katsap","katsaps","kawk","khokhol","khokhols","kicking","kigger","kike","kikes","killer","kills","kimchis","kinbaku","kink","kinkster","kinky","kissass","kkk","klan","klansman","klansmen","klanswoman","klanswomen","klootzak","knobbing","knobead","knobed","knobend","knobhead","knobjocky","knobjokey","knobz","knockers","knulle","kock","kondum","kondums","kooch","kooches","koon","kootch","krap","krappy","kraut","krauts","kuffar","kuk","kuksuger","kum","kumbubble","kumbullbe","kumer","kummer","kumming","kumquat","kums","kunilingus","kunnilingus","kunt","kunts","kuntz","kurac","kurwa","kushi","kushis","kusi","kwa","kwai lo","kwai los","ky","kyke","kykes","kyopo","kyopos","kyrpa","l3i+ch","l3i\\\\+ch","l3itch","labia","lapdance","lds","leather restraint","leather straight jacket","leather straight","leatherrestraint","lebo","lebos","lech","lemon party","lemonparty","leper","lesbain","lesbayn","lesbian","lesbin","lesbo","lez","lezbe","lezbefriends","lezbian","lezbians","lezbo","lezbos","lezz","lezzian","lezzie","lezzies","lezzo","lezzy","libido","licker","licking","lickme","lilniglet","limey","limpdick","limy","lingerie","lipshits","lipshitz","livesex","lmfao","loadedgun","loin","loins","lolita","lovebone","lovegoo","lovegun","lovejuice","lovemaking","lovemuscle","lovepistol","loverocket","lowlife","lsd","lubejob","lubra","lucifer","luckycammeltoe","lugan","lugans","lust","lusting","lusty","lynch","m-fucking","m0f0","m0fo","m45terbate","ma5terb8","ma5terbate","mabuno","mabunos","macaca","macacas","magicwand","mahbuno","mahbunos","make me come","makemecome","makemecum","male squirting","mamhoon","mams","manhater","manpaste","maricon","maricón","marijuana","masochist","masokist","massa","massterbait","masstrbait","masstrbate","mastabate","mastabater","master-bate","masterb8","masterbaiter","masterbat","masterbat3","masterbate","masterbates","masterbating","masterbation","masterbations","masterblaster","mastrabator","masturbat","masturbate","masturbating","masturbation","mattressprincess","mau mau","mau maus","maumau","maumaus","mcfagget","meatbeatter","meatrack","menage a trois","menage","menses","menstruate","menstruation","merd","meth","mgger","mggor","mibun","mick","mickeyfinn","mideast","mierda","milf","minge","missionary position","missionary","mo-fo","mockey","mockie","mocky","mof0","mofo","moky","molest","molestation","molester","molestor","moneyshot","monkleigh","moolie","moon cricket","moon crickets","mooncricket","mooncrickets","mormon","moron","moskal","moskals","moslem","mosshead","motha fucker","motha fuker","motha fukkah","motha fukker","mothafuck","mothafucka","mothafuckas","mothafuckaz","mothafucked","mothafucker","mothafuckers","mothafuckin","mothafucking","mothafuckings","mothafucks","mother fucker","mother fukah","mother fuker","mother fukkah","mother fukker","mother-fucker","motherfuck","motherfucka","motherfucked","motherfucker","motherfuckers","motherfuckin","motherfucking","motherfuckings","motherfuckka","motherfucks","motherfvcker","motherlovebone","mothrfucker","mouliewop","mound of venus","moundofvenus","mr hands","mrhands","mtherfucker","mthrfuck","mthrfucker","mthrfucking","mtrfck","mtrfuck","mtrfucker","muff diver","muff","muffdive","muffdiver","muffdiving","muffindiver","mufflikcer","muie","mulatto","mulkku","muncher","munging","munt","murder","murderer","muschi","mutha fucker","mutha fukah","mutha fuker","mutha fukkah","mutha fukker","mutha","muthafecker","muthafuckaz","muthafucker","muthafuckker","muther","mutherfucker","mutherfucking","muthrfucking","mzungu","mzungus","n1gga","n1gger","n1gr","nad","nads","naked","nambla","nastt","nasty","nastybitch","nastyho","nastyslut","nastywhore","nawashi","nazi","nazis","nazism","necro","negres","negress","negro","negroes","negroid","negros","neonazi","nepesaurio","nig nog","nig","niga","nigar","nigars","nigas","niger","nigerian","nigerians","nigers","nigette","nigettes","nigg","nigg3r","nigg4h","nigga","niggah","niggahs","niggar","niggaracci","niggard","niggarded","niggarding","niggardliness","niggardlinesss","niggardly","niggards","niggars","niggas","niggaz","nigger","niggerhead","niggerhole","niggers","niggle","niggled","niggles","niggling","nigglings","niggor","niggress","niggresses","nigguh","nigguhs","niggur","niggurs","niglet","nignog","nigor","nigors","nigr","nigra","nigras","nigre","nigres","nigress","nigs","nigur","niiger","niigr","nimphomania","nimrod","ninny","nip","nipple","nipplering","nipples","nips","nittit","nlgger","nlggor","nob jokey","nob","nobhead","nobjocky","nobjokey","nofuckingway","nog","nookey","nookie","nooky","noonan","nooner","nsfw images","nsfw","nude","nudger","nudie","nudies","nudity","numbnuts","nut sack","nutfucker","nutsack","nymph","nympho","nymphomania","o c k","octopussy","omorashi","one cup two girls","one guy one jar","one guy","one jar","ontherag","orafis","oral","orally","orga","orgasim","orgasim;","orgasims","orgasm","orgasmic","orgasms","orgasum","orgies","orgy","oriface","orifice","orifiss","orospu","osama","ovum","ovums","p e n i s","p i s","p u s s y","p.u.s.s.y.","p0rn","packi","packie","packy","paddy","paedophile","paki","pakie","pakis","paky","palesimian","pancake face","pancake faces","panooch","pansies","pansy","panti","pantie","panties","panty","paska","pastie","pasty","payo","pcp","pearlnecklace","peck","pecker","peckerhead","peckerwood","pedo","pedobear","pedophile","pedophilia","pedophiliac","pee","peeenus","peeenusss","peehole","peenus","peepee","peepshow","peepshpw","pegging","peinus","pen1s","penas","pendejo","pendy","penetrate","penetration","peni5","penial","penile","penis","penis-breath","penises","penisfucker","penisland","penislick","penislicker","penispuffer","penthouse","penus","penuus","perse","perv","perversion","peyote","phalli","phallic","phone sex","phonesex","phuc","phuck","phuk","phuked","phuker","phuking","phukked","phukker","phukking","phuks","phungky","phuq","pi55","picaninny","piccaninny","picka","pickaninnies","pickaninny","piece of shit","pieceofshit","piefke","piefkes","pierdol","pigfucker","piker","pikey","piky","pillowbiter","pillu","pimmel","pimp","pimped","pimper","pimpis","pimpjuic","pimpjuice","pimpsimp","pindick","pinko","pis","pises","pisin","pising","pisof","piss pig","piss","piss-off","pissed","pisser","pissers","pisses","pissflaps","pisshead","pissin","pissing","pissoff","pisspig","pistol","pizda","playboy","playgirl","pleasure chest","pleasurechest","pms","pocha","pochas","pocho","pochos","pocketpool","pohm","pohms","polac","polack","polacks","polak","pole smoker","polesmoker","pollock","pollocks","pommie grant","pommie grants","pommie","pommies","pommy","ponyplay","poo","poof","poon","poonani","poonany","poontang","poontsee","poop chute","poop","poopchute","pooper","pooperscooper","pooping","poorwhitetrash","popimp","porch monkey","porch monkies","porchmonkey","porn","pornflick","pornking","porno","pornography","pornos","pornprincess","pound town","poundtown","pplicker","pr0n","pr1c","pr1ck","pr1k","prairie nigger","prairie niggers","premature","preteen","pric","prick","prickhead","pricks","prig","prince albert piercing","pron","propaganda","prostitute","pthc","pu55i","pu55y","pube","pubes","pubic","pubiclice","pubis","pud","pudboy","pudd","puddboy","puke","pula","pule","punanny","punany","punkass","punky","punta","puntang","purinapricness","pusies","puss","pusse","pussee","pussi","pussie","pussies","pussy","pussycat","pussydestroyer","pussyeater","pussyfucker","pussylicker","pussylicking","pussylips","pussylover","pussypounder","pussys","pusy","puta","puto","puuke","puuker","qahbeh","quashie","queaf","queef","queero","queers","queerz","quickie","quicky","quiff","quim","qweers","qweerz","qweir","r-tard","r-tards","r5e","ra8s","racial","radicals","raghead","ragheads","raging boner","raging","ragingboner","randy","rape","raped","raper","raping","rapist","raunch","rautenberg","rearend","rearentry","recktum","rectal","rectum","rectus","redleg","redlegs","redlight","redneck","rednecks","redskin","redskins","reefer","reestie","reetard","refugee","reich","renob","rentafuck","rere","retard","retarded","retards","retardz","reverse cowgirl","reversecowgirl","rigger","rimjaw","rimjob","rimming","ritard","rosebuds","rosy palm and her 5 sisters","rosy palm","rosypalm","rosypalmandher5sisters","rosypalmandherefivesisters","round eyes","roundeye","rtard","rtards","rump","rumprammer","ruski","russki","russkie","rusty trombone","rustytrombone","s h i t","s hit","s&m","s-h-1-t","s-h-i-t","s-o-b","s.h.i.t.","s.o.b.","s0b","s_h_i_t","sac","sack","sadis","sadism","sadist","sadom","sambo","sambos","samckdaddy","sanchez","sand nigger","sand niggers","sandm","sandnigger","santorum","scag","scallywag","scank","scantily","scat","schaffer","scheiss","schizo","schlampe","schlong","schmuck","schvartse","schvartsen","schwartze","schwartzen","scissoring","screwed","screwing","screwyou","scroat","scrog","scrot","scrote","scrotum","scrud","seduce","semen","seppo","seppos","septics","sex","sexed","sexfarm","sexhound","sexhouse","sexi","sexing","sexkitten","sexo","sexpot","sexslave","sextogo","sextoy","sextoys","sexual","sexually","sexwhore","sexx","sexxi","sexxx","sexxxi","sexxxy","sexxy","sexy","sexymoma","sexyslim","sh!+","sh!t","sh1t","sh1ter","sh1ts","sh1tter","sh1tz","shag","shagger","shaggin","shagging","shamedame","sharmuta","sharmute","shat","shav","shaved beaver","shaved pussy","shaved","shavedbeaver","shavedpussy","shawtypimp","sheeney","shemale","shhit","shi+","shibari","shinola","shipal","shit","shitass","shitbag","shitbagger","shitblimp","shitbrain","shitbreath","shitcan","shitcunt","shitdick","shite","shiteater","shited","shitey","shitface","shitfaced","shitfit","shitforbrains","shitfuck","shitfucker","shitfull","shithapens","shithappens","shithead","shithole","shithouse","shiting","shitings","shitlist","shitola","shitoutofluck","shits","shitspitter","shitstain","shitt","shitted","shitter","shitters","shittiest","shitting","shittings","shitty","shity","shitz","shiz","shiznit","shortfuck","shota","shrimping","shylock","shylocks","shyt","shyte","shytty","shyty","sissy","sixsixsix","sixtynine","sixtyniner","skag","skanck","skank","skankbitch","skankee","skankey","skankfuck","skanks","skankwhore","skanky","skankybitch","skankywhore","skeet","skinflute","skribz","skullfuck","skum","skumbag","skurwysyn","skwa","skwe","slag","slant","slanteye","slanty","slapper","slaughter","slave","slavedriver","sleaze","sleazy","sleezebag","sleezeball","slideitin","slimeball","slimebucket","slopehead","slopeheads","sloper","slopers","slopes","slopey","slopeys","slopies","slopy","slut","slutbag","slutdumper","slutkiss","sluts","slutt","slutting","slutty","slutwear","slutwhore","slutz","smack","smackthemonkey","smeg","smegma","smoker","smut","smutty","snatch","snatchpatch","snigger","sniggered","sniggering","sniggers","sniper","snowback","snowballing","snownigger","snuff","sob","socksucker","sodom","sodomise","sodomite","sodomize","sodomy","son of a bitch","son-of-a-bitch","sonofabitch","sonofbitch","sooties","sooty","souse","soused","spac","spade","spades","spaghettibender","spaghettinigger","spank","spankthemonkey","spearchucker","spearchuckers","sperm","spermacide","spermbag","spermhearder","spermherder","sphencter","spic","spick","spicks","spics","spierdalaj","spig","spigotty","spik","spiks","spitter","splittail","splooge moose","splooge","spludge","spooge","spread legs","spreadeagle","spunk","spunky","sqeh","squa","squarehead","squareheads","squaw","squinty","squirting","stagg","steamy","stfu","stiffy","stoned","stoner","strap on","strapon","strappado","stringer","strip club","stripclub","stroke","stroking","stuinties","stupid","stupidfuck","stupidfucker","style doggy","suck","suckdick","sucked","sucker","sucking","suckme","suckmyass","suckmydick","suckmytit","suckoff","sucks","suicide girl","suicide girls","suicide","suicidegirl","suicidegirls","suka","sultry women","sultry","sultrywoman","sultrywomen","sumofabiatch","swallow","swallower","swalow","swamp guinea","swamp guineas","swastika","swinger","syphilis","t i t","t i ts","t1t","t1tt1e5","t1tties","taboo","tacohead","tacoheads","taff","tainted love","tainted","take off your","tantra","tar babies","tar baby","tarbaby","tard","taste my","tastemy","tawdry","tea bagging","teabagging","teat","teets","teez","terd","terror","terrorist","teste","testee","testes","testical","testicle","testicles","testis","thicklip","thicklips","thirdeye","thirdleg","threesome","threeway","throat","throating","thrust","thug","thundercunt","ti","tied up","tight white","timber nigger","timber niggers","timbernigger","tinkle","tit","titbitnipply","titfuck","titfucker","titfuckin","titi","titjob","titlicker","titlover","tits","titt","tittie","tittie5","tittiefucker","titties","tittis","titty","tittyfuck","tittyfucker","tittys","tittywank","titwank","tity","to murder","toke","tongethruster","tongue in a","tongueina","tonguethrust","tonguetramp","toots","topless","tortur","torture","tosser","towel head","towel heads","towelhead","trailertrash","tramp","trannie","tranny","transsexual","transvestite","trashy","tribadism","triplex","trisexual","trois","trojan","trombone","trots","tub girl","tubgirl","tuckahoe","tunneloflove","turd","turnon","tush","tushy","tw4t","twat","twathead","twatlips","twats","twatty","twatwaffle","twink","twinkie","two girls one cup","twobitwhore","twunt","twunter","udge packer","ukrop","uncle tom","unclefucker","undies","undressing","unfuckable","unwed","upskirt","uptheass","upthebutt","urethra play","urethra","urethraplay","urinal","urinary","urinate","urine","urophilia","usama","ussys","uzi","v a g i n a","v14gra","v1gra","v4gra","va-j-j","va1jina","vag","vag1na","vagiina","vagina","vaginal","vaj1na","vajina","valium","venus mound","vgra","viagra","vibe","vibr","vibrater","vibrator","vietcong","violet wand","virgin","virginbreaker","vittu","vixen","vjayjay","vodka","vomit","vorarephilia","voyeur","vulgar","vullva","vulva","w00se","w0p","wab","wad","wang","wank","wanker","wanking","wanky","waysted","wazoo","wedgie","weed","weenie","weewee","weiner","weirdo","welcher","wench","wet dream","wetb","wetback","wetbacks","wetdream","wetspot","wh00r","wh0re","wh0reface","whacker","whash","whigger","whiggers","whiskeydick","whiskydick","whit","white power","white trash","whitenigger","whitepower","whites","whitetrash","whitey","whiteys","whities","whiz","whoar","whop","whoralicious","whore","whorealicious","whorebag","whored","whoreface","whorefucker","whorehopper","whorehouse","whores","whoring","wichser","wigga","wiggas","wigger","wiggers","willie","willies","williewanker","willy","wn","wog","wogs","woody","wop","wrapping men","wrinkled starfish","wtf","wuss","wuzzie","x-rated","xkwe","xrated","xtc","xx","xxx","xxxxxx","yank","yaoi","yarpie","yarpies","yeasty","yed","yellow showers","yellowman","yellowshowers","yid","yids","yiffy","yobbo","yourboobs","yourpenis","yourtits","zabourah","zigabo","zigabos","zipperhead","zipperheads","zoophile","zoophilia","🖕"]')},function(e,t,n){"use strict";n.r(t);n(108)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(7),o=(r=n(18))&&"object"==typeof r&&"default"in r?r.default:r,a=n(20),s=n(12),c=n(109),l=n(19),u=new a.Logger("@firebase/firestore");function h(){return u.logLevel}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=a.LogLevel.DEBUG){var r=t.map(m);u.debug.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=a.LogLevel.ERROR){var r=t.map(m);u.error.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=a.LogLevel.WARN){var r=t.map(m);u.warn.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function m(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}+i.registerVersion("firebase","7.19.0","app"),e.exports=i},function(e,t){e.exports="#define T time * 0.06\nvarying vec2 uvs;\nuniform float time;\nuniform float thickness;\nvoid main() {\n uvs.xy = uv.xy;\n vec3 pos = position;\n\n pos.x *= thickness + sin(T) * ((0.1 + uv.x) * 16.0 + uv.y * 4.9) * thickness * 0.005;\n pos.z *= thickness + cos(T) * ((0.1 + uv.x) * 13.0 + uv.y * 14.9) * thickness * 0.005;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.04\n\nvoid main() {\n vec2 uv = uvs;\n uv += T * 0.05;\n vec3 col = texture2D(src, uv).xyz;\n float core = step(0.125, uvs.x);\n gl_FragColor = vec4(col * color, mix(1.0, 0.07, core));\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.03\n\nvoid main() {\n vec3 col = texture2D(src, uvs * vec2(1.0, 0.7) + vec2(T * 0.01, T * 0.05)).xyz;\n gl_FragColor = vec4(col * color, 0.4 * uvs.y);\n}\n"},function(e,t){e.exports=function(e){if(e.converted)return e;e.map&&(e=e.map),e.version=e.versions[0].hash,e.directDownload=e.versions[0].downloadURL,e.coverURL=e.versions[0].coverURL.replace(/^https?:\/\/[^/]+\//,"https://eu.cdn.beatsaver.com/");let t=e.versions[0].diffs;e.metadata.characteristics={};for(const n of t)void 0===e.metadata.characteristics[n.characteristic]&&(e.metadata.characteristics[n.characteristic]={}),e.metadata.characteristics[n.characteristic][n.difficulty]=n;return e.metadata.characteristics=JSON.stringify(e.metadata.characteristics),e.converted=!0,e}},,,,,,,,,,,,function(e,t,n){function r(e){e.keys().forEach(e)}console.time=()=>{},console.timeEnd=()=>{},n(42),n(43),n(44),n(45),n(46),n(47),n(49),n(50),AFRAME.log=()=>{},n(52),n(54),n(55),n(56),n(57),n(58),r(n(59)),r(n(197)),n(201),n(208),e.hot.accept(),"http:"!==window.location.protocol||window.location.host.startsWith("localhost")||window.location.replace("https:"+location.href.substring(location.protocol.length))},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,o=n.normal.array,a=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,_=e.groups;0===_.length&&(_=[{start:0,count:r.length}]);for(var w=0,E=_.length;w<E;++w)for(var A=O=(P=_[w]).start,x=O+P.count;A<x;A+=3)N(r[A+0],r[A+1],r[A+2]);var S,T,M,R=new THREE.Vector3,C=new THREE.Vector3,k=new THREE.Vector3,I=new THREE.Vector3;for(w=0,E=_.length;w<E;++w){var P,O;for(A=O=(P=_[w]).start,x=O+P.count;A<x;A+=3)D(r[A+0]),D(r[A+1]),D(r[A+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function N(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(a,2*e),g.fromArray(a,2*t),y.fromArray(a,2*n);var r=p.x-d.x,o=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,_=f.z-d.z,w=g.x-m.x,E=y.x-m.x,A=g.y-m.y,x=y.y-m.y,S=1/(w*x-E*A);v.set((x*r-A*o)*S,(x*s-A*c)*S,(x*h-A*_)*S),b.set((w*o-E*r)*S,(w*c-E*s)*S,(w*_-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function D(e){k.fromArray(o,3*e),I.copy(k),T=l[e],R.copy(T),R.sub(k.multiplyScalar(k.dot(T))).normalize(),C.crossVectors(I,T),M=C.dot(u[e]),S=M<0?-1:1,c[4*e]=R.x,c[4*e+1]=R.y,c[4*e+2]=R.z,c[4*e+3]=S}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),o={},a={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){var m=e[l].index;if(p>0){m=m.clone();for(var g=0;g<m.count;++g)m.setX(g,m.getX(g)+p)}f.push(m),p+=e[l].attributes.position.count}var y=this.mergeBufferAttributes(f);if(!y)return null;s.index=y}for(var h in o){var v=this.mergeBufferAttributes(o[h]);if(!v)return null;s.addAttribute(h,v)}for(var h in a){var b=a[h][0].length;if(0===b)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<b;++l){var _=[];for(g=0;g<a[h].length;++g)_.push(a[h][g][l]);var w=this.mergeBufferAttributes(_);if(!w)return null;s.morphAttributes[h].push(w)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,o=0;o<e.length;++o){var a=e[o];if(a.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return null;i+=a.array.length}for(var s=new t(i),c=0,l=0;l<e.length;++l)s.set(e[l].array,c),c+=e[l].array.length;return new THREE.BufferAttribute(s,n,r)},toTrianglesDrawMode:function(e,t){if(t===THREE.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===THREE.TriangleFanDrawMode||t===THREE.TriangleStripDrawMode){var n=e.getIndex();if(null===n){var r=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var o=0;o<i.count;o++)r.push(o);e.setIndex(r),n=e.getIndex()}var a=n.count-2,s=[];if(t===THREE.TriangleFanDrawMode)for(o=1;o<=a;o++)s.push(n.getX(0)),s.push(n.getX(o)),s.push(n.getX(o+1));else for(o=0;o<a;o++)o%2==0?(s.push(n.getX(o)),s.push(n.getX(o+1)),s.push(n.getX(o+2))):(s.push(n.getX(o+2)),s.push(n.getX(o+1)),s.push(n.getX(o)));s.length/3!==a&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(s),c.clearGroups(),c}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const n={childList:!0,attributes:!0,subtree:!0};AFRAME.registerComponent("aabb-collider",{schema:{collideNonVisible:{default:!1},debug:{default:!1},enabled:{default:!0},interval:{default:80},objects:{default:""}},init:function(){this.centerDifferenceVec3=new THREE.Vector3,this.clearedIntersectedEls=[],this.closestIntersectedEl=null,this.boundingBox=new THREE.Box3,this.boxCenter=new THREE.Vector3,this.boxHelper=new THREE.BoxHelper,this.boxMax=new THREE.Vector3,this.boxMin=new THREE.Vector3,this.hitClosestClearEventDetail={},this.hitClosestEventDetail={},this.intersectedEls=[],this.objectEls=[],this.newIntersectedEls=[],this.prevCheckTime=void 0,this.previousIntersectedEls=[],this.setDirty=this.setDirty.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.hitStartEventDetail={intersectedEls:this.newIntersectedEls}},play:function(){this.observer.observe(this.el.sceneEl,n),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty)},remove:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},tick:function(e){const t=this.boundingBox,n=this.centerDifferenceVec3,r=this.clearedIntersectedEls,i=this.el,o=this.intersectedEls,a=this.newIntersectedEls,s=this.objectEls,c=this.prevCheckTime,l=this.previousIntersectedEls;let u,h,d;if(this.data.enabled&&!(c&&e-c<this.data.interval)){for(this.prevCheckTime=e,this.dirty&&this.refreshObjects(),t.setFromObject(i.object3D),this.boxMin.copy(t.min),this.boxMax.copy(t.max),t.getCenter(this.boxCenter),this.data.debug&&(this.boxHelper.setFromObject(i.object3D),this.boxHelper.parent||i.sceneEl.object3D.add(this.boxHelper)),function(e,t){e.length=0;for(let n=0;n<t.length;n++)e[n]=t[n]}(l,o),o.length=0,d=0;d<s.length;d++)if(s[d]!==this.el)if(this.data.collideNonVisible||s[d].getAttribute("visible"))this.isIntersecting(s[d])&&o.push(s[d]);else if(this.data.debug){const e=s[d].object3D.boxHelper;e&&(i.sceneEl.object3D.remove(e),s[d].object3D.boxHelper=null)}for(a.length=0,d=0;d<o.length;d++)-1===l.indexOf(o[d])&&a.push(o[d]);for(r.length=0,d=0;d<l.length;d++)-1===o.indexOf(l[d])&&(l[d].hasAttribute("aabb-collider")||l[d].emit("hitend"),r.push(l[d]));for(d=0;d<a.length;d++)a[d]!==this.el&&(a[d].hasAttribute("aabb-collider")||a[d].emit("hitstart"));for(d=0;d<o.length;d++)o[d]!==this.el&&(n.copy(o[d].object3D.boundingBoxCenter).sub(this.boxCenter),(void 0===u||n.length()<u)&&(u=n.length(),h=o[d]));!o.length&&this.closestIntersectedEl?(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear"),this.closestIntersectedEl=null,i.emit("hitclosestclear",this.hitClosestClearEventDetail)):h!==this.closestIntersectedEl&&(this.closestIntersectedEl&&(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear",this.hitClosestClearEventDetail)),h&&(h.emit("hitclosest"),this.closestIntersectedEl=h,this.hitClosestEventDetail.el=h,i.emit("hitclosest",this.hitClosestEventDetail))),r.length&&i.emit("hitend"),a.length&&i.emit("hitstart",this.hitStartEventDetail)}},isIntersecting:function(){const e=new THREE.Box3;return function(t){let n;t.dataset.aabbColliderDynamic&&(e.setFromObject(t.object3D),n=e,t.object3D.boundingBoxCenter=t.object3D.boundingBoxCenter||new THREE.Vector3,n.getCenter(t.object3D.boundingBoxCenter)),t.dataset.aabbColliderDynamic||(t.object3D.aabbBox||(t.object3D.aabbBox=(new THREE.Box3).setFromObject(t.object3D),t.object3D.boundingBoxCenter=new THREE.Vector3,t.object3D.aabbBox.getCenter(t.object3D.boundingBoxCenter)),n=t.object3D.aabbBox),this.data.debug&&(t.object3D.boxHelper||(t.object3D.boxHelper=new THREE.BoxHelper(t.object3D,new THREE.Color(Math.random(),Math.random(),Math.random())),t.sceneEl.object3D.add(t.object3D.boxHelper)),t.object3D.boxHelper.setFromObject(t.object3D));const r=n.min,i=n.max;return this.boxMin.x<=i.x&&this.boxMax.x>=r.x&&this.boxMin.y<=i.y&&this.boxMax.y>=r.y&&this.boxMin.z<=i.z&&this.boxMax.z>=r.z}}(),setDirty:function(){this.dirty=!0},refreshObjects:function(){const e=this.data;this.objectEls=e.objects?this.el.sceneEl.querySelectorAll(e.objects):this.el.sceneEl.children,this.dirty=!1}})},function(e,t){var n=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function r(e,t,r,i){const o=1/i,a=1/r;return n[0].set(o*t,a*e+a),n[1].set(o*t,a*e),n[2].set(o*t+o,a*e),n[3].set(o*t+o,a*e+a),n}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const e=this.data,t=r(e.row-1,e.column-1,e.totalRows,e.totalColumns),n=this.el.getObject3D("mesh").geometry;var i=new Float32Array([t[0].x,t[0].y,t[3].x,t[3].y,t[1].x,t[1].y,t[2].x,t[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(i,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const e=this.canvas=document.createElement("canvas");e.id=this.data.canvasId,e.height=this.data.canvasHeight,e.width=this.data.canvasWidth,this.ctx=e.getContext("2d"),document.body.appendChild(e),this.data.debug&&(e.style.left=0,e.style.top=0,e.style.position="fixed",e.style.zIndex=9999999999)},drawTexture:function(e,t,n,i,o){const a=this.canvas,s=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,n)});const c=o||a.height/s.numRows,l=i||a.width/s.numColumns;return this.ctx.drawImage(e,l*t,l*n,l,c),r(t,n,s.numRows,s.numColumns)}}),e.exports.getGridUvs=r},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var n={};AFRAME.registerComponent("audioanalyser",{schema:{buffer:{default:!1},beatDetectionDecay:{default:.99},beatDetectionMinVolume:{default:15},beatDetectionThrottle:{default:250},cache:{default:!1},enabled:{default:!0},enableBeatDetection:{default:!0},enableLevels:{default:!0},enableWaveform:{default:!0},enableVolume:{default:!0},fftSize:{default:2048},smoothingTimeConstant:{default:.8},src:{parse:function(e){return e.constructor!==String?e:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):e}},unique:{default:!1}},init:function(){this.audioEl=null,this.levels=null,this.waveform=null,this.volume=0,this.xhr=null,this.initContext()},update:function(e){var t=this.analyser,n=this.data;e.fftSize===n.fftSize&&e.smoothingTimeConstant===n.smoothingTimeConstant||(t.fftSize=n.fftSize,t.smoothingTimeConstant=n.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),n.src&&this.refreshSource()},tick:function(e,t){var n,r=this.data;if(r.enabled){if((r.enableLevels||r.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),r.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),r.enableVolume||r.enableBeatDetection){for(var i=0,o=0;o<this.levels.length;o++)i+=this.levels[o];this.volume=i/this.levels.length}r.enableBeatDetection&&(n=this.volume,this.beatCutOff||(this.beatCutOff=n),n>this.beatCutOff&&n>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*n,this.beatTime=0):this.beatTime<=this.data.beatDetectionThrottle?this.beatTime+=t:(this.beatCutOff*=this.data.beatDetectionDecay,this.beatCutOff=Math.max(this.beatCutOff,this.data.beatDetectionMinVolume)))}},initContext:function(){var e,t=this.data;this.context=new(window.webkitAudioContext||window.AudioContext),e=this.analyser=this.context.createAnalyser(),(this.gainNode=this.context.createGain()).connect(e),e.connect(this.context.destination),e.fftSize=t.fftSize,e.smoothingTimeConstant=t.smoothingTimeConstant,this.levels=new Uint8Array(e.frequencyBinCount),this.waveform=new Uint8Array(e.fftSize)},refreshSource:function(){this.analyser;var e=this.data;e.buffer&&e.src.constructor===String?this.getBufferSource().then(e=>{this.source=e,this.source.connect(this.gainNode)}):(this.source=this.getMediaSource(),this.source.connect(this.gainNode))},suspendContext:function(){this.context.suspend()},resumeContext:function(){this.context.resume()},fetchAudioBuffer:function(e){return n[e]?n[e].constructor===Promise?n[e]:Promise.resolve(n[e]):(this.data.cache||Object.keys(n).forEach((function(e){delete n[e]})),n[e]=new Promise(t=>{const r=this.xhr=new XMLHttpRequest;r.open("GET",e),r.responseType="arraybuffer",r.addEventListener("load",()=>{function i(r){n[e]=r,t(r)}const o=this.context.decodeAudioData(r.response,i);o&&o.constructor===Promise&&o.then(i).catch(console.error)}),r.send()}),n[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=n[e.src],this.el.emit("audioanalyserbuffersource",t,!1),t}).catch(console.error)},getMediaSource:function(){const e={};return function(){const t=this.data.src.constructor===String?this.data.src:this.data.src.src;if(e[t])return e[t];this.data.src.constructor===String?(this.audio=document.createElement("audio"),this.audio.crossOrigin="anonymous",this.audio.setAttribute("src",this.data.src)):this.audio=this.data.src;const n=this.context.createMediaElementSource(this.audio);return e[t]=n,n}}()})},function(e,t){var n=AFRAME.utils.styleParser;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("event-set",{schema:{default:"",parse:function(e){return n.parse(e)}},multiple:!0,init:function(){this.eventHandler=null,this.eventName=null},update:function(e){this.removeEventListener(),this.updateEventListener(),this.addEventListener()},remove:function(){this.removeEventListener()},pause:function(){this.removeEventListener()},play:function(){this.addEventListener()},updateEventListener:function(){var e,t,n,r=this.data,i=this.el;e=r._event||this.id,t=r._target,n=t?i.sceneEl.querySelector(t):i,this.eventName=e;const o=()=>{var e;for(e in r)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,n,e,r[e])};isNaN(r._delay)?this.eventHandler=o:this.eventHandler=()=>{setTimeout(o,parseFloat(r._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,n){THREE.BufferGeometryUtils||n(48),AFRAME.registerComponent("geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=this;this.geometry=new THREE.Geometry,this.mesh=new THREE.Mesh(this.geometry),this.el.setObject3D("mesh",this.mesh),this.faceIndex={},this.vertexIndex={},this.el.object3D.traverse((function(t){"Mesh"===t.type&&t!==e.mesh&&(e.faceIndex[t.parent.uuid]=[e.geometry.faces.length,e.geometry.faces.length+t.geometry.faces.length-1],e.vertexIndex[t.parent.uuid]=[e.geometry.vertices.length,e.geometry.vertices.length+t.geometry.vertices.length-1],t.parent.updateMatrix(),e.geometry.merge(t.geometry,t.parent.matrix),e.data.preserveOriginal||t.parent.remove(t))}))}}),AFRAME.registerComponent("buffer-geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=[];this.el.sceneEl.object3D.updateMatrixWorld(),this.el.object3D.traverse((function(t){"Mesh"===t.type&&t.el!==self.el&&(t.geometry.applyMatrix(t.matrixWorld),e.push(t.geometry.clone()),t.parent.remove(t))}));const t=THREE.BufferGeometryUtils.mergeBufferGeometries(e);this.mesh=new THREE.Mesh(t),this.el.setObject3D("mesh",this.mesh)}})},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,o=n.normal.array,a=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,_=e.groups;0===_.length&&(_=[{start:0,count:r.length}]);h=0;for(var w=_.length;h<w;++h)for(var E=P=(I=_[h]).start,A=P+I.count;E<A;E+=3)O(r[E+0],r[E+1],r[E+2]);var x,S,T,M=new THREE.Vector3,R=new THREE.Vector3,C=new THREE.Vector3,k=new THREE.Vector3;for(h=0,w=_.length;h<w;++h){var I,P;for(E=P=(I=_[h]).start,A=P+I.count;E<A;E+=3)N(r[E+0]),N(r[E+1]),N(r[E+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function O(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(a,2*e),g.fromArray(a,2*t),y.fromArray(a,2*n);var r=p.x-d.x,o=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,_=f.z-d.z,w=g.x-m.x,E=y.x-m.x,A=g.y-m.y,x=y.y-m.y,S=1/(w*x-E*A);v.set((x*r-A*o)*S,(x*s-A*c)*S,(x*h-A*_)*S),b.set((w*o-E*r)*S,(w*c-E*s)*S,(w*_-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function N(e){C.fromArray(o,3*e),k.copy(C),S=l[e],M.copy(S),M.sub(C.multiplyScalar(C.dot(S))).normalize(),R.crossVectors(k,S),T=R.dot(u[e]),x=T<0?-1:1,c[4*e]=M.x,c[4*e+1]=M.y,c[4*e+2]=M.z,c[4*e+3]=x}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),o={},a={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.morphAttributes[h])}if(s.userData&&(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData)),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){for(var m=e[l].index,g=0;g<m.count;++g)f.push(m.getX(g)+p);p+=e[l].attributes.position.count}s.setIndex(f)}for(var h in o){var y=this.mergeBufferAttributes(o[h]);if(!y)return null;s.addAttribute(h,y)}for(var h in a){var v=a[h][0].length;if(0===v)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<v;++l){var b=[];for(g=0;g<a[h].length;++g)b.push(a[h][g][l]);var _=this.mergeBufferAttributes(b);if(!_)return null;s.morphAttributes[h].push(_)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,o=0;o<e.length;++o){var a=e[o];if(a.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return null;i+=a.array.length}var s=new t(i),c=0;for(o=0;o<e.length;++o)s.set(e[o].array,c),c+=e[o].array.length;return new THREE.BufferAttribute(s,n,r)}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("haptics",{schema:{actuatorIndex:{default:0},dur:{default:100},enabled:{default:!0},events:{type:"array"},eventsFrom:{type:"string"},force:{default:1}},multiple:!0,init:function(){this.data;var e=this;this.callPulse=function(){e.pulse()};var t=function(){e.gamepad=e.el.components["tracked-controls"].controller,e.gamepad.gamepad&&(e.gamepad=e.gamepad.gamepad),e.gamepad&&e.gamepad.hapticActuators&&e.gamepad.hapticActuators.length&&e.addEventListeners()};this.el.components["tracked-controls"]&&this.el.components["tracked-controls"].controller?t():this.el.addEventListener("controllerconnected",(function(){t()}))},remove:function(){this.removeEventListeners()},pulse:function(e,t){var n=this.data;n.enabled&&this.gamepad&&this.gamepad.hapticActuators&&this.gamepad.hapticActuators[n.actuatorIndex].pulse(e||n.force,t||n.dur)},addEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.addEventListener(n.events[e],this.callPulse)},removeEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.removeEventListener(n.events[e],this.callPulse)}})},function(e,t){var n=[],r=new THREE.Vector3;function i(e,t,i){var o,a,s,c,l,h,d=Math.ceil(t/e.columns);for(a=e.marginColumn,s=e.marginRow,i&&(a=e.margin,s=e.margin),l=u(e.align,d),c=u(e.align,e.columns),h=0;h<d;h++)for(o=0;o<e.columns;o++)r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=(o-c)*a),0===e.plane.indexOf("y")&&(r.y=(o-c)*a),1===e.plane.indexOf("y")&&(r.y=(h-l)*s),1===e.plane.indexOf("z")&&(r.z=(h-l)*s),f(r);return n}function o(e,t){var i,o;for(i=0;i<t;i++)o=isNaN(e.angle)?i*(2*Math.PI)/t:i*e.angle*.01745329252,r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=e.radius*Math.cos(o)),0===e.plane.indexOf("y")&&(r.y=e.radius*Math.cos(o)),1===e.plane.indexOf("y")&&(r.y=e.radius*Math.sin(o)),1===e.plane.indexOf("z")&&(r.z=e.radius*Math.sin(o)),f(r);return n}function a(e,t){return e.columns=t,i(e,t,!0)}function s(e,t){return p(1,0,0,0,1,0,0,0,1,-1,0,0,0,-1,0,0,0,-1),h(e.radius/2),n}function c(e,t){var r=(1+Math.sqrt(5))/2,i=1/r,o=2-r,a=-1*i,s=-1*o;return p(-1,o,0,-1,s,0,0,-1,o,0,-1,s,0,1,o,0,1,s,1,o,0,1,s,0,i,i,i,i,i,a,i,a,i,i,a,a,o,0,1,o,0,-1,a,i,i,a,i,a,a,a,i,a,a,a,s,0,1,s,0,-1),h(e.radius/2),n}function l(e,t){var r=Math.sqrt(3),i=-1/Math.sqrt(3);return p(0,0,r+i,-1,0,i,1,0,i,0,2*Math.sqrt(2/3),0),h(e.radius/2),n}function u(e,t){switch(e){case"start":return t-1;case"center":return(t-1)/2;case"end":return 0}}function h(e){var t;for(t=0;t<n.length;t++)n[t]=n[t]*e}function d(e,t,n){var r,i,o;if(n)for(i=0;i<e.length;i++)null!=(r=e[i].getAttribute(n))&&(o=3*parseInt(r,10),e[i].object3D.position.set(t[o],t[o+1],t[o+2]));else for(i=0;i<t.length;i+=3){if(!e[i/3])return;e[i/3].object3D.position.set(t[i],t[i+1],t[i+2])}}function p(){var e;for(e=0;e<arguments.length;e++)n.push(e)}function f(e){n.push(e.x),n.push(e.y),n.push(e.z)}AFRAME.registerComponent("layout",{schema:{angle:{type:"number",default:!1,min:0,max:360,if:{type:["circle"]}},columns:{default:1,min:0,if:{type:["box"]}},margin:{default:1,min:0,if:{type:["box","line"]}},marginColumn:{default:1,min:0,if:{type:["box"]}},marginRow:{default:1,min:0,if:{type:["box"]}},orderAttribute:{default:""},plane:{default:"xy"},radius:{default:1,min:0,if:{type:["circle","cube","dodecahedron","pyramid"]}},reverse:{default:!1},type:{default:"line",oneOf:["box","circle","cube","dodecahedron","line","pyramid"]},fill:{default:!0,if:{type:["circle"]}},align:{default:"end",oneOf:["start","center","end"]}},init:function(){var e=this,t=this.el;this.children=t.getChildEntities(),this.initialPositions=[],this.children.forEach((function(t){if(t.hasLoaded)return n();function n(){e.initialPositions.push(t.object3D.position.x),e.initialPositions.push(t.object3D.position.y),e.initialPositions.push(t.object3D.position.z)}t.addEventListener("loaded",n)})),this.handleChildAttached=this.handleChildAttached.bind(this),this.handleChildDetached=this.handleChildDetached.bind(this),t.addEventListener("child-attached",this.handleChildAttached),t.addEventListener("child-detached",this.handleChildDetached),t.addEventListener("layoutrefresh",this.update.bind(this))},update:function(e){var t,r,u,h=this.children,p=this.data,f=this.el;switch(r=h.length,p.type){case"box":u=i;break;case"circle":u=o;break;case"cube":u=s;break;case"dodecahedron":u=c;break;case"pyramid":u=l;break;default:u=a}t=f.getDOMAttribute("layout"),n.length=0,n=u(p,r,"string"==typeof t?-1!==t.indexOf("margin"):"margin"in t),p.reverse&&n.reverse(),d(h,n,p.orderAttribute)},remove:function(){this.el.removeEventListener("child-attached",this.handleChildAttached),this.el.removeEventListener("child-detached",this.handleChildDetached),d(this.children,this.initialPositions)},handleChildAttached:function(e){var t=this.el;e.detail.el.parentNode===t&&(this.children.push(e.detail.el),this.update())},handleChildDetached:function(e){-1!==this.children.indexOf(e.detail.el)&&(this.children.splice(this.children.indexOf(e.detail.el),1),this.initialPositions.splice(this.children.indexOf(e.detail.el),1),this.update())}}),e.exports.getBoxPositions=i,e.exports.getCirclePositions=o,e.exports.getLinePositions=a,e.exports.getCubePositions=s,e.exports.getDodecahedronPositions=c,e.exports.getPyramidPositions=l},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerPrimitive("a-log",{defaultComponents:{geometry:{primitive:"plane",height:5},log:{},material:{color:"#111",shader:"flat",side:"double"},text:{color:"lightgreen",baseline:"top",align:"center",height:5}},mappings:{channel:"log.channel"}}),AFRAME.registerSystem("log",{schema:{console:{default:!0}},init:function(){var e=this.data,t=this.logs=[],n=this.loggers=[];AFRAME.log=function(r,i){t.push([r,i]),n.forEach((function(e){e.receiveLog(r,i)})),e.console&&console.log("[log:"+(i||"")+"] "+r)}},registerLogger:function(e){this.loggers.push(e),this.logs.forEach((function(t){e.receiveLog.apply(e,t)}))},unregisterLogger:function(e){this.loggers.splice(this.loggers.indexOf(e),1)}}),AFRAME.registerComponent("log",{schema:{channel:{type:"string"},filter:{type:"string"},max:{default:100},showErrors:{default:!0}},init:function(){this.logs=[],this.system.registerLogger(this)},play:function(){var e=this;this.el.sceneEl.addEventListener("log",(function(t){t.detail&&e.receiveLog(t.detail.message,t.detail.channel)})),window.onerror=function(t,n,r,i,o){e.receiveLog("Error: "+t)}},receiveLog:function(e,t){var n=this.data;"string"!=typeof e&&(e=JSON.stringify(e)),n.channel&&t&&n.channel!==t||n.filter&&-1===e.indexOf(n.filter)||(this.logs.push(e),n.max&&this.logs.length>n.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})},function(e,t,n){n(53),AFRAME.registerComponent("orbit-controls",{dependencies:["camera"],schema:{autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},initialPosition:{type:"vec3"},keyPanSpeed:{default:7},minAzimuthAngle:{type:"number",default:1/0},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:1e3},maxPolarAngle:{default:AFRAME.utils.device.isMobile()?90:120},minDistance:{default:1},minPolarAngle:{default:0},minZoom:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},target:{type:"vec3"},zoomSpeed:{default:.5}},init:function(){var e,t=this.el;this.controls=new THREE.OrbitControls(t.getObject3D("camera"),t.sceneEl.renderer.domElement),e=new THREE.Vector3,t.sceneEl.addEventListener("enter-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!1,t.hasAttribute("look-controls")&&(t.setAttribute("look-controls","enabled",!0),e.copy(t.getObject3D("camera").position),t.getObject3D("camera").position.set(0,0,0)))}),t.sceneEl.addEventListener("exit-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!0,t.getObject3D("camera").position.copy(e),t.hasAttribute("look-controls")&&t.setAttribute("look-controls","enabled",!1))}),document.body.style.cursor="grab",document.addEventListener("mousedown",()=>{document.body.style.cursor="grabbing"}),document.addEventListener("mouseup",()=>{document.body.style.cursor="grab"}),this.target=new THREE.Vector3,t.getObject3D("camera").position.copy(this.data.initialPosition)},update:function(e){var t=this.controls,n=this.data;t.target=this.target.copy(n.target),t.autoRotate=n.autoRotate,t.autoRotateSpeed=n.autoRotateSpeed,t.dampingFactor=n.dampingFactor,t.enabled=n.enabled,t.enableDamping=n.enableDamping,t.enableKeys=n.enableKeys,t.enablePan=n.enablePan,t.enableRotate=n.enableRotate,t.enableZoom=n.enableZoom,t.keyPanSpeed=n.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(n.maxPolarAngle),t.maxDistance=n.maxDistance,t.minDistance=n.minDistance,t.minPolarAngle=THREE.Math.degToRad(n.minPolarAngle),t.minZoom=n.minZoom,t.panSpeed=n.panSpeed,t.rotateSpeed=n.rotateSpeed,t.screenSpacePanning=n.screenSpacePanning,t.zoomSpeed=n.zoomSpeed},tick:function(){var e=this.controls;this.data.enabled&&e.enabled&&(e.enableDamping||e.autoRotate)&&this.controls.update()}})},function(e,t){THREE.OrbitControls=function(e,t){var n,r,i,o,a;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){s.target0.copy(s.target),s.position0.copy(s.object.position),s.zoom0=s.object.zoom},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(c),s.update(),d=h.NONE},this.update=(n=new THREE.Vector3,r=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),i=r.clone().inverse(),o=new THREE.Vector3,a=new THREE.Quaternion,function(){var e=s.object.position;return n.copy(e).sub(s.target),n.applyQuaternion(r),f.setFromVector3(n),s.autoRotate&&d===h.NONE&&C(2*Math.PI/60/60*s.autoRotateSpeed),f.theta+=m.theta,f.phi+=m.phi,f.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,f.theta)),f.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=g,f.radius=Math.max(s.minDistance,Math.min(s.maxDistance,f.radius)),s.target.add(y),n.setFromSpherical(f),n.applyQuaternion(i),e.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(m.theta*=1-s.dampingFactor,m.phi*=1-s.dampingFactor):m.set(0,0,0),g=1,y.set(0,0,0),!!(v||o.distanceToSquared(s.object.position)>p||8*(1-a.dot(s.object.quaternion))>p)&&(s.dispatchEvent(c),o.copy(s.object.position),a.copy(s.object.quaternion),v=!1,!0)}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",G,!1),s.domElement.removeEventListener("mousedown",F,!1),s.domElement.removeEventListener("wheel",B,!1),s.domElement.removeEventListener("touchstart",H,!1),s.domElement.removeEventListener("touchend",q,!1),s.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",V,!1)};var s=this,c={type:"change"},l={type:"start"},u={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,f=new THREE.Spherical,m=new THREE.Spherical,g=1,y=new THREE.Vector3,v=!1,b=new THREE.Vector2,_=new THREE.Vector2,w=new THREE.Vector2,E=new THREE.Vector2,A=new THREE.Vector2,x=new THREE.Vector2,S=new THREE.Vector2,T=new THREE.Vector2,M=new THREE.Vector2;function R(){return Math.pow(.95,s.zoomSpeed)}function C(e){m.theta-=e}function k(e){m.phi-=e}var I,P=(I=new THREE.Vector3,function(e,t){I.setFromMatrixColumn(t,0),I.multiplyScalar(-e),y.add(I)}),O=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),y.add(e)}}(),N=function(){var e=new THREE.Vector3;return function(t,n){var r=s.domElement===document?s.domElement.body:s.domElement;if(s.object.isPerspectiveCamera){var i=s.object.position;e.copy(i).sub(s.target);var o=e.length();o*=Math.tan(s.object.fov/2*Math.PI/180),P(2*t*o/r.clientHeight,s.object.matrix),O(2*n*o/r.clientHeight,s.object.matrix)}else s.object.isOrthographicCamera?(P(t*(s.object.right-s.object.left)/s.object.zoom/r.clientWidth,s.object.matrix),O(n*(s.object.top-s.object.bottom)/s.object.zoom/r.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)}}();function D(e){s.object.isPerspectiveCamera?g/=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function L(e){s.object.isPerspectiveCamera?g*=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function F(e){if(!1!==s.enabled){switch(e.preventDefault(),e.button){case s.mouseButtons.ORBIT:if(!1===s.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case s.mouseButtons.ZOOM:if(!1===s.enableZoom)return;!function(e){S.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case s.mouseButtons.PAN:if(!1===s.enablePan)return;!function(e){E.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",U,!1),s.dispatchEvent(l))}}function j(e){if(!1!==s.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===s.enableRotate)return;!function(e){_.set(e.clientX,e.clientY),w.subVectors(_,b);var t=s.domElement===document?s.domElement.body:s.domElement;C(2*Math.PI*w.x/t.clientWidth*s.rotateSpeed),k(2*Math.PI*w.y/t.clientHeight*s.rotateSpeed),b.copy(_),s.update()}(e);break;case h.DOLLY:if(!1===s.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),M.subVectors(T,S),M.y>0?D(R()):M.y<0&&L(R()),S.copy(T),s.update()}(e);break;case h.PAN:if(!1===s.enablePan)return;!function(e){A.set(e.clientX,e.clientY),x.subVectors(A,E),N(x.x,x.y),E.copy(A),s.update()}(e)}}function U(e){!1!==s.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),s.dispatchEvent(u),d=h.NONE)}function B(e){!1===s.enabled||!1===s.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),s.dispatchEvent(l),function(e){e.deltaY<0?L(R()):e.deltaY>0&&D(R()),s.update()}(e),s.dispatchEvent(u))}function V(e){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(e){switch(e.keyCode){case s.keys.UP:N(0,s.keyPanSpeed),s.update();break;case s.keys.BOTTOM:N(0,-s.keyPanSpeed),s.update();break;case s.keys.LEFT:N(s.keyPanSpeed,0),s.update();break;case s.keys.RIGHT:N(-s.keyPanSpeed,0),s.update()}}(e)}function H(e){if(!1!==s.enabled){switch(e.touches.length){case 1:if(!1===s.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===s.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);S.set(0,r)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===s.enablePan)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&s.dispatchEvent(l)}}function z(e){if(!1!==s.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===s.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){_.set(e.touches[0].pageX,e.touches[0].pageY),w.subVectors(_,b);var t=s.domElement===document?s.domElement.body:s.domElement;C(2*Math.PI*w.x/t.clientWidth*s.rotateSpeed),k(2*Math.PI*w.y/t.clientHeight*s.rotateSpeed),b.copy(_),s.update()}(e);break;case 2:if(!1===s.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);T.set(0,r),M.subVectors(T,S),M.y>0?L(R()):M.y<0&&D(R()),S.copy(T),s.update()}(e);break;case 3:if(!1===s.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY),x.subVectors(A,E),N(x.x,x.y),E.copy(A),s.update()}(e);break;default:d=h.NONE}}function q(e){!1!==s.enabled&&(s.dispatchEvent(u),d=h.NONE)}function G(e){!1!==s.enabled&&e.preventDefault()}s.domElement.addEventListener("contextmenu",G,!1),s.domElement.addEventListener("mousedown",F,!1),s.domElement.addEventListener("wheel",B,!1),s.domElement.addEventListener("touchstart",H,!1),s.domElement.addEventListener("touchend",q,!1),s.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",V,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t){AFRAME.registerComponent("proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,o=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){var r=o.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(t){var r=n.data;r.enabled&&(r.captureBubbles||t.target===e)&&n.el.emit(r.as||r.event,t.detail?t.detail:null,!1)}))}})},function(e,t){AFRAME.registerSystem("render-order",{schema:{type:"array"},init:function(){this.el.renderer.sortObjects=!0},update:function(){for(this.order={},i=0;i<this.data.length;i++)this.order[this.data[i]]=i}}),AFRAME.registerComponent("render-order",{schema:{type:"string"},multiple:!0,init:function(){this.set=this.set.bind(this),this.el.addEventListener("object3dset",e=>{"nonrecursive"!==this.id&&e.detail.object.traverse(this.set)})},update:function(){"nonrecursive"===this.id?this.set(this.el.object3D):this.el.object3D.traverse(this.set)},set:function(e){isNaN(this.data)?e.renderOrder=this.system.order[this.data]:e.renderOrder=parseFloat(this.data)}}),AFRAME.registerComponent("render-order-recursive",{init:function(){this.el.addEventListener("child-attached",e=>{e.detail.el.setAttribute("render-order",this.el.getAttribute("render-order"))})}})},function(e,t,n){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r={};e.exports.select=function(e,t,n){return r[t]||(r[t]=new Function("state","item","return "+c(t)+";")),r[t](e,n)};var i=/\.([A-Za-z][\w_-]*)/g,o=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,a=/^([\(]?)([A-Za-z][\w_-]*)/g,s=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(i,'["$1"]')).replace(a,'$1state["$2"]')).replace(o,'$1$2$3state["$4"]')).replace(s,"item")}function l(){var e=arguments;return function(){var t;for(t=0;t<e.length;t++)e[t].apply(this,arguments)}}e.exports.generateExpression=c,e.exports.clearObject=function(e){for(var t in e)delete e[t]},e.exports.composeHandlers=function(){var e,t,n,r=arguments;for(n={},t=0;t<r.length;t++)for(e in r[t])e in n?n[e].constructor===Array?n[e].push(r[t][e]):n[e]=[n[e],r[t][e]]:n[e]=r[t][e];for(e in n)n[e].constructor===Array&&(n[e]=l.apply(this,n[e]));return n},e.exports.composeFunctions=l;var u=["||","&&","!=","!==","==","===",">","<","<=",">="],h=/\s+/,d=/\(|\)|\!/g;function p(e){return-1===(e=function(e){return 0===e.indexOf("!!")?e.replace("!!",""):0===e.indexOf("!")?e.replace("!",""):e}(e.trim())).indexOf(".")?e:e.substring(0,e.indexOf("."))}e.exports.parseKeysToWatch=function(e,t,n){var r,i;for(i=m(t,h),r=0;r<i.length;r++)if(-1===u.indexOf(i[r])&&!i[r].startsWith("'")&&-1===e.indexOf(i[r])){if(n&&"item"===i[r])continue;e.push(p(i[r]).replace(d,""))}return e};var f={};function m(e,t){return f[t]||(f[t]={}),f[t][e]||(f[t][e]=e.split(t)),f[t][e]}e.exports.split=m,e.exports.copyArray=function(e,t){var n;for(e.length=0,n=0;n<t.length;n++)e[n]=t[n]}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n(2);var i,o,a=n(3),s=n(0),c=n(4).wrapArray,l={initialState:{},nonBindedStateKeys:[],handlers:{},computeState:function(){}};AFRAME.registerState=function(e){AFRAME.utils.extend(l,e)},AFRAME.registerSystem("state",{init:function(){var e,t=this;for(e in this.arrays=[],this.dirtyArrays=[],this.diff={},this.state=AFRAME.utils.clone(l.initialState),this.subscriptions=[],this.initEventHandlers(),this.state)this.state[e]&&this.state[e].constructor===Array&&(this.arrays.push(e),this.state[e].__dirty=!0,c(this.state[e]));this.lastState=AFRAME.utils.clone(this.state),this.eventDetail={lastState:this.lastState,state:this.state},this.el.addEventListener("loaded",(function(){var e;for(l.computeState(t.state,"@@INIT"),e=0;e<t.subscriptions.length;e++)t.subscriptions[e].onStateUpdate(t.state)}))},dispatch:(o=[],function(e,t){var n,r;for(r in l.handlers[e](this.state,t),l.computeState(this.state,e,t),this.diff)delete this.diff[r];for(a(this.lastState,this.state,this.diff,l.nonBindedStateKeys),this.dirtyArrays.length=0,n=0;n<this.arrays.length;n++)this.state[this.arrays[n]].__dirty&&this.dirtyArrays.push(this.arrays[n]);for(o.length=0,n=0;n<this.subscriptions.length;n++){if("bind-for"===this.subscriptions[n].name){if(!this.state[this.subscriptions[n].keysToWatch[0]].__dirty)continue}else if(!this.shouldUpdate(this.subscriptions[n].keysToWatch,this.diff,this.dirtyArrays))continue;-1===o.indexOf(this.subscriptions[n])&&o.push(this.subscriptions[n])}for(n=0;n<o.length;n++)o[n].onStateUpdate();for(r in this.state)this.state[r]&&this.state[r].constructor===Array&&(this.state[r].__dirty=!1);this.copyState(this.lastState,this.state),this.eventDetail.action=e,this.eventDetail.payload=t,this.el.emit("stateupdate",this.eventDetail)}),copyState:function(e,t,n){var r;for(r in t)if(n||-1===l.nonBindedStateKeys.indexOf(r))if(t[r]&&t[r].constructor===Object){if(!(r in e)){e[r]=AFRAME.utils.clone(t[r]);continue}this.copyState(e[r],t[r],!0)}else e[r]=t[r]},subscribe:function(e){this.subscriptions.push(e)},unsubscribe:function(e){this.subscriptions.splice(this.subscriptions.indexOf(e),1)},shouldUpdate:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]in t||-1!==n.indexOf(e[r]))return!0;return!1},initEventHandlers:function(){var e,t=[];for(e in n=n.bind(this),l.handlers)-1===t.indexOf(e)&&(t.push(e),n(e));function n(e){var t=this;this.el.addEventListener(e,(function(n){t.dispatch(e,n.detail)}))}},renderTemplate:(i=/{{\s*(\w*\.)?([\w.]+)\s*}}/g,function(e,t,n){var o,a;if(a=e,t)for(;o=i.exec(e);)a=a.replace(o[0],"object"===(void 0===t?"undefined":r(t))?s.select(t,o[2])||"":t);return n?a:document.createRange().createContextualFragment(a)}),select:s.select}),AFRAME.registerComponent("bind",{schema:{default:{},parse:function(e){var t,n,r,i;if(e.constructor===Object)return e;if(-1===e.indexOf(":"))return e;for(t={},r=s.split(e,";"),n=0;n<r.length;n++)t[(i=s.split(r[n].trim(),":"))[0]]=i[1].trim();return t}},multiple:!0,init:function(){var e;this.data,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system=this.el.sceneEl.systems.state,this.id&&(e=s.split(this.id,"__")[0]),this.isNamespacedBind=this.id&&e in AFRAME.components&&!AFRAME.components[e].isSingleProp||e in AFRAME.systems,this.lastData={},this.updateObj={},this.system.subscribe(this),this.onStateUpdate=this.onStateUpdate.bind(this)},update:function(){var e,t=this.data;if(this.keysToWatch.length=0,"string"==typeof t)s.parseKeysToWatch(this.keysToWatch,t);else for(e in t)s.parseKeysToWatch(this.keysToWatch,t[e]);this.onStateUpdate()},onStateUpdate:function(){var e,t,n,i,o=!1,a=this.el;if(a.parentNode){if(this.isNamespacedBind&&s.clearObject(this.updateObj),n=this.system.state,"object"!==r(this.data)){try{i=s.select(n,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"!==(void 0===i?"undefined":r(i))&&"object"!==r(this.lastData)&&this.lastData===i)return;return AFRAME.utils.entity.setComponentProperty(a,this.id,i),void(this.lastData=i)}for(e in this.data){t=this.data[e].trim();try{i=s.select(n,t)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+t+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"===(void 0===i?"undefined":r(i))||"object"===r(this.lastData[e])||this.lastData[e]!==i){if(e in AFRAME.components&&void 0===i)return void a.removeAttribute(e);this.isNamespacedBind?this.updateObj[e]=i:AFRAME.utils.entity.setComponentProperty(a,e,i),this.lastData[e]=i}}for(o in this.updateObj);this.isNamespacedBind&&o&&a.setAttribute(this.id,this.updateObj)}},remove:function(){this.system.unsubscribe(this)}}),AFRAME.registerComponent("bind-toggle",{schema:{type:"string"},multiple:!0,init:function(){this.system=this.el.sceneEl.systems.state,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system.subscribe(this),this.onStateUpdate()},update:function(){this.keysToWatch.length=0,s.parseKeysToWatch(this.keysToWatch,this.data)},onStateUpdate:function(){var e,t,n=this.el;e=this.system.state;try{t=s.select(e,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}t?n.setAttribute(this.id,""):n.removeAttribute(this.id)},remove:function(){this.system.unsubscribe(this)}}),e.exports={composeFunctions:s.composeFunctions,composeHandlers:s.composeHandlers,select:s.select}},function(e,t,n){"use strict";var r,i,o=n(0);AFRAME.registerComponent("bind-for",{schema:{delay:{default:0},for:{type:"string",default:"item"},in:{type:"string"},key:{type:"string"},pool:{default:0},template:{type:"string"},updateInPlace:{default:!1}},init:function(){this.system=this.el.sceneEl.systems.state,this.onStateUpdate=this.onStateUpdate.bind(this),this.keysToWatch=[],this.renderedKeys=[],this.system.subscribe(this),this.el.children[0]&&"TEMPLATE"===this.el.children[0].tagName?this.template=this.el.children[0].innerHTML.trim():this.template=document.querySelector(this.data.template).innerHTML.trim();for(var e=0;e<this.data.pool;e++)this.el.appendChild(this.generateFromTemplate(null,e))},update:function(){this.keysToWatch[0]=o.split(this.data.in,".")[0],this.onStateUpdate()},onStateUpdateNaive:(i=[],function(){var e,t=this.data,n=this.el;try{e=o.select(this.system.state,t.in)}catch(e){throw new Error("[aframe-state-component] Key '"+t.in+"' not found in state. #"+n.getAttribute("id")+"["+this.attrName+"]")}i.length=0;for(var r=0;r<e.length;r++){var a=e[r];i.push(t.key?a[t.key].toString():a.toString())}for(var s=this.getElsToRemove(i,this.renderedKeys),c=0;c<s.length;c++)s[c].parentNode.removeChild(s[c]);e.length&&this.renderItems(e,i,0)}),renderItems:function(e,t,n){var r,i=this,o=this.data,a=this.el,s=e[n],c=o.key?s[o.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(c))r=this.generateFromTemplate(s,n),a.appendChild(r),this.renderedKeys.push(c);else{if(e.length&&e[0].constructor===String){var l=o.key?s[o.key].toString():s.toString();(r=a.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n)}else{var u=this.getBindForKey(s,n);r=a.querySelector('[data-bind-for-key="'+u+'"]')}r.emit("bindforupdate",s,!1)}e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItems(e,t,n+1)}),this.data.delay):this.renderItems(e,t,n+1))},onStateUpdateInPlace:function(){var e=[];return function(){var t,n,r=this.data,i=this.el;try{t=o.select(this.system.state,r.in)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+r.in+"' not found in state. #"+i.getAttribute("id")+"["+this.attrName+"]")}e.length=0;for(var a=0;a<t.length;a++){var s=t[a];n=r.key?s[r.key].toString():s.toString(),e.push(n)}for(var c=this.getElsToRemove(e,this.renderedKeys),l=0;l<c.length;l++)c[l].object3D.visible=!1,c[l].setAttribute("data-bind-for-active","false"),c[l].removeAttribute("data-bind-for-key"),c[l].removeAttribute("data-bind-for-value"),c[l].emit("bindfordeactivate",null,!1),c[l].pause();t.length&&this.renderItemsInPlace(t,e,0)}}(),renderItemsInPlace:function(e,t,n){var r,i=this,o=this.data,a=this.el,s=e[n],c=this.getBindForKey(s,n),l=o.key?s[o.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(l)){if(a.querySelector(':scope > [data-bind-for-active="false"]'))(r=a.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),r.setAttribute("data-bind-for-value",l),r.object3D.visible=!0,r.play(),r.setAttribute("data-bind-for-active","true"),r.emit("bindforupdateinplace",s,!1);else{var u=this.generateFromTemplate(s,n);u.addEventListener("loaded",(function(){u.emit("bindforupdateinplace",s,!1)})),a.appendChild(u)}this.renderedKeys.push(l)}else-1!==t.indexOf(l)&&(e.length&&e[0].constructor===String?(r=a.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n):r=a.querySelector('[data-bind-for-key="'+c+'"]'),r.emit("bindforupdateinplace",s,!1));e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItemsInPlace(e,t,n+1)}),this.data.delay):this.renderItemsInPlace(e,t,n+1))},generateFromTemplate:function(e,t){var n=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var r=this.el.children[this.el.children.length-1];if(!e)return r.setAttribute("data-bind-for-key",""),r.setAttribute("data-bind-for-active","false"),r;var i=this.getBindForKey(e,t);return r.setAttribute("data-bind-for-key",i),n.key||r.setAttribute("data-bind-for-value",e),r.setAttribute("data-bind-for-active","true"),r},getElsToRemove:(r=[],function(e,t){var n=this.data,i=this.el;r.length=0;for(var o=0;o<i.children.length;o++)if("TEMPLATE"!==i.children[o].tagName){var a=n.key?i.children[o].getAttribute("data-bind-for-key"):i.children[o].getAttribute("data-bind-for-value");-1===e.indexOf(a)&&-1!==t.indexOf(a)&&(r.push(i.children[o]),t.splice(t.indexOf(a),1))}return r}),getBindForKey:function(e,t){return this.data.key?e[this.data.key].toString():t.toString()},onStateUpdate:function(){this.data.updateInPlace?this.onStateUpdateInPlace():this.onStateUpdateNaive()}}),AFRAME.registerComponent("bind-item",{schema:{type:"string"},multiple:!0,init:function(){this.itemData=null,this.keysToWatch=[],this.prevValues={};var e=this.rootEl=this.el.closest("[data-bind-for-key]");if(!e)throw new Error("bind-item component must be attached to entity under a bind-for item.");e.addEventListener("bindforupdateinplace",this.updateInPlace.bind(this)),e.addEventListener("bindfordeactivate",this.deactivate.bind(this)),this.el.sceneEl.systems.state.subscribe(this)},update:function(){this.parseSelector()},updateInPlace:function(e){var t=this.propertyMap;if("false"!==this.rootEl.getAttribute("data-bind-for-active"))for(var n in e&&(this.itemData=e.detail),t){var r=this.select(this.itemData,t[n]);r!==this.prevValues[n]&&(AFRAME.utils.entity.setComponentProperty(this.el,n,r),this.prevValues[n]=r)}},onStateUpdate:function(){this.updateInPlace()},select:function(e,t){return o.select(this.el.sceneEl.systems.state.state,t,e)},deactivate:function(){this.prevValues={}},parseSelector:function(){var e=this.propertyMap={};this.keysToWatch.length=0;var t=o.split(this.id,"__")[0];if(!(t in AFRAME.components)||AFRAME.components[t].isSingleProp)e[this.id]=this.data,o.parseKeysToWatch(this.keysToWatch,this.data,!0);else for(var n=o.split(this.data,";"),r=0;r<n.length;r++){var i=o.split(n[r],":");e[this.id+"."+i[0].trim()]=i[1].trim(),o.parseKeysToWatch(this.keysToWatch,i[1].trim(),!0)}}})},function(e,t,n){"use strict";var r;e.exports=(r=[],function(e,t,n,i){var o,a,s,c,l,u,h;for(l in c=n||{},r.length=0,e)r.push(l);if(!t)return c;for(s in t)-1===r.indexOf(s)&&r.push(s);for(u=0;u<r.length;u++)l=r[u],i&&-1!==i.indexOf(l)||(o=e[l],a=t[l],((h=o&&a&&o.constructor===Object&&a.constructor===Object)&&!AFRAME.utils.deepEqual(o,a)||!h&&o!==a)&&(c[l]=a));return c})},function(e,t,n){"use strict";var r=["push","pop","shift","unshift","splice"];function i(e,t){var n=e[t];e[t]=function(){n.apply(e,arguments),e.__dirty=!0}}e.exports.wrapArray=function(e){var t;if(!e.__wrapped){for(t=0;t<r.length;t++)i(e,r[t]);e.__wrapped=!0}}}])},e.exports=r()},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("slice9",{schema:{width:{default:1,min:0},height:{default:1,min:0},left:{default:0,min:0},right:{default:0,min:0},bottom:{default:0,min:0},top:{default:0,min:0},side:{default:"front",oneOf:["front","back","double"]},padding:{default:.1,min:.01},color:{type:"color",default:"#fff"},opacity:{default:1,min:0,max:1},transparent:{default:!0},debug:{default:!1},src:{type:"map"}},multiple:!1,init:function(){var e=this.data,t=this.material=new THREE.MeshBasicMaterial({color:e.color,opacity:e.opacity,transparent:e.transparent,wireframe:e.debug}),n=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,3,3);new THREE.TextureLoader;this.plane=new THREE.Mesh(n,t),this.el.setObject3D("mesh",this.plane),this.textureSrc=null},updateMap:function(){var e=this.data.src;if(e){if(e===this.textureSrc)return;return this.textureSrc=e,void this.el.sceneEl.systems.material.loadTexture(e,{src:e},t.bind(this))}function t(e){this.material.map=e,this.material.needsUpdate=!0,this.regenerateMesh()}this.material.map&&t(null)},regenerateMesh:function(){var e=this.data,t=this.geometry.attributes.position.array,n=this.geometry.attributes.uv.array,r=this.material.map.image;if(r){var i={left:e.left/r.width,right:e.right/r.width,top:e.top/r.height,bottom:e.bottom/r.height};d(1,i.left,1),d(2,i.right,1),d(4,0,i.bottom),d(5,i.left,i.bottom),d(6,i.right,i.bottom),d(7,1,i.bottom),d(8,0,i.top),d(9,i.left,i.top),d(10,i.right,i.top),d(11,1,i.top),d(13,i.left,0),d(14,i.right,0);var o=e.width/2,a=e.height/2,s=-o+e.padding,c=o-e.padding,l=a-e.padding,u=-a+e.padding;h(0,-o,a),h(1,s,a),h(2,c,a),h(3,o,a),h(4,-o,l),h(5,s,l),h(6,c,l),h(7,o,l),h(8,-o,u),h(9,s,u),h(10,c,u),h(11,o,u),h(13,s,-a),h(14,c,-a),h(12,-o,-a),h(15,o,-a),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0}function h(e,n,r){t[3*e]=n,t[3*e+1]=r}function d(e,t,r){n[2*e]=t,n[2*e+1]=r}},update:function(e){var t=this.data;this.material.color.setStyle(t.color),this.material.opacity=t.opacity,this.material.transparent=t.transparent,this.material.wireframe=t.debug,this.material.side=function(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}(t.side);var n=AFRAME.utils.diff(t,e);"src"in n?this.updateMap():("width"in n||"height"in n||"padding"in n||"left"in n||"top"in n||"bottom"in n||"right"in n)&&this.regenerateMesh()},remove:function(){},pause:function(){},play:function(){}})},function(e,t){var n=[0,90,180,270],r=["right","up","left","down"],i={NULL:{START:"thumbstart",END:"thumbend"}};r.forEach(e=>{i[e]={},i[e].START="thumb"+e+"start",i[e].END="thumb"+e+"end"});AFRAME.registerComponent("thumb-controls",{schema:{thresholdAngle:{default:89.5},thresholdPad:{default:.05},thresholdStick:{default:.75}},init:function(){var e=this.el;this.onTrackpadDown=this.onTrackpadDown.bind(this),this.onTrackpadUp=this.onTrackpadUp.bind(this),this.directionStick="",this.directionTrackpad="",e.components["tracked-controls"]&&(this.axis=e.components["tracked-controls"].axis),this.type="STICK",e.addEventListener("controllerconnected",t=>{this.axis=e.components["tracked-controls"].axis,"oculus-touch-controls"!==t.detail.name&&"windows-motion-controls"!==t.detail.name?this.type="PAD":this.type="STICK"})},play:function(){var e=this.el;e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("touchpaddown",this.onTrackpadDown),e.addEventListener("touchpadup",this.onTrackpadUp)},pause:function(){var e=this.el;e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("touchpaddown",this.onTrackpadDown),e.removeEventListener("touchpadup",this.onTrackpadUp)},onTrackpadDown:function(){var e,t=this.el;this.getDistance()<this.data.thresholdPad||(e=this.getDirection())&&(this.directionTrackpad=e,t.emit(i.NULL.START,null,!1),t.emit(i[this.directionTrackpad].START,null,!1))},onTrackpadUp:function(){var e=this.el;this.directionTrackpad&&(e.emit(i.NULL.END,null,!1),e.emit(i[this.directionTrackpad].END,null,!1),this.directionTrackpad="")},tick:function(){var e,t=this.el;if("PAD"!==this.type){if(!this.directionStick&&this.getDistance()>this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(i.NULL.START,null,!1),void t.emit(i[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()<this.data.thresholdStick&&(t.emit(i.NULL.END,null,!1),t.emit(i[this.directionStick].END,null,!1),this.directionStick="")}},getDistance:function(){var e=this.axis;return this.axis?"PAD"===this.type?Math.sqrt(e[1]*e[1]+e[0]*e[0]):Math.sqrt(e[3]*e[3]+e[2]*e[2]):0},getDirection:function(){var e,t,i,o,a;for(e=this.getAngle(),o=this.data.thresholdAngle/2,i=0;i<n.length;i++){if((a=n[i]+o)>360&&(a-=360),(t=n[i]-o)<0&&(e>=360+t&&e<=360||e>=0&&e<=a))return r[i];if(e>=t&&e<=a)return r[i]}},getAngle:function(){var e,t=this.axis;return this.axis?((e="PAD"===this.type?Math.atan2(-t[1],t[0]):Math.atan2(-t[3],t[2]))<0&&(e=2*Math.PI+e),THREE.Math.radToDeg(e)):0}}),AFRAME.registerComponent("thumb-controls-debug",{dependencies:["thumb-controls"],schema:{controllerType:{type:"string"},hand:{type:"string"},enabled:{default:!1}},init:function(){var e,t,n,r,i=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var o=function(){i.components["tracked-controls"].handleAxes=()=>{},n={axis:t=[0,0,0]},i.components["tracked-controls"].axis=t,i.components["thumb-controls"].axis=t};i.components["tracked-controls"]?o():this.el.addEventListener("controllerconnected",(function(){o()})),(r=this.createCanvas()).addEventListener("click",r=>{"vive-controls"===this.data.controllerType?e?i.emit("trackpadup"):i.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1)),e=!e}),r.addEventListener("mousemove",o=>{var a;e&&(a=r.getBoundingClientRect(),t[0]=(o.clientX-a.left)/240*2-1,t[1]=(o.clientY-a.top)/240*2-1,i.emit("axismove",n,!1))}),r.addEventListener("mouseleave",r=>{e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1))})}},createCanvas:function(){var e,t;return(e=document.createElement("canvas")).classList.add("debugThumb"),e.height=240,e.width=240,e.style.bottom=0,e.style.borderRadius="250px",e.style.opacity=.5,e.style.position="fixed",e.style.zIndex=999999999,"left"===this.data.hand?e.style.left=0:e.style.right=0,(t=e.getContext("2d")).fillStyle="#333",t.fillRect(0,0,240,240),document.body.appendChild(e),e}})},function(e,t,n){var r={"./active-item.js":60,"./agent-dance.js":61,"./agent-picker.js":62,"./beat-cut-fx.js":63,"./beat-generator.js":16,"./beat-hit-sound.js":64,"./beat.js":24,"./blade.js":65,"./check-vr.js":66,"./console-shortcuts.js":67,"./controller.js":68,"./copy-texture.js":69,"./cursor-laser.js":70,"./cursor-mesh.js":71,"./curve-follow-rig-reset.js":72,"./cutfx-shader.js":73,"./debug-beat-generator.js":76,"./debug-beat-positioning.js":77,"./debug-controller.js":78,"./debug-cursor.js":79,"./debug-intro.js":80,"./debug-song-time.js":81,"./debug-state.js":82,"./delayed-proxy-event.js":83,"./desktop-input.js":84,"./difficulty-background.js":85,"./difficulty-filter.js":86,"./difficulty-text.js":87,"./follow-position.js":88,"./follow-z.js":89,"./gameover.js":90,"./gpu-preloader.js":91,"./gradient-shader.js":92,"./hand-swapper.js":94,"./handstar-shader.js":95,"./haptics-wall.js":98,"./haptics-weapon.js":99,"./headfist.js":100,"./history.js":101,"./intro-song.js":102,"./keyboard-raycastable.js":103,"./leaderboard.js":104,"./materials.js":110,"./menu-controls.js":125,"./menu-difficulty-select.js":126,"./menu-genre.js":127,"./menu-midsection.js":128,"./menu-mode.js":129,"./menu-playlist-button.js":130,"./menu-playlist.js":131,"./menu-selected-challenge-image.js":132,"./menu-slide-animation.js":133,"./multiplayer.js":134,"./multiplier-ring.js":138,"./no-frustum-cull.js":139,"./panel-shader.js":140,"./pause.js":143,"./pauser.js":144,"./play-sound.js":145,"./player-height.js":147,"./plume.js":148,"./punch.js":149,"./raycaster-target.js":150,"./recenter.js":151,"./ring.js":152,"./score-texts.js":155,"./search-thumbnail-atlas.js":156,"./search.js":157,"./song-info-positioner.js":160,"./song-preview.js":161,"./song-progress-info.js":162,"./song.js":163,"./stage-colors.js":164,"./stage-lasers.js":165,"./stars.js":166,"./stats-param.js":167,"./stepback.js":168,"./sub-object.js":169,"./super-keyboard.js":170,"./supercurve-color.js":171,"./supercurve-shader.js":172,"./supercurve.js":175,"./supercutfx-shader.js":178,"./supercutfx.js":179,"./tail.js":180,"./text-counter.js":181,"./text-geometry.js":241,"./text-truncate.js":182,"./text-uppercase.js":183,"./toggle-pause-play.js":184,"./trail.js":185,"./tunnels.js":186,"./vertex-colors-buffer.js":187,"./victory-accuracy-ring.js":188,"./victory-rank.js":189,"./visible-raycastable.js":190,"./wall-shader.js":191,"./wall.js":194,"./weapon-particles.js":195,"./zip-loader.js":196};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=59},function(e,t,n){if(AFRAME.registerComponent("active-item",{dependencies:["material"],schema:{active:{default:!1},opacity:{default:1}},init:function(){this.defaultOpacity=this.el.getAttribute("material").opacity,this.materialObj={opacity:this.data.opacity}},update:function(){var e=this.el;this.data.active?(e.setAttribute("material",this.materialObj),e.object3D.visible=!0):(e.setAttribute("material","opacity",this.defaultOpacity),e.components.animation__mouseleave&&setTimeout(()=>{e.emit("mouseleave",null,!1)}))}}),AFRAME.registerComponent("active-text-color",{dependencies:["text"],schema:{active:{default:!1},color:{default:"#333"}},init:function(){this.defaultColor=this.el.getAttribute("text").color},update:function(){var e=this.el;this.data.active?e.setAttribute("text","color",this.data.color):e.setAttribute("text","color",this.defaultColor)}}),window.AFRAME){const t=["active-item","active-text-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["dance","rumba","capoeira","thriller","wave","celebrate","taunt","silly","jump","pray","reaction","sitclap","sitlaugh","kiss","angry","defeated","falling","dying","idle"];if(AFRAME.registerComponent("agent-dance",{schema:{base:{default:"assets/clips/"},initial:{default:"dance"}},init:function(){this.clips={},this.currentAction=null;const e=this.el,t=()=>{const t=e.getObject3D("mesh");t&&(this.mixer=new THREE.AnimationMixer(t),this.play(this.data.initial),this.buildUI())};e.getObject3D("mesh")?t():e.addEventListener("model-loaded",t),this.onKeyDown=e=>{if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t="1234567890".indexOf(e.key);t>=0&&r[t]&&(this.play(r[t]),this.ui&&(this.ui.value=r[t]))},window.addEventListener("keydown",this.onKeyDown)},remove:function(){window.removeEventListener("keydown",this.onKeyDown),this.ui&&this.ui.remove()},play:function(e){if(!this.mixer)return;const t=e=>{const t=this.mixer.clipAction(e);t.reset().play(),this.currentAction&&this.currentAction!==t&&this.currentAction.crossFadeTo(t,.3,!1),this.currentAction=t};this.clips[e]?t(this.clips[e]):fetch(this.data.base+e+".json").then(e=>e.ok?e.json():null).then(n=>{if(!n)return;const r=THREE.AnimationClip.parse(n);this.clips[e]=r,t(r)}).catch(()=>{})},buildUI:function(){const e=document.createElement("select");e.style.cssText="position:fixed;top:10px;left:10px;z-index:9999998;background:rgba(0,0,0,0.7);color:#fff;font-family:monospace;padding:6px;border:1px solid #444;border-radius:4px;",e.title="Agent animation (1-0 keys also work)",r.forEach((t,n)=>{const r=document.createElement("option");r.value=t;const i=n<10?`[${(n+1)%10}] `:"";r.textContent=i+t,t===this.data.initial&&(r.selected=!0),e.appendChild(r)}),e.addEventListener("change",()=>this.play(e.value)),document.body.appendChild(e),this.ui=e},tick:function(e,t){this.mixer&&this.mixer.update(t/1e3)}}),window.AFRAME){const t=["agent-dance"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=[{id:"cz",name:"CZ",url:"assets/avatars/cz.glb"}];function i(e){return String(e).replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]))}function o(e){return"three.ws"===window.location.hostname?e:e.replace(/^https:\/\/pub-2534e921bf9c4314addcd4d8a6e98b7b\.r2\.dev/,"/r2-proxy")}if(AFRAME.registerSystem("agent-picker",{init:function(){this.agents=r.slice(),this.currentId=null,this.companionEl=null,this.searchQuery="";const e=()=>{this.companionEl=document.querySelector("#agentCompanion"),this.companionEl&&(this.buildOverlay(),this.applyInitialSelection(),this.wireSceneEvents(),this.wirePostMessage(),this.fetchPublicAvatars())};this.sceneEl.hasLoaded?e():this.sceneEl.addEventListener("loaded",e)},fetchPublicAvatars:function(e=""){const t=new URL("https://three.ws/api/explore");t.searchParams.set("only3d","1"),t.searchParams.set("limit","40"),e&&t.searchParams.set("q",e),fetch(t.toString()).then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e.items))return;const t=e.items.filter(e=>e.glbUrl).map(e=>({id:`${e.kind}-${e.agentId||e.name}-${e.sortDate}`,name:e.name||"Untitled",url:o(e.glbUrl),owner:e.ownerShort||""}));this.agents=r.concat(t),this.renderList()}).catch(()=>{})},buildOverlay:function(){if(document.getElementById("agentPicker"))return;const e=document.createElement("div");e.id="agentPicker",e.innerHTML='\n <style>\n #agentPicker {\n position: fixed; top: 12px; right: 12px; z-index: 9999;\n font-family: system-ui, sans-serif; user-select: none;\n transition: opacity 0.3s;\n }\n #agentPicker.playing { opacity: 0; pointer-events: none; }\n #agentPicker .ap-toggle {\n background: rgba(8, 10, 24, 0.85); color: #cfd6ff;\n border: 1px solid rgba(120, 140, 255, 0.4); border-radius: 8px;\n padding: 8px 14px; font-size: 12px; letter-spacing: 0.08em;\n cursor: pointer; backdrop-filter: blur(6px);\n }\n #agentPicker .ap-toggle:hover { background: rgba(40, 50, 100, 0.9); }\n #agentPicker .ap-panel {\n margin-top: 8px; background: rgba(8, 10, 24, 0.92);\n border: 1px solid rgba(120, 140, 255, 0.3); border-radius: 8px;\n padding: 8px; width: 260px; display: none;\n backdrop-filter: blur(6px);\n }\n #agentPicker.open .ap-panel { display: block; }\n #agentPicker .ap-search {\n width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.4);\n color: #cfd6ff; border: 1px solid rgba(120, 140, 255, 0.3);\n border-radius: 6px; padding: 6px 8px; font-size: 12px;\n margin-bottom: 6px; outline: none;\n }\n #agentPicker .ap-list { max-height: 320px; overflow-y: auto; }\n #agentPicker .ap-item {\n display: flex; align-items: center; gap: 10px;\n padding: 8px 10px; border-radius: 6px; cursor: pointer;\n color: #cfd6ff; font-size: 13px;\n }\n #agentPicker .ap-item:hover { background: rgba(80, 100, 200, 0.25); }\n #agentPicker .ap-item.active { background: rgba(80, 100, 200, 0.4); }\n #agentPicker .ap-dot {\n width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;\n background: linear-gradient(135deg, #6699ff, #ff4488);\n }\n #agentPicker .ap-name {\n flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n }\n #agentPicker .ap-owner { color: #6677aa; font-size: 10px; }\n #agentPicker .ap-empty { padding: 10px; color: #6677aa; font-size: 12px; text-align: center; }\n </style>\n <button class="ap-toggle" type="button">AGENT</button>\n <div class="ap-panel">\n <input class="ap-search" type="text" placeholder="Search avatars on three.ws..." />\n <div class="ap-list"></div>\n </div>\n ',document.body.appendChild(e);const t=e.querySelector(".ap-toggle"),n=e.querySelector(".ap-search");let r;t.addEventListener("click",()=>e.classList.toggle("open")),n.addEventListener("input",()=>{clearTimeout(r),this.searchQuery=n.value.trim(),r=setTimeout(()=>this.fetchPublicAvatars(this.searchQuery),300)}),this.overlayEl=e,this.listEl=e.querySelector(".ap-list")},renderList:function(){this.listEl&&(this.listEl.innerHTML="",this.agents.length?this.agents.forEach(e=>{const t=document.createElement("div");t.className="ap-item"+(e.id===this.currentId?" active":""),t.dataset.id=e.id,t.innerHTML=`\n <span class="ap-dot"></span>\n <span class="ap-name">${i(e.name)}</span>\n ${e.owner?`<span class="ap-owner">${i(e.owner)}</span>`:""}\n `,t.addEventListener("click",()=>{this.selectAgent(e.id),this.overlayEl.classList.remove("open")}),this.listEl.appendChild(t)}):this.listEl.innerHTML='<div class="ap-empty">No avatars found.</div>')},applyInitialSelection:function(){const e=new URLSearchParams(window.location.search).get("agent");e&&this.agents.some(t=>t.id===e)?this.selectAgent(e):this.selectAgent(this.agents[0].id),this.renderList()},selectAgent:function(e){let t;"string"==typeof e?t=this.agents.find(t=>t.id===e):e&&e.url&&(t=e,this.agents.some(e=>e.id===t.id)||this.agents.push(t)),t&&this.companionEl&&(this.currentId=t.id,this.companionEl.setAttribute("gltf-model",t.url),this.renderList(),this.sceneEl.emit("agentchanged",{agentId:t.id,url:t.url}))},wireSceneEvents:function(){const e=()=>this.overlayEl&&this.overlayEl.classList.remove("playing");this.sceneEl.addEventListener("songstartfade",()=>this.overlayEl&&this.overlayEl.classList.add("playing")),this.sceneEl.addEventListener("cleargame",e),this.sceneEl.addEventListener("gameover",e),this.sceneEl.addEventListener("songcomplete",e)},wirePostMessage:function(){window.addEventListener("message",e=>{const t=e.data;t&&"rider:setAgent"===t.type&&(t.url?this.selectAgent({id:t.agentId||"external-"+Date.now(),name:t.name||"Agent",url:t.url}):t.agentId&&this.selectAgent(t.agentId))})}}),window.AFRAME){const t=[],n=[],r=["agent-picker"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Vector3,i={right:0,upright:45,up:90,upleft:135,left:180,downleft:225,down:270,downright:315},o={right:new THREE.Vector2(0,1),upright:new THREE.Vector2(-.5,.5),up:new THREE.Vector2(-1,0),upleft:new THREE.Vector2(-.5,-.5),left:new THREE.Vector2(0,-1),downleft:new THREE.Vector2(.5,-.5),down:new THREE.Vector2(1,0),downright:new THREE.Vector2(.5,.5)};function a(e,t){e.x+=(Math.random()-.5)*t,e.y+=(Math.random()-.5)*t,e.z+=(Math.random()-.5)*t}if(AFRAME.registerComponent("beat-cut-fx",{schema:{color:{type:"string"},type:{oneOf:["beat","dot","mine"],default:"beat"}},init:function(){this.breaking=!1,this.fx=null,this.fxpool=null,this.pieces=[],this.pool=null,this.returnToPoolTimer=500,this.el.addEventListener("model-loaded",this.setupModel.bind(this)),this.el.addEventListener("explode",this.explode.bind(this),!1)},update:function(){const e=this.el.sceneEl,t=this.data.color;"beat"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components["pool__beat-broken-"+t],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):"dot"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components[`pool__beat-broken-${t}-dot`],this.poolPunch=e.components[`pool__punch-broken-${t}-dot`],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):(this.material=e.systems.materials.minePieces,this.poolBeat=e.components["pool__beat-broken-mine"],this.poolBeatFx=e.components["pool__beat-fx-mine"],this.poolPunchFx=e.components["pool__punch-fx-mine"])},setupModel:function(e){const t=e.detail.model;this.pieces=t.children;for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.restPosition=t.position.clone(),t.restRotation=t.rotation.clone(),t.posVelocity=new THREE.Vector3,t.rotVelocity=new THREE.Vector3,t.material=this.material}},explode:function(e){const t=e.detail.direction,n=e.detail.gameMode,s=e.detail.correctHit,c=e.detail.position,l=e.detail.rotation;let u=e.detail.beatDirection;if(c&&l&&t&&this.data.color===e.detail.color){if(this.el.object3D.position.copy(c),"classic"===n&&"mine"!==this.data.type){const e="dot"===this.data.type;e&&(u=Math.abs(t.x)>Math.abs(t.y)?"right":"down"),t.z*=.01,r.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t<this.pieces.length;t++){let n=this.pieces[t];if(n.posVelocity.copy(r),n.rotation.z=THREE.Math.degToRad(i[u]),s){let r=t%2==0?-.001:.001;n.posVelocity.x+=o[u].x*r,n.posVelocity.y+=o[u].y*r,!e||t<2?(a(n.posVelocity,.002),a(n.rotVelocity,.004)):(n.posVelocity.copy(this.pieces[t-2].posVelocity),n.rotVelocity.copy(this.pieces[t-2].rotVelocity))}else n.posVelocity.y+=.001,n.rotVelocity.z+=.01}}else for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];s?(t.posVelocity.copy(t.position).normalize().multiplyScalar(.002),t.posVelocity.z=-.004,a(t.posVelocity,.001),a(t.rotVelocity,.01)):(t.posVelocity.y+=.001,t.posVelocity.z-=.001)}this.pool=this["classic"===n?"poolBeat":"poolPunch"],null===this.fx&&(this.fxpool=this["classic"===n?"poolBeatFx":"poolPunchFx"],this.fx=this.fxpool.requestEntity()),this.fx&&(this.fx.play(),this.fx.object3D.position.copy(c),this.fx.object3D.rotation.copy(l),this.fx.emit("explode")),this.returnToPoolTimer=500,this.breaking=!0,this.el.play()}},returnToPool:function(){for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.position.copy(t.restPosition),t.rotation.copy(t.restRotation),t.posVelocity.set(0,0,0),t.rotVelocity.set(0,0,0),t.scale.set(1,1,1)}this.fx&&(this.fxpool.returnEntity(this.fx),this.fx=null),this.pool.returnEntity(this.el),this.breaking=!1},tick:function(e,t){if(this.breaking)if(this.returnToPoolTimer-=t,this.returnToPoolTimer<=0)this.returnToPool();else for(let e=0;e<this.pieces.length;e++){const n=this.pieces[e];n.position.addScaledVector(n.posVelocity,t),n.rotation.set(n.rotation.x+n.rotVelocity.x*t,n.rotation.y+n.rotVelocity.y*t,n.rotation.z+n.rotVelocity.z*t),"mine"!==this.data.type?(this.returnToPoolTimer<250&&n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97),n.posVelocity.y-=3e-6*t):(n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97))}}}),window.AFRAME){const t=["beat-cut-fx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("beat-hit-sound",{directionsToSounds:{up:"",down:"",upleft:"left",upright:"right",downleft:"left",downright:"right",left:"left",right:"right"},init:function(){this.currentBeatEl=null,this.currentCutDirection="",this.processSound=this.processSound.bind(this),this.sourceCreatedCallback.bind(this);for(let e=1;e<=10;e++)this.el.setAttribute("sound__beathit"+e,{poolSize:8,positional:!1,src:"#hitSound"+e,volume:.185}),this.el.setAttribute(`sound__beathit${e}left`,{poolSize:8,positional:!1,src:`#hitSound${e}left`,volume:.185}),this.el.setAttribute(`sound__beathit${e}right`,{poolSize:8,positional:!1,src:`#hitSound${e}right`,volume:.185})},play:function(){for(let e=1;e<=10;e++)this.el.components["sound__beathit"+e].loaded||(this.el.setAttribute("sound__beathit"+e,"src",""),this.el.setAttribute("sound__beathit"+e,"src","#hitSound"+e)),this.el.components[`sound__beathit${e}left`].loaded||(this.el.setAttribute(`sound__beathit${e}left`,"src",""),this.el.setAttribute(`sound__beathit${e}left`,"src",`#hitSound${e}left`)),this.el.components[`sound__beathit${e}right`].loaded||(this.el.setAttribute(`sound__beathit${e}right`,"src",""),this.el.setAttribute(`sound__beathit${e}right`,"src",`#hitSound${e}right`))},playSound:function(e,t,n){const r=1+Math.floor(10*Math.random()),i=this.directionsToSounds[n||"up"];this.el.components[`sound__beathit${r}${i}`].playSound(this.processSound)},processSound:function(e){e.detune=0},sourceCreatedCallback:function(e){const t=this.getLayer(this.currentBeatEl.object3D.position.y);"bottom"===t?e.detune.setValueAtTime(-400,0):"top"===t&&e.detune.setValueAtTime(200,0),"down"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(-400,1),"up"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(400,1)},getLayer:function(e){return 1===e?"bottom":1.7===e?"top":"middle"}}),window.AFRAME){const t=["beat-hit-sound"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("blade",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.data;this.bladeHandle=e.querySelector(".bladeHandleHelper").object3D,this.bladeTip=e.querySelector(".bladeTipHelper").object3D,this.rigEl=document.getElementById("curveFollowRig"),this.strokeDirectionVector=new THREE.Vector3,this.strokeSpeed=0,this.bladeBottomPosition=new THREE.Vector3,this.bladeTipPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeWorldPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeEl=this.el.querySelector(".blade")},update:function(e){!e.enabled&&this.data.enabled&&this.bladeEl.emit("drawblade")},tickBeatSystem:function(e,t){this.data.enabled&&this.updateVelocity(t)},updateVelocity:function(e){const t=this.bladeTipPositions,n=this.bladeWorldPositions;this.data;n[2].copy(n[0]),n[3].copy(n[1]),this.bladeTip.getWorldPosition(n[0]),this.bladeHandle.getWorldPosition(n[1]),t[2].copy(n[0]),this.rigEl.object3D.worldToLocal(t[2]),this.strokeDirectionVector.copy(t[2]).sub(t[0]);const r=this.strokeDirectionVector.length();this.strokeSpeed=r/(e/1e3),this.strokeDirectionVector.z=0,this.strokeDirectionVector.normalize();const i=t.shift();t.push(i)},checkCollision:function(){const e=new THREE.Box3,t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],n=new THREE.Triangle;return function(r){if(this.strokeSpeed<1)return!1;for(let e=0;e<3;e++)t[e].copy(this.bladeWorldPositions[e]),r.blockEl.object3D.worldToLocal(t[e]),t[e].multiplyScalar(1.75);return n.set(t[0],t[1],t[2]),e.copy(r.bbox),e.expandByScalar(.02),"left"!==r.horizontalPosition&&"right"!==r.horizontalPosition||e.expandByScalar(.07),!!e.intersectsTriangle(n)||(t[3].copy(this.bladeWorldPositions[3]),r.blockEl.object3D.worldToLocal(t[3]),n.set(t[2],t[3],t[0]),!!e.intersectsTriangle(n))}}(),createDebugCube:function(e,t){const n=new THREE.BoxGeometry(.05,.05,.05),r=new THREE.Mesh(n,new THREE.MeshBasicMaterial({color:t,side:THREE.DoubleSide}));r.position.copy(e),this.el.sceneEl.object3D.add(r)}}),window.AFRAME){const t=["blade"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerSystem("check-vr",{init:function(){AFRAME.utils.device.isMobile()&&(document.getElementById("vrButton").style.display="none"),setTimeout(()=>{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],n=[],r=["check-vr"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("console-shortcuts",{play:function(){window.$=e=>document.querySelector(e),window.$$=e=>document.querySelectorAll(e),window.$$$=e=>document.querySelector(`[${e}]`).getAttribute(e),window.$$$$=e=>document.querySelector(`[${e}]`).components[e],window.scene=this.el,window.state=this.el.systems.state.state}}),window.AFRAME){const t=["console-shortcuts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("controller",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){const e=this.el,t=this.data;this.controllerType="",e.addEventListener("controllerconnected",e=>{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const n={hand:t.hand,model:!1};e.setAttribute("daydream-controls",n),e.setAttribute("oculus-go-controls",n),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",n),e.setAttribute("vive-focus-controls",n),e.setAttribute("windows-motion-controls",n),e.setAttribute("generic-tracked-controller-controls",n)},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown"],upEvents:["triggerup","gripup","abuttonup","bbuttonup","xbuttonup","ybuttonup"]}},"vive-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"windows-motion-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}}),window.AFRAME){const t=["controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("copy-texture",{dependencies:["geometry","material"],schema:{from:{type:"selector"}},init:function(){this.data.from.addEventListener("materialtextureloaded",()=>{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,n=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(n.map=t.getObject3D("mesh").material.map,n.map&&(n.map.needsUpdate=!0,n.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-laser",{dependencies:["geometry"],schema:{enabled:{default:!0}},init:function(){const e=this.el;this.weaponEl=this.el.closest(".weapon");const t=this.el.getAttribute("geometry");e.object3D.position.z=-1*t.height/2,this.originalSize=t.height,this.currentLength=t.height},update:function(){this.el.object3D.visible=this.data.enabled},tick:function(){const e=this.el;if(!this.data.enabled)return;const t=this.weaponEl.components.cursor;if(!t)return;if(!t.intersectedEl)return e.object3D.position.z=-24.98,e.object3D.scale.x=.75,e.getObject3D("mesh").scale.y=50,void(this.currentLength=1);const n=this.weaponEl.components.raycaster.intersections[0];n&&(e.object3D.scale.x=1,e.object3D.position.z=-n.distance/2,e.getObject3D("mesh").scale.y=this.currentLength=n.distance)}}),window.AFRAME){const t=["cursor-laser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-mesh",{schema:{active:{default:!0},cursorEl:{type:"selector"}},init:function(){this.scenePivotEl=document.getElementById("scenePivot")},update:function(){this.el.object3D.visible=this.data.active},tick:function(){var e,t,n=this.data.cursorEl,r=this.el,i=this.scenePivotEl;this.data.active&&n.components.cursor&&((t=n.components.cursor.intersectedEl)?(r.object3D.visible=!0,(e=n.components.raycaster.getIntersection(t))&&(r.object3D.position.copy(e.point),i&&r.object3D.rotation.copy(i.object3D.rotation))):r.object3D.visible=!1)}}),window.AFRAME){const t=["cursor-mesh"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("curve-follow-rig-reset",{schema:{isVictory:{type:"string"}},init:function(){this.el.sceneEl.addEventListener("cleargame",()=>{this.reset()})},update:function(e){const t=this.data;this.el;!e.isVictory&&t.isVictory&&this.reset()},reset:function(){this.el.components["supercurve-follow"].curveProgress=0,this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0)}}),window.AFRAME){const t=["curve-follow-rig-reset"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("cutfxShader",{schema:{src:{type:"map",is:"uniform",default:"#cutfxImg"},color:{type:"color",is:"uniform",default:"#fff"},progress:{type:"number",is:"uniform"},transparent:{default:!0},blending:{default:"additive"},side:{default:"double"},depthTest:{default:!1},depthWrite:{default:!1}},vertexShader:n(74),fragmentShader:n(75)}),window.AFRAME){const t=[],n=["cutfxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float progress;\n\nvoid main() {\n vec3 col = color;\n float alpha = smoothstep(progress, 1.0, texture2D(src, uvs).a);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("debug-beat-generator",{dependencies:["beat-generator"],schema:{beatEnabled:{default:!1},stageEnabled:{default:!1}},init:function(){this.beatLoader=this.el.components["beat-generator"],this.selectedBeat={color:"red",position:"middleCenterLeft",type:"arrow",orientation:"up"},this.beats={},this.onKeyDown=this.onKeyDown.bind(this),(this.data.stageEnabled||AFRAME.utils.getUrlParameter("debugstage"))&&this.addDebugStageControls(),(this.data.beatEnabled||"gameplay"===AFRAME.utils.getUrlParameter("debugstate").trim())&&(window.addEventListener("keydown",this.onKeyDown),this.addDebugBeatControls())},spawn:function(){var e=this;Object.keys(this.beats).forEach((function(t){e.generateBeat(e.beats[t])}))},generateBeat:function(e){var t;"wall"!==e.type?(t="mine"===e.type?3:"red"===e.color?0:1,this.beatLoader.generateBeat({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_lineLayer:this.beatLoader.positionHumanized[e.position].layer,_cutDirection:"dot"===e.type?8:this.beatLoader.orientationsHumanized.indexOf(e.orientation),_type:t})):this.generateWall(e)},generateWall:function(e){this.beatLoader.bpm=90,this.beatLoader.generateWall({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_width:1,_duration:3})},onKeyDown:function(e){switch(e.keyCode){case 32:this.spawn()}},addDebugBeatControls:function(){const e=document.createElement("div"),t=this;var n;function r(t){const n=document.createElement("div");return n.id=t,n.style.marginBottom="20px",n.style.width="500px",n.style.display="inline-block",e.appendChild(n),n}function i(e,n,r){const i=document.createElement("div"),o=r||function(){const e=i.parentElement.querySelectorAll(".button");for(let t=0;t<e.length;t++)e[t].style.background="#000";i.style.background="#66f",t.selectedBeat[i.parentElement.id]=this.id,t["selected"+i.parentElement.id.charAt(0).toUpperCase()+i.parentElement.id.slice(1)+"El"]=this};return i.classList.add("button"),i.id=e,i.style.width="100px",i.style.height="30px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.margin="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.lineHeight="30px",i.style.cursor="pointer",i.style.display="inline-block",i.innerHTML=e,n.appendChild(i),i.addEventListener("click",o),i}e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.padding="10px",e.style.width="500px",e.style.height="600px",document.body.appendChild(e),function(){const t=r("type");i("arrow",t),i("dot",t),i("mine",t),i("wall",t),e.appendChild(t)}(),function(){const t=r("color");i("blue",t),i("red",t),e.appendChild(t)}(),function(){const t=r("orientation");i("top",t),i("left",t),i("right",t),i("down",t),e.appendChild(t)}(),(n=i("Set Beat",e,(function(){var e="mine"!==t.selectedBeat.type?" "+t.selectedBeat.color:"",n="arrow"!==t.selectedBeat.type?"":" "+t.selectedBeat.orientation;t.selectedBeat={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color},t.selectedPositionEl&&(t.selectedPositionEl.innerHTML=t.selectedBeat.type+e+n,t.beats[t.selectedPositionEl.id]={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color})}))).style.width="460px",n.style.bottomMargin="10px",function(){const e=r("position");i("topLeft",e),i("topCenterLeft",e),i("topCenterRight",e),i("topRight",e),i("middleLeft",e),i("middleCenterLeft",e),i("middleCenterRight",e),i("middleRight",e),i("bottomLeft",e),i("bottomCenterLeft",e),i("bottomCenterRight",e),i("bottomRight",e)}(),function(n,r){const o=i("Spawn (Space Bar)",e,()=>{t.spawn()});o.style.width="460px",o.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,n,r)=>{const i=document.createElement("div");i.style.position="absolute",i.id="stagecontrol"+t,i.style.width="100px",i.style.height="30px",i.style.top="element"===r?"20px":"70px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.cursor="pointer",i.style.left=20+120*t+"px",i.innerHTML=n,"element"===r?i.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",i.style.background="#66f",e=t}):i.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(i)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,n)=>{t(n,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,n)=>{t(n,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["left","middleleft","middleright","right"],i=["bottom","middle","top"];if(AFRAME.registerComponent("debug-beat-positioning",{play:function(){let e=AFRAME.utils.getUrlParameter("debugbeatpositioning");e&&("punch"!==e&&"classic"!==e&&(e="classic"),this.el.emit("debugbeatpositioning"),setTimeout(()=>{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),r.forEach(n=>{i.forEach(r=>{let i=t.requestBeat("punch"===e?"dot":"arrow","red"),o=Math.random()<.5?"left":"right";i.components.beat.onGenerate(.001,n,r,o),i.object3D.renderOrder=9999,i.play(),i=t.requestBeat("dot","blue"),o=Math.random()<.5?"down":"up",i.components.beat.onGenerate(.0015,n,r,o),i.object3D.renderOrder=9999,i.play()})});const n=scene.components.pool__wall.requestEntity();n.components.wall.onGenerate(.0015,"left",4,4,!0),n.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-controller",{init:function(){var e,t;AFRAME.utils.getUrlParameter("debug")&&(console.log("%c debug-controller enabled ","background: #111; color: red"),e=document.getElementById("rightHand"),t=document.getElementById("leftHand"),e.setAttribute("tracked-controls","autoHide",!1),e.object3D.visible=!0,t.object3D.visible=!0,t.setAttribute("tracked-controls","autoHide",!1),AFRAME.utils.getUrlParameter("headfist")||(window.addEventListener("click",t=>{t.isTrusted&&(e.emit("triggerdown"),e.emit("triggerup"))}),"oculus"===AFRAME.utils.getUrlParameter("debug")?(e.emit("controllerconnected",{name:"oculus-touch-controls"}),t.emit("controllerconnected",{name:"oculus-touch-controls"}),e.setAttribute("controller","controllerType","oculus-touch-controls"),t.setAttribute("controller","controllerType","oculus-touch-controls")):(e.emit("controllerconnected",{name:"vive-controls"}),t.emit("controllerconnected",{name:"vive-controls"}),e.setAttribute("controller","controllerType","vive-controls"),t.setAttribute("controller","controllerType","vive-controls")),this.el.emit("enter-vr",null,!1),document.addEventListener("keydown",n=>{var r,i,o,a;n.shiftKey&&(32!==n.keyCode?81!==n.keyCode?(78===n.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===n.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===n.keyCode&&t.emit("menudown"),n.ctrlKey?(o=t.getAttribute("position"),72===n.keyCode&&(o.x-=.02),74===n.keyCode&&(o.y-=.02),75===n.keyCode&&(o.y+=.02),76===n.keyCode&&(o.x+=.02),59!==n.keyCode&&186!==n.keyCode||(o.z-=.01),222===n.keyCode&&(o.z+=.01),t.setAttribute("position",AFRAME.utils.clone(o))):(r=e.getAttribute("position"),72===n.keyCode&&(r.x-=.02),74===n.keyCode&&(r.y-=.02),75===n.keyCode&&(r.y+=.02),76===n.keyCode&&(r.x+=.02),59!==n.keyCode&&186!==n.keyCode||(r.z-=.02),222===n.keyCode&&(r.z+=.02),e.setAttribute("position",AFRAME.utils.clone(r))),n.ctrlKey?(a=t.getAttribute("rotation"),89===n.keyCode&&(a.x-=10),79===n.keyCode&&(a.x+=10),85===n.keyCode&&(a.y-=10),73===n.keyCode&&(a.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(a))):(i=e.getAttribute("rotation"),89===n.keyCode&&(i.x-=10),79===n.keyCode&&(i.x+=10),85===n.keyCode&&(i.y-=10),73===n.keyCode&&(i.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(i)))):this.isSecondaryTriggerDown?(t.emit("triggerup"),this.isSecondaryTriggerDown=!1):(t.emit("triggerdown"),this.isSecondaryTriggerDown=!0):this.isTriggerDown?(e.emit("triggerup"),this.isTriggerDown=!1):(e.emit("triggerdown"),this.isTriggerDown=!0))})))},play:function(){var e,t;if(this.bounds=document.body.getBoundingClientRect(),!AFRAME.utils.getUrlParameter("debug"))return;if(AFRAME.utils.getUrlParameter("headfist"))return;e=document.getElementById("rightHand"),(t=document.getElementById("leftHand")).object3D.position.set(-.2,1.5,-.5),e.object3D.position.set(.2,1.5,-.5),t.setAttribute("rotation",{x:35,y:0,z:0});const n=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===n?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===n?(e.querySelector(".punch").removeAttribute("bind__visible"),e.querySelector(".punch").object3D.visible=!0,e.querySelector(".punch").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1):"ride"===n&&(e.querySelector(".handStar").removeAttribute("bind__visible"),e.querySelector(".handStar").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1)})},onMouseMove:function(){const e=new THREE.Vector3,t=new THREE.Vector2,n=new THREE.Vector3;return function(r){const i=this.bounds,o=this.el.sceneEl.camera,a=r.clientX-i.left,s=r.clientY-i.top;t.x=a/i.width*2-1,t.y=-s/i.height*2-1,document.getElementById("camera").object3D.getWorldPosition(n),e.set(t.x,t.y,.5).unproject(o).sub(n).normalize();const c=document.getElementById("rightHand").object3D.position,l=-n.z/e.z;o.getWorldPosition(c).add(e.multiplyScalar(l)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-cursor",{init:function(){},log:function(e,t,n){t.id?console.log(`%c[${e}] ${t.id}`,"color: "+n):(console.log(`%c[${e}]`,"color: "+n),console.log(t))}}),window.AFRAME){const t=["debug-cursor"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=AFRAME.utils.getUrlParameter("skipintro");if(AFRAME.registerComponent("debug-intro",{play:function(){r&&document.getElementById("startButton").emit("click")}}),window.AFRAME){const t=["debug-intro"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-song-time",{dependencies:["song"],init:function(){AFRAME.utils.getUrlParameter("debug-song-time")&&setInterval(()=>{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-state",{play:function(){const e=AFRAME.utils.getUrlParameter("debugstate").trim();e&&setTimeout(()=>{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("delayed-proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1},delay:{default:0,type:"int"}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,o=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){setTimeout(()=>{var r=o.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)},r.delay)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(r){setTimeout(()=>{var t=n.data;t.enabled&&(t.captureBubbles||r.target===e)&&n.el.emit(t.as||t.event,r.detail?r.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=.6,i=.5;if(AFRAME.registerComponent("desktop-input",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){this.target=new THREE.Vector3("right"===this.data.hand?.25:-.25,1.4,0),this.lungeUntil=0,this.hasController=!1,this.el.addEventListener("controllerconnected",()=>{this.hasController=!0}),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onContextMenu=e=>e.preventDefault(),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mousedown",this.onMouseDown),window.addEventListener("contextmenu",this.onContextMenu)},remove:function(){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("contextmenu",this.onContextMenu)},onMouseMove:function(e){const t=e.clientX/window.innerWidth*2-1,n=e.clientY/window.innerHeight*2-1;this.target.x=("right"===this.data.hand?.25:-.25)+t*r,this.target.y=1.4-n*i},onMouseDown:function(e){const t="right"===this.data.hand,n=2===e.button||e.shiftKey;t&&n||(t||n)&&(this.lungeUntil=performance.now()+140,this.el.emit("triggerdown",null,!1),setTimeout(()=>this.el.emit("triggerup",null,!1),140))},tick:function(){if(this.hasController)return;const e=this.el.object3D,t=performance.now()<this.lungeUntil;e.position.x+=.35*(this.target.x-e.position.x),e.position.y+=.35*(this.target.y-e.position.y);const n=t?-.6:this.target.z;e.position.z+=.5*(n-e.position.z)}}),window.AFRAME){const t=["desktop-input"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-background",{schema:{enabled:{type:!1}},update:function(){this.data.enabled?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable")}}),window.AFRAME){const t=["difficulty-background"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-filter",{events:{click:function(e){this.el.sceneEl.emit("difficultyfilter",e.target.parentNode.dataset.difficultyFilter)}}}),window.AFRAME){const t=["difficulty-filter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-text",{schema:{id:{value:"Standard-Easy"}},update:function(){this.el.setAttribute("text","value",this.data.id.replace("Standard-","").replace("-","\n"))}}),window.AFRAME){const t=["difficulty-text"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-position",{schema:{target:{type:"selector"}},tick:function(){this.el.object3D.position.copy(this.data.target.object3D.position)}}),window.AFRAME){const t=["follow-position"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-z",{schema:{offset:{type:"vec3"},target:{type:"selector"}},tick:function(){this.data.target&&(this.el.object3D.position.copy(this.data.offset),this.el.object3D.position.z+=this.data.target.object3D.position.z)}}),window.AFRAME){const t=["follow-z"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("gameover",{schema:{isGameOver:{default:!1}},init:function(){this.beatContainer=document.getElementById("beatContainer"),this.gameOverEls=document.querySelectorAll("[animation__gameover]")},update:function(e){this.data;!e.isGameOver&&this.data.isGameOver&&(this.triggerAnimations(),this.countDown=1),e.isGameOver&&!this.data.isGameOver&&this.reset()},tick:function(e,t){this.data.isGameOver&&this.countDown>=0&&(this.beatContainer.object3D.position.z=1.5*-Math.pow(1-this.countDown,2),this.countDown-=t/1e3)},reset:function(){this.beatContainer.object3D.position.z=0,this.el.sceneEl.setAttribute("stage-colors","color","blue")},triggerAnimations:function(){for(let e=0;e<this.gameOverEls.length;e++)this.gameOverEls[e].emit("gameover",null,!1);this.el.emit("textglowoff",null,!1),this.el.emit("bgcolorgameover",null,!1)}}),window.AFRAME){const t=["gameover"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){let r=0;if(AFRAME.registerComponent("gpu-preloader",{dependencies:["materials"],play:function(){setTimeout(()=>{this.preloadFromSelector("#mainLogo"),this.preloadFromSelector("#prevArrow"),this.preloadFromSelector("#stepback"),this.preloadFromSelector(".difficultyBackground"),this.preloadFromSelector(".genreIcon"),this.preloadFromSelector(".merkababloom"),this.preloadFromSelector(".searchResultBackground"),this.preloadMaterialsComponentTextures(),this.preloadKeyboard(),this.preloadSlice(),this.preloadEnvMap(),this.preloadFXs()},1e3)},preloadFromSelector:function(e){const t=document.querySelector(e);this.preloadTexture(t.getObject3D("mesh").material.map)},preloadMaterialsComponentTextures:function(){const e=this.el.systems.materials.textureList;for(var t=0;t<e.length;t++)this.preloadTexture(e[t])},preloadKeyboard:function(){const e=document.getElementById("keyboard").components["super-keyboard"];this.preloadTexture(e.kbImg.getObject3D("mesh").material.map),this.preloadTexture(e.keyColorPlane.getObject3D("mesh").material.map)},preloadSlice:function(){const e=document.getElementById("searchPrevPage");this.preloadTexture(e.components.slice9.material.map)},preloadEnvMap:function(){const e=document.querySelector("#wallContainer [wall]");this.preloadTexture(e.components.material.material.uniforms.environment.value)},preloadFXs:function(){const e=document.querySelector("#rigContainer [mixin~=blueBeatFX]");this.preloadTexture(e.components.material.material.uniforms.src.value);const t=document.querySelector("#rigContainer [mixin~=mineFX]");this.preloadTexture(t.components.material.material.map)},preloadTexture:function(e){e&&e.image?e.image.complete?this.el.renderer.setTexture2D(e,r++%8):console.warn("[gpu-preloader] Error preloading, image not loaded",e):console.warn("[gpu-preloader] Error preloading texture",e)}}),window.AFRAME){const t=["gpu-preloader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("gradientShader",{schema:{color1:{type:"color",is:"uniform"},color2:{type:"color",is:"uniform"}},vertexShader:n(17),fragmentShader:n(93)}),window.AFRAME){const t=[],n=["gradientShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nuniform vec3 color1;\nuniform vec3 color2;\n\nvoid main () {\n float mixDistance = distance(uvs, vec2(0.5, 0));\n float alphaDistance = min(1., (0.5 - distance(uvs, vec2(0.5))) * 2.5);\n gl_FragColor = vec4(mix(color1, color2, pow(mixDistance, 2.4)), alphaDistance);\n}\n"},function(e,t,n){const r=["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown","trackpaddown"];if(AFRAME.registerComponent("hand-swapper",{schema:{enabled:{default:!1}},init:function(){this.swapHand=this.swapHand.bind(this),r.forEach(e=>{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("handStar",{schema:{colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},colorTertiary:{type:"color",is:"uniform",default:i.a.initial.tertiary},pulse:{type:"number",is:"uniform",default:0},transparent:{default:!0},side:{default:"back"},depthTest:{default:!1}},vertexShader:n(96),fragmentShader:n(97)}),window.AFRAME){const t=[],n=["handStar"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\n\nvoid main() {\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vec3 worldNormal = normalize(mat3(modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz) * normal);\n vec3 viewVector = normalize(vWorldPosition - cameraPosition);\n fresnel = 0.08 * pow(0.4 + dot(viewVector, worldNormal), 6.0 + pulse);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += (fresnel * pulse) * 0.1;\n gl_FragColor = vec4 (col, clamp(fresnel, 0.0, 1.0));\n}\n"},function(e,t,n){if(AFRAME.registerComponent("haptics-wall",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isHittingWall=!1,e.setAttribute("haptics__wall",{dur:50,force:.15}),this.checkIfHittingWall=this.checkIfHittingWall.bind(this),e.addEventListener("mouseenter",this.checkIfHittingWall),e.addEventListener("mouseleave",this.checkIfHittingWall),this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),50)},checkIfHittingWall:function(){const e=this.el.components.raycaster__game.intersectedEls;this.isHittingWall=!1;for(let t=0;t<e.length;t++)if(e[t].components.wall)return void(this.isHittingWall=!0)},tick:function(){this.data.enabled&&this.isHittingWall&&this.el.components.haptics__wall.pulse()}}),window.AFRAME){const t=["haptics-wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("haptics-weapons",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isColliding=!1,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),100),e.setAttribute("haptics__weapon",{dur:100,force:.075}),e.addEventListener("mouseenter",t=>{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const n=t.detail.intersectedEl;n.classList.contains("blade")&&n!==e?(this.isColliding=!0,this.el.components.haptics__weapon.pulse()):this.isColliding=!1}),e.addEventListener("mouseleave",e=>{this.isColliding=!1})},tick:function(){this.isColliding&&this.data.enabled&&this.el.components.haptics__weapon.pulse()}}),window.AFRAME){const t=["haptics-weapons"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=!!AFRAME.utils.getUrlParameter("headfist");if(AFRAME.registerComponent("headfist",{schema:{hand:{type:"string"},isPlaying:{default:!1}},init:function(){console.log("[headfist] "+r),r&&(this.camera=document.getElementById("camera").object3D,this.originalParent=this.el.object3D.parent)},update:function(){const e=this.el;if(r&&this.camera)return this.data.isPlaying?(this.camera.add(e.object3D),e.object3D.rotation.set(-5,0,0),e.object3D.position.set("right"===this.data.hand?.175:-.175,.15,-.2),e.components["tracked-controls"].pause(),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].pause(),void(e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].pause())):void(e.object3D.parent!==this.originalParent&&(console.log("[headfist] Detach."),this.originalParent.add(e.object3D),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].play(),e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].play()))}}),window.AFRAME){const t=["headfist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("history",{schema:{challengeId:{type:"string"},songName:{type:"string"},songSubName:{type:"string"}},update:function(){const e=this.data;history.pushState("",e.songName,updateQueryParam(window.location.href,"challenge",e.challengeId)),document.title="Super Saber - "+e.songName}}),window.AFRAME){const t=["history"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("intro-song",{schema:{isPlaying:{default:!0},isSearching:{default:!1}},init:function(){this.analyserEl=document.getElementById("audioAnalyser"),this.audio=document.getElementById("introSong"),this.timeout=null},update:function(e){const t=this.audio;this.el.sceneEl.isPlaying&&(!e.isSearching&&this.data.isSearching||(!e.isPlaying&&this.data.isPlaying&&(this.analyserEl.components.audioanalyser.resumeContext(),this.analyserEl.setAttribute("audioanalyser","src",t),this.fadeInAudio()),e.isPlaying&&!this.data.isPlaying&&t.pause()))},pause:function(){this.audio.pause()},play:function(){this.fadeInAudio()},fadeInAudio:function(){if(AFRAME.utils.getUrlParameter("mute"))return;const e=this.analyserEl.components.audioanalyser.context,t=this.analyserEl.components.audioanalyser.gainNode;t.gain.setValueAtTime(0,e.currentTime),this.audio.play(),t.gain.linearRampToValueAtTime(.5,e.currentTime+.5)}}),window.AFRAME){const t=["intro-song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("keyboard-raycastable",{dependencies:["super-keyboard"],schema:{condition:{default:""}},play:function(){this.el.components["super-keyboard"].kbImg.setAttribute("bind-toggle__raycastable",this.data.condition)}}),window.AFRAME){const t=["keyboard-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(25),i=n(105);n(107);const o=/(fuc)|(ass)|(nig)|(shit)|(retard)/gi;if(AFRAME.registerComponent("leaderboard",{schema:{challengeId:{default:""},difficulty:{default:""},beatmapCharacteristic:{default:""},inVR:{default:!1},gameMode:{type:"string"},menuSelectedChallengeId:{default:""},isVictory:{default:!1}},init:function(){this.qualifyingIndex=void 0,this.scores=[],this.eventDetail={scores:this.scores},this.addEventDetail={scoreData:void 0,index:void 0},this.username=localStorage.getItem("threewsusername")||"Super Zealot",this.el.addEventListener("leaderboardusername",e=>{this.username=e.detail.value,localStorage.setItem("threewsusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this)),this.initFirebase()},initFirebase:async function(){try{const e=await fetch("/api/rider/firebase"),t=await e.json();t.apiKey&&!r.apps.length&&(r.initializeApp(t),this.firestore=r.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores"))}catch(e){console.error("Error fetching Firebase config",e)}},update:function(e){!r.apps.length&&this.data.apiKey&&(r.initializeApp({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.firestore=r.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores")),!e.isVictory&&this.data.isVictory&&this.checkLeaderboardQualify(),this.data.difficulty&&e.difficulty!==this.data.difficulty||this.data.menuSelectedChallengeId&&e.menuSelectedChallengeId!==this.data.menuSelectedChallengeId?this.fetchScores(this.data.menuSelectedChallengeId):this.data.challengeId&&e.challengeId!==this.data.challengeId&&this.fetchScores(this.data.challengeId)},addScore:function(){const e=this.el.sceneEl.systems.state.state;if(!e.isVictory||!e.inVR)return;const t={accuracy:e.score.accuracy,challengeId:e.challenge.id,gameMode:this.data.gameMode,score:e.score.score,username:this.username,difficulty:this.data.difficulty||e.challenge.difficulty,time:new Date};i.includes(this.username.toLowerCase())||this.username.match(o)||this.db.add(t),this.addEventDetail.scoreData=t,this.el.emit("leaderboardscoreadded",this.addEventDetail,!1)},fetchScores:function(e){if("ride"===this.data.gameMode)return;const t=this.el.sceneEl.systems.state.state;this.db.where("challengeId","==",e).where("difficulty","==",t.menuSelectedChallenge.id?t.menuSelectedChallenge.difficulty:t.challenge.difficulty).where("gameMode","==",this.data.gameMode).orderBy("score","desc").orderBy("time","asc").limit(10).get().then(t=>{this.eventDetail.challengeId=e,this.scores.length=0,t.empty||t.forEach(e=>this.scores.push(e.data())),this.el.sceneEl.emit("leaderboard",this.eventDetail,!1)}).catch(e=>{console.error("[firestore]",e)})},checkLeaderboardQualify:function(){const e=this.el.sceneEl.systems.state.state.score.score;if(!AFRAME.utils.getUrlParameter("dot")){if(this.scores.length<10)return this.qualifyingIndex=this.scores.length,void this.el.sceneEl.emit("leaderboardqualify",this.scores.length,!1);for(let t=0;t<this.scores.length;t++)if(e>this.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){e.exports=n(106)},function(e){e.exports=JSON.parse('["2 girls 1 cup","2g1c","4r5e","5h1t","5hit","5ht","666","@$$","a s s","a s shole","a55","a55hole","a_s_s","abbo","abeed","abuse","acrotomophilia","addicts","aeolus","africoon","ahole","alabama hot pocket","alaskan pipeline","alligator bait","alligatorbait","amcik","anal","analannie","analprobe","analsex","andskota","anilingus","anus","apeshit","ar5e","arabush","arabushs","areola","areole","argie","arian","armo","armos","aroused","arrse","arschloch","arse","arsehole","aryan","ash0le","ash0les","asholes","ass monkey","ass","ass-fucker","ass-hat","ass-pirate","assbag","assbagger","assbandit","assbang","assbanged","assbanger","assbangs","assbite","assblaster","assclown","asscock","asscowboy","asscracker","asses","assface","assfuck","assfucker","assfukka","assgoblin","assh0le","assh0lez","asshat","asshead","assho1e","asshole","assholes","assholz","asshopper","asshore","assjacker","assjockey","asskiss","asskisser","assklown","asslick","asslicker","asslover","assman","assmaster","assmonkey","assmunch","assmuncher","assnigger","asspacker","asspirate","asspuppies","assrammer","assranger","assshit","assshole","asssucker","asswad","asswhole","asswhore","asswipe","asswipes","auto erotic","autoerotic","ayir","azazel","azz","azzhole","b a s t a r d","b i t c h","b o o b","b!+ch","b!tch","b!tchin","b*tch","b00b","b00bies","b00biez","b00bs","b00bz","b17ch","b1tch","b7ch","babeland","babes","baby batter","baby juice","backdoor","backdoorman","badfuck","bagging","ball gag","ball gravy","ball kicking","ball licking","ball sack","ball sucking","ballbag","balllicker","ballsack","bampot","bangbro","bangbros","banger","banging","bareback","barely legal","barelylegal","barenaked","barf","barface","barfface","bassterd","bassterds","bastard","bastardo","bastards","bastardz","basterds","basterdz","bastinado","bawdy","bazongas","bazooms","bbw","bdsm","beaner","beaners","beaney","beaneys","beardedclam","beastality","beastial","beastiality","beastility","beatch","beatoff","beatyourmeat","beaver cleaver","beaver lips","beaver","beeyotch","bellend","beotch","bestial","bestiality","bi curious","bi+ch","bi7ch","biatch","bicurious","big black","big breasts","big knockers","big tits","bigass","bigbastard","bigbreasts","bigbutt","bigtits","bimbo","bimbos","bint","birdlock","bitch","bitchass","bitched","bitcher","bitchers","bitches","bitchez","bitchin","bitching","bitchslap","bitchtit","bitchy","biteme","black cock","blackcock","blackman","blackout","blacks","blonde action","blonde on blonde action","blonde on blonde","bloody","blow j","blow job","blow your l","blow your load","blowjob","blowjobs","blue waffle","bluegum","bluegums","blumpkin","bo ob","bo obs","boang","boche","boches","bodily","boffing","bogan","bohunk","boink","boiolas","bollick","bollock","bollocks","bollok","bollox","bombers","bombing","bomd","bondage","boned","boner","boners","bong","boob","boobies","boobs","booby","boobz","boody","booger","bookie","boong","boonga","boongas","boongs","boonie","boonies","booobs","boooobs","booooobs","booooooobs","bootee","bootlip","bootlips","booty call","booty","bootycall","boozer","boozy","bosch","bosche","bosches","boschs","bosomy","bounty bar","bounty bars","bountybar","brea5t","breastjob","breastlover","breastman","brothel","brown showers","brunette action","btch","buceta","buddhahead","buddhaheads","buffies","bugger","buggered","buggery","bukkake","bule","bules","bullcrap","bulldike","bulldyke","bullet vibe","bullshit","bullshits","bullshitted","bullturds","bumblefuck","bumfuck","bung hole","bung","bunga","bungas","bunghole","bunny fucker","burr head","burr heads","burrhead","burrheads","butchbabes","butchdike","butchdyke","butt plug","butt-pirate","buttbang","buttcheeks","buttface","buttfuck","buttfucker","buttfuckers","butthead","butthole","buttman","buttmuch","buttmunch","buttmuncher","buttons","buttpirate","buttplug","buttstain","buttwipe","byatch","c u n t","c-0-c-k","c-o-c-k","c-u-n-t","c.0.c.k","c.o.c.k.","c.u.n.t","c0ck","c0cks","c0cksucker","c0k","cabron","caca","cacker","cahone","camel jockey","camel jockeys","camel toe","cameljockey","cameltoe","camgirl","camslut","camwhore","carpet muncher","carpetmuncher","carruth","cawk","cawks","cazzo","cervix","chav","cheese eating surrender monkey","cheese eating surrender monkies","cheeseeating surrender monkey","cheeseeating surrender monkies","cheesehead","cheeseheads","cherrypopper","chickslick","china swede","china swedes","chinaman","chinamen","chinaswede","chinaswedes","chinc","chincs","ching chong","ching chongs","chinga","chingchong","chingchongs","chink","chinks","chinky","choad","chocolate rosebuds","chode","chodes","chonkies","chonky","chonkys","chraa","christ killer","christ killers","chug","chugs","chuj","chunger","chungers","chunkies","chunkys","chute","cipa","circlejerk","cl1t","clamdigger","clamdiver","clamps","clansman","clansmen","clanswoman","clanswomen","cleveland steamer","climax","clit","clitface","clitfuck","clitoris","clitorus","clits","clitty","clogwog","clover clamps","clusterfuck","cnts","cntz","cnut","cocain","cocaine","cock","cock-head","cock-sucker","cockbite","cockblock","cockblocker","cockburger","cockcowboy","cockface","cockfight","cockfucker","cockhead","cockholster","cockknob","cockknocker","cocklicker","cocklover","cockmonkey","cockmunch","cockmuncher","cocknob","cocknose","cocknugget","cockqueen","cockrider","cocks","cockshit","cocksman","cocksmith","cocksmoker","cocksucer","cocksuck","cocksucked","cocksucker","cocksucking","cocksucks","cocksuka","cocksukka","cocktease","cocky","cohee","coital","coitus","cok","cokmuncher","coksucka","commie","condom","coochie","coochy","coolie","coolies","cooly","coon ass","coon asses","coon","coonass","coonasses","coondog","coons","cooter","coprolagnia","coprophilia","copulate","corksucker","cornhole","cowgirl","cox","cra5h","crabs","crackcocain","cracker","crackpipe","crackwhore","crap","crapola","crapper","crappy","crash","creampie","crotch","crotchjockey","crotchmonkey","crotchrot","cum","cumbubble","cumdumpster","cumfest","cumjockey","cumm","cummer","cummin","cumming","cumquat","cumqueen","cums","cumshot","cumshots","cumslut","cumstain","cumtart","cunilingus","cunillingus","cunn","cunnie","cunnilingus","cunntt","cunny","cunt","cunteyed","cuntface","cuntfuck","cuntfucker","cunthole","cunthunter","cuntlick","cuntlicker","cuntlicking","cuntrag","cunts","cuntslut","cuntsucker","cuntz","curry muncher","curry munchers","currymuncher","currymunchers","cushi","cushis","cyalis","cyberfuc","cyberfuck","cyberfucked","cyberfucker","cyberfuckers","cyberfucking","cybersex","cyberslimer","d0ng","d0uch3","d0uche","d1ck","d1ld0","d1ldo","d4mn","dago","dagos","dahmer","damm","dammit","damn","damnation","damned","damnit","darkey","darkeys","darkie","darkies","darky","date rape","daterape","datnigga","dawgie style","dawgie-style","daygo","deapthroat","deep throat","deep throating","deepaction","deepthroat","deepthroating","defecate","deggo","dego","degos","demon","dendrophilia","destroyyourpussy","deth","diaper head","diaper heads","diaperhead","diaperheads","dick pic","dick","dick-ish","dickbag","dickbeaters","dickbrain","dickdipper","dickface","dickflipper","dickforbrains","dickfuck","dickhead","dickheads","dickhole","dickish","dickjuice","dickless","dicklick","dicklicker","dickman","dickmilk","dickpic","dickripper","dicks","dicksipper","dickslap","dickwad","dickweasel","dickweed","dickwhipper","dickwod","dickzipper","diddle","dike","dild0","dild0s","dildo","dildos","dilf","diligaf","dilld0","dilld0s","dillweed","dimwit","dingle","dingleberries","dingleberry","dink","dinks","dipship","dipshit","dipstick","dirsa","dirty pillows","dirty sanchez","dix","dixiedike","dixiedyke","dlck","dog style","dog-fucker","doggie style","doggie","doggie-style","doggiestyle","doggin","dogging","doggy style","doggy-style","doggystyle","dolcett","domination","dominatricks","dominatrics","dominatrix","dommes","dong","donkey punch","donkeypunch","donkeyribber","doochbag","doodoo","doofus","dookie","doosh","dot head","dot heads","dothead","dotheads","double dong","double penetration","doubledong","doublepenetration","douch3","douche bag","douche","douche-fag","douchebag","douchebags","douchewaffle","douchey","dp action","dp","dpaction","dragqueen","dragqween","dripdick","drug","dry hump","dryhump","duche","dudette","dumass","dumb ass","dumbass","dumbasses","dumbbitch","dumbfuck","dumbshit","dummy","dumshit","dune coon","dune coons","dupa","dvda","dyefly","dyke","dykes","dziwka","earotics","easyslut","eat my ass","eat my","eatballs","eatme","eatmyass","eatpussy","ecchi","ejackulate","ejaculate","ejaculated","ejaculates","ejaculating","ejaculatings","ejaculation","ejaculations","ejakulate","ekrem","ekto","enculer","enema","enlargement","erect","erection","ero","erotic","erotism","escort","esqua","essohbee","ethical slut","evl","excrement","exkwew","explosion","extacy","extasy","f u c k e r","f u c k e","f u c k","f u k","f*ck","f-u-c-k","f.u.c.k","f4nny","f_u_c_k","facefucker","fack","faeces","faen","fag","fag1t","fagbag","faget","fagfucker","fagg","fagg1t","fagged","fagging","faggit","faggitt","faggot","faggotcock","faggs","fagit","fagot","fagots","fags","fagt","fagtard","fagz","faig","faigs","faigt","fanculo","fannybandit","fannyflaps","fannyfucker","fanyy","fartknocker","farty","fastfuck","fatah","fatass","fatfuck","fatfucker","fatso","fck","fckcum","fckd","fcuk","fcuker","fcuking","fecal","feces","feck","fecker","feg","felatio","felch","felcher","felching","fellate","fellatio","feltch","feltcher","feltching","female squirting","femalesquirtin","femalesquirting","femdom","fetish","ficken","figging","fingerbang","fingerfood","fingerfuck","fingerfucked","fingerfucker","fingerfuckers","fingerfucking","fingerfucks","fingering","fisted","fister","fistfuck","fistfucked","fistfucker","fistfuckers","fistfucking","fistfuckings","fistfucks","fisting","fisty","fitt","flamer","flange","flasher","flikker","flipping the bird","floo","floozy","flydie","flydye","foad","fok","fondle","foobar","fook","fooker","foot fetish","footaction","footfetish","footfuck","footfucker","footjob","footlicker","footstar","foreskin","forni","fornicate","fotze","foursome","fourtwenty","freakfuck","freakyfucker","freefuck","freex","frigg","frigga","frotting","fubar","fucck","fuck buttons","fuck","fuck-tard","fucka","fuckable","fuckass","fuckbag","fuckbook","fuckboy","fuckbrain","fuckbuddy","fuckbutt","fuckd","fucked","fuckedup","fucker","fuckers","fuckersucker","fuckface","fuckfest","fuckfreak","fuckfriend","fuckhead","fuckheads","fuckher","fuckhole","fuckin","fuckina","fucking","fuckingbitch","fuckings","fuckingshitmotherfucker","fuckinnuts","fuckinright","fuckit","fuckknob","fuckme","fuckmehard","fuckmonkey","fuckn","fucknugget","fucknut","fucknuts","fucknutt","fucknutz","fuckoff","fuckpig","fuckr","fucks","fuckstick","fucktard","fucktards","fuckup","fuckwad","fuckwhit","fuckwhore","fuckwit","fuckwitt","fuckyou","fudge packer","fudgepacker","fugly","fuk","fukah","fuken","fuker","fukin","fuking","fukk","fukkah","fukken","fukker","fukkin","fuks","fuktard","fuktards","fukwhit","fukwit","funeral","funfuck","fungus","futanari","futkretzn","fuuck","fux","fux0r","fvck","fvk","fxck","g-spot","g00k","gae","gai","gang bang","gangbang","gangbanged","gangbanger","gangbangs","gangsta","ganja","gator bait","gatorbait","gay sex","gayboy","gaygirl","gaylord","gaymuthafuckinwhore","gays","gaysex","gayz","geezer","geni","genital","genitals","getiton","gey","gfy","ghay","ghey","giant cock","gigolo","ginzo","ginzos","gipp","gippo","gippos","gipps","girl on top","girl on","girls gone wild","givehead","glans","glazeddonut","goatcx","goatse","gob","god dammit","god damn","god damnit","god-dam","god-damned","godam","godammit","godamn","godamnit","goddam","goddamit","goddamm","goddammit","goddamn","goddamned","goddamnes","goddamnit","goddamnmuthafucker","gokkun","golden shower","goldenshower","golliwog","golliwogs","gonad","gonads","gonorrehea","gonzagas","goo girl","gooch","goodpoop","gook eye","gook eyes","gook","gookeye","gookeyes","gookies","gooks","gooky","gora","goras","goregasm","gotohell","goy","goyim","greaseball","greaseballs","gringo","gringos","groe","groid","groids","grope","gross","grostulation","group sex","gspot","gstring","gtfo","gub","gubba","gubbas","gubs","guido","guiena","guineas","guizi","gummer","guro","gwailo","gwailos","gweilo","gweilos","gyopo","gyopos","gyp","gyped","gypo","gypos","gypp","gypped","gyppie","gyppies","gyppo","gyppos","gyppy","gyppys","gypsys","h e l l","h o m","h00r","h0ar","h0m0","h0mo","h0r","h0re","h4x0r","hadji","hadjis","hairyback","hairybacks","haji","hajis","hajji","hajjis","half breed","half caste","halfbreed","halfcaste","hamas","hand job","handjob","haole","haoles","hapa","hard core","hardcore","hardcoresex","hardon","harem","he11","headfuck","hebe","hebes","heeb","heebs","hell","hells","helvete","henhouse","hentai","heroin","herp","herpes","herpy","heshe","hijacker","hijacking","hillbillies","hillbilly","hindoo","hiscock","hitler","hitlerism","hitlerist","ho","hobag","hodgie","hoe","hoer","hoes","holestuffer","hom0","homey","homicide","homo","homobangers","homodumbshit","homoey","honger","honkers","honkey","honkeys","honkie","honkies","honky","hooch","hooker","hookers","hoor","hoore","hootch","hooter","hooters","hore","hori","horis","hork","horndawg","horndog","horney","horniest","horny","horseshit","hosejob","hoser","hot carl","hot chick","hotcarl","hotdamn","hotpussy","hotsex","hottotrot","how to kill","how to murder","huevon","huge fat","hugefat","hui","hummer","humped","humper","humpher","humphim","humpin","humping","husky","hussy","hustler","hymen","hymie","hymies","iblowu","ike","ikes","ikey","ikeymo","ikeymos","ikwe","illegal","illegals","inbred","incest","indon","indons","injun","injuns","insest","intercourse","interracial","intheass","inthebuff","israels","j3rk0ff","jack off","jack-off","jackass","jackhole","jackoff","jackshit","jacktheripper","jail bait","jailbait","jap","japcrap","japie","japies","japs","jebus","jelly donut","jerk off","jerk","jerk-off","jerk0ff","jerked","jerkoff","jerries","jerry","jesuschrist","jewed","jewess","jig","jiga","jigaboo","jigaboos","jigarooni","jigaroonis","jigg","jigga","jiggabo","jiggaboo","jiggabos","jiggas","jigger","jiggerboo","jiggers","jiggs","jiggy","jigs","jihad","jijjiboo","jijjiboos","jimfish","jisim","jism","jiss","jiz","jizim","jizin","jizjuice","jizm","jizn","jizz","jizzd","jizzed","jizzim","jizzin","jizzn","jizzum","jugg","juggs","jugs","jungle bunnies","jungle bunny","junglebunny","junkie","junky","kacap","kacapas","kacaps","kaffer","kaffir","kaffre","kafir","kanake","kanker","katsap","katsaps","kawk","khokhol","khokhols","kicking","kigger","kike","kikes","killer","kills","kimchis","kinbaku","kink","kinkster","kinky","kissass","kkk","klan","klansman","klansmen","klanswoman","klanswomen","klootzak","knobbing","knobead","knobed","knobend","knobhead","knobjocky","knobjokey","knobz","knockers","knulle","kock","kondum","kondums","kooch","kooches","koon","kootch","krap","krappy","kraut","krauts","kuffar","kuk","kuksuger","kum","kumbubble","kumbullbe","kumer","kummer","kumming","kumquat","kums","kunilingus","kunnilingus","kunt","kunts","kuntz","kurac","kurwa","kushi","kushis","kusi","kwa","kwai lo","kwai los","ky","kyke","kykes","kyopo","kyopos","kyrpa","l3i+ch","l3i\\\\+ch","l3itch","labia","lapdance","lds","leather restraint","leather straight jacket","leather straight","leatherrestraint","lebo","lebos","lech","lemon party","lemonparty","leper","lesbain","lesbayn","lesbian","lesbin","lesbo","lez","lezbe","lezbefriends","lezbian","lezbians","lezbo","lezbos","lezz","lezzian","lezzie","lezzies","lezzo","lezzy","libido","licker","licking","lickme","lilniglet","limey","limpdick","limy","lingerie","lipshits","lipshitz","livesex","lmfao","loadedgun","loin","loins","lolita","lovebone","lovegoo","lovegun","lovejuice","lovemaking","lovemuscle","lovepistol","loverocket","lowlife","lsd","lubejob","lubra","lucifer","luckycammeltoe","lugan","lugans","lust","lusting","lusty","lynch","m-fucking","m0f0","m0fo","m45terbate","ma5terb8","ma5terbate","mabuno","mabunos","macaca","macacas","magicwand","mahbuno","mahbunos","make me come","makemecome","makemecum","male squirting","mamhoon","mams","manhater","manpaste","maricon","maricón","marijuana","masochist","masokist","massa","massterbait","masstrbait","masstrbate","mastabate","mastabater","master-bate","masterb8","masterbaiter","masterbat","masterbat3","masterbate","masterbates","masterbating","masterbation","masterbations","masterblaster","mastrabator","masturbat","masturbate","masturbating","masturbation","mattressprincess","mau mau","mau maus","maumau","maumaus","mcfagget","meatbeatter","meatrack","menage a trois","menage","menses","menstruate","menstruation","merd","meth","mgger","mggor","mibun","mick","mickeyfinn","mideast","mierda","milf","minge","missionary position","missionary","mo-fo","mockey","mockie","mocky","mof0","mofo","moky","molest","molestation","molester","molestor","moneyshot","monkleigh","moolie","moon cricket","moon crickets","mooncricket","mooncrickets","mormon","moron","moskal","moskals","moslem","mosshead","motha fucker","motha fuker","motha fukkah","motha fukker","mothafuck","mothafucka","mothafuckas","mothafuckaz","mothafucked","mothafucker","mothafuckers","mothafuckin","mothafucking","mothafuckings","mothafucks","mother fucker","mother fukah","mother fuker","mother fukkah","mother fukker","mother-fucker","motherfuck","motherfucka","motherfucked","motherfucker","motherfuckers","motherfuckin","motherfucking","motherfuckings","motherfuckka","motherfucks","motherfvcker","motherlovebone","mothrfucker","mouliewop","mound of venus","moundofvenus","mr hands","mrhands","mtherfucker","mthrfuck","mthrfucker","mthrfucking","mtrfck","mtrfuck","mtrfucker","muff diver","muff","muffdive","muffdiver","muffdiving","muffindiver","mufflikcer","muie","mulatto","mulkku","muncher","munging","munt","murder","murderer","muschi","mutha fucker","mutha fukah","mutha fuker","mutha fukkah","mutha fukker","mutha","muthafecker","muthafuckaz","muthafucker","muthafuckker","muther","mutherfucker","mutherfucking","muthrfucking","mzungu","mzungus","n1gga","n1gger","n1gr","nad","nads","naked","nambla","nastt","nasty","nastybitch","nastyho","nastyslut","nastywhore","nawashi","nazi","nazis","nazism","necro","negres","negress","negro","negroes","negroid","negros","neonazi","nepesaurio","nig nog","nig","niga","nigar","nigars","nigas","niger","nigerian","nigerians","nigers","nigette","nigettes","nigg","nigg3r","nigg4h","nigga","niggah","niggahs","niggar","niggaracci","niggard","niggarded","niggarding","niggardliness","niggardlinesss","niggardly","niggards","niggars","niggas","niggaz","nigger","niggerhead","niggerhole","niggers","niggle","niggled","niggles","niggling","nigglings","niggor","niggress","niggresses","nigguh","nigguhs","niggur","niggurs","niglet","nignog","nigor","nigors","nigr","nigra","nigras","nigre","nigres","nigress","nigs","nigur","niiger","niigr","nimphomania","nimrod","ninny","nip","nipple","nipplering","nipples","nips","nittit","nlgger","nlggor","nob jokey","nob","nobhead","nobjocky","nobjokey","nofuckingway","nog","nookey","nookie","nooky","noonan","nooner","nsfw images","nsfw","nude","nudger","nudie","nudies","nudity","numbnuts","nut sack","nutfucker","nutsack","nymph","nympho","nymphomania","o c k","octopussy","omorashi","one cup two girls","one guy one jar","one guy","one jar","ontherag","orafis","oral","orally","orga","orgasim","orgasim;","orgasims","orgasm","orgasmic","orgasms","orgasum","orgies","orgy","oriface","orifice","orifiss","orospu","osama","ovum","ovums","p e n i s","p i s","p u s s y","p.u.s.s.y.","p0rn","packi","packie","packy","paddy","paedophile","paki","pakie","pakis","paky","palesimian","pancake face","pancake faces","panooch","pansies","pansy","panti","pantie","panties","panty","paska","pastie","pasty","payo","pcp","pearlnecklace","peck","pecker","peckerhead","peckerwood","pedo","pedobear","pedophile","pedophilia","pedophiliac","pee","peeenus","peeenusss","peehole","peenus","peepee","peepshow","peepshpw","pegging","peinus","pen1s","penas","pendejo","pendy","penetrate","penetration","peni5","penial","penile","penis","penis-breath","penises","penisfucker","penisland","penislick","penislicker","penispuffer","penthouse","penus","penuus","perse","perv","perversion","peyote","phalli","phallic","phone sex","phonesex","phuc","phuck","phuk","phuked","phuker","phuking","phukked","phukker","phukking","phuks","phungky","phuq","pi55","picaninny","piccaninny","picka","pickaninnies","pickaninny","piece of shit","pieceofshit","piefke","piefkes","pierdol","pigfucker","piker","pikey","piky","pillowbiter","pillu","pimmel","pimp","pimped","pimper","pimpis","pimpjuic","pimpjuice","pimpsimp","pindick","pinko","pis","pises","pisin","pising","pisof","piss pig","piss","piss-off","pissed","pisser","pissers","pisses","pissflaps","pisshead","pissin","pissing","pissoff","pisspig","pistol","pizda","playboy","playgirl","pleasure chest","pleasurechest","pms","pocha","pochas","pocho","pochos","pocketpool","pohm","pohms","polac","polack","polacks","polak","pole smoker","polesmoker","pollock","pollocks","pommie grant","pommie grants","pommie","pommies","pommy","ponyplay","poo","poof","poon","poonani","poonany","poontang","poontsee","poop chute","poop","poopchute","pooper","pooperscooper","pooping","poorwhitetrash","popimp","porch monkey","porch monkies","porchmonkey","porn","pornflick","pornking","porno","pornography","pornos","pornprincess","pound town","poundtown","pplicker","pr0n","pr1c","pr1ck","pr1k","prairie nigger","prairie niggers","premature","preteen","pric","prick","prickhead","pricks","prig","prince albert piercing","pron","propaganda","prostitute","pthc","pu55i","pu55y","pube","pubes","pubic","pubiclice","pubis","pud","pudboy","pudd","puddboy","puke","pula","pule","punanny","punany","punkass","punky","punta","puntang","purinapricness","pusies","puss","pusse","pussee","pussi","pussie","pussies","pussy","pussycat","pussydestroyer","pussyeater","pussyfucker","pussylicker","pussylicking","pussylips","pussylover","pussypounder","pussys","pusy","puta","puto","puuke","puuker","qahbeh","quashie","queaf","queef","queero","queers","queerz","quickie","quicky","quiff","quim","qweers","qweerz","qweir","r-tard","r-tards","r5e","ra8s","racial","radicals","raghead","ragheads","raging boner","raging","ragingboner","randy","rape","raped","raper","raping","rapist","raunch","rautenberg","rearend","rearentry","recktum","rectal","rectum","rectus","redleg","redlegs","redlight","redneck","rednecks","redskin","redskins","reefer","reestie","reetard","refugee","reich","renob","rentafuck","rere","retard","retarded","retards","retardz","reverse cowgirl","reversecowgirl","rigger","rimjaw","rimjob","rimming","ritard","rosebuds","rosy palm and her 5 sisters","rosy palm","rosypalm","rosypalmandher5sisters","rosypalmandherefivesisters","round eyes","roundeye","rtard","rtards","rump","rumprammer","ruski","russki","russkie","rusty trombone","rustytrombone","s h i t","s hit","s&m","s-h-1-t","s-h-i-t","s-o-b","s.h.i.t.","s.o.b.","s0b","s_h_i_t","sac","sack","sadis","sadism","sadist","sadom","sambo","sambos","samckdaddy","sanchez","sand nigger","sand niggers","sandm","sandnigger","santorum","scag","scallywag","scank","scantily","scat","schaffer","scheiss","schizo","schlampe","schlong","schmuck","schvartse","schvartsen","schwartze","schwartzen","scissoring","screwed","screwing","screwyou","scroat","scrog","scrot","scrote","scrotum","scrud","seduce","semen","seppo","seppos","septics","sex","sexed","sexfarm","sexhound","sexhouse","sexi","sexing","sexkitten","sexo","sexpot","sexslave","sextogo","sextoy","sextoys","sexual","sexually","sexwhore","sexx","sexxi","sexxx","sexxxi","sexxxy","sexxy","sexy","sexymoma","sexyslim","sh!+","sh!t","sh1t","sh1ter","sh1ts","sh1tter","sh1tz","shag","shagger","shaggin","shagging","shamedame","sharmuta","sharmute","shat","shav","shaved beaver","shaved pussy","shaved","shavedbeaver","shavedpussy","shawtypimp","sheeney","shemale","shhit","shi+","shibari","shinola","shipal","shit","shitass","shitbag","shitbagger","shitblimp","shitbrain","shitbreath","shitcan","shitcunt","shitdick","shite","shiteater","shited","shitey","shitface","shitfaced","shitfit","shitforbrains","shitfuck","shitfucker","shitfull","shithapens","shithappens","shithead","shithole","shithouse","shiting","shitings","shitlist","shitola","shitoutofluck","shits","shitspitter","shitstain","shitt","shitted","shitter","shitters","shittiest","shitting","shittings","shitty","shity","shitz","shiz","shiznit","shortfuck","shota","shrimping","shylock","shylocks","shyt","shyte","shytty","shyty","sissy","sixsixsix","sixtynine","sixtyniner","skag","skanck","skank","skankbitch","skankee","skankey","skankfuck","skanks","skankwhore","skanky","skankybitch","skankywhore","skeet","skinflute","skribz","skullfuck","skum","skumbag","skurwysyn","skwa","skwe","slag","slant","slanteye","slanty","slapper","slaughter","slave","slavedriver","sleaze","sleazy","sleezebag","sleezeball","slideitin","slimeball","slimebucket","slopehead","slopeheads","sloper","slopers","slopes","slopey","slopeys","slopies","slopy","slut","slutbag","slutdumper","slutkiss","sluts","slutt","slutting","slutty","slutwear","slutwhore","slutz","smack","smackthemonkey","smeg","smegma","smoker","smut","smutty","snatch","snatchpatch","snigger","sniggered","sniggering","sniggers","sniper","snowback","snowballing","snownigger","snuff","sob","socksucker","sodom","sodomise","sodomite","sodomize","sodomy","son of a bitch","son-of-a-bitch","sonofabitch","sonofbitch","sooties","sooty","souse","soused","spac","spade","spades","spaghettibender","spaghettinigger","spank","spankthemonkey","spearchucker","spearchuckers","sperm","spermacide","spermbag","spermhearder","spermherder","sphencter","spic","spick","spicks","spics","spierdalaj","spig","spigotty","spik","spiks","spitter","splittail","splooge moose","splooge","spludge","spooge","spread legs","spreadeagle","spunk","spunky","sqeh","squa","squarehead","squareheads","squaw","squinty","squirting","stagg","steamy","stfu","stiffy","stoned","stoner","strap on","strapon","strappado","stringer","strip club","stripclub","stroke","stroking","stuinties","stupid","stupidfuck","stupidfucker","style doggy","suck","suckdick","sucked","sucker","sucking","suckme","suckmyass","suckmydick","suckmytit","suckoff","sucks","suicide girl","suicide girls","suicide","suicidegirl","suicidegirls","suka","sultry women","sultry","sultrywoman","sultrywomen","sumofabiatch","swallow","swallower","swalow","swamp guinea","swamp guineas","swastika","swinger","syphilis","t i t","t i ts","t1t","t1tt1e5","t1tties","taboo","tacohead","tacoheads","taff","tainted love","tainted","take off your","tantra","tar babies","tar baby","tarbaby","tard","taste my","tastemy","tawdry","tea bagging","teabagging","teat","teets","teez","terd","terror","terrorist","teste","testee","testes","testical","testicle","testicles","testis","thicklip","thicklips","thirdeye","thirdleg","threesome","threeway","throat","throating","thrust","thug","thundercunt","ti","tied up","tight white","timber nigger","timber niggers","timbernigger","tinkle","tit","titbitnipply","titfuck","titfucker","titfuckin","titi","titjob","titlicker","titlover","tits","titt","tittie","tittie5","tittiefucker","titties","tittis","titty","tittyfuck","tittyfucker","tittys","tittywank","titwank","tity","to murder","toke","tongethruster","tongue in a","tongueina","tonguethrust","tonguetramp","toots","topless","tortur","torture","tosser","towel head","towel heads","towelhead","trailertrash","tramp","trannie","tranny","transsexual","transvestite","trashy","tribadism","triplex","trisexual","trois","trojan","trombone","trots","tub girl","tubgirl","tuckahoe","tunneloflove","turd","turnon","tush","tushy","tw4t","twat","twathead","twatlips","twats","twatty","twatwaffle","twink","twinkie","two girls one cup","twobitwhore","twunt","twunter","udge packer","ukrop","uncle tom","unclefucker","undies","undressing","unfuckable","unwed","upskirt","uptheass","upthebutt","urethra play","urethra","urethraplay","urinal","urinary","urinate","urine","urophilia","usama","ussys","uzi","v a g i n a","v14gra","v1gra","v4gra","va-j-j","va1jina","vag","vag1na","vagiina","vagina","vaginal","vaj1na","vajina","valium","venus mound","vgra","viagra","vibe","vibr","vibrater","vibrator","vietcong","violet wand","virgin","virginbreaker","vittu","vixen","vjayjay","vodka","vomit","vorarephilia","voyeur","vulgar","vullva","vulva","w00se","w0p","wab","wad","wang","wank","wanker","wanking","wanky","waysted","wazoo","wedgie","weed","weenie","weewee","weiner","weirdo","welcher","wench","wet dream","wetb","wetback","wetbacks","wetdream","wetspot","wh00r","wh0re","wh0reface","whacker","whash","whigger","whiggers","whiskeydick","whiskydick","whit","white power","white trash","whitenigger","whitepower","whites","whitetrash","whitey","whiteys","whities","whiz","whoar","whop","whoralicious","whore","whorealicious","whorebag","whored","whoreface","whorefucker","whorehopper","whorehouse","whores","whoring","wichser","wigga","wiggas","wigger","wiggers","willie","willies","williewanker","willy","wn","wog","wogs","woody","wop","wrapping men","wrinkled starfish","wtf","wuss","wuzzie","x-rated","xkwe","xrated","xtc","xx","xxx","xxxxxx","yank","yaoi","yarpie","yarpies","yeasty","yed","yellow showers","yellowman","yellowshowers","yid","yids","yiffy","yobbo","yourboobs","yourpenis","yourtits","zabourah","zigabo","zigabos","zipperhead","zipperheads","zoophile","zoophilia","🖕"]')},function(e,t,n){"use strict";n.r(t);n(108)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(7),o=(r=n(18))&&"object"==typeof r&&"default"in r?r.default:r,a=n(20),s=n(12),c=n(109),l=n(19),u=new a.Logger("@firebase/firestore");function h(){return u.logLevel}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=a.LogLevel.DEBUG){var r=t.map(m);u.debug.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=a.LogLevel.ERROR){var r=t.map(m);u.error.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=a.LogLevel.WARN){var r=t.map(m);u.warn.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function m(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}/*** @license* Copyright 2020 Google LLC@@ -549,7 +549,7 @@ i.registerVersion("firebase","7.19.0","app"),e.exports=i},function(e,t){e.export* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var J=function(){function e(e){this.H=e}return e.fromBase64String=function(t){return new e(atob(t))},e.fromUint8Array=function(t){return new e(function(e){for(var t="",n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(t))},e.prototype.toBase64=function(){return e=this.H,btoa(e);var e},e.prototype.toUint8Array=function(){return function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.H)},e.prototype.Y=function(){return 2*this.H.length},e.prototype.o=function(e){return w(this.H,e.H)},e.prototype.isEqual=function(e){return this.H===e.H},e}();J.J=new J("");var Z,X,Y=function(){function e(e,t,n,r,i,o,a){void 0===i&&(i=O.min()),void 0===o&&(o=O.min()),void 0===a&&(a=J.J),this.target=e,this.targetId=t,this.X=n,this.sequenceNumber=r,this.Z=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return e.prototype.tt=function(t){return new e(this.target,this.targetId,this.X,t,this.Z,this.lastLimboFreeSnapshotVersion,this.resumeToken)},e.prototype.et=function(t,n){return new e(this.target,this.targetId,this.X,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,t)},e.prototype.nt=function(t){return new e(this.target,this.targetId,this.X,this.sequenceNumber,this.Z,t,this.resumeToken)},e}(),Q=function(e){this.count=e};+ */var J=function(){function e(e){this.H=e}return e.fromBase64String=function(t){return new e(atob(t))},e.fromUint8Array=function(t){return new e(function(e){for(var t="",n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(t))},e.prototype.toBase64=function(){return e=this.H,btoa(e);var e},e.prototype.toUint8Array=function(){return function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.H)},e.prototype.Y=function(){return 2*this.H.length},e.prototype.o=function(e){return w(this.H,e.H)},e.prototype.isEqual=function(e){return this.H===e.H},e}();J.J=new J("");var Z,Y,X=function(){function e(e,t,n,r,i,o,a){void 0===i&&(i=O.min()),void 0===o&&(o=O.min()),void 0===a&&(a=J.J),this.target=e,this.targetId=t,this.X=n,this.sequenceNumber=r,this.Z=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return e.prototype.tt=function(t){return new e(this.target,this.targetId,this.X,t,this.Z,this.lastLimboFreeSnapshotVersion,this.resumeToken)},e.prototype.et=function(t,n){return new e(this.target,this.targetId,this.X,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,t)},e.prototype.nt=function(t){return new e(this.target,this.targetId,this.X,this.sequenceNumber,this.Z,t,this.resumeToken)},e}(),Q=function(e){this.count=e};/*** @license* Copyright 2017 Google LLC@@ -565,7 +565,7 @@ i.registerVersion("firebase","7.19.0","app"),e.exports=i},function(e,t){e.export* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */function K(e){switch(e){case k.OK:return g();case k.CANCELLED:case k.UNKNOWN:case k.DEADLINE_EXCEEDED:case k.RESOURCE_EXHAUSTED:case k.INTERNAL:case k.UNAVAILABLE:case k.UNAUTHENTICATED:return!1;case k.INVALID_ARGUMENT:case k.NOT_FOUND:case k.ALREADY_EXISTS:case k.PERMISSION_DENIED:case k.FAILED_PRECONDITION:case k.ABORTED:case k.OUT_OF_RANGE:case k.UNIMPLEMENTED:case k.DATA_LOSS:return!0;default:return g()}}function $(e){if(void 0===e)return p("GRPC error has no .code"),k.UNKNOWN;switch(e){case Z.OK:return k.OK;case Z.CANCELLED:return k.CANCELLED;case Z.UNKNOWN:return k.UNKNOWN;case Z.DEADLINE_EXCEEDED:return k.DEADLINE_EXCEEDED;case Z.RESOURCE_EXHAUSTED:return k.RESOURCE_EXHAUSTED;case Z.INTERNAL:return k.INTERNAL;case Z.UNAVAILABLE:return k.UNAVAILABLE;case Z.UNAUTHENTICATED:return k.UNAUTHENTICATED;case Z.INVALID_ARGUMENT:return k.INVALID_ARGUMENT;case Z.NOT_FOUND:return k.NOT_FOUND;case Z.ALREADY_EXISTS:return k.ALREADY_EXISTS;case Z.PERMISSION_DENIED:return k.PERMISSION_DENIED;case Z.FAILED_PRECONDITION:return k.FAILED_PRECONDITION;case Z.ABORTED:return k.ABORTED;case Z.OUT_OF_RANGE:return k.OUT_OF_RANGE;case Z.UNIMPLEMENTED:return k.UNIMPLEMENTED;case Z.DATA_LOSS:return k.DATA_LOSS;default:return g()}}(X=Z||(Z={}))[X.OK=0]="OK",X[X.CANCELLED=1]="CANCELLED",X[X.UNKNOWN=2]="UNKNOWN",X[X.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",X[X.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",X[X.NOT_FOUND=5]="NOT_FOUND",X[X.ALREADY_EXISTS=6]="ALREADY_EXISTS",X[X.PERMISSION_DENIED=7]="PERMISSION_DENIED",X[X.UNAUTHENTICATED=16]="UNAUTHENTICATED",X[X.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",X[X.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",X[X.ABORTED=10]="ABORTED",X[X.OUT_OF_RANGE=11]="OUT_OF_RANGE",X[X.UNIMPLEMENTED=12]="UNIMPLEMENTED",X[X.INTERNAL=13]="INTERNAL",X[X.UNAVAILABLE=14]="UNAVAILABLE",X[X.DATA_LOSS=15]="DATA_LOSS";+ */function K(e){switch(e){case k.OK:return g();case k.CANCELLED:case k.UNKNOWN:case k.DEADLINE_EXCEEDED:case k.RESOURCE_EXHAUSTED:case k.INTERNAL:case k.UNAVAILABLE:case k.UNAUTHENTICATED:return!1;case k.INVALID_ARGUMENT:case k.NOT_FOUND:case k.ALREADY_EXISTS:case k.PERMISSION_DENIED:case k.FAILED_PRECONDITION:case k.ABORTED:case k.OUT_OF_RANGE:case k.UNIMPLEMENTED:case k.DATA_LOSS:return!0;default:return g()}}function $(e){if(void 0===e)return p("GRPC error has no .code"),k.UNKNOWN;switch(e){case Z.OK:return k.OK;case Z.CANCELLED:return k.CANCELLED;case Z.UNKNOWN:return k.UNKNOWN;case Z.DEADLINE_EXCEEDED:return k.DEADLINE_EXCEEDED;case Z.RESOURCE_EXHAUSTED:return k.RESOURCE_EXHAUSTED;case Z.INTERNAL:return k.INTERNAL;case Z.UNAVAILABLE:return k.UNAVAILABLE;case Z.UNAUTHENTICATED:return k.UNAUTHENTICATED;case Z.INVALID_ARGUMENT:return k.INVALID_ARGUMENT;case Z.NOT_FOUND:return k.NOT_FOUND;case Z.ALREADY_EXISTS:return k.ALREADY_EXISTS;case Z.PERMISSION_DENIED:return k.PERMISSION_DENIED;case Z.FAILED_PRECONDITION:return k.FAILED_PRECONDITION;case Z.ABORTED:return k.ABORTED;case Z.OUT_OF_RANGE:return k.OUT_OF_RANGE;case Z.UNIMPLEMENTED:return k.UNIMPLEMENTED;case Z.DATA_LOSS:return k.DATA_LOSS;default:return g()}}(Y=Z||(Z={}))[Y.OK=0]="OK",Y[Y.CANCELLED=1]="CANCELLED",Y[Y.UNKNOWN=2]="UNKNOWN",Y[Y.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Y[Y.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Y[Y.NOT_FOUND=5]="NOT_FOUND",Y[Y.ALREADY_EXISTS=6]="ALREADY_EXISTS",Y[Y.PERMISSION_DENIED=7]="PERMISSION_DENIED",Y[Y.UNAUTHENTICATED=16]="UNAUTHENTICATED",Y[Y.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Y[Y.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Y[Y.ABORTED=10]="ABORTED",Y[Y.OUT_OF_RANGE=11]="OUT_OF_RANGE",Y[Y.UNIMPLEMENTED=12]="UNIMPLEMENTED",Y[Y.INTERNAL=13]="INTERNAL",Y[Y.UNAVAILABLE=14]="UNAVAILABLE",Y[Y.DATA_LOSS=15]="DATA_LOSS";/*** @license* Copyright 2017 Google LLC@@ -679,7 +679,7 @@ var re=function(){function e(e){this.P=e,this.data=new ee(this.P)}return e.proto* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var Ge={asc:"ASCENDING",desc:"DESCENDING"},We={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Je=function(e,t){this.s=e,this.Le=t};function Ze(e){return{integerValue:""+e}}function Xe(e,t){if(e.Le){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:B(t)?"-0":t}}function Ye(e,t){return V(t)?Ze(t):Xe(e,t)}function Qe(e,t){return e.Le?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function Ke(e,t){return e.Le?t.toBase64():t.toUint8Array()}function $e(e,t){return Qe(e,t.A())}function et(e){return y(!!e),O.m(function(e){var t=Le(e);return new P(t.seconds,t.nanos)}(e))}function tt(e,t){return function(e){return new D(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).F()}function nt(e){var t=D.k(e);return y(wt(t)),t}function rt(e,t){return tt(e.s,t.path)}function it(e,t){var n=nt(t);return y(n.get(1)===e.s.projectId),y(!n.get(3)&&!e.s.database||n.get(3)===e.s.database),new j(ct(n))}function ot(e,t){return tt(e.s,t)}function at(e){var t=nt(e);return 4===t.length?D.$():ct(t)}function st(e){return new D(["projects",e.s.projectId,"databases",e.s.database]).F()}function ct(e){return y(e.length>4&&"documents"===e.get(4)),e.V(5)}function lt(e,t,n){return{name:rt(e,t),fields:n.proto.mapValue.fields}}function ut(e,t){var n;if(t instanceof Gt)n={update:lt(e,t.key,t.value)};else if(t instanceof Qt)n={delete:rt(e,t.key)};else if(t instanceof Wt)n={update:lt(e,t.key,t.data),updateMask:_t(t.qe)};else if(t instanceof Zt)n={transform:{document:rt(e,t.key),fieldTransforms:t.fieldTransforms.map((function(e){return function(e,t){var n=t.transform;if(n instanceof Tt)return{fieldPath:t.field.F(),setToServerValue:"REQUEST_TIME"};if(n instanceof Mt)return{fieldPath:t.field.F(),appendMissingElements:{values:n.elements}};if(n instanceof Ct)return{fieldPath:t.field.F(),removeAllFromArray:{values:n.elements}};if(n instanceof It)return{fieldPath:t.field.F(),increment:n.Be};throw g()}(0,e)}))}};else{if(!(t instanceof Kt))return g();n={verify:rt(e,t.key)}}return t.Qe.Ue||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:$e(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:g()}(e,t.Qe)),n}function ht(e,t){var n=t.currentDocument?function(e){return void 0!==e.updateTime?Ft.updateTime(et(e.updateTime)):void 0!==e.exists?Ft.exists(e.exists):Ft.We()}(t.currentDocument):Ft.We();if(t.update){t.update.name;var r=it(e,t.update.name),i=new $t({mapValue:{fields:t.update.fields}});if(t.updateMask){var o=function(e){var t=e.fieldPaths||[];return new Nt(t.map((function(e){return F.q(e)})))}(t.updateMask);return new Wt(r,i,o,n)}return new Gt(r,i,n)}if(t.delete){var a=it(e,t.delete);return new Qt(a,n)}if(t.transform){var s=it(e,t.transform.document),c=t.transform.fieldTransforms.map((function(t){return function(e,t){var n=null;if("setToServerValue"in t)y("REQUEST_TIME"===t.setToServerValue),n=new Tt;else if("appendMissingElements"in t){var r=t.appendMissingElements.values||[];n=new Mt(r)}else if("removeAllFromArray"in t){var i=t.removeAllFromArray.values||[];n=new Ct(i)}else"increment"in t?n=new It(e,t.increment):g();var o=F.q(t.fieldPath);return new Dt(o,n)}(e,t)}));return y(!0===n.exists),new Zt(s,c)}if(t.verify){var l=it(e,t.verify);return new Kt(l,n)}return g()}function dt(e,t){return{documents:[ot(e,t.path)]}}function pt(e,t){var n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=ot(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=ot(e,r.p()),n.structuredQuery.from=[{collectionId:r.S()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(ze(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NAN"}};if(He(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(ze(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NOT_NAN"}};if(He(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:gt(e.field),op:(t=e.op,We[t]),value:e.value}};var t}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(n.structuredQuery.where=i);var o=function(e){if(0!==e.length)return e.map((function(e){return{field:gt((t=e).field),direction:(n=t.dir,Ge[n])};var t,n}))}(t.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(e,t){return e.Le||U(t)?t:{value:t}}(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=ft(t.startAt)),t.endAt&&(n.structuredQuery.endAt=ft(t.endAt)),n}function ft(e){return{before:e.before,values:e.position}}function mt(e){var t=!!e.before,n=e.values||[];return new In(n,t)}function gt(e){return{fieldPath:e.F()}}function yt(e){return F.q(e.fieldPath)}function vt(e){return En.create(yt(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return g()}}(e.fieldFilter.op),e.fieldFilter.value)}function bt(e){switch(e.unaryFilter.op){case"IS_NAN":var t=yt(e.unaryFilter.field);return En.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=yt(e.unaryFilter.field);return En.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=yt(e.unaryFilter.field);return En.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=yt(e.unaryFilter.field);return En.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return g()}}function _t(e){var t=[];return e.fields.forEach((function(e){return t.push(e.F())})),{fieldPaths:t}}function wt(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}+ */var Ge={asc:"ASCENDING",desc:"DESCENDING"},We={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Je=function(e,t){this.s=e,this.Le=t};function Ze(e){return{integerValue:""+e}}function Ye(e,t){if(e.Le){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:B(t)?"-0":t}}function Xe(e,t){return V(t)?Ze(t):Ye(e,t)}function Qe(e,t){return e.Le?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function Ke(e,t){return e.Le?t.toBase64():t.toUint8Array()}function $e(e,t){return Qe(e,t.A())}function et(e){return y(!!e),O.m(function(e){var t=Le(e);return new P(t.seconds,t.nanos)}(e))}function tt(e,t){return function(e){return new D(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).F()}function nt(e){var t=D.k(e);return y(wt(t)),t}function rt(e,t){return tt(e.s,t.path)}function it(e,t){var n=nt(t);return y(n.get(1)===e.s.projectId),y(!n.get(3)&&!e.s.database||n.get(3)===e.s.database),new j(ct(n))}function ot(e,t){return tt(e.s,t)}function at(e){var t=nt(e);return 4===t.length?D.$():ct(t)}function st(e){return new D(["projects",e.s.projectId,"databases",e.s.database]).F()}function ct(e){return y(e.length>4&&"documents"===e.get(4)),e.V(5)}function lt(e,t,n){return{name:rt(e,t),fields:n.proto.mapValue.fields}}function ut(e,t){var n;if(t instanceof Gt)n={update:lt(e,t.key,t.value)};else if(t instanceof Qt)n={delete:rt(e,t.key)};else if(t instanceof Wt)n={update:lt(e,t.key,t.data),updateMask:_t(t.qe)};else if(t instanceof Zt)n={transform:{document:rt(e,t.key),fieldTransforms:t.fieldTransforms.map((function(e){return function(e,t){var n=t.transform;if(n instanceof Tt)return{fieldPath:t.field.F(),setToServerValue:"REQUEST_TIME"};if(n instanceof Mt)return{fieldPath:t.field.F(),appendMissingElements:{values:n.elements}};if(n instanceof Ct)return{fieldPath:t.field.F(),removeAllFromArray:{values:n.elements}};if(n instanceof It)return{fieldPath:t.field.F(),increment:n.Be};throw g()}(0,e)}))}};else{if(!(t instanceof Kt))return g();n={verify:rt(e,t.key)}}return t.Qe.Ue||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:$e(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:g()}(e,t.Qe)),n}function ht(e,t){var n=t.currentDocument?function(e){return void 0!==e.updateTime?Ft.updateTime(et(e.updateTime)):void 0!==e.exists?Ft.exists(e.exists):Ft.We()}(t.currentDocument):Ft.We();if(t.update){t.update.name;var r=it(e,t.update.name),i=new $t({mapValue:{fields:t.update.fields}});if(t.updateMask){var o=function(e){var t=e.fieldPaths||[];return new Nt(t.map((function(e){return F.q(e)})))}(t.updateMask);return new Wt(r,i,o,n)}return new Gt(r,i,n)}if(t.delete){var a=it(e,t.delete);return new Qt(a,n)}if(t.transform){var s=it(e,t.transform.document),c=t.transform.fieldTransforms.map((function(t){return function(e,t){var n=null;if("setToServerValue"in t)y("REQUEST_TIME"===t.setToServerValue),n=new Tt;else if("appendMissingElements"in t){var r=t.appendMissingElements.values||[];n=new Mt(r)}else if("removeAllFromArray"in t){var i=t.removeAllFromArray.values||[];n=new Ct(i)}else"increment"in t?n=new It(e,t.increment):g();var o=F.q(t.fieldPath);return new Dt(o,n)}(e,t)}));return y(!0===n.exists),new Zt(s,c)}if(t.verify){var l=it(e,t.verify);return new Kt(l,n)}return g()}function dt(e,t){return{documents:[ot(e,t.path)]}}function pt(e,t){var n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=ot(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=ot(e,r.p()),n.structuredQuery.from=[{collectionId:r.S()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(ze(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NAN"}};if(He(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(ze(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NOT_NAN"}};if(He(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:gt(e.field),op:(t=e.op,We[t]),value:e.value}};var t}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(n.structuredQuery.where=i);var o=function(e){if(0!==e.length)return e.map((function(e){return{field:gt((t=e).field),direction:(n=t.dir,Ge[n])};var t,n}))}(t.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(e,t){return e.Le||U(t)?t:{value:t}}(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=ft(t.startAt)),t.endAt&&(n.structuredQuery.endAt=ft(t.endAt)),n}function ft(e){return{before:e.before,values:e.position}}function mt(e){var t=!!e.before,n=e.values||[];return new In(n,t)}function gt(e){return{fieldPath:e.F()}}function yt(e){return F.q(e.fieldPath)}function vt(e){return En.create(yt(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return g()}}(e.fieldFilter.op),e.fieldFilter.value)}function bt(e){switch(e.unaryFilter.op){case"IS_NAN":var t=yt(e.unaryFilter.field);return En.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=yt(e.unaryFilter.field);return En.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=yt(e.unaryFilter.field);return En.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=yt(e.unaryFilter.field);return En.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return g()}}function _t(e){var t=[];return e.fields.forEach((function(e){return t.push(e.F())})),{fieldPaths:t}}function wt(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}/*** @license* Copyright 2018 Google LLC@@ -695,7 +695,7 @@ var re=function(){function e(e){this.P=e,this.data=new ee(this.P)}return e.proto* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var Et=function(){this.je=void 0};function At(e,t,n){return e instanceof Tt?function(e,t){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof Mt?Rt(e,t):e instanceof Ct?kt(e,t):function(e,t){var n=St(e,t),r=Pt(n)+Pt(e.Be);return Be(n)&&Be(e.Be)?Ze(r):Xe(e.serializer,r)}(e,t)}function xt(e,t,n){return e instanceof Mt?Rt(e,t):e instanceof Ct?kt(e,t):n}function St(e,t){return e instanceof It?Be(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}var Tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t}(Et),Mt=function(e){function t(t){var n=this;return(n=e.call(this)||this).elements=t,n}return i.__extends(t,e),t}(Et);function Rt(e,t){for(var n=Ot(t),r=function(e){n.some((function(t){return Ie(t,e)}))||n.push(e)},i=0,o=e.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var Ct=function(e){function t(t){var n=this;return(n=e.call(this)||this).elements=t,n}return i.__extends(t,e),t}(Et);function kt(e,t){for(var n=Ot(t),r=function(e){n=n.filter((function(t){return!Ie(t,e)}))},i=0,o=e.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var It=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).serializer=t,r.Be=n,r}return i.__extends(t,e),t}(Et);function Pt(e){return Fe(e.integerValue||e.doubleValue)}function Ot(e){return Ve(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}+ */var Et=function(){this.je=void 0};function At(e,t,n){return e instanceof Tt?function(e,t){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof Mt?Rt(e,t):e instanceof Ct?kt(e,t):function(e,t){var n=St(e,t),r=Pt(n)+Pt(e.Be);return Be(n)&&Be(e.Be)?Ze(r):Ye(e.serializer,r)}(e,t)}function xt(e,t,n){return e instanceof Mt?Rt(e,t):e instanceof Ct?kt(e,t):n}function St(e,t){return e instanceof It?Be(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}var Tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t}(Et),Mt=function(e){function t(t){var n=this;return(n=e.call(this)||this).elements=t,n}return i.__extends(t,e),t}(Et);function Rt(e,t){for(var n=Ot(t),r=function(e){n.some((function(t){return Ie(t,e)}))||n.push(e)},i=0,o=e.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var Ct=function(e){function t(t){var n=this;return(n=e.call(this)||this).elements=t,n}return i.__extends(t,e),t}(Et);function kt(e,t){for(var n=Ot(t),r=function(e){n=n.filter((function(t){return!Ie(t,e)}))},i=0,o=e.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var It=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).serializer=t,r.Be=n,r}return i.__extends(t,e),t}(Et);function Pt(e){return Fe(e.integerValue||e.doubleValue)}function Ot(e){return Ve(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}/*** @license* Copyright 2017 Google LLC@@ -711,7 +711,7 @@ var re=function(){function e(e){this.P=e,this.data=new ee(this.P)}return e.proto* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var Nt=function(){function e(e){this.fields=e,e.sort(F.P)}return e.prototype.Ke=function(e){for(var t=0,n=this.fields;t<n.length;t++)if(n[t].D(e))return!0;return!1},e.prototype.isEqual=function(e){return E(this.fields,e.fields,(function(e,t){return e.isEqual(t)}))},e}(),Dt=function(e,t){this.field=e,this.transform=t},Lt=function(e,t){this.version=e,this.transformResults=t},Ft=function(){function e(e,t){this.updateTime=e,this.exists=t}return e.We=function(){return new e},e.exists=function(t){return new e(void 0,t)},e.updateTime=function(t){return new e(t)},Object.defineProperty(e.prototype,"Ue",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)},e}();function jt(e,t){return void 0!==e.updateTime?t instanceof rn&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t instanceof rn}var Ut=function(){};function Bt(e,t,n){return e instanceof Gt?function(e,t,n){return new rn(e.key,n.version,e.value,{hasCommittedMutations:!0})}(e,0,n):e instanceof Wt?function(e,t,n){if(!jt(e.Qe,t))return new an(e.key,n.version);var r=Jt(e,t);return new rn(e.key,n.version,r,{hasCommittedMutations:!0})}(e,t,n):e instanceof Zt?function(e,t,n){if(y(null!=n.transformResults),!jt(e.Qe,t))return new an(e.key,n.version);var r=Xt(e,t),i=function(e,t,n){var r=[];y(e.length===n.length);for(var i=0;i<n.length;i++){var o=e[i],a=o.transform,s=null;t instanceof rn&&(s=t.field(o.field)),r.push(xt(a,s,n[i]))}return r}(e.fieldTransforms,t,n.transformResults),o=n.version,a=Yt(e,r.data(),i);return new rn(e.key,o,a,{hasCommittedMutations:!0})}(e,t,n):function(e,t,n){return new on(e.key,n.version,{hasCommittedMutations:!0})}(e,0,n)}function Vt(e,t,n,r){return e instanceof Gt?function(e,t){if(!jt(e.Qe,t))return t;var n=qt(t);return new rn(e.key,n,e.value,{Ge:!0})}(e,t):e instanceof Wt?function(e,t){if(!jt(e.Qe,t))return t;var n=qt(t),r=Jt(e,t);return new rn(e.key,n,r,{Ge:!0})}(e,t):e instanceof Zt?function(e,t,n,r){if(!jt(e.Qe,t))return t;var i=Xt(e,t),o=function(e,t,n,r){for(var i=[],o=0,a=e;o<a.length;o++){var s=a[o],c=s.transform,l=null;n instanceof rn&&(l=n.field(s.field)),null===l&&r instanceof rn&&(l=r.field(s.field)),i.push(At(c,l,t))}return i}(e.fieldTransforms,n,t,r),a=Yt(e,i.data(),o);return new rn(e.key,i.version,a,{Ge:!0})}(e,t,r,n):function(e,t){return jt(e.Qe,t)?new on(e.key,O.min()):t}(e,t)}function Ht(e,t){return e instanceof Zt?function(e,t){for(var n=null,r=0,i=e.fieldTransforms;r<i.length;r++){var o=i[r],a=t instanceof rn?t.field(o.field):void 0,s=St(o.transform,a||null);null!=s&&(n=null==n?(new en).set(o.field,s):n.set(o.field,s))}return n?n.ze():null}(e,t):null}function zt(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.Qe.isEqual(t.Qe)&&(0===e.type?e.value.isEqual(t.value):1===e.type?e.data.isEqual(t.data)&&e.qe.isEqual(t.qe):2!==e.type||E(e.fieldTransforms,e.fieldTransforms,(function(e,t){return function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof Mt&&t instanceof Mt||e instanceof Ct&&t instanceof Ct?E(e.elements,t.elements,Ie):e instanceof It&&t instanceof It?Ie(e.Be,t.Be):e instanceof Tt&&t instanceof Tt}(e.transform,t.transform)}(e,t)})))}function qt(e){return e instanceof rn?e.version:O.min()}var Gt=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).key=t,i.value=n,i.Qe=r,i.type=0,i}return i.__extends(t,e),t}(Ut),Wt=function(e){function t(t,n,r,i){var o=this;return(o=e.call(this)||this).key=t,o.data=n,o.qe=r,o.Qe=i,o.type=1,o}return i.__extends(t,e),t}(Ut);function Jt(e,t){return function(e,t){var n=new en(t);return e.qe.fields.forEach((function(t){if(!t._()){var r=e.data.field(t);null!==r?n.set(t,r):n.delete(t)}})),n.ze()}(e,t instanceof rn?t.data():$t.empty())}var Zt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.fieldTransforms=n,r.type=2,r.Qe=Ft.exists(!0),r}return i.__extends(t,e),t}(Ut);function Xt(e,t){return t}function Yt(e,t,n){for(var r=new en(t),i=0;i<e.fieldTransforms.length;i++){var o=e.fieldTransforms[i];r.set(o.field,n[i])}return r.ze()}var Qt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.Qe=n,r.type=3,r}return i.__extends(t,e),t}(Ut),Kt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.Qe=n,r.type=4,r}return i.__extends(t,e),t}(Ut),$t=function(){function e(e){this.proto=e}return e.empty=function(){return new e({mapValue:{}})},e.prototype.field=function(e){if(e._())return this.proto;for(var t=this.proto,n=0;n<e.length-1;++n){if(!t.mapValue.fields)return null;if(!qe(t=t.mapValue.fields[e.get(n)]))return null}return(t=(t.mapValue.fields||{})[e.S()])||null},e.prototype.isEqual=function(e){return Ie(this.proto,e.proto)},e}(),en=function(){function e(e){void 0===e&&(e=$t.empty()),this.He=e,this.Ye=new Map}return e.prototype.set=function(e,t){return this.Je(e,t),this},e.prototype.delete=function(e){return this.Je(e,null),this},e.prototype.Je=function(e,t){for(var n=this.Ye,r=0;r<e.length-1;++r){var i=e.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===ke(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(e.S(),t)},e.prototype.ze=function(){var e=this.Xe(F.$(),this.Ye);return null!=e?new $t(e):this.He},e.prototype.Xe=function(e,t){var n=this,r=!1,i=this.He.field(e),o=qe(i)?Object.assign({},i.mapValue.fields):{};return t.forEach((function(t,i){if(t instanceof Map){var a=n.Xe(e.child(i),t);null!=a&&(o[i]=a,r=!0)}else null!==t?(o[i]=t,r=!0):o.hasOwnProperty(i)&&(delete o[i],r=!0)})),r?{mapValue:{fields:o}}:null},e}();function tn(e){var t=[];return M(e.fields||{},(function(e,n){var r=new F([e]);if(qe(n)){var i=tn(n.mapValue).fields;if(0===i.length)t.push(r);else for(var o=0,a=i;o<a.length;o++){var s=a[o];t.push(r.child(s))}}else t.push(r)})),new Nt(t)+ */var Nt=function(){function e(e){this.fields=e,e.sort(F.P)}return e.prototype.Ke=function(e){for(var t=0,n=this.fields;t<n.length;t++)if(n[t].D(e))return!0;return!1},e.prototype.isEqual=function(e){return E(this.fields,e.fields,(function(e,t){return e.isEqual(t)}))},e}(),Dt=function(e,t){this.field=e,this.transform=t},Lt=function(e,t){this.version=e,this.transformResults=t},Ft=function(){function e(e,t){this.updateTime=e,this.exists=t}return e.We=function(){return new e},e.exists=function(t){return new e(void 0,t)},e.updateTime=function(t){return new e(t)},Object.defineProperty(e.prototype,"Ue",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)},e}();function jt(e,t){return void 0!==e.updateTime?t instanceof rn&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t instanceof rn}var Ut=function(){};function Bt(e,t,n){return e instanceof Gt?function(e,t,n){return new rn(e.key,n.version,e.value,{hasCommittedMutations:!0})}(e,0,n):e instanceof Wt?function(e,t,n){if(!jt(e.Qe,t))return new an(e.key,n.version);var r=Jt(e,t);return new rn(e.key,n.version,r,{hasCommittedMutations:!0})}(e,t,n):e instanceof Zt?function(e,t,n){if(y(null!=n.transformResults),!jt(e.Qe,t))return new an(e.key,n.version);var r=Yt(e,t),i=function(e,t,n){var r=[];y(e.length===n.length);for(var i=0;i<n.length;i++){var o=e[i],a=o.transform,s=null;t instanceof rn&&(s=t.field(o.field)),r.push(xt(a,s,n[i]))}return r}(e.fieldTransforms,t,n.transformResults),o=n.version,a=Xt(e,r.data(),i);return new rn(e.key,o,a,{hasCommittedMutations:!0})}(e,t,n):function(e,t,n){return new on(e.key,n.version,{hasCommittedMutations:!0})}(e,0,n)}function Vt(e,t,n,r){return e instanceof Gt?function(e,t){if(!jt(e.Qe,t))return t;var n=qt(t);return new rn(e.key,n,e.value,{Ge:!0})}(e,t):e instanceof Wt?function(e,t){if(!jt(e.Qe,t))return t;var n=qt(t),r=Jt(e,t);return new rn(e.key,n,r,{Ge:!0})}(e,t):e instanceof Zt?function(e,t,n,r){if(!jt(e.Qe,t))return t;var i=Yt(e,t),o=function(e,t,n,r){for(var i=[],o=0,a=e;o<a.length;o++){var s=a[o],c=s.transform,l=null;n instanceof rn&&(l=n.field(s.field)),null===l&&r instanceof rn&&(l=r.field(s.field)),i.push(At(c,l,t))}return i}(e.fieldTransforms,n,t,r),a=Xt(e,i.data(),o);return new rn(e.key,i.version,a,{Ge:!0})}(e,t,r,n):function(e,t){return jt(e.Qe,t)?new on(e.key,O.min()):t}(e,t)}function Ht(e,t){return e instanceof Zt?function(e,t){for(var n=null,r=0,i=e.fieldTransforms;r<i.length;r++){var o=i[r],a=t instanceof rn?t.field(o.field):void 0,s=St(o.transform,a||null);null!=s&&(n=null==n?(new en).set(o.field,s):n.set(o.field,s))}return n?n.ze():null}(e,t):null}function zt(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.Qe.isEqual(t.Qe)&&(0===e.type?e.value.isEqual(t.value):1===e.type?e.data.isEqual(t.data)&&e.qe.isEqual(t.qe):2!==e.type||E(e.fieldTransforms,e.fieldTransforms,(function(e,t){return function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof Mt&&t instanceof Mt||e instanceof Ct&&t instanceof Ct?E(e.elements,t.elements,Ie):e instanceof It&&t instanceof It?Ie(e.Be,t.Be):e instanceof Tt&&t instanceof Tt}(e.transform,t.transform)}(e,t)})))}function qt(e){return e instanceof rn?e.version:O.min()}var Gt=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).key=t,i.value=n,i.Qe=r,i.type=0,i}return i.__extends(t,e),t}(Ut),Wt=function(e){function t(t,n,r,i){var o=this;return(o=e.call(this)||this).key=t,o.data=n,o.qe=r,o.Qe=i,o.type=1,o}return i.__extends(t,e),t}(Ut);function Jt(e,t){return function(e,t){var n=new en(t);return e.qe.fields.forEach((function(t){if(!t._()){var r=e.data.field(t);null!==r?n.set(t,r):n.delete(t)}})),n.ze()}(e,t instanceof rn?t.data():$t.empty())}var Zt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.fieldTransforms=n,r.type=2,r.Qe=Ft.exists(!0),r}return i.__extends(t,e),t}(Ut);function Yt(e,t){return t}function Xt(e,t,n){for(var r=new en(t),i=0;i<e.fieldTransforms.length;i++){var o=e.fieldTransforms[i];r.set(o.field,n[i])}return r.ze()}var Qt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.Qe=n,r.type=3,r}return i.__extends(t,e),t}(Ut),Kt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.Qe=n,r.type=4,r}return i.__extends(t,e),t}(Ut),$t=function(){function e(e){this.proto=e}return e.empty=function(){return new e({mapValue:{}})},e.prototype.field=function(e){if(e._())return this.proto;for(var t=this.proto,n=0;n<e.length-1;++n){if(!t.mapValue.fields)return null;if(!qe(t=t.mapValue.fields[e.get(n)]))return null}return(t=(t.mapValue.fields||{})[e.S()])||null},e.prototype.isEqual=function(e){return Ie(this.proto,e.proto)},e}(),en=function(){function e(e){void 0===e&&(e=$t.empty()),this.He=e,this.Ye=new Map}return e.prototype.set=function(e,t){return this.Je(e,t),this},e.prototype.delete=function(e){return this.Je(e,null),this},e.prototype.Je=function(e,t){for(var n=this.Ye,r=0;r<e.length-1;++r){var i=e.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===ke(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(e.S(),t)},e.prototype.ze=function(){var e=this.Xe(F.$(),this.Ye);return null!=e?new $t(e):this.He},e.prototype.Xe=function(e,t){var n=this,r=!1,i=this.He.field(e),o=qe(i)?Object.assign({},i.mapValue.fields):{};return t.forEach((function(t,i){if(t instanceof Map){var a=n.Xe(e.child(i),t);null!=a&&(o[i]=a,r=!0)}else null!==t?(o[i]=t,r=!0):o.hasOwnProperty(i)&&(delete o[i],r=!0)})),r?{mapValue:{fields:o}}:null},e}();function tn(e){var t=[];return M(e.fields||{},(function(e,n){var r=new F([e]);if(qe(n)){var i=tn(n.mapValue).fields;if(0===i.length)t.push(r);else for(var o=0,a=i;o<a.length;o++){var s=a[o];t.push(r.child(s))}}else t.push(r)})),new Nt(t)/*** @license* Copyright 2017 Google LLC@@ -792,7 +792,7 @@ var re=function(){function e(e){this.P=e,this.data=new ee(this.P)}return e.proto* See the License for the specific language governing permissions and* limitations under the License.*/-var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},Zn=function(){function e(e,t,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.ms=e,this.Is=t,this.As=n,this.Rs=r,this.Ps=i,this.gs=0,this.Vs=null,this.ys=Date.now(),this.reset()}return e.prototype.reset=function(){this.gs=0},e.prototype.ps=function(){this.gs=this.Ps},e.prototype.bs=function(e){var t=this;this.cancel();var n=Math.floor(this.gs+this.vs()),r=Math.max(0,Date.now()-this.ys),i=Math.max(0,n-r);i>0&&d("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.gs+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Vs=this.ms.Ss(this.Is,i,(function(){return t.ys=Date.now(),e()})),this.gs*=this.Rs,this.gs<this.As&&(this.gs=this.As),this.gs>this.Ps&&(this.gs=this.Ps)},e.prototype.Ds=function(){null!==this.Vs&&(this.Vs.Cs(),this.Vs=null)},e.prototype.cancel=function(){null!==this.Vs&&(this.Vs.cancel(),this.Vs=null)},e.prototype.vs=function(){return(Math.random()-.5)*this.gs},e}(),Xn=function(){function t(e,n,r){this.name=e,this.version=n,this.Ns=r,12.2===t.Fs(s.getUA())&&p("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return t.delete=function(e){return d("SimpleDb","Removing database:",e),tr(window.indexedDB.deleteDatabase(e)).Sn()},t.ks=function(){if("undefined"==typeof indexedDB)return!1;if(t.$s())return!0;var e=s.getUA(),n=t.Fs(e),r=0<n&&n<10,i=t.xs(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)},t.$s=function(){var t;return void 0!==e&&"YES"===(null===(t=e.env)||void 0===t?void 0:t.Os)},t.Ms=function(e,t){return e.store(t)},t.Fs=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.xs=function(e){var t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.Ls=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t=this;return i.__generator(this,(function(n){switch(n.label){case 0:return this.db?[3,2]:(d("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,n){var r=indexedDB.open(t.name,t.version);r.onsuccess=function(t){var n=t.target.result;e(n)},r.onblocked=function(){n(new Qn("Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=function(e){var t=e.target.error;"VersionError"===t.name?n(new I(k.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):n(new Qn(t))},r.onupgradeneeded=function(e){d("SimpleDb",'Database "'+t.name+'" requires upgrade from version:',e.oldVersion);var n=e.target.result;t.Ns.createOrUpgrade(n,r.transaction,e.oldVersion,t.version).next((function(){d("SimpleDb","Database upgrade to version "+t.version+" complete")}))}}))]);case 1:e.db=n.sent(),n.label=2;case 2:return[2,(this.qs&&(this.db.onversionchange=function(e){return t.qs(e)}),this.db)]}}))}))},t.prototype.Bs=function(e){this.qs=e,this.db&&(this.db.onversionchange=function(t){return e(t)})},t.prototype.runTransaction=function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,c;return i.__generator(this,(function(l){switch(l.label){case 0:r="readonly"===e,o=0,a=function(){var e,a,c,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:++o,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,s.Ls()];case 2:return s.db=i.sent(),e=$n.open(s.db,r?"readonly":"readwrite",t),a=n(e).catch((function(t){return e.abort(t),Bn.reject(t)})).Sn(),c={},a.catch((function(){})),[4,e.Us];case 3:return[2,(c.value=(i.sent(),a),c)];case 4:return l=i.sent(),u="FirebaseError"!==l.name&&o<3,d("SimpleDb","Transaction failed with error: %s. Retrying: %s.",l.message,u),s.close(),u?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}))},s=this,l.label=1;case 1:return[5,a()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),Yn=function(){function e(e){this.Qs=e,this.Ws=!1,this.js=null}return Object.defineProperty(e.prototype,"yn",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Ks",{get:function(){return this.js},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.Qs=e},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Ws=!0},e.prototype.Gs=function(e){this.js=e},e.prototype.delete=function(){return tr(this.Qs.delete())},e}(),Qn=function(e){function t(t){var n=this;return(n=e.call(this,k.UNAVAILABLE,"IndexedDB transaction failed: "+t)||this).name="IndexedDbTransactionError",n}return i.__extends(t,e),t}(I);+var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},Zn=function(){function e(e,t,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.ms=e,this.Is=t,this.As=n,this.Rs=r,this.Ps=i,this.gs=0,this.Vs=null,this.ys=Date.now(),this.reset()}return e.prototype.reset=function(){this.gs=0},e.prototype.ps=function(){this.gs=this.Ps},e.prototype.bs=function(e){var t=this;this.cancel();var n=Math.floor(this.gs+this.vs()),r=Math.max(0,Date.now()-this.ys),i=Math.max(0,n-r);i>0&&d("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.gs+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Vs=this.ms.Ss(this.Is,i,(function(){return t.ys=Date.now(),e()})),this.gs*=this.Rs,this.gs<this.As&&(this.gs=this.As),this.gs>this.Ps&&(this.gs=this.Ps)},e.prototype.Ds=function(){null!==this.Vs&&(this.Vs.Cs(),this.Vs=null)},e.prototype.cancel=function(){null!==this.Vs&&(this.Vs.cancel(),this.Vs=null)},e.prototype.vs=function(){return(Math.random()-.5)*this.gs},e}(),Yn=function(){function t(e,n,r){this.name=e,this.version=n,this.Ns=r,12.2===t.Fs(s.getUA())&&p("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return t.delete=function(e){return d("SimpleDb","Removing database:",e),tr(window.indexedDB.deleteDatabase(e)).Sn()},t.ks=function(){if("undefined"==typeof indexedDB)return!1;if(t.$s())return!0;var e=s.getUA(),n=t.Fs(e),r=0<n&&n<10,i=t.xs(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)},t.$s=function(){var t;return void 0!==e&&"YES"===(null===(t=e.env)||void 0===t?void 0:t.Os)},t.Ms=function(e,t){return e.store(t)},t.Fs=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.xs=function(e){var t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.Ls=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t=this;return i.__generator(this,(function(n){switch(n.label){case 0:return this.db?[3,2]:(d("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,n){var r=indexedDB.open(t.name,t.version);r.onsuccess=function(t){var n=t.target.result;e(n)},r.onblocked=function(){n(new Qn("Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=function(e){var t=e.target.error;"VersionError"===t.name?n(new I(k.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):n(new Qn(t))},r.onupgradeneeded=function(e){d("SimpleDb",'Database "'+t.name+'" requires upgrade from version:',e.oldVersion);var n=e.target.result;t.Ns.createOrUpgrade(n,r.transaction,e.oldVersion,t.version).next((function(){d("SimpleDb","Database upgrade to version "+t.version+" complete")}))}}))]);case 1:e.db=n.sent(),n.label=2;case 2:return[2,(this.qs&&(this.db.onversionchange=function(e){return t.qs(e)}),this.db)]}}))}))},t.prototype.Bs=function(e){this.qs=e,this.db&&(this.db.onversionchange=function(t){return e(t)})},t.prototype.runTransaction=function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,c;return i.__generator(this,(function(l){switch(l.label){case 0:r="readonly"===e,o=0,a=function(){var e,a,c,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:++o,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,s.Ls()];case 2:return s.db=i.sent(),e=$n.open(s.db,r?"readonly":"readwrite",t),a=n(e).catch((function(t){return e.abort(t),Bn.reject(t)})).Sn(),c={},a.catch((function(){})),[4,e.Us];case 3:return[2,(c.value=(i.sent(),a),c)];case 4:return l=i.sent(),u="FirebaseError"!==l.name&&o<3,d("SimpleDb","Transaction failed with error: %s. Retrying: %s.",l.message,u),s.close(),u?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}))},s=this,l.label=1;case 1:return[5,a()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),Xn=function(){function e(e){this.Qs=e,this.Ws=!1,this.js=null}return Object.defineProperty(e.prototype,"yn",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Ks",{get:function(){return this.js},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.Qs=e},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Ws=!0},e.prototype.Gs=function(e){this.js=e},e.prototype.delete=function(){return tr(this.Qs.delete())},e}(),Qn=function(e){function t(t){var n=this;return(n=e.call(this,k.UNAVAILABLE,"IndexedDB transaction failed: "+t)||this).name="IndexedDbTransactionError",n}return i.__extends(t,e),t}(I);/*** @license* Copyright 2017 Google LLC@@ -808,7 +808,7 @@ var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */function Kn(e){return"IndexedDbTransactionError"===e.name}var $n=function(){function e(e){var t=this;this.transaction=e,this.aborted=!1,this.zs=new Jn,this.transaction.oncomplete=function(){t.zs.resolve()},this.transaction.onabort=function(){e.error?t.zs.reject(new Qn(e.error)):t.zs.resolve()},this.transaction.onerror=function(e){var n=rr(e.target.error);t.zs.reject(new Qn(n))}}return e.open=function(t,n,r){try{return new e(t.transaction(r,n))}catch(t){throw new Qn(t)}},Object.defineProperty(e.prototype,"Us",{get:function(){return this.zs.promise},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){e&&this.zs.reject(e),this.aborted||(d("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},e.prototype.store=function(e){var t=this.transaction.objectStore(e);return new er(t)},e}(),er=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0!==t?(d("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(d("SimpleDb","PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),tr(n)},e.prototype.add=function(e){return d("SimpleDb","ADD",this.store.name,e,e),tr(this.store.add(e))},e.prototype.get=function(e){var t=this;return tr(this.store.get(e)).next((function(n){return void 0===n&&(n=null),d("SimpleDb","GET",t.store.name,e,n),n}))},e.prototype.delete=function(e){return d("SimpleDb","DELETE",this.store.name,e),tr(this.store.delete(e))},e.prototype.count=function(){return d("SimpleDb","COUNT",this.store.name),tr(this.store.count())},e.prototype.Hs=function(e,t){var n=this.cursor(this.options(e,t)),r=[];return this.Ys(n,(function(e,t){r.push(t)})).next((function(){return r}))},e.prototype.Js=function(e,t){d("SimpleDb","DELETE ALL",this.store.name);var n=this.options(e,t);n.Xs=!1;var r=this.cursor(n);return this.Ys(r,(function(e,t,n){return n.delete()}))},e.prototype.Zs=function(e,t){var n;t?n=e:(n={},t=e);var r=this.cursor(n);return this.Ys(r,t)},e.prototype.ti=function(e){var t=this.cursor({});return new Bn((function(n,r){t.onerror=function(e){var t=rr(e.target.error);r(t)},t.onsuccess=function(t){var r=t.target.result;r?e(r.primaryKey,r.value).next((function(e){e?r.continue():n()})):n()}}))},e.prototype.Ys=function(e,t){var n=[];return new Bn((function(r,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var o=new Yn(i),a=t(i.primaryKey,i.value,o);if(a instanceof Bn){var s=a.catch((function(e){return o.done(),Bn.reject(e)}));n.push(s)}o.yn?r():null===o.Ks?i.continue():i.continue(o.Ks)}else r()}})).next((function(){return Bn.Cn(n)}))},e.prototype.options=function(e,t){var n=void 0;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.Xs?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function tr(e){return new Bn((function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){var t=rr(e.target.error);n(t)}}))}var nr=!1;function rr(e){var t=Xn.Fs(s.getUA());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var r=new I("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return nr||(nr=!0,setTimeout((function(){throw r}),0)),r}}return e}+ */function Kn(e){return"IndexedDbTransactionError"===e.name}var $n=function(){function e(e){var t=this;this.transaction=e,this.aborted=!1,this.zs=new Jn,this.transaction.oncomplete=function(){t.zs.resolve()},this.transaction.onabort=function(){e.error?t.zs.reject(new Qn(e.error)):t.zs.resolve()},this.transaction.onerror=function(e){var n=rr(e.target.error);t.zs.reject(new Qn(n))}}return e.open=function(t,n,r){try{return new e(t.transaction(r,n))}catch(t){throw new Qn(t)}},Object.defineProperty(e.prototype,"Us",{get:function(){return this.zs.promise},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){e&&this.zs.reject(e),this.aborted||(d("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},e.prototype.store=function(e){var t=this.transaction.objectStore(e);return new er(t)},e}(),er=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0!==t?(d("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(d("SimpleDb","PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),tr(n)},e.prototype.add=function(e){return d("SimpleDb","ADD",this.store.name,e,e),tr(this.store.add(e))},e.prototype.get=function(e){var t=this;return tr(this.store.get(e)).next((function(n){return void 0===n&&(n=null),d("SimpleDb","GET",t.store.name,e,n),n}))},e.prototype.delete=function(e){return d("SimpleDb","DELETE",this.store.name,e),tr(this.store.delete(e))},e.prototype.count=function(){return d("SimpleDb","COUNT",this.store.name),tr(this.store.count())},e.prototype.Hs=function(e,t){var n=this.cursor(this.options(e,t)),r=[];return this.Ys(n,(function(e,t){r.push(t)})).next((function(){return r}))},e.prototype.Js=function(e,t){d("SimpleDb","DELETE ALL",this.store.name);var n=this.options(e,t);n.Xs=!1;var r=this.cursor(n);return this.Ys(r,(function(e,t,n){return n.delete()}))},e.prototype.Zs=function(e,t){var n;t?n=e:(n={},t=e);var r=this.cursor(n);return this.Ys(r,t)},e.prototype.ti=function(e){var t=this.cursor({});return new Bn((function(n,r){t.onerror=function(e){var t=rr(e.target.error);r(t)},t.onsuccess=function(t){var r=t.target.result;r?e(r.primaryKey,r.value).next((function(e){e?r.continue():n()})):n()}}))},e.prototype.Ys=function(e,t){var n=[];return new Bn((function(r,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var o=new Xn(i),a=t(i.primaryKey,i.value,o);if(a instanceof Bn){var s=a.catch((function(e){return o.done(),Bn.reject(e)}));n.push(s)}o.yn?r():null===o.Ks?i.continue():i.continue(o.Ks)}else r()}})).next((function(){return Bn.Cn(n)}))},e.prototype.options=function(e,t){var n=void 0;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.Xs?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function tr(e){return new Bn((function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){var t=rr(e.target.error);n(t)}}))}var nr=!1;function rr(e){var t=Yn.Fs(s.getUA());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var r=new I("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return nr||(nr=!0,setTimeout((function(){throw r}),0)),r}}return e}/*** @license* Copyright 2020 Google LLC@@ -872,7 +872,7 @@ var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var br=function(e){this._r=e};function _r(e,t){if(t.document)return function(e,t,n){var r=it(e,t.name),i=et(t.updateTime),o=new $t({mapValue:{fields:t.fields}});return new rn(r,i,o,{hasCommittedMutations:!!n})}(e._r,t.document,!!t.hasCommittedMutations);if(t.noDocument){var n=j.K(t.noDocument.path),r=Sr(t.noDocument.readTime);return new on(n,r,{hasCommittedMutations:!!t.hasCommittedMutations})}if(t.unknownDocument){var i=j.K(t.unknownDocument.path),o=Sr(t.unknownDocument.version);return new an(i,o)}return g()}function wr(e,t,n){var r=Er(n),i=t.key.path.p().N();if(t instanceof rn){var o=function(e,t){return{name:rt(e,t.key),fields:t.tn().mapValue.fields,updateTime:Qe(e,t.version.A())}}(e._r,t),a=t.hasCommittedMutations;return new Yr(null,null,o,a,r,i)}if(t instanceof on){var s=t.key.path.N(),c=xr(t.version),l=t.hasCommittedMutations;return new Yr(null,new Zr(s,c),null,l,r,i)}if(t instanceof an){var u=t.key.path.N(),h=xr(t.version);return new Yr(new Xr(u,h),null,null,!0,r,i)}return g()}function Er(e){var t=e.A();return[t.seconds,t.nanoseconds]}function Ar(e){var t=new P(e[0],e[1]);return O.m(t)}function xr(e){var t=e.A();return new zr(t.seconds,t.nanoseconds)}function Sr(e){var t=new P(e.seconds,e.nanoseconds);return O.m(t)}function Tr(e,t){var n=(t.baseMutations||[]).map((function(t){return ht(e._r,t)})),r=t.mutations.map((function(t){return ht(e._r,t)})),i=P.fromMillis(t.localWriteTimeMs);return new jn(t.batchId,i,n,r)}function Mr(e){var t,n,r=Sr(e.readTime),i=void 0!==e.lastLimboFreeSnapshotVersion?Sr(e.lastLimboFreeSnapshotVersion):O.min();return void 0!==e.query.documents?(y(1===(n=e.query).documents.length),t=pn(un(at(n.documents[0])))):t=function(e){var t=at(e.parent),n=e.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){y(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:t=t.child(o.collectionId)}var a=[];n.where&&(a=function e(t){return t?void 0!==t.unaryFilter?[bt(t)]:void 0!==t.fieldFilter?[vt(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return e(t)})).reduce((function(e,t){return e.concat(t)})):g():[]}(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(e){return new Dn(yt((t=e).field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction));var t})));var c=null;n.limit&&(c=function(e){var t;return U(t="object"==typeof e?e.value:e)?null:t}(n.limit));var l=null;n.startAt&&(l=mt(n.startAt));var u=null;return n.endAt&&(u=mt(n.endAt)),pn(ln(t,i,s,a,c,"F",l,u))}(e.query),new Y(t,e.targetId,0,e.lastListenSequenceNumber,r,i,J.fromBase64String(e.resumeToken))}function Rr(e,t){var n,r=xr(t.Z),i=xr(t.lastLimboFreeSnapshotVersion);n=W(t.target)?dt(e._r,t.target):pt(e._r,t.target);var o=t.resumeToken.toBase64();return new Kr(t.targetId,q(t.target),r,o,t.sequenceNumber,i,n)}+ */var br=function(e){this._r=e};function _r(e,t){if(t.document)return function(e,t,n){var r=it(e,t.name),i=et(t.updateTime),o=new $t({mapValue:{fields:t.fields}});return new rn(r,i,o,{hasCommittedMutations:!!n})}(e._r,t.document,!!t.hasCommittedMutations);if(t.noDocument){var n=j.K(t.noDocument.path),r=Sr(t.noDocument.readTime);return new on(n,r,{hasCommittedMutations:!!t.hasCommittedMutations})}if(t.unknownDocument){var i=j.K(t.unknownDocument.path),o=Sr(t.unknownDocument.version);return new an(i,o)}return g()}function wr(e,t,n){var r=Er(n),i=t.key.path.p().N();if(t instanceof rn){var o=function(e,t){return{name:rt(e,t.key),fields:t.tn().mapValue.fields,updateTime:Qe(e,t.version.A())}}(e._r,t),a=t.hasCommittedMutations;return new Xr(null,null,o,a,r,i)}if(t instanceof on){var s=t.key.path.N(),c=xr(t.version),l=t.hasCommittedMutations;return new Xr(null,new Zr(s,c),null,l,r,i)}if(t instanceof an){var u=t.key.path.N(),h=xr(t.version);return new Xr(new Yr(u,h),null,null,!0,r,i)}return g()}function Er(e){var t=e.A();return[t.seconds,t.nanoseconds]}function Ar(e){var t=new P(e[0],e[1]);return O.m(t)}function xr(e){var t=e.A();return new zr(t.seconds,t.nanoseconds)}function Sr(e){var t=new P(e.seconds,e.nanoseconds);return O.m(t)}function Tr(e,t){var n=(t.baseMutations||[]).map((function(t){return ht(e._r,t)})),r=t.mutations.map((function(t){return ht(e._r,t)})),i=P.fromMillis(t.localWriteTimeMs);return new jn(t.batchId,i,n,r)}function Mr(e){var t,n,r=Sr(e.readTime),i=void 0!==e.lastLimboFreeSnapshotVersion?Sr(e.lastLimboFreeSnapshotVersion):O.min();return void 0!==e.query.documents?(y(1===(n=e.query).documents.length),t=pn(un(at(n.documents[0])))):t=function(e){var t=at(e.parent),n=e.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){y(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:t=t.child(o.collectionId)}var a=[];n.where&&(a=function e(t){return t?void 0!==t.unaryFilter?[bt(t)]:void 0!==t.fieldFilter?[vt(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return e(t)})).reduce((function(e,t){return e.concat(t)})):g():[]}(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(e){return new Dn(yt((t=e).field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction));var t})));var c=null;n.limit&&(c=function(e){var t;return U(t="object"==typeof e?e.value:e)?null:t}(n.limit));var l=null;n.startAt&&(l=mt(n.startAt));var u=null;return n.endAt&&(u=mt(n.endAt)),pn(ln(t,i,s,a,c,"F",l,u))}(e.query),new X(t,e.targetId,0,e.lastListenSequenceNumber,r,i,J.fromBase64String(e.resumeToken))}function Rr(e,t){var n,r=xr(t.Z),i=xr(t.lastLimboFreeSnapshotVersion);n=W(t.target)?dt(e._r,t.target):pt(e._r,t.target);var o=t.resumeToken.toBase64();return new Kr(t.targetId,q(t.target),r,o,t.sequenceNumber,i,n)}/*** @license* Copyright 2017 Google LLC@@ -904,7 +904,7 @@ var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var Dr=function(){function e(e,t){this.serializer=e,this.zn=t}return e.prototype.xn=function(e,t,n){return Fr(e).put(jr(t),n)},e.prototype.Mn=function(e,t){var n=Fr(e),r=jr(t);return n.delete(r)},e.prototype.updateMetadata=function(e,t){var n=this;return this.getMetadata(e).next((function(r){return r.byteSize+=t,n.kr(e,r)}))},e.prototype.Ln=function(e,t){var n=this;return Fr(e).get(jr(t)).next((function(e){return n.$r(e)}))},e.prototype.xr=function(e,t){var n=this;return Fr(e).get(jr(t)).next((function(e){var t=n.$r(e);return t?{Or:t,size:Ur(e)}:null}))},e.prototype.getEntries=function(e,t){var n=this,r=se();return this.Mr(e,t,(function(e,t){var i=n.$r(t);r=r.st(e,i)})).next((function(){return r}))},e.prototype.Lr=function(e,t){var n=this,r=se(),i=new ee(j.P);return this.Mr(e,t,(function(e,t){var o=n.$r(t);o?(r=r.st(e,o),i=i.st(e,Ur(t))):(r=r.st(e,null),i=i.st(e,0))})).next((function(){return{qr:r,Br:i}}))},e.prototype.Mr=function(e,t,n){if(t._())return Bn.resolve();var r=IDBKeyRange.bound(t.first().path.N(),t.last().path.N()),i=t.ct(),o=i.wt();return Fr(e).Zs({range:r},(function(e,t,r){for(var a=j.K(e);o&&j.P(o,a)<0;)n(o,null),o=i.wt();o&&o.isEqual(a)&&(n(o,t),o=i.Tt()?i.wt():null),o?r.Gs(o.path.N()):r.done()})).next((function(){for(;o;)n(o,null),o=i.Tt()?i.wt():null}))},e.prototype.ns=function(e,t,n){var r=this,i=le(),o=t.path.length+1,a={};if(n.isEqual(O.min())){var s=t.path.N();a.range=IDBKeyRange.lowerBound(s)}else{var c=t.path.N(),l=Er(n);a.range=IDBKeyRange.lowerBound([c,l],!0),a.index=Yr.collectionReadTimeIndex}return Fr(e).Zs(a,(function(e,n,a){if(e.length===o){var s=_r(r.serializer,n);t.path.D(s.key.path)?s instanceof rn&&_n(t,s)&&(i=i.st(s.key,s)):a.done()}})).next((function(){return i}))},e.prototype.Ur=function(e,t){var n=this,r=ae(),i=Er(t),o=Fr(e),a=IDBKeyRange.lowerBound(i,!0);return o.Zs({index:Yr.readTimeIndex,range:a},(function(e,t){var o=_r(n.serializer,t);r=r.st(o.key,o),i=t.readTime})).next((function(){return{Qr:r,readTime:Ar(i)}}))},e.prototype.Wr=function(e){var t=Fr(e),n=O.min();return t.Zs({index:Yr.readTimeIndex,reverse:!0},(function(e,t,r){t.readTime&&(n=Ar(t.readTime)),r.done()})).next((function(){return n}))},e.prototype.jr=function(t){return new e.Kr(this,!!t&&t.Gr)},e.prototype.zr=function(e){return this.getMetadata(e).next((function(e){return e.byteSize}))},e.prototype.getMetadata=function(e){return Lr(e).get(Qr.key).next((function(e){return y(!!e),e}))},e.prototype.kr=function(e,t){return Lr(e).put(Qr.key,t)},e.prototype.$r=function(e){if(e){var t=_r(this.serializer,e);return t instanceof on&&t.version.isEqual(O.min())?null:t}return null},e}();function Lr(e){return fi.Ms(e,Qr.store)}function Fr(e){return fi.Ms(e,Yr.store)}function jr(e){return e.path.N()}function Ur(e){var t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw g();t=e.noDocument}return JSON.stringify(t).length}+ */var Dr=function(){function e(e,t){this.serializer=e,this.zn=t}return e.prototype.xn=function(e,t,n){return Fr(e).put(jr(t),n)},e.prototype.Mn=function(e,t){var n=Fr(e),r=jr(t);return n.delete(r)},e.prototype.updateMetadata=function(e,t){var n=this;return this.getMetadata(e).next((function(r){return r.byteSize+=t,n.kr(e,r)}))},e.prototype.Ln=function(e,t){var n=this;return Fr(e).get(jr(t)).next((function(e){return n.$r(e)}))},e.prototype.xr=function(e,t){var n=this;return Fr(e).get(jr(t)).next((function(e){var t=n.$r(e);return t?{Or:t,size:Ur(e)}:null}))},e.prototype.getEntries=function(e,t){var n=this,r=se();return this.Mr(e,t,(function(e,t){var i=n.$r(t);r=r.st(e,i)})).next((function(){return r}))},e.prototype.Lr=function(e,t){var n=this,r=se(),i=new ee(j.P);return this.Mr(e,t,(function(e,t){var o=n.$r(t);o?(r=r.st(e,o),i=i.st(e,Ur(t))):(r=r.st(e,null),i=i.st(e,0))})).next((function(){return{qr:r,Br:i}}))},e.prototype.Mr=function(e,t,n){if(t._())return Bn.resolve();var r=IDBKeyRange.bound(t.first().path.N(),t.last().path.N()),i=t.ct(),o=i.wt();return Fr(e).Zs({range:r},(function(e,t,r){for(var a=j.K(e);o&&j.P(o,a)<0;)n(o,null),o=i.wt();o&&o.isEqual(a)&&(n(o,t),o=i.Tt()?i.wt():null),o?r.Gs(o.path.N()):r.done()})).next((function(){for(;o;)n(o,null),o=i.Tt()?i.wt():null}))},e.prototype.ns=function(e,t,n){var r=this,i=le(),o=t.path.length+1,a={};if(n.isEqual(O.min())){var s=t.path.N();a.range=IDBKeyRange.lowerBound(s)}else{var c=t.path.N(),l=Er(n);a.range=IDBKeyRange.lowerBound([c,l],!0),a.index=Xr.collectionReadTimeIndex}return Fr(e).Zs(a,(function(e,n,a){if(e.length===o){var s=_r(r.serializer,n);t.path.D(s.key.path)?s instanceof rn&&_n(t,s)&&(i=i.st(s.key,s)):a.done()}})).next((function(){return i}))},e.prototype.Ur=function(e,t){var n=this,r=ae(),i=Er(t),o=Fr(e),a=IDBKeyRange.lowerBound(i,!0);return o.Zs({index:Xr.readTimeIndex,range:a},(function(e,t){var o=_r(n.serializer,t);r=r.st(o.key,o),i=t.readTime})).next((function(){return{Qr:r,readTime:Ar(i)}}))},e.prototype.Wr=function(e){var t=Fr(e),n=O.min();return t.Zs({index:Xr.readTimeIndex,reverse:!0},(function(e,t,r){t.readTime&&(n=Ar(t.readTime)),r.done()})).next((function(){return n}))},e.prototype.jr=function(t){return new e.Kr(this,!!t&&t.Gr)},e.prototype.zr=function(e){return this.getMetadata(e).next((function(e){return e.byteSize}))},e.prototype.getMetadata=function(e){return Lr(e).get(Qr.key).next((function(e){return y(!!e),e}))},e.prototype.kr=function(e,t){return Lr(e).put(Qr.key,t)},e.prototype.$r=function(e){if(e){var t=_r(this.serializer,e);return t instanceof on&&t.version.isEqual(O.min())?null:t}return null},e}();function Lr(e){return fi.Ms(e,Qr.store)}function Fr(e){return fi.Ms(e,Xr.store)}function jr(e){return e.path.N()}function Ur(e){var t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw g();t=e.noDocument}return JSON.stringify(t).length}/*** @license* Copyright 2019 Google LLC@@ -920,7 +920,7 @@ var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */Dr.Kr=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Hr=t,r.Gr=n,r.Yr=new C((function(e){return e.toString()}),(function(e,t){return e.isEqual(t)})),r}return i.__extends(t,e),t.prototype.Un=function(e){var t=this,n=[],r=0,i=new re((function(e,t){return w(e.F(),t.F())}));return this.Fn.forEach((function(o,a){var s=t.Yr.get(o);if(a){var c=wr(t.Hr.serializer,a,t.readTime);i=i.add(o.path.p());var l=Ur(c);r+=l-s,n.push(t.Hr.xn(e,o,c))}else if(r-=s,t.Gr){var u=wr(t.Hr.serializer,new on(o,O.min()),t.readTime);n.push(t.Hr.xn(e,o,u))}else n.push(t.Hr.Mn(e,o))})),i.forEach((function(r){n.push(t.Hr.zn.Ar(e,r))})),n.push(this.Hr.updateMetadata(e,r)),Bn.Cn(n)},t.prototype.qn=function(e,t){var n=this;return this.Hr.xr(e,t).next((function(e){return null===e?(n.Yr.set(t,0),null):(n.Yr.set(t,e.size),e.Or)}))},t.prototype.Bn=function(e,t){var n=this;return this.Hr.Lr(e,t).next((function(e){var t=e.qr;return e.Br.forEach((function(e,t){n.Yr.set(e,t)})),t}))},t}(Vn);var Br=function(){function e(){this.Jr=new Vr}return e.prototype.Ar=function(e,t){return this.Jr.add(t),Bn.resolve()},e.prototype.hs=function(e,t){return Bn.resolve(this.Jr.getEntries(t))},e}(),Vr=function(){function e(){this.index={}}return e.prototype.add=function(e){var t=e.S(),n=e.p(),r=this.index[t]||new re(D.P),i=!r.has(n);return this.index[t]=r.add(n),i},e.prototype.has=function(e){var t=e.S(),n=e.p(),r=this.index[t];return r&&r.has(n)},e.prototype.getEntries=function(e){return(this.index[e]||new re(D.P)).N()},e}(),Hr=function(){function e(e){this.serializer=e}return e.prototype.createOrUpgrade=function(e,t,n,r){var i=this;y(n<r&&n>=0&&r<=10);var o=new $n(t);n<1&&r>=1&&(function(e){e.createObjectStore(qr.store)}(e),function(e){e.createObjectStore(Gr.store,{keyPath:Gr.keyPath}),e.createObjectStore(Wr.store,{keyPath:Wr.keyPath,autoIncrement:!0}).createIndex(Wr.userMutationsIndex,Wr.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Jr.store)}(e),ni(e),function(e){e.createObjectStore(Yr.store)}(e));var a=Bn.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore($r.store),e.deleteObjectStore(Kr.store),e.deleteObjectStore(ei.store)}(e),ni(e)),a=a.next((function(){return function(e){var t=e.store(ei.store),n=new ei(0,0,O.min().A(),0);return t.put(ei.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(e,t){return t.store(Wr.store).Hs().next((function(n){e.deleteObjectStore(Wr.store),e.createObjectStore(Wr.store,{keyPath:Wr.keyPath,autoIncrement:!0}).createIndex(Wr.userMutationsIndex,Wr.userMutationsKeyPath,{unique:!0});var r=t.store(Wr.store),i=n.map((function(e){return r.put(e)}));return Bn.Cn(i)}))}(e,o)}))),a=a.next((function(){!function(e){e.createObjectStore(ri.store,{keyPath:ri.keyPath})}(e)}))),n<5&&r>=5&&(a=a.next((function(){return i.removeAcknowledgedMutations(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(e){e.createObjectStore(Qr.store)}(e),i.addDocumentGlobal(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ensureSequenceNumbers(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.createCollectionParentIndex(e,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){var t=e.objectStore(Yr.store);t.createIndex(Yr.readTimeIndex,Yr.readTimeIndexPath,{unique:!1}),t.createIndex(Yr.collectionReadTimeIndex,Yr.collectionReadTimeIndexPath,{unique:!1})}(t)}))),n<10&&r>=10&&(a=a.next((function(){return i.rewriteCanonicalIds(o)}))),a},e.prototype.addDocumentGlobal=function(e){var t=0;return e.store(Yr.store).Zs((function(e,n){t+=Ur(n)})).next((function(){var n=new Qr(t);return e.store(Qr.store).put(Qr.key,n)}))},e.prototype.removeAcknowledgedMutations=function(e){var t=this,n=e.store(Gr.store),r=e.store(Wr.store);return n.Hs().next((function(n){return Bn.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Hs(Wr.userMutationsIndex,i).next((function(r){return Bn.forEach(r,(function(r){y(r.userId===n.userId);var i=Tr(t.serializer,r);return Ir(e,n.userId,i).next((function(){}))}))}))}))}))},e.prototype.ensureSequenceNumbers=function(e){var t=e.store($r.store),n=e.store(Yr.store);return e.store(ei.store).get(ei.key).next((function(e){var r=[];return n.Zs((function(n,i){var o=new D(n),a=function(e){return[0,mr(e)]}(o);r.push(t.get(a).next((function(n){return n?Bn.resolve():function(n){return t.put(new $r(0,mr(n),e.highestListenSequenceNumber))}(o)})))})).next((function(){return Bn.Cn(r)}))}))},e.prototype.createCollectionParentIndex=function(e,t){e.createObjectStore(ti.store,{keyPath:ti.keyPath});var n=t.store(ti.store),r=new Vr,i=function(e){if(r.add(e)){var t=e.S(),i=e.p();return n.put({collectionId:t,parent:mr(i)})}};return t.store(Yr.store).Zs({Xs:!0},(function(e,t){var n=new D(e);return i(n.p())})).next((function(){return t.store(Jr.store).Zs({Xs:!0},(function(e,t){e[0];var n=e[1],r=(e[2],vr(n));return i(r.p())}))}))},e.prototype.rewriteCanonicalIds=function(e){var t=this,n=e.store(Kr.store);return n.Zs((function(e,r){var i=Mr(r),o=Rr(t.serializer,i);return n.put(o)}))},e}(),zr=function(e,t){this.seconds=e,this.nanoseconds=t},qr=function(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n};qr.store="owner",qr.key="owner";var Gr=function(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n};Gr.store="mutationQueues",Gr.keyPath="userId";var Wr=function(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Wr.store="mutations",Wr.keyPath="batchId",Wr.userMutationsIndex="userMutationsIndex",Wr.userMutationsKeyPath=["userId","batchId"];var Jr=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,mr(t)]},e.key=function(e,t,n){return[e,mr(t),n]},e}();Jr.store="documentMutations",Jr.PLACEHOLDER=new Jr;var Zr=function(e,t){this.path=e,this.readTime=t},Xr=function(e,t){this.path=e,this.version=t},Yr=function(e,t,n,r,i,o){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};Yr.store="remoteDocuments",Yr.readTimeIndex="readTimeIndex",Yr.readTimeIndexPath="readTime",Yr.collectionReadTimeIndex="collectionReadTimeIndex",Yr.collectionReadTimeIndexPath=["parentPath","readTime"];var Qr=function(e){this.byteSize=e};Qr.store="remoteDocumentGlobal",Qr.key="remoteDocumentGlobalKey";var Kr=function(e,t,n,r,i,o,a){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};Kr.store="targets",Kr.keyPath="targetId",Kr.queryTargetsIndexName="queryTargetsIndex",Kr.queryTargetsKeyPath=["canonicalId","targetId"];var $r=function(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n};$r.store="targetDocuments",$r.keyPath=["targetId","path"],$r.documentTargetsIndex="documentTargetsIndex",$r.documentTargetsKeyPath=["path","targetId"];var ei=function(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r};ei.key="targetGlobalKey",ei.store="targetGlobal";var ti=function(e,t){this.collectionId=e,this.parent=t};function ni(e){e.createObjectStore($r.store,{keyPath:$r.keyPath}).createIndex($r.documentTargetsIndex,$r.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Kr.store,{keyPath:Kr.keyPath}).createIndex(Kr.queryTargetsIndexName,Kr.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(ei.store)}ti.store="collectionParents",ti.keyPath=["collectionId","parent"];var ri=function(e,t,n,r){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r};ri.store="clientMetadata",ri.keyPath="clientId";var ii=i.__spreadArrays(i.__spreadArrays(i.__spreadArrays([Gr.store,Wr.store,Jr.store,Yr.store,Kr.store,qr.store,ei.store,$r.store],[ri.store]),[Qr.store]),[ti.store]),oi=function(){function e(){this.Xr=new Vr}return e.prototype.Ar=function(e,t){var n=this;if(!this.Xr.has(t)){var r=t.S(),i=t.p();e.Wn((function(){n.Xr.add(t)}));var o={collectionId:r,parent:mr(i)};return ai(e).put(o)}return Bn.resolve()},e.prototype.hs=function(e,t){var n=[],r=IDBKeyRange.bound([t,""],[A(t),""],!1,!0);return ai(e).Hs(r).next((function(e){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.collectionId!==t)break;n.push(vr(o.parent))}return n}))},e}();+ */Dr.Kr=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Hr=t,r.Gr=n,r.Yr=new C((function(e){return e.toString()}),(function(e,t){return e.isEqual(t)})),r}return i.__extends(t,e),t.prototype.Un=function(e){var t=this,n=[],r=0,i=new re((function(e,t){return w(e.F(),t.F())}));return this.Fn.forEach((function(o,a){var s=t.Yr.get(o);if(a){var c=wr(t.Hr.serializer,a,t.readTime);i=i.add(o.path.p());var l=Ur(c);r+=l-s,n.push(t.Hr.xn(e,o,c))}else if(r-=s,t.Gr){var u=wr(t.Hr.serializer,new on(o,O.min()),t.readTime);n.push(t.Hr.xn(e,o,u))}else n.push(t.Hr.Mn(e,o))})),i.forEach((function(r){n.push(t.Hr.zn.Ar(e,r))})),n.push(this.Hr.updateMetadata(e,r)),Bn.Cn(n)},t.prototype.qn=function(e,t){var n=this;return this.Hr.xr(e,t).next((function(e){return null===e?(n.Yr.set(t,0),null):(n.Yr.set(t,e.size),e.Or)}))},t.prototype.Bn=function(e,t){var n=this;return this.Hr.Lr(e,t).next((function(e){var t=e.qr;return e.Br.forEach((function(e,t){n.Yr.set(e,t)})),t}))},t}(Vn);var Br=function(){function e(){this.Jr=new Vr}return e.prototype.Ar=function(e,t){return this.Jr.add(t),Bn.resolve()},e.prototype.hs=function(e,t){return Bn.resolve(this.Jr.getEntries(t))},e}(),Vr=function(){function e(){this.index={}}return e.prototype.add=function(e){var t=e.S(),n=e.p(),r=this.index[t]||new re(D.P),i=!r.has(n);return this.index[t]=r.add(n),i},e.prototype.has=function(e){var t=e.S(),n=e.p(),r=this.index[t];return r&&r.has(n)},e.prototype.getEntries=function(e){return(this.index[e]||new re(D.P)).N()},e}(),Hr=function(){function e(e){this.serializer=e}return e.prototype.createOrUpgrade=function(e,t,n,r){var i=this;y(n<r&&n>=0&&r<=10);var o=new $n(t);n<1&&r>=1&&(function(e){e.createObjectStore(qr.store)}(e),function(e){e.createObjectStore(Gr.store,{keyPath:Gr.keyPath}),e.createObjectStore(Wr.store,{keyPath:Wr.keyPath,autoIncrement:!0}).createIndex(Wr.userMutationsIndex,Wr.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Jr.store)}(e),ni(e),function(e){e.createObjectStore(Xr.store)}(e));var a=Bn.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore($r.store),e.deleteObjectStore(Kr.store),e.deleteObjectStore(ei.store)}(e),ni(e)),a=a.next((function(){return function(e){var t=e.store(ei.store),n=new ei(0,0,O.min().A(),0);return t.put(ei.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(e,t){return t.store(Wr.store).Hs().next((function(n){e.deleteObjectStore(Wr.store),e.createObjectStore(Wr.store,{keyPath:Wr.keyPath,autoIncrement:!0}).createIndex(Wr.userMutationsIndex,Wr.userMutationsKeyPath,{unique:!0});var r=t.store(Wr.store),i=n.map((function(e){return r.put(e)}));return Bn.Cn(i)}))}(e,o)}))),a=a.next((function(){!function(e){e.createObjectStore(ri.store,{keyPath:ri.keyPath})}(e)}))),n<5&&r>=5&&(a=a.next((function(){return i.removeAcknowledgedMutations(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(e){e.createObjectStore(Qr.store)}(e),i.addDocumentGlobal(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ensureSequenceNumbers(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.createCollectionParentIndex(e,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){var t=e.objectStore(Xr.store);t.createIndex(Xr.readTimeIndex,Xr.readTimeIndexPath,{unique:!1}),t.createIndex(Xr.collectionReadTimeIndex,Xr.collectionReadTimeIndexPath,{unique:!1})}(t)}))),n<10&&r>=10&&(a=a.next((function(){return i.rewriteCanonicalIds(o)}))),a},e.prototype.addDocumentGlobal=function(e){var t=0;return e.store(Xr.store).Zs((function(e,n){t+=Ur(n)})).next((function(){var n=new Qr(t);return e.store(Qr.store).put(Qr.key,n)}))},e.prototype.removeAcknowledgedMutations=function(e){var t=this,n=e.store(Gr.store),r=e.store(Wr.store);return n.Hs().next((function(n){return Bn.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Hs(Wr.userMutationsIndex,i).next((function(r){return Bn.forEach(r,(function(r){y(r.userId===n.userId);var i=Tr(t.serializer,r);return Ir(e,n.userId,i).next((function(){}))}))}))}))}))},e.prototype.ensureSequenceNumbers=function(e){var t=e.store($r.store),n=e.store(Xr.store);return e.store(ei.store).get(ei.key).next((function(e){var r=[];return n.Zs((function(n,i){var o=new D(n),a=function(e){return[0,mr(e)]}(o);r.push(t.get(a).next((function(n){return n?Bn.resolve():function(n){return t.put(new $r(0,mr(n),e.highestListenSequenceNumber))}(o)})))})).next((function(){return Bn.Cn(r)}))}))},e.prototype.createCollectionParentIndex=function(e,t){e.createObjectStore(ti.store,{keyPath:ti.keyPath});var n=t.store(ti.store),r=new Vr,i=function(e){if(r.add(e)){var t=e.S(),i=e.p();return n.put({collectionId:t,parent:mr(i)})}};return t.store(Xr.store).Zs({Xs:!0},(function(e,t){var n=new D(e);return i(n.p())})).next((function(){return t.store(Jr.store).Zs({Xs:!0},(function(e,t){e[0];var n=e[1],r=(e[2],vr(n));return i(r.p())}))}))},e.prototype.rewriteCanonicalIds=function(e){var t=this,n=e.store(Kr.store);return n.Zs((function(e,r){var i=Mr(r),o=Rr(t.serializer,i);return n.put(o)}))},e}(),zr=function(e,t){this.seconds=e,this.nanoseconds=t},qr=function(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n};qr.store="owner",qr.key="owner";var Gr=function(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n};Gr.store="mutationQueues",Gr.keyPath="userId";var Wr=function(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Wr.store="mutations",Wr.keyPath="batchId",Wr.userMutationsIndex="userMutationsIndex",Wr.userMutationsKeyPath=["userId","batchId"];var Jr=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,mr(t)]},e.key=function(e,t,n){return[e,mr(t),n]},e}();Jr.store="documentMutations",Jr.PLACEHOLDER=new Jr;var Zr=function(e,t){this.path=e,this.readTime=t},Yr=function(e,t){this.path=e,this.version=t},Xr=function(e,t,n,r,i,o){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};Xr.store="remoteDocuments",Xr.readTimeIndex="readTimeIndex",Xr.readTimeIndexPath="readTime",Xr.collectionReadTimeIndex="collectionReadTimeIndex",Xr.collectionReadTimeIndexPath=["parentPath","readTime"];var Qr=function(e){this.byteSize=e};Qr.store="remoteDocumentGlobal",Qr.key="remoteDocumentGlobalKey";var Kr=function(e,t,n,r,i,o,a){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};Kr.store="targets",Kr.keyPath="targetId",Kr.queryTargetsIndexName="queryTargetsIndex",Kr.queryTargetsKeyPath=["canonicalId","targetId"];var $r=function(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n};$r.store="targetDocuments",$r.keyPath=["targetId","path"],$r.documentTargetsIndex="documentTargetsIndex",$r.documentTargetsKeyPath=["path","targetId"];var ei=function(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r};ei.key="targetGlobalKey",ei.store="targetGlobal";var ti=function(e,t){this.collectionId=e,this.parent=t};function ni(e){e.createObjectStore($r.store,{keyPath:$r.keyPath}).createIndex($r.documentTargetsIndex,$r.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Kr.store,{keyPath:Kr.keyPath}).createIndex(Kr.queryTargetsIndexName,Kr.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(ei.store)}ti.store="collectionParents",ti.keyPath=["collectionId","parent"];var ri=function(e,t,n,r){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r};ri.store="clientMetadata",ri.keyPath="clientId";var ii=i.__spreadArrays(i.__spreadArrays(i.__spreadArrays([Gr.store,Wr.store,Jr.store,Xr.store,Kr.store,qr.store,ei.store,$r.store],[ri.store]),[Qr.store]),[ti.store]),oi=function(){function e(){this.Xr=new Vr}return e.prototype.Ar=function(e,t){var n=this;if(!this.Xr.has(t)){var r=t.S(),i=t.p();e.Wn((function(){n.Xr.add(t)}));var o={collectionId:r,parent:mr(i)};return ai(e).put(o)}return Bn.resolve()},e.prototype.hs=function(e,t){var n=[],r=IDBKeyRange.bound([t,""],[A(t),""],!1,!0);return ai(e).Hs(r).next((function(e){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.collectionId!==t)break;n.push(vr(o.parent))}return n}))},e}();/*** @license* Copyright 2019 Google LLC@@ -984,7 +984,7 @@ var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var di="Failed to obtain exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",pi=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).vr=t,r.Ro=n,r}return i.__extends(t,e),t}(zn),fi=function(){function e(t,n,r,i,o,a,s,c,l,u){if(this.allowTabSynchronization=t,this.persistenceKey=n,this.clientId=r,this.ms=o,this.window=a,this.document=s,this.Po=l,this.Vo=u,this.yo=null,this.po=!1,this.isPrimary=!1,this.networkEnabled=!0,this.bo=null,this.inForeground=!1,this.vo=null,this.So=null,this.Do=Number.NEGATIVE_INFINITY,this.Co=function(e){return Promise.resolve()},!e.ks())throw new I(k.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.dr=new yi(this,i),this.No=n+"main",this.serializer=new br(c),this.Fo=new Xn(this.No,10,new Hr(this.serializer)),this.ko=new ci(this.dr,this.serializer),this.zn=new oi,this.Kn=new Dr(this.serializer,this.zn),this.window&&this.window.localStorage?this.$o=this.window.localStorage:(this.$o=null,!1===u&&p("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.Ms=function(e,t){if(e instanceof pi)return Xn.Ms(e.vr,t);throw g()},e.prototype.start=function(){var e=this;return this.xo().then((function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new I(k.FAILED_PRECONDITION,di);return e.Oo(),e.Mo(),e.Lo(),e.runTransaction("getHighestListenSequenceNumber","readonly",(function(t){return e.ko.oo(t)}))})).then((function(t){e.yo=new Wn(t,e.Po)})).then((function(){e.po=!0})).catch((function(t){return e.Fo&&e.Fo.close(),Promise.reject(t)}))},e.prototype.qo=function(e){var t=this;return this.Co=function(n){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.tr?[2,e(n)]:[2]}))}))},e(this.isPrimary)},e.prototype.Bo=function(e){var t=this;this.Fo.Bs((function(n){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return null===n.newVersion?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.Uo=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.ms.ai((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.tr?[4,this.xo()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})))},e.prototype.xo=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(t){return gi(t).put(new ri(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next((function(){if(e.isPrimary)return e.Qo(t).next((function(t){t||(e.isPrimary=!1,e.ms.gi((function(){return e.Co(!1)})))}))})).next((function(){return e.Wo(t)})).next((function(n){return e.isPrimary&&!n?e.jo(t).next((function(){return!1})):!!n&&e.Ko(t).next((function(){return!0}))}))})).catch((function(t){if(Kn(t))return d("IndexedDbPersistence","Failed to extend owner lease: ",t),e.isPrimary;if(!e.allowTabSynchronization)throw t;return d("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((function(t){e.isPrimary!==t&&e.ms.gi((function(){return e.Co(t)})),e.isPrimary=t}))},e.prototype.Qo=function(e){var t=this;return mi(e).get(qr.key).next((function(e){return Bn.resolve(t.Go(e))}))},e.prototype.zo=function(e){return gi(e).delete(this.clientId)},e.prototype.Ho=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o,a=this;return i.__generator(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.Yo(this.Do,18e5)?[3,2]:(this.Do=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var n=e.Ms(t,ri.store);return n.Hs().next((function(e){var t=a.Jo(e,18e5),r=e.filter((function(e){return-1===t.indexOf(e)}));return Bn.forEach(r,(function(e){return n.delete(e.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=i.sent(),this.$o)for(n=0,r=t;n<r.length;n++)o=r[n],this.$o.removeItem(this.Xo(o.clientId));i.label=2;case 2:return[2]}}))}))},e.prototype.Lo=function(){var e=this;this.So=this.ms.Ss("client_metadata_refresh",4e3,(function(){return e.xo().then((function(){return e.Ho()})).then((function(){return e.Lo()}))}))},e.prototype.Go=function(e){return!!e&&e.ownerId===this.clientId},e.prototype.Wo=function(e){var t=this;return this.Vo?Bn.resolve(!0):mi(e).get(qr.key).next((function(n){if(null!==n&&t.Yo(n.leaseTimestampMs,5e3)&&!t.Zo(n.ownerId)){if(t.Go(n)&&t.networkEnabled)return!0;if(!t.Go(n)){if(!n.allowTabSynchronization)throw new I(k.FAILED_PRECONDITION,di);return!1}}return!(!t.networkEnabled||!t.inForeground)||gi(e).Hs().next((function(e){return void 0===t.Jo(e,5e3).find((function(e){if(t.clientId!==e.clientId){var n=!t.networkEnabled&&e.networkEnabled,r=!t.inForeground&&e.inForeground,i=t.networkEnabled===e.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(e){return t.isPrimary!==e&&d("IndexedDbPersistence","Client "+(e?"is":"is not")+" eligible for a primary lease."),e}))},e.prototype.th=function(){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(t){switch(t.label){case 0:return this.po=!1,this.eh(),this.So&&(this.So.cancel(),this.So=null),this.nh(),this.sh(),[4,this.Fo.runTransaction("readwrite",[qr.store,ri.store],(function(t){var n=new pi(t,Wn.Es);return e.jo(n).next((function(){return e.zo(n)}))}))];case 1:return t.sent(),this.Fo.close(),this.ih(),[2]}}))}))},e.prototype.Jo=function(e,t){var n=this;return e.filter((function(e){return n.Yo(e.updateTimeMs,t)&&!n.Zo(e.clientId)}))},e.prototype.rh=function(){var e=this;return this.runTransaction("getActiveClients","readonly",(function(t){return gi(t).Hs().next((function(t){return e.Jo(t,18e5).map((function(e){return e.clientId}))}))}))},Object.defineProperty(e.prototype,"tr",{get:function(){return this.po},enumerable:!1,configurable:!0}),e.prototype.oh=function(e){return Cr.Tr(e,this.serializer,this.zn,this.dr)},e.prototype.hh=function(){return this.ko},e.prototype.ah=function(){return this.Kn},e.prototype.uh=function(){return this.zn},e.prototype.runTransaction=function(e,t,n){var r=this;d("IndexedDbPersistence","Starting transaction:",e);var i,o="readonly"===t?"readonly":"readwrite";return this.Fo.runTransaction(o,ii,(function(o){return i=new pi(o,r.yo?r.yo.next():Wn.Es),"readwrite-primary"===t?r.Qo(i).next((function(e){return!!e||r.Wo(i)})).next((function(t){if(!t)throw p("Failed to obtain primary lease for action '"+e+"'."),r.isPrimary=!1,r.ms.gi((function(){return r.Co(!1)})),new I(k.FAILED_PRECONDITION,Hn);return n(i)})).next((function(e){return r.Ko(i).next((function(){return e}))})):r.lh(i).next((function(){return n(i)}))})).then((function(e){return i.jn(),e}))},e.prototype.lh=function(e){var t=this;return mi(e).get(qr.key).next((function(e){if(null!==e&&t.Yo(e.leaseTimestampMs,5e3)&&!t.Zo(e.ownerId)&&!t.Go(e)&&!(t.Vo||t.allowTabSynchronization&&e.allowTabSynchronization))throw new I(k.FAILED_PRECONDITION,di)}))},e.prototype.Ko=function(e){var t=new qr(this.clientId,this.allowTabSynchronization,Date.now());return mi(e).put(qr.key,t)},e.ks=function(){return Xn.ks()},e.prototype.jo=function(e){var t=this,n=mi(e);return n.get(qr.key).next((function(e){return t.Go(e)?(d("IndexedDbPersistence","Releasing primary lease."),n.delete(qr.key)):Bn.resolve()}))},e.prototype.Yo=function(e,t){var n=Date.now();return!(e<n-t||e>n&&(p("Detected an update time that is in the future: "+e+" > "+n),1))},e.prototype.Oo=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.vo=function(){e.ms.ai((function(){return e.inForeground="visible"===e.document.visibilityState,e.xo()}))},this.document.addEventListener("visibilitychange",this.vo),this.inForeground="visible"===this.document.visibilityState)},e.prototype.nh=function(){this.vo&&(this.document.removeEventListener("visibilitychange",this.vo),this.vo=null)},e.prototype.Mo=function(){var e,t=this;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.bo=function(){t.eh(),t.ms.ai((function(){return t.th()}))},this.window.addEventListener("unload",this.bo))},e.prototype.sh=function(){this.bo&&(this.window.removeEventListener("unload",this.bo),this.bo=null)},e.prototype.Zo=function(e){var t;try{var n=null!==(null===(t=this.$o)||void 0===t?void 0:t.getItem(this.Xo(e)));return d("IndexedDbPersistence","Client '"+e+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(e){return p("IndexedDbPersistence","Failed to get zombied client id.",e),!1}},e.prototype.eh=function(){if(this.$o)try{this.$o.setItem(this.Xo(this.clientId),String(Date.now()))}catch(e){p("Failed to set zombie client id.",e)}},e.prototype.ih=function(){if(this.$o)try{this.$o.removeItem(this.Xo(this.clientId))}catch(e){}},e.prototype.Xo=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e}();function mi(e){return fi.Ms(e,qr.store)}function gi(e){return fi.Ms(e,ri.store)}var yi=function(){function e(e,t){this.db=e,this.Yi=new fr(this,t)}return e.prototype.ir=function(e){var t=this._h(e);return this.db.hh().do(e).next((function(e){return t.next((function(t){return e+t}))}))},e.prototype._h=function(e){var t=0;return this.or(e,(function(e){t++})).next((function(){return t}))},e.prototype.be=function(e,t){return this.db.hh().be(e,t)},e.prototype.or=function(e,t){return this.fh(e,(function(e,n){return t(n)}))},e.prototype.Eo=function(e,t,n){return vi(e,n)},e.prototype.Io=function(e,t,n){return vi(e,n)},e.prototype.hr=function(e,t,n){return this.db.hh().hr(e,t,n)},e.prototype.Dr=function(e,t){return vi(e,t)},e.prototype.dh=function(e,t){return function(e,t){var n=!1;return Nr(e).ti((function(r){return kr(e,r,t).next((function(e){return e&&(n=!0),Bn.resolve(!e)}))})).next((function(){return n}))}(e,t)},e.prototype.ar=function(e,t){var n=this,r=this.db.ah().jr(),i=[],o=0;return this.fh(e,(function(a,s){if(s<=t){var c=n.dh(e,a).next((function(t){if(!t)return o++,r.Ln(e,a).next((function(){return r.Mn(a),hi(e).delete([0,mr(a.path)])}))}));i.push(c)}})).next((function(){return Bn.Cn(i)})).next((function(){return r.apply(e)})).next((function(){return o}))},e.prototype.removeTarget=function(e,t){var n=t.tt(e.Ro);return this.db.hh().lo(e,n)},e.prototype.wh=function(e,t){return vi(e,t)},e.prototype.fh=function(e,t){var n,r=hi(e),i=Wn.Es;return r.Zs({index:$r.documentTargetsIndex},(function(e,r){var o=e[0],a=(e[1],r.path),s=r.sequenceNumber;0===o?(i!==Wn.Es&&t(new j(vr(n)),i),i=s,n=a):i=Wn.Es})).next((function(){i!==Wn.Es&&t(new j(vr(n)),i)}))},e.prototype.ur=function(e){return this.db.ah().zr(e)},e}();function vi(e,t){return hi(e).put(function(e,t){return new $r(0,mr(e.path),t)}(t,e.Ro))}function bi(e,t){var n=e.projectId;return e.i||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}var _i=function(){function e(e,t,n){this.persistence=e,this.Th=t,this.Eh=new ee(w),this.mh=new C((function(e){return q(e)}),G),this.Ih=O.min(),this.Gn=e.oh(n),this.Ah=e.ah(),this.ko=e.hh(),this.Rh=new qn(this.Ah,this.Gn,this.persistence.uh()),this.Th.Ph(this.Rh)}return e.prototype.er=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return e.cr(n,t.Eh)}))},e}();function wi(e,t){var n=v(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(e){var r=t.batch.keys(),i=n.Ah.jr({Gr:!0});return function(e,t,n,r){var i=n.batch,o=i.keys(),a=Bn.resolve();return o.forEach((function(e){a=a.next((function(){return r.Ln(t,e)})).next((function(t){var o=t,a=n.Pn.get(e);y(null!==a),(!o||o.version.o(a)<0)&&(o=i.En(e,o,n))&&r.xn(o,n.Rn)}))})),a.next((function(){return e.Gn.br(t,i)}))}(n,e,t,i).next((function(){return i.apply(e)})).next((function(){return n.Gn.Cr(e)})).next((function(){return n.Rh.Zn(e,r)}))}))}function Ei(e){var t=v(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(function(e){return t.ko.ro(e)}))}function Ai(e,t){var n=v(e),r=t.Z,i=n.Eh;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(e){var o=n.Ah.jr({Gr:!0});i=n.Eh;var a=[];t.Wt.forEach((function(t,o){var s=i.get(o);if(s){a.push(n.ko.mo(e,t.Zt,o).next((function(){return n.ko.To(e,t.Jt,o)})));var c=t.resumeToken;if(c.Y()>0){var l=s.et(c,r).tt(e.Ro);i=i.st(o,l),function(e,t,n){return y(t.resumeToken.Y()>0),0===e.resumeToken.Y()||t.Z.I()-e.Z.I()>=3e8||n.Jt.size+n.Xt.size+n.Zt.size>0}(s,l,t)&&a.push(n.ko.lo(e,l))}}}));var s=ae(),c=de();if(t.Kt.forEach((function(e,t){c=c.add(e)})),a.push(o.getEntries(e,c).next((function(i){t.Kt.forEach((function(c,l){var u=i.get(c);l instanceof on&&l.version.isEqual(O.min())?(o.Mn(c,r),s=s.st(c,l)):null==u||l.version.o(u.version)>0||0===l.version.o(u.version)&&u.hasPendingWrites?(o.xn(l,r),s=s.st(c,l)):d("LocalStore","Ignoring outdated watch update for ",c,". Current version:",u.version," Watch version:",l.version),t.Gt.has(c)&&a.push(n.persistence.dr.wh(e,c))}))}))),!r.isEqual(O.min())){var l=n.ko.ro(e).next((function(t){return n.ko.ho(e,e.Ro,r)}));a.push(l)}return Bn.Cn(a).next((function(){return o.apply(e)})).next((function(){return n.Rh.ts(e,s)}))})).then((function(e){return n.Eh=i,e}))}function xi(e,t){var n=v(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),n.Gn.gr(e,t)}))}function Si(e,t){var n=v(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(e){var r;return n.ko.wo(e,t).next((function(i){return i?(r=i,Bn.resolve(r)):n.ko.no(e).next((function(i){return r=new Y(t,i,0,e.Ro),n.ko.ao(e,r).next((function(){return r}))}))}))})).then((function(e){var r=n.Eh.get(e.targetId);return(null===r||e.Z.o(r.Z)>0)&&(n.Eh=n.Eh.st(e.targetId,e),n.mh.set(t,e.targetId)),e}))}function Ti(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s;return i.__generator(this,(function(i){switch(i.label){case 0:r=v(e),o=r.Eh.get(t),a=n?"readwrite":"readwrite-primary",i.label=1;case 1:return i.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",a,(function(e){return r.persistence.dr.removeTarget(e,o)}))];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if(!Kn(s=i.sent()))throw s;return d("LocalStore","Failed to update sequence numbers for target "+t+": "+s),[3,5];case 5:return r.Eh=r.Eh.remove(t),r.mh.delete(o.target),[2]}}))}))}function Mi(e,t,n){var r=v(e),i=O.min(),o=de();return r.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,n){var r=v(e),i=r.mh.get(n);return void 0!==i?Bn.resolve(r.Eh.get(i)):r.ko.wo(t,n)}(r,e,pn(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,r.ko.Ao(e,t.targetId).next((function(e){o=e}))})).next((function(){return r.Th.ns(e,t,n?i:O.min(),n?o:de())})).next((function(e){return{documents:e,gh:o}}))}))}function Ri(e,t){var n=v(e),r=v(n.ko),i=n.Eh.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(e){return r.Me(e,t).next((function(e){return e?e.target:null}))}))}function Ci(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){if(e.code!==k.FAILED_PRECONDITION||e.message!==Hn)throw e;return d("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}+ */var di="Failed to obtain exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",pi=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).vr=t,r.Ro=n,r}return i.__extends(t,e),t}(zn),fi=function(){function e(t,n,r,i,o,a,s,c,l,u){if(this.allowTabSynchronization=t,this.persistenceKey=n,this.clientId=r,this.ms=o,this.window=a,this.document=s,this.Po=l,this.Vo=u,this.yo=null,this.po=!1,this.isPrimary=!1,this.networkEnabled=!0,this.bo=null,this.inForeground=!1,this.vo=null,this.So=null,this.Do=Number.NEGATIVE_INFINITY,this.Co=function(e){return Promise.resolve()},!e.ks())throw new I(k.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.dr=new yi(this,i),this.No=n+"main",this.serializer=new br(c),this.Fo=new Yn(this.No,10,new Hr(this.serializer)),this.ko=new ci(this.dr,this.serializer),this.zn=new oi,this.Kn=new Dr(this.serializer,this.zn),this.window&&this.window.localStorage?this.$o=this.window.localStorage:(this.$o=null,!1===u&&p("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.Ms=function(e,t){if(e instanceof pi)return Yn.Ms(e.vr,t);throw g()},e.prototype.start=function(){var e=this;return this.xo().then((function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new I(k.FAILED_PRECONDITION,di);return e.Oo(),e.Mo(),e.Lo(),e.runTransaction("getHighestListenSequenceNumber","readonly",(function(t){return e.ko.oo(t)}))})).then((function(t){e.yo=new Wn(t,e.Po)})).then((function(){e.po=!0})).catch((function(t){return e.Fo&&e.Fo.close(),Promise.reject(t)}))},e.prototype.qo=function(e){var t=this;return this.Co=function(n){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.tr?[2,e(n)]:[2]}))}))},e(this.isPrimary)},e.prototype.Bo=function(e){var t=this;this.Fo.Bs((function(n){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return null===n.newVersion?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.Uo=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.ms.ai((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.tr?[4,this.xo()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})))},e.prototype.xo=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(t){return gi(t).put(new ri(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next((function(){if(e.isPrimary)return e.Qo(t).next((function(t){t||(e.isPrimary=!1,e.ms.gi((function(){return e.Co(!1)})))}))})).next((function(){return e.Wo(t)})).next((function(n){return e.isPrimary&&!n?e.jo(t).next((function(){return!1})):!!n&&e.Ko(t).next((function(){return!0}))}))})).catch((function(t){if(Kn(t))return d("IndexedDbPersistence","Failed to extend owner lease: ",t),e.isPrimary;if(!e.allowTabSynchronization)throw t;return d("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((function(t){e.isPrimary!==t&&e.ms.gi((function(){return e.Co(t)})),e.isPrimary=t}))},e.prototype.Qo=function(e){var t=this;return mi(e).get(qr.key).next((function(e){return Bn.resolve(t.Go(e))}))},e.prototype.zo=function(e){return gi(e).delete(this.clientId)},e.prototype.Ho=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o,a=this;return i.__generator(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.Yo(this.Do,18e5)?[3,2]:(this.Do=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var n=e.Ms(t,ri.store);return n.Hs().next((function(e){var t=a.Jo(e,18e5),r=e.filter((function(e){return-1===t.indexOf(e)}));return Bn.forEach(r,(function(e){return n.delete(e.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=i.sent(),this.$o)for(n=0,r=t;n<r.length;n++)o=r[n],this.$o.removeItem(this.Xo(o.clientId));i.label=2;case 2:return[2]}}))}))},e.prototype.Lo=function(){var e=this;this.So=this.ms.Ss("client_metadata_refresh",4e3,(function(){return e.xo().then((function(){return e.Ho()})).then((function(){return e.Lo()}))}))},e.prototype.Go=function(e){return!!e&&e.ownerId===this.clientId},e.prototype.Wo=function(e){var t=this;return this.Vo?Bn.resolve(!0):mi(e).get(qr.key).next((function(n){if(null!==n&&t.Yo(n.leaseTimestampMs,5e3)&&!t.Zo(n.ownerId)){if(t.Go(n)&&t.networkEnabled)return!0;if(!t.Go(n)){if(!n.allowTabSynchronization)throw new I(k.FAILED_PRECONDITION,di);return!1}}return!(!t.networkEnabled||!t.inForeground)||gi(e).Hs().next((function(e){return void 0===t.Jo(e,5e3).find((function(e){if(t.clientId!==e.clientId){var n=!t.networkEnabled&&e.networkEnabled,r=!t.inForeground&&e.inForeground,i=t.networkEnabled===e.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(e){return t.isPrimary!==e&&d("IndexedDbPersistence","Client "+(e?"is":"is not")+" eligible for a primary lease."),e}))},e.prototype.th=function(){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(t){switch(t.label){case 0:return this.po=!1,this.eh(),this.So&&(this.So.cancel(),this.So=null),this.nh(),this.sh(),[4,this.Fo.runTransaction("readwrite",[qr.store,ri.store],(function(t){var n=new pi(t,Wn.Es);return e.jo(n).next((function(){return e.zo(n)}))}))];case 1:return t.sent(),this.Fo.close(),this.ih(),[2]}}))}))},e.prototype.Jo=function(e,t){var n=this;return e.filter((function(e){return n.Yo(e.updateTimeMs,t)&&!n.Zo(e.clientId)}))},e.prototype.rh=function(){var e=this;return this.runTransaction("getActiveClients","readonly",(function(t){return gi(t).Hs().next((function(t){return e.Jo(t,18e5).map((function(e){return e.clientId}))}))}))},Object.defineProperty(e.prototype,"tr",{get:function(){return this.po},enumerable:!1,configurable:!0}),e.prototype.oh=function(e){return Cr.Tr(e,this.serializer,this.zn,this.dr)},e.prototype.hh=function(){return this.ko},e.prototype.ah=function(){return this.Kn},e.prototype.uh=function(){return this.zn},e.prototype.runTransaction=function(e,t,n){var r=this;d("IndexedDbPersistence","Starting transaction:",e);var i,o="readonly"===t?"readonly":"readwrite";return this.Fo.runTransaction(o,ii,(function(o){return i=new pi(o,r.yo?r.yo.next():Wn.Es),"readwrite-primary"===t?r.Qo(i).next((function(e){return!!e||r.Wo(i)})).next((function(t){if(!t)throw p("Failed to obtain primary lease for action '"+e+"'."),r.isPrimary=!1,r.ms.gi((function(){return r.Co(!1)})),new I(k.FAILED_PRECONDITION,Hn);return n(i)})).next((function(e){return r.Ko(i).next((function(){return e}))})):r.lh(i).next((function(){return n(i)}))})).then((function(e){return i.jn(),e}))},e.prototype.lh=function(e){var t=this;return mi(e).get(qr.key).next((function(e){if(null!==e&&t.Yo(e.leaseTimestampMs,5e3)&&!t.Zo(e.ownerId)&&!t.Go(e)&&!(t.Vo||t.allowTabSynchronization&&e.allowTabSynchronization))throw new I(k.FAILED_PRECONDITION,di)}))},e.prototype.Ko=function(e){var t=new qr(this.clientId,this.allowTabSynchronization,Date.now());return mi(e).put(qr.key,t)},e.ks=function(){return Yn.ks()},e.prototype.jo=function(e){var t=this,n=mi(e);return n.get(qr.key).next((function(e){return t.Go(e)?(d("IndexedDbPersistence","Releasing primary lease."),n.delete(qr.key)):Bn.resolve()}))},e.prototype.Yo=function(e,t){var n=Date.now();return!(e<n-t||e>n&&(p("Detected an update time that is in the future: "+e+" > "+n),1))},e.prototype.Oo=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.vo=function(){e.ms.ai((function(){return e.inForeground="visible"===e.document.visibilityState,e.xo()}))},this.document.addEventListener("visibilitychange",this.vo),this.inForeground="visible"===this.document.visibilityState)},e.prototype.nh=function(){this.vo&&(this.document.removeEventListener("visibilitychange",this.vo),this.vo=null)},e.prototype.Mo=function(){var e,t=this;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.bo=function(){t.eh(),t.ms.ai((function(){return t.th()}))},this.window.addEventListener("unload",this.bo))},e.prototype.sh=function(){this.bo&&(this.window.removeEventListener("unload",this.bo),this.bo=null)},e.prototype.Zo=function(e){var t;try{var n=null!==(null===(t=this.$o)||void 0===t?void 0:t.getItem(this.Xo(e)));return d("IndexedDbPersistence","Client '"+e+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(e){return p("IndexedDbPersistence","Failed to get zombied client id.",e),!1}},e.prototype.eh=function(){if(this.$o)try{this.$o.setItem(this.Xo(this.clientId),String(Date.now()))}catch(e){p("Failed to set zombie client id.",e)}},e.prototype.ih=function(){if(this.$o)try{this.$o.removeItem(this.Xo(this.clientId))}catch(e){}},e.prototype.Xo=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e}();function mi(e){return fi.Ms(e,qr.store)}function gi(e){return fi.Ms(e,ri.store)}var yi=function(){function e(e,t){this.db=e,this.Yi=new fr(this,t)}return e.prototype.ir=function(e){var t=this._h(e);return this.db.hh().do(e).next((function(e){return t.next((function(t){return e+t}))}))},e.prototype._h=function(e){var t=0;return this.or(e,(function(e){t++})).next((function(){return t}))},e.prototype.be=function(e,t){return this.db.hh().be(e,t)},e.prototype.or=function(e,t){return this.fh(e,(function(e,n){return t(n)}))},e.prototype.Eo=function(e,t,n){return vi(e,n)},e.prototype.Io=function(e,t,n){return vi(e,n)},e.prototype.hr=function(e,t,n){return this.db.hh().hr(e,t,n)},e.prototype.Dr=function(e,t){return vi(e,t)},e.prototype.dh=function(e,t){return function(e,t){var n=!1;return Nr(e).ti((function(r){return kr(e,r,t).next((function(e){return e&&(n=!0),Bn.resolve(!e)}))})).next((function(){return n}))}(e,t)},e.prototype.ar=function(e,t){var n=this,r=this.db.ah().jr(),i=[],o=0;return this.fh(e,(function(a,s){if(s<=t){var c=n.dh(e,a).next((function(t){if(!t)return o++,r.Ln(e,a).next((function(){return r.Mn(a),hi(e).delete([0,mr(a.path)])}))}));i.push(c)}})).next((function(){return Bn.Cn(i)})).next((function(){return r.apply(e)})).next((function(){return o}))},e.prototype.removeTarget=function(e,t){var n=t.tt(e.Ro);return this.db.hh().lo(e,n)},e.prototype.wh=function(e,t){return vi(e,t)},e.prototype.fh=function(e,t){var n,r=hi(e),i=Wn.Es;return r.Zs({index:$r.documentTargetsIndex},(function(e,r){var o=e[0],a=(e[1],r.path),s=r.sequenceNumber;0===o?(i!==Wn.Es&&t(new j(vr(n)),i),i=s,n=a):i=Wn.Es})).next((function(){i!==Wn.Es&&t(new j(vr(n)),i)}))},e.prototype.ur=function(e){return this.db.ah().zr(e)},e}();function vi(e,t){return hi(e).put(function(e,t){return new $r(0,mr(e.path),t)}(t,e.Ro))}function bi(e,t){var n=e.projectId;return e.i||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}var _i=function(){function e(e,t,n){this.persistence=e,this.Th=t,this.Eh=new ee(w),this.mh=new C((function(e){return q(e)}),G),this.Ih=O.min(),this.Gn=e.oh(n),this.Ah=e.ah(),this.ko=e.hh(),this.Rh=new qn(this.Ah,this.Gn,this.persistence.uh()),this.Th.Ph(this.Rh)}return e.prototype.er=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return e.cr(n,t.Eh)}))},e}();function wi(e,t){var n=v(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(e){var r=t.batch.keys(),i=n.Ah.jr({Gr:!0});return function(e,t,n,r){var i=n.batch,o=i.keys(),a=Bn.resolve();return o.forEach((function(e){a=a.next((function(){return r.Ln(t,e)})).next((function(t){var o=t,a=n.Pn.get(e);y(null!==a),(!o||o.version.o(a)<0)&&(o=i.En(e,o,n))&&r.xn(o,n.Rn)}))})),a.next((function(){return e.Gn.br(t,i)}))}(n,e,t,i).next((function(){return i.apply(e)})).next((function(){return n.Gn.Cr(e)})).next((function(){return n.Rh.Zn(e,r)}))}))}function Ei(e){var t=v(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(function(e){return t.ko.ro(e)}))}function Ai(e,t){var n=v(e),r=t.Z,i=n.Eh;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(e){var o=n.Ah.jr({Gr:!0});i=n.Eh;var a=[];t.Wt.forEach((function(t,o){var s=i.get(o);if(s){a.push(n.ko.mo(e,t.Zt,o).next((function(){return n.ko.To(e,t.Jt,o)})));var c=t.resumeToken;if(c.Y()>0){var l=s.et(c,r).tt(e.Ro);i=i.st(o,l),function(e,t,n){return y(t.resumeToken.Y()>0),0===e.resumeToken.Y()||t.Z.I()-e.Z.I()>=3e8||n.Jt.size+n.Xt.size+n.Zt.size>0}(s,l,t)&&a.push(n.ko.lo(e,l))}}}));var s=ae(),c=de();if(t.Kt.forEach((function(e,t){c=c.add(e)})),a.push(o.getEntries(e,c).next((function(i){t.Kt.forEach((function(c,l){var u=i.get(c);l instanceof on&&l.version.isEqual(O.min())?(o.Mn(c,r),s=s.st(c,l)):null==u||l.version.o(u.version)>0||0===l.version.o(u.version)&&u.hasPendingWrites?(o.xn(l,r),s=s.st(c,l)):d("LocalStore","Ignoring outdated watch update for ",c,". Current version:",u.version," Watch version:",l.version),t.Gt.has(c)&&a.push(n.persistence.dr.wh(e,c))}))}))),!r.isEqual(O.min())){var l=n.ko.ro(e).next((function(t){return n.ko.ho(e,e.Ro,r)}));a.push(l)}return Bn.Cn(a).next((function(){return o.apply(e)})).next((function(){return n.Rh.ts(e,s)}))})).then((function(e){return n.Eh=i,e}))}function xi(e,t){var n=v(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),n.Gn.gr(e,t)}))}function Si(e,t){var n=v(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(e){var r;return n.ko.wo(e,t).next((function(i){return i?(r=i,Bn.resolve(r)):n.ko.no(e).next((function(i){return r=new X(t,i,0,e.Ro),n.ko.ao(e,r).next((function(){return r}))}))}))})).then((function(e){var r=n.Eh.get(e.targetId);return(null===r||e.Z.o(r.Z)>0)&&(n.Eh=n.Eh.st(e.targetId,e),n.mh.set(t,e.targetId)),e}))}function Ti(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s;return i.__generator(this,(function(i){switch(i.label){case 0:r=v(e),o=r.Eh.get(t),a=n?"readwrite":"readwrite-primary",i.label=1;case 1:return i.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",a,(function(e){return r.persistence.dr.removeTarget(e,o)}))];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if(!Kn(s=i.sent()))throw s;return d("LocalStore","Failed to update sequence numbers for target "+t+": "+s),[3,5];case 5:return r.Eh=r.Eh.remove(t),r.mh.delete(o.target),[2]}}))}))}function Mi(e,t,n){var r=v(e),i=O.min(),o=de();return r.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,n){var r=v(e),i=r.mh.get(n);return void 0!==i?Bn.resolve(r.Eh.get(i)):r.ko.wo(t,n)}(r,e,pn(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,r.ko.Ao(e,t.targetId).next((function(e){o=e}))})).next((function(){return r.Th.ns(e,t,n?i:O.min(),n?o:de())})).next((function(e){return{documents:e,gh:o}}))}))}function Ri(e,t){var n=v(e),r=v(n.ko),i=n.Eh.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(e){return r.Me(e,t).next((function(e){return e?e.target:null}))}))}function Ci(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){if(e.code!==k.FAILED_PRECONDITION||e.message!==Hn)throw e;return d("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}/*** @license* Copyright 2017 Google LLC@@ -1017,7 +1017,7 @@ var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t* See the License for the specific language governing permissions and* limitations under the License.*/-var Oi=function(e,t){this.user=t,this.type="OAuth",this.Mh={},this.Mh.Authorization="Bearer "+e},Ni=function(){function e(){this.Lh=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.qh=function(){},e.prototype.Bh=function(e){this.Lh=e,e(Pi.UNAUTHENTICATED)},e.prototype.Uh=function(){this.Lh=null},e}(),Di=function(){function e(e){var t=this;this.Qh=null,this.currentUser=Pi.UNAUTHENTICATED,this.Wh=!1,this.jh=0,this.Lh=null,this.forceRefresh=!1,this.Qh=function(){t.jh++,t.currentUser=t.Kh(),t.Wh=!0,t.Lh&&t.Lh(t.currentUser)},this.jh=0,this.auth=e.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.Qh):(this.Qh(null),e.get().then((function(e){t.auth=e,t.Qh&&t.auth.addAuthTokenListener(t.Qh)}),(function(){})))}return e.prototype.getToken=function(){var e=this,t=this.jh,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return e.jh!==t?(d("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):n?(y("string"==typeof n.accessToken),new Oi(n.accessToken,e.currentUser)):null})):Promise.resolve(null)},e.prototype.qh=function(){this.forceRefresh=!0},e.prototype.Bh=function(e){this.Lh=e,this.Wh&&e(this.currentUser)},e.prototype.Uh=function(){this.auth&&this.auth.removeAuthTokenListener(this.Qh),this.Qh=null,this.Lh=null},e.prototype.Kh=function(){var e=this.auth&&this.auth.getUid();return y(null===e||"string"==typeof e),new Pi(e)},e}(),Li=function(){function e(e,t){this.Gh=e,this.zh=t,this.type="FirstParty",this.user=Pi.Oh}return Object.defineProperty(e.prototype,"Mh",{get:function(){var e={"X-Goog-AuthUser":this.zh},t=this.Gh.auth.Hh([]);return t&&(e.Authorization=t),e},enumerable:!1,configurable:!0}),e}(),Fi=function(){function e(e,t){this.Gh=e,this.zh=t}return e.prototype.getToken=function(){return Promise.resolve(new Li(this.Gh,this.zh))},e.prototype.Bh=function(e){e(Pi.Oh)},e.prototype.Uh=function(){},e.prototype.qh=function(){},e}(),ji=function(){function e(e,t,n,r,i,o){this.ms=e,this.Yh=n,this.Jh=r,this.Xh=i,this.listener=o,this.state=0,this.Zh=0,this.ta=null,this.stream=null,this.Ti=new Zn(e,t)}return e.prototype.ea=function(){return 1===this.state||2===this.state||4===this.state},e.prototype.na=function(){return 2===this.state},e.prototype.start=function(){3!==this.state?this.auth():this.sa()},e.prototype.stop=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.ea()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.ia=function(){this.state=0,this.Ti.reset()},e.prototype.ra=function(){var e=this;this.na()&&null===this.ta&&(this.ta=this.ms.Ss(this.Yh,6e4,(function(){return e.oa()})))},e.prototype.ha=function(e){this.aa(),this.stream.send(e)},e.prototype.oa=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.na()?[2,this.close(0)]:[2]}))}))},e.prototype.aa=function(){this.ta&&(this.ta.cancel(),this.ta=null)},e.prototype.close=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return this.aa(),this.Ti.cancel(),this.Zh++,3!==e?this.Ti.reset():t&&t.code===k.RESOURCE_EXHAUSTED?(p(t.toString()),p("Using maximum backoff delay to prevent overloading the backend."),this.Ti.ps()):t&&t.code===k.UNAUTHENTICATED&&this.Xh.qh(),null!==this.stream&&(this.ca(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.ua(t)];case 1:return n.sent(),[2]}}))}))},e.prototype.ca=function(){},e.prototype.auth=function(){var e=this;this.state=1;var t=this.la(this.Zh),n=this.Zh;this.Xh.getToken().then((function(t){e.Zh===n&&e._a(t)}),(function(n){t((function(){var t=new I(k.UNKNOWN,"Fetching auth token failed: "+n.message);return e.fa(t)}))}))},e.prototype._a=function(e){var t=this,n=this.la(this.Zh);this.stream=this.da(e),this.stream.wa((function(){n((function(){return t.state=2,t.listener.wa()}))})),this.stream.ua((function(e){n((function(){return t.fa(e)}))})),this.stream.onMessage((function(e){n((function(){return t.onMessage(e)}))}))},e.prototype.sa=function(){var e=this;this.state=4,this.Ti.bs((function(){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.state=0,this.start(),[2]}))}))}))},e.prototype.fa=function(e){return d("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},e.prototype.la=function(e){var t=this;return function(n){t.ms.ai((function(){return t.Zh===e?n():(d("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e}(),Ui=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).serializer=i,a}return i.__extends(t,e),t.prototype.da=function(e){return this.Jh.Ta("Listen",e)},t.prototype.onMessage=function(e){this.Ti.reset();var t=function(e,t){var n;if("targetChange"in t){t.targetChange;var r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:g()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=function(e,t){return e.Le?(y(void 0===t||"string"==typeof t),J.fromBase64String(t||"")):(y(void 0===t||t instanceof Uint8Array),J.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=t.targetChange.cause,s=a&&function(e){var t=void 0===e.code?k.UNKNOWN:$(e.code);return new I(t,e.message||"")}(a);n=new Ee(r,i,o,s||null)}else if("documentChange"in t){t.documentChange;var c=t.documentChange;c.document,c.document.name,c.document.updateTime;var l=it(e,c.document.name),u=et(c.document.updateTime),h=new $t({mapValue:{fields:c.document.fields}}),d=new rn(l,u,h,{}),p=c.targetIds||[],f=c.removedTargetIds||[];n=new _e(p,f,d.key,d)}else if("documentDelete"in t){t.documentDelete;var m=t.documentDelete;m.document;var v=it(e,m.document),b=m.readTime?et(m.readTime):O.min(),_=new on(v,b),w=m.removedTargetIds||[];n=new _e([],w,_.key,_)}else if("documentRemove"in t){t.documentRemove;var E=t.documentRemove;E.document;var A=it(e,E.document),x=E.removedTargetIds||[];n=new _e([],x,A,null)}else{if(!("filter"in t))return g();t.filter;var S=t.filter;S.targetId;var T=S.count||0,M=new Q(T),R=S.targetId;n=new we(R,M)}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return O.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?O.min():t.readTime?et(t.readTime):O.min()}(e);return this.listener.Ea(t,n)},t.prototype.ma=function(e){var t={};t.database=st(this.serializer),t.addTarget=function(e,t){var n,r=t.target;return(n=W(r)?{documents:dt(e,r)}:{query:pt(e,r)}).targetId=t.targetId,t.resumeToken.Y()>0&&(n.resumeToken=Ke(e,t.resumeToken)),n}(this.serializer,e);var n=function(e,t){var n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return g()}}(0,t.X);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.ha(t)},t.prototype.Ia=function(e){var t={};t.database=st(this.serializer),t.removeTarget=e,this.ha(t)},t}(ji),Bi=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).serializer=i,a.Aa=!1,a}return i.__extends(t,e),Object.defineProperty(t.prototype,"Ra",{get:function(){return this.Aa},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.Aa=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ca=function(){this.Aa&&this.Pa([])},t.prototype.da=function(e){return this.Jh.Ta("Write",e)},t.prototype.onMessage=function(e){if(y(!!e.streamToken),this.lastStreamToken=e.streamToken,this.Aa){this.Ti.reset();var t=function(e,t){return e&&e.length>0?(y(void 0!==t),e.map((function(e){return function(e,t){var n=e.updateTime?et(e.updateTime):et(t);n.isEqual(O.min())&&(n=et(t));var r=null;return e.transformResults&&e.transformResults.length>0&&(r=e.transformResults),new Lt(n,r)}(e,t)}))):[]}(e.writeResults,e.commitTime),n=et(e.commitTime);return this.listener.ga(n,t)}return y(!e.writeResults||0===e.writeResults.length),this.Aa=!0,this.listener.Va()},t.prototype.ya=function(){var e={};e.database=st(this.serializer),this.ha(e)},t.prototype.Pa=function(e){var t=this,n={streamToken:this.lastStreamToken,writes:e.map((function(e){return ut(t.serializer,e)}))};this.ha(n)},t}(ji),Vi=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).credentials=t,i.Jh=n,i.serializer=r,i.pa=!1,i}return i.__extends(t,e),t.prototype.ba=function(){if(this.pa)throw new I(k.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.va=function(e,t,n){var r=this;return this.ba(),this.credentials.getToken().then((function(i){return r.Jh.va(e,t,n,i)})).catch((function(e){throw e.code===k.UNAUTHENTICATED&&r.credentials.qh(),e}))},t.prototype.Sa=function(e,t,n){var r=this;return this.ba(),this.credentials.getToken().then((function(i){return r.Jh.Sa(e,t,n,i)})).catch((function(e){throw e.code===k.UNAUTHENTICATED&&r.credentials.qh(),e}))},t.prototype.terminate=function(){this.pa=!1},t}((function(){})),Hi=function(){function e(e,t){this.ei=e,this.Da=t,this.state="Unknown",this.Ca=0,this.Na=null,this.Fa=!0}return e.prototype.ka=function(){var e=this;0===this.Ca&&(this.$a("Unknown"),this.Na=this.ei.Ss("online_state_timeout",1e4,(function(){return e.Na=null,e.xa("Backend didn't respond within 10 seconds."),e.$a("Offline"),Promise.resolve()})))},e.prototype.Oa=function(e){"Online"===this.state?this.$a("Unknown"):(this.Ca++,this.Ca>=1&&(this.Ma(),this.xa("Connection failed 1 times. Most recent error: "+e.toString()),this.$a("Offline")))},e.prototype.set=function(e){this.Ma(),this.Ca=0,"Online"===e&&(this.Fa=!1),this.$a(e)},e.prototype.$a=function(e){e!==this.state&&(this.state=e,this.Da(e))},e.prototype.xa=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Fa?(p(t),this.Fa=!1):d("OnlineStateTracker",t)},e.prototype.Ma=function(){null!==this.Na&&(this.Na.cancel(),this.Na=null)},e}(),zi=function(){function e(e,t,n,r,o){var a=this;this.La=e,this.qa=t,this.ei=n,this.Ba=[],this.Ua=new Map,this.Qa=null,this.Wa=new Set,this.ja=o,this.ja.Ka((function(e){n.ai((function(){return i.__awaiter(a,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Ga()?(d("RemoteStore","Restarting streams for network reachability change."),[4,this.za()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))})),this.Ha=new Hi(n,r),this.Ya=function(e,t,n){var r=v(e);return r.ba(),new Ui(t,r.Jh,r.credentials,r.serializer,n)}(this.qa,n,{wa:this.Ja.bind(this),ua:this.Xa.bind(this),Ea:this.Za.bind(this)}),this.tc=function(e,t,n){var r=v(e);return r.ba(),new Bi(t,r.Jh,r.credentials,r.serializer,n)}(this.qa,n,{wa:this.ec.bind(this),ua:this.nc.bind(this),Va:this.sc.bind(this),ga:this.ga.bind(this)})}return e.prototype.start=function(){return this.enableNetwork()},e.prototype.enableNetwork=function(){return this.Wa.delete(0),this.ic()},e.prototype.ic=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Ga()?(this.rc()?this.oc():this.Ha.set("Unknown"),[4,this.hc()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.disableNetwork=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Wa.add(0),[4,this.ac()];case 1:return e.sent(),this.Ha.set("Offline"),[2]}}))}))},e.prototype.ac=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return[4,this.tc.stop()];case 1:return e.sent(),[4,this.Ya.stop()];case 2:return e.sent(),this.Ba.length>0&&(d("RemoteStore","Stopping write stream with "+this.Ba.length+" pending writes"),this.Ba=[]),this.cc(),[2]}}))}))},e.prototype.th=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return d("RemoteStore","RemoteStore shutting down."),this.Wa.add(5),[4,this.ac()];case 1:return e.sent(),this.ja.th(),this.Ha.set("Unknown"),[2]}}))}))},e.prototype.listen=function(e){this.Ua.has(e.targetId)||(this.Ua.set(e.targetId,e),this.rc()?this.oc():this.Ya.na()&&this.uc(e))},e.prototype.lc=function(e){this.Ua.delete(e),this.Ya.na()&&this._c(e),0===this.Ua.size&&(this.Ya.na()?this.Ya.ra():this.Ga()&&this.Ha.set("Unknown"))},e.prototype.Me=function(e){return this.Ua.get(e)||null},e.prototype.Oe=function(e){return this.fc.Oe(e)},e.prototype.uc=function(e){this.Qa.we(e.targetId),this.Ya.ma(e)},e.prototype._c=function(e){this.Qa.we(e),this.Ya.Ia(e)},e.prototype.oc=function(){this.Qa=new xe(this),this.Ya.start(),this.Ha.ka()},e.prototype.rc=function(){return this.Ga()&&!this.Ya.ea()&&this.Ua.size>0},e.prototype.Ga=function(){return 0===this.Wa.size},e.prototype.cc=function(){this.Qa=null},e.prototype.Ja=function(){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(t){return this.Ua.forEach((function(t,n){e.uc(t)})),[2]}))}))},e.prototype.Xa=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.cc(),this.rc()?(this.Ha.Oa(e),this.oc()):this.Ha.set("Unknown"),[2]}))}))},e.prototype.Za=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:if(this.Ha.set("Online"),!(e instanceof Ee&&2===e.state&&e.cause))return[3,6];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,this.dc(e)];case 2:return i.sent(),[3,5];case 3:return n=i.sent(),d("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),[4,this.wc(n)];case 4:return i.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof _e?this.Qa.ge(e):e instanceof we?this.Qa.Ce(e):this.Qa.pe(e),t.isEqual(O.min()))return[3,13];i.label=7;case 7:return i.trys.push([7,11,,13]),[4,Ei(this.La)];case 8:return r=i.sent(),t.o(r)>=0?[4,this.Tc(t)]:[3,10];case 9:i.sent(),i.label=10;case 10:return[3,13];case 11:return d("RemoteStore","Failed to raise snapshot:",o=i.sent()),[4,this.wc(o)];case 12:return i.sent(),[3,13];case 13:return[2]}}))}))},e.prototype.wc=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:if(!Kn(e))throw e;return this.Wa.add(1),[4,this.ac()];case 1:return r.sent(),this.Ha.set("Offline"),t||(t=function(){return Ei(n.La)}),this.ei.gi((function(){return i.__awaiter(n,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return d("RemoteStore","Retrying IndexedDB access"),[4,t()];case 1:return e.sent(),this.Wa.delete(1),[4,this.ic()];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))},e.prototype.Ec=function(e){var t=this;return e().catch((function(n){return t.wc(n,e)}))},e.prototype.Tc=function(e){var t=this,n=this.Qa.ke(e);return n.Wt.forEach((function(n,r){if(n.resumeToken.Y()>0){var i=t.Ua.get(r);i&&t.Ua.set(r,i.et(n.resumeToken,e))}})),n.jt.forEach((function(e){var n=t.Ua.get(e);if(n){t.Ua.set(e,n.et(J.J,n.Z)),t._c(e);var r=new Y(n.target,e,1,n.sequenceNumber);t.uc(r)}})),this.fc.mc(n)},e.prototype.dc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:t=e.cause,n=0,r=e.targetIds,i.label=1;case 1:return n<r.length?(o=r[n],this.Ua.has(o)?[4,this.fc.Ic(o,t)]:[3,3]):[3,5];case 2:i.sent(),this.Ua.delete(o),this.Qa.removeTarget(o),i.label=3;case 3:i.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}))},e.prototype.hc=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n;return i.__generator(this,(function(r){switch(r.label){case 0:e=this.Ba.length>0?this.Ba[this.Ba.length-1].batchId:-1,r.label=1;case 1:if(!this.Ac())return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,xi(this.La,e)];case 3:return null===(t=r.sent())?(0===this.Ba.length&&this.tc.ra(),[3,7]):(e=t.batchId,this.Rc(t),[3,6]);case 4:return n=r.sent(),[4,this.wc(n)];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:return this.Pc()&&this.gc(),[2]}}))}))},e.prototype.Ac=function(){return this.Ga()&&this.Ba.length<10},e.prototype.Vc=function(){return this.Ba.length},e.prototype.Rc=function(e){this.Ba.push(e),this.tc.na()&&this.tc.Ra&&this.tc.Pa(e.mutations)},e.prototype.Pc=function(){return this.Ga()&&!this.tc.ea()&&this.Ba.length>0},e.prototype.gc=function(){this.tc.start()},e.prototype.ec=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.tc.ya(),[2]}))}))},e.prototype.sc=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n;return i.__generator(this,(function(r){for(e=0,t=this.Ba;e<t.length;e++)n=t[e],this.tc.Pa(n.mutations);return[2]}))}))},e.prototype.ga=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o=this;return i.__generator(this,(function(i){switch(i.label){case 0:return n=this.Ba.shift(),r=Un.from(n,e,t),[4,this.Ec((function(){return o.fc.yc(r)}))];case 1:return i.sent(),[4,this.hc()];case 2:return i.sent(),[2]}}))}))},e.prototype.nc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return e&&this.tc.Ra?[4,this.pc(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.Pc()&&this.gc(),[2]}}))}))},e.prototype.pc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return K(n=e.code)&&n!==k.ABORTED?(t=this.Ba.shift(),this.tc.ia(),[4,this.Ec((function(){return r.fc.bc(t.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,this.hc()];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.za=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Wa.add(4),[4,this.ac()];case 1:return e.sent(),this.Ha.set("Unknown"),this.tc.ia(),this.Ya.ia(),this.Wa.delete(4),[4,this.ic()];case 2:return e.sent(),[2]}}))}))},e.prototype.vc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.ei.pi(),d("RemoteStore","RemoteStore received new credentials"),this.Wa.add(3),[4,this.ac()];case 1:return t.sent(),this.Ha.set("Unknown"),[4,this.fc.vc(e)];case 2:return t.sent(),this.Wa.delete(3),[4,this.ic()];case 3:return t.sent(),[2]}}))}))},e.prototype.Sc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return e?(this.Wa.delete(2),[4,this.ic()]):[3,2];case 1:return t.sent(),[3,5];case 2:return e?[3,4]:(this.Wa.add(2),[4,this.ac()]);case 3:t.sent(),this.Ha.set("Unknown"),t.label=4;case 4:t.label=5;case 5:return[2]}}))}))},e}();+var Oi=function(e,t){this.user=t,this.type="OAuth",this.Mh={},this.Mh.Authorization="Bearer "+e},Ni=function(){function e(){this.Lh=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.qh=function(){},e.prototype.Bh=function(e){this.Lh=e,e(Pi.UNAUTHENTICATED)},e.prototype.Uh=function(){this.Lh=null},e}(),Di=function(){function e(e){var t=this;this.Qh=null,this.currentUser=Pi.UNAUTHENTICATED,this.Wh=!1,this.jh=0,this.Lh=null,this.forceRefresh=!1,this.Qh=function(){t.jh++,t.currentUser=t.Kh(),t.Wh=!0,t.Lh&&t.Lh(t.currentUser)},this.jh=0,this.auth=e.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.Qh):(this.Qh(null),e.get().then((function(e){t.auth=e,t.Qh&&t.auth.addAuthTokenListener(t.Qh)}),(function(){})))}return e.prototype.getToken=function(){var e=this,t=this.jh,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return e.jh!==t?(d("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):n?(y("string"==typeof n.accessToken),new Oi(n.accessToken,e.currentUser)):null})):Promise.resolve(null)},e.prototype.qh=function(){this.forceRefresh=!0},e.prototype.Bh=function(e){this.Lh=e,this.Wh&&e(this.currentUser)},e.prototype.Uh=function(){this.auth&&this.auth.removeAuthTokenListener(this.Qh),this.Qh=null,this.Lh=null},e.prototype.Kh=function(){var e=this.auth&&this.auth.getUid();return y(null===e||"string"==typeof e),new Pi(e)},e}(),Li=function(){function e(e,t){this.Gh=e,this.zh=t,this.type="FirstParty",this.user=Pi.Oh}return Object.defineProperty(e.prototype,"Mh",{get:function(){var e={"X-Goog-AuthUser":this.zh},t=this.Gh.auth.Hh([]);return t&&(e.Authorization=t),e},enumerable:!1,configurable:!0}),e}(),Fi=function(){function e(e,t){this.Gh=e,this.zh=t}return e.prototype.getToken=function(){return Promise.resolve(new Li(this.Gh,this.zh))},e.prototype.Bh=function(e){e(Pi.Oh)},e.prototype.Uh=function(){},e.prototype.qh=function(){},e}(),ji=function(){function e(e,t,n,r,i,o){this.ms=e,this.Yh=n,this.Jh=r,this.Xh=i,this.listener=o,this.state=0,this.Zh=0,this.ta=null,this.stream=null,this.Ti=new Zn(e,t)}return e.prototype.ea=function(){return 1===this.state||2===this.state||4===this.state},e.prototype.na=function(){return 2===this.state},e.prototype.start=function(){3!==this.state?this.auth():this.sa()},e.prototype.stop=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.ea()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.ia=function(){this.state=0,this.Ti.reset()},e.prototype.ra=function(){var e=this;this.na()&&null===this.ta&&(this.ta=this.ms.Ss(this.Yh,6e4,(function(){return e.oa()})))},e.prototype.ha=function(e){this.aa(),this.stream.send(e)},e.prototype.oa=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.na()?[2,this.close(0)]:[2]}))}))},e.prototype.aa=function(){this.ta&&(this.ta.cancel(),this.ta=null)},e.prototype.close=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return this.aa(),this.Ti.cancel(),this.Zh++,3!==e?this.Ti.reset():t&&t.code===k.RESOURCE_EXHAUSTED?(p(t.toString()),p("Using maximum backoff delay to prevent overloading the backend."),this.Ti.ps()):t&&t.code===k.UNAUTHENTICATED&&this.Xh.qh(),null!==this.stream&&(this.ca(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.ua(t)];case 1:return n.sent(),[2]}}))}))},e.prototype.ca=function(){},e.prototype.auth=function(){var e=this;this.state=1;var t=this.la(this.Zh),n=this.Zh;this.Xh.getToken().then((function(t){e.Zh===n&&e._a(t)}),(function(n){t((function(){var t=new I(k.UNKNOWN,"Fetching auth token failed: "+n.message);return e.fa(t)}))}))},e.prototype._a=function(e){var t=this,n=this.la(this.Zh);this.stream=this.da(e),this.stream.wa((function(){n((function(){return t.state=2,t.listener.wa()}))})),this.stream.ua((function(e){n((function(){return t.fa(e)}))})),this.stream.onMessage((function(e){n((function(){return t.onMessage(e)}))}))},e.prototype.sa=function(){var e=this;this.state=4,this.Ti.bs((function(){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.state=0,this.start(),[2]}))}))}))},e.prototype.fa=function(e){return d("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},e.prototype.la=function(e){var t=this;return function(n){t.ms.ai((function(){return t.Zh===e?n():(d("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e}(),Ui=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).serializer=i,a}return i.__extends(t,e),t.prototype.da=function(e){return this.Jh.Ta("Listen",e)},t.prototype.onMessage=function(e){this.Ti.reset();var t=function(e,t){var n;if("targetChange"in t){t.targetChange;var r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:g()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=function(e,t){return e.Le?(y(void 0===t||"string"==typeof t),J.fromBase64String(t||"")):(y(void 0===t||t instanceof Uint8Array),J.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=t.targetChange.cause,s=a&&function(e){var t=void 0===e.code?k.UNKNOWN:$(e.code);return new I(t,e.message||"")}(a);n=new Ee(r,i,o,s||null)}else if("documentChange"in t){t.documentChange;var c=t.documentChange;c.document,c.document.name,c.document.updateTime;var l=it(e,c.document.name),u=et(c.document.updateTime),h=new $t({mapValue:{fields:c.document.fields}}),d=new rn(l,u,h,{}),p=c.targetIds||[],f=c.removedTargetIds||[];n=new _e(p,f,d.key,d)}else if("documentDelete"in t){t.documentDelete;var m=t.documentDelete;m.document;var v=it(e,m.document),b=m.readTime?et(m.readTime):O.min(),_=new on(v,b),w=m.removedTargetIds||[];n=new _e([],w,_.key,_)}else if("documentRemove"in t){t.documentRemove;var E=t.documentRemove;E.document;var A=it(e,E.document),x=E.removedTargetIds||[];n=new _e([],x,A,null)}else{if(!("filter"in t))return g();t.filter;var S=t.filter;S.targetId;var T=S.count||0,M=new Q(T),R=S.targetId;n=new we(R,M)}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return O.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?O.min():t.readTime?et(t.readTime):O.min()}(e);return this.listener.Ea(t,n)},t.prototype.ma=function(e){var t={};t.database=st(this.serializer),t.addTarget=function(e,t){var n,r=t.target;return(n=W(r)?{documents:dt(e,r)}:{query:pt(e,r)}).targetId=t.targetId,t.resumeToken.Y()>0&&(n.resumeToken=Ke(e,t.resumeToken)),n}(this.serializer,e);var n=function(e,t){var n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return g()}}(0,t.X);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.ha(t)},t.prototype.Ia=function(e){var t={};t.database=st(this.serializer),t.removeTarget=e,this.ha(t)},t}(ji),Bi=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).serializer=i,a.Aa=!1,a}return i.__extends(t,e),Object.defineProperty(t.prototype,"Ra",{get:function(){return this.Aa},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.Aa=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ca=function(){this.Aa&&this.Pa([])},t.prototype.da=function(e){return this.Jh.Ta("Write",e)},t.prototype.onMessage=function(e){if(y(!!e.streamToken),this.lastStreamToken=e.streamToken,this.Aa){this.Ti.reset();var t=function(e,t){return e&&e.length>0?(y(void 0!==t),e.map((function(e){return function(e,t){var n=e.updateTime?et(e.updateTime):et(t);n.isEqual(O.min())&&(n=et(t));var r=null;return e.transformResults&&e.transformResults.length>0&&(r=e.transformResults),new Lt(n,r)}(e,t)}))):[]}(e.writeResults,e.commitTime),n=et(e.commitTime);return this.listener.ga(n,t)}return y(!e.writeResults||0===e.writeResults.length),this.Aa=!0,this.listener.Va()},t.prototype.ya=function(){var e={};e.database=st(this.serializer),this.ha(e)},t.prototype.Pa=function(e){var t=this,n={streamToken:this.lastStreamToken,writes:e.map((function(e){return ut(t.serializer,e)}))};this.ha(n)},t}(ji),Vi=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).credentials=t,i.Jh=n,i.serializer=r,i.pa=!1,i}return i.__extends(t,e),t.prototype.ba=function(){if(this.pa)throw new I(k.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.va=function(e,t,n){var r=this;return this.ba(),this.credentials.getToken().then((function(i){return r.Jh.va(e,t,n,i)})).catch((function(e){throw e.code===k.UNAUTHENTICATED&&r.credentials.qh(),e}))},t.prototype.Sa=function(e,t,n){var r=this;return this.ba(),this.credentials.getToken().then((function(i){return r.Jh.Sa(e,t,n,i)})).catch((function(e){throw e.code===k.UNAUTHENTICATED&&r.credentials.qh(),e}))},t.prototype.terminate=function(){this.pa=!1},t}((function(){})),Hi=function(){function e(e,t){this.ei=e,this.Da=t,this.state="Unknown",this.Ca=0,this.Na=null,this.Fa=!0}return e.prototype.ka=function(){var e=this;0===this.Ca&&(this.$a("Unknown"),this.Na=this.ei.Ss("online_state_timeout",1e4,(function(){return e.Na=null,e.xa("Backend didn't respond within 10 seconds."),e.$a("Offline"),Promise.resolve()})))},e.prototype.Oa=function(e){"Online"===this.state?this.$a("Unknown"):(this.Ca++,this.Ca>=1&&(this.Ma(),this.xa("Connection failed 1 times. Most recent error: "+e.toString()),this.$a("Offline")))},e.prototype.set=function(e){this.Ma(),this.Ca=0,"Online"===e&&(this.Fa=!1),this.$a(e)},e.prototype.$a=function(e){e!==this.state&&(this.state=e,this.Da(e))},e.prototype.xa=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Fa?(p(t),this.Fa=!1):d("OnlineStateTracker",t)},e.prototype.Ma=function(){null!==this.Na&&(this.Na.cancel(),this.Na=null)},e}(),zi=function(){function e(e,t,n,r,o){var a=this;this.La=e,this.qa=t,this.ei=n,this.Ba=[],this.Ua=new Map,this.Qa=null,this.Wa=new Set,this.ja=o,this.ja.Ka((function(e){n.ai((function(){return i.__awaiter(a,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Ga()?(d("RemoteStore","Restarting streams for network reachability change."),[4,this.za()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))})),this.Ha=new Hi(n,r),this.Ya=function(e,t,n){var r=v(e);return r.ba(),new Ui(t,r.Jh,r.credentials,r.serializer,n)}(this.qa,n,{wa:this.Ja.bind(this),ua:this.Xa.bind(this),Ea:this.Za.bind(this)}),this.tc=function(e,t,n){var r=v(e);return r.ba(),new Bi(t,r.Jh,r.credentials,r.serializer,n)}(this.qa,n,{wa:this.ec.bind(this),ua:this.nc.bind(this),Va:this.sc.bind(this),ga:this.ga.bind(this)})}return e.prototype.start=function(){return this.enableNetwork()},e.prototype.enableNetwork=function(){return this.Wa.delete(0),this.ic()},e.prototype.ic=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Ga()?(this.rc()?this.oc():this.Ha.set("Unknown"),[4,this.hc()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.disableNetwork=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Wa.add(0),[4,this.ac()];case 1:return e.sent(),this.Ha.set("Offline"),[2]}}))}))},e.prototype.ac=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return[4,this.tc.stop()];case 1:return e.sent(),[4,this.Ya.stop()];case 2:return e.sent(),this.Ba.length>0&&(d("RemoteStore","Stopping write stream with "+this.Ba.length+" pending writes"),this.Ba=[]),this.cc(),[2]}}))}))},e.prototype.th=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return d("RemoteStore","RemoteStore shutting down."),this.Wa.add(5),[4,this.ac()];case 1:return e.sent(),this.ja.th(),this.Ha.set("Unknown"),[2]}}))}))},e.prototype.listen=function(e){this.Ua.has(e.targetId)||(this.Ua.set(e.targetId,e),this.rc()?this.oc():this.Ya.na()&&this.uc(e))},e.prototype.lc=function(e){this.Ua.delete(e),this.Ya.na()&&this._c(e),0===this.Ua.size&&(this.Ya.na()?this.Ya.ra():this.Ga()&&this.Ha.set("Unknown"))},e.prototype.Me=function(e){return this.Ua.get(e)||null},e.prototype.Oe=function(e){return this.fc.Oe(e)},e.prototype.uc=function(e){this.Qa.we(e.targetId),this.Ya.ma(e)},e.prototype._c=function(e){this.Qa.we(e),this.Ya.Ia(e)},e.prototype.oc=function(){this.Qa=new xe(this),this.Ya.start(),this.Ha.ka()},e.prototype.rc=function(){return this.Ga()&&!this.Ya.ea()&&this.Ua.size>0},e.prototype.Ga=function(){return 0===this.Wa.size},e.prototype.cc=function(){this.Qa=null},e.prototype.Ja=function(){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(t){return this.Ua.forEach((function(t,n){e.uc(t)})),[2]}))}))},e.prototype.Xa=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.cc(),this.rc()?(this.Ha.Oa(e),this.oc()):this.Ha.set("Unknown"),[2]}))}))},e.prototype.Za=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:if(this.Ha.set("Online"),!(e instanceof Ee&&2===e.state&&e.cause))return[3,6];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,this.dc(e)];case 2:return i.sent(),[3,5];case 3:return n=i.sent(),d("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),[4,this.wc(n)];case 4:return i.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof _e?this.Qa.ge(e):e instanceof we?this.Qa.Ce(e):this.Qa.pe(e),t.isEqual(O.min()))return[3,13];i.label=7;case 7:return i.trys.push([7,11,,13]),[4,Ei(this.La)];case 8:return r=i.sent(),t.o(r)>=0?[4,this.Tc(t)]:[3,10];case 9:i.sent(),i.label=10;case 10:return[3,13];case 11:return d("RemoteStore","Failed to raise snapshot:",o=i.sent()),[4,this.wc(o)];case 12:return i.sent(),[3,13];case 13:return[2]}}))}))},e.prototype.wc=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:if(!Kn(e))throw e;return this.Wa.add(1),[4,this.ac()];case 1:return r.sent(),this.Ha.set("Offline"),t||(t=function(){return Ei(n.La)}),this.ei.gi((function(){return i.__awaiter(n,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return d("RemoteStore","Retrying IndexedDB access"),[4,t()];case 1:return e.sent(),this.Wa.delete(1),[4,this.ic()];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))},e.prototype.Ec=function(e){var t=this;return e().catch((function(n){return t.wc(n,e)}))},e.prototype.Tc=function(e){var t=this,n=this.Qa.ke(e);return n.Wt.forEach((function(n,r){if(n.resumeToken.Y()>0){var i=t.Ua.get(r);i&&t.Ua.set(r,i.et(n.resumeToken,e))}})),n.jt.forEach((function(e){var n=t.Ua.get(e);if(n){t.Ua.set(e,n.et(J.J,n.Z)),t._c(e);var r=new X(n.target,e,1,n.sequenceNumber);t.uc(r)}})),this.fc.mc(n)},e.prototype.dc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:t=e.cause,n=0,r=e.targetIds,i.label=1;case 1:return n<r.length?(o=r[n],this.Ua.has(o)?[4,this.fc.Ic(o,t)]:[3,3]):[3,5];case 2:i.sent(),this.Ua.delete(o),this.Qa.removeTarget(o),i.label=3;case 3:i.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}))},e.prototype.hc=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n;return i.__generator(this,(function(r){switch(r.label){case 0:e=this.Ba.length>0?this.Ba[this.Ba.length-1].batchId:-1,r.label=1;case 1:if(!this.Ac())return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,xi(this.La,e)];case 3:return null===(t=r.sent())?(0===this.Ba.length&&this.tc.ra(),[3,7]):(e=t.batchId,this.Rc(t),[3,6]);case 4:return n=r.sent(),[4,this.wc(n)];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:return this.Pc()&&this.gc(),[2]}}))}))},e.prototype.Ac=function(){return this.Ga()&&this.Ba.length<10},e.prototype.Vc=function(){return this.Ba.length},e.prototype.Rc=function(e){this.Ba.push(e),this.tc.na()&&this.tc.Ra&&this.tc.Pa(e.mutations)},e.prototype.Pc=function(){return this.Ga()&&!this.tc.ea()&&this.Ba.length>0},e.prototype.gc=function(){this.tc.start()},e.prototype.ec=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.tc.ya(),[2]}))}))},e.prototype.sc=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n;return i.__generator(this,(function(r){for(e=0,t=this.Ba;e<t.length;e++)n=t[e],this.tc.Pa(n.mutations);return[2]}))}))},e.prototype.ga=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o=this;return i.__generator(this,(function(i){switch(i.label){case 0:return n=this.Ba.shift(),r=Un.from(n,e,t),[4,this.Ec((function(){return o.fc.yc(r)}))];case 1:return i.sent(),[4,this.hc()];case 2:return i.sent(),[2]}}))}))},e.prototype.nc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return e&&this.tc.Ra?[4,this.pc(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.Pc()&&this.gc(),[2]}}))}))},e.prototype.pc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return K(n=e.code)&&n!==k.ABORTED?(t=this.Ba.shift(),this.tc.ia(),[4,this.Ec((function(){return r.fc.bc(t.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,this.hc()];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.za=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Wa.add(4),[4,this.ac()];case 1:return e.sent(),this.Ha.set("Unknown"),this.tc.ia(),this.Ya.ia(),this.Wa.delete(4),[4,this.ic()];case 2:return e.sent(),[2]}}))}))},e.prototype.vc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.ei.pi(),d("RemoteStore","RemoteStore received new credentials"),this.Wa.add(3),[4,this.ac()];case 1:return t.sent(),this.Ha.set("Unknown"),[4,this.fc.vc(e)];case 2:return t.sent(),this.Wa.delete(3),[4,this.ic()];case 3:return t.sent(),[2]}}))}))},e.prototype.Sc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return e?(this.Wa.delete(2),[4,this.ic()]):[3,2];case 1:return t.sent(),[3,5];case 2:return e?[3,4]:(this.Wa.add(2),[4,this.ac()]);case 3:t.sent(),this.Ha.set("Unknown"),t.label=4;case 4:t.label=5;case 5:return[2]}}))}))},e}();/*** @license* Copyright 2019 Google LLC@@ -1033,7 +1033,7 @@ var Oi=function(e,t){this.user=t,this.type="OAuth",this.Mh={},this.Mh.Authorizat* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */function qi(e,t){return"firestore_clients_"+e+"_"+t}function Gi(e,t,n){var r="firestore_mutations_"+e+"_"+n;return t.Er()&&(r+="_"+t.uid),r}function Wi(e,t){return"firestore_targets_"+e+"_"+t}var Ji=function(){function e(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}return e.Dc=function(t,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),a=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(a=new I(i.error.code,i.error.message)),o?new e(t,n,i.state,a):(p("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},e.prototype.Cc=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Zi=function(){function e(e,t,n){this.targetId=e,this.state=t,this.error=n}return e.Dc=function(t,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new I(r.error.code,r.error.message)),i?new e(t,r.state,o):(p("SharedClientState","Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.Cc=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Xi=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.Dc=function(t,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=fe(),a=0;i&&a<r.activeTargetIds.length;++a)i=V(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new e(t,o):(p("SharedClientState","Failed to parse client data for instance '"+t+"': "+n),null)},e}(),Yi=function(){function e(e,t){this.clientId=e,this.onlineState=t}return e.Dc=function(t){var n=JSON.parse(t);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new e(n.clientId,n.onlineState):(p("SharedClientState","Failed to parse online state: "+t),null)},e}(),Qi=function(){function e(){this.activeTargetIds=fe()}return e.prototype.Nc=function(e){this.activeTargetIds=this.activeTargetIds.add(e)},e.prototype.Fc=function(e){this.activeTargetIds=this.activeTargetIds.delete(e)},e.prototype.Cc=function(){var e={activeTargetIds:this.activeTargetIds.N(),updateTimeMs:Date.now()};return JSON.stringify(e)},e}(),Ki=function(){function e(e,t,n,r,i){this.window=e,this.ms=t,this.persistenceKey=n,this.kc=r,this.fc=null,this.Da=null,this.fs=null,this.$c=this.xc.bind(this),this.Oc=new ee(w),this.tr=!1,this.Mc=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Lc=qi(this.persistenceKey,this.kc),this.qc=function(e){return"firestore_sequence_number_"+e}(this.persistenceKey),this.Oc=this.Oc.st(this.kc,new Qi),this.Bc=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Uc=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.Qc=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Wc=function(e){return"firestore_online_state_"+e}(this.persistenceKey),this.window.addEventListener("storage",this.$c)}return e.ks=function(e){return!(!e||!e.localStorage)},e.prototype.start=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n,r,o,a,s,c,l,u,h,d=this;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,this.fc.rh()];case 1:for(e=i.sent(),t=0,n=e;t<n.length;t++)(r=n[t])!==this.kc&&(o=this.getItem(qi(this.persistenceKey,r)))&&(a=Xi.Dc(r,o))&&(this.Oc=this.Oc.st(a.clientId,a));for(this.jc(),(s=this.storage.getItem(this.Wc))&&(c=this.Kc(s))&&this.Gc(c),l=0,u=this.Mc;l<u.length;l++)h=u[l],this.xc(h);return this.Mc=[],this.window.addEventListener("unload",(function(){return d.th()})),this.tr=!0,[2]}}))}))},e.prototype.Ts=function(e){this.setItem(this.qc,JSON.stringify(e))},e.prototype.zc=function(){return this.Hc(this.Oc)},e.prototype.Yc=function(e){var t=!1;return this.Oc.forEach((function(n,r){r.activeTargetIds.has(e)&&(t=!0)})),t},e.prototype.Jc=function(e){this.Xc(e,"pending")},e.prototype.Zc=function(e,t,n){this.Xc(e,t,n),this.tu(e)},e.prototype.eu=function(e){var t="not-current";if(this.Yc(e)){var n=this.storage.getItem(Wi(this.persistenceKey,e));if(n){var r=Zi.Dc(e,n);r&&(t=r.state)}}return this.nu.Nc(e),this.jc(),t},e.prototype.su=function(e){this.nu.Fc(e),this.jc()},e.prototype.iu=function(e){return this.nu.activeTargetIds.has(e)},e.prototype.ru=function(e){this.removeItem(Wi(this.persistenceKey,e))},e.prototype.ou=function(e,t,n){this.hu(e,t,n)},e.prototype.au=function(e,t,n){var r=this;t.forEach((function(e){r.tu(e)})),this.currentUser=e,n.forEach((function(e){r.Jc(e)}))},e.prototype.cu=function(e){this.uu(e)},e.prototype.th=function(){this.tr&&(this.window.removeEventListener("storage",this.$c),this.removeItem(this.Lc),this.tr=!1)},e.prototype.getItem=function(e){var t=this.storage.getItem(e);return d("SharedClientState","READ",e,t),t},e.prototype.setItem=function(e,t){d("SharedClientState","SET",e,t),this.storage.setItem(e,t)},e.prototype.removeItem=function(e){d("SharedClientState","REMOVE",e),this.storage.removeItem(e)},e.prototype.xc=function(e){var t=this,n=e;if(n.storageArea===this.storage){if(d("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Lc)return void p("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.ms.gi((function(){return i.__awaiter(t,void 0,void 0,(function(){var e,t,r,o,a,s;return i.__generator(this,(function(i){if(this.tr){if(null!==n.key)if(this.Bc.test(n.key)){if(null==n.newValue)return e=this.lu(n.key),[2,this._u(e,null)];if(t=this.fu(n.key,n.newValue))return[2,this._u(t.clientId,t)]}else if(this.Uc.test(n.key)){if(null!==n.newValue&&(r=this.du(n.key,n.newValue)))return[2,this.wu(r)]}else if(this.Qc.test(n.key)){if(null!==n.newValue&&(o=this.Tu(n.key,n.newValue)))return[2,this.Eu(o)]}else if(n.key===this.Wc){if(null!==n.newValue&&(a=this.Kc(n.newValue)))return[2,this.Gc(a)]}else n.key===this.qc&&(s=function(e){var t=Wn.Es;if(null!=e)try{var n=JSON.parse(e);y("number"==typeof n),t=n}catch(e){p("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(n.newValue))!==Wn.Es&&this.fs(s)}else this.Mc.push(n);return[2]}))}))}))}},Object.defineProperty(e.prototype,"nu",{get:function(){return this.Oc.get(this.kc)},enumerable:!1,configurable:!0}),e.prototype.jc=function(){this.setItem(this.Lc,this.nu.Cc())},e.prototype.Xc=function(e,t,n){var r=new Ji(this.currentUser,e,t,n),i=Gi(this.persistenceKey,this.currentUser,e);this.setItem(i,r.Cc())},e.prototype.tu=function(e){var t=Gi(this.persistenceKey,this.currentUser,e);this.removeItem(t)},e.prototype.uu=function(e){var t={clientId:this.kc,onlineState:e};this.storage.setItem(this.Wc,JSON.stringify(t))},e.prototype.hu=function(e,t,n){var r=Wi(this.persistenceKey,e),i=new Zi(e,t,n);this.setItem(r,i.Cc())},e.prototype.lu=function(e){var t=this.Bc.exec(e);return t?t[1]:null},e.prototype.fu=function(e,t){var n=this.lu(e);return Xi.Dc(n,t)},e.prototype.du=function(e,t){var n=this.Uc.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return Ji.Dc(new Pi(i),r,t)},e.prototype.Tu=function(e,t){var n=this.Qc.exec(e),r=Number(n[1]);return Zi.Dc(r,t)},e.prototype.Kc=function(e){return Yi.Dc(e)},e.prototype.wu=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return e.user.uid===this.currentUser.uid?[2,this.fc.mu(e.batchId,e.state,e.error)]:(d("SharedClientState","Ignoring mutation for non-active user "+e.user.uid),[2])}))}))},e.prototype.Eu=function(e){return this.fc.Iu(e.targetId,e.state,e.error)},e.prototype._u=function(e,t){var n=this,r=t?this.Oc.st(e,t):this.Oc.remove(e),i=this.Hc(this.Oc),o=this.Hc(r),a=[],s=[];return o.forEach((function(e){i.has(e)||a.push(e)})),i.forEach((function(e){o.has(e)||s.push(e)})),this.fc.Au(a,s).then((function(){n.Oc=r}))},e.prototype.Gc=function(e){this.Oc.get(e.clientId)&&this.Da(e.onlineState)},e.prototype.Hc=function(e){var t=fe();return e.forEach((function(e,n){t=t.Nt(n.activeTargetIds)})),t},e}(),$i=function(){function e(){this.Ru=new Qi,this.Pu={},this.Da=null,this.fs=null}return e.prototype.Jc=function(e){},e.prototype.Zc=function(e,t,n){},e.prototype.eu=function(e){return this.Ru.Nc(e),this.Pu[e]||"not-current"},e.prototype.ou=function(e,t,n){this.Pu[e]=t},e.prototype.su=function(e){this.Ru.Fc(e)},e.prototype.iu=function(e){return this.Ru.activeTargetIds.has(e)},e.prototype.ru=function(e){delete this.Pu[e]},e.prototype.zc=function(){return this.Ru.activeTargetIds},e.prototype.Yc=function(e){return this.Ru.activeTargetIds.has(e)},e.prototype.start=function(){return this.Ru=new Qi,Promise.resolve()},e.prototype.au=function(e,t,n){},e.prototype.cu=function(e){},e.prototype.th=function(){},e.prototype.Ts=function(e){},e}(),eo=function(e){this.key=e},to=function(e){this.key=e},no=function(){function e(e,t){this.query=e,this.gu=t,this.Vu=null,this.Yt=!1,this.yu=de(),this.qt=de(),this.pu=wn(e),this.bu=new me(this.pu)}return Object.defineProperty(e.prototype,"vu",{get:function(){return this.gu},enumerable:!1,configurable:!0}),e.prototype.Su=function(e,t){var n=this,r=t?t.Du:new ge,i=t?t.bu:this.bu,o=t?t.qt:this.qt,a=i,s=!1,c=this.query.an()&&i.size===this.query.limit?i.last():null,l=this.query.cn()&&i.size===this.query.limit?i.first():null;if(e.ht((function(e,t){var u=i.get(e),h=t instanceof rn?t:null;h&&(h=_n(n.query,h)?h:null);var d=!!u&&n.qt.has(u.key),p=!!h&&(h.Ge||n.qt.has(h.key)&&h.hasCommittedMutations),f=!1;u&&h?u.data().isEqual(h.data())?d!==p&&(r.track({type:3,doc:h}),f=!0):n.Cu(u,h)||(r.track({type:2,doc:h}),f=!0,(c&&n.pu(h,c)>0||l&&n.pu(h,l)<0)&&(s=!0)):!u&&h?(r.track({type:0,doc:h}),f=!0):u&&!h&&(r.track({type:1,doc:u}),f=!0,(c||l)&&(s=!0)),f&&(h?(a=a.add(h),o=p?o.add(e):o.delete(e)):(a=a.delete(e),o=o.delete(e)))})),this.query.an()||this.query.cn())for(;a.size>this.query.limit;){var u=this.query.an()?a.last():a.first();a=a.delete(u.key),o=o.delete(u.key),r.track({type:1,doc:u})}return{bu:a,Du:r,Nu:s,qt:o}},e.prototype.Cu=function(e,t){return e.Ge&&t.hasCommittedMutations&&!t.Ge},e.prototype.Un=function(e,t,n){var r=this,i=this.bu;this.bu=e.bu,this.qt=e.qt;var o=e.Du.Mt();o.sort((function(e,t){return function(e,t){var n=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return g()}};return n(e)-n(t)}(e.type,t.type)||r.pu(e.doc,t.doc)})),this.Fu(n);var a=t?this.ku():[],s=0===this.yu.size&&this.Yt?1:0,c=s!==this.Vu;return this.Vu=s,0!==o.length||c?{snapshot:new ye(this.query,e.bu,i,o,e.qt,0===s,c,!1),$u:a}:{$u:a}},e.prototype.xu=function(e){return this.Yt&&"Offline"===e?(this.Yt=!1,this.Un({bu:this.bu,Du:new ge,qt:this.qt,Nu:!1},!1)):{$u:[]}},e.prototype.Ou=function(e){return!this.gu.has(e)&&!!this.bu.has(e)&&!this.bu.get(e).Ge},e.prototype.Fu=function(e){var t=this;e&&(e.Jt.forEach((function(e){return t.gu=t.gu.add(e)})),e.Xt.forEach((function(e){})),e.Zt.forEach((function(e){return t.gu=t.gu.delete(e)})),this.Yt=e.Yt)},e.prototype.ku=function(){var e=this;if(!this.Yt)return[];var t=this.yu;this.yu=de(),this.bu.forEach((function(t){e.Ou(t.key)&&(e.yu=e.yu.add(t.key))}));var n=[];return t.forEach((function(t){e.yu.has(t)||n.push(new to(t))})),this.yu.forEach((function(e){t.has(e)||n.push(new eo(e))})),n},e.prototype.Mu=function(e){this.gu=e.gh,this.yu=de();var t=this.Su(e.documents);return this.Un(t,!0)},e.prototype.Lu=function(){return ye.Qt(this.query,this.bu,this.qt,0===this.Vu)},e}(),ro=function(e,t,n){this.query=e,this.targetId=t,this.view=n},io=function(e){this.key=e,this.qu=!1},oo=function(){function e(e,t,n,r,i,o){this.La=e,this.Bu=t,this.qa=n,this.Uu=r,this.currentUser=i,this.Qu=o,this.Wu=null,this.ju=new C((function(e){return vn(e)}),yn),this.Ku=new Map,this.Gu=[],this.zu=new ee(j.P),this.Hu=new Map,this.Yu=new ki,this.Ju={},this.Xu=new Map,this.Zu=si.eo(),this.onlineState="Unknown",this.tl=void 0}return Object.defineProperty(e.prototype,"el",{get:function(){return!0===this.tl},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){this.Wu=e},e.prototype.listen=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("listen()"),(r=this.ju.get(e))?(t=r.targetId,this.Uu.eu(t),n=r.view.Lu(),[3,4]):[3,1];case 1:return[4,Si(this.La,pn(e))];case 2:return o=i.sent(),a=this.Uu.eu(o.targetId),t=o.targetId,[4,this.sl(e,t,"current"===a)];case 3:n=i.sent(),this.el&&this.Bu.listen(o),i.label=4;case 4:return[2,n]}}))}))},e.prototype.sl=function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,c,l;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Mi(this.La,e,!0)];case 1:return r=i.sent(),o=new no(e,r.gh),a=o.Su(r.documents),s=be.Ht(t,n&&"Offline"!==this.onlineState),c=o.Un(a,this.el,s),this.il(t,c.$u),l=new ro(e,t,o),[2,(this.ju.set(e,l),this.Ku.has(t)?this.Ku.get(t).push(e):this.Ku.set(t,[e]),c.snapshot)]}}))}))},e.prototype.lc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("unlisten()"),t=this.ju.get(e),(n=this.Ku.get(t.targetId)).length>1?[2,(this.Ku.set(t.targetId,n.filter((function(t){return!yn(t,e)}))),void this.ju.delete(e))]:this.el?(this.Uu.su(t.targetId),this.Uu.Yc(t.targetId)?[3,2]:[4,Ti(this.La,t.targetId,!1).then((function(){r.Uu.ru(t.targetId),r.Bu.lc(t.targetId),r.rl(t.targetId)})).catch(Ci)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return this.rl(t.targetId),[4,Ti(this.La,t.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},e.prototype.write=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:this.nl("write()"),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,function(e,t){var n,r=v(e),i=P.now(),o=t.reduce((function(e,t){return e.add(t.key)}),de());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return r.Rh.Zn(e,o).next((function(o){n=o;for(var a=[],s=0,c=t;s<c.length;s++){var l=c[s],u=Ht(l,n.get(l.key));null!=u&&a.push(new Wt(l.key,u,tn(u.proto.mapValue),Ft.exists(!0)))}return r.Gn.Ir(e,i,a,t)}))})).then((function(e){var t=e.An(n);return{batchId:e.batchId,Fn:t}}))}(this.La,e)];case 2:return n=i.sent(),this.Uu.Jc(n.batchId),this.ol(n.batchId,t),[4,this.hl(n.Fn)];case 3:return i.sent(),[4,this.Bu.hc()];case 4:return i.sent(),[3,6];case 5:return r=i.sent(),o=cr(r,"Failed to persist write"),t.reject(o),[3,6];case 6:return[2]}}))}))},e.prototype.mc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("applyRemoteEvent()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,Ai(this.La,e)];case 2:return t=r.sent(),e.Wt.forEach((function(e,t){var r=n.Hu.get(t);r&&(y(e.Jt.size+e.Xt.size+e.Zt.size<=1),e.Jt.size>0?r.qu=!0:e.Xt.size>0?y(r.qu):e.Zt.size>0&&(y(r.qu),r.qu=!1))})),[4,this.hl(t,e)];case 3:return r.sent(),[3,6];case 4:return[4,Ci(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.xu=function(e,t){if(this.el&&0===t||!this.el&&1===t){this.nl("applyOnlineStateChange()");var n=[];this.ju.forEach((function(t,r){var i=r.view.xu(e);i.snapshot&&n.push(i.snapshot)})),this.Wu.al(e),this.Wu.Ea(n),this.onlineState=e,this.el&&this.Uu.cu(e)}},e.prototype.Ic=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("rejectListens()"),this.Uu.ou(e,"rejected",t),n=this.Hu.get(e),(r=n&&n.key)?(o=(o=new ee(j.P)).st(r,new on(r,O.min())),a=de().add(r),s=new ve(O.min(),new Map,new re(w),o,a),[4,this.mc(s)]):[3,2];case 1:return i.sent(),this.zu=this.zu.remove(r),this.Hu.delete(e),this.cl(),[3,4];case 2:return[4,Ti(this.La,e,!1).then((function(){return c.rl(e,t)})).catch(Ci)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},e.prototype.yc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("applySuccessfulWrite()"),t=e.batch.batchId,r.label=1;case 1:return r.trys.push([1,4,,6]),[4,wi(this.La,e)];case 2:return n=r.sent(),this.ul(t,null),this.ll(t),this.Uu.Zc(t,"acknowledged"),[4,this.hl(n)];case 3:return r.sent(),[3,6];case 4:return[4,Ci(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.bc=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("rejectFailedWrite()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,function(e,t){var n=v(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(e){var r;return n.Gn.Rr(e,t).next((function(t){return y(null!==t),r=t.keys(),n.Gn.br(e,t)})).next((function(){return n.Gn.Cr(e)})).next((function(){return n.Rh.Zn(e,r)}))}))}(this.La,e)];case 2:return n=r.sent(),this.ul(e,t),this.ll(e),this.Uu.Zc(e,"rejected",t),[4,this.hl(n)];case 3:return r.sent(),[3,6];case 4:return[4,Ci(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype._l=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:this.Bu.Ga()||d("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,function(e){var t=v(e);return t.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(e){return t.Gn.Vr(e)}))}(this.La)];case 2:return-1===(t=i.sent())?[2,void e.resolve()]:((n=this.Xu.get(t)||[]).push(e),this.Xu.set(t,n),[3,4]);case 3:return r=i.sent(),o=cr(r,"Initialization of waitForPendingWrites() operation failed"),e.reject(o),[3,4];case 4:return[2]}}))}))},e.prototype.ll=function(e){(this.Xu.get(e)||[]).forEach((function(e){e.resolve()})),this.Xu.delete(e)},e.prototype.fl=function(e){this.Xu.forEach((function(t){t.forEach((function(t){t.reject(new I(k.CANCELLED,e))}))})),this.Xu.clear()},e.prototype.ol=function(e,t){var n=this.Ju[this.currentUser.$h()];n||(n=new ee(w)),n=n.st(e,t),this.Ju[this.currentUser.$h()]=n},e.prototype.ul=function(e,t){var n=this.Ju[this.currentUser.$h()];if(n){var r=n.get(e);r&&(t?r.reject(t):r.resolve(),n=n.remove(e)),this.Ju[this.currentUser.$h()]=n}},e.prototype.rl=function(e,t){var n=this;void 0===t&&(t=null),this.Uu.su(e);for(var r=0,i=this.Ku.get(e);r<i.length;r++){var o=i[r];this.ju.delete(o),t&&this.Wu.dl(o,t)}this.Ku.delete(e),this.el&&this.Yu.Ch(e).forEach((function(e){n.Yu.Nr(e)||n.wl(e)}))},e.prototype.wl=function(e){var t=this.zu.get(e);null!==t&&(this.Bu.lc(t),this.zu=this.zu.remove(e),this.Hu.delete(t),this.cl())},e.prototype.il=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];i instanceof eo?(this.Yu.Eo(i.key,e),this.Tl(i)):i instanceof to?(d("SyncEngine","Document no longer in limbo: "+i.key),this.Yu.Io(i.key,e),this.Yu.Nr(i.key)||this.wl(i.key)):g()}},e.prototype.Tl=function(e){var t=e.key;this.zu.get(t)||(d("SyncEngine","New document in limbo: "+t),this.Gu.push(t),this.cl())},e.prototype.cl=function(){for(;this.Gu.length>0&&this.zu.size<this.Qu;){var e=this.Gu.shift(),t=this.Zu.next();this.Hu.set(t,new io(e)),this.zu=this.zu.st(e,t),this.Bu.listen(new Y(pn(un(e.path)),t,2,Wn.Es))}},e.prototype.El=function(){return this.zu},e.prototype.ml=function(){return this.Gu},e.prototype.hl=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a=this;return i.__generator(this,(function(s){switch(s.label){case 0:return n=[],r=[],o=[],this.ju.forEach((function(i,s){o.push(Promise.resolve().then((function(){var t=s.view.Su(e);return t.Nu?Mi(a.La,s.query,!1).then((function(e){var n=e.documents;return s.view.Su(n,t)})):t})).then((function(e){var i=t&&t.Wt.get(s.targetId),o=s.view.Un(e,a.el,i);if(a.il(s.targetId,o.$u),o.snapshot){a.el&&a.Uu.ou(s.targetId,o.snapshot.fromCache?"not-current":"current"),n.push(o.snapshot);var c=Gn._s(s.targetId,o.snapshot);r.push(c)}})))})),[4,Promise.all(o)];case 1:return s.sent(),this.Wu.Ea(n),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,u,h;return i.__generator(this,(function(i){switch(i.label){case 0:n=v(e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(e){return Bn.forEach(t,(function(t){return Bn.forEach(t.us,(function(r){return n.persistence.dr.Eo(e,t.targetId,r)})).next((function(){return Bn.forEach(t.ls,(function(r){return n.persistence.dr.Io(e,t.targetId,r)}))}))}))}))];case 2:return i.sent(),[3,4];case 3:if(!Kn(r=i.sent()))throw r;return d("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(o=0,a=t;o<a.length;o++)s=a[o],c=s.targetId,s.fromCache||(l=n.Eh.get(c),u=l.Z,h=l.nt(u),n.Eh=n.Eh.st(c,h));return[2]}}))}))}(this.La,r)];case 2:return s.sent(),[2]}}))}))},e.prototype.nl=function(e){},e.prototype.vc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return this.currentUser.isEqual(e)?[3,3]:(d("SyncEngine","User change. New user:",e.$h()),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),r=n.Gn,o=n.Rh,[4,n.persistence.runTransaction("Handle user change","readonly",(function(e){var i;return n.Gn.yr(e).next((function(a){return i=a,r=n.persistence.oh(t),o=new qn(n.Ah,r,n.persistence.uh()),r.yr(e)})).next((function(t){for(var n=[],r=[],a=de(),s=0,c=i;s<c.length;s++){var l=c[s];n.push(l.batchId);for(var u=0,h=l.mutations;u<h.length;u++){var d=h[u];a=a.add(d.key)}}for(var p=0,f=t;p<f.length;p++){var m=f[p];r.push(m.batchId);for(var g=0,y=m.mutations;g<y.length;g++){var v=y[g];a=a.add(v.key)}}return o.Zn(e,a).next((function(e){return{Il:e,Al:n,Rl:r}}))}))}))];case 1:return a=i.sent(),[2,(n.Gn=r,n.Rh=o,n.Th.Ph(n.Rh),a)]}}))}))}(this.La,e)]);case 1:return t=n.sent(),this.currentUser=e,this.fl("'waitForPendingWrites' promise is rejected due to a user change."),this.Uu.au(e,t.Al,t.Rl),[4,this.hl(t.Il)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.Oe=function(e){var t=this.Hu.get(e);if(t&&t.qu)return de().add(t.key);var n=de(),r=this.Ku.get(e);if(!r)return n;for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.ju.get(a);n=n.Nt(s.view.vu)}return n},e}();function ao(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Mi((n=v(e)).La,t.query,!0)];case 1:return r=i.sent(),o=t.view.Mu(r),[2,(n.el&&n.il(t.targetId,o.$u),o)]}}))}))}function so(e,t,n,r){return i.__awaiter(this,void 0,void 0,(function(){var o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return(o=v(e)).nl("applyBatchState()"),[4,function(e,t){var n=v(e),r=v(n.Gn);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(e){return r.Pr(e,t).next((function(t){return t?n.Rh.Zn(e,t):Bn.resolve(null)}))}))}(o.La,t)];case 1:return null===(a=i.sent())?[3,6]:"pending"!==n?[3,3]:[4,o.Bu.hc()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(o.ul(t,r||null),function(e,t){v(v(e).Gn).Sr(t)}(o.La,t)):g(),i.label=4;case 4:return[4,o.hl(a)];case 5:return i.sent(),[3,7];case 6:d("SyncEngine","Cannot apply mutation batch with id: "+t),i.label=7;case 7:return[2]}}))}))}function co(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),!0!==t||!0===n.tl?[3,3]:(r=n.Uu.zc(),[4,lo(n,r.N())]);case 1:return o=i.sent(),n.tl=!0,[4,n.Bu.Sc(!0)];case 2:for(i.sent(),a=0,s=o;a<s.length;a++)c=s[a],n.Bu.listen(c);return[3,7];case 3:return!1!==t||!1===n.tl?[3,7]:(l=[],u=Promise.resolve(),n.Ku.forEach((function(e,t){n.Uu.iu(t)?l.push(t):u=u.then((function(){return n.rl(t),Ti(n.La,t,!0)})),n.Bu.lc(t)})),[4,u]);case 4:return i.sent(),[4,lo(n,l)];case 5:return i.sent(),function(e){var t=v(e);t.Hu.forEach((function(e,n){t.Bu.lc(n)})),t.Yu.Nh(),t.Hu=new Map,t.zu=new ee(j.P)}(n),n.tl=!1,[4,n.Bu.Sc(!1)];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))}function lo(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,u,h,d,p,f,m,g;return i.__generator(this,(function(i){switch(i.label){case 0:n=v(e),r=[],o=[],a=0,s=t,i.label=1;case 1:return a<s.length?(c=s[a],l=void 0,(u=n.Ku.get(c))&&0!==u.length?[4,Si(n.La,pn(u[0]))]:[3,7]):[3,13];case 2:l=i.sent(),h=0,d=u,i.label=3;case 3:return h<d.length?(p=d[h],f=n.ju.get(p),[4,ao(n,f)]):[3,6];case 4:(m=i.sent()).snapshot&&o.push(m.snapshot),i.label=5;case 5:return h++,[3,3];case 6:return[3,11];case 7:return[4,Ri(n.La,c)];case 8:return g=i.sent(),[4,Si(n.La,g)];case 9:return l=i.sent(),[4,n.sl(uo(g),c,!1)];case 10:i.sent(),i.label=11;case 11:r.push(l),i.label=12;case 12:return a++,[3,1];case 13:return[2,(n.Wu.Ea(o),r)]}}))}))}function uo(e){return ln(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function ho(e){var t=v(e);return v(v(t.La).persistence).rh()}function po(e,t,n,r){return i.__awaiter(this,void 0,void 0,(function(){var o,a,s;return i.__generator(this,(function(i){switch(i.label){case 0:return(o=v(e)).tl?(d("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Ku.has(t))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,function(e){var t=v(e),n=v(t.Ah);return t.persistence.runTransaction("Get new document changes","readonly",(function(e){return n.Ur(e,t.Ih)})).then((function(e){var n=e.Qr,r=e.readTime;return t.Ih=r,n}))}(o.La)];case 3:return a=i.sent(),s=ve.zt(t,"current"===n),[4,o.hl(a,s)];case 4:return i.sent(),[3,8];case 5:return[4,Ti(o.La,t,!0)];case 6:return i.sent(),o.rl(t,r),[3,8];case 7:g(),i.label=8;case 8:return[2]}}))}))}function fo(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,c,l,u,h,p,f;return i.__generator(this,(function(m){switch(m.label){case 0:if(!(r=v(e)).tl)return[3,10];o=0,a=t,m.label=1;case 1:return o<a.length?(s=a[o],r.Ku.has(s)?(d("SyncEngine","Adding an already active target "+s),[3,5]):[4,Ri(r.La,s)]):[3,6];case 2:return c=m.sent(),[4,Si(r.La,c)];case 3:return l=m.sent(),[4,r.sl(uo(c),l.targetId,!1)];case 4:m.sent(),r.Bu.listen(l),m.label=5;case 5:return o++,[3,1];case 6:u=function(e){return i.__generator(this,(function(t){switch(t.label){case 0:return r.Ku.has(e)?[4,Ti(r.La,e,!1).then((function(){r.Bu.lc(e),r.rl(e)})).catch(Ci)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},h=0,p=n,m.label=7;case 7:return h<p.length?(f=p[h],[5,u(f)]):[3,10];case 8:m.sent(),m.label=9;case 9:return h++,[3,7];case 10:return[2]}}))}))}+ */function qi(e,t){return"firestore_clients_"+e+"_"+t}function Gi(e,t,n){var r="firestore_mutations_"+e+"_"+n;return t.Er()&&(r+="_"+t.uid),r}function Wi(e,t){return"firestore_targets_"+e+"_"+t}var Ji=function(){function e(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}return e.Dc=function(t,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),a=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(a=new I(i.error.code,i.error.message)),o?new e(t,n,i.state,a):(p("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},e.prototype.Cc=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Zi=function(){function e(e,t,n){this.targetId=e,this.state=t,this.error=n}return e.Dc=function(t,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new I(r.error.code,r.error.message)),i?new e(t,r.state,o):(p("SharedClientState","Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.Cc=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Yi=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.Dc=function(t,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=fe(),a=0;i&&a<r.activeTargetIds.length;++a)i=V(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new e(t,o):(p("SharedClientState","Failed to parse client data for instance '"+t+"': "+n),null)},e}(),Xi=function(){function e(e,t){this.clientId=e,this.onlineState=t}return e.Dc=function(t){var n=JSON.parse(t);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new e(n.clientId,n.onlineState):(p("SharedClientState","Failed to parse online state: "+t),null)},e}(),Qi=function(){function e(){this.activeTargetIds=fe()}return e.prototype.Nc=function(e){this.activeTargetIds=this.activeTargetIds.add(e)},e.prototype.Fc=function(e){this.activeTargetIds=this.activeTargetIds.delete(e)},e.prototype.Cc=function(){var e={activeTargetIds:this.activeTargetIds.N(),updateTimeMs:Date.now()};return JSON.stringify(e)},e}(),Ki=function(){function e(e,t,n,r,i){this.window=e,this.ms=t,this.persistenceKey=n,this.kc=r,this.fc=null,this.Da=null,this.fs=null,this.$c=this.xc.bind(this),this.Oc=new ee(w),this.tr=!1,this.Mc=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Lc=qi(this.persistenceKey,this.kc),this.qc=function(e){return"firestore_sequence_number_"+e}(this.persistenceKey),this.Oc=this.Oc.st(this.kc,new Qi),this.Bc=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Uc=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.Qc=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Wc=function(e){return"firestore_online_state_"+e}(this.persistenceKey),this.window.addEventListener("storage",this.$c)}return e.ks=function(e){return!(!e||!e.localStorage)},e.prototype.start=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n,r,o,a,s,c,l,u,h,d=this;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,this.fc.rh()];case 1:for(e=i.sent(),t=0,n=e;t<n.length;t++)(r=n[t])!==this.kc&&(o=this.getItem(qi(this.persistenceKey,r)))&&(a=Yi.Dc(r,o))&&(this.Oc=this.Oc.st(a.clientId,a));for(this.jc(),(s=this.storage.getItem(this.Wc))&&(c=this.Kc(s))&&this.Gc(c),l=0,u=this.Mc;l<u.length;l++)h=u[l],this.xc(h);return this.Mc=[],this.window.addEventListener("unload",(function(){return d.th()})),this.tr=!0,[2]}}))}))},e.prototype.Ts=function(e){this.setItem(this.qc,JSON.stringify(e))},e.prototype.zc=function(){return this.Hc(this.Oc)},e.prototype.Yc=function(e){var t=!1;return this.Oc.forEach((function(n,r){r.activeTargetIds.has(e)&&(t=!0)})),t},e.prototype.Jc=function(e){this.Xc(e,"pending")},e.prototype.Zc=function(e,t,n){this.Xc(e,t,n),this.tu(e)},e.prototype.eu=function(e){var t="not-current";if(this.Yc(e)){var n=this.storage.getItem(Wi(this.persistenceKey,e));if(n){var r=Zi.Dc(e,n);r&&(t=r.state)}}return this.nu.Nc(e),this.jc(),t},e.prototype.su=function(e){this.nu.Fc(e),this.jc()},e.prototype.iu=function(e){return this.nu.activeTargetIds.has(e)},e.prototype.ru=function(e){this.removeItem(Wi(this.persistenceKey,e))},e.prototype.ou=function(e,t,n){this.hu(e,t,n)},e.prototype.au=function(e,t,n){var r=this;t.forEach((function(e){r.tu(e)})),this.currentUser=e,n.forEach((function(e){r.Jc(e)}))},e.prototype.cu=function(e){this.uu(e)},e.prototype.th=function(){this.tr&&(this.window.removeEventListener("storage",this.$c),this.removeItem(this.Lc),this.tr=!1)},e.prototype.getItem=function(e){var t=this.storage.getItem(e);return d("SharedClientState","READ",e,t),t},e.prototype.setItem=function(e,t){d("SharedClientState","SET",e,t),this.storage.setItem(e,t)},e.prototype.removeItem=function(e){d("SharedClientState","REMOVE",e),this.storage.removeItem(e)},e.prototype.xc=function(e){var t=this,n=e;if(n.storageArea===this.storage){if(d("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Lc)return void p("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.ms.gi((function(){return i.__awaiter(t,void 0,void 0,(function(){var e,t,r,o,a,s;return i.__generator(this,(function(i){if(this.tr){if(null!==n.key)if(this.Bc.test(n.key)){if(null==n.newValue)return e=this.lu(n.key),[2,this._u(e,null)];if(t=this.fu(n.key,n.newValue))return[2,this._u(t.clientId,t)]}else if(this.Uc.test(n.key)){if(null!==n.newValue&&(r=this.du(n.key,n.newValue)))return[2,this.wu(r)]}else if(this.Qc.test(n.key)){if(null!==n.newValue&&(o=this.Tu(n.key,n.newValue)))return[2,this.Eu(o)]}else if(n.key===this.Wc){if(null!==n.newValue&&(a=this.Kc(n.newValue)))return[2,this.Gc(a)]}else n.key===this.qc&&(s=function(e){var t=Wn.Es;if(null!=e)try{var n=JSON.parse(e);y("number"==typeof n),t=n}catch(e){p("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(n.newValue))!==Wn.Es&&this.fs(s)}else this.Mc.push(n);return[2]}))}))}))}},Object.defineProperty(e.prototype,"nu",{get:function(){return this.Oc.get(this.kc)},enumerable:!1,configurable:!0}),e.prototype.jc=function(){this.setItem(this.Lc,this.nu.Cc())},e.prototype.Xc=function(e,t,n){var r=new Ji(this.currentUser,e,t,n),i=Gi(this.persistenceKey,this.currentUser,e);this.setItem(i,r.Cc())},e.prototype.tu=function(e){var t=Gi(this.persistenceKey,this.currentUser,e);this.removeItem(t)},e.prototype.uu=function(e){var t={clientId:this.kc,onlineState:e};this.storage.setItem(this.Wc,JSON.stringify(t))},e.prototype.hu=function(e,t,n){var r=Wi(this.persistenceKey,e),i=new Zi(e,t,n);this.setItem(r,i.Cc())},e.prototype.lu=function(e){var t=this.Bc.exec(e);return t?t[1]:null},e.prototype.fu=function(e,t){var n=this.lu(e);return Yi.Dc(n,t)},e.prototype.du=function(e,t){var n=this.Uc.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return Ji.Dc(new Pi(i),r,t)},e.prototype.Tu=function(e,t){var n=this.Qc.exec(e),r=Number(n[1]);return Zi.Dc(r,t)},e.prototype.Kc=function(e){return Xi.Dc(e)},e.prototype.wu=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return e.user.uid===this.currentUser.uid?[2,this.fc.mu(e.batchId,e.state,e.error)]:(d("SharedClientState","Ignoring mutation for non-active user "+e.user.uid),[2])}))}))},e.prototype.Eu=function(e){return this.fc.Iu(e.targetId,e.state,e.error)},e.prototype._u=function(e,t){var n=this,r=t?this.Oc.st(e,t):this.Oc.remove(e),i=this.Hc(this.Oc),o=this.Hc(r),a=[],s=[];return o.forEach((function(e){i.has(e)||a.push(e)})),i.forEach((function(e){o.has(e)||s.push(e)})),this.fc.Au(a,s).then((function(){n.Oc=r}))},e.prototype.Gc=function(e){this.Oc.get(e.clientId)&&this.Da(e.onlineState)},e.prototype.Hc=function(e){var t=fe();return e.forEach((function(e,n){t=t.Nt(n.activeTargetIds)})),t},e}(),$i=function(){function e(){this.Ru=new Qi,this.Pu={},this.Da=null,this.fs=null}return e.prototype.Jc=function(e){},e.prototype.Zc=function(e,t,n){},e.prototype.eu=function(e){return this.Ru.Nc(e),this.Pu[e]||"not-current"},e.prototype.ou=function(e,t,n){this.Pu[e]=t},e.prototype.su=function(e){this.Ru.Fc(e)},e.prototype.iu=function(e){return this.Ru.activeTargetIds.has(e)},e.prototype.ru=function(e){delete this.Pu[e]},e.prototype.zc=function(){return this.Ru.activeTargetIds},e.prototype.Yc=function(e){return this.Ru.activeTargetIds.has(e)},e.prototype.start=function(){return this.Ru=new Qi,Promise.resolve()},e.prototype.au=function(e,t,n){},e.prototype.cu=function(e){},e.prototype.th=function(){},e.prototype.Ts=function(e){},e}(),eo=function(e){this.key=e},to=function(e){this.key=e},no=function(){function e(e,t){this.query=e,this.gu=t,this.Vu=null,this.Yt=!1,this.yu=de(),this.qt=de(),this.pu=wn(e),this.bu=new me(this.pu)}return Object.defineProperty(e.prototype,"vu",{get:function(){return this.gu},enumerable:!1,configurable:!0}),e.prototype.Su=function(e,t){var n=this,r=t?t.Du:new ge,i=t?t.bu:this.bu,o=t?t.qt:this.qt,a=i,s=!1,c=this.query.an()&&i.size===this.query.limit?i.last():null,l=this.query.cn()&&i.size===this.query.limit?i.first():null;if(e.ht((function(e,t){var u=i.get(e),h=t instanceof rn?t:null;h&&(h=_n(n.query,h)?h:null);var d=!!u&&n.qt.has(u.key),p=!!h&&(h.Ge||n.qt.has(h.key)&&h.hasCommittedMutations),f=!1;u&&h?u.data().isEqual(h.data())?d!==p&&(r.track({type:3,doc:h}),f=!0):n.Cu(u,h)||(r.track({type:2,doc:h}),f=!0,(c&&n.pu(h,c)>0||l&&n.pu(h,l)<0)&&(s=!0)):!u&&h?(r.track({type:0,doc:h}),f=!0):u&&!h&&(r.track({type:1,doc:u}),f=!0,(c||l)&&(s=!0)),f&&(h?(a=a.add(h),o=p?o.add(e):o.delete(e)):(a=a.delete(e),o=o.delete(e)))})),this.query.an()||this.query.cn())for(;a.size>this.query.limit;){var u=this.query.an()?a.last():a.first();a=a.delete(u.key),o=o.delete(u.key),r.track({type:1,doc:u})}return{bu:a,Du:r,Nu:s,qt:o}},e.prototype.Cu=function(e,t){return e.Ge&&t.hasCommittedMutations&&!t.Ge},e.prototype.Un=function(e,t,n){var r=this,i=this.bu;this.bu=e.bu,this.qt=e.qt;var o=e.Du.Mt();o.sort((function(e,t){return function(e,t){var n=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return g()}};return n(e)-n(t)}(e.type,t.type)||r.pu(e.doc,t.doc)})),this.Fu(n);var a=t?this.ku():[],s=0===this.yu.size&&this.Yt?1:0,c=s!==this.Vu;return this.Vu=s,0!==o.length||c?{snapshot:new ye(this.query,e.bu,i,o,e.qt,0===s,c,!1),$u:a}:{$u:a}},e.prototype.xu=function(e){return this.Yt&&"Offline"===e?(this.Yt=!1,this.Un({bu:this.bu,Du:new ge,qt:this.qt,Nu:!1},!1)):{$u:[]}},e.prototype.Ou=function(e){return!this.gu.has(e)&&!!this.bu.has(e)&&!this.bu.get(e).Ge},e.prototype.Fu=function(e){var t=this;e&&(e.Jt.forEach((function(e){return t.gu=t.gu.add(e)})),e.Xt.forEach((function(e){})),e.Zt.forEach((function(e){return t.gu=t.gu.delete(e)})),this.Yt=e.Yt)},e.prototype.ku=function(){var e=this;if(!this.Yt)return[];var t=this.yu;this.yu=de(),this.bu.forEach((function(t){e.Ou(t.key)&&(e.yu=e.yu.add(t.key))}));var n=[];return t.forEach((function(t){e.yu.has(t)||n.push(new to(t))})),this.yu.forEach((function(e){t.has(e)||n.push(new eo(e))})),n},e.prototype.Mu=function(e){this.gu=e.gh,this.yu=de();var t=this.Su(e.documents);return this.Un(t,!0)},e.prototype.Lu=function(){return ye.Qt(this.query,this.bu,this.qt,0===this.Vu)},e}(),ro=function(e,t,n){this.query=e,this.targetId=t,this.view=n},io=function(e){this.key=e,this.qu=!1},oo=function(){function e(e,t,n,r,i,o){this.La=e,this.Bu=t,this.qa=n,this.Uu=r,this.currentUser=i,this.Qu=o,this.Wu=null,this.ju=new C((function(e){return vn(e)}),yn),this.Ku=new Map,this.Gu=[],this.zu=new ee(j.P),this.Hu=new Map,this.Yu=new ki,this.Ju={},this.Xu=new Map,this.Zu=si.eo(),this.onlineState="Unknown",this.tl=void 0}return Object.defineProperty(e.prototype,"el",{get:function(){return!0===this.tl},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){this.Wu=e},e.prototype.listen=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("listen()"),(r=this.ju.get(e))?(t=r.targetId,this.Uu.eu(t),n=r.view.Lu(),[3,4]):[3,1];case 1:return[4,Si(this.La,pn(e))];case 2:return o=i.sent(),a=this.Uu.eu(o.targetId),t=o.targetId,[4,this.sl(e,t,"current"===a)];case 3:n=i.sent(),this.el&&this.Bu.listen(o),i.label=4;case 4:return[2,n]}}))}))},e.prototype.sl=function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,c,l;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Mi(this.La,e,!0)];case 1:return r=i.sent(),o=new no(e,r.gh),a=o.Su(r.documents),s=be.Ht(t,n&&"Offline"!==this.onlineState),c=o.Un(a,this.el,s),this.il(t,c.$u),l=new ro(e,t,o),[2,(this.ju.set(e,l),this.Ku.has(t)?this.Ku.get(t).push(e):this.Ku.set(t,[e]),c.snapshot)]}}))}))},e.prototype.lc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("unlisten()"),t=this.ju.get(e),(n=this.Ku.get(t.targetId)).length>1?[2,(this.Ku.set(t.targetId,n.filter((function(t){return!yn(t,e)}))),void this.ju.delete(e))]:this.el?(this.Uu.su(t.targetId),this.Uu.Yc(t.targetId)?[3,2]:[4,Ti(this.La,t.targetId,!1).then((function(){r.Uu.ru(t.targetId),r.Bu.lc(t.targetId),r.rl(t.targetId)})).catch(Ci)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return this.rl(t.targetId),[4,Ti(this.La,t.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},e.prototype.write=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:this.nl("write()"),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,function(e,t){var n,r=v(e),i=P.now(),o=t.reduce((function(e,t){return e.add(t.key)}),de());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return r.Rh.Zn(e,o).next((function(o){n=o;for(var a=[],s=0,c=t;s<c.length;s++){var l=c[s],u=Ht(l,n.get(l.key));null!=u&&a.push(new Wt(l.key,u,tn(u.proto.mapValue),Ft.exists(!0)))}return r.Gn.Ir(e,i,a,t)}))})).then((function(e){var t=e.An(n);return{batchId:e.batchId,Fn:t}}))}(this.La,e)];case 2:return n=i.sent(),this.Uu.Jc(n.batchId),this.ol(n.batchId,t),[4,this.hl(n.Fn)];case 3:return i.sent(),[4,this.Bu.hc()];case 4:return i.sent(),[3,6];case 5:return r=i.sent(),o=cr(r,"Failed to persist write"),t.reject(o),[3,6];case 6:return[2]}}))}))},e.prototype.mc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("applyRemoteEvent()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,Ai(this.La,e)];case 2:return t=r.sent(),e.Wt.forEach((function(e,t){var r=n.Hu.get(t);r&&(y(e.Jt.size+e.Xt.size+e.Zt.size<=1),e.Jt.size>0?r.qu=!0:e.Xt.size>0?y(r.qu):e.Zt.size>0&&(y(r.qu),r.qu=!1))})),[4,this.hl(t,e)];case 3:return r.sent(),[3,6];case 4:return[4,Ci(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.xu=function(e,t){if(this.el&&0===t||!this.el&&1===t){this.nl("applyOnlineStateChange()");var n=[];this.ju.forEach((function(t,r){var i=r.view.xu(e);i.snapshot&&n.push(i.snapshot)})),this.Wu.al(e),this.Wu.Ea(n),this.onlineState=e,this.el&&this.Uu.cu(e)}},e.prototype.Ic=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("rejectListens()"),this.Uu.ou(e,"rejected",t),n=this.Hu.get(e),(r=n&&n.key)?(o=(o=new ee(j.P)).st(r,new on(r,O.min())),a=de().add(r),s=new ve(O.min(),new Map,new re(w),o,a),[4,this.mc(s)]):[3,2];case 1:return i.sent(),this.zu=this.zu.remove(r),this.Hu.delete(e),this.cl(),[3,4];case 2:return[4,Ti(this.La,e,!1).then((function(){return c.rl(e,t)})).catch(Ci)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},e.prototype.yc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("applySuccessfulWrite()"),t=e.batch.batchId,r.label=1;case 1:return r.trys.push([1,4,,6]),[4,wi(this.La,e)];case 2:return n=r.sent(),this.ul(t,null),this.ll(t),this.Uu.Zc(t,"acknowledged"),[4,this.hl(n)];case 3:return r.sent(),[3,6];case 4:return[4,Ci(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.bc=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("rejectFailedWrite()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,function(e,t){var n=v(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(e){var r;return n.Gn.Rr(e,t).next((function(t){return y(null!==t),r=t.keys(),n.Gn.br(e,t)})).next((function(){return n.Gn.Cr(e)})).next((function(){return n.Rh.Zn(e,r)}))}))}(this.La,e)];case 2:return n=r.sent(),this.ul(e,t),this.ll(e),this.Uu.Zc(e,"rejected",t),[4,this.hl(n)];case 3:return r.sent(),[3,6];case 4:return[4,Ci(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype._l=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:this.Bu.Ga()||d("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,function(e){var t=v(e);return t.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(e){return t.Gn.Vr(e)}))}(this.La)];case 2:return-1===(t=i.sent())?[2,void e.resolve()]:((n=this.Xu.get(t)||[]).push(e),this.Xu.set(t,n),[3,4]);case 3:return r=i.sent(),o=cr(r,"Initialization of waitForPendingWrites() operation failed"),e.reject(o),[3,4];case 4:return[2]}}))}))},e.prototype.ll=function(e){(this.Xu.get(e)||[]).forEach((function(e){e.resolve()})),this.Xu.delete(e)},e.prototype.fl=function(e){this.Xu.forEach((function(t){t.forEach((function(t){t.reject(new I(k.CANCELLED,e))}))})),this.Xu.clear()},e.prototype.ol=function(e,t){var n=this.Ju[this.currentUser.$h()];n||(n=new ee(w)),n=n.st(e,t),this.Ju[this.currentUser.$h()]=n},e.prototype.ul=function(e,t){var n=this.Ju[this.currentUser.$h()];if(n){var r=n.get(e);r&&(t?r.reject(t):r.resolve(),n=n.remove(e)),this.Ju[this.currentUser.$h()]=n}},e.prototype.rl=function(e,t){var n=this;void 0===t&&(t=null),this.Uu.su(e);for(var r=0,i=this.Ku.get(e);r<i.length;r++){var o=i[r];this.ju.delete(o),t&&this.Wu.dl(o,t)}this.Ku.delete(e),this.el&&this.Yu.Ch(e).forEach((function(e){n.Yu.Nr(e)||n.wl(e)}))},e.prototype.wl=function(e){var t=this.zu.get(e);null!==t&&(this.Bu.lc(t),this.zu=this.zu.remove(e),this.Hu.delete(t),this.cl())},e.prototype.il=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];i instanceof eo?(this.Yu.Eo(i.key,e),this.Tl(i)):i instanceof to?(d("SyncEngine","Document no longer in limbo: "+i.key),this.Yu.Io(i.key,e),this.Yu.Nr(i.key)||this.wl(i.key)):g()}},e.prototype.Tl=function(e){var t=e.key;this.zu.get(t)||(d("SyncEngine","New document in limbo: "+t),this.Gu.push(t),this.cl())},e.prototype.cl=function(){for(;this.Gu.length>0&&this.zu.size<this.Qu;){var e=this.Gu.shift(),t=this.Zu.next();this.Hu.set(t,new io(e)),this.zu=this.zu.st(e,t),this.Bu.listen(new X(pn(un(e.path)),t,2,Wn.Es))}},e.prototype.El=function(){return this.zu},e.prototype.ml=function(){return this.Gu},e.prototype.hl=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a=this;return i.__generator(this,(function(s){switch(s.label){case 0:return n=[],r=[],o=[],this.ju.forEach((function(i,s){o.push(Promise.resolve().then((function(){var t=s.view.Su(e);return t.Nu?Mi(a.La,s.query,!1).then((function(e){var n=e.documents;return s.view.Su(n,t)})):t})).then((function(e){var i=t&&t.Wt.get(s.targetId),o=s.view.Un(e,a.el,i);if(a.il(s.targetId,o.$u),o.snapshot){a.el&&a.Uu.ou(s.targetId,o.snapshot.fromCache?"not-current":"current"),n.push(o.snapshot);var c=Gn._s(s.targetId,o.snapshot);r.push(c)}})))})),[4,Promise.all(o)];case 1:return s.sent(),this.Wu.Ea(n),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,u,h;return i.__generator(this,(function(i){switch(i.label){case 0:n=v(e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(e){return Bn.forEach(t,(function(t){return Bn.forEach(t.us,(function(r){return n.persistence.dr.Eo(e,t.targetId,r)})).next((function(){return Bn.forEach(t.ls,(function(r){return n.persistence.dr.Io(e,t.targetId,r)}))}))}))}))];case 2:return i.sent(),[3,4];case 3:if(!Kn(r=i.sent()))throw r;return d("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(o=0,a=t;o<a.length;o++)s=a[o],c=s.targetId,s.fromCache||(l=n.Eh.get(c),u=l.Z,h=l.nt(u),n.Eh=n.Eh.st(c,h));return[2]}}))}))}(this.La,r)];case 2:return s.sent(),[2]}}))}))},e.prototype.nl=function(e){},e.prototype.vc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return this.currentUser.isEqual(e)?[3,3]:(d("SyncEngine","User change. New user:",e.$h()),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),r=n.Gn,o=n.Rh,[4,n.persistence.runTransaction("Handle user change","readonly",(function(e){var i;return n.Gn.yr(e).next((function(a){return i=a,r=n.persistence.oh(t),o=new qn(n.Ah,r,n.persistence.uh()),r.yr(e)})).next((function(t){for(var n=[],r=[],a=de(),s=0,c=i;s<c.length;s++){var l=c[s];n.push(l.batchId);for(var u=0,h=l.mutations;u<h.length;u++){var d=h[u];a=a.add(d.key)}}for(var p=0,f=t;p<f.length;p++){var m=f[p];r.push(m.batchId);for(var g=0,y=m.mutations;g<y.length;g++){var v=y[g];a=a.add(v.key)}}return o.Zn(e,a).next((function(e){return{Il:e,Al:n,Rl:r}}))}))}))];case 1:return a=i.sent(),[2,(n.Gn=r,n.Rh=o,n.Th.Ph(n.Rh),a)]}}))}))}(this.La,e)]);case 1:return t=n.sent(),this.currentUser=e,this.fl("'waitForPendingWrites' promise is rejected due to a user change."),this.Uu.au(e,t.Al,t.Rl),[4,this.hl(t.Il)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.Oe=function(e){var t=this.Hu.get(e);if(t&&t.qu)return de().add(t.key);var n=de(),r=this.Ku.get(e);if(!r)return n;for(var i=0,o=r;i<o.length;i++){var a=o[i],s=this.ju.get(a);n=n.Nt(s.view.vu)}return n},e}();function ao(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Mi((n=v(e)).La,t.query,!0)];case 1:return r=i.sent(),o=t.view.Mu(r),[2,(n.el&&n.il(t.targetId,o.$u),o)]}}))}))}function so(e,t,n,r){return i.__awaiter(this,void 0,void 0,(function(){var o,a;return i.__generator(this,(function(i){switch(i.label){case 0:return(o=v(e)).nl("applyBatchState()"),[4,function(e,t){var n=v(e),r=v(n.Gn);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(e){return r.Pr(e,t).next((function(t){return t?n.Rh.Zn(e,t):Bn.resolve(null)}))}))}(o.La,t)];case 1:return null===(a=i.sent())?[3,6]:"pending"!==n?[3,3]:[4,o.Bu.hc()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(o.ul(t,r||null),function(e,t){v(v(e).Gn).Sr(t)}(o.La,t)):g(),i.label=4;case 4:return[4,o.hl(a)];case 5:return i.sent(),[3,7];case 6:d("SyncEngine","Cannot apply mutation batch with id: "+t),i.label=7;case 7:return[2]}}))}))}function co(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),!0!==t||!0===n.tl?[3,3]:(r=n.Uu.zc(),[4,lo(n,r.N())]);case 1:return o=i.sent(),n.tl=!0,[4,n.Bu.Sc(!0)];case 2:for(i.sent(),a=0,s=o;a<s.length;a++)c=s[a],n.Bu.listen(c);return[3,7];case 3:return!1!==t||!1===n.tl?[3,7]:(l=[],u=Promise.resolve(),n.Ku.forEach((function(e,t){n.Uu.iu(t)?l.push(t):u=u.then((function(){return n.rl(t),Ti(n.La,t,!0)})),n.Bu.lc(t)})),[4,u]);case 4:return i.sent(),[4,lo(n,l)];case 5:return i.sent(),function(e){var t=v(e);t.Hu.forEach((function(e,n){t.Bu.lc(n)})),t.Yu.Nh(),t.Hu=new Map,t.zu=new ee(j.P)}(n),n.tl=!1,[4,n.Bu.Sc(!1)];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))}function lo(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,u,h,d,p,f,m,g;return i.__generator(this,(function(i){switch(i.label){case 0:n=v(e),r=[],o=[],a=0,s=t,i.label=1;case 1:return a<s.length?(c=s[a],l=void 0,(u=n.Ku.get(c))&&0!==u.length?[4,Si(n.La,pn(u[0]))]:[3,7]):[3,13];case 2:l=i.sent(),h=0,d=u,i.label=3;case 3:return h<d.length?(p=d[h],f=n.ju.get(p),[4,ao(n,f)]):[3,6];case 4:(m=i.sent()).snapshot&&o.push(m.snapshot),i.label=5;case 5:return h++,[3,3];case 6:return[3,11];case 7:return[4,Ri(n.La,c)];case 8:return g=i.sent(),[4,Si(n.La,g)];case 9:return l=i.sent(),[4,n.sl(uo(g),c,!1)];case 10:i.sent(),i.label=11;case 11:r.push(l),i.label=12;case 12:return a++,[3,1];case 13:return[2,(n.Wu.Ea(o),r)]}}))}))}function uo(e){return ln(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function ho(e){var t=v(e);return v(v(t.La).persistence).rh()}function po(e,t,n,r){return i.__awaiter(this,void 0,void 0,(function(){var o,a,s;return i.__generator(this,(function(i){switch(i.label){case 0:return(o=v(e)).tl?(d("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Ku.has(t))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,function(e){var t=v(e),n=v(t.Ah);return t.persistence.runTransaction("Get new document changes","readonly",(function(e){return n.Ur(e,t.Ih)})).then((function(e){var n=e.Qr,r=e.readTime;return t.Ih=r,n}))}(o.La)];case 3:return a=i.sent(),s=ve.zt(t,"current"===n),[4,o.hl(a,s)];case 4:return i.sent(),[3,8];case 5:return[4,Ti(o.La,t,!0)];case 6:return i.sent(),o.rl(t,r),[3,8];case 7:g(),i.label=8;case 8:return[2]}}))}))}function fo(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,a,s,c,l,u,h,p,f;return i.__generator(this,(function(m){switch(m.label){case 0:if(!(r=v(e)).tl)return[3,10];o=0,a=t,m.label=1;case 1:return o<a.length?(s=a[o],r.Ku.has(s)?(d("SyncEngine","Adding an already active target "+s),[3,5]):[4,Ri(r.La,s)]):[3,6];case 2:return c=m.sent(),[4,Si(r.La,c)];case 3:return l=m.sent(),[4,r.sl(uo(c),l.targetId,!1)];case 4:m.sent(),r.Bu.listen(l),m.label=5;case 5:return o++,[3,1];case 6:u=function(e){return i.__generator(this,(function(t){switch(t.label){case 0:return r.Ku.has(e)?[4,Ti(r.La,e,!1).then((function(){r.Bu.lc(e),r.rl(e)})).catch(Ci)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},h=0,p=n,m.label=7;case 7:return h<p.length?(f=p[h],[5,u(f)]):[3,10];case 8:m.sent(),m.label=9;case 9:return h++,[3,7];case 10:return[2]}}))}))}/*** @license* Copyright 2017 Google LLC@@ -1130,7 +1130,7 @@ var wo=function(){function e(e){this.persistence=e,this.Gl=new C((function(e){re* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var Io="You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.",Po=function(){function e(){}return e.prototype.initialize=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.Uu=this.b_(e),this.persistence=this.v_(e),[4,this.persistence.start()];case 1:return t.sent(),this.S_=this.D_(e),this.La=this.C_(e),[2]}}))}))},e.prototype.D_=function(e){return null},e.prototype.C_=function(e){return t=this.persistence,n=new vo,r=e.N_,new _i(t,n,r);var t,n,r},e.prototype.v_=function(e){if(e.k_.F_)throw new I(k.FAILED_PRECONDITION,Io);return new Eo(xo.i_)},e.prototype.b_=function(e){return new $i},e.prototype.terminate=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.S_&&this.S_.stop(),[4,this.Uu.th()];case 1:return e.sent(),[4,this.persistence.th()];case 2:return e.sent(),[2]}}))}))},e.prototype.clearPersistence=function(e,t){throw new I(k.FAILED_PRECONDITION,Io)},e}(),Oo=function(e){function t(t){var n=this;return(n=e.call(this)||this).x_=t,n}return i.__extends(t,e),t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){var n,r=this;return i.__generator(this,(function(o){switch(o.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return o.sent(),[4,this.x_.initialize(this,t)];case 2:return o.sent(),n=this.x_.fc,this.Uu instanceof Ki?(this.Uu.fc={mu:so.bind(null,n),Iu:po.bind(null,n),Au:fo.bind(null,n),rh:ho.bind(null,n)},[4,this.Uu.start()]):[3,4];case 3:o.sent(),o.label=4;case 4:return[4,this.persistence.qo((function(e){return i.__awaiter(r,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return[4,co(this.x_.fc,e)];case 1:return t.sent(),this.S_&&(e&&!this.S_.tr?this.S_.start(this.La):e||this.S_.stop()),[2]}}))}))}))];case 5:return o.sent(),[2]}}))}))},t.prototype.b_=function(e){if(e.k_.F_&&e.k_.synchronizeTabs){var t=ir();if(!Ki.ks(t))throw new I(k.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=bi(e.w_.s,e.w_.persistenceKey);return new Ki(t,e.ei,n,e.clientId,e.N_)}return new $i},t}(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return n.sent(),[4,function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n;return i.__generator(this,(function(r){return t=v(e),n=v(t.Ah),[2,t.persistence.runTransaction("Synchronize last document change read time","readonly",(function(e){return n.Wr(e)})).then((function(e){t.Ih=e}))]}))}))}(this.La)];case 2:return n.sent(),[2]}}))}))},t.prototype.D_=function(e){var t=this.persistence.dr.Yi;return new pr(t,e.ei)},t.prototype.v_=function(e){var t=bi(e.w_.s,e.w_.persistenceKey),n=ko(e.w_.s);return new fi(e.k_.synchronizeTabs,t,e.clientId,dr.Ui(e.k_.cacheSizeBytes),e.ei,ir(),or(),n,this.Uu,e.k_.Vo)},t.prototype.b_=function(e){return new $i},t.prototype.clearPersistence=function(e,t){return function(e){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return Xn.ks()?(t=e+"main",[4,Xn.delete(t)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(bi(e,t))},t}(Po)),No=function(){function e(){}return e.prototype.initialize=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return this.La?[3,3]:(this.La=e.La,this.Uu=e.Uu,this.qa=this.O_(t),this.Bu=this.M_(t),this.fc=this.L_(t),this.q_=this.B_(t),this.Uu.Da=function(e){return n.fc.xu(e,1)},this.Bu.fc=this.fc,[4,this.Bu.start()]);case 1:return r.sent(),[4,this.Bu.Sc(this.fc.el)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.B_=function(e){return new go(this.fc)},e.prototype.O_=function(e){var t,n=ko(e.w_.s),r=(t=e.w_,new Mo(t));return function(e,t,n){return new Vi(e,t,n)}(e.credentials,r,n)},e.prototype.M_=function(e){var t=this;return new zi(this.La,this.qa,e.ei,(function(e){return t.fc.xu(e,0)}),Ro.ks()?new Ro:new Co)},e.prototype.L_=function(e){return function(e,t,n,r,i,o,a){var s=new oo(e,t,n,r,i,o);return a&&(s.tl=!0),s}(this.La,this.Bu,this.qa,this.Uu,e.N_,e.Qu,!e.k_.F_||!e.k_.synchronizeTabs)},e.prototype.terminate=function(){return this.Bu.th()},e}();+ */var Io="You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.",Po=function(){function e(){}return e.prototype.initialize=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.Uu=this.b_(e),this.persistence=this.v_(e),[4,this.persistence.start()];case 1:return t.sent(),this.S_=this.D_(e),this.La=this.C_(e),[2]}}))}))},e.prototype.D_=function(e){return null},e.prototype.C_=function(e){return t=this.persistence,n=new vo,r=e.N_,new _i(t,n,r);var t,n,r},e.prototype.v_=function(e){if(e.k_.F_)throw new I(k.FAILED_PRECONDITION,Io);return new Eo(xo.i_)},e.prototype.b_=function(e){return new $i},e.prototype.terminate=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.S_&&this.S_.stop(),[4,this.Uu.th()];case 1:return e.sent(),[4,this.persistence.th()];case 2:return e.sent(),[2]}}))}))},e.prototype.clearPersistence=function(e,t){throw new I(k.FAILED_PRECONDITION,Io)},e}(),Oo=function(e){function t(t){var n=this;return(n=e.call(this)||this).x_=t,n}return i.__extends(t,e),t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){var n,r=this;return i.__generator(this,(function(o){switch(o.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return o.sent(),[4,this.x_.initialize(this,t)];case 2:return o.sent(),n=this.x_.fc,this.Uu instanceof Ki?(this.Uu.fc={mu:so.bind(null,n),Iu:po.bind(null,n),Au:fo.bind(null,n),rh:ho.bind(null,n)},[4,this.Uu.start()]):[3,4];case 3:o.sent(),o.label=4;case 4:return[4,this.persistence.qo((function(e){return i.__awaiter(r,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return[4,co(this.x_.fc,e)];case 1:return t.sent(),this.S_&&(e&&!this.S_.tr?this.S_.start(this.La):e||this.S_.stop()),[2]}}))}))}))];case 5:return o.sent(),[2]}}))}))},t.prototype.b_=function(e){if(e.k_.F_&&e.k_.synchronizeTabs){var t=ir();if(!Ki.ks(t))throw new I(k.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=bi(e.w_.s,e.w_.persistenceKey);return new Ki(t,e.ei,n,e.clientId,e.N_)}return new $i},t}(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return n.sent(),[4,function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n;return i.__generator(this,(function(r){return t=v(e),n=v(t.Ah),[2,t.persistence.runTransaction("Synchronize last document change read time","readonly",(function(e){return n.Wr(e)})).then((function(e){t.Ih=e}))]}))}))}(this.La)];case 2:return n.sent(),[2]}}))}))},t.prototype.D_=function(e){var t=this.persistence.dr.Yi;return new pr(t,e.ei)},t.prototype.v_=function(e){var t=bi(e.w_.s,e.w_.persistenceKey),n=ko(e.w_.s);return new fi(e.k_.synchronizeTabs,t,e.clientId,dr.Ui(e.k_.cacheSizeBytes),e.ei,ir(),or(),n,this.Uu,e.k_.Vo)},t.prototype.b_=function(e){return new $i},t.prototype.clearPersistence=function(e,t){return function(e){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return Yn.ks()?(t=e+"main",[4,Yn.delete(t)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(bi(e,t))},t}(Po)),No=function(){function e(){}return e.prototype.initialize=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return this.La?[3,3]:(this.La=e.La,this.Uu=e.Uu,this.qa=this.O_(t),this.Bu=this.M_(t),this.fc=this.L_(t),this.q_=this.B_(t),this.Uu.Da=function(e){return n.fc.xu(e,1)},this.Bu.fc=this.fc,[4,this.Bu.start()]);case 1:return r.sent(),[4,this.Bu.Sc(this.fc.el)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.B_=function(e){return new go(this.fc)},e.prototype.O_=function(e){var t,n=ko(e.w_.s),r=(t=e.w_,new Mo(t));return function(e,t,n){return new Vi(e,t,n)}(e.credentials,r,n)},e.prototype.M_=function(e){var t=this;return new zi(this.La,this.qa,e.ei,(function(e){return t.fc.xu(e,0)}),Ro.ks()?new Ro:new Co)},e.prototype.L_=function(e){return function(e,t,n,r,i,o,a){var s=new oo(e,t,n,r,i,o);return a&&(s.tl=!0),s}(this.La,this.Bu,this.qa,this.Uu,e.N_,e.Qu,!e.k_.F_||!e.k_.synchronizeTabs)},e.prototype.terminate=function(){return this.Bu.th()},e}();/*** @license* Copyright 2017 Google LLC@@ -1162,7 +1162,7 @@ var wo=function(){function e(e){this.persistence=e,this.Gl=new C((function(e){re* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */function Fo(e,t){if(0!==t.length)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() does not support arguments, but was called with "+ta(t.length,"argument")+".")}function jo(e,t,n){if(t.length!==n)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires "+ta(n,"argument")+", but was called with "+ta(t.length,"argument")+".")}function Uo(e,t,n){if(t.length<n)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires at least "+ta(n,"argument")+", but was called with "+ta(t.length,"argument")+".")}function Bo(e,t,n,r){if(t.length<n||t.length>r)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires between "+n+" and "+r+" arguments, but was called with "+ta(t.length,"argument")+".")}function Vo(e,t,n,r){Jo(e,t,ea(n)+" argument",r)}function Ho(e,t,n,r){void 0!==r&&Vo(e,t,n,r)}function zo(e,t,n,r){Jo(e,t,n+" option",r)}function qo(e,t,n,r){void 0!==r&&zo(e,t,n,r)}function Go(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){for(var o=[],a=0,s=i;a<s.length;a++){var c=s[a];if(c===r)return;o.push(Xo(c))}var l=Xo(r);throw new I(k.INVALID_ARGUMENT,"Invalid value "+l+" provided to function "+e+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(e,0,n,r,i)}function Wo(e,t,n,r){if(!t.some((function(e){return e===r})))throw new I(k.INVALID_ARGUMENT,"Invalid value "+Xo(r)+" provided to function "+e+"() for its "+ea(n)+" argument. Acceptable values: "+t.join(", "));return r}function Jo(e,t,n,r){if(!("object"===t?Zo(r):"non-empty string"===t?"string"==typeof r&&""!==r:typeof r===t)){var i=Xo(r);throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+n+" to be of type "+t+", but it was: "+i)}}function Zo(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function Xo(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":g()}function Yo(e,t,n){if(void 0===n)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires a valid "+ea(t)+" argument, but it was undefined.")}function Qo(e,t,n){M(t,(function(t,r){if(n.indexOf(t)<0)throw new I(k.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+e+"(). Available options: "+n.join(", "))}))}function Ko(e,t,n,r){var i=Xo(r);return new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+ea(n)+" argument to be a "+t+", but it was: "+i)}function $o(e,t,n){if(n<=0)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+ea(t)+" argument to be a positive number, but it was: "+n+".")}function ea(e){switch(e){case 1:return"first";case 2:return"second";case 3:return"third";default:return e+"th"}}function ta(e,t){return e+" "+t+(1===e?"":"s")}+ */function Fo(e,t){if(0!==t.length)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() does not support arguments, but was called with "+ta(t.length,"argument")+".")}function jo(e,t,n){if(t.length!==n)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires "+ta(n,"argument")+", but was called with "+ta(t.length,"argument")+".")}function Uo(e,t,n){if(t.length<n)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires at least "+ta(n,"argument")+", but was called with "+ta(t.length,"argument")+".")}function Bo(e,t,n,r){if(t.length<n||t.length>r)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires between "+n+" and "+r+" arguments, but was called with "+ta(t.length,"argument")+".")}function Vo(e,t,n,r){Jo(e,t,ea(n)+" argument",r)}function Ho(e,t,n,r){void 0!==r&&Vo(e,t,n,r)}function zo(e,t,n,r){Jo(e,t,n+" option",r)}function qo(e,t,n,r){void 0!==r&&zo(e,t,n,r)}function Go(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){for(var o=[],a=0,s=i;a<s.length;a++){var c=s[a];if(c===r)return;o.push(Yo(c))}var l=Yo(r);throw new I(k.INVALID_ARGUMENT,"Invalid value "+l+" provided to function "+e+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(e,0,n,r,i)}function Wo(e,t,n,r){if(!t.some((function(e){return e===r})))throw new I(k.INVALID_ARGUMENT,"Invalid value "+Yo(r)+" provided to function "+e+"() for its "+ea(n)+" argument. Acceptable values: "+t.join(", "));return r}function Jo(e,t,n,r){if(!("object"===t?Zo(r):"non-empty string"===t?"string"==typeof r&&""!==r:typeof r===t)){var i=Yo(r);throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+n+" to be of type "+t+", but it was: "+i)}}function Zo(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function Yo(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":g()}function Xo(e,t,n){if(void 0===n)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires a valid "+ea(t)+" argument, but it was undefined.")}function Qo(e,t,n){M(t,(function(t,r){if(n.indexOf(t)<0)throw new I(k.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+e+"(). Available options: "+n.join(", "))}))}function Ko(e,t,n,r){var i=Yo(r);return new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+ea(n)+" argument to be a "+t+", but it was: "+i)}function $o(e,t,n){if(n<=0)throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+ea(t)+" argument to be a positive number, but it was: "+n+".")}function ea(e){switch(e){case 1:return"first";case 2:return"second";case 3:return"third";default:return e+"th"}}function ta(e,t){return e+" "+t+(1===e?"":"s")}/*** @license* Copyright 2017 Google LLC@@ -1194,7 +1194,7 @@ var wo=function(){function e(e){this.persistence=e,this.Gl=new C((function(e){re* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */function ua(e,t,n){return new Aa({H_:3,J_:t.settings.J_,methodName:e.G_,X_:n},t.s,t.serializer,t.ignoreUndefinedProperties)}var ha=function(e){function t(t){var n=this;return(n=e.call(this)||this).G_=t,n}return i.__extends(t,e),t.prototype.z_=function(e){return new Dt(e.path,new Tt)},t.prototype.isEqual=function(e){return e instanceof t},t}(ca),da=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.Z_=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=ua(this,e,!0),n=this.Z_.map((function(e){return Ca(e,t)})),r=new Mt(n);return new Dt(e.path,r)},t.prototype.isEqual=function(e){return this===e},t}(ca),pa=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.Z_=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=ua(this,e,!0),n=this.Z_.map((function(e){return Ca(e,t)})),r=new Ct(n);return new Dt(e.path,r)},t.prototype.isEqual=function(e){return this===e},t}(ca),fa=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.tf=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=new It(e.serializer,Ye(e.serializer,this.tf));return new Dt(e.path,t)},t.prototype.isEqual=function(e){return this===e},t}(ca),ma=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.delete=function(){return Fo("FieldValue.delete",arguments),new ga(new la("FieldValue.delete"))},t.serverTimestamp=function(){return Fo("FieldValue.serverTimestamp",arguments),new ga(new ha("FieldValue.serverTimestamp"))},t.arrayUnion=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Uo("FieldValue.arrayUnion",arguments,1),new ga(new da("FieldValue.arrayUnion",e))},t.arrayRemove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Uo("FieldValue.arrayRemove",arguments,1),new ga(new pa("FieldValue.arrayRemove",e))},t.increment=function(e){return Vo("FieldValue.increment","number",1,e),jo("FieldValue.increment",arguments,1),new ga(new fa("FieldValue.increment",e))},t}(ca),ga=function(e){function t(t){var n=this;return(n=e.call(this)||this).K_=t,n.G_=t.G_,n}return i.__extends(t,e),t.prototype.z_=function(e){return this.K_.z_(e)},t.prototype.isEqual=function(e){return e instanceof t&&this.K_.isEqual(e.K_)},t}(ma),ya=function(){function e(e,t){if(jo("GeoPoint",arguments,2),Vo("GeoPoint","number",1,e),Vo("GeoPoint","number",2,t),!isFinite(e)||e<-90||e>90)throw new I(k.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new I(k.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this.ef=e,this.nf=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this.ef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this.nf},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this.ef===e.ef&&this.nf===e.nf},e.prototype.toJSON=function(){return{latitude:this.ef,longitude:this.nf}},e.prototype.T=function(e){return w(this.ef,e.ef)||w(this.nf,e.nf)},e}(),va=/^__.*__$/,ba=function(e,t,n){this.sf=e,this.if=t,this.rf=n},_a=function(){function e(e,t,n){this.data=e,this.qe=t,this.fieldTransforms=n}return e.prototype.hf=function(e,t){var n=[];return null!==this.qe?n.push(new Wt(e,this.data,this.qe,t)):n.push(new Gt(e,this.data,t)),this.fieldTransforms.length>0&&n.push(new Zt(e,this.fieldTransforms)),n},e}(),wa=function(){function e(e,t,n){this.data=e,this.qe=t,this.fieldTransforms=n}return e.prototype.hf=function(e,t){var n=[new Wt(e,this.data,this.qe,t)];return this.fieldTransforms.length>0&&n.push(new Zt(e,this.fieldTransforms)),n},e}();function Ea(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw g()}}var Aa=function(){function e(e,t,n,r,i,o){this.settings=e,this.s=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.af(),this.fieldTransforms=i||[],this.qe=o||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H_",{get:function(){return this.settings.H_},enumerable:!1,configurable:!0}),e.prototype.cf=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.s,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.qe)},e.prototype.uf=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.cf({path:n,X_:!1});return r.lf(e),r},e.prototype._f=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.cf({path:n,X_:!1});return r.af(),r},e.prototype.ff=function(e){return this.cf({path:void 0,X_:!0})},e.prototype.Y_=function(e){return Da(e,this.settings.methodName,this.settings.df||!1,this.path,this.settings.J_)},e.prototype.contains=function(e){return void 0!==this.qe.find((function(t){return e.D(t)}))||void 0!==this.fieldTransforms.find((function(t){return e.D(t.field)}))},e.prototype.af=function(){if(this.path)for(var e=0;e<this.path.length;e++)this.lf(this.path.get(e))},e.prototype.lf=function(e){if(0===e.length)throw this.Y_("Document fields must not be empty");if(Ea(this.H_)&&va.test(e))throw this.Y_('Document fields cannot begin and end with "__"')},e}(),xa=function(){function e(e,t,n){this.s=e,this.ignoreUndefinedProperties=t,this.serializer=n||ko(e)}return e.prototype.wf=function(e,t,n,r){return void 0===r&&(r=!1),new Aa({H_:e,methodName:t,J_:n,path:F.$(),X_:!1,df:r},this.s,this.serializer,this.ignoreUndefinedProperties)},e}();function Sa(e,t,n,r,i,o){void 0===o&&(o={});var a=e.wf(o.merge||o.mergeFields?2:0,t,n,i);Pa("Data must be an object, but it was:",a,r);var s,c,l=ka(r,a);if(o.merge)s=new Nt(a.qe),c=a.fieldTransforms;else if(o.mergeFields){for(var u=[],h=0,d=o.mergeFields;h<d.length;h++){var p=d[h],f=void 0;if(p instanceof oa)f=p.j_;else{if("string"!=typeof p)throw g();f=Na(t,p,n)}if(!a.contains(f))throw new I(k.INVALID_ARGUMENT,"Field '"+f+"' is specified in your field mask but missing from your input data.");La(u,f)||u.push(f)}s=new Nt(u),c=a.fieldTransforms.filter((function(e){return s.Ke(e.field)}))}else s=null,c=a.fieldTransforms;return new _a(new $t(l),s,c)}function Ta(e,t,n,r){var i=e.wf(1,t,n);Pa("Data must be an object, but it was:",i,r);var o=[],a=new en;M(r,(function(e,r){var s=Na(t,e,n),c=i._f(s);if(r instanceof ca&&r.K_ instanceof la)o.push(s);else{var l=Ca(r,c);null!=l&&(o.push(s),a.set(s,l))}}));var s=new Nt(o);return new wa(a.ze(),s,i.fieldTransforms)}function Ma(e,t,n,r,i,o){var a=e.wf(1,t,n),s=[Oa(t,r,n)],c=[i];if(o.length%2!=0)throw new I(k.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var l=0;l<o.length;l+=2)s.push(Oa(t,o[l])),c.push(o[l+1]);for(var u=[],h=new en,d=s.length-1;d>=0;--d)if(!La(u,s[d])){var p=s[d],f=c[d],m=a._f(p);if(f instanceof ca&&f.K_ instanceof la)u.push(p);else{var g=Ca(f,m);null!=g&&(u.push(p),h.set(p,g))}}var y=new Nt(u);return new wa(h.ze(),y,a.fieldTransforms)}function Ra(e,t,n,r){return void 0===r&&(r=!1),Ca(n,e.wf(r?4:3,t))}function Ca(e,t){if(Ia(e))return Pa("Unsupported field value:",t,e),ka(e,t);if(e instanceof ca)return function(e,t){if(!Ea(t.H_))throw t.Y_(e.G_+"() can only be used with update() and set()");if(!t.path)throw t.Y_(e.G_+"() is not currently supported inside arrays");var n=e.z_(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(t.path&&t.qe.push(t.path),e instanceof Array){if(t.settings.X_&&4!==t.H_)throw t.Y_("Nested arrays are not supported");return function(e,t){for(var n=[],r=0,i=0,o=e;i<o.length;i++){var a=Ca(o[i],t.ff(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===e)return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Ye(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){var n=P.fromDate(e);return{timestampValue:Qe(t.serializer,n)}}if(e instanceof P){var r=new P(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:Qe(t.serializer,r)}}if(e instanceof ya)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof ia)return{bytesValue:Ke(t.serializer,e)};if(e instanceof ba){var i=t.s,o=e.sf;if(!o.isEqual(i))throw t.Y_("Document reference is for database "+o.projectId+"/"+o.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:tt(e.sf||t.s,e.if.path)}}if(void 0===e&&t.ignoreUndefinedProperties)return null;throw t.Y_("Unsupported field value: "+Xo(e))}(e,t)}function ka(e,t){var n={};return R(e)?t.path&&t.path.length>0&&t.qe.push(t.path):M(e,(function(e,r){var i=Ca(r,t.uf(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function Ia(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof P||e instanceof ya||e instanceof ia||e instanceof ba||e instanceof ca)}function Pa(e,t,n){if(!Ia(n)||!Zo(n)){var r=Xo(n);throw"an object"===r?t.Y_(e+" a custom object"):t.Y_(e+" "+r)}}function Oa(e,t,n){if(t instanceof oa)return t.j_;if("string"==typeof t)return Na(e,t);throw Da("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}function Na(e,t,n){try{return function(e){if(e.search(sa)>=0)throw new I(k.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(aa.bind.apply(aa,i.__spreadArrays([void 0],e.split("."))))}catch(t){throw new I(k.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(t).j_}catch(t){throw Da((r=t)instanceof Error?r.message:r.toString(),e,!1,void 0,n)}var r}function Da(e,t,n,r,i){var o=r&&!r._(),a=void 0!==i,s="Function "+t+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var c="";return(o||a)&&(c+=" (found",o&&(c+=" in field "+r),a&&(c+=" in document "+i),c+=")"),new I(k.INVALID_ARGUMENT,(s+=". ")+e+c)}function La(e,t){return e.some((function(e){return e.isEqual(t)}))}+ */function ua(e,t,n){return new Aa({H_:3,J_:t.settings.J_,methodName:e.G_,X_:n},t.s,t.serializer,t.ignoreUndefinedProperties)}var ha=function(e){function t(t){var n=this;return(n=e.call(this)||this).G_=t,n}return i.__extends(t,e),t.prototype.z_=function(e){return new Dt(e.path,new Tt)},t.prototype.isEqual=function(e){return e instanceof t},t}(ca),da=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.Z_=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=ua(this,e,!0),n=this.Z_.map((function(e){return Ca(e,t)})),r=new Mt(n);return new Dt(e.path,r)},t.prototype.isEqual=function(e){return this===e},t}(ca),pa=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.Z_=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=ua(this,e,!0),n=this.Z_.map((function(e){return Ca(e,t)})),r=new Ct(n);return new Dt(e.path,r)},t.prototype.isEqual=function(e){return this===e},t}(ca),fa=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.tf=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=new It(e.serializer,Xe(e.serializer,this.tf));return new Dt(e.path,t)},t.prototype.isEqual=function(e){return this===e},t}(ca),ma=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.delete=function(){return Fo("FieldValue.delete",arguments),new ga(new la("FieldValue.delete"))},t.serverTimestamp=function(){return Fo("FieldValue.serverTimestamp",arguments),new ga(new ha("FieldValue.serverTimestamp"))},t.arrayUnion=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Uo("FieldValue.arrayUnion",arguments,1),new ga(new da("FieldValue.arrayUnion",e))},t.arrayRemove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Uo("FieldValue.arrayRemove",arguments,1),new ga(new pa("FieldValue.arrayRemove",e))},t.increment=function(e){return Vo("FieldValue.increment","number",1,e),jo("FieldValue.increment",arguments,1),new ga(new fa("FieldValue.increment",e))},t}(ca),ga=function(e){function t(t){var n=this;return(n=e.call(this)||this).K_=t,n.G_=t.G_,n}return i.__extends(t,e),t.prototype.z_=function(e){return this.K_.z_(e)},t.prototype.isEqual=function(e){return e instanceof t&&this.K_.isEqual(e.K_)},t}(ma),ya=function(){function e(e,t){if(jo("GeoPoint",arguments,2),Vo("GeoPoint","number",1,e),Vo("GeoPoint","number",2,t),!isFinite(e)||e<-90||e>90)throw new I(k.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new I(k.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this.ef=e,this.nf=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this.ef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this.nf},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this.ef===e.ef&&this.nf===e.nf},e.prototype.toJSON=function(){return{latitude:this.ef,longitude:this.nf}},e.prototype.T=function(e){return w(this.ef,e.ef)||w(this.nf,e.nf)},e}(),va=/^__.*__$/,ba=function(e,t,n){this.sf=e,this.if=t,this.rf=n},_a=function(){function e(e,t,n){this.data=e,this.qe=t,this.fieldTransforms=n}return e.prototype.hf=function(e,t){var n=[];return null!==this.qe?n.push(new Wt(e,this.data,this.qe,t)):n.push(new Gt(e,this.data,t)),this.fieldTransforms.length>0&&n.push(new Zt(e,this.fieldTransforms)),n},e}(),wa=function(){function e(e,t,n){this.data=e,this.qe=t,this.fieldTransforms=n}return e.prototype.hf=function(e,t){var n=[new Wt(e,this.data,this.qe,t)];return this.fieldTransforms.length>0&&n.push(new Zt(e,this.fieldTransforms)),n},e}();function Ea(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw g()}}var Aa=function(){function e(e,t,n,r,i,o){this.settings=e,this.s=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.af(),this.fieldTransforms=i||[],this.qe=o||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H_",{get:function(){return this.settings.H_},enumerable:!1,configurable:!0}),e.prototype.cf=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.s,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.qe)},e.prototype.uf=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.cf({path:n,X_:!1});return r.lf(e),r},e.prototype._f=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.cf({path:n,X_:!1});return r.af(),r},e.prototype.ff=function(e){return this.cf({path:void 0,X_:!0})},e.prototype.Y_=function(e){return Da(e,this.settings.methodName,this.settings.df||!1,this.path,this.settings.J_)},e.prototype.contains=function(e){return void 0!==this.qe.find((function(t){return e.D(t)}))||void 0!==this.fieldTransforms.find((function(t){return e.D(t.field)}))},e.prototype.af=function(){if(this.path)for(var e=0;e<this.path.length;e++)this.lf(this.path.get(e))},e.prototype.lf=function(e){if(0===e.length)throw this.Y_("Document fields must not be empty");if(Ea(this.H_)&&va.test(e))throw this.Y_('Document fields cannot begin and end with "__"')},e}(),xa=function(){function e(e,t,n){this.s=e,this.ignoreUndefinedProperties=t,this.serializer=n||ko(e)}return e.prototype.wf=function(e,t,n,r){return void 0===r&&(r=!1),new Aa({H_:e,methodName:t,J_:n,path:F.$(),X_:!1,df:r},this.s,this.serializer,this.ignoreUndefinedProperties)},e}();function Sa(e,t,n,r,i,o){void 0===o&&(o={});var a=e.wf(o.merge||o.mergeFields?2:0,t,n,i);Pa("Data must be an object, but it was:",a,r);var s,c,l=ka(r,a);if(o.merge)s=new Nt(a.qe),c=a.fieldTransforms;else if(o.mergeFields){for(var u=[],h=0,d=o.mergeFields;h<d.length;h++){var p=d[h],f=void 0;if(p instanceof oa)f=p.j_;else{if("string"!=typeof p)throw g();f=Na(t,p,n)}if(!a.contains(f))throw new I(k.INVALID_ARGUMENT,"Field '"+f+"' is specified in your field mask but missing from your input data.");La(u,f)||u.push(f)}s=new Nt(u),c=a.fieldTransforms.filter((function(e){return s.Ke(e.field)}))}else s=null,c=a.fieldTransforms;return new _a(new $t(l),s,c)}function Ta(e,t,n,r){var i=e.wf(1,t,n);Pa("Data must be an object, but it was:",i,r);var o=[],a=new en;M(r,(function(e,r){var s=Na(t,e,n),c=i._f(s);if(r instanceof ca&&r.K_ instanceof la)o.push(s);else{var l=Ca(r,c);null!=l&&(o.push(s),a.set(s,l))}}));var s=new Nt(o);return new wa(a.ze(),s,i.fieldTransforms)}function Ma(e,t,n,r,i,o){var a=e.wf(1,t,n),s=[Oa(t,r,n)],c=[i];if(o.length%2!=0)throw new I(k.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var l=0;l<o.length;l+=2)s.push(Oa(t,o[l])),c.push(o[l+1]);for(var u=[],h=new en,d=s.length-1;d>=0;--d)if(!La(u,s[d])){var p=s[d],f=c[d],m=a._f(p);if(f instanceof ca&&f.K_ instanceof la)u.push(p);else{var g=Ca(f,m);null!=g&&(u.push(p),h.set(p,g))}}var y=new Nt(u);return new wa(h.ze(),y,a.fieldTransforms)}function Ra(e,t,n,r){return void 0===r&&(r=!1),Ca(n,e.wf(r?4:3,t))}function Ca(e,t){if(Ia(e))return Pa("Unsupported field value:",t,e),ka(e,t);if(e instanceof ca)return function(e,t){if(!Ea(t.H_))throw t.Y_(e.G_+"() can only be used with update() and set()");if(!t.path)throw t.Y_(e.G_+"() is not currently supported inside arrays");var n=e.z_(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(t.path&&t.qe.push(t.path),e instanceof Array){if(t.settings.X_&&4!==t.H_)throw t.Y_("Nested arrays are not supported");return function(e,t){for(var n=[],r=0,i=0,o=e;i<o.length;i++){var a=Ca(o[i],t.ff(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===e)return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Xe(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){var n=P.fromDate(e);return{timestampValue:Qe(t.serializer,n)}}if(e instanceof P){var r=new P(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:Qe(t.serializer,r)}}if(e instanceof ya)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof ia)return{bytesValue:Ke(t.serializer,e)};if(e instanceof ba){var i=t.s,o=e.sf;if(!o.isEqual(i))throw t.Y_("Document reference is for database "+o.projectId+"/"+o.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:tt(e.sf||t.s,e.if.path)}}if(void 0===e&&t.ignoreUndefinedProperties)return null;throw t.Y_("Unsupported field value: "+Yo(e))}(e,t)}function ka(e,t){var n={};return R(e)?t.path&&t.path.length>0&&t.qe.push(t.path):M(e,(function(e,r){var i=Ca(r,t.uf(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function Ia(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof P||e instanceof ya||e instanceof ia||e instanceof ba||e instanceof ca)}function Pa(e,t,n){if(!Ia(n)||!Zo(n)){var r=Yo(n);throw"an object"===r?t.Y_(e+" a custom object"):t.Y_(e+" "+r)}}function Oa(e,t,n){if(t instanceof oa)return t.j_;if("string"==typeof t)return Na(e,t);throw Da("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}function Na(e,t,n){try{return function(e){if(e.search(sa)>=0)throw new I(k.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(aa.bind.apply(aa,i.__spreadArrays([void 0],e.split("."))))}catch(t){throw new I(k.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(t).j_}catch(t){throw Da((r=t)instanceof Error?r.message:r.toString(),e,!1,void 0,n)}var r}function Da(e,t,n,r,i){var o=r&&!r._(),a=void 0!==i,s="Function "+t+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var c="";return(o||a)&&(c+=" (found",o&&(c+=" in field "+r),a&&(c+=" in document "+i),c+=")"),new I(k.INVALID_ARGUMENT,(s+=". ")+e+c)}function La(e,t){return e.some((function(e){return e.isEqual(t)}))}/*** @license* Copyright 2017 Google LLC@@ -1242,7 +1242,7 @@ var wo=function(){function e(e){this.persistence=e,this.Gl=new C((function(e){re* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */if(!n||"string"!=typeof n)throw new I(k.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new S(n)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this.Yf)throw new I(k.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Yf},enumerable:!1,configurable:!0}),e.prototype.collection=function(e){return jo("Firestore.collection",arguments,1),Vo("Firestore.collection","non-empty string",1,e),this.Xf(),new os(D.k(e),this,null)},e.prototype.doc=function(e){return jo("Firestore.doc",arguments,1),Vo("Firestore.doc","non-empty string",1,e),this.Xf(),Ja._d(D.k(e),this,null)},e.prototype.collectionGroup=function(e){if(jo("Firestore.collectionGroup",arguments,1),Vo("Firestore.collectionGroup","non-empty string",1,e),e.indexOf("/")>=0)throw new I(k.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.Xf(),new rs(function(e){return new cn(D.$(),e)}(e),this,null)},e.prototype.runTransaction=function(e){var t=this;return jo("Firestore.runTransaction",arguments,1),Vo("Firestore.runTransaction","function",1,e),this.Xf().transaction((function(n){return e(new Ga(t,n))}))},e.prototype.batch=function(){return this.Xf(),new Wa(this)},Object.defineProperty(e,"logLevel",{get:function(){switch(h()){case a.LogLevel.DEBUG:return"debug";case a.LogLevel.ERROR:return"error";case a.LogLevel.SILENT:return"silent";case a.LogLevel.WARN:return"warn";case a.LogLevel.INFO:return"info";case a.LogLevel.VERBOSE:return"verbose";default:return"error"}},enumerable:!1,configurable:!0}),e.setLogLevel=function(e){var t;jo("Firestore.setLogLevel",arguments,1),Wo("setLogLevel",["debug","error","silent","warn","info","verbose"],1,e),t=e,u.setLogLevel(t)},e.prototype.fd=function(){return this.sd.timestampsInSnapshots},e}(),Ga=function(){function e(e,t){this.dd=e,this.wd=t}return e.prototype.get=function(e){var t=this;jo("Transaction.get",arguments,1);var n=ls("Transaction.get",e,this.dd);return this.wd.Af([n.if]).then((function(e){if(!e||1!==e.length)return g();var r=e[0];if(r instanceof on)return new Xa(t.dd,n.if,null,!1,!1,n.rf);if(r instanceof rn)return new Xa(t.dd,n.if,r,!1,!1,n.rf);throw g()}))},e.prototype.set=function(e,t,n){Bo("Transaction.set",arguments,2,3);var r=ls("Transaction.set",e,this.dd);n=as("Transaction.set",n);var i=hs(r.rf,t,n),o=Sa(this.dd.rd,"Transaction.set",r.if,i,null!==r.rf,n);return this.wd.set(r.if,o),this},e.prototype.update=function(e,t,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return"string"==typeof t||t instanceof aa?(Uo("Transaction.update",arguments,3),r=ls("Transaction.update",e,this.dd),i=Ma(this.dd.rd,"Transaction.update",r.if,t,n,o)):(jo("Transaction.update",arguments,2),r=ls("Transaction.update",e,this.dd),i=Ta(this.dd.rd,"Transaction.update",r.if,t)),this.wd.update(r.if,i),this},e.prototype.delete=function(e){jo("Transaction.delete",arguments,1);var t=ls("Transaction.delete",e,this.dd);return this.wd.delete(t.if),this},e}(),Wa=function(){function e(e){this.dd=e,this.Td=[],this.Ed=!1}return e.prototype.set=function(e,t,n){Bo("WriteBatch.set",arguments,2,3),this.md();var r=ls("WriteBatch.set",e,this.dd);n=as("WriteBatch.set",n);var i=hs(r.rf,t,n),o=Sa(this.dd.rd,"WriteBatch.set",r.if,i,null!==r.rf,n);return this.Td=this.Td.concat(o.hf(r.if,Ft.We())),this},e.prototype.update=function(e,t,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return this.md(),"string"==typeof t||t instanceof aa?(Uo("WriteBatch.update",arguments,3),r=ls("WriteBatch.update",e,this.dd),i=Ma(this.dd.rd,"WriteBatch.update",r.if,t,n,o)):(jo("WriteBatch.update",arguments,2),r=ls("WriteBatch.update",e,this.dd),i=Ta(this.dd.rd,"WriteBatch.update",r.if,t)),this.Td=this.Td.concat(i.hf(r.if,Ft.exists(!0))),this},e.prototype.delete=function(e){jo("WriteBatch.delete",arguments,1),this.md();var t=ls("WriteBatch.delete",e,this.dd);return this.Td=this.Td.concat(new Qt(t.if,Ft.We())),this},e.prototype.commit=function(){return this.md(),this.Ed=!0,this.Td.length>0?this.dd.Xf().write(this.Td):Promise.resolve()},e.prototype.md=function(){if(this.Ed)throw new I(k.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}(),Ja=function(e){function t(t,n,r){var i=this;return(i=e.call(this,n.sf,t,r)||this).if=t,i.firestore=n,i.rf=r,i.Zf=i.firestore.Xf(),i}return i.__extends(t,e),t._d=function(e,n,r){if(e.length%2!=0)throw new I(k.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.F()+" has "+e.length);return new t(new j(e),n,r)},Object.defineProperty(t.prototype,"id",{get:function(){return this.if.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new os(this.if.path.p(),this.firestore,this.rf)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.if.path.F()},enumerable:!1,configurable:!0}),t.prototype.collection=function(e){if(jo("DocumentReference.collection",arguments,1),Vo("DocumentReference.collection","non-empty string",1,e),!e)throw new I(k.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var t=D.k(e);return new os(this.if.path.child(t),this.firestore,null)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ko("isEqual","DocumentReference",1,e);return this.firestore===e.firestore&&this.if.isEqual(e.if)&&this.rf===e.rf},t.prototype.set=function(e,t){Bo("DocumentReference.set",arguments,1,2),t=as("DocumentReference.set",t);var n=hs(this.rf,e,t),r=Sa(this.firestore.rd,"DocumentReference.set",this.if,n,null!==this.rf,t);return this.Zf.write(r.hf(this.if,Ft.We()))},t.prototype.update=function(e,t){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof e||e instanceof aa?(Uo("DocumentReference.update",arguments,2),n=Ma(this.firestore.rd,"DocumentReference.update",this.if,e,t,r)):(jo("DocumentReference.update",arguments,1),n=Ta(this.firestore.rd,"DocumentReference.update",this.if,e)),this.Zf.write(n.hf(this.if,Ft.exists(!0)))},t.prototype.delete=function(){return jo("DocumentReference.delete",arguments,0),this.Zf.write([new Qt(this.if,Ft.We())])},t.prototype.onSnapshot=function(){for(var e,t,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];Bo("DocumentReference.onSnapshot",arguments,1,4);var a={includeMetadataChanges:!1},s=0;"object"!=typeof i[s]||Do(i[s])||(Qo("DocumentReference.onSnapshot",a=i[s],["includeMetadataChanges"]),qo("DocumentReference.onSnapshot","boolean","includeMetadataChanges",a.includeMetadataChanges),s++);var c={includeMetadataChanges:a.includeMetadataChanges};if(Do(i[s])){var l=i[s];i[s]=null===(e=l.next)||void 0===e?void 0:e.bind(l),i[s+1]=null===(t=l.error)||void 0===t?void 0:t.bind(l),i[s+2]=null===(n=l.complete)||void 0===n?void 0:n.bind(l)}else Vo("DocumentReference.onSnapshot","function",s,i[s]),Ho("DocumentReference.onSnapshot","function",s+1,i[s+1]),Ho("DocumentReference.onSnapshot","function",s+2,i[s+2]);var u={next:function(e){i[s]&&i[s](r.Id(e))},error:i[s+1],complete:i[s+2]};return this.Zf.listen(un(this.if.path),c,u)},t.prototype.get=function(e){var t=this;Bo("DocumentReference.get",arguments,0,1),cs("DocumentReference.get",e);var n=this.firestore.Xf();return e&&"cache"===e.source?n.kf(this.if).then((function(e){return new Xa(t.firestore,t.if,e,!0,e instanceof rn&&e.Ge,t.rf)})):n.$f(this.if,e).then((function(e){return t.Id(e)}))},t.prototype.withConverter=function(e){return new t(this.if,this.firestore,e)},t.prototype.Id=function(e){var t=e.docs.get(this.if);return new Xa(this.firestore,this.if,t,e.fromCache,e.hasPendingWrites,this.rf)},t}(ba),Za=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),Xa=function(){function e(e,t,n,r,i,o){this.dd=e,this.if=t,this.Ad=n,this.Rd=r,this.Pd=i,this.rf=o}return e.prototype.data=function(e){var t=this;if(Bo("DocumentSnapshot.data",arguments,0,1),e=ss("DocumentSnapshot.data",e),this.Ad){if(this.rf){var n=new Ya(this.dd,this.if,this.Ad,this.Rd,this.Pd,null);return this.rf.fromFirestore(n,e)}return new Va(this.dd.sf,this.dd.fd(),e.serverTimestamps||"none",(function(e){return new Ja(e,t.dd,null)})).Bf(this.Ad.tn())}},e.prototype.get=function(e,t){var n=this;if(Bo("DocumentSnapshot.get",arguments,1,2),t=ss("DocumentSnapshot.get",t),this.Ad){var r=this.Ad.data().field(Oa("DocumentSnapshot.get",e,this.if));if(null!==r)return new Va(this.dd.sf,this.dd.fd(),t.serverTimestamps||"none",(function(e){return new Ja(e,n.dd,n.rf)})).Bf(r)}},Object.defineProperty(e.prototype,"id",{get:function(){return this.if.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Ja(this.if,this.dd,this.rf)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this.Ad},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return new Za(this.Pd,this.Rd)},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ko("isEqual","DocumentSnapshot",1,t);return this.dd===t.dd&&this.Rd===t.Rd&&this.if.isEqual(t.if)&&(null===this.Ad?null===t.Ad:this.Ad.isEqual(t.Ad))&&this.rf===t.rf},e}(),Ya=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.data=function(t){return e.prototype.data.call(this,t)},t}(Xa);+ */if(!n||"string"!=typeof n)throw new I(k.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new S(n)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this.Yf)throw new I(k.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Yf},enumerable:!1,configurable:!0}),e.prototype.collection=function(e){return jo("Firestore.collection",arguments,1),Vo("Firestore.collection","non-empty string",1,e),this.Xf(),new os(D.k(e),this,null)},e.prototype.doc=function(e){return jo("Firestore.doc",arguments,1),Vo("Firestore.doc","non-empty string",1,e),this.Xf(),Ja._d(D.k(e),this,null)},e.prototype.collectionGroup=function(e){if(jo("Firestore.collectionGroup",arguments,1),Vo("Firestore.collectionGroup","non-empty string",1,e),e.indexOf("/")>=0)throw new I(k.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.Xf(),new rs(function(e){return new cn(D.$(),e)}(e),this,null)},e.prototype.runTransaction=function(e){var t=this;return jo("Firestore.runTransaction",arguments,1),Vo("Firestore.runTransaction","function",1,e),this.Xf().transaction((function(n){return e(new Ga(t,n))}))},e.prototype.batch=function(){return this.Xf(),new Wa(this)},Object.defineProperty(e,"logLevel",{get:function(){switch(h()){case a.LogLevel.DEBUG:return"debug";case a.LogLevel.ERROR:return"error";case a.LogLevel.SILENT:return"silent";case a.LogLevel.WARN:return"warn";case a.LogLevel.INFO:return"info";case a.LogLevel.VERBOSE:return"verbose";default:return"error"}},enumerable:!1,configurable:!0}),e.setLogLevel=function(e){var t;jo("Firestore.setLogLevel",arguments,1),Wo("setLogLevel",["debug","error","silent","warn","info","verbose"],1,e),t=e,u.setLogLevel(t)},e.prototype.fd=function(){return this.sd.timestampsInSnapshots},e}(),Ga=function(){function e(e,t){this.dd=e,this.wd=t}return e.prototype.get=function(e){var t=this;jo("Transaction.get",arguments,1);var n=ls("Transaction.get",e,this.dd);return this.wd.Af([n.if]).then((function(e){if(!e||1!==e.length)return g();var r=e[0];if(r instanceof on)return new Ya(t.dd,n.if,null,!1,!1,n.rf);if(r instanceof rn)return new Ya(t.dd,n.if,r,!1,!1,n.rf);throw g()}))},e.prototype.set=function(e,t,n){Bo("Transaction.set",arguments,2,3);var r=ls("Transaction.set",e,this.dd);n=as("Transaction.set",n);var i=hs(r.rf,t,n),o=Sa(this.dd.rd,"Transaction.set",r.if,i,null!==r.rf,n);return this.wd.set(r.if,o),this},e.prototype.update=function(e,t,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return"string"==typeof t||t instanceof aa?(Uo("Transaction.update",arguments,3),r=ls("Transaction.update",e,this.dd),i=Ma(this.dd.rd,"Transaction.update",r.if,t,n,o)):(jo("Transaction.update",arguments,2),r=ls("Transaction.update",e,this.dd),i=Ta(this.dd.rd,"Transaction.update",r.if,t)),this.wd.update(r.if,i),this},e.prototype.delete=function(e){jo("Transaction.delete",arguments,1);var t=ls("Transaction.delete",e,this.dd);return this.wd.delete(t.if),this},e}(),Wa=function(){function e(e){this.dd=e,this.Td=[],this.Ed=!1}return e.prototype.set=function(e,t,n){Bo("WriteBatch.set",arguments,2,3),this.md();var r=ls("WriteBatch.set",e,this.dd);n=as("WriteBatch.set",n);var i=hs(r.rf,t,n),o=Sa(this.dd.rd,"WriteBatch.set",r.if,i,null!==r.rf,n);return this.Td=this.Td.concat(o.hf(r.if,Ft.We())),this},e.prototype.update=function(e,t,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return this.md(),"string"==typeof t||t instanceof aa?(Uo("WriteBatch.update",arguments,3),r=ls("WriteBatch.update",e,this.dd),i=Ma(this.dd.rd,"WriteBatch.update",r.if,t,n,o)):(jo("WriteBatch.update",arguments,2),r=ls("WriteBatch.update",e,this.dd),i=Ta(this.dd.rd,"WriteBatch.update",r.if,t)),this.Td=this.Td.concat(i.hf(r.if,Ft.exists(!0))),this},e.prototype.delete=function(e){jo("WriteBatch.delete",arguments,1),this.md();var t=ls("WriteBatch.delete",e,this.dd);return this.Td=this.Td.concat(new Qt(t.if,Ft.We())),this},e.prototype.commit=function(){return this.md(),this.Ed=!0,this.Td.length>0?this.dd.Xf().write(this.Td):Promise.resolve()},e.prototype.md=function(){if(this.Ed)throw new I(k.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}(),Ja=function(e){function t(t,n,r){var i=this;return(i=e.call(this,n.sf,t,r)||this).if=t,i.firestore=n,i.rf=r,i.Zf=i.firestore.Xf(),i}return i.__extends(t,e),t._d=function(e,n,r){if(e.length%2!=0)throw new I(k.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.F()+" has "+e.length);return new t(new j(e),n,r)},Object.defineProperty(t.prototype,"id",{get:function(){return this.if.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new os(this.if.path.p(),this.firestore,this.rf)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.if.path.F()},enumerable:!1,configurable:!0}),t.prototype.collection=function(e){if(jo("DocumentReference.collection",arguments,1),Vo("DocumentReference.collection","non-empty string",1,e),!e)throw new I(k.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var t=D.k(e);return new os(this.if.path.child(t),this.firestore,null)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ko("isEqual","DocumentReference",1,e);return this.firestore===e.firestore&&this.if.isEqual(e.if)&&this.rf===e.rf},t.prototype.set=function(e,t){Bo("DocumentReference.set",arguments,1,2),t=as("DocumentReference.set",t);var n=hs(this.rf,e,t),r=Sa(this.firestore.rd,"DocumentReference.set",this.if,n,null!==this.rf,t);return this.Zf.write(r.hf(this.if,Ft.We()))},t.prototype.update=function(e,t){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof e||e instanceof aa?(Uo("DocumentReference.update",arguments,2),n=Ma(this.firestore.rd,"DocumentReference.update",this.if,e,t,r)):(jo("DocumentReference.update",arguments,1),n=Ta(this.firestore.rd,"DocumentReference.update",this.if,e)),this.Zf.write(n.hf(this.if,Ft.exists(!0)))},t.prototype.delete=function(){return jo("DocumentReference.delete",arguments,0),this.Zf.write([new Qt(this.if,Ft.We())])},t.prototype.onSnapshot=function(){for(var e,t,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];Bo("DocumentReference.onSnapshot",arguments,1,4);var a={includeMetadataChanges:!1},s=0;"object"!=typeof i[s]||Do(i[s])||(Qo("DocumentReference.onSnapshot",a=i[s],["includeMetadataChanges"]),qo("DocumentReference.onSnapshot","boolean","includeMetadataChanges",a.includeMetadataChanges),s++);var c={includeMetadataChanges:a.includeMetadataChanges};if(Do(i[s])){var l=i[s];i[s]=null===(e=l.next)||void 0===e?void 0:e.bind(l),i[s+1]=null===(t=l.error)||void 0===t?void 0:t.bind(l),i[s+2]=null===(n=l.complete)||void 0===n?void 0:n.bind(l)}else Vo("DocumentReference.onSnapshot","function",s,i[s]),Ho("DocumentReference.onSnapshot","function",s+1,i[s+1]),Ho("DocumentReference.onSnapshot","function",s+2,i[s+2]);var u={next:function(e){i[s]&&i[s](r.Id(e))},error:i[s+1],complete:i[s+2]};return this.Zf.listen(un(this.if.path),c,u)},t.prototype.get=function(e){var t=this;Bo("DocumentReference.get",arguments,0,1),cs("DocumentReference.get",e);var n=this.firestore.Xf();return e&&"cache"===e.source?n.kf(this.if).then((function(e){return new Ya(t.firestore,t.if,e,!0,e instanceof rn&&e.Ge,t.rf)})):n.$f(this.if,e).then((function(e){return t.Id(e)}))},t.prototype.withConverter=function(e){return new t(this.if,this.firestore,e)},t.prototype.Id=function(e){var t=e.docs.get(this.if);return new Ya(this.firestore,this.if,t,e.fromCache,e.hasPendingWrites,this.rf)},t}(ba),Za=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),Ya=function(){function e(e,t,n,r,i,o){this.dd=e,this.if=t,this.Ad=n,this.Rd=r,this.Pd=i,this.rf=o}return e.prototype.data=function(e){var t=this;if(Bo("DocumentSnapshot.data",arguments,0,1),e=ss("DocumentSnapshot.data",e),this.Ad){if(this.rf){var n=new Xa(this.dd,this.if,this.Ad,this.Rd,this.Pd,null);return this.rf.fromFirestore(n,e)}return new Va(this.dd.sf,this.dd.fd(),e.serverTimestamps||"none",(function(e){return new Ja(e,t.dd,null)})).Bf(this.Ad.tn())}},e.prototype.get=function(e,t){var n=this;if(Bo("DocumentSnapshot.get",arguments,1,2),t=ss("DocumentSnapshot.get",t),this.Ad){var r=this.Ad.data().field(Oa("DocumentSnapshot.get",e,this.if));if(null!==r)return new Va(this.dd.sf,this.dd.fd(),t.serverTimestamps||"none",(function(e){return new Ja(e,n.dd,n.rf)})).Bf(r)}},Object.defineProperty(e.prototype,"id",{get:function(){return this.if.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Ja(this.if,this.dd,this.rf)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this.Ad},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return new Za(this.Pd,this.Rd)},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ko("isEqual","DocumentSnapshot",1,t);return this.dd===t.dd&&this.Rd===t.Rd&&this.if.isEqual(t.if)&&(null===this.Ad?null===t.Ad:this.Ad.isEqual(t.Ad))&&this.rf===t.rf},e}(),Xa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.data=function(t){return e.prototype.data.call(this,t)},t}(Ya);/*** @license* Copyright 2017 Google LLC@@ -1258,7 +1258,7 @@ var wo=function(){function e(e){this.persistence=e,this.Gl=new C((function(e){re* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */function Qa(e,t,n,r,i,o,a){var s;if(i.M()){if("array-contains"===o||"array-contains-any"===o)throw new I(k.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){es(a,o);for(var c=[],l=0,u=a;l<u.length;l++){var h=u[l];c.push($a(r,e,h))}s={arrayValue:{values:c}}}else s=$a(r,e,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||es(a,o),s=Ra(n,t,a,"in"===o||"not-in"===o);var d=En.create(i,o,s);return function(e,t){if(t._n()){var n=e.ln();if(null!==n&&!n.isEqual(t.field))throw new I(k.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+t.field.toString()+"'");var r=e.un();null!==r&&ts(e,t.field,r)}var i=e.fn(function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new I(k.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new I(k.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+i.toString()+"' filters.")}(e,d),d}function Ka(e,t,n){if(null!==e.startAt)throw new I(k.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new I(k.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Dn(t,n);return function(e,t){if(null===e.un()){var n=e.ln();null!==n&&ts(e,n,t.field)}}(e,r),r}function $a(e,t,n){if("string"==typeof n){if(""===n)throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!hn(t)&&-1!==n.indexOf("/"))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=t.path.child(D.k(n));if(!j.j(r))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return Ue(e,new j(r))}if(n instanceof ba)return Ue(e,n.if);throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Xo(n)+".")}function es(e,t){if(!Array.isArray(e)||0===e.length)throw new I(k.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+t.toString()+"' filters.");if(e.length>10)throw new I(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.");if("in"===t||"array-contains-any"===t){if(e.indexOf(null)>=0)throw new I(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'null' in the value array.");if(e.filter((function(e){return Number.isNaN(e)})).length>0)throw new I(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'NaN' in the value array.")}}function ts(e,t,n){if(!n.isEqual(t))throw new I(k.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function ns(e){if(e.cn()&&0===e.en.length)throw new I(k.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var rs=function(){function e(e,t,n){this.gd=e,this.firestore=t,this.rf=n}return e.prototype.where=function(t,n,r){var i;jo("Query.where",arguments,3),Yo("Query.where",3,r),i="not-in"===n||"!="===n?n:Wo("Query.where",["<","<=","==",">=",">","array-contains","in","array-contains-any"],2,n);var o=Oa("Query.where",t),a=Qa(this.gd,"Query.where",this.firestore.rd,this.firestore.sf,o,i,r);return new e(function(e,t){var n=e.filters.concat([t]);return new cn(e.path,e.collectionGroup,e.en.slice(),n,e.limit,e.nn,e.startAt,e.endAt)}(this.gd,a),this.firestore,this.rf)},e.prototype.orderBy=function(t,n){var r;if(Bo("Query.orderBy",arguments,1,2),Ho("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r="asc";else{if("desc"!==n)throw new I(k.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r="desc"}var i=Oa("Query.orderBy",t),o=Ka(this.gd,i,r);return new e(function(e,t){var n=e.en.concat([t]);return new cn(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.nn,e.startAt,e.endAt)}(this.gd,o),this.firestore,this.rf)},e.prototype.limit=function(t){return jo("Query.limit",arguments,1),Vo("Query.limit","number",1,t),$o("Query.limit",1,t),new e(fn(this.gd,t,"F"),this.firestore,this.rf)},e.prototype.limitToLast=function(t){return jo("Query.limitToLast",arguments,1),Vo("Query.limitToLast","number",1,t),$o("Query.limitToLast",1,t),new e(fn(this.gd,t,"L"),this.firestore,this.rf)},e.prototype.startAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.startAt",arguments,1);var i=this.Vd("Query.startAt",t,n,!0);return new e(mn(this.gd,i),this.firestore,this.rf)},e.prototype.startAfter=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.startAfter",arguments,1);var i=this.Vd("Query.startAfter",t,n,!1);return new e(mn(this.gd,i),this.firestore,this.rf)},e.prototype.endBefore=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.endBefore",arguments,1);var i=this.Vd("Query.endBefore",t,n,!0);return new e(gn(this.gd,i),this.firestore,this.rf)},e.prototype.endAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.endAt",arguments,1);var i=this.Vd("Query.endAt",t,n,!1);return new e(gn(this.gd,i),this.firestore,this.rf)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ko("isEqual","Query",1,t);return this.firestore===t.firestore&&yn(this.gd,t.gd)&&this.rf===t.rf},e.prototype.withConverter=function(t){return new e(this.gd,this.firestore,t)},e.prototype.Vd=function(e,t,n,r){if(Yo(e,1,t),t instanceof Xa)return jo(e,i.__spreadArrays([t],n),1),function(e,t,n,r,i){if(!r)throw new I(k.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=dn(e);a<s.length;a++){var c=s[a];if(c.field.M())o.push(Ue(t,r.key));else{var l=r.field(c.field);if(Me(l))throw new I(k.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+c.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===l){var u=c.field.F();throw new I(k.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}o.push(l)}}return new In(o,i)}(this.gd,this.firestore.sf,e,t.Ad,r);var o=[t].concat(n);return function(e,t,n,r,i,o){var a=e.en;if(i.length>a.length)throw new I(k.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],c=0;c<i.length;c++){var l=i[c];if(a[c].field.M()){if("string"!=typeof l)throw new I(k.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof l);if(!hn(e)&&-1!==l.indexOf("/"))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+l+"' contains a slash.");var u=e.path.child(D.k(l));if(!j.j(u))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+u+"' is not because it contains an odd number of segments.");var h=new j(u);s.push(Ue(t,h))}else{var d=Ra(n,r,l);s.push(d)}}return new In(s,o)}(this.gd,this.firestore.sf,this.firestore.rd,e,o,r)},e.prototype.onSnapshot=function(){for(var e,t,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];Bo("Query.onSnapshot",arguments,1,4);var a={},s=0;if("object"!=typeof i[s]||Do(i[s])||(Qo("Query.onSnapshot",a=i[s],["includeMetadataChanges"]),qo("Query.onSnapshot","boolean","includeMetadataChanges",a.includeMetadataChanges),s++),Do(i[s])){var c=i[s];i[s]=null===(e=c.next)||void 0===e?void 0:e.bind(c),i[s+1]=null===(t=c.error)||void 0===t?void 0:t.bind(c),i[s+2]=null===(n=c.complete)||void 0===n?void 0:n.bind(c)}else Vo("Query.onSnapshot","function",s,i[s]),Ho("Query.onSnapshot","function",s+1,i[s+1]),Ho("Query.onSnapshot","function",s+2,i[s+2]);var l={next:function(e){i[s]&&i[s](new is(r.firestore,r.gd,e,r.rf))},error:i[s+1],complete:i[s+2]};return ns(this.gd),this.firestore.Xf().listen(this.gd,a,l)},e.prototype.get=function(e){var t=this;Bo("Query.get",arguments,0,1),cs("Query.get",e),ns(this.gd);var n=this.firestore.Xf();return(e&&"cache"===e.source?n.xf(this.gd):n.Of(this.gd,e)).then((function(e){return new is(t.firestore,t.gd,e,t.rf)}))},e}(),is=function(){function e(e,t,n,r){this.dd=e,this.yd=t,this.pd=n,this.rf=r,this.bd=null,this.vd=null,this.metadata=new Za(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.pd.docs._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.pd.docs.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;Bo("QuerySnapshot.forEach",arguments,1,2),Vo("QuerySnapshot.forEach","function",1,e),this.pd.docs.forEach((function(r){e.call(t,n.Sd(r,n.metadata.fromCache,n.pd.qt.has(r.key)))}))},Object.defineProperty(e.prototype,"query",{get:function(){return new rs(this.yd,this.dd,this.rf)},enumerable:!1,configurable:!0}),e.prototype.docChanges=function(e){e&&(Qo("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),qo("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges));var t=!(!e||!e.includeMetadataChanges);if(t&&this.pd.Ut)throw new I(k.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.bd&&this.vd===t||(this.bd=function(e,t,n){if(e.Lt._()){var r=0;return e.docChanges.map((function(t){var i=n(t.doc,e.fromCache,e.qt.has(t.doc.key));return t.doc,{type:"added",doc:i,oldIndex:-1,newIndex:r++}}))}var i=e.Lt;return e.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var r=n(t.doc,e.fromCache,e.qt.has(t.doc.key)),o=-1,a=-1;return 0!==t.type&&(o=i.indexOf(t.doc.key),i=i.delete(t.doc.key)),1!==t.type&&(a=(i=i.add(t.doc)).indexOf(t.doc.key)),{type:us(t.type),doc:r,oldIndex:o,newIndex:a}}))}(this.pd,t,this.Sd.bind(this)),this.vd=t),this.bd},e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ko("isEqual","QuerySnapshot",1,t);return this.dd===t.dd&&yn(this.yd,t.yd)&&this.pd.isEqual(t.pd)&&this.rf===t.rf},e.prototype.Sd=function(e,t,n){return new Ya(this.dd,e.key,e,t,n,this.rf)},e}(),os=function(e){function t(t,n,r){var i=this;if((i=e.call(this,un(t),n,r)||this).Dd=t,t.length%2!=1)throw new I(k.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t.F()+" has "+t.length);return i}return i.__extends(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this.gd.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.gd.path.p();return e._()?null:new Ja(new j(e),this.firestore,null)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.gd.path.F()},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){Bo("CollectionReference.doc",arguments,0,1),0===arguments.length&&(e=_.t()),Vo("CollectionReference.doc","non-empty string",1,e);var t=D.k(e);return Ja._d(this.gd.path.child(t),this.firestore,this.rf)},t.prototype.add=function(e){jo("CollectionReference.add",arguments,1),Vo("CollectionReference.add","object",1,this.rf?this.rf.toFirestore(e):e);var t=this.doc();return t.set(e).then((function(){return t}))},t.prototype.withConverter=function(e){return new t(this.Dd,this.firestore,e)},t}(rs);function as(e,t){if(void 0===t)return{merge:!1};if(Qo(e,t,["merge","mergeFields"]),qo(e,"boolean","merge",t.merge),function(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){if(!(r instanceof Array))throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+t+" option to be an array, but it was: "+Xo(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires all "+t+" elements to be a string or a FieldPath, but the value at index "+o+" was: "+Xo(r[o]))}(e,"mergeFields",0,r,(function(e){return"string"==typeof e||e instanceof aa}))}(e,0,0,t.mergeFields),void 0!==t.mergeFields&&void 0!==t.merge)throw new I(k.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function ss(e,t){return void 0===t?{}:(Qo(e,t,["serverTimestamps"]),Go(e,0,"serverTimestamps",t.serverTimestamps,["estimate","previous","none"]),t)}function cs(e,t){Ho(e,"object",1,t),t&&(Qo(e,t,["source"]),Go(e,0,"source",t.source,["default","server","cache"]))}function ls(e,t,n){if(t instanceof ba){if(t.firestore!==n)throw new I(k.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}throw Ko(e,"DocumentReference",1,t)}function us(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return g()}}function hs(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var ds={Firestore:qa,GeoPoint:ya,Timestamp:P,Blob:ia,Transaction:Ga,WriteBatch:Wa,DocumentReference:Ja,DocumentSnapshot:Xa,Query:rs,QueryDocumentSnapshot:Ya,QuerySnapshot:is,CollectionReference:os,FieldPath:aa,FieldValue:ma,setLogLevel:qa.setLogLevel,CACHE_SIZE_UNLIMITED:Ha};+ */function Qa(e,t,n,r,i,o,a){var s;if(i.M()){if("array-contains"===o||"array-contains-any"===o)throw new I(k.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){es(a,o);for(var c=[],l=0,u=a;l<u.length;l++){var h=u[l];c.push($a(r,e,h))}s={arrayValue:{values:c}}}else s=$a(r,e,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||es(a,o),s=Ra(n,t,a,"in"===o||"not-in"===o);var d=En.create(i,o,s);return function(e,t){if(t._n()){var n=e.ln();if(null!==n&&!n.isEqual(t.field))throw new I(k.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+t.field.toString()+"'");var r=e.un();null!==r&&ts(e,t.field,r)}var i=e.fn(function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new I(k.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new I(k.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+i.toString()+"' filters.")}(e,d),d}function Ka(e,t,n){if(null!==e.startAt)throw new I(k.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new I(k.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Dn(t,n);return function(e,t){if(null===e.un()){var n=e.ln();null!==n&&ts(e,n,t.field)}}(e,r),r}function $a(e,t,n){if("string"==typeof n){if(""===n)throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!hn(t)&&-1!==n.indexOf("/"))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=t.path.child(D.k(n));if(!j.j(r))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return Ue(e,new j(r))}if(n instanceof ba)return Ue(e,n.if);throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Yo(n)+".")}function es(e,t){if(!Array.isArray(e)||0===e.length)throw new I(k.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+t.toString()+"' filters.");if(e.length>10)throw new I(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.");if("in"===t||"array-contains-any"===t){if(e.indexOf(null)>=0)throw new I(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'null' in the value array.");if(e.filter((function(e){return Number.isNaN(e)})).length>0)throw new I(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'NaN' in the value array.")}}function ts(e,t,n){if(!n.isEqual(t))throw new I(k.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function ns(e){if(e.cn()&&0===e.en.length)throw new I(k.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var rs=function(){function e(e,t,n){this.gd=e,this.firestore=t,this.rf=n}return e.prototype.where=function(t,n,r){var i;jo("Query.where",arguments,3),Xo("Query.where",3,r),i="not-in"===n||"!="===n?n:Wo("Query.where",["<","<=","==",">=",">","array-contains","in","array-contains-any"],2,n);var o=Oa("Query.where",t),a=Qa(this.gd,"Query.where",this.firestore.rd,this.firestore.sf,o,i,r);return new e(function(e,t){var n=e.filters.concat([t]);return new cn(e.path,e.collectionGroup,e.en.slice(),n,e.limit,e.nn,e.startAt,e.endAt)}(this.gd,a),this.firestore,this.rf)},e.prototype.orderBy=function(t,n){var r;if(Bo("Query.orderBy",arguments,1,2),Ho("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r="asc";else{if("desc"!==n)throw new I(k.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r="desc"}var i=Oa("Query.orderBy",t),o=Ka(this.gd,i,r);return new e(function(e,t){var n=e.en.concat([t]);return new cn(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.nn,e.startAt,e.endAt)}(this.gd,o),this.firestore,this.rf)},e.prototype.limit=function(t){return jo("Query.limit",arguments,1),Vo("Query.limit","number",1,t),$o("Query.limit",1,t),new e(fn(this.gd,t,"F"),this.firestore,this.rf)},e.prototype.limitToLast=function(t){return jo("Query.limitToLast",arguments,1),Vo("Query.limitToLast","number",1,t),$o("Query.limitToLast",1,t),new e(fn(this.gd,t,"L"),this.firestore,this.rf)},e.prototype.startAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.startAt",arguments,1);var i=this.Vd("Query.startAt",t,n,!0);return new e(mn(this.gd,i),this.firestore,this.rf)},e.prototype.startAfter=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.startAfter",arguments,1);var i=this.Vd("Query.startAfter",t,n,!1);return new e(mn(this.gd,i),this.firestore,this.rf)},e.prototype.endBefore=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.endBefore",arguments,1);var i=this.Vd("Query.endBefore",t,n,!0);return new e(gn(this.gd,i),this.firestore,this.rf)},e.prototype.endAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Uo("Query.endAt",arguments,1);var i=this.Vd("Query.endAt",t,n,!1);return new e(gn(this.gd,i),this.firestore,this.rf)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ko("isEqual","Query",1,t);return this.firestore===t.firestore&&yn(this.gd,t.gd)&&this.rf===t.rf},e.prototype.withConverter=function(t){return new e(this.gd,this.firestore,t)},e.prototype.Vd=function(e,t,n,r){if(Xo(e,1,t),t instanceof Ya)return jo(e,i.__spreadArrays([t],n),1),function(e,t,n,r,i){if(!r)throw new I(k.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=dn(e);a<s.length;a++){var c=s[a];if(c.field.M())o.push(Ue(t,r.key));else{var l=r.field(c.field);if(Me(l))throw new I(k.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+c.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===l){var u=c.field.F();throw new I(k.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}o.push(l)}}return new In(o,i)}(this.gd,this.firestore.sf,e,t.Ad,r);var o=[t].concat(n);return function(e,t,n,r,i,o){var a=e.en;if(i.length>a.length)throw new I(k.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],c=0;c<i.length;c++){var l=i[c];if(a[c].field.M()){if("string"!=typeof l)throw new I(k.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof l);if(!hn(e)&&-1!==l.indexOf("/"))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+l+"' contains a slash.");var u=e.path.child(D.k(l));if(!j.j(u))throw new I(k.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+u+"' is not because it contains an odd number of segments.");var h=new j(u);s.push(Ue(t,h))}else{var d=Ra(n,r,l);s.push(d)}}return new In(s,o)}(this.gd,this.firestore.sf,this.firestore.rd,e,o,r)},e.prototype.onSnapshot=function(){for(var e,t,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];Bo("Query.onSnapshot",arguments,1,4);var a={},s=0;if("object"!=typeof i[s]||Do(i[s])||(Qo("Query.onSnapshot",a=i[s],["includeMetadataChanges"]),qo("Query.onSnapshot","boolean","includeMetadataChanges",a.includeMetadataChanges),s++),Do(i[s])){var c=i[s];i[s]=null===(e=c.next)||void 0===e?void 0:e.bind(c),i[s+1]=null===(t=c.error)||void 0===t?void 0:t.bind(c),i[s+2]=null===(n=c.complete)||void 0===n?void 0:n.bind(c)}else Vo("Query.onSnapshot","function",s,i[s]),Ho("Query.onSnapshot","function",s+1,i[s+1]),Ho("Query.onSnapshot","function",s+2,i[s+2]);var l={next:function(e){i[s]&&i[s](new is(r.firestore,r.gd,e,r.rf))},error:i[s+1],complete:i[s+2]};return ns(this.gd),this.firestore.Xf().listen(this.gd,a,l)},e.prototype.get=function(e){var t=this;Bo("Query.get",arguments,0,1),cs("Query.get",e),ns(this.gd);var n=this.firestore.Xf();return(e&&"cache"===e.source?n.xf(this.gd):n.Of(this.gd,e)).then((function(e){return new is(t.firestore,t.gd,e,t.rf)}))},e}(),is=function(){function e(e,t,n,r){this.dd=e,this.yd=t,this.pd=n,this.rf=r,this.bd=null,this.vd=null,this.metadata=new Za(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.pd.docs._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.pd.docs.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;Bo("QuerySnapshot.forEach",arguments,1,2),Vo("QuerySnapshot.forEach","function",1,e),this.pd.docs.forEach((function(r){e.call(t,n.Sd(r,n.metadata.fromCache,n.pd.qt.has(r.key)))}))},Object.defineProperty(e.prototype,"query",{get:function(){return new rs(this.yd,this.dd,this.rf)},enumerable:!1,configurable:!0}),e.prototype.docChanges=function(e){e&&(Qo("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),qo("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges));var t=!(!e||!e.includeMetadataChanges);if(t&&this.pd.Ut)throw new I(k.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.bd&&this.vd===t||(this.bd=function(e,t,n){if(e.Lt._()){var r=0;return e.docChanges.map((function(t){var i=n(t.doc,e.fromCache,e.qt.has(t.doc.key));return t.doc,{type:"added",doc:i,oldIndex:-1,newIndex:r++}}))}var i=e.Lt;return e.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var r=n(t.doc,e.fromCache,e.qt.has(t.doc.key)),o=-1,a=-1;return 0!==t.type&&(o=i.indexOf(t.doc.key),i=i.delete(t.doc.key)),1!==t.type&&(a=(i=i.add(t.doc)).indexOf(t.doc.key)),{type:us(t.type),doc:r,oldIndex:o,newIndex:a}}))}(this.pd,t,this.Sd.bind(this)),this.vd=t),this.bd},e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ko("isEqual","QuerySnapshot",1,t);return this.dd===t.dd&&yn(this.yd,t.yd)&&this.pd.isEqual(t.pd)&&this.rf===t.rf},e.prototype.Sd=function(e,t,n){return new Xa(this.dd,e.key,e,t,n,this.rf)},e}(),os=function(e){function t(t,n,r){var i=this;if((i=e.call(this,un(t),n,r)||this).Dd=t,t.length%2!=1)throw new I(k.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t.F()+" has "+t.length);return i}return i.__extends(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this.gd.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.gd.path.p();return e._()?null:new Ja(new j(e),this.firestore,null)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.gd.path.F()},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){Bo("CollectionReference.doc",arguments,0,1),0===arguments.length&&(e=_.t()),Vo("CollectionReference.doc","non-empty string",1,e);var t=D.k(e);return Ja._d(this.gd.path.child(t),this.firestore,this.rf)},t.prototype.add=function(e){jo("CollectionReference.add",arguments,1),Vo("CollectionReference.add","object",1,this.rf?this.rf.toFirestore(e):e);var t=this.doc();return t.set(e).then((function(){return t}))},t.prototype.withConverter=function(e){return new t(this.Dd,this.firestore,e)},t}(rs);function as(e,t){if(void 0===t)return{merge:!1};if(Qo(e,t,["merge","mergeFields"]),qo(e,"boolean","merge",t.merge),function(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){if(!(r instanceof Array))throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires its "+t+" option to be an array, but it was: "+Yo(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new I(k.INVALID_ARGUMENT,"Function "+e+"() requires all "+t+" elements to be a string or a FieldPath, but the value at index "+o+" was: "+Yo(r[o]))}(e,"mergeFields",0,r,(function(e){return"string"==typeof e||e instanceof aa}))}(e,0,0,t.mergeFields),void 0!==t.mergeFields&&void 0!==t.merge)throw new I(k.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function ss(e,t){return void 0===t?{}:(Qo(e,t,["serverTimestamps"]),Go(e,0,"serverTimestamps",t.serverTimestamps,["estimate","previous","none"]),t)}function cs(e,t){Ho(e,"object",1,t),t&&(Qo(e,t,["source"]),Go(e,0,"source",t.source,["default","server","cache"]))}function ls(e,t,n){if(t instanceof ba){if(t.firestore!==n)throw new I(k.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}throw Ko(e,"DocumentReference",1,t)}function us(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return g()}}function hs(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var ds={Firestore:qa,GeoPoint:ya,Timestamp:P,Blob:ia,Transaction:Ga,WriteBatch:Wa,DocumentReference:Ja,DocumentSnapshot:Ya,Query:rs,QueryDocumentSnapshot:Xa,QuerySnapshot:is,CollectionReference:os,FieldPath:aa,FieldValue:ma,setLogLevel:qa.setLogLevel,CACHE_SIZE_UNLIMITED:Ha};/*** @license* Copyright 2017 Google LLC@@ -1289,7 +1289,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OROTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE ORPERFORMANCE OF THIS SOFTWARE.***************************************************************************** */-var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var o,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=s||{},c=a||self;function l(){}function u(e){var t=typeof e;return"object"!=t?t:e?Array.isArray(e)?"array":t:"null"}function h(e){var t=u(e);return"array"==t||"object"==t&&"number"==typeof e.length}function d(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),f=0;function m(e,t,n){return e.call.apply(e.bind,arguments)}function g(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function y(e,t,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:g).apply(null,arguments)}function v(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var b=Date.now;function _(e,t){function n(){}n.prototype=t.prototype,e.S=t.prototype,e.prototype=new n,e.prototype.constructor=e}function w(){this.j=this.j,this.i=this.i}w.prototype.j=!1,w.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0))(function(e){Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++f)})(this)},w.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var E=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},A=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i="string"==typeof e?e.split(""):e,o=0;o<r;o++)o in i&&t.call(n,i[o],o,e)};function x(e){return Array.prototype.concat.apply([],arguments)}function S(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function T(e){return/^[\s\xa0]*$/.test(e)}var M,R=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function C(e,t){return-1!=e.indexOf(t)}function k(e,t){return e<t?-1:e>t?1:0}e:{var I=c.navigator;if(I){var P=I.userAgent;if(P){M=P;break e}}M=""}function O(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function N(e){var t={};for(var n in e)t[n]=e[n];return t}var D="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function L(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var o=0;o<D.length;o++)n=D[o],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function F(e){return F[" "](e),e}F[" "]=l;var j,U,B=C(M,"Opera"),V=C(M,"Trident")||C(M,"MSIE"),H=C(M,"Edge"),z=H||V,q=C(M,"Gecko")&&!(C(M.toLowerCase(),"webkit")&&!C(M,"Edge"))&&!(C(M,"Trident")||C(M,"MSIE"))&&!C(M,"Edge"),G=C(M.toLowerCase(),"webkit")&&!C(M,"Edge");function W(){var e=c.document;return e?e.documentMode:void 0}e:{var J="",Z=(U=M,q?/rv:([^\);]+)(\)|;)/.exec(U):H?/Edge\/([\d\.]+)/.exec(U):V?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(U):G?/WebKit\/(\S+)/.exec(U):B?/(?:Version)[ \/]?(\S+)/.exec(U):void 0);if(Z&&(J=Z?Z[1]:""),V){var X=W();if(null!=X&&X>parseFloat(J)){j=String(X);break e}}j=J}var Y,Q={};function K(e){return function(e,t){var n=Q;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=R(String(j)).split("."),r=R(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;t=k(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||k(0==a[2].length,0==s[2].length)||k(a[2],s[2]),a=a[3],s=s[3]}while(0==t)}return 0<=t}))}if(c.document&&V){var $=W();Y=$||(parseInt(j,10)||void 0)}else Y=void 0;var ee=Y,te=!V||9<=Number(ee),ne=V&&!K("9"),re=function(){if(!c.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{c.addEventListener("test",l,t),c.removeEventListener("test",l,t)}catch(e){}return e}();function ie(e,t){this.type=e,this.a=this.target=t,this.defaultPrevented=!1}function oe(e,t){if(ie.call(this,e?e.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.a=t,t=e.relatedTarget){if(q){e:{try{F(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:ae[e.pointerType]||"",this.c=e,e.defaultPrevented&&this.b()}}ie.prototype.b=function(){this.defaultPrevented=!0},_(oe,ie);var ae={2:"touch",3:"pen",4:"mouse"};oe.prototype.b=function(){oe.S.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,ne)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var se="closure_listenable_"+(1e6*Math.random()|0),ce=0;function le(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ce,this.Y=this.Z=!1}function ue(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function he(e){this.src=e,this.a={},this.b=0}function de(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],o=E(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ue(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function pe(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i];if(!o.Y&&o.listener==t&&o.capture==!!n&&o.ca==r)return i}return-1}he.prototype.add=function(e,t,n,r,i){var o=e.toString();(e=this.a[o])||(e=this.a[o]=[],this.b++);var a=pe(e,t,r,i);return-1<a?(t=e[a],n||(t.Z=!1)):((t=new le(t,this.src,o,!!r,i)).Z=n,e.push(t)),t};var fe="closure_lm_"+(1e6*Math.random()|0),me={};function ge(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,o){if(Array.isArray(n)){for(var a=0;a<n.length;a++)e(t,n[a],r,i,o);return null}return r=xe(r),t&&t[se]?t.wa(n,r,d(i)?!!i.capture:!!i,o):ye(t,n,r,!0,i,o)}(e,t,n,r,i);if(Array.isArray(t)){for(var o=0;o<t.length;o++)ge(e,t[o],n,r,i);return null}return n=xe(n),e&&e[se]?e.va(t,n,d(r)?!!r.capture:!!r,i):ye(e,t,n,!1,r,i)}function ye(e,t,n,r,i,o){if(!t)throw Error("Invalid event type");var a=d(i)?!!i.capture:!!i;if(a&&!te)return null;var s=Ee(e);if(s||(e[fe]=s=new he(e)),(n=s.add(t,n,r,a,o)).proxy)return n;if(r=function(){var e=we,t=te?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)re||(i=a),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(be(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ve(e){if("number"!=typeof e&&e&&!e.Y){var t=e.src;if(t&&t[se])de(t.c,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(be(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=Ee(t))?(de(n,e),0==n.b&&(n.src=null,t[fe]=null)):ue(e)}}}function be(e){return e in me?me[e]:me[e]="on"+e}function _e(e,t){var n=e.listener,r=e.ca||e.src;return e.Z&&ve(e),n.call(r,t)}function we(e,t){if(e.Y)return!0;if(!te){if(!t)e:{t=["window","event"];for(var n=c,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return _e(e,t=new oe(t,this))}return _e(e,new oe(t,this))}function Ee(e){return(e=e[fe])instanceof he?e:null}var Ae="__closure_events_fn_"+(1e9*Math.random()>>>0);function xe(e){return"function"==u(e)?e:(e[Ae]||(e[Ae]=function(t){return e.handleEvent(t)}),e[Ae])}function Se(){w.call(this),this.c=new he(this),this.J=this,this.C=null}function Te(e,t,n,r){if(!(t=e.c.a[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;o<t.length;++o){var a=t[o];if(a&&!a.Y&&a.capture==n){var s=a.listener,c=a.ca||a.src;a.Z&&de(e.c,a),i=!1!==s.call(c,r)&&i}}return i&&!r.defaultPrevented}_(Se,w),Se.prototype[se]=!0,(o=Se.prototype).addEventListener=function(e,t,n,r){ge(this,e,t,n,r)},o.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,o){if(Array.isArray(n))for(var a=0;a<n.length;a++)e(t,n[a],r,i,o);else i=d(i)?!!i.capture:!!i,r=xe(r),t&&t[se]?(t=t.c,(n=String(n).toString())in t.a&&(-1<(r=pe(a=t.a[n],r,i,o))&&(ue(a[r]),Array.prototype.splice.call(a,r,1),0==a.length&&(delete t.a[n],t.b--)))):t&&(t=Ee(t))&&(n=t.a[n.toString()],t=-1,n&&(t=pe(n,r,i,o)),(r=-1<t?n[t]:null)&&ve(r))}(this,e,t,n,r)},o.dispatchEvent=function(e){var t,n=this.C;if(n)for(t=[];n;n=n.C)t.push(n);n=this.J;var r=e.type||e;if("string"==typeof e)e=new ie(e,n);else if(e instanceof ie)e.target=e.target||n;else{var i=e;L(e=new ie(r,n),i)}if(i=!0,t)for(var o=t.length-1;0<=o;o--){var a=e.a=t[o];i=Te(a,r,!0,e)&&i}if(i=Te(a=e.a=n,r,!0,e)&&i,i=Te(a,r,!1,e)&&i,t)for(o=0;o<t.length;o++)i=Te(a=e.a=t[o],r,!1,e)&&i;return i},o.G=function(){if(Se.S.G.call(this),this.c){var e,t=this.c;for(e in t.a){for(var n=t.a[e],r=0;r<n.length;r++)ue(n[r]);delete t.a[e],t.b--}}this.C=null},o.va=function(e,t,n,r){return this.c.add(String(e),t,!1,n,r)},o.wa=function(e,t,n,r){return this.c.add(String(e),t,!0,n,r)};var Me=c.JSON.stringify;function Re(){this.b=this.a=null}var Ce,ke=new(function(){function e(e,t,n){this.f=n,this.c=e,this.g=t,this.b=0,this.a=null}return e.prototype.get=function(){var e;return 0<this.b?(this.b--,e=this.a,this.a=e.next,e.next=null):e=this.c(),e},e}())((function(){return new Pe}),(function(e){e.reset()}),100);function Ie(){var e=Le,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function Pe(){this.next=this.b=this.a=null}function Oe(e){c.setTimeout((function(){throw e}),0)}function Ne(e,t){Ce||function(){var e=c.Promise.resolve(void 0);Ce=function(){e.then(Fe)}}(),De||(Ce(),De=!0),Le.add(e,t)}Re.prototype.add=function(e,t){var n=ke.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},Pe.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},Pe.prototype.reset=function(){this.next=this.b=this.a=null};var De=!1,Le=new Re;function Fe(){for(var e;e=Ie();){try{e.a.call(e.b)}catch(e){Oe(e)}var t=ke;t.g(e),t.b<t.f&&(t.b++,e.next=t.a,t.a=e)}De=!1}function je(e,t){Se.call(this),this.b=e||1,this.a=t||c,this.f=y(this.Ya,this),this.g=b()}function Ue(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Be(e,t,n){if("function"==u(e))n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647<Number(t)?-1:c.setTimeout(e,t||0)}function Ve(e){e.a=Be((function(){e.a=null,e.c&&(e.c=!1,Ve(e))}),e.h);var t=e.b;e.b=null,e.g.apply(null,t)}_(je,Se),(o=je.prototype).aa=!1,o.M=null,o.Ya=function(){if(this.aa){var e=b()-this.g;0<e&&e<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-e):(this.M&&(this.a.clearTimeout(this.M),this.M=null),this.dispatchEvent("tick"),this.aa&&(Ue(this),this.start()))}},o.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=b())},o.G=function(){je.S.G.call(this),Ue(this),delete this.a};var He=function(e){function t(t,n,r){var i=e.call(this)||this;return i.g=null!=r?t.bind(r):t,i.h=n,i.b=null,i.c=!1,i.a=null,i}return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.f=function(e){this.b=arguments,this.a?this.c=!0:Ve(this)},t.prototype.G=function(){e.prototype.G.call(this),this.a&&(c.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},t}(w);function ze(e){w.call(this),this.b=e,this.a={}}_(ze,w);var qe=[];function Ge(e,t,n,r){Array.isArray(n)||(n&&(qe[0]=n.toString()),n=qe);for(var i=0;i<n.length;i++){var o=ge(t,n[i],r||e.handleEvent,!1,e.b||e);if(!o)break;e.a[o.key]=o}}function We(e){O(e.a,(function(e,t){this.a.hasOwnProperty(t)&&ve(e)}),e),e.a={}}function Je(){this.a=!0}function Ze(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.a)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;a<i.length;a++)i[a]=""}}}return Me(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}ze.prototype.G=function(){ze.S.G.call(this),We(this)},ze.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Je.prototype.info=function(){};var Xe=null;function Ye(){return Xe=Xe||new Se}function Qe(e){ie.call(this,"serverreachability",e)}function Ke(e){var t=Ye();t.dispatchEvent(new Qe(t,e))}function $e(e){ie.call(this,"statevent",e)}function et(e){var t=Ye();t.dispatchEvent(new $e(t,e))}function tt(e){ie.call(this,"timingevent",e)}function nt(e,t){if("function"!=u(e))throw Error("Fn must not be null and must be a function");return c.setTimeout((function(){e()}),t)}_(Qe,ie),_($e,ie),_(tt,ie);var rt={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},it={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function ot(){}function at(e){var t;return(t=e.a)||(t=e.a={}),t}function st(){}ot.prototype.a=null;var ct,lt={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function ut(){ie.call(this,"d")}function ht(){ie.call(this,"c")}function dt(){}function pt(e,t,n,r){this.g=e,this.c=t,this.f=n,this.T=r||1,this.J=new ze(this),this.P=ft,e=z?125:void 0,this.R=new je(e),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.U=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.W=this.C=this.V=this.I=!1}_(ut,ie),_(ht,ie),_(dt,ot),ct=new dt;var ft=45e3,mt={},gt={};function yt(e,t,n){e.H=1,e.i=Ut(Ot(t)),e.j=n,e.I=!0,vt(e,null)}function vt(e,t){e.u=b(),wt(e),e.l=Ot(e.i);var n=e.l,r=e.T;Array.isArray(r)||(r=[String(r)]),Kt(n.b,"t",r),e.D=0,e.a=Jn(e.g,e.g.C?t:null),0<e.O&&(e.F=new He(y(e.Ca,e,e.a),e.O)),Ge(e.J,e.a,"readystatechange",e.Wa),t=e.B?N(e.B):{},e.j?(e.m||(e.m="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.ba(e.l,e.m,e.j,t)):(e.m="GET",e.a.ba(e.l,e.m,null,t)),Ke(1),function(e,t,n,r,i,o){e.info((function(){if(e.a)if(o)for(var a="",s=o.split("&"),c=0;c<s.length;c++){var l=s[c].split("=");if(1<l.length){var u=l[0];l=l[1];var h=u.split("_");a=2<=h.length&&"type"==h[1]?a+(u+"=")+l+"&":a+(u+"=redacted&")}}else a=null;else a=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+a}))}(e.c,e.m,e.l,e.f,e.T,e.j)}function bt(e,t,n){for(var r=!0;!e.A&&e.D<n.length;){var i=_t(e,n);if(i==gt){4==t&&(e.h=4,et(14),r=!1),Ze(e.c,e.f,null,"[Incomplete Response]");break}if(i==mt){e.h=4,et(15),Ze(e.c,e.f,n,"[Invalid Chunk]"),r=!1;break}Ze(e.c,e.f,i,null),Tt(e,i)}4==t&&0==n.length&&(e.h=1,et(16),r=!1),e.b=e.b&&r,r?0<n.length&&!e.W&&(e.W=!0,(t=e.g).a==e&&t.V&&!t.F&&(t.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Un(t),t.F=!0)):(Ze(e.c,e.f,n,"[Invalid Chunked Response]"),St(e),xt(e))}function _t(e,t){var n=e.D,r=t.indexOf("\n",n);return-1==r?gt:(n=Number(t.substring(n,r)),isNaN(n)?mt:(r+=1)+n>t.length?gt:(t=t.substr(r,n),e.D=r+n,t))}function wt(e){e.U=b()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=nt(y(e.Ua,e),t)}function At(e){e.o&&(c.clearTimeout(e.o),e.o=null)}function xt(e){0==e.g.v||e.A||Hn(e.g,e)}function St(e){At(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Ue(e.R),We(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Tt(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||an(n.b,e)))if(n.I=e.N,!e.C&&an(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3<e.u))break e;Vn(n),kn(n)}jn(n),et(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=nt(y(n.Ra,n),6e3));if(1>=on(n.b)&&n.ea){try{n.ea()}catch(e){}n.ea=void 0}}else qn(n,11)}else if((e.C||n.a==e)&&Vn(n),!T(t))for(t=r=n.ka.a.parse(t),r=0;r<t.length;r++)if(i=t[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var o=i[3];null!=o&&(n.ha=o,n.c.info("VER="+n.ha));var a=i[4];null!=a&&(n.pa=a,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"==typeof s&&0<s){var c=1.5*s;n.D=c,n.c.info("backChannelRequestTimeoutMs_="+c)}c=n;var l=e.a;if(l){var u=l.a?l.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var h=c.b;!h.a&&(C(u,"spdy")||C(u,"quic")||C(u,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(sn(h,h.b),h.b=null))}if(c.A){var d=l.a?l.a.getResponseHeader("X-HTTP-Session-Id"):null;d&&(c.na=d,jt(c.B,c.A,d))}}n.v=3,n.f&&n.f.ta(),n.V&&(n.N=b()-e.u,n.c.info("Handshake RTT: "+n.N+"ms"));var p=e;if((c=n).la=Wn(c,c.C?c.ga:null,c.fa),p.C){cn(c.b,p);var f=p,m=c.D;m&&f.setTimeout(m),f.o&&(At(f),wt(f)),c.a=p}else Fn(c);0<n.g.length&&On(n)}else"stop"!=i[0]&&"close"!=i[0]||qn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?qn(n,7):Cn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);Ke(4)}catch(e){}}function Mt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(h(e)||"string"==typeof e)A(e,t,void 0);else{if(e.L&&"function"==typeof e.L)var n=e.L();else if(e.K&&"function"==typeof e.K)n=void 0;else if(h(e)||"string"==typeof e){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;i=(r=function(e){if(e.K&&"function"==typeof e.K)return e.K();if("string"==typeof e)return e.split("");if(h(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e)).length;for(var o=0;o<i;o++)t.call(void 0,r[o],n&&n[o],e)}}function Rt(e,t){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(e)if(e instanceof Rt)for(n=e.L(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function Ct(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];kt(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)kt(i,r=e.a[t])||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function kt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(o=pt.prototype).setTimeout=function(e){this.P=e},o.Wa=function(e){e=e.target;var t=this.F;t&&3==Sn(e)?t.f():this.Ca(e)},o.Ca=function(e){try{if(e==this.a)e:{var t=Sn(this.a),n=this.a.ua(),r=this.a.X();if(!(3>t||3==t&&!z&&!this.a.$())){this.A||4!=t||7==n||Ke(8==n||0>=r?3:2),At(this);var i=this.a.X();this.N=i;var o=this.a.$();if(this.b=200==i,function(e,t,n,r,i,o,a){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+a}))}(this.c,this.m,this.l,this.f,this.T,t,i),this.b){if(this.V&&!this.C){t:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!T(a)){var c=a;break t}}c=null}if(!c){this.b=!1,this.h=3,et(12),St(this),xt(this);break e}Ze(this.c,this.f,c,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Tt(this,c)}this.I?(bt(this,t,o),z&&this.b&&3==t&&(Ge(this.J,this.R,"tick",this.Va),this.R.start())):(Ze(this.c,this.f,o,null),Tt(this,o)),4==t&&St(this),this.b&&!this.A&&(4==t?Hn(this.g,this):(this.b=!1,wt(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,et(12)):(this.h=0,et(13)),St(this),xt(this)}}}catch(e){}},o.Va=function(){if(this.a){var e=Sn(this.a),t=this.a.$();this.D<t.length&&(At(this),bt(this,e,t),this.b&&4!=e&&wt(this))}},o.cancel=function(){this.A=!0,St(this)},o.Ua=function(){this.o=null;var e=b();0<=e-this.U?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.c,this.l),2!=this.H&&(Ke(3),et(17)),St(this),this.h=2,xt(this)):Et(this,this.U-e)},(o=Rt.prototype).K=function(){Ct(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},o.L=function(){return Ct(this),this.a.concat()},o.get=function(e,t){return kt(this.b,e)?this.b[e]:t},o.set=function(e,t){kt(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},o.forEach=function(e,t){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);e.call(t,o,i,this)}};var It=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Pt(e,t){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,e instanceof Pt){this.a=void 0!==t?t:e.a,Nt(this,e.f),this.j=e.j,Dt(this,e.c),Lt(this,e.h),this.g=e.g,t=e.b;var n=new Zt;n.c=t.c,t.a&&(n.a=new Rt(t.a),n.b=t.b),Ft(this,n),this.i=e.i}else e&&(n=String(e).match(It))?(this.a=!!t,Nt(this,n[1]||"",!0),this.j=Bt(n[2]||""),Dt(this,n[3]||"",!0),Lt(this,n[4]),this.g=Bt(n[5]||"",!0),Ft(this,n[6]||"",!0),this.i=Bt(n[7]||"")):(this.a=!!t,this.b=new Zt(null,this.a))}function Ot(e){return new Pt(e)}function Nt(e,t,n){e.f=n?Bt(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Dt(e,t,n){e.c=n?Bt(t,!0):t}function Lt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Ft(e,t,n){t instanceof Zt?(e.b=t,function(e,t){t&&!e.f&&(Xt(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Yt(this,t),Kt(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Vt(t,Wt)),e.b=new Zt(t,e.a))}function jt(e,t,n){e.b.set(t,n)}function Ut(e){return jt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^b()).toString(36)),e}function Bt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Vt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,Ht),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Ht(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Vt(t,zt,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Vt(t,zt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Vt(n,"/"==n.charAt(0)?Gt:qt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Vt(n,Jt)),e.join("")};var zt=/[#\/\?@]/g,qt=/[#\?:]/g,Gt=/[#\?]/g,Wt=/[#\?@]/g,Jt=/#/g;function Zt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Xt(e){e.a||(e.a=new Rt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var o=e[n].substring(0,r);i=e[n].substring(r+1)}else o=e[n];t(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.c,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Yt(e,t){Xt(e),t=$t(e,t),kt(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,kt((e=e.a).b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&Ct(e)))}function Qt(e,t){return Xt(e),t=$t(e,t),kt(e.a.b,t)}function Kt(e,t,n){Yt(e,t),0<n.length&&(e.c=null,e.a.set($t(e,t),S(n)),e.b+=n.length)}function $t(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function en(e,t){this.b=e,this.a=t}function tn(e){this.g=e||nn,c.PerformanceNavigationTiming?e=0<(e=c.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(c.ia&&c.ia.ya&&c.ia.ya()&&c.ia.ya().qb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(o=Zt.prototype).add=function(e,t){Xt(this),this.c=null,e=$t(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},o.forEach=function(e,t){Xt(this),this.a.forEach((function(n,r){A(n,(function(n){e.call(t,n,r,this)}),this)}),this)},o.L=function(){Xt(this);for(var e=this.a.K(),t=this.a.L(),n=[],r=0;r<t.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(t[r]);return n},o.K=function(e){Xt(this);var t=[];if("string"==typeof e)Qt(this,e)&&(t=x(t,this.a.get($t(this,e))));else{e=this.a.K();for(var n=0;n<e.length;n++)t=x(t,e[n])}return t},o.set=function(e,t){return Xt(this),this.c=null,Qt(this,e=$t(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},o.get=function(e,t){return e&&0<(e=this.K(e)).length?String(e[0]):t},o.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.L(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.K(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),e.push(a)}}return this.c=e.join("&")};var nn=10;function rn(e){return!!e.b||!!e.a&&e.a.size>=e.f}function on(e){return e.b?1:e.a?e.a.size:0}function an(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function sn(e,t){e.a?e.a.add(t):e.b=t}function cn(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function ln(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var o=i(e.a.values()),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.concat(s.s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}return S(e.c)}function un(){}function hn(){this.a=new un}function dn(e,t,n){var r=n||"";try{Mt(e,(function(e,n){var i=e;d(e)&&(i=Me(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function pn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}tn.prototype.cancel=function(){var e,t;if(this.c=ln(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},un.prototype.stringify=function(e){return c.JSON.stringify(e,void 0)},un.prototype.parse=function(e){return c.JSON.parse(e,void 0)};var fn=c.JSON.parse;function mn(e){Se.call(this),this.headers=new Rt,this.H=e||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=gn,this.D=this.F=!1}_(mn,Se);var gn="",yn=/^https?$/i,vn=["POST","PUT"];function bn(e){return"content-type"==e.toLowerCase()}function _n(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,wn(e),An(e)}function wn(e){e.u||(e.u=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function En(e){if(e.b&&void 0!==s&&(!e.s[1]||4!=Sn(e)||2!=e.X()))if(e.l&&4==Sn(e))Be(e.za,0,e);else if(e.dispatchEvent("readystatechange"),4==Sn(e)){e.b=!1;try{var t,n=e.X();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var o=String(e.B).match(It)[1]||null;if(!o&&c.self&&c.self.location){var a=c.self.location.protocol;o=a.substr(0,a.length-1)}i=!yn.test(o?o.toLowerCase():"")}t=i}if(t)e.dispatchEvent("complete"),e.dispatchEvent("success");else{e.h=6;try{var l=2<Sn(e)?e.a.statusText:""}catch(e){l=""}e.f=l+" ["+e.X()+"]",wn(e)}}finally{An(e)}}}function An(e,t){if(e.a){xn(e);var n=e.a,r=e.s[0]?l:null;e.a=null,e.s=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){}}}function xn(e){e.a&&e.D&&(e.a.ontimeout=null),e.m&&(c.clearTimeout(e.m),e.m=null)}function Sn(e){return e.a?e.a.readyState:0}function Tn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=function(e){var t="";return O(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):jt(e,t,n))}function Mn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Rn(e){this.pa=0,this.g=[],this.c=new Je,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.W=this.i=this.O=this.l=null,this.La=this.R=0,this.Ia=Mn("failFast",!1,e),this.H=this.m=this.j=this.h=this.f=null,this.T=!0,this.I=this.oa=this.P=-1,this.U=this.o=this.u=0,this.Fa=Mn("baseRetryDelayMs",5e3,e),this.Ma=Mn("retryDelaySeedMs",1e4,e),this.Ja=Mn("forwardChannelMaxRetries",2,e),this.ma=Mn("forwardChannelRequestTimeoutMs",2e4,e),this.Ka=e&&e.g||void 0,this.D=void 0,this.C=e&&e.supportsCrossDomainXhr||!1,this.J="",this.b=new tn(e&&e.concurrentRequestLimit),this.ka=new hn,this.da=e&&e.fastHandshake||!1,this.Ga=e&&e.b||!1,e&&e.f&&(this.c.a=!1),e&&e.forceLongPolling&&(this.T=!1),this.V=!this.da&&this.T&&e&&e.c||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null}function Cn(e){if(In(e),3==e.v){var t=e.R++,n=Ot(e.B);jt(n,"SID",e.J),jt(n,"RID",t),jt(n,"TYPE","terminate"),Dn(e,n),(t=new pt(e,e.c,t,void 0)).H=2,t.i=Ut(Ot(n)),n=!1,c.navigator&&c.navigator.sendBeacon&&(n=c.navigator.sendBeacon(t.i.toString(),"")),!n&&c.Image&&((new Image).src=t.i,n=!0),n||(t.a=Jn(t.g,null),t.a.ba(t.i)),t.u=b(),wt(t)}Gn(e)}function kn(e){e.a&&(Un(e),e.a.cancel(),e.a=null)}function In(e){kn(e),e.j&&(c.clearTimeout(e.j),e.j=null),Vn(e),e.b.cancel(),e.h&&("number"==typeof e.h&&c.clearTimeout(e.h),e.h=null)}function Pn(e,t){e.g.push(new en(e.La++,t)),3==e.v&&On(e)}function On(e){rn(e.b)||e.h||(e.h=!0,Ne(e.Ba,e),e.u=0)}function Nn(e,t){var n;n=t?t.f:e.R++;var r=Ot(e.B);jt(r,"SID",e.J),jt(r,"RID",n),jt(r,"AID",e.P),Dn(e,r),e.i&&e.l&&Tn(r,e.i,e.l),n=new pt(e,e.c,n,e.u+1),null===e.i&&(n.B=e.l),t&&(e.g=t.s.concat(e.g)),t=Ln(e,n,1e3),n.setTimeout(Math.round(.5*e.ma)+Math.round(.5*e.ma*Math.random())),sn(e.b,n),yt(n,r,t)}function Dn(e,t){e.f&&Mt({},(function(e,n){jt(t,n,e)}))}function Ln(e,t,n){n=Math.min(e.g.length,n);var r=e.f?y(e.f.Ha,e.f,e):null;e:for(var i=e.g,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].b,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,c=0;c<n;c++){var l=i[c].b,u=i[c].a;if(0>(l-=o))o=Math.max(0,i[c].b-100),s=!1;else try{dn(u,a,"req"+l+"_")}catch(e){r&&r(u)}}if(s){r=a.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Fn(e){e.a||e.j||(e.U=1,Ne(e.Aa,e),e.o=0)}function jn(e){return!(e.a||e.j||3<=e.o)&&(e.U++,e.j=nt(y(e.Aa,e),zn(e,e.o)),e.o++,!0)}function Un(e){null!=e.s&&(c.clearTimeout(e.s),e.s=null)}function Bn(e){e.a=new pt(e,e.c,"rpc",e.U),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=Ot(e.la);jt(t,"RID","rpc"),jt(t,"SID",e.J),jt(t,"CI",e.H?"0":"1"),jt(t,"AID",e.P),Dn(e,t),jt(t,"TYPE","xmlhttp"),e.i&&e.l&&Tn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=Ut(Ot(t)),n.j=null,n.I=!0,vt(n,e)}function Vn(e){null!=e.m&&(c.clearTimeout(e.m),e.m=null)}function Hn(e,t){var n=null;if(e.a==t){Vn(e),Un(e),e.a=null;var r=2}else{if(!an(e.b,t))return;n=t.s,cn(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=b()-t.u;var i=e.u;(r=Ye()).dispatchEvent(new tt(r,n,t,i)),On(e)}else Fn(e);else if(3==(i=t.h)||0==i&&0<e.I||!(1==r&&function(e,t){return!(on(e.b)>=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.Ia?0:e.Ja))&&(e.h=nt(y(e.Ba,e,t),zn(e,e.u)),e.u++,!0))}(e,t)||2==r&&jn(e)))switch(n&&0<n.length&&(t=e.b,t.c=t.c.concat(n)),i){case 1:qn(e,5);break;case 4:qn(e,10);break;case 3:qn(e,6);break;default:qn(e,2)}}function zn(e,t){var n=e.Fa+Math.floor(Math.random()*e.Ma);return e.f||(n*=2),n*t}function qn(e,t){if(e.c.info("Error code "+t),2==t){var n=null;e.f&&(n=null);var r=y(e.Xa,e);n||(n=new Pt("//www.google.com/images/cleardot.gif"),c.location&&"http"==c.location.protocol||Nt(n,"https"),Ut(n)),function(e,t){var n=new Je;if(c.Image){var r=new Image;r.onload=v(pn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=v(pn,n,r,"TestLoadImage: error",!1,t),r.onabort=v(pn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=v(pn,n,r,"TestLoadImage: timeout",!1,t),c.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else et(2);e.v=0,e.f&&e.f.ra(t),Gn(e),In(e)}function Gn(e){e.v=0,e.I=-1,e.f&&(0==ln(e.b).length&&0==e.g.length||(e.b.c.length=0,S(e.g),e.g.length=0),e.f.qa())}function Wn(e,t,n){var r=function(e){return e instanceof Pt?Ot(e):new Pt(e,void 0)}(n);if(""!=r.c)t&&Dt(r,t+"."+r.c),Lt(r,r.h);else{var i=c.location;r=function(e,t,n,r){var i=new Pt(null,void 0);return e&&Nt(i,e),t&&Dt(i,t),n&&Lt(i,n),r&&(i.g=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.W&&O(e.W,(function(e,t){jt(r,t,e)})),t=e.A,n=e.na,t&&n&&jt(r,t,n),jt(r,"VER",e.ha),Dn(e,r),r}function Jn(e,t){if(t&&!e.C)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new mn(e.Ka)).F=e.C,t}function Zn(){}function Xn(){if(V&&!(10<=Number(ee)))throw Error("Environmental error: no available transport.")}function Yn(e,t){Se.call(this),this.a=new Rn(t),this.l=e,this.b=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.l=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.a&&(e?e["X-WebChannel-Client-Profile"]=t.a:e={"X-WebChannel-Client-Profile":t.a}),this.a.O=e,(e=t&&t.httpHeadersOverwriteParam)&&!T(e)&&(this.a.i=e),this.h=t&&t.supportsCrossDomainXhr||!1,this.g=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!T(t)&&(this.a.A=t,null!==(e=this.b)&&t in e&&(t in(e=this.b)&&delete e[t])),this.f=new $n(this)}function Qn(e){ut.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function Kn(){ht.call(this),this.status=1}function $n(e){this.a=e}(o=mn.prototype).ba=function(e,t,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+e);t=t?t.toUpperCase():"GET",this.B=e,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?at(this.H):at(ct),this.a.onreadystatechange=y(this.za,this);try{this.A=!0,this.a.open(t,String(e),!0),this.A=!1}catch(e){return void _n(this,e)}e=n||"";var i=new Rt(this.headers);r&&Mt(r,(function(e,t){i.set(t,e)})),r=function(e){e:{for(var t=bn,n=e.length,r="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:"string"==typeof e?e.charAt(t):e[t]}(i.L()),n=c.FormData&&e instanceof c.FormData,!(0<=E(vn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{xn(this),0<this.o&&((this.D=function(e){return V&&K(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=y(this.xa,this)):this.m=Be(this.xa,this.o,this)),this.l=!0,this.a.send(e),this.l=!1}catch(e){_n(this,e)}},o.xa=function(){void 0!==s&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},o.abort=function(e){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),An(this))},o.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),An(this,!0)),mn.S.G.call(this)},o.za=function(){this.j||(this.A||this.l||this.g?En(this):this.Ta())},o.Ta=function(){En(this)},o.X=function(){try{return 2<Sn(this)?this.a.status:-1}catch(e){return-1}},o.$=function(){try{return this.a?this.a.responseText:""}catch(e){return""}},o.Na=function(e){if(this.a){var t=this.a.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),fn(t)}},o.ua=function(){return this.h},o.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(o=Rn.prototype).ha=8,o.v=1,o.Ba=function(e){if(this.h)if(this.h=null,1==this.v){if(!e){this.R=Math.floor(1e5*Math.random()),e=this.R++;var t,n=new pt(this,this.c,e,void 0),r=this.l;if(this.O&&(r?L(r=N(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)e:{for(var i=t=0;i<this.g.length;i++){var o=this.g[i];if(void 0===(o="__data__"in o.a&&"string"==typeof(o=o.a.__data__)?o.length:void 0))break;if(4096<(t+=o)){t=i;break e}if(4096===t||i===this.g.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Ln(this,n,t),jt(i=Ot(this.B),"RID",e),jt(i,"CVER",22),this.A&&jt(i,"X-HTTP-Session-Id",this.A),Dn(this,i),this.i&&r&&Tn(i,this.i,r),sn(this.b,n),this.Ga&&jt(i,"TYPE","init"),this.da?(jt(i,"$req",t),jt(i,"SID","null"),n.V=!0,yt(n,i,null)):yt(n,i,t),this.v=2}}else 3==this.v&&(e?Nn(this,e):0==this.g.length||rn(this.b)||Nn(this))},o.Aa=function(){if(this.j=null,Bn(this),this.V&&!(this.F||null==this.a||0>=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=nt(y(this.Sa,this),e)}},o.Sa=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,kn(this),Bn(this))},o.Ra=function(){null!=this.m&&(this.m=null,kn(this),jn(this),et(19))},o.Xa=function(e){e?(this.c.info("Successfully pinged google.com"),et(2)):(this.c.info("Failed to ping google.com"),et(1))},(o=Zn.prototype).ta=function(){},o.sa=function(){},o.ra=function(){},o.qa=function(){},o.Ha=function(){},Xn.prototype.a=function(e,t){return new Yn(e,t)},_(Yn,Se),(o=Yn.prototype).addEventListener=function(e,t,n,r){Yn.S.addEventListener.call(this,e,t,n,r)},o.removeEventListener=function(e,t,n,r){Yn.S.removeEventListener.call(this,e,t,n,r)},o.Oa=function(){this.a.f=this.f,this.h&&(this.a.C=!0);var e=this.a,t=this.l,n=this.b||void 0;et(0),e.fa=t,e.W=n||{},e.H=e.T,e.B=Wn(e,null,e.fa),On(e)},o.close=function(){Cn(this.a)},o.Pa=function(e){if("string"==typeof e){var t={};t.__data__=e,Pn(this.a,t)}else this.g?((t={}).__data__=Me(e),Pn(this.a,t)):Pn(this.a,e)},o.G=function(){this.a.f=null,delete this.f,Cn(this.a),delete this.a,Yn.S.G.call(this)},_(Qn,ut),_(Kn,ht),_($n,Zn),$n.prototype.ta=function(){this.a.dispatchEvent("a")},$n.prototype.sa=function(e){this.a.dispatchEvent(new Qn(e))},$n.prototype.ra=function(e){this.a.dispatchEvent(new Kn(e))},$n.prototype.qa=function(){this.a.dispatchEvent("b")},Xn.prototype.createWebChannel=Xn.prototype.a,Yn.prototype.send=Yn.prototype.Pa,Yn.prototype.open=Yn.prototype.Oa,Yn.prototype.close=Yn.prototype.close,rt.NO_ERROR=0,rt.TIMEOUT=8,rt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=lt,lt.OPEN="a",lt.CLOSE="b",lt.ERROR="c",lt.MESSAGE="d",Se.prototype.listen=Se.prototype.va,mn.prototype.listenOnce=mn.prototype.wa,mn.prototype.getLastError=mn.prototype.Qa,mn.prototype.getLastErrorCode=mn.prototype.ua,mn.prototype.getStatus=mn.prototype.X,mn.prototype.getResponseJson=mn.prototype.Na,mn.prototype.getResponseText=mn.prototype.$,mn.prototype.send=mn.prototype.ba;var er={createWebChannelTransport:function(){return new Xn},ErrorCode:rt,EventType:it,WebChannel:st,XhrIo:mn},tr=er.createWebChannelTransport,nr=er.ErrorCode,rr=er.EventType,ir=er.WebChannel,or=er.XhrIo;t.default=er}.call(this,n(1))},function(e,t,n){const r=n(0),i=new THREE.Color;function o(e,t,n){i.set(n),e.uniforms?(e.uniforms[t].value.x=i.r,e.uniforms[t].value.y=i.g,e.uniforms[t].value.z=i.b):e[t].set(n)}function a(e,t,n,r,i,o){e.fillStyle=t,e.fillRect(n,r,i,o)}function s(e,t,n,r,i,o,a){let s;s=o>a?e.createLinearGradient(0,0,o,0):e.createLinearGradient(0,0,0,a),s.addColorStop(0,t),s.addColorStop(1,n),e.fillStyle=s,e.fillRect(r,i,o,a)}if(AFRAME.registerSystem("materials",{schema:{},init:function(){this.curve=null,this.panelMaterials=[];const e=localStorage.getItem("colorScheme")||"default";this.scheme=r.schemes[e],this.textureList=[],this.beatsCanvas=document.createElement("canvas"),this.beatsTexture=new THREE.CanvasTexture(this.beatsCanvas),this.generateBeatsTexture(),this.textureList.push(this.beatsTexture),this.envmapCanvas=document.createElement("canvas"),this.envmapTexture=new THREE.CanvasTexture(this.envmapCanvas),this.generateEnvmapTexture(),this.textureList.push(this.envmapTexture),this.fistsCanvas=document.createElement("canvas"),this.fistsTexture=new THREE.CanvasTexture(this.fistsCanvas),this.generateFistsTexture(),this.textureList.push(this.fistsTexture),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.createMaterials()}):this.createMaterials()},play:function(){this.setColorScheme()},tick:function(e,t){this.aurora.uniforms.time.value=e,this.home.animate&&(this.home.uniforms.time.value=e),this.leftFistWeapon.uniforms.time.value=e,this.leftWeapon.uniforms.time.value=e,this.rightFistWeapon.uniforms.time.value=e,this.rightWeapon.uniforms.time.value=e,this.rings.uniforms.time.value=e,this.tube.uniforms.time.value=e},createMaterials:function(){const e=this.scheme;this.tunnel=new THREE.ShaderMaterial({vertexShader:n(111),fragmentShader:n(112),uniforms:{fogColor:{value:new THREE.Color(e.primary)},color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},scale:{value:1}},transparent:!0}),this.merkaba=new THREE.MeshBasicMaterial({color:new THREE.Color(e.primary)}),this.backglow=new THREE.MeshBasicMaterial({transparent:!0,map:(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src),color:new THREE.Color(e.primary)}),this.textureList.push(this.backglow.map),this.aurora=new THREE.ShaderMaterial({vertexShader:n(113),fragmentShader:n(114),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},time:{value:0}},transparent:!0}),this.rings=new THREE.ShaderMaterial({vertexShader:n(115),fragmentShader:n(116),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},time:{value:0}},transparent:!0,depthWrite:!1}),this.moon=new THREE.ShaderMaterial({vertexShader:n(117),fragmentShader:n(118),uniforms:{map:{value:(new THREE.TextureLoader).load(document.getElementById("moonImg").src)},tint:{value:new THREE.Color(e.secondarybright)}},transparent:!0}),this.textureList.push(this.moon.uniforms.map.value),this.home=new THREE.ShaderMaterial({vertexShader:n(119),fragmentShader:n(120),uniforms:{color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},src:{value:(new THREE.TextureLoader).load(document.getElementById("homeShadowImg").src)},time:{value:0}},transparent:!0}),this.textureList.push(this.home.uniforms.src.value);const t=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src);t.wrapS=THREE.RepeatWrapping,t.wrapT=THREE.RepeatWrapping,t.repeat.set(2,2),t.magFilter=THREE.NearestFilter,this.textureList.push(t),this.rightWeapon=new THREE.ShaderMaterial({vertexShader:n(26),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftWeapon=new THREE.ShaderMaterial({vertexShader:n(26),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftFistWeapon=new THREE.ShaderMaterial({vertexShader:n(17),fragmentShader:n(28),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending}),this.rightFistWeapon=new THREE.ShaderMaterial({vertexShader:n(17),fragmentShader:n(28),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending});const i=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src),o=(new THREE.TextureLoader).load(document.getElementById("weaponHandleImg").src);i.mapping=THREE.SphericalReflectionMapping,this.textureList.push(i),this.textureList.push(o),this.leftWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.primary),map:o,envMap:i}),this.rightWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.secondary),map:o,envMap:i});const a=(new THREE.TextureLoader).load(document.getElementById("weapon2Img").src);a.mapping=THREE.SphericalReflectionMapping,this.leftFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:a,transparent:!0}),this.rightFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:a,transparent:!0}),this.beat=new THREE.MeshLambertMaterial({map:this.beatsTexture,transparent:!0}),this.blueBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.secondary,emissive:e.secondary,emissiveIntensity:.2}),this.redBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.primary,emissive:e.primary,emissiveIntensity:.2}),this.minePieces=new THREE.MeshLambertMaterial({color:e.tertiary,emissive:e.tertiary,emissiveIntensity:.2});const s=(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src);this.redBeatGlow=new THREE.MeshBasicMaterial({color:e.primary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.blueBeatGlow=new THREE.MeshBasicMaterial({color:e.secondary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.textureList.push(s),this.stars=new THREE.PointsMaterial({size:1,map:(new THREE.TextureLoader).load(document.getElementById("starImg").src),blending:THREE.AdditiveBlending,transparent:!0,color:new THREE.Color(e.secondary)}),this.textureList.push(this.stars.map);const c=(new THREE.TextureLoader).load(document.getElementById("sideglowImg").src);this.textureList.push(c),this.leftsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,side:THREE.BackSide,color:new THREE.Color(r.OFF)}),this.rightsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,color:new THREE.Color(r.OFF)});const l=(new THREE.TextureLoader).load(document.getElementById("plumeImg").src);l.minFilter=THREE.LinearFilter,this.arrowBluePlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.arrowRedPlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotBluePlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotRedPlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.minePlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.tertiary)},src:{value:l}},transparent:!0,depthTest:!1});const u=(new THREE.TextureLoader).load(document.getElementById("tubeImg").src),h=(new THREE.TextureLoader).load(document.getElementById("tubeColorImg").src);u.generateMipmaps=!1,u.minFilter=THREE.LinearFilter,h.generateMipmaps=!1,h.minFilter=THREE.LinearFilter,this.tube=new THREE.ShaderMaterial({vertexShader:n(121),fragmentShader:n(122),uniforms:{time:{value:0},opacity:{value:0},src:{value:u},color:{value:h}},transparent:!0,depthTest:!1,side:THREE.BackSide});const d=(new THREE.TextureLoader).load(document.getElementById("handStarTrailImg").src);d.generateMipmaps=!1,d.minFilter=THREE.LinearFilter,this.handStarTrail=new THREE.ShaderMaterial({vertexShader:n(123),fragmentShader:n(124),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},pulse:{value:0},src:{value:d}},transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,side:THREE.DoubleSide})},setColorScheme:function(e){this.el.sceneEl;const t=this.scheme=r.schemes[e]||r.schemes.default;o(this.arrowBluePlume,"color",t.secondary),o(this.arrowRedPlume,"color",t.primary),o(this.aurora,"colorPrimary",t.primary),o(this.aurora,"colorSecondary",t.secondary),o(this.backglow,"color",t.primary),o(this.blueBeatGlow,"color",t.secondary),o(this.blueBeatGlow,"color",t.secondary),o(this.blueBeatPieces,"color",t.secondary),o(this.blueBeatPieces,"emissive",t.secondary),o(this.dotBluePlume,"color",t.secondary),o(this.dotRedPlume,"color",t.primary),o(this.handStarTrail,"colorPrimary",t.primary),o(this.handStarTrail,"colorSecondary",t.secondary),o(this.handStarTrail,"colorTertiary",t.tertiary),o(this.home,"color1",t.primary),o(this.home,"color2",t.secondary),o(this.home,"color3",t.tertiary),o(this.leftFist,"color",t.primarybright),o(this.leftFistWeapon,"color",t.primary),o(this.leftWeapon,"color",t.primary),o(this.leftWeaponHandle,"color",t.primary),o(this.merkaba,"color",t.primary),o(this.minePieces,"color",t.tertiary),o(this.minePieces,"emissive",t.tertiary),o(this.minePlume,"color",t.tertiary),o(this.moon,"tint",t.secondarybright),o(this.redBeatGlow,"color",t.primary),o(this.redBeatGlow,"color",t.primary),o(this.redBeatPieces,"color",t.primary),o(this.redBeatPieces,"emissive",t.primary),o(this.rightFist,"color",t.secondarybright),o(this.rightWeapon,"color",t.secondary),o(this.rightFistWeapon,"color",t.secondary),o(this.rightWeaponHandle,"color",t.secondary),o(this.rings,"colorPrimary",t.primary),o(this.rings,"colorSecondary",t.secondary),o(this.rings,"colorTertiary",t.tertiary),o(this.stars,"color",t.secondary),o(this.tunnel,"fogColor",t.primary),o(this.tunnel,"color1",t.primary),o(this.tunnel,"color2",t.secondary),o(this.tunnel,"color3",t.tertiary),this.generateBeatsTexture(),this.generateEnvmapTexture(),this.generateFistsTexture(),document.querySelectorAll("a-entity[wall]").forEach(e=>{o(e.getObject3D("mesh").material,"colorTertiary",t.tertiary)}),this.panelMaterials.forEach(e=>{o(e,"colorPrimary",t.primary),o(e,"colorSecondary",t.secondary)}),o(this.curve,"fogColor",t.primary),o(this.curve,"color1",t.primary),o(this.curve,"color2",t.secondary)},generateBeatsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=new THREE.Color(e.tertiary),i=this.beatsCanvas,o=i.getContext("2d");i.width=512,i.height=32,a(o,r.getStyle(),0,0,128,6),a(o,"#000",128,0,128,6),a(o,n.getStyle(),256,0,128,6),a(o,t.getStyle(),384,0,105,6),a(o,"#FFF",489,0,23,6),s(o,"#000000",n.getStyle(),0,6,512,4),s(o,"#000",t.getStyle(),0,10,512,5),s(o,"#000",r.getStyle(),0,15,512,4),s(o,`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,n.getStyle(),0,19,512,5),s(o,`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,t.getStyle(),0,24,512,4),s(o,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`,r.getStyle(),0,28,512,4);const c=this.beatsTexture;return c.generateMipmaps=!1,c.magFilter=THREE.LinearFilter,c.minFilter=THREE.LinearFilter,c.needsUpdate=!0,c},generateFistsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primarybright),n=new THREE.Color(e.secondarybright),r=this.fistsCanvas,i=r.getContext("2d");return r.width=8,r.height=128,s(i,t.getStyle(),`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,0,0,4,128),s(i,n.getStyle(),`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,4,0,4,128),this.fistsTexture.needsUpdate=!0,this.fistsTexture},generateEnvmapTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=document.getElementById("envmapTemplateImg");r.addEventListener("load",()=>{const e=r.width,i=r.height,o=this.envmapCanvas;o.width=e,o.height=i;const a=o.getContext("2d");a.drawImage(r,0,0);const s=a.getImageData(0,0,e,i),c=s.data;let l,u;for(let e=0;e<c.length;e+=4)l=c[e],u=c[e+1],l*=1-u/255,c[e+0]=Math.floor(t.r*l+n.r*u),c[e+1]=Math.floor(t.g*l+n.g*u),c[e+2]=Math.floor(t.b*l+n.b*u),c[e+3]=255;a.putImageData(s,0,0),document.getElementById("envmapImg").src=o.toDataURL("image/png")})},registerCurve:function(e){this.curve=e},registerPanel:function(e){this.panelMaterials.push(e)}}),AFRAME.registerComponent("materials",{schema:{animate:{default:!0},name:{default:""},recursive:{default:!0}},update:function(){if(""===this.data.name)return;if(this.material=this.system[this.data.name],!this.material)return void console.warn("[materials] Unknown material: "+this.data.name);let e=this.el.getObject3D("mesh");e?this.applyMaterial(e):this.el.addEventListener("object3dset",t=>{"mesh"===t.detail.type&&(e=this.el.getObject3D("mesh"),e&&this.applyMaterial(e))}),this.material.animate=this.data.animate},applyMaterial:function(e){e.detail&&(e=e.detail.model),this.data.recursive?e.traverse(e=>{"Mesh"===e.type&&(e.material=this.material)}):e.material=this.material}}),AFRAME.registerComponent("materials-color-menu",{play:function(){this.text=document.getElementById("colorName")},events:{mouseenter:function(e){this.text.setAttribute("text","value",e.target.dataset.colorName)},mouseleave:function(e){this.text.setAttribute("text","value","")},click:function(e){this.el.sceneEl.systems.materials.setColorScheme(e.target.dataset.colorScheme),this.el.sceneEl.emit("colorschemechange",e.target.dataset.colorScheme,!1)}}}),window.AFRAME){const t=["materials","materials-color-menu"],n=[],r=["materials"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPos;\nvarying vec3 vPos;\nvarying vec3 vNormal;\n\nvoid main() {\n vNormal = normal;\n vPos = position;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="uniform sampler2D src;\nuniform float scale;\nvarying vec3 vPos;\nvarying vec3 vWorldPos;\nvarying vec3 vNormal;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\nuniform vec3 fogColor;\n\nvoid main() {\n vec3 pw = vWorldPos - cameraPosition;\n vec3 p = pw / scale;\n float pz = p.z * 0.3;\n\n // build color weights\n float f = clamp( (sin(p.x * 0.6 + pz ) + sin(p.y * 0.3 - pz)) * 0.3 + 0.17, 0.0, 1.0);\n float g = clamp( (sin(p.x * 0.7 + pz) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.1)) * 0.25 + 0.15, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.4 + pz + 3.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.3)) * 0.16 + 0.08, 0.0, 1.0);\n\n\n // mix colors using weights\n vec3 col = vec3(0.3);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n float fog = 1.0 - clamp(length(pw) / 180.0 - 0.1, 0.0, 1.0);\n\n // mix color with fog\n col = mix(fogColor, col, smoothstep(0.2, 0.9, fog));\n\n // calc shadow (using normal and fixed light pos + fade to black in y)\n float shadow = 0.5 + dot(vec3(0.0, 1.0, 1.0), vNormal) * 0.5;\n float shadowGrad = clamp((vPos.y + 2.0) / 6.0, 0.1, 1.0);\n // fade in fog\n shadow = mix(1.0, shadow, fog);\n shadowGrad = mix(1.0, shadowGrad, smoothstep(0.3, 1.0, fog));\n\n gl_FragColor = vec4(col * shadow * shadowGrad, smoothstep(0.3, 0.6, fog));\n //gl_FragColor = vec4(vec3(fog), 1.0);\n}"},function(e,t){e.exports="uniform float time;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n float t = time * 0.0005;\n vec3 pos = position;\n pos.y += sin(t + uv.x * 3.0 + pos.x * 0.01) * 20.0;\n pos.y += sin(-t * 1.3 + uv.x * 7.0 + pos.x * 0.008) * 10.0;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1.0 );\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nvarying vec2 uvs;\n\nvoid main() {\n vec3 col = vec3(1.0);\n float t = time * 0.001;\n col *= 0.80 + sin(-t * 3.4 + 5.5 + uvs.x * 6.0) * 0.1;\n col *= 0.80 + sin(t * 1.4 + 0.5 + uvs.x * 12.0) * 0.2;\n col *= 0.80 + sin(t * 1.0 + 0.2 + uvs.x * 30.0) * 0.2;\n col *= 0.90 + sin(-t * 1.6 + 5.2 + uvs.x * 43.0) * 0.1;\n col *= 0.95 + sin(-t * 0.3 + 1.2 + uvs.x * 50.0) * 0.05;\n col *= 0.95 + sin(t * 0.8 + 1.2 + uvs.x * 80.0) * 0.05;\n col *= 0.94 + sin(-t + 0.1 + uvs.x * 180.0) * 0.01;\n col *= 0.90 + sin(t * 2.49 + 0.1 + uvs.x * 120.0) * 0.01;\n col *= 0.86 + sin(-t * 1.7 + 4.7 + uvs.x * 80.0) * 0.03;\n col *= 0.86 + sin(-t * 1.2 + 0.7 + uvs.x * 180.0) * 0.02;\n\n // border fades\n float alpha = 1.0;\n alpha *= 1.0 - smoothstep(0.0, 1.0, uvs.y);\n alpha *= smoothstep(0.0, 0.3, uvs.y);\n alpha *= sin(uvs.x * 3.141592);\n\n // colorize\n col = col * mix(colorPrimary, colorSecondary, uvs.y);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nvarying vec2 uvs;\n#define PI 3.14159265358979\n\nfloat pulse(float x, float t, float r){\n return 1.0 - smoothstep(0.0, r, abs((x - t)));\n}\n\nvoid main() {\n float t = time * 0.002;\n vec2 uv = uvs - 0.5;\n uv = vec2(-uv.y, uv.x);\n float d = length(uv);\n float f = pulse(d, 0.44, 0.012);\n float f2 = pulse(d, 0.44, 0.002);\n\n float g = pulse(d, 0.20, 0.01);\n float g1 = pulse(d, 0.20, 0.0018);\n\n float g2 = pulse(d, 0.21, 0.01);\n float g3 = pulse(d, 0.21, 0.0018);\n\n float ang = abs(atan(uv.y, uv.x)) / PI;\n float angalpha = sin(ang * 20.0 - t * 0.1) * 0.4 + 0.6;\n\n float sparks = pulse(angalpha, 0.4, 0.17) * (pulse(d, 0.435, 0.035) + pulse(d, 0.205, 0.026)) * 0.14;\n sparks += pulse(angalpha, 0.4, 0.2) * (pulse(d, 0.44, 0.002) + pulse(d, 0.2, 0.0018)) * 0.4;\n sparks *= sin(ang * 14.0 + t) * 0.5 + 0.5;\n vec3 col = mix(colorPrimary, colorSecondary, ang);\n col = mix (col, colorPrimary, g3);\n col = mix (col, colorSecondary, g1);\n col = mix (col, colorTertiary, sparks * 2.4);\n gl_FragColor = vec4(col, ((f + g + g2) * 0.1 + (f2 + g1 + g3) * 0.4) * angalpha + sparks);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D map;\nuniform vec3 tint;\n\nvoid main() {\n vec4 tex = texture2D(map, uvs);\n vec3 col = mix(tex.rgb * tint, tex.rgb, uvs.y);\n gl_FragColor = vec4(col, tex.a );\n}\n"},function(e,t){e.exports="uniform float time;\nvarying vec3 vWorldPos;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n vec3 pos = vec3(position.x, position.y + sin(time * 0.002 - position.z) * 0.05 + 0.04, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 vWorldPos;\nuniform sampler2D src;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\n\nvoid main() {\n vec4 tex = texture2D(src, uvs);\n vec3 p = vWorldPos + cameraPosition;\n float pz = p.z * 0.36;\n float f = clamp( (sin(p.x + pz ) + sin(p.y - pz)) * 0.35 + 0.14, 0.0, 1.0);\n float g = clamp( (sin(p.x + pz + 2.0) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.5)) * 0.3 + 0.1, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.7 + pz + 2.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.8)) * 0.3 + 0.05, 0.0, 1.0);\n\n vec3 col = vec3(0.1);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n gl_FragColor = vec4((col * 1.5) * tex.r, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform float time;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform sampler2D color;\nuniform float time;\nuniform float opacity;\n\nvoid main() {\n vec2 uvanim = vec2(\n mod(uvs.x + sin(time / 20000.0), 1.0),\n mod(uvs.y + time / 2000.0, 1.0));\n vec4 texAlpha = texture2D(src, uvanim);\n float alpha = texAlpha.a * smoothstep(0.0, 0.5, uvs.y) * (1.0 - smoothstep(0.5, 1.0, uvs.y));\n gl_FragColor = vec4(texture2D(color, uvs).rgb, alpha * 0.7 * opacity);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\n\nvoid main() {\n uvs = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nuniform float pulse;\nuniform sampler2D src;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += vec3(pulse) * 0.1;\n gl_FragColor = vec4 (col, texture2D(src, uvs).a);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("menu-controls",{schema:{enabled:{default:!0}},events:{thumbdownstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchnextpage",null,!1)},thumbleftstart:function(){this.data.enabled&&this.el.sceneEl.emit("menuchallengeunselect",null,!1)},thumbupstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchprevpage",null,!1)}}}),window.AFRAME){const t=["menu-controls"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-difficulty-select",{init:function(){this.el.sceneEl.addEventListener("menuchallengeselect",()=>{this.el.object3D.visible=!1,setTimeout(()=>{this.el.components.layout.update(),this.el.object3D.visible=!0},150)})},events:{click:function(e){this.el.sceneEl.emit("menudifficultyselect",e.target.closest(".difficultyOption").dataset.difficulty,!1)}}}),window.AFRAME){const t=["menu-difficulty-select"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-genre",{init:function(){this.el.addEventListener("click",e=>{this.el.sceneEl.emit("genreselect",e.target.closest(".genre").dataset.bindForKey)})}}),window.AFRAME){const t=["menu-genre"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-midsection",{schema:{active:{default:!1},selectedChallenge:{default:""}},update:function(e){e.active&&!this.data.active&&this.el.emit("hidedifficultysection",null,!1),(!e.active&&this.data.active||this.data.selectedChallenge&&e.selectedChallenge!==this.data.selectedChallenge)&&this.el.emit("showdifficultysection",null,!1)}}),window.AFRAME){const t=["menu-midsection"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0),i={classicvr:-.6,punchvr:.87,ride2d:.87,ridevr:.15,viewer2d:.15},o={classicvr:"classic",punchvr:"punch",ride2d:"ride",ridevr:"ride",viewer2d:"viewer"};if(AFRAME.registerComponent("multiplayer-button",{init:function(){this.el.addEventListener("click",()=>{this.el.sceneEl.emit("mpopen",null,!1)})}}),AFRAME.registerComponent("multiplayer-join-button",{init:function(){this.el.addEventListener("click",()=>{const e=this.el.sceneEl;if(e.systems.state.state.inVR)return void e.emit("mpkeyboardopen",null,!1);const t=window.prompt("Enter 4-letter room code:");if(!t)return;const n=t.toUpperCase().trim().slice(0,4);e.emit("mpcodeinput",n,!1),e.emit("mpjoin",{code:n},!1)})}}),AFRAME.registerComponent("multiplayer-keyboard-bridge",{init:function(){const e=this.el.sceneEl;e.addEventListener("mpkeyboardsubmit",()=>{const t=(e.systems.state.state.multiplayer.joinCodeInput||"").toUpperCase().slice(0,4);e.emit("mpkeyboardclose",null,!1),4===t.length?e.emit("mpjoin",{code:t},!1):e.emit("mperror",{message:"Enter all 4 letters"},!1)}),e.addEventListener("mpnamekeyboardsubmit",()=>{const t=(e.systems.state.state.multiplayer.nameInput||"").trim().slice(0,14)||"Player";e.emit("mpnamekeyboardclose",null,!1),e.emit("mpsetname",{value:t},!1)})}}),AFRAME.registerComponent("multiplayer-name-button",{init:function(){this.el.addEventListener("click",()=>{const e=this.el.sceneEl;if(e.systems.state.state.inVR)return void e.emit("mpnamekeyboardopen",null,!1);const t=window.prompt("Your display name:",localStorage.getItem("threewsusername")||"Player");t&&e.emit("mpsetname",{value:t.trim().slice(0,14)},!1)})}}),AFRAME.registerComponent("multiplayer-ready-button",{init:function(){this.el.addEventListener("click",()=>{const e=this.el.sceneEl,t=e.systems.state.state,n=t.multiplayer.players.find(e=>e.uid===t.multiplayer.uid),r=!n||!n.ready;e.emit("mpready",{value:r},!1)})}}),AFRAME.registerComponent("menu-mode",{schema:{colorScheme:{default:"default"},hasVR:{default:!1}},init:function(){this.el.addEventListener("click",e=>{const t=e.target.closest("[data-mode]");if(!t)return;const n=t.dataset.mode,r=t.dataset.name;this.el.sceneEl.emit("gamemode",n,!1),localStorage.setItem("gameMode",r),this.setModeOption(r)})},update:function(){const e=localStorage.getItem("gameMode")||"punchvr";this.setModeOption(e),this.el.sceneEl.emit("gamemode",o[e])},setModeOption:function(e){const t=this.el.querySelectorAll(".modeItem");document.getElementById("modeIcon").object3D.position.y=i[e];for(let n=0;n<t.length;n++){const i=t[n],o=i.dataset.name===e;i.emit(o?"select":"deselect",null,!1);const a=i.querySelector(".modeBackground");a.emit(o?"select":"deselect",null,!1),a.setAttribute("mixin","modeBackgroundSelect"+(o?"":" modeBackgroundHover"));i.querySelector(".modeThumb").emit(o?"select":"deselect",null,!1);i.querySelector(".modeTitle").setAttribute("text","color",o?r.WHITE:r.schemes[this.data.colorScheme].secondary);i.querySelector(".modeInstructions").setAttribute("text","color",o?r.WHITE:r.schemes[this.data.colorScheme].primary)}}}),window.AFRAME){const t=["multiplayer-button","multiplayer-join-button","multiplayer-keyboard-bridge","multiplayer-name-button","multiplayer-ready-button","menu-mode"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist-button",{schema:{isFavorited:{default:!1},selectedChallenge:{default:""}},init:function(){const e=this.el;e.setAttribute("animation__scaleup",{property:"scale",from:"1 1 1",to:"1.2 1.2 1.2",dur:800,autoplay:!1,easing:"easeInOutElastic"}),e.setAttribute("animation__scaledown",{property:"scale",from:"1.2 1.2 1.2",to:"1 1 1",dur:100,autoplay:!1,easing:"easeInOutCubic"})},update:function(e){!e.isFavorited&&this.data.isFavorited&&e.selectedChallenge===this.data.selectedChallenge&&(this.el.object3D.position.z=.01,this.el.components.animation__scaleup.beginAnimation(),setTimeout(()=>{this.el.components.animation__scaledown.beginAnimation(),this.el.object3D.position.z=0},800))}}),window.AFRAME){const t=["menu-playlist-button"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist",{init:function(){this.eventDetail={id:"",title:""},this.el.addEventListener("click",e=>{const t=e.target.closest(".playlist");this.eventDetail.id=t.dataset.playlist,this.eventDetail.title=t.dataset.title,this.el.sceneEl.emit("playlistselect",this.eventDetail)})}}),window.AFRAME){const t=["menu-playlist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-selected-challenge-image",{schema:{coverURL:{type:"string"}},update:function(){this.el.setAttribute("material","src",this.data.coverURL)}}),window.AFRAME){const t=["menu-selected-challenge-image"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-slide-animation",{schema:{isSearching:{default:!1},menuSelectedChallengeId:{type:"string"}},init:function(){this.isLeft=!1},update:function(e){const t=this.data;if(this.isLeft)return!e.menuSelectedChallengeId||t.menuSelectedChallengeId||t.isSearching||this.rightMenu(),void(!e.isSearching||t.isSearching||t.menuSelectedChallengeId||this.rightMenu());this.isLeft||(!e.menuSelectedChallengeId&&t.menuSelectedChallengeId&&this.leftMenu(),!e.isSearching&&t.isSearching&&this.leftMenu())},rightMenu:function(){this.isLeft&&(this.el.components.animation__menuright.beginAnimation(),this.isLeft=!1)},leftMenu:function(){this.isLeft||(this.el.components.animation__menuleft.beginAnimation(),this.isLeft=!0)}}),window.AFRAME){const t=["menu-slide-animation"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const{MultiplayerClient:r}=n(135);if(AFRAME.registerComponent("multiplayer",{schema:{apiKey:{type:"string"},authDomain:{type:"string"},databaseURL:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"}},init:function(){this.client=null,this.lastRoom=null,this.pendingStartAt=null,this._scheduledFire=!1,this._lastCountdownLabel="",this._lastScoreTick=0,this.onCreate=this.onCreate.bind(this),this.onJoin=this.onJoin.bind(this),this.onLeave=this.onLeave.bind(this),this.onReady=this.onReady.bind(this),this.onSetName=this.onSetName.bind(this),this.onPlayButtonClick=this.onPlayButtonClick.bind(this),this.onBeatHit=this.onBeatHit.bind(this),this.onBeatMiss=this.onBeatMiss.bind(this),this.onSongComplete=this.onSongComplete.bind(this),this.onRematch=this.onRematch.bind(this),this.onRoomUpdate=this.onRoomUpdate.bind(this),this.onShareLink=this.onShareLink.bind(this);const e=this.el.sceneEl||this.el;e.addEventListener("mpcreate",this.onCreate),e.addEventListener("mpjoin",this.onJoin),e.addEventListener("mpleave",this.onLeave),e.addEventListener("mpready",this.onReady),e.addEventListener("mpsetname",this.onSetName),e.addEventListener("mprematch",this.onRematch),e.addEventListener("mpsharelink",this.onShareLink),e.addEventListener("beathit",this.onBeatHit),e.addEventListener("beatmiss",this.onBeatMiss),e.addEventListener("beatwrong",this.onBeatMiss),e.addEventListener("songcomplete",this.onSongComplete),e.addEventListener("playbuttonclick",this.onPlayButtonClick,!0);const t=AFRAME.utils.getUrlParameter("mpjoin");t&&setTimeout(()=>{e.emit("mpopen",null,!1),e.emit("mpjoin",{code:t},!1)},250)},_ensureClient:function(){return this.client?this.client:this.data.apiKey?(this.client=new r({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.client.onRoomUpdate(this.onRoomUpdate),this.client):(console.error("[multiplayer] Missing Firebase config"),null)},_name:function(){return localStorage.getItem("threewsusername")||"Player"},onCreate:async function(){const e=this._ensureClient();if(e){this.el.sceneEl.emit("mpconnecting",null,!1);try{const t=await e.createRoom(this._name());this.el.sceneEl.emit("mproomjoined",{code:t,isHost:!0},!1)}catch(e){console.error("[multiplayer] create failed",e),this.el.sceneEl.emit("mperror",{message:"Could not create room"},!1)}}},onJoin:async function(e){const t=this._ensureClient();if(!t)return;const n=e.detail&&e.detail.code||"";if(!n||n.length<4)this.el.sceneEl.emit("mperror",{message:"Enter a 4-letter room code"},!1);else{this.el.sceneEl.emit("mpconnecting",null,!1);try{await t.joinRoom(n,this._name()),this.el.sceneEl.emit("mproomjoined",{code:n.toUpperCase(),isHost:!1},!1)}catch(e){console.error("[multiplayer] join failed",e),this.el.sceneEl.emit("mperror",{message:e.message||"Join failed"},!1)}}},onLeave:async function(){this.client&&(await this.client.leaveRoom(),this.lastRoom=null,this.pendingStartAt=null,this.el.sceneEl.emit("mproomleft",null,!1))},onReady:function(e){this.client&&this.client.setReady(e.detail&&e.detail.value)},onSetName:function(e){if(!this.client)return;const t=e.detail&&(e.detail.value||e.detail)||this._name();localStorage.setItem("threewsusername",String(t).slice(0,20)),this.client.setName(t)},onRematch:async function(){this.client&&(this.pendingStartAt=null,await this.client.resetForRematch())},onShareLink:function(){if(!this.client||!this.client.roomCode)return;const e=window.location.origin+window.location.pathname+"?mpjoin="+this.client.roomCode,t=()=>{this.el.sceneEl.emit("mpsharelinkcopied",{url:e},!1),setTimeout(()=>this.el.sceneEl.emit("mpsharelinkcleared",null,!1),1500)};navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(t,()=>window.prompt("Share this link:",e)):(window.prompt("Share this link:",e),t())},onPlayButtonClick:function(e){if(this._scheduledFire)return;if(!this.client||!this.client.roomRef)return;const t=this.el.sceneEl.systems.state.state;if(!t.multiplayer||!t.multiplayer.active)return;if(!this.client.isHost)return e.stopImmediatePropagation(),void e.preventDefault();if(t.multiplayer.players.length<2)return e.stopImmediatePropagation(),e.preventDefault(),void this.el.sceneEl.emit("mperror",{message:"Need at least 2 players"},!1);e.stopImmediatePropagation(),e.preventDefault();const n=Object.assign({},t.menuSelectedChallenge);this.client.broadcastSong(n).then(()=>this.client.startSong(5e3)).catch(e=>{console.error("[multiplayer] host start failed",e),this.el.sceneEl.emit("mperror",{message:"Failed to start song"},!1)})},onBeatHit:function(){this._maybePushScore()},onBeatMiss:function(){this._maybePushScore()},_maybePushScore:function(){if(!this.client||!this.client.roomRef)return;const e=performance.now();if(e-this._lastScoreTick<250)return;this._lastScoreTick=e;const t=this.el.sceneEl.systems.state.state;this.client.pushScore(t.score)},onSongComplete:function(){if(!this.client||!this.client.roomRef)return;const e=this.el.sceneEl.systems.state.state;this.client.pushFinal(e.score)},onRoomUpdate:function(e){if(!e)return this.pendingStartAt=null,void this.el.sceneEl.emit("mproomleft",null,!1);const t=this.el.sceneEl,n=this.client.uid,r=Object.keys(e.players||{}).map(t=>({uid:t,...e.players[t]})).sort((e,t)=>(e.joinedAt||0)-(t.joinedAt||0));if(t.emit("mproomupdate",{code:this.client.roomCode,isHost:e.host===n,hostUid:e.host,uid:n,status:e.status,song:e.song,startAt:e.startAt,players:r},!1),!this.client.isHost&&e.song&&e.song.id){const n=this.lastRoom&&this.lastRoom.song&&this.lastRoom.song.id;e.song.id!==n&&t.emit("mpremotesongselect",e.song,!1)}if("playing"===e.status&&e.startAt){const t=this.lastRoom&&this.lastRoom.startAt;e.startAt!==t&&(this.pendingStartAt=e.startAt)}"lobby"===e.status&&(this.pendingStartAt=null),this.lastRoom=e},tick:function(){if(this.client&&this.pendingStartAt){const e=this.pendingStartAt-this.client.serverNow(),t=Math.max(0,Math.ceil(e/1e3)),n=t>0?"STARTING IN "+t:"GO!";if(n!==this._lastCountdownLabel&&(this._lastCountdownLabel=n,this.el.sceneEl.emit("mpcountdown",{value:n,secs:t,active:!0},!1)),e<=0){const e=this.pendingStartAt;this.pendingStartAt=null,this._fireLocalStart(),setTimeout(()=>{this.el.sceneEl.emit("mpcountdown",{value:"",secs:0,active:!1},!1),this._lastCountdownLabel=""},600),this._lastFiredStartAt=e}}},_fireLocalStart:function(){const e=this.el.sceneEl.systems.state.state;if(this.client.isHost){this._scheduledFire=!0;try{this.el.sceneEl.emit("playbuttonclick",null,!1)}finally{this._scheduledFire=!1}}else{if(!e.menuSelectedChallenge.id)return void console.warn("[multiplayer] non-host fire without song selected");this.el.sceneEl.emit("mpremoteplaystart",null,!1)}}}),window.AFRAME){const t=["multiplayer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(25);n(136);function i(){let e="";for(let t=0;t<4;t++)e+="ABCDEFGHJKLMNPQRSTUVWXYZ23456789"[Math.floor(Math.random()*"ABCDEFGHJKLMNPQRSTUVWXYZ23456789".length)];return e}e.exports={MultiplayerClient:class{constructor(e){r.apps.length||r.initializeApp(e),this.db=r.database(),this.uid=function(){const e=localStorage.getItem("threewsmpuid");if(e)return e;const t="u_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36);return localStorage.setItem("threewsmpuid",t),t}(),this.roomCode=null,this.roomRef=null,this.playerRef=null,this.isHost=!1,this.lastScoreWrite=0,this._roomListener=null,this._onRoomUpdate=null,this._serverOffset=0,this.db.ref(".info/serverTimeOffset").on("value",e=>{this._serverOffset=e.val()||0})}serverNow(){return Date.now()+this._serverOffset}async createRoom(e){for(let t=0;t<5;t++){const t=i(),n=this.db.ref("rooms/"+t);if((await n.once("value")).exists())continue;const o={host:this.uid,createdAt:r.database.ServerValue.TIMESTAMP,status:"lobby",song:null,startAt:null,players:{[this.uid]:this._initialPlayer(e)}};return await n.set(o),this._attach(t,!0),t}throw new Error("Could not generate unique room code")}async joinRoom(e,t){if(!(e=(e||"").toUpperCase().trim()))throw new Error("Room code required");const n=this.db.ref("rooms/"+e);if(!(await n.once("value")).exists())throw new Error("Room not found");return await n.child("players/"+this.uid).set(this._initialPlayer(t)),this._attach(e,!1),e}_initialPlayer(e){return{name:(e||"Player").slice(0,20),joinedAt:r.database.ServerValue.TIMESTAMP,ready:!1,score:0,combo:0,maxCombo:0,accuracy:100,beatsHit:0,beatsMissed:0,finished:!1,rank:"",finalScore:0}}_attach(e,t){this.roomCode=e,this.isHost=t,this.roomRef=this.db.ref("rooms/"+e),this.playerRef=this.roomRef.child("players/"+this.uid),this.playerRef.onDisconnect().remove(),this._roomListener=e=>{const t=e.val();this._onRoomUpdate&&this._onRoomUpdate(t)},this.roomRef.on("value",this._roomListener)}onRoomUpdate(e){this._onRoomUpdate=e}async leaveRoom(){if(this.roomRef){try{this.roomRef.off("value",this._roomListener),await this.playerRef.onDisconnect().cancel(),await this.playerRef.remove();const e=await this.roomRef.child("players").once("value");if(e.exists()){if(this.isHost){const t=Object.keys(e.val())[0];await this.roomRef.child("host").set(t)}}else await this.roomRef.remove()}catch(e){}this.roomCode=null,this.roomRef=null,this.playerRef=null,this.isHost=!1}}async setReady(e){this.playerRef&&await this.playerRef.child("ready").set(!!e)}async setName(e){this.playerRef&&await this.playerRef.child("name").set((e||"Player").slice(0,20))}async broadcastSong(e){if(!this.isHost||!this.roomRef)return;const t={id:e.id||"",difficulty:e.difficulty||"",beatmapCharacteristic:e.beatmapCharacteristic||"",difficultyId:e.difficultyId||"",songName:e.songName||"",songSubName:e.songSubName||"",image:e.image||e.coverURL||"",version:e.version||"",directDownload:e.directDownload||"",downloads:e.downloads||"",downloadsText:e.downloadsText||"",songDuration:e.songDuration||0,metadata:e.metadata||{}};await this.roomRef.update({song:t});const n=(await this.roomRef.child("players").once("value")).val()||{},r={};Object.keys(n).forEach(e=>{r["players/"+e+"/ready"]=!1,r["players/"+e+"/finished"]=!1,r["players/"+e+"/score"]=0,r["players/"+e+"/finalScore"]=0,r["players/"+e+"/combo"]=0,r["players/"+e+"/maxCombo"]=0,r["players/"+e+"/accuracy"]=100,r["players/"+e+"/beatsHit"]=0,r["players/"+e+"/beatsMissed"]=0,r["players/"+e+"/rank"]=""}),await this.roomRef.update(r)}async startSong(e){if(!this.isHost||!this.roomRef)return;const t=this.serverNow()+("number"==typeof e?e:5e3);return await this.roomRef.update({status:"playing",startAt:t}),t}pushScore(e){if(!this.playerRef)return;const t=Date.now();t-this.lastScoreWrite<250||(this.lastScoreWrite=t,this.playerRef.update({score:0|e.score,combo:0|e.combo,maxCombo:0|e.maxCombo,accuracy:parseFloat(e.accuracy)||0,beatsHit:0|e.beatsHit,beatsMissed:0|e.beatsMissed}))}async pushFinal(e){this.playerRef&&(await this.playerRef.update({finished:!0,finalScore:0|e.score,score:0|e.score,maxCombo:0|e.maxCombo,accuracy:parseFloat(e.accuracy)||0,beatsHit:0|e.beatsHit,beatsMissed:0|e.beatsMissed,rank:e.rank||""}),this.isHost&&this.roomRef&&this.roomRef.update({status:"finished"}))}async resetForRematch(){this.isHost&&this.roomRef&&await this.roomRef.update({status:"lobby",startAt:null})}},START_DELAY_MS:5e3}},function(e,t,n){"use strict";n.r(t);n(137)},function(e,t,n){"use strict";(function(r){Object.defineProperty(t,"__esModule",{value:!0});var i,o,a=(i=n(18))&&"object"==typeof i&&"default"in i?i.default:i,s=n(7),c=n(12),l=n(20),u=n(19),h=function(){function e(e){this.domStorage_=e,this.prefix_="firebase:"}return e.prototype.set=function(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),c.stringify(t))},e.prototype.get=function(e){var t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:c.jsonEval(t)},e.prototype.remove=function(e){this.domStorage_.removeItem(this.prefixedName_(e))},e.prototype.prefixedName_=function(e){return this.prefix_+e},e.prototype.toString=function(){return this.domStorage_.toString()},e}(),d=function(){function e(){this.cache_={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t},e.prototype.get=function(e){return c.contains(this.cache_,e)?this.cache_[e]:null},e.prototype.remove=function(e){delete this.cache_[e]},e}(),p=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new h(t)}}catch(e){}return new d},f=p("localStorage"),m=p("sessionStorage"),g=new l.Logger("@firebase/database"),y=(o=1,function(){return o++}),v=function(e){var t=c.stringToByteArray(e),n=new c.Sha1;n.update(t);var r=n.digest();return c.base64.encodeByteArray(r)},b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n="",r=0;r<e.length;r++){var i=e[r];Array.isArray(i)||i&&"object"==typeof i&&"number"==typeof i.length?n+=b.apply(null,i):n+="object"==typeof i?c.stringify(i):i,n+=" "}return n},_=null,w=!0,E=function(e,t){c.assert(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(g.logLevel=l.LogLevel.VERBOSE,_=g.log.bind(g),t&&m.set("logging_enabled",!0)):"function"==typeof e?_=e:(_=null,m.remove("logging_enabled"))},A=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!0===w&&(w=!1,null===_&&!0===m.get("logging_enabled")&&E(!0)),_){var n=b.apply(null,e);_(n)}},x=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];A.apply(void 0,s.__spread([e],t))}},S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE INTERNAL ERROR: "+b.apply(void 0,s.__spread(e));g.error(n)},T=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE FATAL ERROR: "+b.apply(void 0,s.__spread(e));throw g.error(n),new Error(n)},M=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE WARNING: "+b.apply(void 0,s.__spread(e));g.warn(n)},R=function(e){return"number"==typeof e&&(e!=e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},C="[MIN_NAME]",k="[MAX_NAME]",I=function(e,t){if(e===t)return 0;if(e===C||t===k)return-1;if(t===C||e===k)return 1;var n=U(e),r=U(t);return null!==n?null!==r?n-r==0?e.length-t.length:n-r:-1:null!==r?1:e<t?-1:1},P=function(e,t){return e===t?0:e<t?-1:1},O=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+c.stringify(t))},N=function(e){if("object"!=typeof e||null===e)return c.stringify(e);var t=[];for(var n in e)t.push(n);t.sort();for(var r="{",i=0;i<t.length;i++)0!==i&&(r+=","),r+=c.stringify(t[i]),r+=":",r+=N(e[t[i]]);return r+="}"},D=function(e,t){var n=e.length;if(n<=t)return[e];for(var r=[],i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function L(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}var F=function(e){c.assert(!R(e),"Invalid JSON number");var t,n,r,i,o;0===e?(n=0,r=0,t=1/e==-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,r=Math.round(e*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(e/Math.pow(2,-1074))));var a=[];for(o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(t?1:0),a.reverse();var s=a.join(""),l="";for(o=0;o<64;o+=8){var u=parseInt(s.substr(o,8),2).toString(16);1===u.length&&(u="0"+u),l+=u}return l.toLowerCase()},j=new RegExp("^-?(0*)\\d{1,10}$"),U=function(e){if(j.test(e)){var t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},B=function(e){try{e()}catch(e){setTimeout((function(){var t=e.stack||"";throw M("Exception was thrown by user callback.",t),e}),Math.floor(0))}},V=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n},H=function(){function e(e,t){if(void 0===t){this.pieces_=e.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!1,configurable:!0}),e.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},e.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},e.prototype.popFront=function(){var t=this.pieceNum_;return t<this.pieces_.length&&t++,new e(this.pieces_,t)},e.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"},e.prototype.toUrlEncodedString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+encodeURIComponent(String(this.pieces_[t])));return e||"/"},e.prototype.slice=function(e){return void 0===e&&(e=0),this.pieces_.slice(this.pieceNum_+e)},e.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var t=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)t.push(this.pieces_[n]);return new e(t,0)},e.prototype.child=function(t){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(t instanceof e)for(r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);else{var i=t.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new e(n,0)},e.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},e.relativePath=function(t,n){var r=t.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return e.relativePath(t.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),r=t.slice(),i=0;i<n.length&&i<r.length;i++){var o=I(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},e.prototype.equals=function(e){if(this.getLength()!==e.getLength())return!1;for(var t=this.pieceNum_,n=e.pieceNum_;t<=this.pieces_.length;t++,n++)if(this.pieces_[t]!==e.pieces_[n])return!1;return!0},e.prototype.contains=function(e){var t=this.pieceNum_,n=e.pieceNum_;if(this.getLength()>e.getLength())return!1;for(;t<this.pieces_.length;){if(this.pieces_[t]!==e.pieces_[n])return!1;++t,++n}return!0},e}(),z=function(){function e(e,t){this.errorPrefix_=t,this.parts_=e.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=c.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(e,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!1,configurable:!0}),Object.defineProperty(e,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!1,configurable:!0}),e.prototype.push=function(e){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(e),this.byteLength_+=c.stringLength(e),this.checkValid_()},e.prototype.pop=function(){var e=this.parts_.pop();this.byteLength_-=c.stringLength(e),this.parts_.length>0&&(this.byteLength_-=1)},e.prototype.checkValid_=function(){if(this.byteLength_>e.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>e.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},e}(),q=function(){function e(e,t,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o=!1),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.includeNamespaceInQueryParams=o,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=f.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()||this.includeNamespaceInQueryParams},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&f.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){var n;if(c.assert("string"==typeof e,"typeof type must == string"),c.assert("object"==typeof t,"typeof params must == object"),"websocket"===e)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if("long_polling"!==e)throw new Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var r=[];return L(t,(function(e,t){r.push(e+"="+t)})),n+r.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();var G,W,J,Z,X,Y=function(e){var t=Q(e),n=t.namespace;"firebase.com"===t.domain&&T(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!==n||"localhost"===t.domain||T("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&M("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===t.scheme||"wss"===t.scheme;return{repoInfo:new q(t.host,t.secure,n,r,"",n!==t.subdomain),path:new H(t.pathString)}},Q=function(e){var t="",n="",r="",i="",o="",a=!0,c="https",l=443;if("string"==typeof e){var u=e.indexOf("//");u>=0&&(c=e.substring(0,u-1),e=e.substring(u+2));var h=e.indexOf("/");-1===h&&(h=e.length);var d=e.indexOf("?");-1===d&&(d=e.length),t=e.substring(0,Math.min(h,d)),h<d&&(i=+var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var o,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=s||{},c=a||self;function l(){}function u(e){var t=typeof e;return"object"!=t?t:e?Array.isArray(e)?"array":t:"null"}function h(e){var t=u(e);return"array"==t||"object"==t&&"number"==typeof e.length}function d(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),f=0;function m(e,t,n){return e.call.apply(e.bind,arguments)}function g(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function y(e,t,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:g).apply(null,arguments)}function v(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var b=Date.now;function _(e,t){function n(){}n.prototype=t.prototype,e.S=t.prototype,e.prototype=new n,e.prototype.constructor=e}function w(){this.j=this.j,this.i=this.i}w.prototype.j=!1,w.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0))(function(e){Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++f)})(this)},w.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var E=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},A=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i="string"==typeof e?e.split(""):e,o=0;o<r;o++)o in i&&t.call(n,i[o],o,e)};function x(e){return Array.prototype.concat.apply([],arguments)}function S(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function T(e){return/^[\s\xa0]*$/.test(e)}var M,R=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function C(e,t){return-1!=e.indexOf(t)}function k(e,t){return e<t?-1:e>t?1:0}e:{var I=c.navigator;if(I){var P=I.userAgent;if(P){M=P;break e}}M=""}function O(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function N(e){var t={};for(var n in e)t[n]=e[n];return t}var D="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function L(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var o=0;o<D.length;o++)n=D[o],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function F(e){return F[" "](e),e}F[" "]=l;var j,U,B=C(M,"Opera"),V=C(M,"Trident")||C(M,"MSIE"),H=C(M,"Edge"),z=H||V,q=C(M,"Gecko")&&!(C(M.toLowerCase(),"webkit")&&!C(M,"Edge"))&&!(C(M,"Trident")||C(M,"MSIE"))&&!C(M,"Edge"),G=C(M.toLowerCase(),"webkit")&&!C(M,"Edge");function W(){var e=c.document;return e?e.documentMode:void 0}e:{var J="",Z=(U=M,q?/rv:([^\);]+)(\)|;)/.exec(U):H?/Edge\/([\d\.]+)/.exec(U):V?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(U):G?/WebKit\/(\S+)/.exec(U):B?/(?:Version)[ \/]?(\S+)/.exec(U):void 0);if(Z&&(J=Z?Z[1]:""),V){var Y=W();if(null!=Y&&Y>parseFloat(J)){j=String(Y);break e}}j=J}var X,Q={};function K(e){return function(e,t){var n=Q;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=R(String(j)).split("."),r=R(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;t=k(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||k(0==a[2].length,0==s[2].length)||k(a[2],s[2]),a=a[3],s=s[3]}while(0==t)}return 0<=t}))}if(c.document&&V){var $=W();X=$||(parseInt(j,10)||void 0)}else X=void 0;var ee=X,te=!V||9<=Number(ee),ne=V&&!K("9"),re=function(){if(!c.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{c.addEventListener("test",l,t),c.removeEventListener("test",l,t)}catch(e){}return e}();function ie(e,t){this.type=e,this.a=this.target=t,this.defaultPrevented=!1}function oe(e,t){if(ie.call(this,e?e.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.a=t,t=e.relatedTarget){if(q){e:{try{F(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:ae[e.pointerType]||"",this.c=e,e.defaultPrevented&&this.b()}}ie.prototype.b=function(){this.defaultPrevented=!0},_(oe,ie);var ae={2:"touch",3:"pen",4:"mouse"};oe.prototype.b=function(){oe.S.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,ne)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var se="closure_listenable_"+(1e6*Math.random()|0),ce=0;function le(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ce,this.Y=this.Z=!1}function ue(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function he(e){this.src=e,this.a={},this.b=0}function de(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],o=E(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ue(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function pe(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i];if(!o.Y&&o.listener==t&&o.capture==!!n&&o.ca==r)return i}return-1}he.prototype.add=function(e,t,n,r,i){var o=e.toString();(e=this.a[o])||(e=this.a[o]=[],this.b++);var a=pe(e,t,r,i);return-1<a?(t=e[a],n||(t.Z=!1)):((t=new le(t,this.src,o,!!r,i)).Z=n,e.push(t)),t};var fe="closure_lm_"+(1e6*Math.random()|0),me={};function ge(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,o){if(Array.isArray(n)){for(var a=0;a<n.length;a++)e(t,n[a],r,i,o);return null}return r=xe(r),t&&t[se]?t.wa(n,r,d(i)?!!i.capture:!!i,o):ye(t,n,r,!0,i,o)}(e,t,n,r,i);if(Array.isArray(t)){for(var o=0;o<t.length;o++)ge(e,t[o],n,r,i);return null}return n=xe(n),e&&e[se]?e.va(t,n,d(r)?!!r.capture:!!r,i):ye(e,t,n,!1,r,i)}function ye(e,t,n,r,i,o){if(!t)throw Error("Invalid event type");var a=d(i)?!!i.capture:!!i;if(a&&!te)return null;var s=Ee(e);if(s||(e[fe]=s=new he(e)),(n=s.add(t,n,r,a,o)).proxy)return n;if(r=function(){var e=we,t=te?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)re||(i=a),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(be(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ve(e){if("number"!=typeof e&&e&&!e.Y){var t=e.src;if(t&&t[se])de(t.c,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(be(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=Ee(t))?(de(n,e),0==n.b&&(n.src=null,t[fe]=null)):ue(e)}}}function be(e){return e in me?me[e]:me[e]="on"+e}function _e(e,t){var n=e.listener,r=e.ca||e.src;return e.Z&&ve(e),n.call(r,t)}function we(e,t){if(e.Y)return!0;if(!te){if(!t)e:{t=["window","event"];for(var n=c,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return _e(e,t=new oe(t,this))}return _e(e,new oe(t,this))}function Ee(e){return(e=e[fe])instanceof he?e:null}var Ae="__closure_events_fn_"+(1e9*Math.random()>>>0);function xe(e){return"function"==u(e)?e:(e[Ae]||(e[Ae]=function(t){return e.handleEvent(t)}),e[Ae])}function Se(){w.call(this),this.c=new he(this),this.J=this,this.C=null}function Te(e,t,n,r){if(!(t=e.c.a[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;o<t.length;++o){var a=t[o];if(a&&!a.Y&&a.capture==n){var s=a.listener,c=a.ca||a.src;a.Z&&de(e.c,a),i=!1!==s.call(c,r)&&i}}return i&&!r.defaultPrevented}_(Se,w),Se.prototype[se]=!0,(o=Se.prototype).addEventListener=function(e,t,n,r){ge(this,e,t,n,r)},o.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,o){if(Array.isArray(n))for(var a=0;a<n.length;a++)e(t,n[a],r,i,o);else i=d(i)?!!i.capture:!!i,r=xe(r),t&&t[se]?(t=t.c,(n=String(n).toString())in t.a&&(-1<(r=pe(a=t.a[n],r,i,o))&&(ue(a[r]),Array.prototype.splice.call(a,r,1),0==a.length&&(delete t.a[n],t.b--)))):t&&(t=Ee(t))&&(n=t.a[n.toString()],t=-1,n&&(t=pe(n,r,i,o)),(r=-1<t?n[t]:null)&&ve(r))}(this,e,t,n,r)},o.dispatchEvent=function(e){var t,n=this.C;if(n)for(t=[];n;n=n.C)t.push(n);n=this.J;var r=e.type||e;if("string"==typeof e)e=new ie(e,n);else if(e instanceof ie)e.target=e.target||n;else{var i=e;L(e=new ie(r,n),i)}if(i=!0,t)for(var o=t.length-1;0<=o;o--){var a=e.a=t[o];i=Te(a,r,!0,e)&&i}if(i=Te(a=e.a=n,r,!0,e)&&i,i=Te(a,r,!1,e)&&i,t)for(o=0;o<t.length;o++)i=Te(a=e.a=t[o],r,!1,e)&&i;return i},o.G=function(){if(Se.S.G.call(this),this.c){var e,t=this.c;for(e in t.a){for(var n=t.a[e],r=0;r<n.length;r++)ue(n[r]);delete t.a[e],t.b--}}this.C=null},o.va=function(e,t,n,r){return this.c.add(String(e),t,!1,n,r)},o.wa=function(e,t,n,r){return this.c.add(String(e),t,!0,n,r)};var Me=c.JSON.stringify;function Re(){this.b=this.a=null}var Ce,ke=new(function(){function e(e,t,n){this.f=n,this.c=e,this.g=t,this.b=0,this.a=null}return e.prototype.get=function(){var e;return 0<this.b?(this.b--,e=this.a,this.a=e.next,e.next=null):e=this.c(),e},e}())((function(){return new Pe}),(function(e){e.reset()}),100);function Ie(){var e=Le,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function Pe(){this.next=this.b=this.a=null}function Oe(e){c.setTimeout((function(){throw e}),0)}function Ne(e,t){Ce||function(){var e=c.Promise.resolve(void 0);Ce=function(){e.then(Fe)}}(),De||(Ce(),De=!0),Le.add(e,t)}Re.prototype.add=function(e,t){var n=ke.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},Pe.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},Pe.prototype.reset=function(){this.next=this.b=this.a=null};var De=!1,Le=new Re;function Fe(){for(var e;e=Ie();){try{e.a.call(e.b)}catch(e){Oe(e)}var t=ke;t.g(e),t.b<t.f&&(t.b++,e.next=t.a,t.a=e)}De=!1}function je(e,t){Se.call(this),this.b=e||1,this.a=t||c,this.f=y(this.Ya,this),this.g=b()}function Ue(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Be(e,t,n){if("function"==u(e))n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647<Number(t)?-1:c.setTimeout(e,t||0)}function Ve(e){e.a=Be((function(){e.a=null,e.c&&(e.c=!1,Ve(e))}),e.h);var t=e.b;e.b=null,e.g.apply(null,t)}_(je,Se),(o=je.prototype).aa=!1,o.M=null,o.Ya=function(){if(this.aa){var e=b()-this.g;0<e&&e<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-e):(this.M&&(this.a.clearTimeout(this.M),this.M=null),this.dispatchEvent("tick"),this.aa&&(Ue(this),this.start()))}},o.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=b())},o.G=function(){je.S.G.call(this),Ue(this),delete this.a};var He=function(e){function t(t,n,r){var i=e.call(this)||this;return i.g=null!=r?t.bind(r):t,i.h=n,i.b=null,i.c=!1,i.a=null,i}return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.f=function(e){this.b=arguments,this.a?this.c=!0:Ve(this)},t.prototype.G=function(){e.prototype.G.call(this),this.a&&(c.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},t}(w);function ze(e){w.call(this),this.b=e,this.a={}}_(ze,w);var qe=[];function Ge(e,t,n,r){Array.isArray(n)||(n&&(qe[0]=n.toString()),n=qe);for(var i=0;i<n.length;i++){var o=ge(t,n[i],r||e.handleEvent,!1,e.b||e);if(!o)break;e.a[o.key]=o}}function We(e){O(e.a,(function(e,t){this.a.hasOwnProperty(t)&&ve(e)}),e),e.a={}}function Je(){this.a=!0}function Ze(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.a)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;a<i.length;a++)i[a]=""}}}return Me(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}ze.prototype.G=function(){ze.S.G.call(this),We(this)},ze.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Je.prototype.info=function(){};var Ye=null;function Xe(){return Ye=Ye||new Se}function Qe(e){ie.call(this,"serverreachability",e)}function Ke(e){var t=Xe();t.dispatchEvent(new Qe(t,e))}function $e(e){ie.call(this,"statevent",e)}function et(e){var t=Xe();t.dispatchEvent(new $e(t,e))}function tt(e){ie.call(this,"timingevent",e)}function nt(e,t){if("function"!=u(e))throw Error("Fn must not be null and must be a function");return c.setTimeout((function(){e()}),t)}_(Qe,ie),_($e,ie),_(tt,ie);var rt={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},it={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function ot(){}function at(e){var t;return(t=e.a)||(t=e.a={}),t}function st(){}ot.prototype.a=null;var ct,lt={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function ut(){ie.call(this,"d")}function ht(){ie.call(this,"c")}function dt(){}function pt(e,t,n,r){this.g=e,this.c=t,this.f=n,this.T=r||1,this.J=new ze(this),this.P=ft,e=z?125:void 0,this.R=new je(e),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.U=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.W=this.C=this.V=this.I=!1}_(ut,ie),_(ht,ie),_(dt,ot),ct=new dt;var ft=45e3,mt={},gt={};function yt(e,t,n){e.H=1,e.i=Ut(Ot(t)),e.j=n,e.I=!0,vt(e,null)}function vt(e,t){e.u=b(),wt(e),e.l=Ot(e.i);var n=e.l,r=e.T;Array.isArray(r)||(r=[String(r)]),Kt(n.b,"t",r),e.D=0,e.a=Jn(e.g,e.g.C?t:null),0<e.O&&(e.F=new He(y(e.Ca,e,e.a),e.O)),Ge(e.J,e.a,"readystatechange",e.Wa),t=e.B?N(e.B):{},e.j?(e.m||(e.m="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.ba(e.l,e.m,e.j,t)):(e.m="GET",e.a.ba(e.l,e.m,null,t)),Ke(1),function(e,t,n,r,i,o){e.info((function(){if(e.a)if(o)for(var a="",s=o.split("&"),c=0;c<s.length;c++){var l=s[c].split("=");if(1<l.length){var u=l[0];l=l[1];var h=u.split("_");a=2<=h.length&&"type"==h[1]?a+(u+"=")+l+"&":a+(u+"=redacted&")}}else a=null;else a=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+a}))}(e.c,e.m,e.l,e.f,e.T,e.j)}function bt(e,t,n){for(var r=!0;!e.A&&e.D<n.length;){var i=_t(e,n);if(i==gt){4==t&&(e.h=4,et(14),r=!1),Ze(e.c,e.f,null,"[Incomplete Response]");break}if(i==mt){e.h=4,et(15),Ze(e.c,e.f,n,"[Invalid Chunk]"),r=!1;break}Ze(e.c,e.f,i,null),Tt(e,i)}4==t&&0==n.length&&(e.h=1,et(16),r=!1),e.b=e.b&&r,r?0<n.length&&!e.W&&(e.W=!0,(t=e.g).a==e&&t.V&&!t.F&&(t.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Un(t),t.F=!0)):(Ze(e.c,e.f,n,"[Invalid Chunked Response]"),St(e),xt(e))}function _t(e,t){var n=e.D,r=t.indexOf("\n",n);return-1==r?gt:(n=Number(t.substring(n,r)),isNaN(n)?mt:(r+=1)+n>t.length?gt:(t=t.substr(r,n),e.D=r+n,t))}function wt(e){e.U=b()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=nt(y(e.Ua,e),t)}function At(e){e.o&&(c.clearTimeout(e.o),e.o=null)}function xt(e){0==e.g.v||e.A||Hn(e.g,e)}function St(e){At(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Ue(e.R),We(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Tt(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||an(n.b,e)))if(n.I=e.N,!e.C&&an(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3<e.u))break e;Vn(n),kn(n)}jn(n),et(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=nt(y(n.Ra,n),6e3));if(1>=on(n.b)&&n.ea){try{n.ea()}catch(e){}n.ea=void 0}}else qn(n,11)}else if((e.C||n.a==e)&&Vn(n),!T(t))for(t=r=n.ka.a.parse(t),r=0;r<t.length;r++)if(i=t[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var o=i[3];null!=o&&(n.ha=o,n.c.info("VER="+n.ha));var a=i[4];null!=a&&(n.pa=a,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"==typeof s&&0<s){var c=1.5*s;n.D=c,n.c.info("backChannelRequestTimeoutMs_="+c)}c=n;var l=e.a;if(l){var u=l.a?l.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var h=c.b;!h.a&&(C(u,"spdy")||C(u,"quic")||C(u,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(sn(h,h.b),h.b=null))}if(c.A){var d=l.a?l.a.getResponseHeader("X-HTTP-Session-Id"):null;d&&(c.na=d,jt(c.B,c.A,d))}}n.v=3,n.f&&n.f.ta(),n.V&&(n.N=b()-e.u,n.c.info("Handshake RTT: "+n.N+"ms"));var p=e;if((c=n).la=Wn(c,c.C?c.ga:null,c.fa),p.C){cn(c.b,p);var f=p,m=c.D;m&&f.setTimeout(m),f.o&&(At(f),wt(f)),c.a=p}else Fn(c);0<n.g.length&&On(n)}else"stop"!=i[0]&&"close"!=i[0]||qn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?qn(n,7):Cn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);Ke(4)}catch(e){}}function Mt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(h(e)||"string"==typeof e)A(e,t,void 0);else{if(e.L&&"function"==typeof e.L)var n=e.L();else if(e.K&&"function"==typeof e.K)n=void 0;else if(h(e)||"string"==typeof e){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;i=(r=function(e){if(e.K&&"function"==typeof e.K)return e.K();if("string"==typeof e)return e.split("");if(h(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e)).length;for(var o=0;o<i;o++)t.call(void 0,r[o],n&&n[o],e)}}function Rt(e,t){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(e)if(e instanceof Rt)for(n=e.L(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function Ct(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];kt(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)kt(i,r=e.a[t])||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function kt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(o=pt.prototype).setTimeout=function(e){this.P=e},o.Wa=function(e){e=e.target;var t=this.F;t&&3==Sn(e)?t.f():this.Ca(e)},o.Ca=function(e){try{if(e==this.a)e:{var t=Sn(this.a),n=this.a.ua(),r=this.a.X();if(!(3>t||3==t&&!z&&!this.a.$())){this.A||4!=t||7==n||Ke(8==n||0>=r?3:2),At(this);var i=this.a.X();this.N=i;var o=this.a.$();if(this.b=200==i,function(e,t,n,r,i,o,a){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+a}))}(this.c,this.m,this.l,this.f,this.T,t,i),this.b){if(this.V&&!this.C){t:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!T(a)){var c=a;break t}}c=null}if(!c){this.b=!1,this.h=3,et(12),St(this),xt(this);break e}Ze(this.c,this.f,c,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Tt(this,c)}this.I?(bt(this,t,o),z&&this.b&&3==t&&(Ge(this.J,this.R,"tick",this.Va),this.R.start())):(Ze(this.c,this.f,o,null),Tt(this,o)),4==t&&St(this),this.b&&!this.A&&(4==t?Hn(this.g,this):(this.b=!1,wt(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,et(12)):(this.h=0,et(13)),St(this),xt(this)}}}catch(e){}},o.Va=function(){if(this.a){var e=Sn(this.a),t=this.a.$();this.D<t.length&&(At(this),bt(this,e,t),this.b&&4!=e&&wt(this))}},o.cancel=function(){this.A=!0,St(this)},o.Ua=function(){this.o=null;var e=b();0<=e-this.U?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.c,this.l),2!=this.H&&(Ke(3),et(17)),St(this),this.h=2,xt(this)):Et(this,this.U-e)},(o=Rt.prototype).K=function(){Ct(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},o.L=function(){return Ct(this),this.a.concat()},o.get=function(e,t){return kt(this.b,e)?this.b[e]:t},o.set=function(e,t){kt(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},o.forEach=function(e,t){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);e.call(t,o,i,this)}};var It=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Pt(e,t){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,e instanceof Pt){this.a=void 0!==t?t:e.a,Nt(this,e.f),this.j=e.j,Dt(this,e.c),Lt(this,e.h),this.g=e.g,t=e.b;var n=new Zt;n.c=t.c,t.a&&(n.a=new Rt(t.a),n.b=t.b),Ft(this,n),this.i=e.i}else e&&(n=String(e).match(It))?(this.a=!!t,Nt(this,n[1]||"",!0),this.j=Bt(n[2]||""),Dt(this,n[3]||"",!0),Lt(this,n[4]),this.g=Bt(n[5]||"",!0),Ft(this,n[6]||"",!0),this.i=Bt(n[7]||"")):(this.a=!!t,this.b=new Zt(null,this.a))}function Ot(e){return new Pt(e)}function Nt(e,t,n){e.f=n?Bt(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Dt(e,t,n){e.c=n?Bt(t,!0):t}function Lt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Ft(e,t,n){t instanceof Zt?(e.b=t,function(e,t){t&&!e.f&&(Yt(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Xt(this,t),Kt(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Vt(t,Wt)),e.b=new Zt(t,e.a))}function jt(e,t,n){e.b.set(t,n)}function Ut(e){return jt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^b()).toString(36)),e}function Bt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Vt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,Ht),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Ht(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Vt(t,zt,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Vt(t,zt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Vt(n,"/"==n.charAt(0)?Gt:qt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Vt(n,Jt)),e.join("")};var zt=/[#\/\?@]/g,qt=/[#\?:]/g,Gt=/[#\?]/g,Wt=/[#\?@]/g,Jt=/#/g;function Zt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Yt(e){e.a||(e.a=new Rt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var o=e[n].substring(0,r);i=e[n].substring(r+1)}else o=e[n];t(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.c,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Xt(e,t){Yt(e),t=$t(e,t),kt(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,kt((e=e.a).b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&Ct(e)))}function Qt(e,t){return Yt(e),t=$t(e,t),kt(e.a.b,t)}function Kt(e,t,n){Xt(e,t),0<n.length&&(e.c=null,e.a.set($t(e,t),S(n)),e.b+=n.length)}function $t(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function en(e,t){this.b=e,this.a=t}function tn(e){this.g=e||nn,c.PerformanceNavigationTiming?e=0<(e=c.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(c.ia&&c.ia.ya&&c.ia.ya()&&c.ia.ya().qb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(o=Zt.prototype).add=function(e,t){Yt(this),this.c=null,e=$t(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},o.forEach=function(e,t){Yt(this),this.a.forEach((function(n,r){A(n,(function(n){e.call(t,n,r,this)}),this)}),this)},o.L=function(){Yt(this);for(var e=this.a.K(),t=this.a.L(),n=[],r=0;r<t.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(t[r]);return n},o.K=function(e){Yt(this);var t=[];if("string"==typeof e)Qt(this,e)&&(t=x(t,this.a.get($t(this,e))));else{e=this.a.K();for(var n=0;n<e.length;n++)t=x(t,e[n])}return t},o.set=function(e,t){return Yt(this),this.c=null,Qt(this,e=$t(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},o.get=function(e,t){return e&&0<(e=this.K(e)).length?String(e[0]):t},o.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.L(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.K(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),e.push(a)}}return this.c=e.join("&")};var nn=10;function rn(e){return!!e.b||!!e.a&&e.a.size>=e.f}function on(e){return e.b?1:e.a?e.a.size:0}function an(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function sn(e,t){e.a?e.a.add(t):e.b=t}function cn(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function ln(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var o=i(e.a.values()),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.concat(s.s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}return S(e.c)}function un(){}function hn(){this.a=new un}function dn(e,t,n){var r=n||"";try{Mt(e,(function(e,n){var i=e;d(e)&&(i=Me(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function pn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}tn.prototype.cancel=function(){var e,t;if(this.c=ln(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},un.prototype.stringify=function(e){return c.JSON.stringify(e,void 0)},un.prototype.parse=function(e){return c.JSON.parse(e,void 0)};var fn=c.JSON.parse;function mn(e){Se.call(this),this.headers=new Rt,this.H=e||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=gn,this.D=this.F=!1}_(mn,Se);var gn="",yn=/^https?$/i,vn=["POST","PUT"];function bn(e){return"content-type"==e.toLowerCase()}function _n(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,wn(e),An(e)}function wn(e){e.u||(e.u=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function En(e){if(e.b&&void 0!==s&&(!e.s[1]||4!=Sn(e)||2!=e.X()))if(e.l&&4==Sn(e))Be(e.za,0,e);else if(e.dispatchEvent("readystatechange"),4==Sn(e)){e.b=!1;try{var t,n=e.X();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var o=String(e.B).match(It)[1]||null;if(!o&&c.self&&c.self.location){var a=c.self.location.protocol;o=a.substr(0,a.length-1)}i=!yn.test(o?o.toLowerCase():"")}t=i}if(t)e.dispatchEvent("complete"),e.dispatchEvent("success");else{e.h=6;try{var l=2<Sn(e)?e.a.statusText:""}catch(e){l=""}e.f=l+" ["+e.X()+"]",wn(e)}}finally{An(e)}}}function An(e,t){if(e.a){xn(e);var n=e.a,r=e.s[0]?l:null;e.a=null,e.s=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){}}}function xn(e){e.a&&e.D&&(e.a.ontimeout=null),e.m&&(c.clearTimeout(e.m),e.m=null)}function Sn(e){return e.a?e.a.readyState:0}function Tn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=function(e){var t="";return O(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):jt(e,t,n))}function Mn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Rn(e){this.pa=0,this.g=[],this.c=new Je,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.W=this.i=this.O=this.l=null,this.La=this.R=0,this.Ia=Mn("failFast",!1,e),this.H=this.m=this.j=this.h=this.f=null,this.T=!0,this.I=this.oa=this.P=-1,this.U=this.o=this.u=0,this.Fa=Mn("baseRetryDelayMs",5e3,e),this.Ma=Mn("retryDelaySeedMs",1e4,e),this.Ja=Mn("forwardChannelMaxRetries",2,e),this.ma=Mn("forwardChannelRequestTimeoutMs",2e4,e),this.Ka=e&&e.g||void 0,this.D=void 0,this.C=e&&e.supportsCrossDomainXhr||!1,this.J="",this.b=new tn(e&&e.concurrentRequestLimit),this.ka=new hn,this.da=e&&e.fastHandshake||!1,this.Ga=e&&e.b||!1,e&&e.f&&(this.c.a=!1),e&&e.forceLongPolling&&(this.T=!1),this.V=!this.da&&this.T&&e&&e.c||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null}function Cn(e){if(In(e),3==e.v){var t=e.R++,n=Ot(e.B);jt(n,"SID",e.J),jt(n,"RID",t),jt(n,"TYPE","terminate"),Dn(e,n),(t=new pt(e,e.c,t,void 0)).H=2,t.i=Ut(Ot(n)),n=!1,c.navigator&&c.navigator.sendBeacon&&(n=c.navigator.sendBeacon(t.i.toString(),"")),!n&&c.Image&&((new Image).src=t.i,n=!0),n||(t.a=Jn(t.g,null),t.a.ba(t.i)),t.u=b(),wt(t)}Gn(e)}function kn(e){e.a&&(Un(e),e.a.cancel(),e.a=null)}function In(e){kn(e),e.j&&(c.clearTimeout(e.j),e.j=null),Vn(e),e.b.cancel(),e.h&&("number"==typeof e.h&&c.clearTimeout(e.h),e.h=null)}function Pn(e,t){e.g.push(new en(e.La++,t)),3==e.v&&On(e)}function On(e){rn(e.b)||e.h||(e.h=!0,Ne(e.Ba,e),e.u=0)}function Nn(e,t){var n;n=t?t.f:e.R++;var r=Ot(e.B);jt(r,"SID",e.J),jt(r,"RID",n),jt(r,"AID",e.P),Dn(e,r),e.i&&e.l&&Tn(r,e.i,e.l),n=new pt(e,e.c,n,e.u+1),null===e.i&&(n.B=e.l),t&&(e.g=t.s.concat(e.g)),t=Ln(e,n,1e3),n.setTimeout(Math.round(.5*e.ma)+Math.round(.5*e.ma*Math.random())),sn(e.b,n),yt(n,r,t)}function Dn(e,t){e.f&&Mt({},(function(e,n){jt(t,n,e)}))}function Ln(e,t,n){n=Math.min(e.g.length,n);var r=e.f?y(e.f.Ha,e.f,e):null;e:for(var i=e.g,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].b,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,c=0;c<n;c++){var l=i[c].b,u=i[c].a;if(0>(l-=o))o=Math.max(0,i[c].b-100),s=!1;else try{dn(u,a,"req"+l+"_")}catch(e){r&&r(u)}}if(s){r=a.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Fn(e){e.a||e.j||(e.U=1,Ne(e.Aa,e),e.o=0)}function jn(e){return!(e.a||e.j||3<=e.o)&&(e.U++,e.j=nt(y(e.Aa,e),zn(e,e.o)),e.o++,!0)}function Un(e){null!=e.s&&(c.clearTimeout(e.s),e.s=null)}function Bn(e){e.a=new pt(e,e.c,"rpc",e.U),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=Ot(e.la);jt(t,"RID","rpc"),jt(t,"SID",e.J),jt(t,"CI",e.H?"0":"1"),jt(t,"AID",e.P),Dn(e,t),jt(t,"TYPE","xmlhttp"),e.i&&e.l&&Tn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=Ut(Ot(t)),n.j=null,n.I=!0,vt(n,e)}function Vn(e){null!=e.m&&(c.clearTimeout(e.m),e.m=null)}function Hn(e,t){var n=null;if(e.a==t){Vn(e),Un(e),e.a=null;var r=2}else{if(!an(e.b,t))return;n=t.s,cn(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=b()-t.u;var i=e.u;(r=Xe()).dispatchEvent(new tt(r,n,t,i)),On(e)}else Fn(e);else if(3==(i=t.h)||0==i&&0<e.I||!(1==r&&function(e,t){return!(on(e.b)>=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.Ia?0:e.Ja))&&(e.h=nt(y(e.Ba,e,t),zn(e,e.u)),e.u++,!0))}(e,t)||2==r&&jn(e)))switch(n&&0<n.length&&(t=e.b,t.c=t.c.concat(n)),i){case 1:qn(e,5);break;case 4:qn(e,10);break;case 3:qn(e,6);break;default:qn(e,2)}}function zn(e,t){var n=e.Fa+Math.floor(Math.random()*e.Ma);return e.f||(n*=2),n*t}function qn(e,t){if(e.c.info("Error code "+t),2==t){var n=null;e.f&&(n=null);var r=y(e.Xa,e);n||(n=new Pt("//www.google.com/images/cleardot.gif"),c.location&&"http"==c.location.protocol||Nt(n,"https"),Ut(n)),function(e,t){var n=new Je;if(c.Image){var r=new Image;r.onload=v(pn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=v(pn,n,r,"TestLoadImage: error",!1,t),r.onabort=v(pn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=v(pn,n,r,"TestLoadImage: timeout",!1,t),c.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else et(2);e.v=0,e.f&&e.f.ra(t),Gn(e),In(e)}function Gn(e){e.v=0,e.I=-1,e.f&&(0==ln(e.b).length&&0==e.g.length||(e.b.c.length=0,S(e.g),e.g.length=0),e.f.qa())}function Wn(e,t,n){var r=function(e){return e instanceof Pt?Ot(e):new Pt(e,void 0)}(n);if(""!=r.c)t&&Dt(r,t+"."+r.c),Lt(r,r.h);else{var i=c.location;r=function(e,t,n,r){var i=new Pt(null,void 0);return e&&Nt(i,e),t&&Dt(i,t),n&&Lt(i,n),r&&(i.g=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.W&&O(e.W,(function(e,t){jt(r,t,e)})),t=e.A,n=e.na,t&&n&&jt(r,t,n),jt(r,"VER",e.ha),Dn(e,r),r}function Jn(e,t){if(t&&!e.C)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new mn(e.Ka)).F=e.C,t}function Zn(){}function Yn(){if(V&&!(10<=Number(ee)))throw Error("Environmental error: no available transport.")}function Xn(e,t){Se.call(this),this.a=new Rn(t),this.l=e,this.b=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.l=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.a&&(e?e["X-WebChannel-Client-Profile"]=t.a:e={"X-WebChannel-Client-Profile":t.a}),this.a.O=e,(e=t&&t.httpHeadersOverwriteParam)&&!T(e)&&(this.a.i=e),this.h=t&&t.supportsCrossDomainXhr||!1,this.g=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!T(t)&&(this.a.A=t,null!==(e=this.b)&&t in e&&(t in(e=this.b)&&delete e[t])),this.f=new $n(this)}function Qn(e){ut.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function Kn(){ht.call(this),this.status=1}function $n(e){this.a=e}(o=mn.prototype).ba=function(e,t,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+e);t=t?t.toUpperCase():"GET",this.B=e,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?at(this.H):at(ct),this.a.onreadystatechange=y(this.za,this);try{this.A=!0,this.a.open(t,String(e),!0),this.A=!1}catch(e){return void _n(this,e)}e=n||"";var i=new Rt(this.headers);r&&Mt(r,(function(e,t){i.set(t,e)})),r=function(e){e:{for(var t=bn,n=e.length,r="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:"string"==typeof e?e.charAt(t):e[t]}(i.L()),n=c.FormData&&e instanceof c.FormData,!(0<=E(vn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{xn(this),0<this.o&&((this.D=function(e){return V&&K(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=y(this.xa,this)):this.m=Be(this.xa,this.o,this)),this.l=!0,this.a.send(e),this.l=!1}catch(e){_n(this,e)}},o.xa=function(){void 0!==s&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},o.abort=function(e){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),An(this))},o.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),An(this,!0)),mn.S.G.call(this)},o.za=function(){this.j||(this.A||this.l||this.g?En(this):this.Ta())},o.Ta=function(){En(this)},o.X=function(){try{return 2<Sn(this)?this.a.status:-1}catch(e){return-1}},o.$=function(){try{return this.a?this.a.responseText:""}catch(e){return""}},o.Na=function(e){if(this.a){var t=this.a.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),fn(t)}},o.ua=function(){return this.h},o.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(o=Rn.prototype).ha=8,o.v=1,o.Ba=function(e){if(this.h)if(this.h=null,1==this.v){if(!e){this.R=Math.floor(1e5*Math.random()),e=this.R++;var t,n=new pt(this,this.c,e,void 0),r=this.l;if(this.O&&(r?L(r=N(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)e:{for(var i=t=0;i<this.g.length;i++){var o=this.g[i];if(void 0===(o="__data__"in o.a&&"string"==typeof(o=o.a.__data__)?o.length:void 0))break;if(4096<(t+=o)){t=i;break e}if(4096===t||i===this.g.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Ln(this,n,t),jt(i=Ot(this.B),"RID",e),jt(i,"CVER",22),this.A&&jt(i,"X-HTTP-Session-Id",this.A),Dn(this,i),this.i&&r&&Tn(i,this.i,r),sn(this.b,n),this.Ga&&jt(i,"TYPE","init"),this.da?(jt(i,"$req",t),jt(i,"SID","null"),n.V=!0,yt(n,i,null)):yt(n,i,t),this.v=2}}else 3==this.v&&(e?Nn(this,e):0==this.g.length||rn(this.b)||Nn(this))},o.Aa=function(){if(this.j=null,Bn(this),this.V&&!(this.F||null==this.a||0>=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=nt(y(this.Sa,this),e)}},o.Sa=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,kn(this),Bn(this))},o.Ra=function(){null!=this.m&&(this.m=null,kn(this),jn(this),et(19))},o.Xa=function(e){e?(this.c.info("Successfully pinged google.com"),et(2)):(this.c.info("Failed to ping google.com"),et(1))},(o=Zn.prototype).ta=function(){},o.sa=function(){},o.ra=function(){},o.qa=function(){},o.Ha=function(){},Yn.prototype.a=function(e,t){return new Xn(e,t)},_(Xn,Se),(o=Xn.prototype).addEventListener=function(e,t,n,r){Xn.S.addEventListener.call(this,e,t,n,r)},o.removeEventListener=function(e,t,n,r){Xn.S.removeEventListener.call(this,e,t,n,r)},o.Oa=function(){this.a.f=this.f,this.h&&(this.a.C=!0);var e=this.a,t=this.l,n=this.b||void 0;et(0),e.fa=t,e.W=n||{},e.H=e.T,e.B=Wn(e,null,e.fa),On(e)},o.close=function(){Cn(this.a)},o.Pa=function(e){if("string"==typeof e){var t={};t.__data__=e,Pn(this.a,t)}else this.g?((t={}).__data__=Me(e),Pn(this.a,t)):Pn(this.a,e)},o.G=function(){this.a.f=null,delete this.f,Cn(this.a),delete this.a,Xn.S.G.call(this)},_(Qn,ut),_(Kn,ht),_($n,Zn),$n.prototype.ta=function(){this.a.dispatchEvent("a")},$n.prototype.sa=function(e){this.a.dispatchEvent(new Qn(e))},$n.prototype.ra=function(e){this.a.dispatchEvent(new Kn(e))},$n.prototype.qa=function(){this.a.dispatchEvent("b")},Yn.prototype.createWebChannel=Yn.prototype.a,Xn.prototype.send=Xn.prototype.Pa,Xn.prototype.open=Xn.prototype.Oa,Xn.prototype.close=Xn.prototype.close,rt.NO_ERROR=0,rt.TIMEOUT=8,rt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=lt,lt.OPEN="a",lt.CLOSE="b",lt.ERROR="c",lt.MESSAGE="d",Se.prototype.listen=Se.prototype.va,mn.prototype.listenOnce=mn.prototype.wa,mn.prototype.getLastError=mn.prototype.Qa,mn.prototype.getLastErrorCode=mn.prototype.ua,mn.prototype.getStatus=mn.prototype.X,mn.prototype.getResponseJson=mn.prototype.Na,mn.prototype.getResponseText=mn.prototype.$,mn.prototype.send=mn.prototype.ba;var er={createWebChannelTransport:function(){return new Yn},ErrorCode:rt,EventType:it,WebChannel:st,XhrIo:mn},tr=er.createWebChannelTransport,nr=er.ErrorCode,rr=er.EventType,ir=er.WebChannel,or=er.XhrIo;t.default=er}.call(this,n(1))},function(e,t,n){const r=n(0),i=new THREE.Color;function o(e,t,n){i.set(n),e.uniforms?(e.uniforms[t].value.x=i.r,e.uniforms[t].value.y=i.g,e.uniforms[t].value.z=i.b):e[t].set(n)}function a(e,t,n,r,i,o){e.fillStyle=t,e.fillRect(n,r,i,o)}function s(e,t,n,r,i,o,a){let s;s=o>a?e.createLinearGradient(0,0,o,0):e.createLinearGradient(0,0,0,a),s.addColorStop(0,t),s.addColorStop(1,n),e.fillStyle=s,e.fillRect(r,i,o,a)}if(AFRAME.registerSystem("materials",{schema:{},init:function(){this.curve=null,this.panelMaterials=[];const e=localStorage.getItem("colorScheme")||"default";this.scheme=r.schemes[e],this.textureList=[],this.beatsCanvas=document.createElement("canvas"),this.beatsTexture=new THREE.CanvasTexture(this.beatsCanvas),this.generateBeatsTexture(),this.textureList.push(this.beatsTexture),this.envmapCanvas=document.createElement("canvas"),this.envmapTexture=new THREE.CanvasTexture(this.envmapCanvas),this.generateEnvmapTexture(),this.textureList.push(this.envmapTexture),this.fistsCanvas=document.createElement("canvas"),this.fistsTexture=new THREE.CanvasTexture(this.fistsCanvas),this.generateFistsTexture(),this.textureList.push(this.fistsTexture),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.createMaterials()}):this.createMaterials()},play:function(){this.setColorScheme()},tick:function(e,t){this.aurora.uniforms.time.value=e,this.home.animate&&(this.home.uniforms.time.value=e),this.leftFistWeapon.uniforms.time.value=e,this.leftWeapon.uniforms.time.value=e,this.rightFistWeapon.uniforms.time.value=e,this.rightWeapon.uniforms.time.value=e,this.rings.uniforms.time.value=e,this.tube.uniforms.time.value=e},createMaterials:function(){const e=this.scheme;this.tunnel=new THREE.ShaderMaterial({vertexShader:n(111),fragmentShader:n(112),uniforms:{fogColor:{value:new THREE.Color(e.primary)},color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},scale:{value:1}},transparent:!0}),this.merkaba=new THREE.MeshBasicMaterial({color:new THREE.Color(e.primary)}),this.backglow=new THREE.MeshBasicMaterial({transparent:!0,map:(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src),color:new THREE.Color(e.primary)}),this.textureList.push(this.backglow.map),this.aurora=new THREE.ShaderMaterial({vertexShader:n(113),fragmentShader:n(114),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},time:{value:0}},transparent:!0}),this.rings=new THREE.ShaderMaterial({vertexShader:n(115),fragmentShader:n(116),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},time:{value:0}},transparent:!0,depthWrite:!1}),this.moon=new THREE.ShaderMaterial({vertexShader:n(117),fragmentShader:n(118),uniforms:{map:{value:(new THREE.TextureLoader).load(document.getElementById("moonImg").src)},tint:{value:new THREE.Color(e.secondarybright)}},transparent:!0}),this.textureList.push(this.moon.uniforms.map.value),this.home=new THREE.ShaderMaterial({vertexShader:n(119),fragmentShader:n(120),uniforms:{color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},src:{value:(new THREE.TextureLoader).load(document.getElementById("homeShadowImg").src)},time:{value:0}},transparent:!0}),this.textureList.push(this.home.uniforms.src.value);const t=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src);t.wrapS=THREE.RepeatWrapping,t.wrapT=THREE.RepeatWrapping,t.repeat.set(2,2),t.magFilter=THREE.NearestFilter,this.textureList.push(t),this.rightWeapon=new THREE.ShaderMaterial({vertexShader:n(26),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftWeapon=new THREE.ShaderMaterial({vertexShader:n(26),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftFistWeapon=new THREE.ShaderMaterial({vertexShader:n(17),fragmentShader:n(28),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending}),this.rightFistWeapon=new THREE.ShaderMaterial({vertexShader:n(17),fragmentShader:n(28),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending});const i=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src),o=(new THREE.TextureLoader).load(document.getElementById("weaponHandleImg").src);i.mapping=THREE.SphericalReflectionMapping,this.textureList.push(i),this.textureList.push(o),this.leftWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.primary),map:o,envMap:i}),this.rightWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.secondary),map:o,envMap:i});const a=(new THREE.TextureLoader).load(document.getElementById("weapon2Img").src);a.mapping=THREE.SphericalReflectionMapping,this.leftFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:a,transparent:!0}),this.rightFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:a,transparent:!0}),this.beat=new THREE.MeshLambertMaterial({map:this.beatsTexture,transparent:!0}),this.blueBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.secondary,emissive:e.secondary,emissiveIntensity:.2}),this.redBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.primary,emissive:e.primary,emissiveIntensity:.2}),this.minePieces=new THREE.MeshLambertMaterial({color:e.tertiary,emissive:e.tertiary,emissiveIntensity:.2});const s=(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src);this.redBeatGlow=new THREE.MeshBasicMaterial({color:e.primary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.blueBeatGlow=new THREE.MeshBasicMaterial({color:e.secondary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.textureList.push(s),this.stars=new THREE.PointsMaterial({size:1,map:(new THREE.TextureLoader).load(document.getElementById("starImg").src),blending:THREE.AdditiveBlending,transparent:!0,color:new THREE.Color(e.secondary)}),this.textureList.push(this.stars.map);const c=(new THREE.TextureLoader).load(document.getElementById("sideglowImg").src);this.textureList.push(c),this.leftsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,side:THREE.BackSide,color:new THREE.Color(r.OFF)}),this.rightsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,color:new THREE.Color(r.OFF)});const l=(new THREE.TextureLoader).load(document.getElementById("plumeImg").src);l.minFilter=THREE.LinearFilter,this.arrowBluePlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.arrowRedPlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotBluePlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotRedPlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.minePlume=new THREE.ShaderMaterial({vertexShader:n(8),fragmentShader:n(9),uniforms:{color:{value:new THREE.Color(e.tertiary)},src:{value:l}},transparent:!0,depthTest:!1});const u=(new THREE.TextureLoader).load(document.getElementById("tubeImg").src),h=(new THREE.TextureLoader).load(document.getElementById("tubeColorImg").src);u.generateMipmaps=!1,u.minFilter=THREE.LinearFilter,h.generateMipmaps=!1,h.minFilter=THREE.LinearFilter,this.tube=new THREE.ShaderMaterial({vertexShader:n(121),fragmentShader:n(122),uniforms:{time:{value:0},opacity:{value:0},src:{value:u},color:{value:h}},transparent:!0,depthTest:!1,side:THREE.BackSide});const d=(new THREE.TextureLoader).load(document.getElementById("handStarTrailImg").src);d.generateMipmaps=!1,d.minFilter=THREE.LinearFilter,this.handStarTrail=new THREE.ShaderMaterial({vertexShader:n(123),fragmentShader:n(124),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},pulse:{value:0},src:{value:d}},transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,side:THREE.DoubleSide})},setColorScheme:function(e){this.el.sceneEl;const t=this.scheme=r.schemes[e]||r.schemes.default;o(this.arrowBluePlume,"color",t.secondary),o(this.arrowRedPlume,"color",t.primary),o(this.aurora,"colorPrimary",t.primary),o(this.aurora,"colorSecondary",t.secondary),o(this.backglow,"color",t.primary),o(this.blueBeatGlow,"color",t.secondary),o(this.blueBeatGlow,"color",t.secondary),o(this.blueBeatPieces,"color",t.secondary),o(this.blueBeatPieces,"emissive",t.secondary),o(this.dotBluePlume,"color",t.secondary),o(this.dotRedPlume,"color",t.primary),o(this.handStarTrail,"colorPrimary",t.primary),o(this.handStarTrail,"colorSecondary",t.secondary),o(this.handStarTrail,"colorTertiary",t.tertiary),o(this.home,"color1",t.primary),o(this.home,"color2",t.secondary),o(this.home,"color3",t.tertiary),o(this.leftFist,"color",t.primarybright),o(this.leftFistWeapon,"color",t.primary),o(this.leftWeapon,"color",t.primary),o(this.leftWeaponHandle,"color",t.primary),o(this.merkaba,"color",t.primary),o(this.minePieces,"color",t.tertiary),o(this.minePieces,"emissive",t.tertiary),o(this.minePlume,"color",t.tertiary),o(this.moon,"tint",t.secondarybright),o(this.redBeatGlow,"color",t.primary),o(this.redBeatGlow,"color",t.primary),o(this.redBeatPieces,"color",t.primary),o(this.redBeatPieces,"emissive",t.primary),o(this.rightFist,"color",t.secondarybright),o(this.rightWeapon,"color",t.secondary),o(this.rightFistWeapon,"color",t.secondary),o(this.rightWeaponHandle,"color",t.secondary),o(this.rings,"colorPrimary",t.primary),o(this.rings,"colorSecondary",t.secondary),o(this.rings,"colorTertiary",t.tertiary),o(this.stars,"color",t.secondary),o(this.tunnel,"fogColor",t.primary),o(this.tunnel,"color1",t.primary),o(this.tunnel,"color2",t.secondary),o(this.tunnel,"color3",t.tertiary),this.generateBeatsTexture(),this.generateEnvmapTexture(),this.generateFistsTexture(),document.querySelectorAll("a-entity[wall]").forEach(e=>{o(e.getObject3D("mesh").material,"colorTertiary",t.tertiary)}),this.panelMaterials.forEach(e=>{o(e,"colorPrimary",t.primary),o(e,"colorSecondary",t.secondary)}),o(this.curve,"fogColor",t.primary),o(this.curve,"color1",t.primary),o(this.curve,"color2",t.secondary)},generateBeatsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=new THREE.Color(e.tertiary),i=this.beatsCanvas,o=i.getContext("2d");i.width=512,i.height=32,a(o,r.getStyle(),0,0,128,6),a(o,"#000",128,0,128,6),a(o,n.getStyle(),256,0,128,6),a(o,t.getStyle(),384,0,105,6),a(o,"#FFF",489,0,23,6),s(o,"#000000",n.getStyle(),0,6,512,4),s(o,"#000",t.getStyle(),0,10,512,5),s(o,"#000",r.getStyle(),0,15,512,4),s(o,`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,n.getStyle(),0,19,512,5),s(o,`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,t.getStyle(),0,24,512,4),s(o,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`,r.getStyle(),0,28,512,4);const c=this.beatsTexture;return c.generateMipmaps=!1,c.magFilter=THREE.LinearFilter,c.minFilter=THREE.LinearFilter,c.needsUpdate=!0,c},generateFistsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primarybright),n=new THREE.Color(e.secondarybright),r=this.fistsCanvas,i=r.getContext("2d");return r.width=8,r.height=128,s(i,t.getStyle(),`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,0,0,4,128),s(i,n.getStyle(),`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,4,0,4,128),this.fistsTexture.needsUpdate=!0,this.fistsTexture},generateEnvmapTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=document.getElementById("envmapTemplateImg");r.addEventListener("load",()=>{const e=r.width,i=r.height,o=this.envmapCanvas;o.width=e,o.height=i;const a=o.getContext("2d");a.drawImage(r,0,0);const s=a.getImageData(0,0,e,i),c=s.data;let l,u;for(let e=0;e<c.length;e+=4)l=c[e],u=c[e+1],l*=1-u/255,c[e+0]=Math.floor(t.r*l+n.r*u),c[e+1]=Math.floor(t.g*l+n.g*u),c[e+2]=Math.floor(t.b*l+n.b*u),c[e+3]=255;a.putImageData(s,0,0),document.getElementById("envmapImg").src=o.toDataURL("image/png")})},registerCurve:function(e){this.curve=e},registerPanel:function(e){this.panelMaterials.push(e)}}),AFRAME.registerComponent("materials",{schema:{animate:{default:!0},name:{default:""},recursive:{default:!0}},update:function(){if(""===this.data.name)return;if(this.material=this.system[this.data.name],!this.material)return void console.warn("[materials] Unknown material: "+this.data.name);let e=this.el.getObject3D("mesh");e?this.applyMaterial(e):this.el.addEventListener("object3dset",t=>{"mesh"===t.detail.type&&(e=this.el.getObject3D("mesh"),e&&this.applyMaterial(e))}),this.material.animate=this.data.animate},applyMaterial:function(e){e.detail&&(e=e.detail.model),this.data.recursive?e.traverse(e=>{"Mesh"===e.type&&(e.material=this.material)}):e.material=this.material}}),AFRAME.registerComponent("materials-color-menu",{play:function(){this.text=document.getElementById("colorName")},events:{mouseenter:function(e){this.text.setAttribute("text","value",e.target.dataset.colorName)},mouseleave:function(e){this.text.setAttribute("text","value","")},click:function(e){this.el.sceneEl.systems.materials.setColorScheme(e.target.dataset.colorScheme),this.el.sceneEl.emit("colorschemechange",e.target.dataset.colorScheme,!1)}}}),window.AFRAME){const t=["materials","materials-color-menu"],n=[],r=["materials"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPos;\nvarying vec3 vPos;\nvarying vec3 vNormal;\n\nvoid main() {\n vNormal = normal;\n vPos = position;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="uniform sampler2D src;\nuniform float scale;\nvarying vec3 vPos;\nvarying vec3 vWorldPos;\nvarying vec3 vNormal;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\nuniform vec3 fogColor;\n\nvoid main() {\n vec3 pw = vWorldPos - cameraPosition;\n vec3 p = pw / scale;\n float pz = p.z * 0.3;\n\n // build color weights\n float f = clamp( (sin(p.x * 0.6 + pz ) + sin(p.y * 0.3 - pz)) * 0.3 + 0.17, 0.0, 1.0);\n float g = clamp( (sin(p.x * 0.7 + pz) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.1)) * 0.25 + 0.15, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.4 + pz + 3.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.3)) * 0.16 + 0.08, 0.0, 1.0);\n\n\n // mix colors using weights\n vec3 col = vec3(0.3);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n float fog = 1.0 - clamp(length(pw) / 180.0 - 0.1, 0.0, 1.0);\n\n // mix color with fog\n col = mix(fogColor, col, smoothstep(0.2, 0.9, fog));\n\n // calc shadow (using normal and fixed light pos + fade to black in y)\n float shadow = 0.5 + dot(vec3(0.0, 1.0, 1.0), vNormal) * 0.5;\n float shadowGrad = clamp((vPos.y + 2.0) / 6.0, 0.1, 1.0);\n // fade in fog\n shadow = mix(1.0, shadow, fog);\n shadowGrad = mix(1.0, shadowGrad, smoothstep(0.3, 1.0, fog));\n\n gl_FragColor = vec4(col * shadow * shadowGrad, smoothstep(0.3, 0.6, fog));\n //gl_FragColor = vec4(vec3(fog), 1.0);\n}"},function(e,t){e.exports="uniform float time;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n float t = time * 0.0005;\n vec3 pos = position;\n pos.y += sin(t + uv.x * 3.0 + pos.x * 0.01) * 20.0;\n pos.y += sin(-t * 1.3 + uv.x * 7.0 + pos.x * 0.008) * 10.0;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1.0 );\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nvarying vec2 uvs;\n\nvoid main() {\n vec3 col = vec3(1.0);\n float t = time * 0.001;\n col *= 0.80 + sin(-t * 3.4 + 5.5 + uvs.x * 6.0) * 0.1;\n col *= 0.80 + sin(t * 1.4 + 0.5 + uvs.x * 12.0) * 0.2;\n col *= 0.80 + sin(t * 1.0 + 0.2 + uvs.x * 30.0) * 0.2;\n col *= 0.90 + sin(-t * 1.6 + 5.2 + uvs.x * 43.0) * 0.1;\n col *= 0.95 + sin(-t * 0.3 + 1.2 + uvs.x * 50.0) * 0.05;\n col *= 0.95 + sin(t * 0.8 + 1.2 + uvs.x * 80.0) * 0.05;\n col *= 0.94 + sin(-t + 0.1 + uvs.x * 180.0) * 0.01;\n col *= 0.90 + sin(t * 2.49 + 0.1 + uvs.x * 120.0) * 0.01;\n col *= 0.86 + sin(-t * 1.7 + 4.7 + uvs.x * 80.0) * 0.03;\n col *= 0.86 + sin(-t * 1.2 + 0.7 + uvs.x * 180.0) * 0.02;\n\n // border fades\n float alpha = 1.0;\n alpha *= 1.0 - smoothstep(0.0, 1.0, uvs.y);\n alpha *= smoothstep(0.0, 0.3, uvs.y);\n alpha *= sin(uvs.x * 3.141592);\n\n // colorize\n col = col * mix(colorPrimary, colorSecondary, uvs.y);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nvarying vec2 uvs;\n#define PI 3.14159265358979\n\nfloat pulse(float x, float t, float r){\n return 1.0 - smoothstep(0.0, r, abs((x - t)));\n}\n\nvoid main() {\n float t = time * 0.002;\n vec2 uv = uvs - 0.5;\n uv = vec2(-uv.y, uv.x);\n float d = length(uv);\n float f = pulse(d, 0.44, 0.012);\n float f2 = pulse(d, 0.44, 0.002);\n\n float g = pulse(d, 0.20, 0.01);\n float g1 = pulse(d, 0.20, 0.0018);\n\n float g2 = pulse(d, 0.21, 0.01);\n float g3 = pulse(d, 0.21, 0.0018);\n\n float ang = abs(atan(uv.y, uv.x)) / PI;\n float angalpha = sin(ang * 20.0 - t * 0.1) * 0.4 + 0.6;\n\n float sparks = pulse(angalpha, 0.4, 0.17) * (pulse(d, 0.435, 0.035) + pulse(d, 0.205, 0.026)) * 0.14;\n sparks += pulse(angalpha, 0.4, 0.2) * (pulse(d, 0.44, 0.002) + pulse(d, 0.2, 0.0018)) * 0.4;\n sparks *= sin(ang * 14.0 + t) * 0.5 + 0.5;\n vec3 col = mix(colorPrimary, colorSecondary, ang);\n col = mix (col, colorPrimary, g3);\n col = mix (col, colorSecondary, g1);\n col = mix (col, colorTertiary, sparks * 2.4);\n gl_FragColor = vec4(col, ((f + g + g2) * 0.1 + (f2 + g1 + g3) * 0.4) * angalpha + sparks);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D map;\nuniform vec3 tint;\n\nvoid main() {\n vec4 tex = texture2D(map, uvs);\n vec3 col = mix(tex.rgb * tint, tex.rgb, uvs.y);\n gl_FragColor = vec4(col, tex.a );\n}\n"},function(e,t){e.exports="uniform float time;\nvarying vec3 vWorldPos;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n vec3 pos = vec3(position.x, position.y + sin(time * 0.002 - position.z) * 0.05 + 0.04, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 vWorldPos;\nuniform sampler2D src;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\n\nvoid main() {\n vec4 tex = texture2D(src, uvs);\n vec3 p = vWorldPos + cameraPosition;\n float pz = p.z * 0.36;\n float f = clamp( (sin(p.x + pz ) + sin(p.y - pz)) * 0.35 + 0.14, 0.0, 1.0);\n float g = clamp( (sin(p.x + pz + 2.0) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.5)) * 0.3 + 0.1, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.7 + pz + 2.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.8)) * 0.3 + 0.05, 0.0, 1.0);\n\n vec3 col = vec3(0.1);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n gl_FragColor = vec4((col * 1.5) * tex.r, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform float time;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform sampler2D color;\nuniform float time;\nuniform float opacity;\n\nvoid main() {\n vec2 uvanim = vec2(\n mod(uvs.x + sin(time / 20000.0), 1.0),\n mod(uvs.y + time / 2000.0, 1.0));\n vec4 texAlpha = texture2D(src, uvanim);\n float alpha = texAlpha.a * smoothstep(0.0, 0.5, uvs.y) * (1.0 - smoothstep(0.5, 1.0, uvs.y));\n gl_FragColor = vec4(texture2D(color, uvs).rgb, alpha * 0.7 * opacity);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\n\nvoid main() {\n uvs = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nuniform float pulse;\nuniform sampler2D src;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += vec3(pulse) * 0.1;\n gl_FragColor = vec4 (col, texture2D(src, uvs).a);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("menu-controls",{schema:{enabled:{default:!0}},events:{thumbdownstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchnextpage",null,!1)},thumbleftstart:function(){this.data.enabled&&this.el.sceneEl.emit("menuchallengeunselect",null,!1)},thumbupstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchprevpage",null,!1)}}}),window.AFRAME){const t=["menu-controls"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-difficulty-select",{init:function(){this.el.sceneEl.addEventListener("menuchallengeselect",()=>{this.el.object3D.visible=!1,setTimeout(()=>{this.el.components.layout.update(),this.el.object3D.visible=!0},150)})},events:{click:function(e){this.el.sceneEl.emit("menudifficultyselect",e.target.closest(".difficultyOption").dataset.difficulty,!1)}}}),window.AFRAME){const t=["menu-difficulty-select"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-genre",{init:function(){this.el.addEventListener("click",e=>{this.el.sceneEl.emit("genreselect",e.target.closest(".genre").dataset.bindForKey)})}}),window.AFRAME){const t=["menu-genre"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-midsection",{schema:{active:{default:!1},selectedChallenge:{default:""}},update:function(e){e.active&&!this.data.active&&this.el.emit("hidedifficultysection",null,!1),(!e.active&&this.data.active||this.data.selectedChallenge&&e.selectedChallenge!==this.data.selectedChallenge)&&this.el.emit("showdifficultysection",null,!1)}}),window.AFRAME){const t=["menu-midsection"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0),i={classicvr:-.6,punchvr:.87,ride2d:.87,ridevr:.15,viewer2d:.15},o={classicvr:"classic",punchvr:"punch",ride2d:"ride",ridevr:"ride",viewer2d:"viewer"};if(AFRAME.registerComponent("multiplayer-button",{init:function(){this.el.addEventListener("click",()=>{this.el.sceneEl.emit("mpopen",null,!1)})}}),AFRAME.registerComponent("multiplayer-join-button",{init:function(){this.el.addEventListener("click",()=>{const e=this.el.sceneEl;if(e.systems.state.state.inVR)return void e.emit("mpkeyboardopen",null,!1);const t=window.prompt("Enter 4-letter room code:");if(!t)return;const n=t.toUpperCase().trim().slice(0,4);e.emit("mpcodeinput",n,!1),e.emit("mpjoin",{code:n},!1)})}}),AFRAME.registerComponent("multiplayer-keyboard-bridge",{init:function(){const e=this.el.sceneEl;e.addEventListener("mpkeyboardsubmit",()=>{const t=(e.systems.state.state.multiplayer.joinCodeInput||"").toUpperCase().slice(0,4);e.emit("mpkeyboardclose",null,!1),4===t.length?e.emit("mpjoin",{code:t},!1):e.emit("mperror",{message:"Enter all 4 letters"},!1)}),e.addEventListener("mpnamekeyboardsubmit",()=>{const t=(e.systems.state.state.multiplayer.nameInput||"").trim().slice(0,14)||"Player";e.emit("mpnamekeyboardclose",null,!1),e.emit("mpsetname",{value:t},!1)})}}),AFRAME.registerComponent("multiplayer-name-button",{init:function(){this.el.addEventListener("click",()=>{const e=this.el.sceneEl;if(e.systems.state.state.inVR)return void e.emit("mpnamekeyboardopen",null,!1);const t=window.prompt("Your display name:",localStorage.getItem("threewsusername")||"Player");t&&e.emit("mpsetname",{value:t.trim().slice(0,14)},!1)})}}),AFRAME.registerComponent("multiplayer-ready-button",{init:function(){this.el.addEventListener("click",()=>{const e=this.el.sceneEl,t=e.systems.state.state,n=t.multiplayer.players.find(e=>e.uid===t.multiplayer.uid),r=!n||!n.ready;e.emit("mpready",{value:r},!1)})}}),AFRAME.registerComponent("menu-mode",{schema:{colorScheme:{default:"default"},hasVR:{default:!1}},init:function(){this.el.addEventListener("click",e=>{const t=e.target.closest("[data-mode]");if(!t)return;const n=t.dataset.mode,r=t.dataset.name;this.el.sceneEl.emit("gamemode",n,!1),localStorage.setItem("gameMode",r),this.setModeOption(r)})},update:function(){const e=localStorage.getItem("gameMode")||"punchvr";this.setModeOption(e),this.el.sceneEl.emit("gamemode",o[e])},setModeOption:function(e){const t=this.el.querySelectorAll(".modeItem");document.getElementById("modeIcon").object3D.position.y=i[e];for(let n=0;n<t.length;n++){const i=t[n],o=i.dataset.name===e;i.emit(o?"select":"deselect",null,!1);const a=i.querySelector(".modeBackground");a.emit(o?"select":"deselect",null,!1),a.setAttribute("mixin","modeBackgroundSelect"+(o?"":" modeBackgroundHover"));i.querySelector(".modeThumb").emit(o?"select":"deselect",null,!1);i.querySelector(".modeTitle").setAttribute("text","color",o?r.WHITE:r.schemes[this.data.colorScheme].secondary);i.querySelector(".modeInstructions").setAttribute("text","color",o?r.WHITE:r.schemes[this.data.colorScheme].primary)}}}),window.AFRAME){const t=["multiplayer-button","multiplayer-join-button","multiplayer-keyboard-bridge","multiplayer-name-button","multiplayer-ready-button","menu-mode"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist-button",{schema:{isFavorited:{default:!1},selectedChallenge:{default:""}},init:function(){const e=this.el;e.setAttribute("animation__scaleup",{property:"scale",from:"1 1 1",to:"1.2 1.2 1.2",dur:800,autoplay:!1,easing:"easeInOutElastic"}),e.setAttribute("animation__scaledown",{property:"scale",from:"1.2 1.2 1.2",to:"1 1 1",dur:100,autoplay:!1,easing:"easeInOutCubic"})},update:function(e){!e.isFavorited&&this.data.isFavorited&&e.selectedChallenge===this.data.selectedChallenge&&(this.el.object3D.position.z=.01,this.el.components.animation__scaleup.beginAnimation(),setTimeout(()=>{this.el.components.animation__scaledown.beginAnimation(),this.el.object3D.position.z=0},800))}}),window.AFRAME){const t=["menu-playlist-button"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist",{init:function(){this.eventDetail={id:"",title:""},this.el.addEventListener("click",e=>{const t=e.target.closest(".playlist");this.eventDetail.id=t.dataset.playlist,this.eventDetail.title=t.dataset.title,this.el.sceneEl.emit("playlistselect",this.eventDetail)})}}),window.AFRAME){const t=["menu-playlist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-selected-challenge-image",{schema:{coverURL:{type:"string"}},update:function(){this.el.setAttribute("material","src",this.data.coverURL)}}),window.AFRAME){const t=["menu-selected-challenge-image"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-slide-animation",{schema:{isSearching:{default:!1},menuSelectedChallengeId:{type:"string"}},init:function(){this.isLeft=!1},update:function(e){const t=this.data;if(this.isLeft)return!e.menuSelectedChallengeId||t.menuSelectedChallengeId||t.isSearching||this.rightMenu(),void(!e.isSearching||t.isSearching||t.menuSelectedChallengeId||this.rightMenu());this.isLeft||(!e.menuSelectedChallengeId&&t.menuSelectedChallengeId&&this.leftMenu(),!e.isSearching&&t.isSearching&&this.leftMenu())},rightMenu:function(){this.isLeft&&(this.el.components.animation__menuright.beginAnimation(),this.isLeft=!1)},leftMenu:function(){this.isLeft||(this.el.components.animation__menuleft.beginAnimation(),this.isLeft=!0)}}),window.AFRAME){const t=["menu-slide-animation"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const{MultiplayerClient:r}=n(135);if(AFRAME.registerComponent("multiplayer",{schema:{},init:function(){this.client=null,this.lastRoom=null,this.pendingStartAt=null,this._scheduledFire=!1,this._lastCountdownLabel="",this._lastScoreTick=0,this.onCreate=this.onCreate.bind(this),this.onJoin=this.onJoin.bind(this),this.onLeave=this.onLeave.bind(this),this.onReady=this.onReady.bind(this),this.onSetName=this.onSetName.bind(this),this.onPlayButtonClick=this.onPlayButtonClick.bind(this),this.onBeatHit=this.onBeatHit.bind(this),this.onBeatMiss=this.onBeatMiss.bind(this),this.onSongComplete=this.onSongComplete.bind(this),this.onRematch=this.onRematch.bind(this),this.onRoomUpdate=this.onRoomUpdate.bind(this),this.onShareLink=this.onShareLink.bind(this);const e=this.el.sceneEl||this.el;e.addEventListener("mpcreate",this.onCreate),e.addEventListener("mpjoin",this.onJoin),e.addEventListener("mpleave",this.onLeave),e.addEventListener("mpready",this.onReady),e.addEventListener("mpsetname",this.onSetName),e.addEventListener("mprematch",this.onRematch),e.addEventListener("mpsharelink",this.onShareLink),e.addEventListener("beathit",this.onBeatHit),e.addEventListener("beatmiss",this.onBeatMiss),e.addEventListener("beatwrong",this.onBeatMiss),e.addEventListener("songcomplete",this.onSongComplete),e.addEventListener("playbuttonclick",this.onPlayButtonClick,!0);const t=AFRAME.utils.getUrlParameter("mpjoin");t&&setTimeout(()=>{e.emit("mpopen",null,!1),e.emit("mpjoin",{code:t},!1)},250)},_ensureClient:async function(){if(this.client)return this.client;try{const e=await fetch("/api/rider/firebase"),t=await e.json();return t.apiKey?(this.client=new r(t),this.client.onRoomUpdate(this.onRoomUpdate),this.client):(console.error("[multiplayer] Missing Firebase config"),null)}catch(e){return console.error("[multiplayer] Error fetching Firebase config",e),null}},_name:function(){return localStorage.getItem("threewsusername")||"Player"},onCreate:async function(){const e=await this._ensureClient();if(e){this.el.sceneEl.emit("mpconnecting",null,!1);try{const t=await e.createRoom(this._name());this.el.sceneEl.emit("mproomjoined",{code:t,isHost:!0},!1)}catch(e){console.error("[multiplayer] create failed",e),this.el.sceneEl.emit("mperror",{message:"Could not create room"},!1)}}},onJoin:async function(e){const t=await this._ensureClient();if(!t)return;const n=e.detail&&e.detail.code||"";if(!n||n.length<4)this.el.sceneEl.emit("mperror",{message:"Enter a 4-letter room code"},!1);else{this.el.sceneEl.emit("mpconnecting",null,!1);try{await t.joinRoom(n,this._name()),this.el.sceneEl.emit("mproomjoined",{code:n.toUpperCase(),isHost:!1},!1)}catch(e){console.error("[multiplayer] join failed",e),this.el.sceneEl.emit("mperror",{message:e.message||"Join failed"},!1)}}},onLeave:async function(){this.client&&(await this.client.leaveRoom(),this.lastRoom=null,this.pendingStartAt=null,this.el.sceneEl.emit("mproomleft",null,!1))},onReady:function(e){this.client&&this.client.setReady(e.detail&&e.detail.value)},onSetName:function(e){if(!this.client)return;const t=e.detail&&(e.detail.value||e.detail)||this._name();localStorage.setItem("threewsusername",String(t).slice(0,20)),this.client.setName(t)},onRematch:async function(){this.client&&(this.pendingStartAt=null,await this.client.resetForRematch())},onShareLink:function(){if(!this.client||!this.client.roomCode)return;const e=window.location.origin+window.location.pathname+"?mpjoin="+this.client.roomCode,t=()=>{this.el.sceneEl.emit("mpsharelinkcopied",{url:e},!1),setTimeout(()=>this.el.sceneEl.emit("mpsharelinkcleared",null,!1),1500)};navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(t,()=>window.prompt("Share this link:",e)):(window.prompt("Share this link:",e),t())},onPlayButtonClick:function(e){if(this._scheduledFire)return;if(!this.client||!this.client.roomRef)return;const t=this.el.sceneEl.systems.state.state;if(!t.multiplayer||!t.multiplayer.active)return;if(!this.client.isHost)return e.stopImmediatePropagation(),void e.preventDefault();if(t.multiplayer.players.length<2)return e.stopImmediatePropagation(),e.preventDefault(),void this.el.sceneEl.emit("mperror",{message:"Need at least 2 players"},!1);e.stopImmediatePropagation(),e.preventDefault();const n=Object.assign({},t.menuSelectedChallenge);this.client.broadcastSong(n).then(()=>this.client.startSong(5e3)).catch(e=>{console.error("[multiplayer] host start failed",e),this.el.sceneEl.emit("mperror",{message:"Failed to start song"},!1)})},onBeatHit:function(){this._maybePushScore()},onBeatMiss:function(){this._maybePushScore()},_maybePushScore:function(){if(!this.client||!this.client.roomRef)return;const e=performance.now();if(e-this._lastScoreTick<250)return;this._lastScoreTick=e;const t=this.el.sceneEl.systems.state.state;this.client.pushScore(t.score)},onSongComplete:function(){if(!this.client||!this.client.roomRef)return;const e=this.el.sceneEl.systems.state.state;this.client.pushFinal(e.score)},onRoomUpdate:function(e){if(!e)return this.pendingStartAt=null,void this.el.sceneEl.emit("mproomleft",null,!1);const t=this.el.sceneEl,n=this.client.uid,r=Object.keys(e.players||{}).map(t=>({uid:t,...e.players[t]})).sort((e,t)=>(e.joinedAt||0)-(t.joinedAt||0));if(t.emit("mproomupdate",{code:this.client.roomCode,isHost:e.host===n,hostUid:e.host,uid:n,status:e.status,song:e.song,startAt:e.startAt,players:r},!1),!this.client.isHost&&e.song&&e.song.id){const n=this.lastRoom&&this.lastRoom.song&&this.lastRoom.song.id;e.song.id!==n&&t.emit("mpremotesongselect",e.song,!1)}if("playing"===e.status&&e.startAt){const t=this.lastRoom&&this.lastRoom.startAt;e.startAt!==t&&(this.pendingStartAt=e.startAt)}"lobby"===e.status&&(this.pendingStartAt=null),this.lastRoom=e},tick:function(){if(this.client&&this.pendingStartAt){const e=this.pendingStartAt-this.client.serverNow(),t=Math.max(0,Math.ceil(e/1e3)),n=t>0?"STARTING IN "+t:"GO!";if(n!==this._lastCountdownLabel&&(this._lastCountdownLabel=n,this.el.sceneEl.emit("mpcountdown",{value:n,secs:t,active:!0},!1)),e<=0){const e=this.pendingStartAt;this.pendingStartAt=null,this._fireLocalStart(),setTimeout(()=>{this.el.sceneEl.emit("mpcountdown",{value:"",secs:0,active:!1},!1),this._lastCountdownLabel=""},600),this._lastFiredStartAt=e}}},_fireLocalStart:function(){const e=this.el.sceneEl.systems.state.state;if(this.client.isHost){this._scheduledFire=!0;try{this.el.sceneEl.emit("playbuttonclick",null,!1)}finally{this._scheduledFire=!1}}else{if(!e.menuSelectedChallenge.id)return void console.warn("[multiplayer] non-host fire without song selected");this.el.sceneEl.emit("mpremoteplaystart",null,!1)}}}),window.AFRAME){const t=["multiplayer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(25);n(136);function i(){let e="";for(let t=0;t<4;t++)e+="ABCDEFGHJKLMNPQRSTUVWXYZ23456789"[Math.floor(Math.random()*"ABCDEFGHJKLMNPQRSTUVWXYZ23456789".length)];return e}e.exports={MultiplayerClient:class{constructor(e){r.apps.length||r.initializeApp(e),this.db=r.database(),this.uid=function(){const e=localStorage.getItem("threewsmpuid");if(e)return e;const t="u_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36);return localStorage.setItem("threewsmpuid",t),t}(),this.roomCode=null,this.roomRef=null,this.playerRef=null,this.isHost=!1,this.lastScoreWrite=0,this._roomListener=null,this._onRoomUpdate=null,this._serverOffset=0,this.db.ref(".info/serverTimeOffset").on("value",e=>{this._serverOffset=e.val()||0})}serverNow(){return Date.now()+this._serverOffset}async createRoom(e){for(let t=0;t<5;t++){const t=i(),n=this.db.ref("rooms/"+t);if((await n.once("value")).exists())continue;const o={host:this.uid,createdAt:r.database.ServerValue.TIMESTAMP,status:"lobby",song:null,startAt:null,players:{[this.uid]:this._initialPlayer(e)}};return await n.set(o),this._attach(t,!0),t}throw new Error("Could not generate unique room code")}async joinRoom(e,t){if(!(e=(e||"").toUpperCase().trim()))throw new Error("Room code required");const n=this.db.ref("rooms/"+e);if(!(await n.once("value")).exists())throw new Error("Room not found");return await n.child("players/"+this.uid).set(this._initialPlayer(t)),this._attach(e,!1),e}_initialPlayer(e){return{name:(e||"Player").slice(0,20),joinedAt:r.database.ServerValue.TIMESTAMP,ready:!1,score:0,combo:0,maxCombo:0,accuracy:100,beatsHit:0,beatsMissed:0,finished:!1,rank:"",finalScore:0}}_attach(e,t){this.roomCode=e,this.isHost=t,this.roomRef=this.db.ref("rooms/"+e),this.playerRef=this.roomRef.child("players/"+this.uid),this.playerRef.onDisconnect().remove(),this._roomListener=e=>{const t=e.val();this._onRoomUpdate&&this._onRoomUpdate(t)},this.roomRef.on("value",this._roomListener)}onRoomUpdate(e){this._onRoomUpdate=e}async leaveRoom(){if(this.roomRef){try{this.roomRef.off("value",this._roomListener),await this.playerRef.onDisconnect().cancel(),await this.playerRef.remove();const e=await this.roomRef.child("players").once("value");if(e.exists()){if(this.isHost){const t=Object.keys(e.val())[0];await this.roomRef.child("host").set(t)}}else await this.roomRef.remove()}catch(e){}this.roomCode=null,this.roomRef=null,this.playerRef=null,this.isHost=!1}}async setReady(e){this.playerRef&&await this.playerRef.child("ready").set(!!e)}async setName(e){this.playerRef&&await this.playerRef.child("name").set((e||"Player").slice(0,20))}async broadcastSong(e){if(!this.isHost||!this.roomRef)return;const t={id:e.id||"",difficulty:e.difficulty||"",beatmapCharacteristic:e.beatmapCharacteristic||"",difficultyId:e.difficultyId||"",songName:e.songName||"",songSubName:e.songSubName||"",image:e.image||e.coverURL||"",version:e.version||"",directDownload:e.directDownload||"",downloads:e.downloads||"",downloadsText:e.downloadsText||"",songDuration:e.songDuration||0,metadata:e.metadata||{}};await this.roomRef.update({song:t});const n=(await this.roomRef.child("players").once("value")).val()||{},r={};Object.keys(n).forEach(e=>{r["players/"+e+"/ready"]=!1,r["players/"+e+"/finished"]=!1,r["players/"+e+"/score"]=0,r["players/"+e+"/finalScore"]=0,r["players/"+e+"/combo"]=0,r["players/"+e+"/maxCombo"]=0,r["players/"+e+"/accuracy"]=100,r["players/"+e+"/beatsHit"]=0,r["players/"+e+"/beatsMissed"]=0,r["players/"+e+"/rank"]=""}),await this.roomRef.update(r)}async startSong(e){if(!this.isHost||!this.roomRef)return;const t=this.serverNow()+("number"==typeof e?e:5e3);return await this.roomRef.update({status:"playing",startAt:t}),t}pushScore(e){if(!this.playerRef)return;const t=Date.now();t-this.lastScoreWrite<250||(this.lastScoreWrite=t,this.playerRef.update({score:0|e.score,combo:0|e.combo,maxCombo:0|e.maxCombo,accuracy:parseFloat(e.accuracy)||0,beatsHit:0|e.beatsHit,beatsMissed:0|e.beatsMissed}))}async pushFinal(e){this.playerRef&&(await this.playerRef.update({finished:!0,finalScore:0|e.score,score:0|e.score,maxCombo:0|e.maxCombo,accuracy:parseFloat(e.accuracy)||0,beatsHit:0|e.beatsHit,beatsMissed:0|e.beatsMissed,rank:e.rank||""}),this.isHost&&this.roomRef&&this.roomRef.update({status:"finished"}))}async resetForRematch(){this.isHost&&this.roomRef&&await this.roomRef.update({status:"lobby",startAt:null})}},START_DELAY_MS:5e3}},function(e,t,n){"use strict";n.r(t);n(137)},function(e,t,n){"use strict";(function(r){Object.defineProperty(t,"__esModule",{value:!0});var i,o,a=(i=n(18))&&"object"==typeof i&&"default"in i?i.default:i,s=n(7),c=n(12),l=n(20),u=n(19),h=function(){function e(e){this.domStorage_=e,this.prefix_="firebase:"}return e.prototype.set=function(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),c.stringify(t))},e.prototype.get=function(e){var t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:c.jsonEval(t)},e.prototype.remove=function(e){this.domStorage_.removeItem(this.prefixedName_(e))},e.prototype.prefixedName_=function(e){return this.prefix_+e},e.prototype.toString=function(){return this.domStorage_.toString()},e}(),d=function(){function e(){this.cache_={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t},e.prototype.get=function(e){return c.contains(this.cache_,e)?this.cache_[e]:null},e.prototype.remove=function(e){delete this.cache_[e]},e}(),p=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new h(t)}}catch(e){}return new d},f=p("localStorage"),m=p("sessionStorage"),g=new l.Logger("@firebase/database"),y=(o=1,function(){return o++}),v=function(e){var t=c.stringToByteArray(e),n=new c.Sha1;n.update(t);var r=n.digest();return c.base64.encodeByteArray(r)},b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n="",r=0;r<e.length;r++){var i=e[r];Array.isArray(i)||i&&"object"==typeof i&&"number"==typeof i.length?n+=b.apply(null,i):n+="object"==typeof i?c.stringify(i):i,n+=" "}return n},_=null,w=!0,E=function(e,t){c.assert(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(g.logLevel=l.LogLevel.VERBOSE,_=g.log.bind(g),t&&m.set("logging_enabled",!0)):"function"==typeof e?_=e:(_=null,m.remove("logging_enabled"))},A=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!0===w&&(w=!1,null===_&&!0===m.get("logging_enabled")&&E(!0)),_){var n=b.apply(null,e);_(n)}},x=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];A.apply(void 0,s.__spread([e],t))}},S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE INTERNAL ERROR: "+b.apply(void 0,s.__spread(e));g.error(n)},T=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE FATAL ERROR: "+b.apply(void 0,s.__spread(e));throw g.error(n),new Error(n)},M=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE WARNING: "+b.apply(void 0,s.__spread(e));g.warn(n)},R=function(e){return"number"==typeof e&&(e!=e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},C="[MIN_NAME]",k="[MAX_NAME]",I=function(e,t){if(e===t)return 0;if(e===C||t===k)return-1;if(t===C||e===k)return 1;var n=U(e),r=U(t);return null!==n?null!==r?n-r==0?e.length-t.length:n-r:-1:null!==r?1:e<t?-1:1},P=function(e,t){return e===t?0:e<t?-1:1},O=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+c.stringify(t))},N=function(e){if("object"!=typeof e||null===e)return c.stringify(e);var t=[];for(var n in e)t.push(n);t.sort();for(var r="{",i=0;i<t.length;i++)0!==i&&(r+=","),r+=c.stringify(t[i]),r+=":",r+=N(e[t[i]]);return r+="}"},D=function(e,t){var n=e.length;if(n<=t)return[e];for(var r=[],i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function L(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}var F=function(e){c.assert(!R(e),"Invalid JSON number");var t,n,r,i,o;0===e?(n=0,r=0,t=1/e==-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,r=Math.round(e*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(e/Math.pow(2,-1074))));var a=[];for(o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(t?1:0),a.reverse();var s=a.join(""),l="";for(o=0;o<64;o+=8){var u=parseInt(s.substr(o,8),2).toString(16);1===u.length&&(u="0"+u),l+=u}return l.toLowerCase()},j=new RegExp("^-?(0*)\\d{1,10}$"),U=function(e){if(j.test(e)){var t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},B=function(e){try{e()}catch(e){setTimeout((function(){var t=e.stack||"";throw M("Exception was thrown by user callback.",t),e}),Math.floor(0))}},V=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n},H=function(){function e(e,t){if(void 0===t){this.pieces_=e.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!1,configurable:!0}),e.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},e.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},e.prototype.popFront=function(){var t=this.pieceNum_;return t<this.pieces_.length&&t++,new e(this.pieces_,t)},e.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"},e.prototype.toUrlEncodedString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+encodeURIComponent(String(this.pieces_[t])));return e||"/"},e.prototype.slice=function(e){return void 0===e&&(e=0),this.pieces_.slice(this.pieceNum_+e)},e.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var t=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)t.push(this.pieces_[n]);return new e(t,0)},e.prototype.child=function(t){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(t instanceof e)for(r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);else{var i=t.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new e(n,0)},e.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},e.relativePath=function(t,n){var r=t.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return e.relativePath(t.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),r=t.slice(),i=0;i<n.length&&i<r.length;i++){var o=I(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},e.prototype.equals=function(e){if(this.getLength()!==e.getLength())return!1;for(var t=this.pieceNum_,n=e.pieceNum_;t<=this.pieces_.length;t++,n++)if(this.pieces_[t]!==e.pieces_[n])return!1;return!0},e.prototype.contains=function(e){var t=this.pieceNum_,n=e.pieceNum_;if(this.getLength()>e.getLength())return!1;for(;t<this.pieces_.length;){if(this.pieces_[t]!==e.pieces_[n])return!1;++t,++n}return!0},e}(),z=function(){function e(e,t){this.errorPrefix_=t,this.parts_=e.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=c.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(e,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!1,configurable:!0}),Object.defineProperty(e,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!1,configurable:!0}),e.prototype.push=function(e){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(e),this.byteLength_+=c.stringLength(e),this.checkValid_()},e.prototype.pop=function(){var e=this.parts_.pop();this.byteLength_-=c.stringLength(e),this.parts_.length>0&&(this.byteLength_-=1)},e.prototype.checkValid_=function(){if(this.byteLength_>e.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>e.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},e}(),q=function(){function e(e,t,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o=!1),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.includeNamespaceInQueryParams=o,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=f.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()||this.includeNamespaceInQueryParams},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&f.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){var n;if(c.assert("string"==typeof e,"typeof type must == string"),c.assert("object"==typeof t,"typeof params must == object"),"websocket"===e)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if("long_polling"!==e)throw new Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var r=[];return L(t,(function(e,t){r.push(e+"="+t)})),n+r.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();var G,W,J,Z,Y,X=function(e){var t=Q(e),n=t.namespace;"firebase.com"===t.domain&&T(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!==n||"localhost"===t.domain||T("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&M("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===t.scheme||"wss"===t.scheme;return{repoInfo:new q(t.host,t.secure,n,r,"",n!==t.subdomain),path:new H(t.pathString)}},Q=function(e){var t="",n="",r="",i="",o="",a=!0,c="https",l=443;if("string"==typeof e){var u=e.indexOf("//");u>=0&&(c=e.substring(0,u-1),e=e.substring(u+2));var h=e.indexOf("/");-1===h&&(h=e.length);var d=e.indexOf("?");-1===d&&(d=e.length),t=e.substring(0,Math.min(h,d)),h<d&&(i=/*** @license* Copyright 2017 Google LLC@@ -1306,7 +1306,7 @@ var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Arr* See the License for the specific language governing permissions and* limitations under the License.*/-function(e){for(var t="",n=e.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(e){}t+="/"+i}return t}(e.substring(h,d)));var p=function(e){var t,n,r={};"?"===e.charAt(0)&&(e=e.substring(1));try{for(var i=s.__values(e.split("&")),o=i.next();!o.done;o=i.next()){var a=o.value;if(0!==a.length){var c=a.split("=");2===c.length?r[decodeURIComponent(c[0])]=decodeURIComponent(c[1]):M("Invalid query segment '"+a+"' in query '"+e+"'")}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(e.substring(Math.min(e.length,d)));(u=t.indexOf(":"))>=0?(a="https"===c||"wss"===c,l=parseInt(t.substring(u+1),10)):u=t.length;var f=t.slice(0,u);if("localhost"===f.toLowerCase())n="localhost";else if(f.split(".").length<=2)n=f;else{var m=t.indexOf(".");r=t.substring(0,m).toLowerCase(),n=t.substring(m+1),o=r}"ns"in p&&(o=p.ns)}return{host:t,port:l,domain:n,subdomain:r,secure:a,scheme:c,pathString:i,namespace:o}},K=/[\[\].#$\/\u0000-\u001F\u007F]/,$=/[\[\].#$\u0000-\u001F\u007F]/,ee=function(e){return"string"==typeof e&&0!==e.length&&!K.test(e)},te=function(e){return"string"==typeof e&&0!==e.length&&!$.test(e)},ne=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!R(e)||e&&"object"==typeof e&&c.contains(e,".sv")},re=function(e,t,n,r,i){i&&void 0===n||ie(c.errorPrefix(e,t,i),n,r)},ie=function(e,t,n){var r=n instanceof H?new z(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+r.toErrorString());if("function"==typeof t)throw new Error(e+"contains a function "+r.toErrorString()+" with contents = "+t.toString());if(R(t))throw new Error(e+"contains "+t.toString()+" "+r.toErrorString());if("string"==typeof t&&t.length>10485760/3&&c.stringLength(t)>10485760)throw new Error(e+"contains a string greater than 10485760 utf8 bytes "+r.toErrorString()+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var i=!1,o=!1;if(L(t,(function(t,n){if(".value"===t)i=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!ee(t)))throw new Error(e+" contains an invalid key ("+t+") "+r.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(t),ie(e,n,r),r.pop()})),i&&o)throw new Error(e+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},oe=function(e,t,n,r,i){if(!i||void 0!==n){var o=c.errorPrefix(e,t,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];L(n,(function(e,t){var n=new H(e);if(ie(o,t,r.child(n)),".priority"===n.getBack()&&!ne(t))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(e,t){var n,r;for(n=0;n<t.length;n++)for(var i=(r=t[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!ee(i[o]))throw new Error(e+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');t.sort(H.comparePaths);var a=null;for(n=0;n<t.length;n++){if(r=t[n],null!==a&&a.contains(r))throw new Error(e+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(o,a)}},ae=function(e,t,n,r){if(!r||void 0!==n){if(R(n))throw new Error(c.errorPrefix(e,t,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!ne(n))throw new Error(c.errorPrefix(e,t,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},se=function(e,t,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(c.errorPrefix(e,t,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},ce=function(e,t,n,r){if(!(r&&void 0===n||ee(n)))throw new Error(c.errorPrefix(e,t,r)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},le=function(e,t,n,r){if(!(r&&void 0===n||te(n)))throw new Error(c.errorPrefix(e,t,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},ue=function(e,t,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),le(e,t,n,r)},he=function(e,t){if(".info"===t.getFront())throw new Error(e+" failed = Can't modify data under /.info/")},de=function(e,t,n){var r=n.path.toString();if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!ee(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),te(e)}(r))throw new Error(c.errorPrefix(e,t,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},pe=function(e,t,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw new Error(c.errorPrefix(e,t,r)+"must be a boolean.")},fe=function(){function e(e,t){this.repo_=e,this.path_=t}return e.prototype.cancel=function(e){c.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),c.validateCallback("OnDisconnect.cancel",1,e,!0);var t=new c.Deferred;return this.repo_.onDisconnectCancel(this.path_,t.wrapCallback(e)),t.promise},e.prototype.remove=function(e){c.validateArgCount("OnDisconnect.remove",0,1,arguments.length),he("OnDisconnect.remove",this.path_),c.validateCallback("OnDisconnect.remove",1,e,!0);var t=new c.Deferred;return this.repo_.onDisconnectSet(this.path_,null,t.wrapCallback(e)),t.promise},e.prototype.set=function(e,t){c.validateArgCount("OnDisconnect.set",1,2,arguments.length),he("OnDisconnect.set",this.path_),re("OnDisconnect.set",1,e,this.path_,!1),c.validateCallback("OnDisconnect.set",2,t,!0);var n=new c.Deferred;return this.repo_.onDisconnectSet(this.path_,e,n.wrapCallback(t)),n.promise},e.prototype.setWithPriority=function(e,t,n){c.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),he("OnDisconnect.setWithPriority",this.path_),re("OnDisconnect.setWithPriority",1,e,this.path_,!1),ae("OnDisconnect.setWithPriority",2,t,!1),c.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new c.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,e,t,r.wrapCallback(n)),r.promise},e.prototype.update=function(e,t){if(c.validateArgCount("OnDisconnect.update",1,2,arguments.length),he("OnDisconnect.update",this.path_),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,M("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}oe("OnDisconnect.update",1,e,this.path_,!1),c.validateCallback("OnDisconnect.update",2,t,!0);var i=new c.Deferred;return this.repo_.onDisconnectUpdate(this.path_,e,i.wrapCallback(t)),i.promise},e}(),me=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return c.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}(),ge=(G="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",W=0,J=[],function(e){var t,n=e===W;W=e;var r=new Array(8);for(t=7;t>=0;t--)r[t]=G.charAt(e%64),e=Math.floor(e/64);c.assert(0===e,"Cannot push at time == 0");var i=r.join("");if(n){for(t=11;t>=0&&63===J[t];t--)J[t]=0;J[t]++}else for(t=0;t<12;t++)J[t]=Math.floor(64*Math.random());for(t=0;t<12;t++)i+=G.charAt(J[t]);return c.assert(20===i.length,"nextPushId: Length should be 20."),i}),ye=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}(),ve=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new ye(C,e),r=new ye(C,t);return 0!==this.compare(n,r)},e.prototype.minPost=function(){return ye.MIN},e}(),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return Z},set:function(e){Z=e},enumerable:!1,configurable:!0}),t.prototype.compare=function(e,t){return I(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw c.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return ye.MIN},t.prototype.maxPost=function(){return new ye(k,Z)},t.prototype.makePost=function(e,t){return c.assert("string"==typeof e,"KeyIndex indexValue must always be a string."),new ye(e,Z)},t.prototype.toString=function(){return".key"},t}(ve),_e=new be;var we,Ee,Ae,xe=function(e){return"number"==typeof e?"number:"+F(e):"string:"+e},Se=function(e){if(e.isLeafNode()){var t=e.val();c.assert("string"==typeof t||"number"==typeof t||"object"==typeof t&&c.contains(t,".sv"),"Priority must be a string or number.")}else c.assert(e===X||e.isEmpty(),"priority of unexpected type.");c.assert(e===X||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Te=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,c.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Se(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return we},set:function(e){we=e},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var r=t.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(c.assert(".priority"!==r||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+xe(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?F(this.value_):this.value_,this.lazyHash_=v(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(c.assert(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,r=typeof this.value_,i=e.VALUE_TYPE_ORDER.indexOf(n),o=e.VALUE_TYPE_ORDER.indexOf(r);return c.assert(i>=0,"Unknown leaf type: "+n),c.assert(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:o-i},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode()){var t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();var Me,Re,Ce=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?I(e.name,t.name):i},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return ye.MIN},t.prototype.maxPost=function(){return new ye(k,new Te("[PRIORITY-POST]",Ae))},t.prototype.makePost=function(e,t){var n=Ee(e);return new ye(t,new Te("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(ve)),ke=function(){function e(e,t,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.nodeStack_.length>0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),Ie=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:Oe.EMPTY_NODE,this.right=null!=o?o:Oe.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return Oe.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var n,r;if(t(e,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return Oe.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight_())).rotateLeft_()).colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Pe=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new Ie(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),Oe=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,Ie.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,Ie.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,r=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new ke(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new ke(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new ke(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new ke(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Pe,e}(),Ne=Math.log(2),De=function(){function e(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/Ne,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=e+1&r}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<<this.current_);return this.current_--,e},e}(),Le=function(e,t,n,r){e.sort(t);var i=function(t,r){var o,a,s=r-t;if(0===s)return null;if(1===s)return o=e[t],a=n?n(o):o,new Ie(a,o.node,Ie.BLACK,null,null);var c=parseInt(s/2,10)+t,l=i(t,c),u=i(c+1,r);return o=e[c],a=n?n(o):o,new Ie(a,o.node,Ie.BLACK,l,u)},o=function(t){for(var r=null,o=null,a=e.length,s=function(t,r){var o=a-t,s=a;a-=t;var l=i(o+1,s),u=e[o],h=n?n(u):u;c(new Ie(h,u.node,r,null,l))},c=function(e){r?(r.left=e,r=e):(o=e,r=e)},l=0;l<t.count;++l){var u=t.nextBitIsOne(),h=Math.pow(2,t.count-(l+1));u?s(h,Ie.BLACK):(s(h,Ie.BLACK),s(h,Ie.RED))}return o}(new De(e.length));return new Oe(r||t,o)},Fe={},je=function(){function e(e,t){this.indexes_=e,this.indexSet_=t}return Object.defineProperty(e,"Default",{get:function(){return c.assert(Fe&&Ce,"ChildrenNode.ts has not been loaded"),Me=Me||new e({".priority":Fe},{".priority":Ce})},enumerable:!1,configurable:!0}),e.prototype.get=function(e){var t=c.safeGet(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof Oe?t:null},e.prototype.hasIndex=function(e){return c.contains(this.indexSet_,e.toString())},e.prototype.addIndex=function(t,n){c.assert(t!==_e,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],o=!1,a=n.getIterator(ye.Wrap),l=a.getNext();l;)o=o||t.isDefinedOn(l.node),i.push(l),l=a.getNext();r=o?Le(i,t.getCompare()):Fe;var u=t.toString(),h=s.__assign({},this.indexSet_);h[u]=t;var d=s.__assign({},this.indexes_);return d[u]=r,new e(d,h)},e.prototype.addToIndexes=function(t,n){var r=this;return new e(c.map(this.indexes_,(function(e,i){var o=c.safeGet(r.indexSet_,i);if(c.assert(o,"Missing index implementation for "+i),e===Fe){if(o.isDefinedOn(t.node)){for(var a=[],s=n.getIterator(ye.Wrap),l=s.getNext();l;)l.name!==t.name&&a.push(l),l=s.getNext();return a.push(t),Le(a,o.getCompare())}return Fe}var u=n.get(t.name),h=e;return u&&(h=h.remove(new ye(t.name,u))),h.insert(t,t.node)})),this.indexSet_)},e.prototype.removeFromIndexes=function(t,n){return new e(c.map(this.indexes_,(function(e){if(e===Fe)return e;var r=n.get(t.name);return r?e.remove(new ye(t.name,r)):e})),this.indexSet_)},e}();+function(e){for(var t="",n=e.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(e){}t+="/"+i}return t}(e.substring(h,d)));var p=function(e){var t,n,r={};"?"===e.charAt(0)&&(e=e.substring(1));try{for(var i=s.__values(e.split("&")),o=i.next();!o.done;o=i.next()){var a=o.value;if(0!==a.length){var c=a.split("=");2===c.length?r[decodeURIComponent(c[0])]=decodeURIComponent(c[1]):M("Invalid query segment '"+a+"' in query '"+e+"'")}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(e.substring(Math.min(e.length,d)));(u=t.indexOf(":"))>=0?(a="https"===c||"wss"===c,l=parseInt(t.substring(u+1),10)):u=t.length;var f=t.slice(0,u);if("localhost"===f.toLowerCase())n="localhost";else if(f.split(".").length<=2)n=f;else{var m=t.indexOf(".");r=t.substring(0,m).toLowerCase(),n=t.substring(m+1),o=r}"ns"in p&&(o=p.ns)}return{host:t,port:l,domain:n,subdomain:r,secure:a,scheme:c,pathString:i,namespace:o}},K=/[\[\].#$\/\u0000-\u001F\u007F]/,$=/[\[\].#$\u0000-\u001F\u007F]/,ee=function(e){return"string"==typeof e&&0!==e.length&&!K.test(e)},te=function(e){return"string"==typeof e&&0!==e.length&&!$.test(e)},ne=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!R(e)||e&&"object"==typeof e&&c.contains(e,".sv")},re=function(e,t,n,r,i){i&&void 0===n||ie(c.errorPrefix(e,t,i),n,r)},ie=function(e,t,n){var r=n instanceof H?new z(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+r.toErrorString());if("function"==typeof t)throw new Error(e+"contains a function "+r.toErrorString()+" with contents = "+t.toString());if(R(t))throw new Error(e+"contains "+t.toString()+" "+r.toErrorString());if("string"==typeof t&&t.length>10485760/3&&c.stringLength(t)>10485760)throw new Error(e+"contains a string greater than 10485760 utf8 bytes "+r.toErrorString()+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var i=!1,o=!1;if(L(t,(function(t,n){if(".value"===t)i=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!ee(t)))throw new Error(e+" contains an invalid key ("+t+") "+r.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(t),ie(e,n,r),r.pop()})),i&&o)throw new Error(e+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},oe=function(e,t,n,r,i){if(!i||void 0!==n){var o=c.errorPrefix(e,t,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];L(n,(function(e,t){var n=new H(e);if(ie(o,t,r.child(n)),".priority"===n.getBack()&&!ne(t))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(e,t){var n,r;for(n=0;n<t.length;n++)for(var i=(r=t[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!ee(i[o]))throw new Error(e+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');t.sort(H.comparePaths);var a=null;for(n=0;n<t.length;n++){if(r=t[n],null!==a&&a.contains(r))throw new Error(e+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(o,a)}},ae=function(e,t,n,r){if(!r||void 0!==n){if(R(n))throw new Error(c.errorPrefix(e,t,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!ne(n))throw new Error(c.errorPrefix(e,t,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},se=function(e,t,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(c.errorPrefix(e,t,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},ce=function(e,t,n,r){if(!(r&&void 0===n||ee(n)))throw new Error(c.errorPrefix(e,t,r)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},le=function(e,t,n,r){if(!(r&&void 0===n||te(n)))throw new Error(c.errorPrefix(e,t,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},ue=function(e,t,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),le(e,t,n,r)},he=function(e,t){if(".info"===t.getFront())throw new Error(e+" failed = Can't modify data under /.info/")},de=function(e,t,n){var r=n.path.toString();if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!ee(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),te(e)}(r))throw new Error(c.errorPrefix(e,t,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},pe=function(e,t,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw new Error(c.errorPrefix(e,t,r)+"must be a boolean.")},fe=function(){function e(e,t){this.repo_=e,this.path_=t}return e.prototype.cancel=function(e){c.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),c.validateCallback("OnDisconnect.cancel",1,e,!0);var t=new c.Deferred;return this.repo_.onDisconnectCancel(this.path_,t.wrapCallback(e)),t.promise},e.prototype.remove=function(e){c.validateArgCount("OnDisconnect.remove",0,1,arguments.length),he("OnDisconnect.remove",this.path_),c.validateCallback("OnDisconnect.remove",1,e,!0);var t=new c.Deferred;return this.repo_.onDisconnectSet(this.path_,null,t.wrapCallback(e)),t.promise},e.prototype.set=function(e,t){c.validateArgCount("OnDisconnect.set",1,2,arguments.length),he("OnDisconnect.set",this.path_),re("OnDisconnect.set",1,e,this.path_,!1),c.validateCallback("OnDisconnect.set",2,t,!0);var n=new c.Deferred;return this.repo_.onDisconnectSet(this.path_,e,n.wrapCallback(t)),n.promise},e.prototype.setWithPriority=function(e,t,n){c.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),he("OnDisconnect.setWithPriority",this.path_),re("OnDisconnect.setWithPriority",1,e,this.path_,!1),ae("OnDisconnect.setWithPriority",2,t,!1),c.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new c.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,e,t,r.wrapCallback(n)),r.promise},e.prototype.update=function(e,t){if(c.validateArgCount("OnDisconnect.update",1,2,arguments.length),he("OnDisconnect.update",this.path_),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,M("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}oe("OnDisconnect.update",1,e,this.path_,!1),c.validateCallback("OnDisconnect.update",2,t,!0);var i=new c.Deferred;return this.repo_.onDisconnectUpdate(this.path_,e,i.wrapCallback(t)),i.promise},e}(),me=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return c.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}(),ge=(G="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",W=0,J=[],function(e){var t,n=e===W;W=e;var r=new Array(8);for(t=7;t>=0;t--)r[t]=G.charAt(e%64),e=Math.floor(e/64);c.assert(0===e,"Cannot push at time == 0");var i=r.join("");if(n){for(t=11;t>=0&&63===J[t];t--)J[t]=0;J[t]++}else for(t=0;t<12;t++)J[t]=Math.floor(64*Math.random());for(t=0;t<12;t++)i+=G.charAt(J[t]);return c.assert(20===i.length,"nextPushId: Length should be 20."),i}),ye=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}(),ve=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new ye(C,e),r=new ye(C,t);return 0!==this.compare(n,r)},e.prototype.minPost=function(){return ye.MIN},e}(),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return Z},set:function(e){Z=e},enumerable:!1,configurable:!0}),t.prototype.compare=function(e,t){return I(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw c.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return ye.MIN},t.prototype.maxPost=function(){return new ye(k,Z)},t.prototype.makePost=function(e,t){return c.assert("string"==typeof e,"KeyIndex indexValue must always be a string."),new ye(e,Z)},t.prototype.toString=function(){return".key"},t}(ve),_e=new be;var we,Ee,Ae,xe=function(e){return"number"==typeof e?"number:"+F(e):"string:"+e},Se=function(e){if(e.isLeafNode()){var t=e.val();c.assert("string"==typeof t||"number"==typeof t||"object"==typeof t&&c.contains(t,".sv"),"Priority must be a string or number.")}else c.assert(e===Y||e.isEmpty(),"priority of unexpected type.");c.assert(e===Y||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Te=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,c.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Se(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return we},set:function(e){we=e},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var r=t.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(c.assert(".priority"!==r||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+xe(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?F(this.value_):this.value_,this.lazyHash_=v(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(c.assert(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,r=typeof this.value_,i=e.VALUE_TYPE_ORDER.indexOf(n),o=e.VALUE_TYPE_ORDER.indexOf(r);return c.assert(i>=0,"Unknown leaf type: "+n),c.assert(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:o-i},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode()){var t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();var Me,Re,Ce=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?I(e.name,t.name):i},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return ye.MIN},t.prototype.maxPost=function(){return new ye(k,new Te("[PRIORITY-POST]",Ae))},t.prototype.makePost=function(e,t){var n=Ee(e);return new ye(t,new Te("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(ve)),ke=function(){function e(e,t,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.nodeStack_.length>0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),Ie=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:Oe.EMPTY_NODE,this.right=null!=o?o:Oe.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return Oe.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var n,r;if(t(e,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return Oe.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight_())).rotateLeft_()).colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Pe=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new Ie(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),Oe=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,Ie.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,Ie.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,r=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new ke(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new ke(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new ke(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new ke(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Pe,e}(),Ne=Math.log(2),De=function(){function e(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/Ne,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=e+1&r}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<<this.current_);return this.current_--,e},e}(),Le=function(e,t,n,r){e.sort(t);var i=function(t,r){var o,a,s=r-t;if(0===s)return null;if(1===s)return o=e[t],a=n?n(o):o,new Ie(a,o.node,Ie.BLACK,null,null);var c=parseInt(s/2,10)+t,l=i(t,c),u=i(c+1,r);return o=e[c],a=n?n(o):o,new Ie(a,o.node,Ie.BLACK,l,u)},o=function(t){for(var r=null,o=null,a=e.length,s=function(t,r){var o=a-t,s=a;a-=t;var l=i(o+1,s),u=e[o],h=n?n(u):u;c(new Ie(h,u.node,r,null,l))},c=function(e){r?(r.left=e,r=e):(o=e,r=e)},l=0;l<t.count;++l){var u=t.nextBitIsOne(),h=Math.pow(2,t.count-(l+1));u?s(h,Ie.BLACK):(s(h,Ie.BLACK),s(h,Ie.RED))}return o}(new De(e.length));return new Oe(r||t,o)},Fe={},je=function(){function e(e,t){this.indexes_=e,this.indexSet_=t}return Object.defineProperty(e,"Default",{get:function(){return c.assert(Fe&&Ce,"ChildrenNode.ts has not been loaded"),Me=Me||new e({".priority":Fe},{".priority":Ce})},enumerable:!1,configurable:!0}),e.prototype.get=function(e){var t=c.safeGet(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof Oe?t:null},e.prototype.hasIndex=function(e){return c.contains(this.indexSet_,e.toString())},e.prototype.addIndex=function(t,n){c.assert(t!==_e,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],o=!1,a=n.getIterator(ye.Wrap),l=a.getNext();l;)o=o||t.isDefinedOn(l.node),i.push(l),l=a.getNext();r=o?Le(i,t.getCompare()):Fe;var u=t.toString(),h=s.__assign({},this.indexSet_);h[u]=t;var d=s.__assign({},this.indexes_);return d[u]=r,new e(d,h)},e.prototype.addToIndexes=function(t,n){var r=this;return new e(c.map(this.indexes_,(function(e,i){var o=c.safeGet(r.indexSet_,i);if(c.assert(o,"Missing index implementation for "+i),e===Fe){if(o.isDefinedOn(t.node)){for(var a=[],s=n.getIterator(ye.Wrap),l=s.getNext();l;)l.name!==t.name&&a.push(l),l=s.getNext();return a.push(t),Le(a,o.getCompare())}return Fe}var u=n.get(t.name),h=e;return u&&(h=h.remove(new ye(t.name,u))),h.insert(t,t.node)})),this.indexSet_)},e.prototype.removeFromIndexes=function(t,n){return new e(c.map(this.indexes_,(function(e){if(e===Fe)return e;var r=n.get(t.name);return r?e.remove(new ye(t.name,r)):e})),this.indexSet_)},e}();/*** @license* Copyright 2017 Google LLC@@ -1339,7 +1339,7 @@ function Ue(e,t){return I(e.name,t.name)}function Be(e,t){return I(e,t)}* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.- */var Ve=function(){function e(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Se(this.priorityNode_),this.children_.isEmpty()&&c.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return Re||(Re=new e(new Oe(Be),null,je.Default))},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.priorityNode_||Re},e.prototype.updatePriority=function(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this.children_.get(e);return null===t?Re:t},e.prototype.getChild=function(e){var t=e.getFront();return null===t?this:this.getImmediateChild(t).getChild(e.popFront())},e.prototype.hasChild=function(e){return null!==this.children_.get(e)},e.prototype.updateImmediateChild=function(t,n){if(c.assert(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var r=new ye(t,n),i=void 0,o=void 0;n.isEmpty()?(i=this.children_.remove(t),o=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(t,n),o=this.indexMap_.addToIndexes(r,this.children_));var a=i.isEmpty()?Re:this.priorityNode_;return new e(i,a,o)},e.prototype.updateChild=function(e,t){var n=e.getFront();if(null===n)return t;c.assert(".priority"!==e.getFront()||1===e.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(e.popFront(),t);return this.updateImmediateChild(n,r)},e.prototype.isEmpty=function(){return this.children_.isEmpty()},e.prototype.numChildren=function(){return this.children_.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(Ce,(function(a,s){n[a]=s.val(t),r++,o&&e.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1})),!t&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.getPriority().isEmpty()||(e+="priority:"+xe(this.getPriority().val())+":"),this.forEachChild(Ce,(function(t,n){var r=n.hash();""!==r&&(e+=":"+t+":"+r)})),this.lazyHash_=""===e?"":v(e)}return this.lazyHash_},e.prototype.getPredecessorChildName=function(e,t,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new ye(e,t));return i?i.name:null}return this.children_.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.minKey();return n&&n.name}return this.children_.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new ye(t,this.children_.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.maxKey();return n&&n.name}return this.children_.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new ye(t,this.children_.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.resolveIndex_(e);return n?n.inorderTraversal((function(e){return t(e.name,e.node)})):this.children_.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,(function(e){return e}));for(var r=this.children_.getIteratorFrom(e.name,ye.Wrap),i=r.peek();null!=i&&t.compare(i,e)<0;)r.getNext(),i=r.peek();return r},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,(function(e){return e}));for(var r=this.children_.getReverseIteratorFrom(e.name,ye.Wrap),i=r.peek();null!=i&&t.compare(i,e)>0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===He?-1:0},e.prototype.withIndex=function(t){if(t===_e||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===_e||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(Ce),r=t.getIterator(Ce),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===_e?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),He=new(function(e){function t(){return e.call(this,new Oe(Be),Ve.EMPTY_NODE,je.Default)||this}return s.__extends(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return Ve.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(Ve));Object.defineProperties(ye,{MIN:{value:new ye(C,Ve.EMPTY_NODE)},MAX:{value:new ye(k,He)}}),be.__EMPTY_NODE=Ve.EMPTY_NODE,Te.__childrenNodeConstructor=Ve,X=He,function(e){Ae=e}(He);function ze(e,t){if(void 0===t&&(t=null),null===e)return Ve.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),c.assert(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e)return new Te(e,ze(t));if(e instanceof Array){var n=Ve.EMPTY_NODE;return L(e,(function(t,r){if(c.contains(e,t)&&"."!==t.substring(0,1)){var i=ze(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}})),n.updatePriority(ze(t))}var r=[],i=!1;if(L(e,(function(e,t){if("."!==e.substring(0,1)){var n=ze(t);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new ye(e,n)))}})),0===r.length)return Ve.EMPTY_NODE;var o=Le(r,Ue,(function(e){return e.name}),Be);if(i){var a=Le(r,Ce.getCompare());return new Ve(o,ze(t),new je({".priority":a},{".priority":Ce}))}return new Ve(o,ze(t),je.Default)}!function(e){Ee=e}(ze);+ */var Ve=function(){function e(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Se(this.priorityNode_),this.children_.isEmpty()&&c.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return Re||(Re=new e(new Oe(Be),null,je.Default))},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.priorityNode_||Re},e.prototype.updatePriority=function(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this.children_.get(e);return null===t?Re:t},e.prototype.getChild=function(e){var t=e.getFront();return null===t?this:this.getImmediateChild(t).getChild(e.popFront())},e.prototype.hasChild=function(e){return null!==this.children_.get(e)},e.prototype.updateImmediateChild=function(t,n){if(c.assert(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var r=new ye(t,n),i=void 0,o=void 0;n.isEmpty()?(i=this.children_.remove(t),o=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(t,n),o=this.indexMap_.addToIndexes(r,this.children_));var a=i.isEmpty()?Re:this.priorityNode_;return new e(i,a,o)},e.prototype.updateChild=function(e,t){var n=e.getFront();if(null===n)return t;c.assert(".priority"!==e.getFront()||1===e.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(e.popFront(),t);return this.updateImmediateChild(n,r)},e.prototype.isEmpty=function(){return this.children_.isEmpty()},e.prototype.numChildren=function(){return this.children_.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(Ce,(function(a,s){n[a]=s.val(t),r++,o&&e.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1})),!t&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.getPriority().isEmpty()||(e+="priority:"+xe(this.getPriority().val())+":"),this.forEachChild(Ce,(function(t,n){var r=n.hash();""!==r&&(e+=":"+t+":"+r)})),this.lazyHash_=""===e?"":v(e)}return this.lazyHash_},e.prototype.getPredecessorChildName=function(e,t,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new ye(e,t));return i?i.name:null}return this.children_.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.minKey();return n&&n.name}return this.children_.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new ye(t,this.children_.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.maxKey();return n&&n.name}return this.children_.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new ye(t,this.children_.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.resolveIndex_(e);return n?n.inorderTraversal((function(e){return t(e.name,e.node)})):this.children_.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,(function(e){return e}));for(var r=this.children_.getIteratorFrom(e.name,ye.Wrap),i=r.peek();null!=i&&t.compare(i,e)<0;)r.getNext(),i=r.peek();return r},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,(function(e){return e}));for(var r=this.children_.getReverseIteratorFrom(e.name,ye.Wrap),i=r.peek();null!=i&&t.compare(i,e)>0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===He?-1:0},e.prototype.withIndex=function(t){if(t===_e||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===_e||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(Ce),r=t.getIterator(Ce),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===_e?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),He=new(function(e){function t(){return e.call(this,new Oe(Be),Ve.EMPTY_NODE,je.Default)||this}return s.__extends(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return Ve.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(Ve));Object.defineProperties(ye,{MIN:{value:new ye(C,Ve.EMPTY_NODE)},MAX:{value:new ye(k,He)}}),be.__EMPTY_NODE=Ve.EMPTY_NODE,Te.__childrenNodeConstructor=Ve,Y=He,function(e){Ae=e}(He);function ze(e,t){if(void 0===t&&(t=null),null===e)return Ve.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),c.assert(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e)return new Te(e,ze(t));if(e instanceof Array){var n=Ve.EMPTY_NODE;return L(e,(function(t,r){if(c.contains(e,t)&&"."!==t.substring(0,1)){var i=ze(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}})),n.updatePriority(ze(t))}var r=[],i=!1;if(L(e,(function(e,t){if("."!==e.substring(0,1)){var n=ze(t);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new ye(e,n)))}})),0===r.length)return Ve.EMPTY_NODE;var o=Le(r,Ue,(function(e){return e.name}),Be);if(i){var a=Le(r,Ce.getCompare());return new Ve(o,ze(t),new je({".priority":a},{".priority":Ce}))}return new Ve(o,ze(t),je.Default)}!function(e){Ee=e}(ze);/*** @license* Copyright 2017 Google LLC@@ -1356,7 +1356,7 @@ function Ue(e,t){return I(e.name,t.name)}function Be(e,t){return I(e,t)}* See the License for the specific language governing permissions and* limitations under the License.*/-var qe,Ge=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?I(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return ye.MIN},t.prototype.maxPost=function(){return ye.MAX},t.prototype.makePost=function(e,t){var n=ze(e);return new ye(t,n)},t.prototype.toString=function(){return".value"},t}(ve)),We=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,c.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return s.__extends(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?I(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=ze(e),r=Ve.EMPTY_NODE.updateChild(this.indexPath_,n);return new ye(t,r)},t.prototype.maxPost=function(){var e=Ve.EMPTY_NODE.updateChild(this.indexPath_,He);return new ye(k,e)},t.prototype.toString=function(){return this.indexPath_.slice().join("/")},t}(ve),Je=function(){function e(e,t,n){this.node_=e,this.ref_=t,this.index_=n}return e.prototype.val=function(){return c.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},e.prototype.exportVal=function(){return c.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},e.prototype.toJSON=function(){return c.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return c.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},e.prototype.child=function(t){c.validateArgCount("DataSnapshot.child",0,1,arguments.length),t=String(t),le("DataSnapshot.child",1,t,!1);var n=new H(t),r=this.ref_.child(n);return new e(this.node_.getChild(n),r,Ce)},e.prototype.hasChild=function(e){c.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),le("DataSnapshot.hasChild",1,e,!1);var t=new H(e);return!this.node_.getChild(t).isEmpty()},e.prototype.getPriority=function(){return c.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},e.prototype.forEach=function(t){var n=this;if(c.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),c.validateCallback("DataSnapshot.forEach",1,t,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return t(new e(i,n.ref_.child(r),Ce))}))},e.prototype.hasChildren=function(){return c.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!1,configurable:!0}),e.prototype.numChildren=function(){return c.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},e.prototype.getRef=function(){return c.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}(),Ze=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+c.stringify(this.snapshot.exportVal())},e}(),Xe=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),Ye=function(){function e(e,t,n){this.callback_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new Ze("value",this,new Je(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){c.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callback_;return function(){r.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Xe(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callback_||!this.callback_||t.callback_===this.callback_&&t.context_===this.context_)},e.prototype.hasAnyCallback=function(){return null!==this.callback_},e}(),Qe=function(){function e(e,t,n){this.callbacks_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,c.contains(this.callbacks_,t)},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Xe(this,e,t):null},e.prototype.createEvent=function(e,t){c.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),r=t.getQueryParams().getIndex();return new Ze(e.type,this,new Je(e.snapshotNode,n,r),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){c.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callbacks_[e.eventType];return function(){r.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){var n=this;if(t instanceof e){if(!this.callbacks_||!t.callbacks_)return!0;if(this.context_===t.context_){var r=Object.keys(t.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var a=r[0],s=i[0];return!(s!==a||t.callbacks_[a]&&this.callbacks_[s]&&t.callbacks_[a]!==this.callbacks_[s])}return i.every((function(e){return t.callbacks_[e]===n.callbacks_[e]}))}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.callbacks_},e}(),Ke=function(){function e(e,t,n,r){this.repo=e,this.path=t,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return c.assert(qe,"Reference.ts has not been loaded"),qe},set:function(e){qe=e},enumerable:!1,configurable:!0}),e.validateQueryEndpoints_=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===_e){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!==C)throw new Error(r);if("string"!=typeof t)throw new Error(i)}if(e.hasEnd()){if(e.getIndexEndName()!==k)throw new Error(r);if("string"!=typeof n)throw new Error(i)}}else if(e.getIndex()===Ce){if(null!=t&&!ne(t)||null!=n&&!ne(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(c.assert(e.getIndex()instanceof We||e.getIndex()===Ge,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.validateLimit_=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.validateNoPreviousOrderByCall_=function(e){if(!0===this.orderByCalled_)throw new Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.queryParams_},e.prototype.getRef=function(){return c.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,r,i){c.validateArgCount("Query.on",2,4,arguments.length),se("Query.on",1,t,!1),c.validateCallback("Query.on",2,n,!1);var o=e.getCancelAndContextArgs_("Query.on",r,i);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[t]=n,this.onChildEvent(a,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var r=new Ye(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,r)},e.prototype.onChildEvent=function(e,t,n){var r=new Qe(e,t,n);this.repo.addEventCallbackForQuery(this,r)},e.prototype.off=function(e,t,n){c.validateArgCount("Query.off",0,3,arguments.length),se("Query.off",1,e,!0),c.validateCallback("Query.off",2,t,!0),c.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===e){var o=t||null;r=new Ye(o,null,n||null)}else e&&(t&&((i={})[e]=t),r=new Qe(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},e.prototype.once=function(t,n,r,i){var o=this;c.validateArgCount("Query.once",1,4,arguments.length),se("Query.once",1,t,!1),c.validateCallback("Query.once",2,n,!0);var a=e.getCancelAndContextArgs_("Query.once",r,i),s=!0,l=new c.Deferred;l.promise.catch((function(){}));var u=function(e){s&&(s=!1,o.off(t,u),n&&n.bind(a.context)(e),l.resolve(e))};return this.on(t,u,(function(e){o.off(t,u),a.cancel&&a.cancel.bind(a.context)(e),l.reject(e)})),l.promise},e.prototype.limitToFirst=function(t){if(c.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToFirst(t),this.orderByCalled_)},e.prototype.limitToLast=function(t){if(c.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToLast(t),this.orderByCalled_)},e.prototype.orderByChild=function(t){if(c.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');le("Query.orderByChild",1,t,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new H(t);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new We(n),i=this.queryParams_.orderBy(r);return e.validateQueryEndpoints_(i),new e(this.repo,this.path,i,!0)},e.prototype.orderByKey=function(){c.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var t=this.queryParams_.orderBy(_e);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){c.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var t=this.queryParams_.orderBy(Ce);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){c.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var t=this.queryParams_.orderBy(Ge);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),c.validateArgCount("Query.startAt",0,2,arguments.length),re("Query.startAt",1,t,this.path,!0),ce("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),c.validateArgCount("Query.endAt",0,2,arguments.length),re("Query.endAt",1,t,this.path,!0),ce("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.equalTo=function(e,t){if(c.validateArgCount("Query.equalTo",1,2,arguments.length),re("Query.equalTo",1,e,this.path,!1),ce("Query.equalTo",2,t,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return c.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return c.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},e.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=N(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(c.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}var r=this.repo===t.repo,i=this.path.equals(t.path),o=this.queryIdentifier()===t.queryIdentifier();return r&&i&&o},e.getCancelAndContextArgs_=function(e,t,n){var r={cancel:null,context:null};if(t&&n)r.cancel=t,c.validateCallback(e,3,r.cancel,!0),r.context=n,c.validateContextObject(e,4,r.context,!0);else if(t)if("object"==typeof t&&null!==t)r.context=t;else{if("function"!=typeof t)throw new Error(c.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");r.cancel=t}return r},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}(),$e=function(){function e(e){this.node_=e}return e.prototype.getImmediateChild=function(t){return new e(this.node_.getImmediateChild(t))},e.prototype.node=function(){return this.node_},e}(),et=function(){function e(e,t){this.syncTree_=e,this.path_=t}return e.prototype.getImmediateChild=function(t){var n=this.path_.child(t);return new e(this.syncTree_,n)},e.prototype.node=function(){return this.syncTree_.calcCompleteEventCache(this.path_)},e}(),tt=function(e,t,n){return e&&"object"==typeof e?(c.assert(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?nt(e[".sv"],t,n):"object"==typeof e[".sv"]?rt(e[".sv"],t):void c.assert(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},nt=function(e,t,n){switch(e){case"timestamp":return n.timestamp;default:c.assert(!1,"Unexpected server value: "+e)}},rt=function(e,t,n){e.hasOwnProperty("increment")||c.assert(!1,"Unexpected server value: "+JSON.stringify(e,null,2));var r=e.increment;"number"!=typeof r&&c.assert(!1,"Unexpected increment value: "+r);var i=t.node();if(c.assert(null!=i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var o=i.getValue();return"number"!=typeof o?r:o+r},it=function(e,t,n,r){return at(t,new et(n,e),r)},ot=function(e,t,n){return at(e,new $e(t),n)};function at(e,t,n){var r,i=e.getPriority().val(),o=tt(i,t.getImmediateChild(".priority"),n);if(e.isLeafNode()){var a=e,s=tt(a.getValue(),t,n);return s!==a.getValue()||o!==a.getPriority().val()?new Te(s,ze(o)):e}var c=e;return r=c,o!==c.getPriority().val()&&(r=r.updatePriority(new Te(o))),c.forEachChild(Ce,(function(e,i){var o=at(i,t.getImmediateChild(e),n);o!==i&&(r=r.updateImmediateChild(e,o))})),r}+var qe,Ge=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?I(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return ye.MIN},t.prototype.maxPost=function(){return ye.MAX},t.prototype.makePost=function(e,t){var n=ze(e);return new ye(t,n)},t.prototype.toString=function(){return".value"},t}(ve)),We=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,c.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return s.__extends(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?I(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=ze(e),r=Ve.EMPTY_NODE.updateChild(this.indexPath_,n);return new ye(t,r)},t.prototype.maxPost=function(){var e=Ve.EMPTY_NODE.updateChild(this.indexPath_,He);return new ye(k,e)},t.prototype.toString=function(){return this.indexPath_.slice().join("/")},t}(ve),Je=function(){function e(e,t,n){this.node_=e,this.ref_=t,this.index_=n}return e.prototype.val=function(){return c.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},e.prototype.exportVal=function(){return c.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},e.prototype.toJSON=function(){return c.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return c.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},e.prototype.child=function(t){c.validateArgCount("DataSnapshot.child",0,1,arguments.length),t=String(t),le("DataSnapshot.child",1,t,!1);var n=new H(t),r=this.ref_.child(n);return new e(this.node_.getChild(n),r,Ce)},e.prototype.hasChild=function(e){c.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),le("DataSnapshot.hasChild",1,e,!1);var t=new H(e);return!this.node_.getChild(t).isEmpty()},e.prototype.getPriority=function(){return c.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},e.prototype.forEach=function(t){var n=this;if(c.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),c.validateCallback("DataSnapshot.forEach",1,t,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return t(new e(i,n.ref_.child(r),Ce))}))},e.prototype.hasChildren=function(){return c.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!1,configurable:!0}),e.prototype.numChildren=function(){return c.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},e.prototype.getRef=function(){return c.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}(),Ze=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+c.stringify(this.snapshot.exportVal())},e}(),Ye=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),Xe=function(){function e(e,t,n){this.callback_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new Ze("value",this,new Je(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){c.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callback_;return function(){r.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ye(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callback_||!this.callback_||t.callback_===this.callback_&&t.context_===this.context_)},e.prototype.hasAnyCallback=function(){return null!==this.callback_},e}(),Qe=function(){function e(e,t,n){this.callbacks_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,c.contains(this.callbacks_,t)},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ye(this,e,t):null},e.prototype.createEvent=function(e,t){c.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),r=t.getQueryParams().getIndex();return new Ze(e.type,this,new Je(e.snapshotNode,n,r),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){c.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callbacks_[e.eventType];return function(){r.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){var n=this;if(t instanceof e){if(!this.callbacks_||!t.callbacks_)return!0;if(this.context_===t.context_){var r=Object.keys(t.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var a=r[0],s=i[0];return!(s!==a||t.callbacks_[a]&&this.callbacks_[s]&&t.callbacks_[a]!==this.callbacks_[s])}return i.every((function(e){return t.callbacks_[e]===n.callbacks_[e]}))}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.callbacks_},e}(),Ke=function(){function e(e,t,n,r){this.repo=e,this.path=t,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return c.assert(qe,"Reference.ts has not been loaded"),qe},set:function(e){qe=e},enumerable:!1,configurable:!0}),e.validateQueryEndpoints_=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===_e){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!==C)throw new Error(r);if("string"!=typeof t)throw new Error(i)}if(e.hasEnd()){if(e.getIndexEndName()!==k)throw new Error(r);if("string"!=typeof n)throw new Error(i)}}else if(e.getIndex()===Ce){if(null!=t&&!ne(t)||null!=n&&!ne(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(c.assert(e.getIndex()instanceof We||e.getIndex()===Ge,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.validateLimit_=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.validateNoPreviousOrderByCall_=function(e){if(!0===this.orderByCalled_)throw new Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.queryParams_},e.prototype.getRef=function(){return c.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,r,i){c.validateArgCount("Query.on",2,4,arguments.length),se("Query.on",1,t,!1),c.validateCallback("Query.on",2,n,!1);var o=e.getCancelAndContextArgs_("Query.on",r,i);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[t]=n,this.onChildEvent(a,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var r=new Xe(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,r)},e.prototype.onChildEvent=function(e,t,n){var r=new Qe(e,t,n);this.repo.addEventCallbackForQuery(this,r)},e.prototype.off=function(e,t,n){c.validateArgCount("Query.off",0,3,arguments.length),se("Query.off",1,e,!0),c.validateCallback("Query.off",2,t,!0),c.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===e){var o=t||null;r=new Xe(o,null,n||null)}else e&&(t&&((i={})[e]=t),r=new Qe(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},e.prototype.once=function(t,n,r,i){var o=this;c.validateArgCount("Query.once",1,4,arguments.length),se("Query.once",1,t,!1),c.validateCallback("Query.once",2,n,!0);var a=e.getCancelAndContextArgs_("Query.once",r,i),s=!0,l=new c.Deferred;l.promise.catch((function(){}));var u=function(e){s&&(s=!1,o.off(t,u),n&&n.bind(a.context)(e),l.resolve(e))};return this.on(t,u,(function(e){o.off(t,u),a.cancel&&a.cancel.bind(a.context)(e),l.reject(e)})),l.promise},e.prototype.limitToFirst=function(t){if(c.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToFirst(t),this.orderByCalled_)},e.prototype.limitToLast=function(t){if(c.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToLast(t),this.orderByCalled_)},e.prototype.orderByChild=function(t){if(c.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');le("Query.orderByChild",1,t,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new H(t);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new We(n),i=this.queryParams_.orderBy(r);return e.validateQueryEndpoints_(i),new e(this.repo,this.path,i,!0)},e.prototype.orderByKey=function(){c.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var t=this.queryParams_.orderBy(_e);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){c.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var t=this.queryParams_.orderBy(Ce);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){c.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var t=this.queryParams_.orderBy(Ge);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),c.validateArgCount("Query.startAt",0,2,arguments.length),re("Query.startAt",1,t,this.path,!0),ce("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),c.validateArgCount("Query.endAt",0,2,arguments.length),re("Query.endAt",1,t,this.path,!0),ce("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.equalTo=function(e,t){if(c.validateArgCount("Query.equalTo",1,2,arguments.length),re("Query.equalTo",1,e,this.path,!1),ce("Query.equalTo",2,t,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return c.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return c.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},e.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=N(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(c.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}var r=this.repo===t.repo,i=this.path.equals(t.path),o=this.queryIdentifier()===t.queryIdentifier();return r&&i&&o},e.getCancelAndContextArgs_=function(e,t,n){var r={cancel:null,context:null};if(t&&n)r.cancel=t,c.validateCallback(e,3,r.cancel,!0),r.context=n,c.validateContextObject(e,4,r.context,!0);else if(t)if("object"==typeof t&&null!==t)r.context=t;else{if("function"!=typeof t)throw new Error(c.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");r.cancel=t}return r},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}(),$e=function(){function e(e){this.node_=e}return e.prototype.getImmediateChild=function(t){return new e(this.node_.getImmediateChild(t))},e.prototype.node=function(){return this.node_},e}(),et=function(){function e(e,t){this.syncTree_=e,this.path_=t}return e.prototype.getImmediateChild=function(t){var n=this.path_.child(t);return new e(this.syncTree_,n)},e.prototype.node=function(){return this.syncTree_.calcCompleteEventCache(this.path_)},e}(),tt=function(e,t,n){return e&&"object"==typeof e?(c.assert(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?nt(e[".sv"],t,n):"object"==typeof e[".sv"]?rt(e[".sv"],t):void c.assert(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},nt=function(e,t,n){switch(e){case"timestamp":return n.timestamp;default:c.assert(!1,"Unexpected server value: "+e)}},rt=function(e,t,n){e.hasOwnProperty("increment")||c.assert(!1,"Unexpected server value: "+JSON.stringify(e,null,2));var r=e.increment;"number"!=typeof r&&c.assert(!1,"Unexpected increment value: "+r);var i=t.node();if(c.assert(null!=i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var o=i.getValue();return"number"!=typeof o?r:o+r},it=function(e,t,n,r){return at(t,new et(n,e),r)},ot=function(e,t,n){return at(e,new $e(t),n)};function at(e,t,n){var r,i=e.getPriority().val(),o=tt(i,t.getImmediateChild(".priority"),n);if(e.isLeafNode()){var a=e,s=tt(a.getValue(),t,n);return s!==a.getValue()||o!==a.getPriority().val()?new Te(s,ze(o)):e}var c=e;return r=c,o!==c.getPriority().val()&&(r=r.updatePriority(new Te(o))),c.forEachChild(Ce,(function(e,i){var o=at(i,t.getImmediateChild(e),n);o!==i&&(r=r.updateImmediateChild(e,o))})),r}/*** @license* Copyright 2017 Google LLC@@ -1437,7 +1437,7 @@ var qe,Ge=new(function(e){function t(){return null!==e&&e.apply(this,arguments)|* See the License for the specific language governing permissions and* limitations under the License.*/-var Jt=null;"undefined"!=typeof MozWebSocket?Jt=MozWebSocket:"undefined"!=typeof WebSocket&&(Jt=WebSocket);var Zt=function(){function e(t,n,r,i,o){this.connId=t,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=x(this.connId),this.stats_=Dt.getCollection(n),this.connURL=e.connectionURL_(n,i,o)}return e.connectionURL_=function(e,t,n){var r={v:"5"};return!c.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),t&&(r.s=t),n&&(r.ls=n),e.connectionURL("websocket",r)},e.prototype.open=function(e,t){var n=this;this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,f.set("previous_websocket_failure",!0);try{if(c.isNodeSdk()){var i=c.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+Wt+"/"+r.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}},a=r.env,s=0===this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;s&&(o.proxy={origin:s}),this.mySock=new Jt(this.connURL,[],o)}else{o={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new Jt(this.connURL,[],o)}}catch(e){this.log_("Error instantiating WebSocket.");var l=e.message||e.data;return l&&this.log_(l),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(e){n.handleIncomingFrame(e)},this.mySock.onerror=function(e){n.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&n.log_(t),n.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==Jt&&!e.forceDisallow_},e.previouslyFailed=function(){return f.isInMemoryStorage||!0===f.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){f.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var t=this.frames.join("");this.frames=null;var n=c.jsonEval(t);this.onMessage(n)}},e.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},e.prototype.extractFrameCount_=function(e){if(c.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},e.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},e.prototype.send=function(e){this.resetKeepAlive();var t=c.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=D(t,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},e.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},e.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},e.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){e.mySock&&e.sendString_("0"),e.resetKeepAlive()}),Math.floor(45e3))},e.prototype.sendString_=function(e){try{this.mySock.send(e)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}(),Xt=function(){function e(e){this.initTransports_(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[qt,Zt]},enumerable:!1,configurable:!0}),e.prototype.initTransports_=function(t){var n,r,i=Zt&&Zt.isAvailable(),o=i&&!Zt.previouslyFailed();if(t.webSocketOnly&&(i||M("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),o=!0),o)this.transports_=[Zt];else{var a=this.transports_=[];try{for(var c=s.__values(e.ALL_TRANSPORTS),l=c.next();!l.done;l=c.next()){var u=l.value;u&&u.isAvailable()&&a.push(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}},e.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),Yt=function(){function e(e,t,n,r,i,o,a,s){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=a,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=x("c:"+this.id+":"),this.transportManager_=new Xt(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){e.conn_&&e.conn_.open(n,r)}),Math.floor(0));var i=t.healthyTimeout||0;i>0&&(this.healthyTimeout_=V((function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))}),Math.floor(i)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!==t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=O("t",e),n=O("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=O("t",e),n=O("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=O("t",e);if("d"in e){var n=e.d;if("h"===t)this.onHandshake_(n);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?S("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):S("Unknown control packet command: "+t)}},e.prototype.onHandshake_=function(e){var t=e.ts,n=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.updateHost(r),0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),"5"!==n&&M("Protocol version mismatch detected"),this.tryStartUpgrade_())},e.prototype.tryStartUpgrade_=function(){var e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)},e.prototype.startUpgrade_=function(e){var t=this;this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),V((function(){t.secondaryConn_&&(t.log_("Timed out trying to upgrade."),t.secondaryConn_.close())}),Math.floor(6e4))},e.prototype.onReset_=function(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.updateHost(e),1===this.state_?this.close():(this.closeConnections_(),this.start_())},e.prototype.onConnectionEstablished_=function(e,t){var n=this;this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):V((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},e.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},e.prototype.onSecondaryConnectionLost_=function(){var e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()},e.prototype.onConnectionLost_=function(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(f.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},e.prototype.onConnectionShutdown_=function(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()},e.prototype.sendData_=function(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)},e.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},e.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},e}(),Qt=function(){function e(){}return e.prototype.put=function(e,t,n,r){},e.prototype.merge=function(e,t,n,r){},e.prototype.refreshAuthToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}(),Kt=function(e){function t(n,r,i,o,a,s,l){var u=e.call(this)||this;if(u.repoInfo_=n,u.applicationId_=r,u.onDataUpdate_=i,u.onConnectStatus_=o,u.onServerInfoUpdate_=a,u.authTokenProvider_=s,u.authOverride_=l,u.id=t.nextPersistentConnectionId_++,u.log_=x("p:"+u.id+":"),u.interruptReasons_={},u.listens=new Map,u.outstandingPuts_=[],u.outstandingPutCount_=0,u.onDisconnectRequestQueue_=[],u.connected_=!1,u.reconnectDelay_=1e3,u.maxReconnectDelay_=3e5,u.securityDebugCallback_=null,u.lastSessionId=null,u.establishConnectionTimer_=null,u.visible_=!1,u.requestCBHash_={},u.requestNumber_=0,u.realtime_=null,u.authToken_=null,u.forceTokenRefresh_=!1,u.invalidAuthTokenCount_=0,u.firstConnection_=!0,u.lastConnectionAttemptTime_=null,u.lastConnectionEstablishedTime_=null,l&&!c.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return u.scheduleConnect_(0),Vt.getInstance().on("visible",u.onVisible_,u),-1===n.host.indexOf("fblocal")&&Ht.getInstance().on("online",u.onOnline_,u),u}return s.__extends(t,e),t.prototype.sendRequest=function(e,t,n){var r=++this.requestNumber_,i={r:r,a:e,b:t};this.log_(c.stringify(i)),c.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},t.prototype.listen=function(e,t,n,r){var i=e.queryIdentifier(),o=e.path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),c.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),c.assert(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:t,query:e,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)},t.prototype.sendListen_=function(e){var n=this,r=e.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=r.queryObject(),a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,c=a.s;t.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===e&&(n.log_("listen response",a),"ok"!==c&&n.removeListen_(i,o),e.onComplete&&e.onComplete(c,s))}))},t.warnOnListenWarnings_=function(e,t){if(e&&"object"==typeof e&&c.contains(e,"w")){var n=c.safeGet(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+t.getQueryParams().getIndex().toString()+'"',i=t.path.toString();M("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||c.isAdmin(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,n=c.isValidFormat(t)?"auth":"gauth",r={cred:t};null===this.authOverride_?r.noauth=!0:"object"==typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";e.authToken_===t&&("ok"===r?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(r,i))}))}},t.prototype.unlisten=function(e,t){var n=e.path.toString(),r=e.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),c.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e.queryObject(),t)},t.prototype.sendUnlisten_=function(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);var i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,n){this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,n,r){var i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,(function(e){r&&setTimeout((function(){r(e.s,e.d)}),Math.floor(0))}))},t.prototype.put=function(e,t,n,r){this.putInternal("p",e,t,n,r)},t.prototype.merge=function(e,t,n,r){this.putInternal("m",e,t,n,r)},t.prototype.putInternal=function(e,t,n,r,i){var o={p:t,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,(function(r){t.log_(n+" response",r),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),i&&i(r.s,r.d)}))},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,(function(e){if("ok"!==e.s){var n=e.d;t.log_("reportStats","Error sending stats: "+n)}}))}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+c.stringify(e));var t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):S("Unrecognized action received from server: "+c.stringify(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;c.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){t.establishConnectionTimer_=null,t.establishConnection_()}),Math.floor(e))},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},t.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+t.nextConnectionId_++,o=this,a=this.lastSessionId,s=!1,l=null,u=function(){l?l.close():(s=!0,r())};this.realtime_={close:u,sendRequest:function(e){c.assert(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(e)}};var h=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(h).then((function(t){s?A("getToken() completed but was canceled"):(A("getToken() completed. Creating connection."),o.authToken_=t&&t.accessToken,l=new Yt(i,o.repoInfo_,o.applicationId_,e,n,r,(function(e){M(e+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")}),a))})).then(null,(function(e){o.log_("Failed to get token: "+e),s||(c.CONSTANTS.NODE_ADMIN&&M(e),u())}))}},t.prototype.interrupt=function(e){A("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){A("Resuming connection for reason: "+e),delete this.interruptReasons_[e],c.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e<this.outstandingPuts_.length;e++){var t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},t.prototype.onListenRevoked_=function(e,t){var n;n=t?t.map((function(e){return N(e)})).join("$"):"default";var r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")},t.prototype.removeListen_=function(e,t){var n,r=new H(e).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(t),i.delete(t),0===i.size&&this.listens.delete(r)}else n=void 0;return n},t.prototype.onAuthRevoked_=function(e,t){A("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e,t,n,r;this.tryAuth();try{for(var i=s.__values(this.listens.values()),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var c=(n=void 0,s.__values(a.values())),l=c.next();!l.done;l=c.next()){var u=l.value;this.sendListen_(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}for(var h=0;h<this.outstandingPuts_.length;h++)this.outstandingPuts_[h]&&this.sendPut_(h);for(;this.onDisconnectRequestQueue_.length;){var d=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(d.action,d.pathString,d.data,d.onComplete)}},t.prototype.sendConnectStats_=function(){var e={},t="js";c.CONSTANTS.NODE_ADMIN?t="admin_node":c.CONSTANTS.NODE_CLIENT&&(t="node"),e["sdk."+t+"."+Wt.replace(/\./g,"-")]=1,c.isMobileCordova()?e["framework.cordova"]=1:c.isReactNative()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.shouldReconnect_=function(){var e=Ht.getInstance().currentlyOnline();return c.isEmpty(this.interruptReasons_)&&e},t.nextPersistentConnectionId_=0,t.nextConnectionId_=0,t}(Qt),$t=function(e){function t(t,n,r){var i=e.call(this)||this;return i.repoInfo_=t,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=x("p:rest:"),i.listens_={},i}return s.__extends(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:(c.assert(e.getQueryParams().isDefault(),"should have a tag if it's not a default query."),e.path.toString())},t.prototype.listen=function(e,n,r,i){var o=this,a=e.path.toString();this.log_("Listen called for "+a+" "+e.queryIdentifier());var s=t.getListenId_(e,r),l={};this.listens_[s]=l;var u=e.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",u,(function(e,t){var n=t;(404===e&&(n=null,e=null),null===e&&o.onDataUpdate_(a,n,!1,r),c.safeGet(o.listens_,s)===l)&&i(e?401===e?"permission_denied":"rest_error:"+e:"ok",null)}))},t.prototype.unlisten=function(e,n){var r=t.getListenId_(e,n);delete this.listens_[r]},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,n){var r=this;void 0===t&&(t={}),t.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var o=i&&i.accessToken;o&&(t.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+e+"?ns="+r.repoInfo_.namespace+c.querystring(t);r.log_("Sending REST request for "+a);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(n&&4===s.readyState){r.log_("REST Response for "+a+" received. status:",s.status,"response:",s.responseText);var e=null;if(s.status>=200&&s.status<300){try{e=c.jsonEval(s.responseText)}catch(e){M("Failed to parse JSON response for "+a+": "+s.responseText)}n(null,e)}else 401!==s.status&&404!==s.status&&M("Got unsuccessful REST response for "+a+" Status: "+s.status),n(s.status);n=null}},s.open("GET",a,!0),s.send()}))},t}(Qt),en=function(){function e(e,t,n,r){var i=this;if(this.repoInfo_=e,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new jt,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new ct,this.persistentConnection_=null,this.stats_=Dt.getCollection(e),t||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)this.server_=new $t(this.repoInfo_,this.onDataUpdate_.bind(this),r),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(null!=o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{c.stringify(o)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}this.persistentConnection_=new Kt(this.repoInfo_,n.options.appId,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),r,o),this.server_=this.persistentConnection_}r.addTokenChangeListener((function(e){i.server_.refreshAuthToken(e)})),this.statsReporter_=Dt.getOrCreateReporter(e,(function(){return new Ft(i.stats_,i.server_)})),this.transactionsInit_(),this.infoData_=new Ot,this.infoSyncTree_=new Pt({startListening:function(e,t,n,r){var o=[],a=i.infoData_.getNode(e.path);return a.isEmpty()||(o=i.infoSyncTree_.applyServerOverwrite(e.path,a),setTimeout((function(){r("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new Pt({startListening:function(e,t,n,r){return i.server_.listen(e,n,t,(function(t,n){var o=r(t,n);i.eventQueue_.raiseEventsForChangedPath(e.path,o)})),[]},stopListening:function(e,t){i.server_.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e.prototype.name=function(){return this.repoInfo_.namespace},e.prototype.serverTime=function(){var e=this.infoData_.getNode(new H(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e},e.prototype.generateServerValues=function(){return(e=(e={timestamp:this.serverTime()})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e},e.prototype.onDataUpdate_=function(e,t,n,r){this.dataUpdateCount++;var i=new H(e);t=this.interceptServerDataCallback_?this.interceptServerDataCallback_(e,t):t;var o=[];if(r)if(n){var a=c.map(t,(function(e){return ze(e)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var s=ze(t);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,s,r)}else if(n){var l=c.map(t,(function(e){return ze(e)}));o=this.serverSyncTree_.applyServerMerge(i,l)}else{var u=ze(t);o=this.serverSyncTree_.applyServerOverwrite(i,u)}var h=i;o.length>0&&(h=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(h,o)},e.prototype.interceptServerData_=function(e){this.interceptServerDataCallback_=e},e.prototype.onConnectStatus_=function(e){this.updateInfo_("connected",e),!1===e&&this.runOnDisconnectEvents_()},e.prototype.onServerInfoUpdate_=function(e){var t=this;L(e,(function(e,n){t.updateInfo_(e,n)}))},e.prototype.updateInfo_=function(e,t){var n=new H("/.info/"+e),r=ze(t);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},e.prototype.getNextWriteId_=function(){return this.nextWriteId_++},e.prototype.setWithPriority=function(e,t,n,r){var i=this;this.log_("set",{path:e.toString(),value:t,priority:n});var o=this.generateServerValues(),a=ze(t,n),s=this.serverSyncTree_.calcCompleteEventCache(e),c=ot(a,s,o),l=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserOverwrite(e,c,l,!0);this.eventQueue_.queueEvents(u),this.server_.put(e.toString(),a.val(!0),(function(t,n){var o="ok"===t;o||M("set at "+e+" failed: "+t);var a=i.serverSyncTree_.ackUserWrite(l,!o);i.eventQueue_.raiseEventsForChangedPath(e,a),i.callOnCompleteCallback(r,t,n)}));var h=this.abortTransactions_(e);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},e.prototype.update=function(e,t,n){var r=this;this.log_("update",{path:e.toString(),value:t});var i=!0,o=this.generateServerValues(),a={};if(L(t,(function(t,n){i=!1,a[t]=it(e.child(t),ze(n),r.serverSyncTree_,o)})),i)A("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var s=this.getNextWriteId_(),c=this.serverSyncTree_.applyUserMerge(e,a,s);this.eventQueue_.queueEvents(c),this.server_.merge(e.toString(),t,(function(t,i){var o="ok"===t;o||M("update at "+e+" failed: "+t);var a=r.serverSyncTree_.ackUserWrite(s,!o),c=a.length>0?r.rerunTransactions_(e):e;r.eventQueue_.raiseEventsForChangedPath(c,a),r.callOnCompleteCallback(n,t,i)})),L(t,(function(t){var n=r.abortTransactions_(e.child(t));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(e,[])}},e.prototype.runOnDisconnectEvents_=function(){var e=this;this.log_("onDisconnectEvents");var t=this.generateServerValues(),n=new ct;this.onDisconnect_.forEachTree(H.Empty,(function(r,i){var o=it(r,i,e.serverSyncTree_,t);n.remember(r,o)}));var r=[];n.forEachTree(H.Empty,(function(t,n){r=r.concat(e.serverSyncTree_.applyServerOverwrite(t,n));var i=e.abortTransactions_(t);e.rerunTransactions_(i)})),this.onDisconnect_=new ct,this.eventQueue_.raiseEventsForChangedPath(H.Empty,r)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.server_.onDisconnectCancel(e.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(e),n.callOnCompleteCallback(t,r,i)}))},e.prototype.onDisconnectSet=function(e,t,n){var r=this,i=ze(t);this.server_.onDisconnectPut(e.toString(),i.val(!0),(function(t,o){"ok"===t&&r.onDisconnect_.remember(e,i),r.callOnCompleteCallback(n,t,o)}))},e.prototype.onDisconnectSetWithPriority=function(e,t,n,r){var i=this,o=ze(t,n);this.server_.onDisconnectPut(e.toString(),o.val(!0),(function(t,n){"ok"===t&&i.onDisconnect_.remember(e,o),i.callOnCompleteCallback(r,t,n)}))},e.prototype.onDisconnectUpdate=function(e,t,n){var r=this;if(c.isEmpty(t))return A("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(e.toString(),t,(function(i,o){"ok"===i&&L(t,(function(t,n){var i=ze(n);r.onDisconnect_.remember(e.child(t),i)})),r.callOnCompleteCallback(n,i,o)}))},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.addEventRegistration(e,t):this.serverSyncTree_.addEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.removeEventRegistration(e,t):this.serverSyncTree_.removeEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},e.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var t;e?(this.statsListener_||(this.statsListener_=new Lt(this.stats_)),t=this.statsListener_.get()):t=this.stats_.get();var n=Object.keys(t).reduce((function(e,t){return Math.max(t.length,e)}),0);L(t,(function(e,t){for(var r=e,i=e.length;i<n+2;i++)r+=" ";console.log(r+t)}))}},e.prototype.statsIncrementCounter=function(e){this.stats_.incrementCounter(e),this.statsReporter_.includeStat(e)},e.prototype.log_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),A.apply(void 0,s.__spread([n],e))},e.prototype.callOnCompleteCallback=function(e,t,n){e&&B((function(){if("ok"===t)e(null);else{var r=(t||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,e(o)}}))},Object.defineProperty(e.prototype,"database",{get:function(){return this.__database||(this.__database=new pn(this))},enumerable:!1,configurable:!0}),e}(),tn=function(){function e(t){this.indexedFilter_=new _t(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t)}return e.prototype.getStartPost=function(){return this.startPost_},e.prototype.getEndPost=function(){return this.endPost_},e.prototype.matches=function(e){return this.index_.compare(this.getStartPost(),e)<=0&&this.index_.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,r,i,o){return this.matches(new ye(t,n))||(n=Ve.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,o)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=Ve.EMPTY_NODE);var r=t.withIndex(this.index_);r=r.updatePriority(Ve.EMPTY_NODE);var i=this;return t.forEachChild(Ce,(function(e,t){i.matches(new ye(e,t))||(r=r.updateImmediateChild(e,Ve.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.indexedFilter_},e.prototype.getIndex=function(){return this.index_},e.getStartPost_=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.getEndPost_=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}(),nn=function(){function e(e){this.rangedFilter_=new tn(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,r,i,o){return this.rangedFilter_.matches(new ye(t,n))||(n=Ve.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,i,o):this.fullLimitUpdateChild_(e,t,n,i,o)},e.prototype.updateFullNode=function(e,t,n){var r;if(t.isLeafNode()||t.isEmpty())r=Ve.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){r=Ve.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=t.withIndex(this.index_)).updatePriority(Ve.EMPTY_NODE);var s=void 0,c=void 0,l=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),c=this.rangedFilter_.getStartPost();var u=this.index_.getCompare();l=function(e,t){return u(t,e)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),c=this.rangedFilter_.getEndPost(),l=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();){a=i.getNext();!h&&l(s,a)<=0&&(h=!0),h&&o<this.limit_&&l(a,c)<=0?o++:r=r.updateImmediateChild(a.name,Ve.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},e.prototype.getIndex=function(){return this.index_},e.prototype.fullLimitUpdateChild_=function(e,t,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(e,t){return a(t,e)}}else o=this.index_.getCompare();var s=e;c.assert(s.numChildren()===this.limit_,"");var l=new ye(t,n),u=this.reverse_?s.getFirstChild(this.index_):s.getLastChild(this.index_),h=this.rangedFilter_.matches(l);if(s.hasChild(t)){for(var d=s.getImmediateChild(t),p=r.getChildAfterChild(this.index_,u,this.reverse_);null!=p&&(p.name===t||s.hasChild(p.name));)p=r.getChildAfterChild(this.index_,p,this.reverse_);var f=null==p?1:o(p,l);if(h&&!n.isEmpty()&&f>=0)return null!=i&&i.trackChildChange(bt.childChangedChange(t,n,d)),s.updateImmediateChild(t,n);null!=i&&i.trackChildChange(bt.childRemovedChange(t,d));var m=s.updateImmediateChild(t,Ve.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=i&&i.trackChildChange(bt.childAddedChange(p.name,p.node)),m.updateImmediateChild(p.name,p.node)):m}return n.isEmpty()?e:h&&o(u,l)>=0?(null!=i&&(i.trackChildChange(bt.childRemovedChange(u.name,u.node)),i.trackChildChange(bt.childAddedChange(t,n))),s.updateImmediateChild(t,n).updateImmediateChild(u.name,Ve.EMPTY_NODE)):e},e}(),rn=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Ce}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return c.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return c.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:C},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return c.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return c.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:k},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return c.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.copy_=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e.prototype.limit=function(e){var t=this.copy_();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="",t},e.prototype.limitToFirst=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.copy_();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=t?(n.startNameSet_=!0,n.indexStartName_=t):(n.startNameSet_=!1,n.indexStartName_=""),n},e.prototype.endAt=function(e,t){var n=this.copy_();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==t?(n.endNameSet_=!0,n.indexEndName_=t):(n.endNameSet_=!1,n.indexEndName_=""),n},e.prototype.orderBy=function(e){var t=this.copy_();return t.index_=e,t},e.prototype.getQueryObject=function(){var t=e.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[t.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[t.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[t.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[t.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[t.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=r}return this.index_!==Ce&&(n[t.INDEX]=this.index_.toString()),n},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Ce},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new _t(this.getIndex()):this.hasLimit()?new nn(this):new tn(this)},e.prototype.toRestQueryStringParameters=function(){var t,n=e.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===Ce?t=n.PRIORITY_INDEX:this.index_===Ge?t=n.VALUE_INDEX:this.index_===_e?t=n.KEY_INDEX:(c.assert(this.index_ instanceof We,"Unrecognized index type!"),t=this.index_.toString()),r[n.ORDER_BY]=c.stringify(t),this.startSet_&&(r[n.START_AT]=c.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+c.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=c.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+c.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_)),r},e.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},e.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},e.DEFAULT=new e,e}(),on=function(e){function t(t,n){if(!(t instanceof en))throw new Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,rn.DEFAULT,!1)||this}return s.__extends(t,e),t.prototype.getKey=function(){return c.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return c.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof e?e=String(e):e instanceof H||(null===this.path.getFront()?ue("Reference.child",1,e,!1):le("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){c.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){c.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){c.validateArgCount("Reference.set",1,2,arguments.length),he("Reference.set",this.path),re("Reference.set",1,e,this.path,!1),c.validateCallback("Reference.set",2,t,!0);var n=new c.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(c.validateArgCount("Reference.update",1,2,arguments.length),he("Reference.update",this.path),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,M("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}oe("Reference.update",1,e,this.path,!1),c.validateCallback("Reference.update",2,t,!0);var i=new c.Deferred;return this.repo.update(this.path,e,i.wrapCallback(t)),i.promise},t.prototype.setWithPriority=function(e,t,n){if(c.validateArgCount("Reference.setWithPriority",2,3,arguments.length),he("Reference.setWithPriority",this.path),re("Reference.setWithPriority",1,e,this.path,!1),ae("Reference.setWithPriority",2,t,!1),c.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new c.Deferred;return this.repo.setWithPriority(this.path,e,t,r.wrapCallback(n)),r.promise},t.prototype.remove=function(e){return c.validateArgCount("Reference.remove",0,1,arguments.length),he("Reference.remove",this.path),c.validateCallback("Reference.remove",1,e,!0),this.set(null,e)},t.prototype.transaction=function(e,t,n){if(c.validateArgCount("Reference.transaction",1,3,arguments.length),he("Reference.transaction",this.path),c.validateCallback("Reference.transaction",1,e,!1),c.validateCallback("Reference.transaction",2,t,!0),pe("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new c.Deferred;"function"==typeof t&&r.promise.catch((function(){}));var i=function(e,n,i){e?r.reject(e):r.resolve(new me(n,i)),"function"==typeof t&&t(e,n,i)};return this.repo.startTransaction(this.path,e,i,n),r.promise},t.prototype.setPriority=function(e,t){c.validateArgCount("Reference.setPriority",1,2,arguments.length),he("Reference.setPriority",this.path),ae("Reference.setPriority",1,e,!1),c.validateCallback("Reference.setPriority",2,t,!0);var n=new c.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),e,null,n.wrapCallback(t)),n.promise},t.prototype.push=function(e,t){c.validateArgCount("Reference.push",0,2,arguments.length),he("Reference.push",this.path),re("Reference.push",1,e,this.path,!0),c.validateCallback("Reference.push",2,t,!0);var n,r=this.repo.serverTime(),i=ge(r),o=this.child(i),a=this.child(i);return n=null!=e?o.set(e,t).then((function(){return a})):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof t&&n.catch((function(){})),o},t.prototype.onDisconnect=function(){return he("Reference.onDisconnect",this.path),new fe(this.repo,this.path)},Object.defineProperty(t.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),t}(Ke);+var Jt=null;"undefined"!=typeof MozWebSocket?Jt=MozWebSocket:"undefined"!=typeof WebSocket&&(Jt=WebSocket);var Zt=function(){function e(t,n,r,i,o){this.connId=t,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=x(this.connId),this.stats_=Dt.getCollection(n),this.connURL=e.connectionURL_(n,i,o)}return e.connectionURL_=function(e,t,n){var r={v:"5"};return!c.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),t&&(r.s=t),n&&(r.ls=n),e.connectionURL("websocket",r)},e.prototype.open=function(e,t){var n=this;this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,f.set("previous_websocket_failure",!0);try{if(c.isNodeSdk()){var i=c.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+Wt+"/"+r.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}},a=r.env,s=0===this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;s&&(o.proxy={origin:s}),this.mySock=new Jt(this.connURL,[],o)}else{o={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new Jt(this.connURL,[],o)}}catch(e){this.log_("Error instantiating WebSocket.");var l=e.message||e.data;return l&&this.log_(l),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(e){n.handleIncomingFrame(e)},this.mySock.onerror=function(e){n.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&n.log_(t),n.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==Jt&&!e.forceDisallow_},e.previouslyFailed=function(){return f.isInMemoryStorage||!0===f.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){f.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var t=this.frames.join("");this.frames=null;var n=c.jsonEval(t);this.onMessage(n)}},e.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},e.prototype.extractFrameCount_=function(e){if(c.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},e.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},e.prototype.send=function(e){this.resetKeepAlive();var t=c.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=D(t,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},e.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},e.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},e.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){e.mySock&&e.sendString_("0"),e.resetKeepAlive()}),Math.floor(45e3))},e.prototype.sendString_=function(e){try{this.mySock.send(e)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}(),Yt=function(){function e(e){this.initTransports_(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[qt,Zt]},enumerable:!1,configurable:!0}),e.prototype.initTransports_=function(t){var n,r,i=Zt&&Zt.isAvailable(),o=i&&!Zt.previouslyFailed();if(t.webSocketOnly&&(i||M("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),o=!0),o)this.transports_=[Zt];else{var a=this.transports_=[];try{for(var c=s.__values(e.ALL_TRANSPORTS),l=c.next();!l.done;l=c.next()){var u=l.value;u&&u.isAvailable()&&a.push(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}},e.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),Xt=function(){function e(e,t,n,r,i,o,a,s){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=a,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=x("c:"+this.id+":"),this.transportManager_=new Yt(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){e.conn_&&e.conn_.open(n,r)}),Math.floor(0));var i=t.healthyTimeout||0;i>0&&(this.healthyTimeout_=V((function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))}),Math.floor(i)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!==t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=O("t",e),n=O("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=O("t",e),n=O("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=O("t",e);if("d"in e){var n=e.d;if("h"===t)this.onHandshake_(n);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?S("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):S("Unknown control packet command: "+t)}},e.prototype.onHandshake_=function(e){var t=e.ts,n=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.updateHost(r),0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),"5"!==n&&M("Protocol version mismatch detected"),this.tryStartUpgrade_())},e.prototype.tryStartUpgrade_=function(){var e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)},e.prototype.startUpgrade_=function(e){var t=this;this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),V((function(){t.secondaryConn_&&(t.log_("Timed out trying to upgrade."),t.secondaryConn_.close())}),Math.floor(6e4))},e.prototype.onReset_=function(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.updateHost(e),1===this.state_?this.close():(this.closeConnections_(),this.start_())},e.prototype.onConnectionEstablished_=function(e,t){var n=this;this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):V((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},e.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},e.prototype.onSecondaryConnectionLost_=function(){var e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()},e.prototype.onConnectionLost_=function(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(f.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},e.prototype.onConnectionShutdown_=function(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()},e.prototype.sendData_=function(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)},e.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},e.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},e}(),Qt=function(){function e(){}return e.prototype.put=function(e,t,n,r){},e.prototype.merge=function(e,t,n,r){},e.prototype.refreshAuthToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}(),Kt=function(e){function t(n,r,i,o,a,s,l){var u=e.call(this)||this;if(u.repoInfo_=n,u.applicationId_=r,u.onDataUpdate_=i,u.onConnectStatus_=o,u.onServerInfoUpdate_=a,u.authTokenProvider_=s,u.authOverride_=l,u.id=t.nextPersistentConnectionId_++,u.log_=x("p:"+u.id+":"),u.interruptReasons_={},u.listens=new Map,u.outstandingPuts_=[],u.outstandingPutCount_=0,u.onDisconnectRequestQueue_=[],u.connected_=!1,u.reconnectDelay_=1e3,u.maxReconnectDelay_=3e5,u.securityDebugCallback_=null,u.lastSessionId=null,u.establishConnectionTimer_=null,u.visible_=!1,u.requestCBHash_={},u.requestNumber_=0,u.realtime_=null,u.authToken_=null,u.forceTokenRefresh_=!1,u.invalidAuthTokenCount_=0,u.firstConnection_=!0,u.lastConnectionAttemptTime_=null,u.lastConnectionEstablishedTime_=null,l&&!c.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return u.scheduleConnect_(0),Vt.getInstance().on("visible",u.onVisible_,u),-1===n.host.indexOf("fblocal")&&Ht.getInstance().on("online",u.onOnline_,u),u}return s.__extends(t,e),t.prototype.sendRequest=function(e,t,n){var r=++this.requestNumber_,i={r:r,a:e,b:t};this.log_(c.stringify(i)),c.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},t.prototype.listen=function(e,t,n,r){var i=e.queryIdentifier(),o=e.path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),c.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),c.assert(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:t,query:e,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)},t.prototype.sendListen_=function(e){var n=this,r=e.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=r.queryObject(),a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,c=a.s;t.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===e&&(n.log_("listen response",a),"ok"!==c&&n.removeListen_(i,o),e.onComplete&&e.onComplete(c,s))}))},t.warnOnListenWarnings_=function(e,t){if(e&&"object"==typeof e&&c.contains(e,"w")){var n=c.safeGet(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+t.getQueryParams().getIndex().toString()+'"',i=t.path.toString();M("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||c.isAdmin(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,n=c.isValidFormat(t)?"auth":"gauth",r={cred:t};null===this.authOverride_?r.noauth=!0:"object"==typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";e.authToken_===t&&("ok"===r?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(r,i))}))}},t.prototype.unlisten=function(e,t){var n=e.path.toString(),r=e.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),c.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e.queryObject(),t)},t.prototype.sendUnlisten_=function(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);var i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,n){this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,n,r){var i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,(function(e){r&&setTimeout((function(){r(e.s,e.d)}),Math.floor(0))}))},t.prototype.put=function(e,t,n,r){this.putInternal("p",e,t,n,r)},t.prototype.merge=function(e,t,n,r){this.putInternal("m",e,t,n,r)},t.prototype.putInternal=function(e,t,n,r,i){var o={p:t,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,(function(r){t.log_(n+" response",r),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),i&&i(r.s,r.d)}))},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,(function(e){if("ok"!==e.s){var n=e.d;t.log_("reportStats","Error sending stats: "+n)}}))}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+c.stringify(e));var t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):S("Unrecognized action received from server: "+c.stringify(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;c.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){t.establishConnectionTimer_=null,t.establishConnection_()}),Math.floor(e))},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},t.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+t.nextConnectionId_++,o=this,a=this.lastSessionId,s=!1,l=null,u=function(){l?l.close():(s=!0,r())};this.realtime_={close:u,sendRequest:function(e){c.assert(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(e)}};var h=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(h).then((function(t){s?A("getToken() completed but was canceled"):(A("getToken() completed. Creating connection."),o.authToken_=t&&t.accessToken,l=new Xt(i,o.repoInfo_,o.applicationId_,e,n,r,(function(e){M(e+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")}),a))})).then(null,(function(e){o.log_("Failed to get token: "+e),s||(c.CONSTANTS.NODE_ADMIN&&M(e),u())}))}},t.prototype.interrupt=function(e){A("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){A("Resuming connection for reason: "+e),delete this.interruptReasons_[e],c.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e<this.outstandingPuts_.length;e++){var t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},t.prototype.onListenRevoked_=function(e,t){var n;n=t?t.map((function(e){return N(e)})).join("$"):"default";var r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")},t.prototype.removeListen_=function(e,t){var n,r=new H(e).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(t),i.delete(t),0===i.size&&this.listens.delete(r)}else n=void 0;return n},t.prototype.onAuthRevoked_=function(e,t){A("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e,t,n,r;this.tryAuth();try{for(var i=s.__values(this.listens.values()),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var c=(n=void 0,s.__values(a.values())),l=c.next();!l.done;l=c.next()){var u=l.value;this.sendListen_(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}for(var h=0;h<this.outstandingPuts_.length;h++)this.outstandingPuts_[h]&&this.sendPut_(h);for(;this.onDisconnectRequestQueue_.length;){var d=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(d.action,d.pathString,d.data,d.onComplete)}},t.prototype.sendConnectStats_=function(){var e={},t="js";c.CONSTANTS.NODE_ADMIN?t="admin_node":c.CONSTANTS.NODE_CLIENT&&(t="node"),e["sdk."+t+"."+Wt.replace(/\./g,"-")]=1,c.isMobileCordova()?e["framework.cordova"]=1:c.isReactNative()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.shouldReconnect_=function(){var e=Ht.getInstance().currentlyOnline();return c.isEmpty(this.interruptReasons_)&&e},t.nextPersistentConnectionId_=0,t.nextConnectionId_=0,t}(Qt),$t=function(e){function t(t,n,r){var i=e.call(this)||this;return i.repoInfo_=t,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=x("p:rest:"),i.listens_={},i}return s.__extends(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:(c.assert(e.getQueryParams().isDefault(),"should have a tag if it's not a default query."),e.path.toString())},t.prototype.listen=function(e,n,r,i){var o=this,a=e.path.toString();this.log_("Listen called for "+a+" "+e.queryIdentifier());var s=t.getListenId_(e,r),l={};this.listens_[s]=l;var u=e.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",u,(function(e,t){var n=t;(404===e&&(n=null,e=null),null===e&&o.onDataUpdate_(a,n,!1,r),c.safeGet(o.listens_,s)===l)&&i(e?401===e?"permission_denied":"rest_error:"+e:"ok",null)}))},t.prototype.unlisten=function(e,n){var r=t.getListenId_(e,n);delete this.listens_[r]},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,n){var r=this;void 0===t&&(t={}),t.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var o=i&&i.accessToken;o&&(t.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+e+"?ns="+r.repoInfo_.namespace+c.querystring(t);r.log_("Sending REST request for "+a);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(n&&4===s.readyState){r.log_("REST Response for "+a+" received. status:",s.status,"response:",s.responseText);var e=null;if(s.status>=200&&s.status<300){try{e=c.jsonEval(s.responseText)}catch(e){M("Failed to parse JSON response for "+a+": "+s.responseText)}n(null,e)}else 401!==s.status&&404!==s.status&&M("Got unsuccessful REST response for "+a+" Status: "+s.status),n(s.status);n=null}},s.open("GET",a,!0),s.send()}))},t}(Qt),en=function(){function e(e,t,n,r){var i=this;if(this.repoInfo_=e,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new jt,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new ct,this.persistentConnection_=null,this.stats_=Dt.getCollection(e),t||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)this.server_=new $t(this.repoInfo_,this.onDataUpdate_.bind(this),r),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(null!=o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{c.stringify(o)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}this.persistentConnection_=new Kt(this.repoInfo_,n.options.appId,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),r,o),this.server_=this.persistentConnection_}r.addTokenChangeListener((function(e){i.server_.refreshAuthToken(e)})),this.statsReporter_=Dt.getOrCreateReporter(e,(function(){return new Ft(i.stats_,i.server_)})),this.transactionsInit_(),this.infoData_=new Ot,this.infoSyncTree_=new Pt({startListening:function(e,t,n,r){var o=[],a=i.infoData_.getNode(e.path);return a.isEmpty()||(o=i.infoSyncTree_.applyServerOverwrite(e.path,a),setTimeout((function(){r("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new Pt({startListening:function(e,t,n,r){return i.server_.listen(e,n,t,(function(t,n){var o=r(t,n);i.eventQueue_.raiseEventsForChangedPath(e.path,o)})),[]},stopListening:function(e,t){i.server_.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e.prototype.name=function(){return this.repoInfo_.namespace},e.prototype.serverTime=function(){var e=this.infoData_.getNode(new H(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e},e.prototype.generateServerValues=function(){return(e=(e={timestamp:this.serverTime()})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e},e.prototype.onDataUpdate_=function(e,t,n,r){this.dataUpdateCount++;var i=new H(e);t=this.interceptServerDataCallback_?this.interceptServerDataCallback_(e,t):t;var o=[];if(r)if(n){var a=c.map(t,(function(e){return ze(e)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var s=ze(t);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,s,r)}else if(n){var l=c.map(t,(function(e){return ze(e)}));o=this.serverSyncTree_.applyServerMerge(i,l)}else{var u=ze(t);o=this.serverSyncTree_.applyServerOverwrite(i,u)}var h=i;o.length>0&&(h=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(h,o)},e.prototype.interceptServerData_=function(e){this.interceptServerDataCallback_=e},e.prototype.onConnectStatus_=function(e){this.updateInfo_("connected",e),!1===e&&this.runOnDisconnectEvents_()},e.prototype.onServerInfoUpdate_=function(e){var t=this;L(e,(function(e,n){t.updateInfo_(e,n)}))},e.prototype.updateInfo_=function(e,t){var n=new H("/.info/"+e),r=ze(t);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},e.prototype.getNextWriteId_=function(){return this.nextWriteId_++},e.prototype.setWithPriority=function(e,t,n,r){var i=this;this.log_("set",{path:e.toString(),value:t,priority:n});var o=this.generateServerValues(),a=ze(t,n),s=this.serverSyncTree_.calcCompleteEventCache(e),c=ot(a,s,o),l=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserOverwrite(e,c,l,!0);this.eventQueue_.queueEvents(u),this.server_.put(e.toString(),a.val(!0),(function(t,n){var o="ok"===t;o||M("set at "+e+" failed: "+t);var a=i.serverSyncTree_.ackUserWrite(l,!o);i.eventQueue_.raiseEventsForChangedPath(e,a),i.callOnCompleteCallback(r,t,n)}));var h=this.abortTransactions_(e);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},e.prototype.update=function(e,t,n){var r=this;this.log_("update",{path:e.toString(),value:t});var i=!0,o=this.generateServerValues(),a={};if(L(t,(function(t,n){i=!1,a[t]=it(e.child(t),ze(n),r.serverSyncTree_,o)})),i)A("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var s=this.getNextWriteId_(),c=this.serverSyncTree_.applyUserMerge(e,a,s);this.eventQueue_.queueEvents(c),this.server_.merge(e.toString(),t,(function(t,i){var o="ok"===t;o||M("update at "+e+" failed: "+t);var a=r.serverSyncTree_.ackUserWrite(s,!o),c=a.length>0?r.rerunTransactions_(e):e;r.eventQueue_.raiseEventsForChangedPath(c,a),r.callOnCompleteCallback(n,t,i)})),L(t,(function(t){var n=r.abortTransactions_(e.child(t));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(e,[])}},e.prototype.runOnDisconnectEvents_=function(){var e=this;this.log_("onDisconnectEvents");var t=this.generateServerValues(),n=new ct;this.onDisconnect_.forEachTree(H.Empty,(function(r,i){var o=it(r,i,e.serverSyncTree_,t);n.remember(r,o)}));var r=[];n.forEachTree(H.Empty,(function(t,n){r=r.concat(e.serverSyncTree_.applyServerOverwrite(t,n));var i=e.abortTransactions_(t);e.rerunTransactions_(i)})),this.onDisconnect_=new ct,this.eventQueue_.raiseEventsForChangedPath(H.Empty,r)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.server_.onDisconnectCancel(e.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(e),n.callOnCompleteCallback(t,r,i)}))},e.prototype.onDisconnectSet=function(e,t,n){var r=this,i=ze(t);this.server_.onDisconnectPut(e.toString(),i.val(!0),(function(t,o){"ok"===t&&r.onDisconnect_.remember(e,i),r.callOnCompleteCallback(n,t,o)}))},e.prototype.onDisconnectSetWithPriority=function(e,t,n,r){var i=this,o=ze(t,n);this.server_.onDisconnectPut(e.toString(),o.val(!0),(function(t,n){"ok"===t&&i.onDisconnect_.remember(e,o),i.callOnCompleteCallback(r,t,n)}))},e.prototype.onDisconnectUpdate=function(e,t,n){var r=this;if(c.isEmpty(t))return A("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(e.toString(),t,(function(i,o){"ok"===i&&L(t,(function(t,n){var i=ze(n);r.onDisconnect_.remember(e.child(t),i)})),r.callOnCompleteCallback(n,i,o)}))},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.addEventRegistration(e,t):this.serverSyncTree_.addEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.removeEventRegistration(e,t):this.serverSyncTree_.removeEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},e.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var t;e?(this.statsListener_||(this.statsListener_=new Lt(this.stats_)),t=this.statsListener_.get()):t=this.stats_.get();var n=Object.keys(t).reduce((function(e,t){return Math.max(t.length,e)}),0);L(t,(function(e,t){for(var r=e,i=e.length;i<n+2;i++)r+=" ";console.log(r+t)}))}},e.prototype.statsIncrementCounter=function(e){this.stats_.incrementCounter(e),this.statsReporter_.includeStat(e)},e.prototype.log_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),A.apply(void 0,s.__spread([n],e))},e.prototype.callOnCompleteCallback=function(e,t,n){e&&B((function(){if("ok"===t)e(null);else{var r=(t||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,e(o)}}))},Object.defineProperty(e.prototype,"database",{get:function(){return this.__database||(this.__database=new pn(this))},enumerable:!1,configurable:!0}),e}(),tn=function(){function e(t){this.indexedFilter_=new _t(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t)}return e.prototype.getStartPost=function(){return this.startPost_},e.prototype.getEndPost=function(){return this.endPost_},e.prototype.matches=function(e){return this.index_.compare(this.getStartPost(),e)<=0&&this.index_.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,r,i,o){return this.matches(new ye(t,n))||(n=Ve.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,o)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=Ve.EMPTY_NODE);var r=t.withIndex(this.index_);r=r.updatePriority(Ve.EMPTY_NODE);var i=this;return t.forEachChild(Ce,(function(e,t){i.matches(new ye(e,t))||(r=r.updateImmediateChild(e,Ve.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.indexedFilter_},e.prototype.getIndex=function(){return this.index_},e.getStartPost_=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.getEndPost_=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}(),nn=function(){function e(e){this.rangedFilter_=new tn(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,r,i,o){return this.rangedFilter_.matches(new ye(t,n))||(n=Ve.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,i,o):this.fullLimitUpdateChild_(e,t,n,i,o)},e.prototype.updateFullNode=function(e,t,n){var r;if(t.isLeafNode()||t.isEmpty())r=Ve.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){r=Ve.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=t.withIndex(this.index_)).updatePriority(Ve.EMPTY_NODE);var s=void 0,c=void 0,l=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),c=this.rangedFilter_.getStartPost();var u=this.index_.getCompare();l=function(e,t){return u(t,e)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),c=this.rangedFilter_.getEndPost(),l=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();){a=i.getNext();!h&&l(s,a)<=0&&(h=!0),h&&o<this.limit_&&l(a,c)<=0?o++:r=r.updateImmediateChild(a.name,Ve.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},e.prototype.getIndex=function(){return this.index_},e.prototype.fullLimitUpdateChild_=function(e,t,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(e,t){return a(t,e)}}else o=this.index_.getCompare();var s=e;c.assert(s.numChildren()===this.limit_,"");var l=new ye(t,n),u=this.reverse_?s.getFirstChild(this.index_):s.getLastChild(this.index_),h=this.rangedFilter_.matches(l);if(s.hasChild(t)){for(var d=s.getImmediateChild(t),p=r.getChildAfterChild(this.index_,u,this.reverse_);null!=p&&(p.name===t||s.hasChild(p.name));)p=r.getChildAfterChild(this.index_,p,this.reverse_);var f=null==p?1:o(p,l);if(h&&!n.isEmpty()&&f>=0)return null!=i&&i.trackChildChange(bt.childChangedChange(t,n,d)),s.updateImmediateChild(t,n);null!=i&&i.trackChildChange(bt.childRemovedChange(t,d));var m=s.updateImmediateChild(t,Ve.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=i&&i.trackChildChange(bt.childAddedChange(p.name,p.node)),m.updateImmediateChild(p.name,p.node)):m}return n.isEmpty()?e:h&&o(u,l)>=0?(null!=i&&(i.trackChildChange(bt.childRemovedChange(u.name,u.node)),i.trackChildChange(bt.childAddedChange(t,n))),s.updateImmediateChild(t,n).updateImmediateChild(u.name,Ve.EMPTY_NODE)):e},e}(),rn=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Ce}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return c.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return c.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:C},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return c.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return c.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:k},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return c.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.copy_=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e.prototype.limit=function(e){var t=this.copy_();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="",t},e.prototype.limitToFirst=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.copy_();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=t?(n.startNameSet_=!0,n.indexStartName_=t):(n.startNameSet_=!1,n.indexStartName_=""),n},e.prototype.endAt=function(e,t){var n=this.copy_();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==t?(n.endNameSet_=!0,n.indexEndName_=t):(n.endNameSet_=!1,n.indexEndName_=""),n},e.prototype.orderBy=function(e){var t=this.copy_();return t.index_=e,t},e.prototype.getQueryObject=function(){var t=e.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[t.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[t.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[t.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[t.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[t.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=r}return this.index_!==Ce&&(n[t.INDEX]=this.index_.toString()),n},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Ce},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new _t(this.getIndex()):this.hasLimit()?new nn(this):new tn(this)},e.prototype.toRestQueryStringParameters=function(){var t,n=e.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===Ce?t=n.PRIORITY_INDEX:this.index_===Ge?t=n.VALUE_INDEX:this.index_===_e?t=n.KEY_INDEX:(c.assert(this.index_ instanceof We,"Unrecognized index type!"),t=this.index_.toString()),r[n.ORDER_BY]=c.stringify(t),this.startSet_&&(r[n.START_AT]=c.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+c.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=c.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+c.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_)),r},e.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},e.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},e.DEFAULT=new e,e}(),on=function(e){function t(t,n){if(!(t instanceof en))throw new Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,rn.DEFAULT,!1)||this}return s.__extends(t,e),t.prototype.getKey=function(){return c.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return c.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof e?e=String(e):e instanceof H||(null===this.path.getFront()?ue("Reference.child",1,e,!1):le("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){c.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){c.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){c.validateArgCount("Reference.set",1,2,arguments.length),he("Reference.set",this.path),re("Reference.set",1,e,this.path,!1),c.validateCallback("Reference.set",2,t,!0);var n=new c.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(c.validateArgCount("Reference.update",1,2,arguments.length),he("Reference.update",this.path),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,M("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}oe("Reference.update",1,e,this.path,!1),c.validateCallback("Reference.update",2,t,!0);var i=new c.Deferred;return this.repo.update(this.path,e,i.wrapCallback(t)),i.promise},t.prototype.setWithPriority=function(e,t,n){if(c.validateArgCount("Reference.setWithPriority",2,3,arguments.length),he("Reference.setWithPriority",this.path),re("Reference.setWithPriority",1,e,this.path,!1),ae("Reference.setWithPriority",2,t,!1),c.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new c.Deferred;return this.repo.setWithPriority(this.path,e,t,r.wrapCallback(n)),r.promise},t.prototype.remove=function(e){return c.validateArgCount("Reference.remove",0,1,arguments.length),he("Reference.remove",this.path),c.validateCallback("Reference.remove",1,e,!0),this.set(null,e)},t.prototype.transaction=function(e,t,n){if(c.validateArgCount("Reference.transaction",1,3,arguments.length),he("Reference.transaction",this.path),c.validateCallback("Reference.transaction",1,e,!1),c.validateCallback("Reference.transaction",2,t,!0),pe("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new c.Deferred;"function"==typeof t&&r.promise.catch((function(){}));var i=function(e,n,i){e?r.reject(e):r.resolve(new me(n,i)),"function"==typeof t&&t(e,n,i)};return this.repo.startTransaction(this.path,e,i,n),r.promise},t.prototype.setPriority=function(e,t){c.validateArgCount("Reference.setPriority",1,2,arguments.length),he("Reference.setPriority",this.path),ae("Reference.setPriority",1,e,!1),c.validateCallback("Reference.setPriority",2,t,!0);var n=new c.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),e,null,n.wrapCallback(t)),n.promise},t.prototype.push=function(e,t){c.validateArgCount("Reference.push",0,2,arguments.length),he("Reference.push",this.path),re("Reference.push",1,e,this.path,!0),c.validateCallback("Reference.push",2,t,!0);var n,r=this.repo.serverTime(),i=ge(r),o=this.child(i),a=this.child(i);return n=null!=e?o.set(e,t).then((function(){return a})):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof t&&n.catch((function(){})),o},t.prototype.onDisconnect=function(){return he("Reference.onDisconnect",this.path),new fe(this.repo,this.path)},Object.defineProperty(t.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),t}(Ke);/*** @license* Copyright 2017 Google LLC@@ -1487,8 +1487,8 @@ var an,sn=function(){this.children={},this.childCount=0,this.value=null},cn=func* See the License for the specific language governing permissions and* limitations under the License.*/-var ln,un=function(){function e(e,t){var n=this;this.app_=e,this.authProvider_=t,this.auth_=null,this.auth_=t.getImmediate({optional:!0}),this.auth_||t.get().then((function(e){return n.auth_=e}))}return e.prototype.getToken=function(e){return this.auth_?this.auth_.getToken(e).catch((function(e){return e&&"auth/token-not-initialized"===e.code?(A("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)})):Promise.resolve(null)},e.prototype.addTokenChangeListener=function(e){this.auth_?this.auth_.addAuthTokenListener(e):(setTimeout((function(){return e(null)}),0),this.authProvider_.get().then((function(t){return t.addAuthTokenListener(e)})))},e.prototype.removeTokenChangeListener=function(e){this.authProvider_.get().then((function(t){return t.removeAuthTokenListener(e)}))},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',M(e)},e}(),hn=function(){function e(){}return e.prototype.getToken=function(t){return Promise.resolve({accessToken:e.EMULATOR_AUTH_TOKEN})},e.prototype.addTokenChangeListener=function(t){t(e.EMULATOR_AUTH_TOKEN)},e.prototype.removeTokenChangeListener=function(e){},e.prototype.notifyForInvalidToken=function(){},e.EMULATOR_AUTH_TOKEN="owner",e}(),dn=function(){function e(){this.repos_={},this.useRestClient_=!1}return e.getInstance=function(){return ln||(ln=new e),ln},e.prototype.interrupt=function(){var e,t,n,r;try{for(var i=s.__values(Object.keys(this.repos_)),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var c=(n=void 0,s.__values(Object.keys(this.repos_[a]))),l=c.next();!l.done;l=c.next()){var u=l.value;this.repos_[a][u].interrupt()}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.resume=function(){var e,t,n,r;try{for(var i=s.__values(Object.keys(this.repos_)),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var c=(n=void 0,s.__values(Object.keys(this.repos_[a]))),l=c.next();!l.done;l=c.next()){var u=l.value;this.repos_[a][u].resume()}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.databaseFromApp=function(e,t,n){var i=n||e.options.databaseURL;void 0===i&&T("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().");var o,a=Y(i),s=a.repoInfo,l=void 0;void 0!==r&&(l=r.env.FIREBASE_DATABASE_EMULATOR_HOST),l?(o=!0,i="http://"+l+"?ns="+s.namespace,s=(a=Y(i)).repoInfo):o=!a.repoInfo.secure;var u=c.CONSTANTS.NODE_ADMIN&&o?new hn:new un(e,t);return de("Invalid Firebase Database URL",1,a),a.path.isEmpty()||T("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(s,e,u).database},e.prototype.deleteRepo=function(e){var t=c.safeGet(this.repos_,e.app.name);t&&c.safeGet(t,e.repoInfo_.toURLString())===e||T("Database "+e.app.name+"("+e.repoInfo_+") has already been deleted."),e.interrupt(),delete t[e.repoInfo_.toURLString()]},e.prototype.createRepo=function(e,t,n){var r=c.safeGet(this.repos_,t.name);r||(r={},this.repos_[t.name]=r);var i=c.safeGet(r,e.toURLString());return i&&T("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new en(e,this.useRestClient_,t,n),r[e.toURLString()]=i,i},e.prototype.forceRestClient=function(e){this.useRestClient_=e},e}(),pn=function(){function e(e){this.repo_=e,e instanceof en||T("Don't call new Database() directly - please use firebase.database()."),this.root_=new on(e,H.Empty),this.INTERNAL=new fn(this)}return Object.defineProperty(e.prototype,"app",{get:function(){return this.repo_.app},enumerable:!1,configurable:!0}),e.prototype.ref=function(e){return this.checkDeleted_("ref"),c.validateArgCount("database.ref",0,1,arguments.length),e instanceof on?this.refFromURL(e.toString()):void 0!==e?this.root_.child(e):this.root_},e.prototype.refFromURL=function(e){var t="database.refFromURL";this.checkDeleted_(t),c.validateArgCount(t,1,1,arguments.length);var n=Y(e);de(t,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&T(t+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},e.prototype.checkDeleted_=function(e){null===this.repo_&&T("Cannot call "+e+" on a deleted database.")},e.prototype.goOffline=function(){c.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},e.prototype.goOnline=function(){c.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},e.ServerValue={TIMESTAMP:{".sv":"timestamp"},increment:function(e){return{".sv":{increment:e}}}},e}(),fn=function(){function e(e){this.database=e}return e.prototype.delete=function(){return s.__awaiter(this,void 0,void 0,(function(){return s.__generator(this,(function(e){return this.database.checkDeleted_("delete"),dn.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]}))}))},e}(),mn=Object.freeze({__proto__:null,forceLongPolling:function(){Zt.forceDisallow(),qt.forceAllow()},forceWebSockets:function(){qt.forceDisallow()},isWebSocketsAvailable:function(){return Zt.isAvailable()},setSecurityDebugCallback:function(e,t){e.repo.persistentConnection_.securityDebugCallback_=t},stats:function(e,t){e.repo.stats(t)},statsIncrementCounter:function(e,t){e.repo.statsIncrementCounter(t)},dataUpdateCount:function(e){return e.repo.dataUpdateCount},interceptServerData:function(e,t){return e.repo.interceptServerData_(t)}}),gn=Kt;Kt.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},Kt.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};var yn=Yt,vn=q,bn=Object.freeze({__proto__:null,DataConnection:gn,RealTimeConnection:yn,hijackHash:function(e){var t=Kt.prototype.put;return Kt.prototype.put=function(n,r,i,o){void 0!==o&&(o=e()),t.call(this,n,r,i,o)},function(){Kt.prototype.put=t}},ConnectionTarget:vn,queryIdentifier:function(e){return e.queryIdentifier()},forceRestClient:function(e){dn.getInstance().forceRestClient(e)}}),_n=pn.ServerValue;function wn(t){!function(e){Wt=e}(t.SDK_VERSION);var n=t.INTERNAL.registerComponent(new u.Component("database",(function(e,t){var n=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal");return dn.getInstance().databaseFromApp(n,r,t)}),"PUBLIC").setServiceProps({Reference:on,Query:Ke,Database:pn,DataSnapshot:Je,enableLogging:E,INTERNAL:mn,ServerValue:_n,TEST_ACCESS:bn}).setMultipleInstances(!0));t.registerVersion("@firebase/database","0.6.11"),c.isNodeSdk()&&(e.exports=n)}wn(a),t.DataSnapshot=Je,t.Database=pn,t.OnDisconnect=fe,t.Query=Ke,t.Reference=on,t.ServerValue=_n,t.enableLogging=E,t.registerDatabase=wn}).call(this,n(2))},function(e,t,n){const r={0:0,1:.5,2:0,3:.25,4:.5,5:.75,6:0,7:.125,8:.25,9:.375,10:.5,11:.625,12:.75,13:.875};if(AFRAME.registerComponent("multiplier-ring",{dependencies:["geometry","material"],schema:{combo:{default:0},multiplier:{default:1}},init:function(){this.animationSet={from:void 0,to:void 0},this.progress=this.el.getObject3D("mesh").material.uniforms.progress,this.el.setAttribute("animation",{property:"components.material.material.uniforms.progress.value",dur:100,autoplay:!1})},update:function(){this.updateRing()},updateRing:function(){const e=this.data,t=this.el,n=this.progress;if(8===e.multiplier)return void(n.value=1);const i=this.animationSet;i.from=n.value,i.to=r[e.combo],t.setAttribute("animation",i),t.components.animation.beginAnimation()}}),window.AFRAME){const t=["multiplier-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("no-frustum-cull",{init:function(){this.el.object3D.frustumCulled=!1}}),window.AFRAME){const t=["no-frustum-cull"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("panelShader",{schema:{activePanel:{type:"number",is:"uniform",default:0},brightness:{type:"number",is:"uniform",default:.3},borderWidth:{type:"number",is:"uniform",default:.004},borderRadius:{type:"number",is:"uniform",default:.15},colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},midSection:{type:"number",is:"uniform",default:0},opacity:{type:"number",is:"uniform",default:1},ratio:{type:"number",is:"uniform",default:.5},transparent:{default:!0}},vertexShader:n(141),fragmentShader:n(142),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerPanel(this.material)}}),window.AFRAME){const t=[],n=["panelShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\n\n#define PI 3.141592\n#define DIFF_SECTION_WIDTH 0.06\n\nuniform float borderWidth;\nuniform float borderRadius;\nuniform float brightness;\nuniform float ratio;\nuniform float midSection;\nuniform float opacity;\nuniform float activePanel;\n\nvarying vec2 uvs;\n\nfloat sdBox( in vec2 p, in vec2 b )\n{\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0.0))) + min(max(d.x,d.y), 0.0);\n}\n\nvoid main()\n{\n vec2 uv = uvs;\n vec2 uv2 = uv * 2.0 - 1.0; // from -1 to 1\n uv2.x *= ratio;\n\n vec3 col = mix(colorSecondary * uv.y, colorPrimary * uv.y, uv.x) * (brightness + activePanel * 0.4);\n vec3 borderCol = mix(colorSecondary, colorPrimary, uv.y);\n\n vec2 size = vec2(0.83 * ratio, 0.86) - borderRadius;\n float grad = sdBox(uv2, size) - borderRadius;\n grad = min(grad, sdBox(uv2 - size, vec2(borderRadius)));\n grad = min(grad, sdBox(uv2 + size, vec2(borderRadius)));\n grad = -grad;\n float aa = fwidth(grad);\n\n float isShape = smoothstep(-aa, 0.0, grad);\n float alpha = clamp(isShape + smoothstep(-0.15, 0.15, grad), 0.0, 1.0);\n float isBorder = smoothstep(-aa - borderWidth, aa - borderWidth, grad) - smoothstep(-aa + borderWidth, aa + borderWidth, grad);\n float mid = clamp(midSection, 0.0, 1.0);\n col *= 1.0 - mid * (step(0.5 - DIFF_SECTION_WIDTH * mid, uv.x) - step(0.5 + DIFF_SECTION_WIDTH * midSection, uv.x)) * 0.3;\n\n gl_FragColor = vec4(mix(col * isShape, borderCol, isBorder), alpha * opacity);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("pause",{schema:{isPaused:{default:!1}},update:function(){this.data.isPaused&&this.el.isPlaying?this.el.pause():this.data.isPaused||this.el.isPlaying||!this.el.sceneEl.isPlaying||this.el.play()}}),window.AFRAME){const t=["pause"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("pauser",{schema:{enabled:{default:!0}},init:function(){this.pauseGame=this.pauseGame.bind(this),document.addEventListener("keydown",e=>{27===e.keyCode&&this.pauseGame()}),this.el.sceneEl.addEventListener("controllerconnected",e=>{"vive-controls"===e.detail.name?this.el.addEventListener("menudown",this.pauseGame):(this.el.addEventListener("thumbstickdown",this.pauseGame),this.el.addEventListener("trackpaddown",this.pauseGame))}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.pauseGame()})},pauseGame:function(){this.data.enabled&&this.el.sceneEl.emit("pausegame",null,!1)}}),window.AFRAME){const t=["pauser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=n(146);if(AFRAME.registerSystem("play-sound",{init:function(){this.lastSoundPlayed="",this.lastSoundPlayedTime=0,this.pools={}},createPool:function(e,t){this.pools[e]||(this.pools[e]=new r(e,t))},playSound:function(e,t){this.pools[e]||this.createPool(e,t),this.pools[e].play(),this.lastSoundPlayed=e,this.lastSoundTime=this.el.time}}),AFRAME.registerComponent("play-sound",{schema:{enabled:{default:!0},event:{type:"string"},sound:{type:"string"},volume:{type:"number",default:1}},multiple:!0,init:function(){this.el.addEventListener(this.data.event,e=>{this.data.enabled&&this.system.playSound(this.src,this.data.volume)})},update:function(){this.src=this.data.sound,this.data.sound.startsWith("#")&&(this.src=document.querySelector(this.data.sound).getAttribute("src"))}}),window.AFRAME){const t=["play-sound"],n=[],r=["play-sound"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports=function(e,t){var n,r=0,i=[];return(n=new Audio(e)).volume=t,i.push(n),{play:function(){0===i[r].currentTime&&i[r].ended||((n=new Audio(e)).volume=t,i.push(n),r++),(0===i[r].currentTime||i[r].ended)&&i[r].play(),r=(r+1)%i.length}}}},function(e,t,n){function r(e,t){return e-t}if(AFRAME.registerComponent("player-height",{init:function(){this.beatOffset=0,this.heights=[],this.height=0,this.el.sceneEl.addEventListener("menuchallengeselect",this.updateHeight.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.updateHeight.bind(this))},pause:function(){this.heights.length=0},updateHeight:function(){const e=this.heights;e.length>3&&e.shift(),e.push(this.el.object3D.position.y),this.height=function(e){e.sort(r);const t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2}(e);const t=(n=this.height,i=1.6,o=2.2,Math.min(Math.max(n,i),o));var n,i,o,a,s;this.beatOffset=(s=0)+(.2-s)*(t-(a=1.6))/(2.2-a)}}),window.AFRAME){const t=["player-height"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("plume",{schema:{color:{default:""},cutDirection:{default:""},horizontalPosition:{default:"middleleft",oneOf:["left","middleleft","middleright","right"]},songPosition:{default:0},type:{default:"arrow",oneOf:["arrow","dot","mine"]},verticalPosition:{default:"middle",oneOf:["bottom","middle","top"]}},horizontalPositions:{left:-.95,middleleft:-.6,middleright:.6,right:.95},init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.handsEls=this.el.sceneEl.querySelectorAll(".handStar"),this.handPos=new THREE.Vector3,this.verticalPositions=this.el.sceneEl.components["beat-system"].verticalPositions,this.el.sceneEl.addEventListener("cleargame",this.returnToPool.bind(this))},update:function(){"mine"===this.data.type?this.poolName="pool__plume-mine":this.poolName=`pool__plume-${this.data.type}-${this.data.color}`},onGenerate:function(e,t,n,r){this.data;const i=this.el,o=this.curveEl.components.supercurve;o.getPointAt(e,i.object3D.position),o.alignToCurve(e,i.object3D),i.object3D.position.x+=this.horizontalPositions[t],i.object3D.position.y+=this.verticalPositions[n]+r,i.object3D.rotation.z=Math.random()*Math.PI*2,this.songPosition=e},tock:function(){if(this.el.object3D.position.z>this.curveFollowRig.object3D.position.z+10)this.returnToPool();else for(let e=0;e<this.handsEls.length;e++){const t=this.handsEls[e];t.object3D.getWorldPosition(this.handPos),this.handPos.distanceToSquared(this.el.object3D.position)<.2&&t.emit("plumepulse")}},returnToPool:function(){this.el.object3D.position.set(0,0,-9999),this.el.object3D.visible=!1,this.el.isPlaying&&this.el.sceneEl.components[this.poolName].returnEntity(this.el)}}),window.AFRAME){const t=["plume"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("punch",{schema:{enabled:{default:!1}},init:function(){this.currentPos=new THREE.Vector3,this.direction=0,this.lastSample=new THREE.Vector3,this.lastSampleTime=0,this.speed=0,this.bbox=new THREE.Box3,this.bboxEl=this.el.querySelector(".punchBbox")},play:function(){this.rig=this.el.closest("#curveFollowRig")},tick:function(e,t){this.data.enabled&&(this.direction=this.currentPos.copy(this.el.object3D.position).sub(this.lastSample),this.speed=this.direction.length()/((e-this.lastSampleTime)/1e3),this.lastSample.copy(this.el.object3D.position),this.lastSampleTime=e)},tickBeatSystem:function(){this.bbox.setFromObject(this.bboxEl.getObject3D("mesh"))},checkCollision:function(){const e=new THREE.Box3,t=new THREE.Vector3(0,0,.2);return function(n){return e.copy(n.bbox).translate(n.el.object3D.position).expandByScalar(.1).expandByVector(t),this.bbox.intersectsBox(e)}}()}),window.AFRAME){const t=["punch"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i;if(AFRAME.registerComponent("raycaster-target",{schema:{bindToggle:{default:""},depth:{type:"number"},height:{type:"number"},position:{type:"vec3",default:{x:0,y:0,z:0}},rotation:{type:"vec3",default:{x:0,y:0,z:0}},useBoxTarget:{default:!1},width:{type:"number"}},init:(r={primitive:"box"},i={primitive:"plane"},function(){var e,t,n=this.data,o=this.el;(t=document.createElement("a-entity")).classList.add("raycasterTarget"),n.bindToggle?t.setAttribute("bind-toggle__raycastable",n.bindToggle):t.setAttribute("data-raycastable",""),n.useBoxTarget?((e=r).depth=n.depth,e.height=n.height,e.width=n.width):((e=i).height=n.height,e.width=n.width),t.setAttribute("geometry",e),t.object3D.visible=!1,t.object3D.position.copy(n.position),t.object3D.rotation.x=THREE.Math.degToRad(n.rotation.x),t.object3D.rotation.y=THREE.Math.degToRad(n.rotation.y),t.object3D.rotation.z=THREE.Math.degToRad(n.rotation.z),o.appendChild(t)})}),window.AFRAME){const t=["raycaster-target"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i,o,a;if(AFRAME.registerComponent("recenter",{schema:{enabled:{default:!0}},init:function(){this.el.sceneEl;this.recenter=this.recenter.bind(this),document.querySelectorAll("[tracked-controls]").forEach(e=>{e.addEventListener("menudown",this.recenter),e.addEventListener("thumbstickdown",this.recenter)}),this.el.addEventListener("recenter",this.recenter)},recenter:(r=new THREE.Euler,i=new THREE.Matrix4,o=new THREE.Matrix4,a=new THREE.Matrix4,function(){const e=this.el;if(!this.data.enabled)return;const t=e.sceneEl.camera.el.object3D;i.identity(),r.set(0,-1*t.rotation.y,0),o.makeRotationFromEuler(r),a.makeTranslation(-1*t.position.x,0,-1*t.position.z),i.multiply(o).multiply(a),i.decompose(e.object3D.position,e.object3D.quaternion,e.object3D.scale),e.object3D.updateMatrixWorld(!0),e.emit("recentered",null,!1)})}),window.AFRAME){const t=["recenter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("ring",{schema:{blur:{default:.01,is:"uniform"},color:{type:"color",is:"uniform"},progress:{default:0,is:"uniform"},radiusInner:{default:.6,is:"uniform"},radiusOuter:{default:1,is:"uniform"}},vertexShader:n(153),fragmentShader:n(154)}),window.AFRAME){const t=[],n=["ring"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUv;\n\nvoid main () {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n#define PI 3.14159265358979\nuniform float blur;\nuniform float progress;\nuniform float radiusInner;\nuniform float radiusOuter;\nuniform vec3 color;\n\nvarying vec2 vUv;\n\nvoid main () {\n // make uvs go from -1 to 1\n vec2 uv = vec2(vUv.x * 2.0 - 1.0, vUv.y * 2.0 - 1.0);\n // calculate distance of fragment to center\n float r = uv.x * uv.x + uv.y * uv.y;\n // calculate antialias\n float aa = fwidth(r);\n // make full circle (radiusOuter - radiusInner)\n float col = (1.0 - smoothstep(radiusOuter - aa, radiusOuter + blur + aa, r)) * smoothstep(radiusInner - aa, radiusInner + blur + aa, r);\n // radial gradient\n float a = smoothstep(-PI-aa, PI+aa, atan(uv.y, uv.x));\n // progress angle\n float p = 1.0 - progress - blur;\n // apply progress to full circle (1 for done part, 0 for part to go)\n col *= smoothstep(p, p + blur, a);\n // multiply by user color\n gl_FragColor = vec4(color * col, col);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("score-texts",{schema:{isLoading:{default:!1}},init:function(){this.textEls=this.el.querySelectorAll("[text]");for(let e=0;e<this.textEls.length;e++)this.textEls[e].setAttribute("animation__fadein",{autoplay:!1,property:"components.text.material.uniforms.opacity.value",delay:250,dur:750,easing:"easeInOutCubic",from:0,to:1})},update:function(e){if(e.isLoading&&!this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.animation__fadein.beginAnimation();this.el.sceneEl.emit("textglownormal",null,!1)}if(!e.isLoading&&this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.text.material.uniforms.opacity.value=0;this.el.sceneEl.emit("textglowoff",null,!1)}}}),window.AFRAME){const t=["score-texts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);n(6);if(AFRAME.registerComponent("search-thumbnail-atlas",{dependencies:["geometry","material"],schema:{dummyUpdater:{type:"string"}},init:function(){const e=this.canvas=document.createElement("canvas");e.setAttribute("id","thumbnailAtlasMap"),e.height=512,e.width=64,e.style.visibility="hidden",this.ctx=e.getContext("2d"),this.clearCanvas(),document.body.appendChild(e);const t=this.alphaCanvas=document.createElement("canvas");t.setAttribute("id","thumbnailAlphaMap"),t.height=512,t.width=64,t.style.visibility="hidden",this.alphaCtx=t.getContext("2d"),document.body.appendChild(t),this.el.components.material.material.alphaMap=new THREE.CanvasTexture(t),this.el.setAttribute("material","src",e),this.images=[],this.lastNumResults=6},update:function(){const e=this.el.sceneEl.systems.state.state.searchResultsPage;for(let t=0;t<e.length;t++){let n=this.images[t]=this.images[t]||document.createElement("img");n.crossOrigin="anonymous",n.src=e[t].coverURL,n.complete?this.draw(n,t):n.onload=()=>{this.draw(n,t)}}e.length!==this.lastNumResults&&this.updateAlphaMap(e.length),this.lastNumResults=e.length},draw:function(e,t){this.ctx.drawImage(e,0,t*(512/384*64),64,512/384*64),this.el.getObject3D("mesh").material.map.needsUpdate=!0},clearCanvas:function(){const e=this.canvas;this.ctx.fillStyle="#111",this.ctx.fillRect(0,0,e.width,e.height)},updateAlphaMap:function(e){const t=this.alphaCanvas,n=this.alphaCtx;n.fillStyle="#FFF",n.fillRect(0,0,t.width,t.height),n.fillStyle="#000",n.fillRect(0,e*(512/384*64),t.width,t.height-e*(512/384*64)),this.el.getObject3D("mesh").material.alphaMap.needsUpdate=!0,this.el.getObject3D("mesh").material.needsUpdate=!0}}),window.AFRAME){const t=["search-thumbnail-atlas"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(158),i=n(29),o=n(159).map(i);if(AFRAME.registerComponent("search",{schema:{difficultyFilter:{default:"All"},genre:{default:""},playlist:{default:""},query:{default:""}},init:function(){this.eventDetail={query:"",results:o,url:"",page:0},this.keyboardEl=document.getElementById("keyboard"),this.popularHits=o,function(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}(this.popularHits),this.queryObject={hitsPerPage:0,query:""},this.el.sceneEl.addEventListener("searchclear",()=>{this.search("")})},update:function(e){this.popularHits&&(e.query&&!this.data.query&&(this.keyboardEl.components["super-keyboard"].data.value="",this.keyboardEl.components["super-keyboard"].updateTextInput("")),this.debouncedSearch=r(this.search.bind(this),1e3),(this.data.genre||this.data.playlist||this.data.query)&&this.search(this.data.query))},play:function(){this.el.sceneEl.emit("searchresults",this.eventDetail),this.search("")},events:{superkeyboardchange:function(e){e.target===this.el&&this.debouncedSearch(e.detail.value)}},search:function(e){if(!e&&"All"===this.data.difficultyFilter&&!this.data.genre&&!this.data.playlist&&this.popularHits)return this.eventDetail.results=this.popularHits,this.eventDetail.query="",void this.el.sceneEl.emit("searchresults",this.eventDetail);if(this.eventDetail.query=e,this.queryObject.query=e,this.queryObject.hitsPerPage=e?30:150,"favorites"===this.data.playlist)return this.eventDetail.results=JSON.parse(localStorage.getItem("favorites-v2")),void this.el.sceneEl.emit("searchresults",this.eventDetail);let t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&q="+encodeURIComponent(e);if(this.data.playlist)t=`https://api.beatsaver.com/playlists/id/${this.data.playlist}/CURRENT_PAGE_INDEX`;else if(this.data.genre){const e={Pop:"pop","R&B":"rb",Rap:"hip-hop-rap",Rock:"rock",Soundtrack:"tv-movie-soundtrack","Video Games":"video-game-soundtrack",Electronic:"electronic","Hip Hop":"hip-hop-rap",House:"house","J-Pop":"j-pop","K-Pop":"k-pop",Meme:"comedy-meme",Alternative:"alternative",Anime:"anime",Comedy:"comedy-meme",Dubstep:"dubstep",Dance:"dance"}[this.data.genre];t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&tags="+encodeURIComponent(e)}else if(e&&e.length<3)return;fetch(t.replaceAll("CURRENT_PAGE_INDEX",0)).then(e=>e.json()).then(e=>{var n=(e.docs||e.maps).map(i);this.eventDetail.results=n,this.eventDetail.url=t,this.eventDetail.urlPage=0,this.el.sceneEl.emit("searchresults",this.eventDetail)})}}),AFRAME.registerComponent("search-result-list",{init:function(){new MutationObserver(e=>{for(let t=0;t<e.length;t++)"data-index"===e[t].attributeName&&this.refreshLayout()}).observe(this.el,{attributes:!0,childList:!1,subtree:!0})},events:{click:function(e){this.el.sceneEl.emit("menuchallengeselect",e.target.closest(".searchResult").dataset.id,!1)}},refreshLayout:function(){this.el.emit("layoutrefresh",null,!1)}}),window.AFRAME){const t=["search","search-result-list"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,p=function(){return l.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,c,l=0,u=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function b(e){return l=e,s=setTimeout(w,t),u?v(e):a}function _(e){var n=e-c;return void 0===c||n>=t||n<0||g&&e-l>=o}function w(){var e=p();if(_(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-c);return g?d(n,o-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=i=void 0,a)}function A(){var e=p(),n=_(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return b(c);if(g)return s=setTimeout(w,t),v(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=m(t)||0,f(n)&&(u=!!n.leading,o=(g="maxWait"in n)?h(m(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),A.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},A.flush=function(){return void 0===s?a:E(p())},A}}).call(this,n(1))},function(e,t){e.exports=[{id:"43a25",name:"[Extra Sensory II] Porter Robinson - Lifelike",description:"// MAP 3 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\nthis is only the beginning...*\n\nVideo:\nhttps://www.youtube.com/watch?v=dlqYqNKcLII",uploader:{id:4340055,name:"nasafrasa",avatar:"https://cdn.beatsaver.com/avatar/16a6108559271b0c0a8d254ceb5ad43f896a0a28.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4340055/playlist"},metadata:{bpm:100.72,duration:96,songName:"Lifelike",songSubName:"",songAuthorName:"Porter Robinson",levelAuthorName:"nasafrasa"},stats:{plays:0,downloads:0,upvotes:3632,downvotes:14,score:.9918,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.030128Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0",state:"Published",createdAt:"2025-01-26T05:53:34.451213Z",sageScore:5,diffs:[{njs:16,offset:0,notes:123,bombs:0,obstacles:0,nps:1.564,length:132,characteristic:"Standard",difficulty:"Easy",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:106395,label:"Nurture",environment:"BillieEnvironment"},{njs:16,offset:0,notes:145,bombs:0,obstacles:0,nps:1.844,length:132,characteristic:"Standard",difficulty:"Normal",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:128235,label:"Lifelike",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.zip",coverURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.jpg",previewURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2025-01-27T00:42:00.509882Z",createdAt:"2025-01-26T05:53:34.451213Z",updatedAt:"2025-11-07T23:01:19.839738Z",lastPublishedAt:"2025-01-26T23:35:01.030128Z",tags:["accuracy","balanced","ambient","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a1f",name:"[Extra Sensory II] Simplifi - you",description:"// MAP 4 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\n====================================================\n\neverything you see in this map was created (from scratch!) by me\n\nlong time coming. this map represents the end of a chapter, and the start of a new one. I've been dreaming of releasing a map with Vivify almost as long as I've been a Beat Saber creative. I was stuck for so long, but I finally had a breakthrough!\n\nand it's yours to keep.\n\n====================================================\n\nproject source: https://github.com/Swifter1243/you_map\ngameplay video: https://youtu.be/2SgLtmqxu-k \nExtra Sensory II website: https://exsii.totalbs.dev/",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:70,duration:157,songName:"you",songSubName:"",songAuthorName:"Simplifi",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:5380,downvotes:28,score:.9914,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.797228Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d265d40935983502ad6f05ddeb5417f3e37c2290",state:"Published",createdAt:"2025-01-26T04:23:47.346441Z",sageScore:3,diffs:[{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Normal",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140835,environment:"BillieEnvironment"},{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140675,environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.zip",coverURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.jpg",previewURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.mp3"}],curator:{id:4331555,name:"TheBlackParrot",avatar:"https://cdn.beatsaver.com/avatar/213097af5fb746f71825aad761723951ce4807ab.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4331555/playlist"},curatedAt:"2025-01-26T23:47:25.274685Z",createdAt:"2025-01-26T04:23:47.346441Z",updatedAt:"2025-02-09T02:00:19.217070Z",lastPublishedAt:"2025-01-26T23:35:01.797228Z",tags:["electronic","accuracy"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b6",name:"[Electro Swing Pack] The Electric Swing Circus - Empires",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/WJy6_2cTPYg\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:173,songName:"Empires",songSubName:"",songAuthorName:"The Electric Swing Circus",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:5096,downvotes:31,score:.9905,reviews:2},uploaded:"2021-07-08T15:24:55.769Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cecc89118b3a75ea7d65ceff5949b3ef19fea716",key:"1a0b6",state:"Published",createdAt:"2021-07-08T15:24:55.769Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:522,bombs:0,obstacles:24,nps:3.173,length:329,characteristic:"Standard",difficulty:"Expert",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:823,bombs:0,obstacles:0,nps:5.003,length:329,characteristic:"Standard",difficulty:"ExpertPlus",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:749915,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.zip",coverURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.jpg",previewURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.mp3"}],curator:{id:57657,name:"Pixelguy",hash:"5cff0b7698cc5a672c8541a8",avatar:"https://cdn.beatsaver.com/avatar/57657.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/57657/playlist"},curatedAt:"2021-07-08T15:24:55.769Z",createdAt:"2021-07-08T15:24:55.769Z",updatedAt:"2024-11-02T11:17:18.878282Z",lastPublishedAt:"2021-07-08T15:24:55.769Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1e6ff",name:"{Modchart} acloudyskye - Somewhere Out There",description:"MAP 10. https://beatsaver.com/playlists/8713\n\nWhat can I say about this map.\n\nI feel like this is the culmination of everything thats happened for modcharting this entire year. All of the advancements I've made with environments, mawntee has made with notemods, and reddek has made with walls come together into this piece that I can only describe as the next step. \n\nI really hope everyone enjoys this one. It's one of a kind.\n\nVideo: https://www.youtube.com/watch?v=rphHsDxJbpg",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:160,duration:323,songName:"Somewhere Out There",songSubName:"",songAuthorName:"acloudyskye",levelAuthorName:"Swifter, Mawntee, Reddek"},stats:{plays:0,downloads:0,upvotes:20023,downvotes:170,score:.9901,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2021-11-30T01:27:30.018531Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"448d219117992026eb23c98dc920ce73a912f289",state:"Published",createdAt:"2022-09-26T15:58:45.498795Z",sageScore:1,diffs:[{njs:19,offset:-.5,notes:892,bombs:8,obstacles:3746,nps:2.973,length:800,characteristic:"Standard",difficulty:"Expert",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:0,warns:0,resets:0},maxScore:813395,label:"Experience Recommended",environment:"BTSEnvironment"},{njs:19,offset:-.5,notes:1134,bombs:8,obstacles:3530,nps:3.78,length:800,characteristic:"Lawless",difficulty:"ExpertPlus",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:719,warns:26,resets:1},maxScore:1036035,label:"Busier Mapping",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.zip",coverURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.jpg",previewURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.mp3"}],curator:{id:4284942,name:"blackjack",hash:"5e96ca3a16c96800062400fe",avatar:"https://cdn.beatsaver.com/avatar/dcd6d334252b91670180855821886983a1818f4a.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284942/playlist"},curatedAt:"2021-11-30T01:27:30.018531Z",createdAt:"2021-11-30T01:03:02.982731Z",updatedAt:"2023-08-26T19:08:38.528705Z",lastPublishedAt:"2022-09-26T16:01:29.467930Z",tags:["pop","balanced"],bookmarked:!1,collaborators:[{id:4233941,name:"reddek",hash:"5dbfb4426dea0b0006bd328d",avatar:"https://cdn.beatsaver.com/avatar/fc462a26fa97d9b2fdadbdf5d7a45ef75026f8e9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4233941/playlist"},{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d7fa",name:"Geoxor - Gloom [Wallmap]",description:"REUPLOAD due to last minute mapping error\n\nSpecial thanks to:\nNyri0 - For providing scripts that were crucial to making this map possible, and for helping me along the way.\nLayanmeta - For giving me so much encouragement throughout the final stages and making a brilliant YouTube video on this map.\nBSMG discord - For the continued support throughout the development process\nAll you people/birds - For playing my map :D\n\nBRIAN HAS BECOME SENTIENT. ALL HAIL BRIAN",uploader:{id:18761,name:"minething",hash:"5e9b4ead16c9680006287387",avatar:"https://www.gravatar.com/avatar/f9bed76044f22e33e287d984993c59797049f1315d399c641b1ea7778975c926?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/18761/playlist"},metadata:{bpm:93,duration:167,songName:"Gloom",songSubName:"",songAuthorName:"Geoxor",levelAuthorName:"Mine Thing"},stats:{plays:0,downloads:0,upvotes:9917,downvotes:81,score:.9896,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-08-16T19:13:40.774Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"823b4e880baac024728ae96a7c20e28026c4585d",key:"d7fa",state:"Published",createdAt:"2020-08-16T19:13:40.774Z",sageScore:3,diffs:[{njs:12,offset:6,notes:0,bombs:0,obstacles:15605,nps:0,length:0,characteristic:"Standard",difficulty:"Easy",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"RocketEnvironment"},{njs:12,offset:6,notes:202,bombs:0,obstacles:15605,nps:1.309,length:239.125,characteristic:"Standard",difficulty:"Hard",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.274,paritySummary:{errors:48,warns:6,resets:0},maxScore:178595,environment:"RocketEnvironment"},{njs:12,offset:6,notes:411,bombs:4,obstacles:15605,nps:2.665,length:239,characteristic:"Standard",difficulty:"Expert",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,environment:"RocketEnvironment"},{njs:12,offset:3,notes:411,bombs:4,obstacles:12340,nps:2.665,length:239,characteristic:"Standard",difficulty:"ExpertPlus",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,label:"Less Lag",environment:"RocketEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.zip",coverURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.jpg",previewURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-16T19:13:40.774Z",createdAt:"2020-08-16T19:13:40.774Z",updatedAt:"2020-08-16T19:13:40.774Z",lastPublishedAt:"2020-08-16T19:13:40.774Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a24",name:"[Extra Sensory II] Andrew Prahlow - End Times",description:"// MAP 2 OF EXTRA SENSORY II\n[https://beatsaver.com/playlists/797071]\n\n=================================================\n\nFirst off, I just want to say thank you. Thank you to the entire TotalBS team (Especially Swifter and Aeroluna) for giving me a chance with this project. When I started on this map, I honestly never thought it would turn into anything like this. At first, it was just going to be something simple with the sun, stars, and you. But as I kept learning more about Unity and Vivify, the project just kept growing little by little, until it became what it is now.\n\nI’ve gotta give a special shoutout to Swifter for helping so much with the shaders, and to Aeroluna for making the custom UI possible. Without those two, this map would not have been able to become what it is now.\n\nOver the past year or so working on this, I feel like my goals and what I want in life have completely shifted. I’ve got more drive and motivation now than I’ve ever had before, and I’m so thankful for that.\n\nI'd like to also thank my closest friend, Azushii, for introducing me to Outer Wilds and encouraging me to start this map in the first place. Rest in peace buddy.. <3\n\n=================================================\nCustom Saber Model: [Coming Soon]\nCustom Note Model: [Coming Soon]\nProject Source: [Coming Soon]\nGameplay Video: https://youtu.be/YtETILVC4V4\nExtra Sensory II Website: https://exsii.totalbs.dev/",uploader:{id:70911,name:"Chaimzy",hash:"605ae0535ab13d000609b331",avatar:"https://cdn.beatsaver.com/avatar/70911.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/70911/playlist"},metadata:{bpm:128,duration:157,songName:"End Times",songSubName:"Outer Wilds",songAuthorName:"Andrew Prahlow",levelAuthorName:"Chaimzy"},stats:{plays:0,downloads:0,upvotes:3127,downvotes:20,score:.9889,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.057933Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b4acc042f6541c06e57a384fa9796a10c45ff558",state:"Published",createdAt:"2025-01-26T05:32:44.984680Z",sageScore:3,diffs:[{njs:16,offset:0,notes:32,bombs:8,obstacles:0,nps:.533,length:128,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:60,paritySummary:{errors:0,warns:0,resets:0},maxScore:22195,label:"There's more to explore here",environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.zip",coverURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.jpg",previewURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.mp3"}],curator:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},curatedAt:"2025-01-27T00:06:25.521273Z",createdAt:"2025-01-26T05:32:44.984680Z",updatedAt:"2025-01-30T01:51:28.961316Z",lastPublishedAt:"2025-01-26T23:35:01.057934Z",tags:["accuracy","ambient","video-game-soundtrack"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d4a5",name:"[FUTURE FUNK PACK] Shiawase No Monosashi (VANTAGE // Short Ver.)",description:'FUTURE FUNK MAP PACK\n2 songs uploaded everyday through August 10th - 14th!\n\n"Shiawase No Monosashi" is performed by Mariya Takeuchi. This version of the song is a short edit I made from VANTAGE //\'s edit. The original length of the song is 5 minutes long\n\nPlease look forward to the upcoming maps!\n\nDM any feedback on Discord\nETAN#8341',uploader:{id:4235140,name:"ETAN",hash:"5cff0b7798cc5a672c855775",avatar:"https://cdn.beatsaver.com/avatar/652a9b5d335007c8668b43aa727c75e84794dbe1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4235140/playlist"},metadata:{bpm:128,duration:171,songName:"Shiawase No Monosashi",songSubName:"(VANTAGE // Short Ver.)",songAuthorName:"Mariya Takeuchi",levelAuthorName:"ETAN"},stats:{plays:0,downloads:0,upvotes:9325,downvotes:95,score:.9876,reviews:2},uploaded:"2020-08-12T18:17:44.285Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d7cb32f23041dec272de3da0ac141dd8f91478ca",key:"d4a5",state:"Published",createdAt:"2020-08-12T18:17:44.285Z",sageScore:7,diffs:[{njs:10,offset:1,notes:168,bombs:16,obstacles:1,nps:1.029,length:348.25,characteristic:"Standard",difficulty:"Easy",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:147315,environment:"BigMirrorEnvironment"},{njs:11,offset:1,notes:255,bombs:16,obstacles:1,nps:1.562,length:348.25,characteristic:"Standard",difficulty:"Normal",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:1,warns:1,resets:0},maxScore:227355,environment:"BigMirrorEnvironment"},{njs:12,offset:1,notes:358,bombs:16,obstacles:1,nps:2.193,length:348.25,characteristic:"Standard",difficulty:"Hard",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:322115,environment:"BigMirrorEnvironment"},{njs:15,offset:0,notes:557,bombs:16,obstacles:1,nps:3.335,length:356.25,characteristic:"Standard",difficulty:"Expert",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:505195,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:778,bombs:16,obstacles:1,nps:4.659,length:356.25,characteristic:"Standard",difficulty:"ExpertPlus",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:708515,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.zip",coverURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.jpg",previewURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-12T18:17:44.285Z",createdAt:"2020-08-12T18:17:44.285Z",updatedAt:"2020-08-12T18:17:44.285Z",lastPublishedAt:"2020-08-12T18:17:44.285Z",tags:["j-pop","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4968d",name:"{Vivify} Jaron - 743⁺Aether*✧ ˳ ⁎ ¹¹¹} ⁺ . ˳",description:"**Originally, this map was going to be my Extra Sensory II map.**\n\nHowever, given the insane density of this song, it demanded rapidly changing visuals that kept up with how dynamic it felt to listen to. I did not have the technical or artistic skill to pull off this song. I tried and failed, for 3 years. Finally, after executing Extra Sensory II this year, I realized it was time to tackle this behemoth of a project. This project took over ~350 hours, and 1000 repository commits. The majority of it was put together over the last 3 months.\n\nI really think that I executed on this vision to a tee, landing every single visual cue that I imagined ever since I heard the song for the first time in 2022. I hope you can feel the electricity of this experience <3\n\n✧\n\n**Special Thanks:**\n- **Frautcres** - Doing extensive technical performance investigations in order to make the map run without a hitch, as well as assisting with technical difficulties\n- **Chaimzy, Astra, HAMCORE, Mawntee, TheBlackParrot, TinyPawb, Klondike, RidgeVR, UGEcko** - Doing loads of playtesting and giving feedback to make the map feel as polished as it does\n- **SKYZA.** - Beautiful ribbon & saber textures\n- **Jaron** - Creating this incredible song, and supporting me over the years as I tried to make visuals that shaped up\n\nvideo: https://youtu.be/qZ1prxep0Wc\nproject source: https://github.com/Swifter1243/aether_map",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:145,duration:274,songName:"743+Aether*✧ . * 111} + , .",songSubName:"",songAuthorName:"Jaron",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:2252,downvotes:15,score:.9876,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2025-08-14T16:00:00.354832Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cc66335f2b8bf50fe49591dd925860b2e596018e",state:"Published",createdAt:"2025-08-14T16:13:20.156249Z",sageScore:3,diffs:[{njs:12,offset:-.5,notes:444,bombs:0,obstacles:0,nps:1.698,length:632,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:401235,label:"✧",environment:"BillieEnvironment"},{njs:16,offset:-.5,notes:703,bombs:0,obstacles:0,nps:2.688,length:632,characteristic:"Lawless",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:639515,label:"\\___*",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.zip",coverURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.jpg",previewURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.mp3"}],curator:{id:4285538,name:"Darkrealm7",hash:"5ffa2803f2cdd000075e24ed",avatar:"https://cdn.beatsaver.com/avatar/7b66a32ba61dcfb938aa0d2207911eb08d28a06f.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285538/playlist"},curatedAt:"2025-08-14T21:11:11.210516Z",createdAt:"2025-08-14T04:02:49.366190Z",updatedAt:"2025-08-20T16:41:30.561039Z",lastPublishedAt:"2025-08-20T16:41:30.561039Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1362d",name:"Ghost Choir - Louie Zong (modchart)",description:"This is a relaxing modchart and a technical proof of concept. If you haven't played my modchart Dondante yet, please check it out: https://beatsaver.com/beatmap/123b5\r\n\r\nThe map requires the mods Noodle Extensions and Chroma. If Noodle Extensions is not available yet on ModAssistant, you can get the latest release at https://github.com/Aeroluna/NoodleExtensions/releases/tag/v1.3.5\r\n\r\nTips for a better experience:\r\n- Disable static lights; there are no lights anyway\r\n- Hide the HUD\r\n- Turn the SFX volume down (0 or low value like 0.2)\r\n- Enable bloom post-processing\r\n\r\nPreview: https://youtu.be/XC7RY9C_EHs\r\n\r\nI adapted this from Louie Zong's original animation: https://youtu.be/kXF3VYYa5TI\r\n\r\n",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:67,duration:90,songName:"Ghost Choir",songSubName:"",songAuthorName:"Louie Zong",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4478,downvotes:42,score:.987,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-30T12:31:29.825Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"1d373506c0b2b82867411f18696a1ad53d4ea01d",key:"1362d",state:"Published",createdAt:"2021-01-30T12:31:29.825Z",sageScore:2,diffs:[{njs:14,offset:0,notes:138,bombs:0,obstacles:1460,nps:1.684,length:91.5,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:81.94,paritySummary:{errors:4,warns:3,resets:0},maxScore:119715,label:"Oooo",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.zip",coverURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.jpg",previewURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.mp3"}],createdAt:"2021-01-30T12:31:29.825Z",updatedAt:"2021-01-30T12:31:29.825Z",lastPublishedAt:"2021-01-30T12:31:29.825Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"198f3",name:"Spider Dance - Toby Fox (Undertale modchart)",description:"There are countless Undertale maps on Beat Saber, but what if you could actually experience a real boss fight? It's now possible thanks to Noodle Extensions, and I'm proud to present to you the first Undertale modchart: Spider Dance, where you will confront Muffet.\r\n\r\nTips for a better experience:\r\n- Don't use static lights; there shouldn't be any lights\r\n- Hide the HUD in player settings\r\n- Enable \"bloom post-processing\"\r\n- Enable \"screen distortion effects\"\r\n\r\nInstallation instructions:\r\n- You will need Noodle Extensions and Chroma and their dependencies. All are now available on ModAssistant.\r\n- If you read this in a future where the update broke the mods and they haven't been approved on ModAssistant yet, install the basic mods from ModAssistant and get the latest releases of Noodle Extensions, Heck, and Chroma from Aeroluna's GitHub: https://github.com/Aeroluna\r\n\r\nVideo: https://youtu.be/fy8KmUor6fI\r\n\r\nI started this a while ago before Ghost Choir and then abandoned the project. But I finally decided to finish the work, so I hope you'll enjoy it :)\r\nThanks to Reaxt and Cyansnow, who testplayed and made detailed suggestions that helped me improve the quality of this map. I really appreciate it.\r\n\r\nMy social media links (please follow/subscribe): https://linktr.ee/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:115,duration:114,songName:"Spider Dance",songSubName:"",songAuthorName:"Toby Fox",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:10995,downvotes:123,score:.9868,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-06-25T17:47:40.296Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"09246637fa63ac55aa518718fd1eb4b876960480",key:"198f3",state:"Published",createdAt:"2021-06-25T17:47:40.296Z",sageScore:2,diffs:[{njs:16,offset:0,notes:434,bombs:88,obstacles:1153,nps:4.377,length:190.063,characteristic:"Standard",difficulty:"ExpertPlus",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:99.163,paritySummary:{errors:13,warns:13,resets:0},maxScore:392035,label:"9999G",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.zip",coverURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.jpg",previewURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-06-25T17:47:40.296Z",createdAt:"2021-06-25T17:47:40.296Z",updatedAt:"2021-06-25T17:47:40.296Z",lastPublishedAt:"2021-06-25T17:47:40.296Z",tags:["electronic","video-game-soundtrack","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"23f6b",name:"acloudyskye & N33T - Nothing Else (Modchart)",description:"9 months ago I created my first chroma map. At this time I didn't think I could make a map that you are about to play\nIn these 9 months, I learned a lot about walls, notes, environment enhancement, etc... but mostly how to properly polish a map.\nI wanted to make something big, something even bigger than SOT(as in scale swifter silly u) and here I am today publishing this map.\nThis map contains 7 different unique environments that connect together with seamless transitions.\nThis map is a big step in the journey of modhcarts just like SOT.\nI hope more people will see this modhcart as a place they can start and learn Noodle Extensions, You can also check the script of the modhcart on my Github. https://github.com/TzurS11/NoodleScript/tree/main/Examples/Scripts\n\nLastly, I wanna thank all the people that helped. even if you are not on this list I appreciate What you've done a lot!\n@GojiCrafter, @tall_chilis_boi, @Swifter, @Mawntee, Stick, kiwii.\n\nShowcase: https://youtu.be/qkSe0gOctEU\n\nbtw HAHA get fucked swifter! I got more environments than in SOT",uploader:{id:4284455,name:"TzurS11",hash:"6040a8135ab13d0006093512",avatar:"https://cdn.beatsaver.com/avatar/87d26d1223ba8840e9dca8d433165f717e7584e1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284455/playlist"},metadata:{bpm:125,duration:291,songName:"Nothing Else",songSubName:"",songAuthorName:"acloudyskye & N33T",levelAuthorName:"TzurS11"},stats:{plays:0,downloads:0,upvotes:2949,downvotes:25,score:.9867,reviews:3},uploaded:"2022-04-10T19:30:00.565807Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"e45b69a9428505e93f73f1bdc43909d43fc844e3",state:"Published",createdAt:"2022-04-10T20:32:24.193634Z",sageScore:3,diffs:[{njs:16,offset:0,notes:919,bombs:0,obstacles:0,nps:3.298,length:580.5,characteristic:"Standard",difficulty:"ExpertPlus",events:18391,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:278.64,paritySummary:{errors:25,warns:13,resets:0},maxScore:838235,label:"You can hide away the fears you face\n\nRead Warnings!",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.zip",coverURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.jpg",previewURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-04-10T20:55:22.272218Z",createdAt:"2022-04-05T14:25:21.240039Z",updatedAt:"2022-08-25T11:32:19.554653Z",lastPublishedAt:"2022-04-10T20:32:58.830331Z",tags:["balanced","electronic","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"32693",name:"Fall Out Boy - The Phoenix",description:"Might be one of my most accessible mapsets yet as a custom-lit full spread of difficulties paired with both a lawless expert+ and one saber difficulties! Made this one for a friend of mine who's a big FoB fan. Enjoy!\n\nFeedback via reviews down below is always appreciated!\n\nPreview: https://youtu.be/2LFQLJd0pOQ\n\nSocials:\nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:138,duration:246,songName:"The Phoenix",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:5122,downvotes:52,score:.9865,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2023-05-31T23:01:59.709120Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf2c367d29b133b66dc27f6f8e20467d0ec3301f",state:"Published",createdAt:"2023-05-31T22:51:42.410637Z",sageScore:5,diffs:[{njs:10,offset:-.95,notes:494,bombs:0,obstacles:44,nps:2.055,length:553,characteristic:"Standard",difficulty:"Easy",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:447235,blStars:2.56,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:545,bombs:0,obstacles:38,nps:2.267,length:553,characteristic:"Standard",difficulty:"Normal",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:494155,blStars:3.04,environment:"NiceEnvironment"},{njs:14,offset:-.2,notes:767,bombs:0,obstacles:6,nps:3.19,length:553,characteristic:"Standard",difficulty:"Hard",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:700075,blStars:4.07,environment:"NiceEnvironment"},{njs:15,offset:-.475,notes:851,bombs:0,obstacles:9,nps:3.539,length:553,characteristic:"Standard",difficulty:"Expert",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:779035,blStars:4.86,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1384,bombs:0,obstacles:4,nps:5.756,length:553,characteristic:"Standard",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1272275,blStars:6.51,environment:"NiceEnvironment"},{njs:16,offset:-.65,notes:816,bombs:0,obstacles:29,nps:3.394,length:553,characteristic:"OneSaber",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:743475,blStars:8.35,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1388,bombs:0,obstacles:4,nps:5.773,length:553,characteristic:"Lawless",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1275955,label:"Double Downs",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.zip",coverURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2023-06-01T02:16:21.699148Z",createdAt:"2023-05-16T06:12:18.475582Z",updatedAt:"2024-08-27T09:34:28.073772Z",lastPublishedAt:"2023-05-31T23:01:59.709120Z",tags:["dance-style","pop","punk"],bookmarked:!1,declaredAi:"None",blRanked:!0,blQualified:!1},{id:"1dcf4",name:"DYES IWASAKI - Bad Hatter ft. Lily Mizusaki",description:'Part of my second custom map pack!\n\nGameplay preview:\nhttps://www.youtube.com/watch?v=ZE5enFMVsv8\n\nGet the pack here:\nhttps://bsaber.com/tokyo-neo-swing/\n\nThis time around I took the extra time and made full spreads and chroma lightshows for each of the 6 songs of the album "Tokyo Neo Swing" by DYES IWASAKI & Lily Mizusaki.\n\nHuge thanks to the lovely playtesters MaybeeMae, Cocci, Monstor, Vaser888, and Kansas!\n\nAlso here is my playthrough of the entire pack on Expert Plus:\nhttps://www.youtube.com/watch?v=lgXR4sBl_kk\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/',uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:122,duration:176,songName:"Bad Hatter",songSubName:"(ft. Lily Mizusaki)",songAuthorName:"DYES IWASAKI",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4470,downvotes:44,score:.9865,reviews:3},uploaded:"2021-11-11T13:06:30.332180Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"ebcf0c8780551bfe0feb96fbc255accad548798b",state:"Published",createdAt:"2021-11-14T11:39:03.473167Z",sageScore:6,diffs:[{njs:12,offset:1,notes:212,bombs:0,obstacles:0,nps:1.249,length:345.167,characteristic:"Standard",difficulty:"Easy",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:46,warns:12,resets:0},maxScore:187795,environment:"FitBeatEnvironment"},{njs:12,offset:.5,notes:320,bombs:0,obstacles:0,nps:1.885,length:345.167,characteristic:"Standard",difficulty:"Normal",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:29,warns:14,resets:0},maxScore:287155,environment:"FitBeatEnvironment"},{njs:14,offset:0,notes:491,bombs:0,obstacles:2,nps:2.89,length:345.5,characteristic:"Standard",difficulty:"Hard",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:4,warns:0,resets:0},maxScore:444475,environment:"FitBeatEnvironment"},{njs:16,offset:-.5,notes:697,bombs:0,obstacles:0,nps:4.102,length:345.5,characteristic:"Standard",difficulty:"Expert",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:9,resets:0},maxScore:633995,environment:"FitBeatEnvironment"},{njs:19,offset:.25,notes:924,bombs:0,obstacles:0,nps:5.438,length:345.5,characteristic:"Standard",difficulty:"ExpertPlus",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:0,resets:0},maxScore:842835,environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.zip",coverURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.jpg",previewURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2021-11-11T13:06:30.332180Z",createdAt:"2021-11-10T18:01:16.390803Z",updatedAt:"2024-11-02T11:19:03.182227Z",lastPublishedAt:"2021-11-14T11:39:08.754762Z",tags:["swing","dance-style","balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b7aa",name:"Powerwolf - Venom of Venus",description:"Back to my more regular style, Powerwolf is a power-metal band that perform around the themes of werewolves and religion, a strange but interesting mixture.\r\n\r\nEx+ has a no-colours mode for those who wish to play without the custom block colours, but unfortunately I can't fit such an option for all difficulties.\r\n\r\nNormal 1.85 NPS\r\nHard 3.15 NPS\r\nExpert 4.43 NPS\r\nExpert+ 5.11 NPS\r\n\r\nThere is no easy difficulty, as that I needed the slot for the no-colour mode.",uploader:{id:4285369,name:"Cyrix",hash:"5eb6eb9a7abb000006c85add",avatar:"https://cdn.beatsaver.com/avatar/4213c7b05b9778149ae4536dd10842c6ed307ec5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285369/playlist"},metadata:{bpm:164,duration:211,songName:"Venom of Venus",songSubName:"",songAuthorName:"Powerwolf",levelAuthorName:"Cyrix"},stats:{plays:0,downloads:0,upvotes:8e3,downvotes:91,score:.9862,reviews:14,sentiment:"VERY_POSITIVE"},uploaded:"2020-06-29T18:24:10.081Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f88b43c770dcd85a4ba18368853fbf062d41a09c",key:"b7aa",state:"Published",createdAt:"2020-06-29T18:24:10.081Z",sageScore:7,diffs:[{njs:12,offset:.5,notes:392,bombs:0,obstacles:63,nps:1.948,length:549.938,characteristic:"Standard",difficulty:"Easy",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:44,warns:15,resets:0},maxScore:353395,label:"Normal",environment:"PanicEnvironment"},{njs:13,offset:1,notes:666,bombs:8,obstacles:36,nps:3.31,length:549.938,characteristic:"Standard",difficulty:"Normal",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:1,warns:0,resets:1},maxScore:605475,label:"Hard",environment:"PanicEnvironment"},{njs:17,offset:0,notes:934,bombs:9,obstacles:7,nps:4.642,length:549.938,characteristic:"Standard",difficulty:"Hard",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:0,warns:0,resets:2},maxScore:852035,label:"Ex",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"Expert",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+ No Colour",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"ExpertPlus",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.zip",coverURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.jpg",previewURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-06-29T18:24:10.081Z",createdAt:"2020-06-29T18:24:10.081Z",updatedAt:"2020-06-29T18:24:10.081Z",lastPublishedAt:"2020-06-29T18:24:10.081Z",tags:["metal","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"210e3",name:"[Modchart] Sarah Cothran - As The World Caves In",description:"This started out as just a simple environment animation test, and then quickly snowballed out into one of my favourite maps I've made so far!\n\nAlso big ups to Fatalution for doing the lighting on this!\nThis is our first collab together, and the first time I've collaborated on a map with someone who shared the same ideas/thought process as myself. \nThis definitely won't be our last collab :)\n\nCheck out their profile and lightshow preview here:\nhttps://beatsaver.com/profile/84945\nhttps://youtu.be/1Fh5jL_UJBc\n\n\nWARNING:\nThis map may cause mild motion sickness! \nIf you feel sick at any point, remember that you can pause and it will stop everything!\n\n(If you have frequent issues with motion sickness in VR, I recommend having a fan on, or keeping smaller carpet with a different texture in your playspace)",uploader:{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"},metadata:{bpm:124,duration:164,songName:"As The World Caves In",songSubName:"",songAuthorName:"Sarah Cothran",levelAuthorName:"Mawntee & Fatalution"},stats:{plays:0,downloads:0,upvotes:8562,downvotes:100,score:.986,reviews:22,sentiment:"VERY_POSITIVE"},uploaded:"2022-02-02T20:18:54.976546Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d4d847465bff16bc936e8281b5e3c703a4ca1c93",state:"Published",createdAt:"2022-02-02T20:27:55.445283Z",sageScore:4,diffs:[{njs:18,offset:1.961111,notes:259,bombs:20,obstacles:0,nps:1.63,length:328.466,characteristic:"Standard",difficulty:"ExpertPlus",events:31028,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:158.935,paritySummary:{errors:403,warns:36,resets:11},maxScore:231035,label:"Our Final Night Alive",environment:"TimbalandEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.zip",coverURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.jpg",previewURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.mp3"}],curator:{id:4234800,name:"AllieeCute",avatar:"https://cdn.beatsaver.com/avatar/f3788635ba87f3e1144e26501fe02c26b29aaccc.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4234800/playlist"},curatedAt:"2022-02-02T20:18:54.976546Z",createdAt:"2022-02-02T20:07:53.311141Z",updatedAt:"2023-10-16T18:16:00.863418Z",lastPublishedAt:"2023-06-06T14:03:19.315272Z",tags:["accuracy","dance-style"],bookmarked:!1,collaborators:[{id:84945,name:"fatalution",hash:"5cff0b7398cc5a672c84f30a",avatar:"https://cdn.beatsaver.com/avatar/7b7e7792dd5a8b250b5205c3a823d7d4006182f5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/84945/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"352d8",name:"Belle - Lend Me Your Voice [Noodle Extension, Chrom+] (Remastered!!!)",description:'If you are seasick in VR, do not play the "ALL EFFECTS" and "NO rotation (360 °)". For you, difficulty - "NO effects"\n\nIf there are performance problems disable "Mirror" in the graphics settings\n\nSong - https://music.youtube.com/watch?v=nSbhUCM5Z6s',uploader:{id:4284370,name:"hickeychan",hash:"6001ba1539ce5b000682a59f",avatar:"https://cdn.beatsaver.com/avatar/ecb540d442d3dbcd21881c32b050977d282a7438.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284370/playlist"},metadata:{bpm:121,duration:304,songName:"Lend Me Your Voice",songSubName:"",songAuthorName:"Kaho Nakamura",levelAuthorName:"HickeyChan"},stats:{plays:0,downloads:0,upvotes:1156,downvotes:6,score:.9859,reviews:3},uploaded:"2023-08-24T10:14:50.865197Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"be0ab6e5f1b5581a9a053f4a4c144c785696d349",state:"Published",createdAt:"2023-08-24T10:12:42.966966Z",sageScore:1,diffs:[{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Hard",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO effects",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Expert",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO rotation (360 °)",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"ExpertPlus",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"ALL EFFECTS",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.zip",coverURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.jpg",previewURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2023-08-25T06:09:54.756879Z",createdAt:"2023-08-24T10:12:42.966966Z",updatedAt:"2023-09-04T05:38:48.731043Z",lastPublishedAt:"2023-08-24T10:14:50.865197Z",tags:["accuracy","balanced","anime","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b8",name:"[Electro Swing Pack] Wolfgang Lohr & The Swinghoppers - Party Like It's 1920",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/ye22W_xrXnk\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:187,songName:"Party Like It's 1920",songSubName:"",songAuthorName:"The Swinghoppers & Wolfgang Lohr",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4194,downvotes:45,score:.9855,reviews:1},uploaded:"2021-07-08T15:25:28.451Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"973bab980b568e41b0a17a772e61377b01ef85ec",key:"1a0b8",state:"Published",createdAt:"2021-07-08T15:25:28.451Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:556,bombs:0,obstacles:0,nps:3.063,length:363,characteristic:"Standard",difficulty:"Expert",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:504275,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:850,bombs:0,obstacles:0,nps:4.683,length:363,characteristic:"Standard",difficulty:"ExpertPlus",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:774755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.zip",coverURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.jpg",previewURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:25:28.451Z",createdAt:"2021-07-08T15:25:28.451Z",updatedAt:"2024-11-02T11:17:34.643709Z",lastPublishedAt:"2021-07-08T15:25:28.451Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1181f",name:"Royal & the Serpent - Overwhelmed",description:"Feeling that finals crunch? Worried about the pandemic? General anxiety with the news, and just feeling overwhelmed? Don't forget to take a step back and take a breath. Maybe by dancing along to this song that perfectly captures all of those feelings! Complete with overwhelming Chroma 2.0 lights! And now the extra details:\n\nBPM: 87\nNPS: Ez - 1.71; N - 2.09; H - 2.75; Ex - 3.19; Ex+ - 4.11\nNotes: Ez - 277; N - 338; H - 444; Ex - 516; Ex+ - 664\nBombs: Ez - 0; N - 0; H - 4; Ex - 4; Ex+ - 4\nWalls: Ez - 136; N - 134; H - 144; Ex - 109; Ex+ - 109\n\nSpecial thanks to qwasyx, Smay, and Cyrix for playtesting!",uploader:{id:4285188,name:"fruhead",hash:"5cff0b7598cc5a672c852683",avatar:"https://cdn.beatsaver.com/avatar/bcfbb8e5ac8665ae28d37b76a402daf0b88a68d0.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285188/playlist"},metadata:{bpm:87,duration:161,songName:"Overwhelmed",songSubName:"",songAuthorName:"Royal & the Serpent",levelAuthorName:"fruhead"},stats:{plays:0,downloads:0,upvotes:7135,downvotes:85,score:.9854,reviews:4},uploaded:"2020-11-29T23:09:47.309Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b748894960a346f1568b9f4876643f1358cfa897",key:"1181f",state:"Published",createdAt:"2020-11-29T23:09:47.309Z",sageScore:6,diffs:[{njs:10,offset:0,notes:277,bombs:0,obstacles:136,nps:1.793,length:224,characteristic:"Standard",difficulty:"Easy",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:43,warns:9,resets:0},maxScore:247595,environment:"PanicEnvironment"},{njs:12,offset:-.3,notes:338,bombs:0,obstacles:134,nps:2.188,length:224,characteristic:"Standard",difficulty:"Normal",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:22,warns:11,resets:0},maxScore:303715,environment:"PanicEnvironment"},{njs:14,offset:.4,notes:444,bombs:4,obstacles:144,nps:2.874,length:224,characteristic:"Standard",difficulty:"Hard",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:14,warns:4,resets:4},maxScore:401235,environment:"PanicEnvironment"},{njs:16,offset:.25,notes:516,bombs:4,obstacles:109,nps:3.34,length:224,characteristic:"Standard",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:467475,environment:"PanicEnvironment"},{njs:18,offset:.1,notes:664,bombs:4,obstacles:109,nps:4.298,length:224,characteristic:"Standard",difficulty:"ExpertPlus",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:603635,environment:"PanicEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Overwhelmed",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.zip",coverURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.jpg",previewURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.mp3"}],curator:{id:76372,name:"brightknight",hash:"5f30421b8a13d900061fe595",avatar:"https://cdn.beatsaver.com/avatar/236b93ff0df8c0f0305e52b6d3d01fa3e588b7ec.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/76372/playlist"},curatedAt:"2020-11-29T23:09:47.309Z",createdAt:"2020-11-29T23:09:47.309Z",updatedAt:"2020-11-29T23:09:47.309Z",lastPublishedAt:"2020-11-29T23:09:47.309Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4980",name:"(Old Version) Paradise - Coldplay",description:"\"Paradise\" is a song by the British rock band Coldplay. The song was released on 12 September 2011. I kinda like this song for relaxing on long car rides and I don't know how it will feel as a beat saber map but I'ma try mapping it anyways. So here it is :)\n\n2022 EDIT: Download the new map here: https://beatsaver.com/maps/28102",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:70,duration:278,songName:"Paradise",songSubName:"",songAuthorName:"Coldplay",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:6216,downvotes:74,score:.9852,reviews:1},uploaded:"2019-04-30T05:45:51Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b14639af36673a43fe32bc7563619deff438d438",key:"4980",state:"Published",createdAt:"2019-04-30T05:45:51Z",sageScore:6,diffs:[{njs:13,offset:0,notes:1023,bombs:0,obstacles:35,nps:3.816,length:312.75,characteristic:"Standard",difficulty:"Expert",events:4651,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:268.071,paritySummary:{errors:28,warns:29,resets:0},maxScore:933915,environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.zip",coverURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.jpg",previewURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2019-04-30T05:45:51Z",createdAt:"2019-04-30T05:45:51Z",updatedAt:"2022-07-22T08:36:01.092595Z",lastPublishedAt:"2019-04-30T05:45:51Z",tags:["alternative","indie"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"bdc7",name:"That's Life - Frank Sinatra",description:"Here is an honest-to-goodness human-mapped version of Frank Sinatra's 1966 hit, That's Life. This song is way too good to just have a crappy beat sage map.\n\nNormal and Hard Standard levels, and Expert Standard, 90, and 360 levels. Note that the expert levels are all essentially the same, just with varying degrees of wobbles.\n\nThanks to Maybeemae for the playtests!\n\nhttps://youtu.be/QXjj2-fgK8U",uploader:{id:78593,name:"techbutterfly",hash:"5cff0b7798cc5a672c8566f7",avatar:"https://cdn.beatsaver.com/avatar/99c0065fcfac5bfcf11adc69a58a8d3251bd748e.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/78593/playlist"},metadata:{bpm:77,duration:187,songName:"That's Life",songSubName:"",songAuthorName:"Frank Sinatra",levelAuthorName:"TechButterfly"},stats:{plays:0,downloads:0,upvotes:3713,downvotes:40,score:.9851,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-07-11T22:35:42.033Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7cca8c1afecd782cfd74f158c312201b780043d8",key:"bdc7",state:"Published",createdAt:"2020-07-11T22:35:42.033Z",sageScore:4,diffs:[{njs:10,offset:-.3,notes:321,bombs:0,obstacles:6,nps:1.768,length:233,characteristic:"Standard",difficulty:"Normal",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:30,warns:41,resets:0},maxScore:288075,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:418,bombs:0,obstacles:8,nps:2.302,length:233,characteristic:"Standard",difficulty:"Hard",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:38,resets:0},maxScore:377315,environment:"NiceEnvironment"},{njs:13,offset:.1,notes:492,bombs:0,obstacles:8,nps:2.71,length:233,characteristic:"Standard",difficulty:"Expert",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:26,resets:0},maxScore:445395,environment:"NiceEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"90Degree",difficulty:"Expert",events:1192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:27,resets:0},maxScore:442635,label:"Expert 90",environment:"GlassDesertEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"360Degree",difficulty:"Expert",events:1166,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:26,resets:0},maxScore:442635,label:"Expert360",environment:"GlassDesertEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.zip",coverURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.jpg",previewURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2020-07-11T22:35:42.033Z",createdAt:"2020-07-11T22:35:42.033Z",updatedAt:"2020-07-11T22:35:42.033Z",lastPublishedAt:"2020-07-11T22:35:42.033Z",tags:["pop","jazz","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"3bbb0",name:"[Modchart] Leslie Wai - Paradigm",description:"MAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\n\nNOTE: If your sabers are in the wrong position after the intro try disabling any room offset/rotation\nNOTE 2: The map is broken on some versions including 1.34 and quest, I am gonna work on report all the issues\nNOTE 3: The map should be playable now on Quest native (just a few visual bugs)\n\nMy biggest project so far!\nenjoy it\n\nMap preview: https://youtu.be/gokZx0QjqZQ\n\nReupload: Thanks for the 429 people that played the map so far! i am reuploading to fix a few bugs:\n- Fix saber positions being wrong for some people\n- Disable left handed option\n- Disable Intro Skip\n\nReupload 2: Thanks for the another 170 plays I hope this is the final reupload:\n- Fix light id errors\n- Fix cinema suggestion not needed\n- Trying another fix for sabers wrong position\n\nReupload 3: And I hope this is the last one, thanks for the 124 new plays!\n- Fix player position bug on quest\n- Fix notes position bug on quest\n- Fix gimmik part on quest\n- Added suggested colors for notes\n- Changed NJS and JD\n- Fix sabers coming from the wrong direction in the intro",uploader:{id:4284535,name:"Elecast",hash:"6069279f5ab13d000609e874",avatar:"https://cdn.beatsaver.com/avatar/4dd111a1ec473c3559cfc73caaac650be56b65a1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284535/playlist"},metadata:{bpm:130,duration:441,songName:"Paradigm",songSubName:"",songAuthorName:"Leslie Wai",levelAuthorName:"Elecast"},stats:{plays:0,downloads:0,upvotes:2734,downvotes:27,score:.9851,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2024-04-13T20:59:13.608905Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"a504aafe70cf723f46503568f65813ef616d030f",state:"Published",createdAt:"2024-04-24T23:51:45.788382Z",sageScore:3,diffs:[{njs:17,offset:-.75,notes:1051,bombs:360,obstacles:249,nps:3.038,length:749.5,characteristic:"Standard",difficulty:"ExpertPlus",events:12016,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:345.923,paritySummary:{errors:0,warns:0,resets:0},maxScore:959675,label:"You can't escape",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.zip",coverURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.jpg",previewURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.mp3"}],curator:{id:4284445,name:"Emilia",hash:"5cff0b7898cc5a672c856ed3",avatar:"https://cdn.beatsaver.com/avatar/4284445.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284445/playlist"},curatedAt:"2024-04-13T23:47:05.160104Z",createdAt:"2024-04-12T23:23:24.101391Z",updatedAt:"2024-08-18T18:18:25.185313Z",lastPublishedAt:"2024-04-24T23:51:50.910171Z",tags:["balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0ba",name:"[Electro Swing Pack] Wolfgang Lohr & Maskarade - Hit The Road Jack",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/0ObNR9n_dDs\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:124,duration:159,songName:"Hit The Road Jack",songSubName:"",songAuthorName:"Wolfgang Lohr & Maskarade",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3787,downvotes:42,score:.9849},uploaded:"2021-07-08T15:26:18.072Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"75f10751d58f6f1ab0bc36e94039a144256adccb",key:"1a0ba",state:"Published",createdAt:"2021-07-08T15:26:18.072Z",sageScore:4,diffs:[{njs:16,offset:-.25,notes:475,bombs:0,obstacles:0,nps:3.089,length:317.75,characteristic:"Standard",difficulty:"Expert",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:429755,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:750,bombs:0,obstacles:0,nps:4.878,length:317.75,characteristic:"Standard",difficulty:"ExpertPlus",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:682755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.zip",coverURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.jpg",previewURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:26:18.072Z",createdAt:"2021-07-08T15:26:18.072Z",updatedAt:"2024-11-02T11:17:50.904586Z",lastPublishedAt:"2021-07-08T15:26:18.072Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b7",name:"[Electro Swing Pack] Jamie Berry - Lost In The Rhythm (ft. Octavia Rose)",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/4O8l7rq4eHI\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:121,duration:187,songName:"Lost In The Rhythm",songSubName:"(ft. Octavia Rose)",songAuthorName:"Jamie Berry",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3307,downvotes:36,score:.9847,reviews:1},uploaded:"2021-07-08T15:24:57.679Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6d006d47880a45a134844f3787f3c184881d4673",key:"1a0b7",state:"Published",createdAt:"2021-07-08T15:24:57.679Z",sageScore:5,diffs:[{njs:16,offset:-.25,notes:591,bombs:0,obstacles:8,nps:3.274,length:364,characteristic:"Standard",difficulty:"Expert",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:536475,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:821,bombs:0,obstacles:8,nps:4.549,length:364,characteristic:"Standard",difficulty:"ExpertPlus",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:748075,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.zip",coverURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.jpg",previewURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:24:57.679Z",createdAt:"2021-07-08T15:24:57.679Z",updatedAt:"2024-11-02T11:17:26.961219Z",lastPublishedAt:"2021-07-08T15:24:57.679Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"77e9",name:"Jingo Jungle [Saga of Tanya the Evil Opening] - AmaLee",description:'AmaLee\'s English cover of "Jingo Jungle", the opening from Saga of Tanya the Evil (Youjo Senki). Original song by MYTH & ROID.',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:130,duration:226,songName:"Jingo Jungle",songSubName:"",songAuthorName:"AmaLee",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4125,downvotes:48,score:.9846,reviews:1},uploaded:"2019-12-21T02:44:34.295Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f90a2e4f8ee7b1f33543cddccb8baea660253d4a",key:"77e9",state:"Published",createdAt:"2019-12-21T02:44:34.295Z",sageScore:5,diffs:[{njs:12,offset:0,notes:581,bombs:104,obstacles:28,nps:2.647,length:475.5,characteristic:"Standard",difficulty:"Hard",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:35,warns:15,resets:10},maxScore:527275,environment:"DefaultEnvironment"},{njs:15,offset:0,notes:950,bombs:78,obstacles:14,nps:4.329,length:475.5,characteristic:"Standard",difficulty:"Expert",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:42,warns:48,resets:8},maxScore:866755,environment:"DefaultEnvironment"},{njs:17,offset:0,notes:1184,bombs:105,obstacles:17,nps:5.395,length:475.5,characteristic:"Standard",difficulty:"ExpertPlus",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:32,warns:43,resets:16},maxScore:1082035,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.zip",coverURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.jpg",previewURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.mp3"}],createdAt:"2019-12-21T02:44:34.295Z",updatedAt:"2019-12-21T02:44:34.295Z",lastPublishedAt:"2019-12-21T02:44:34.295Z",tags:["pop","anime"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"a438",name:"Wait - M83 (wall map)",description:"I wanted to do something special for this great song, and also see the potential of Noodle Extensions. A few tips for a better experience:\r\n- disable the mirror effect in the game settings\r\n- turn the SFX volume down in the player settings\r\n- hide the HUD in the player settings\r\n\r\nVideo: https://youtu.be/oe6ThhijPy0\r\n\r\nThe map has a lot of walls, so you might not be able to run it on the lower-end hardware. I've included a version with less walls in case it helps.",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:148,duration:336,songName:"Wait",songSubName:"",songAuthorName:"M83",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4116,downvotes:48,score:.9845,reviews:9,sentiment:"VERY_POSITIVE"},uploaded:"2020-05-08T23:53:02.030Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0d8921ef06a889cbd9db13afcc43f09a1619b173",key:"a438",state:"Published",createdAt:"2020-05-08T23:53:02.030Z",sageScore:6,diffs:[{njs:8,offset:6,notes:735,bombs:0,obstacles:6684,nps:2.225,length:815,characteristic:"Standard",difficulty:"Easy",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (less lag)",environment:"BigMirrorEnvironment"},{njs:8,offset:6,notes:735,bombs:0,obstacles:10499,nps:2.225,length:815,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (original)",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.zip",coverURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.jpg",previewURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-05-08T23:53:02.030Z",createdAt:"2020-05-08T23:53:02.030Z",updatedAt:"2020-05-08T23:53:02.030Z",lastPublishedAt:"2020-05-08T23:53:02.030Z",tags:["rock","indie","techno"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"12ad1",name:"Minnesota - Colors (ft. Jackie Rain) | Chroma RGB",description:"Chroma 2.0 HIGHLY RECOMMENDED!\n\nHad this map sitting in my project folder for some months and finally got to finish it! \nIt features a Chroma RGB lightshow AND Rainbow notes, for the full COLOR experience :)\n\nPreview: https://www.youtube.com/watch?v=8Omzd7IdJt0",uploader:{id:4284201,name:"nitronik.exe",hash:"5cff0b7798cc5a672c855d84",avatar:"https://cdn.beatsaver.com/avatar/ab054640a94777ed7e92d91a505a85f8c5047be5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284201/playlist"},metadata:{bpm:140,duration:202,songName:"Colors",songSubName:"(ft. Jackie Rain)",songAuthorName:"Minnesota",levelAuthorName:"nitronik.exe"},stats:{plays:0,downloads:0,upvotes:4295,downvotes:51,score:.9844,reviews:7,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-13T15:55:44.846Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"03fcb98091e50600d9d777251d765c53384c2735",key:"12ad1",state:"Published",createdAt:"2021-01-13T15:55:44.846Z",sageScore:4,diffs:[{njs:13,offset:.5,notes:395,bombs:0,obstacles:221,nps:2.057,length:448,characteristic:"Standard",difficulty:"Hard",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:356155,environment:"BigMirrorEnvironment"},{njs:16,offset:0,notes:601,bombs:0,obstacles:113,nps:3.13,length:448,characteristic:"Standard",difficulty:"Expert",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:545675,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:911,bombs:0,obstacles:120,nps:4.745,length:448,characteristic:"Standard",difficulty:"ExpertPlus",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:830875,label:"Colors",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.zip",coverURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.jpg",previewURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2021-01-13T15:55:44.846Z",createdAt:"2021-01-13T15:55:44.846Z",updatedAt:"2021-01-13T15:55:44.846Z",lastPublishedAt:"2021-01-13T15:55:44.846Z",tags:["dubstep","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4a2b3",name:"[Vivify] Turret Orchestra (Cara Mia Addio) - Portal 2",description:"Portal •⩊•\n\nWork done:\nMadChase - Vivify and Standard Mapping\nRateGyro - OneSaber Mapping\nXentha - 3d Modeling \n\nAll Lawless: No Vivify difficulties \n\nThis took FAR too long to make too..... hope you enjoy this product of my sufferings as much as I do :)\n\nGo check out @rategyro, they did the mapping for all the Onesaber diffs and HUGE thanks to @Xentha for making a majority of the env used in this map, this would not have been possible without them. \n\nCredits: https://docs.google.com/document/d/1gR8x4iIk_n2i4ScYRPGEyD8OfZNsrDftmy6Z9cC5L_E/edit?usp=sharing",uploader:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},metadata:{bpm:204,duration:120,songName:"Turret Orchestra",songSubName:"(Cara Mia Addio)",songAuthorName:"Portal 2",levelAuthorName:"MadChase, RateGyro, Xentha\r"},stats:{plays:0,downloads:0,upvotes:758,downvotes:3,score:.9844},uploaded:"2025-09-05T19:09:19.619055Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3a2a0fead6eb8a8ab325aa54efdfb84bd4220375",state:"Published",createdAt:"2025-09-06T02:29:05.366Z",sageScore:4,diffs:[{njs:12,offset:0,notes:107,bombs:0,obstacles:0,nps:1.304,length:279,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:91195,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:149,bombs:0,obstacles:0,nps:1.816,length:279,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:129835,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:714,bombs:0,obstacles:0,nps:8.701,length:279,characteristic:"Standard",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:649635,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:131,bombs:0,obstacles:0,nps:1.591,length:279.937,characteristic:"OneSaber",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:113275,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:612,bombs:0,obstacles:0,nps:7.433,length:279.937,characteristic:"OneSaber",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:555795,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Just Viv",environment:"GagaEnvironment"},{njs:12,offset:0,notes:111,bombs:0,obstacles:473,nps:1.343,length:281,characteristic:"Lawless",difficulty:"Easy",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:94875,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:130,bombs:0,obstacles:473,nps:1.584,length:279,characteristic:"Lawless",difficulty:"Normal",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:112355,label:"One Saber Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:153,bombs:0,obstacles:473,nps:1.851,length:281,characteristic:"Lawless",difficulty:"Hard",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:133515,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:611,bombs:0,obstacles:473,nps:7.446,length:279,characteristic:"Lawless",difficulty:"Expert",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:554875,label:"One Saber Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:734,bombs:0,obstacles:473,nps:8.859,length:281.688,characteristic:"Lawless",difficulty:"ExpertPlus",events:7,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:82.849,paritySummary:{errors:0,warns:0,resets:0},maxScore:668035,label:"Poodles",environment:"GagaEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.zip",coverURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.jpg",previewURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.mp3"}],createdAt:"2025-09-05T18:27:26.937639Z",updatedAt:"2025-09-30T15:48:59.259473Z",lastPublishedAt:"2025-09-06T02:29:10.640787Z",tags:["video-game-soundtrack","balanced","poodle"],bookmarked:!1,collaborators:[{id:103109,name:"Xentha",avatar:"https://cdn.beatsaver.com/avatar/da02df6ec7f6d28e226510b3f8ecb786d24634ca.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/103109/playlist"},{id:4280701,name:"rategyro",hash:"605e50f0cd73ba00060a45e3",avatar:"https://cdn.beatsaver.com/avatar/06d29645455d6652940b240658617d968fc53d91.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4280701/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"14d64",name:"Try - MitiS Feat. RORY",description:"Twenty-Sixth Upload\n\nThis map means the whole world to me, so I hope everyone enjoys this map. My father passed away on Jan. 23, 2021, in the middle of making this map. I am dedicating this map for him because of how much this songs means to me now. \nPouring my heart and soul into this map took a lot out of me, making it as perfect to my little abilities I have for mapping.\n\nBig shout outs to Lonely and Jamman for lighting this beautiful song and for agreeing to light it, it means the world to me.\nBig shout outs to thelightdesigner for making such amazing and beautiful walls. Thank you for taking the time to make this, it means the world to me.\nBig shout outs to Mawntee for giving me advice on how to make this map feel and shout outs to thelitlewiseowl for modding it, showing me what I can improve in this map. \nBiggest shout outs to everyone that play tested it multiple times. I am sorry for bugging them for multiple play test. \n\nAnd Biggest shoutout to my favorite chillstep/melodic dubstep artist, MitiS and Rory for making this beautiful song. \nYou have no idea how much this song means to me, I thank you so much. Keep up the good work MitiS.\n\n**NOODLES AND CHROMA REQUIRED**\n\nI hope this map can show you the feeling in this song, as well as what it portrays. I tried my best, I hope it turns out great and everyone enjoys it. \nThank you everyone for taking the time to download and play this map. I appreciate it everyone.\n\nFeedback is always welcome!",uploader:{id:4285346,name:"remie",hash:"5f6efd989824150006d740ac",avatar:"https://cdn.beatsaver.com/avatar/736cde47222d5d00f4affea115772681d0e070eb.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4285346/playlist"},metadata:{bpm:132,duration:273,songName:"Try",songSubName:"",songAuthorName:"MitiS Feat. RORY",levelAuthorName:"Remie & Lone"},stats:{plays:0,downloads:0,upvotes:7683,downvotes:102,score:.9843,reviews:36,sentiment:"VERY_POSITIVE"},uploaded:"2021-03-01T13:29:26.471Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6db3d9da217b41607d250aa7a28c5dc26a082188",key:"14d64",state:"Published",createdAt:"2021-03-01T13:29:26.471Z",sageScore:3,diffs:[{njs:17,offset:-.7,notes:1447,bombs:21,obstacles:77,nps:6.217,length:512.083,characteristic:"Standard",difficulty:"ExpertPlus",events:36825,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:232.765,paritySummary:{errors:0,warns:0,resets:2},maxScore:1323995,label:"EXPERT+",environment:"OriginsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.zip",coverURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.jpg",previewURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.mp3"}],curator:{id:2381,name:"bearly",hash:"5ea9efbf16c968000636dba4",avatar:"https://cdn.beatsaver.com/avatar/2381.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/2381/playlist"},curatedAt:"2021-03-01T13:29:26.471Z",createdAt:"2021-03-01T13:29:26.471Z",updatedAt:"2021-03-01T13:29:26.471Z",lastPublishedAt:"2021-03-01T13:29:26.471Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"27a13",name:"Jimmy Eat World - The Middle [Arcs][V3 Lights]",description:" - everything'll be alright, alright? \n\nYes, @Bytrius already has a great map of this song in the 2000's Rock Pack (check it out here https://beatsaver.com/maps/157fa) but I thought I'd try it with my own arc map style and provide some lower difficulties as well. \n\nGameplay video by @onespookyboi: https://youtu.be/SjiqMsMkFuU\nLIghtshow: https://streamable.com/zhomzm\n\nThank you testers!\n@maybeemae\n@swukpuff\n@onespookyboi\n@namaki_mono\nFlaemmchenFlame - https://www.twitch.tv/flaemmchenflame\n",uploader:{id:4321171,name:"tetsubeats",avatar:"https://cdn.beatsaver.com/avatar/532b0f3d23e1e795c5e1404c4a807c0dfbe1adf2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4321171/playlist"},metadata:{bpm:162.2,duration:169,songName:"The Middle",songSubName:"",songAuthorName:"Jimmy Eat World",levelAuthorName:"TetsuBeats"},stats:{plays:0,downloads:0,upvotes:3397,downvotes:39,score:.9842,reviews:1},uploaded:"2022-07-10T05:30:32.964512Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"4b980371b6005cc176aed1b402bd104af56c31a3",state:"Published",createdAt:"2022-07-10T04:29:32.041843Z",sageScore:5,diffs:[{njs:10,offset:-1.1,notes:320,bombs:0,obstacles:0,nps:1.951,length:443.5,characteristic:"Standard",difficulty:"Easy",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:287155,environment:"PyroEnvironment"},{njs:12,offset:-1.5,notes:528,bombs:0,obstacles:0,nps:3.218,length:443.5,characteristic:"Standard",difficulty:"Normal",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:478515,environment:"PyroEnvironment"},{njs:14,offset:.1,notes:629,bombs:0,obstacles:0,nps:3.834,length:443.5,characteristic:"Standard",difficulty:"Hard",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:571435,environment:"PyroEnvironment"},{njs:16.5,offset:-.1,notes:758,bombs:0,obstacles:0,nps:4.62,length:443.5,characteristic:"Standard",difficulty:"Expert",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:690115,environment:"PyroEnvironment"},{njs:17.5,offset:-.3,notes:826,bombs:0,obstacles:0,nps:5.035,length:443.5,characteristic:"Standard",difficulty:"ExpertPlus",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:752675,environment:"PyroEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.zip",coverURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.jpg",previewURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-07-10T05:52:53.577094Z",createdAt:"2022-07-10T04:29:32.041843Z",updatedAt:"2022-07-10T14:14:52.319313Z",lastPublishedAt:"2022-07-10T05:30:32.964512Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"271dc",name:"[Electro Swing Pack Vol. 2] Swingrowers - Butterfly (Wolfgang Lohr Remix)",description:"Electro Swing Pack Volume 2: Electric Boogaloo!\n\nFor the anniversary of my first pack, I am making a sequel.\n10 Electro Swing songs, 3 difficulties each + custom vanilla lights!\n\nGet the pack here:\nhttps://bsaber.com/electro-swing-pack-2/\nhttps://beatsaver.com/playlists/6572\n\nPreview this map:\nhttps://youtu.be/91zWh1dLLV4\n\nPack Preview Playlist:\nhttps://youtube.com/playlist?list=PLrVm0whzsGKL5NYTUIEzDyITjl6WuLSJ4\n\n\nThank you to all the Playtesters!\nAlice, MaybeeMae, Pixelguy, Raaknys, Namaki Mono, DeeDee, and WolfieBeat ❤️\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:126,duration:189,songName:"Butterfly",songSubName:"(Wolfgang Lohr Remix)",songAuthorName:"Swingrowers",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:1900,downvotes:18,score:.9842},uploaded:"2022-07-08T13:00:00.564Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7",state:"Published",createdAt:"2022-06-25T18:10:24.485756Z",sageScore:5,diffs:[{njs:14,offset:0,notes:522,bombs:0,obstacles:9,nps:2.818,length:389,characteristic:"Standard",difficulty:"Hard",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:16,offset:-.5,notes:752,bombs:0,obstacles:9,nps:4.06,length:389,characteristic:"Standard",difficulty:"Expert",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:684595,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:903,bombs:0,obstacles:9,nps:4.875,length:389,characteristic:"Standard",difficulty:"ExpertPlus",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:823515,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.zip",coverURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.jpg",previewURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.mp3"}],curator:{id:4284746,name:"Dee-Dee",avatar:"https://cdn.beatsaver.com/avatar/3853d99b74fe4eb9a3954df5946123f67a95da3d.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284746/playlist"},curatedAt:"2022-07-09T12:03:07.374428Z",createdAt:"2022-06-25T18:10:24.485756Z",updatedAt:"2024-11-09T20:31:57.830788Z",lastPublishedAt:"2022-07-08T13:00:00.559037Z",tags:["balanced","electronic","swing","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"39624",name:"[Chroma] DNCE - Cake By The Ocean",description:"[Explicit Lyrics]\n[Flashing Lights Warning]\n\nMy first full spread map!\n\nJan 28th 2024: Reupload with fixed lighting\n-----------------------------------------------------\nSong: Cake By The Ocean by DNCE\nhttps://www.youtube.com/watch?v=vWaRiD5ym74\n\nMap Preview (Expert+):\nhttps://www.youtube.com/watch?v=UZyrFB9vKDo\n-----------------------------------------------------\nThank you to @Noveliniel for playtesting this map.\n-----------------------------------------------------\nMessage wunkoo on Discord for any feedback (must be in the BeastSaber discord).\nOr just leave a BeatSaver review",uploader:{id:4302396,name:"Koreami",avatar:"https://cdn.beatsaver.com/avatar/f5542fc9f09f21504d7e82a61b06d494389ba3d3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4302396/playlist"},metadata:{bpm:119,duration:221,songName:"Cake By The Ocean",songSubName:"",songAuthorName:"DNCE",levelAuthorName:"Koreami"},stats:{plays:0,downloads:0,upvotes:2819,downvotes:31,score:.9841,reviews:3},uploaded:"2024-01-27T19:00:00.269841Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2cb2f496ef6e33a09a56d301923ade73b9a53c3d",state:"Published",createdAt:"2024-01-28T18:55:36.350370Z",sageScore:5,diffs:[{njs:12,offset:-.1,notes:431,bombs:6,obstacles:37,nps:2.021,length:423,characteristic:"Standard",difficulty:"Easy",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:389275,label:"Puddle",environment:"DragonsEnvironment"},{njs:12,offset:-.2,notes:554,bombs:0,obstacles:21,nps:2.598,length:423,characteristic:"Standard",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:502515,label:"Pond",environment:"DragonsEnvironment"},{njs:13,offset:-.25,notes:677,bombs:0,obstacles:31,nps:3.174,length:423,characteristic:"Standard",difficulty:"Hard",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:615595,label:"Lake",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:800,bombs:0,obstacles:33,nps:3.751,length:423,characteristic:"Standard",difficulty:"Expert",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:728755,label:"Sea",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:971,bombs:4,obstacles:41,nps:4.553,length:423,characteristic:"Standard",difficulty:"ExpertPlus",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:886075,label:"Ocean",environment:"DragonsEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Fluorescent Coral",environment:"DragonsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.zip",coverURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.jpg",previewURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.mp3"}],curator:{id:169636,name:"Duffelsalat",avatar:"https://cdn.beatsaver.com/avatar/42f17c520f53b67cf400a66f65e49038263042de.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/169636/playlist"},curatedAt:"2024-01-28T15:09:46.809093Z",createdAt:"2024-01-27T18:49:42.362618Z",updatedAt:"2025-05-27T05:59:37.010902Z",lastPublishedAt:"2024-01-28T18:55:43.801969Z",tags:["accuracy","balanced","pop","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"9a0c",name:"Thnks fr th Mmrs - Fall Out Boy",description:"Thnks fr th Mmrs (or Thanks for the Memories) from Fall Out Boy.\nSo far the map that I have put the most work into (and which probably made me age by 3 years). Hope you enjoy it!\n\nThe map has Chroma lighting but can also be played without the Chroma mod.\nExpert+ contains single saber sections and polyrhythm parts. Just so you are warned ;)\n\nBig thanks to Sorukun for playtesting this map and especially to Timeweaver for pointing out all issues it had during its creation!",uploader:{id:21367,name:"hamsta",hash:"5de27451fffaa600066f2842",avatar:"https://www.gravatar.com/avatar/36e8d99105e1e9c1d2173853194691e2b2d5c0552b6e96bfd7a2fd8108310685?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/21367/playlist"},metadata:{bpm:154.791,duration:198,songName:"Thnks fr th Mmrs",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Hamsta"},stats:{plays:0,downloads:0,upvotes:10577,downvotes:148,score:.984,reviews:2},uploaded:"2020-04-12T09:50:46.516Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0e8ef3006db854c67f04fe72322bccea410f69ee",key:"9a0c",state:"Published",createdAt:"2020-04-12T09:50:46.516Z",sageScore:5,diffs:[{njs:14,offset:0,notes:580,bombs:0,obstacles:51,nps:3.092,length:484,characteristic:"Standard",difficulty:"Hard",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:526355,environment:"PanicEnvironment"},{njs:14,offset:0,notes:637,bombs:0,obstacles:51,nps:3.395,length:484,characteristic:"Standard",difficulty:"Expert",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:578795,environment:"PanicEnvironment"},{njs:16,offset:0,notes:844,bombs:0,obstacles:39,nps:4.499,length:484,characteristic:"Standard",difficulty:"ExpertPlus",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:1,warns:2,resets:0},maxScore:769235,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.zip",coverURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.jpg",previewURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2020-04-12T09:50:46.516Z",createdAt:"2020-04-12T09:50:46.516Z",updatedAt:"2020-04-12T09:50:46.516Z",lastPublishedAt:"2020-04-12T09:50:46.516Z",tags:["pop","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"11b7a",name:"Still Alive - Portal",description:"I've wanted to map this song for a while now. And since this one's probably the last Portal song I'll map, I gave it my best. \r\n\r\nP.S. - I'm so glad to be back mapping this month. I had to take a break due to overwhelming stress, but now I'm feeling ready again.\r\nI hope you enjoy.\r\n\r\nPortal on Steam:\r\nhttps://store.steampowered.com/app/400/Portal/",uploader:{id:4284694,name:"Jokidum",hash:"5e15518d47f1600006e912cc",avatar:"https://cdn.beatsaver.com/avatar/da6133c71c7c84b75622f59dd2fce215f8c444f3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284694/playlist"},metadata:{bpm:120,duration:176,songName:"Still Alive",songSubName:"- Portal",songAuthorName:"Jonathan Coulton",levelAuthorName:"Jokidum"},stats:{plays:0,downloads:0,upvotes:6908,downvotes:92,score:.984,reviews:2},uploaded:"2020-12-04T20:30:44.132Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8c03b43484b0dd1fc7d8a3104a82f0992a001c6c",key:"11b7a",state:"Published",createdAt:"2020-12-04T20:30:44.132Z",sageScore:4,diffs:[{njs:12,offset:0,notes:490,bombs:0,obstacles:13,nps:2.853,length:343.5,characteristic:"Standard",difficulty:"Expert",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:171.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:443555,environment:"TriangleEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Easy",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.zip",coverURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.jpg",previewURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.mp3"}],createdAt:"2020-12-04T20:30:44.132Z",updatedAt:"2020-12-04T20:30:44.132Z",lastPublishedAt:"2020-12-04T20:30:44.132Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"24227",name:"DADDY! DADDY! DO! (TV Size) (2022 Remaster) [Kaguya-sama: Love Is War Season 2 Opening] - Masayuki Suzuki ft. Airi Suzuki ",description:"Just a small remaster of my old daddy daddy do map from 2020, fixed a few parity errors and updated the NJS. There's also 2 additional down maps now. \n\nThanks to https://twitter.com/WicKedBassline for the special request!\n\nDADDY! DADDY! DO! is opening theme for the second season of the Kaguya-sama: Love Is War anime adaptation.\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper's profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:138,duration:91,songName:"DADDY! DADDY! DO! (TV Size) (2022 Remaster)",songSubName:"ft. Airi Suzuki",songAuthorName:"Masayuki Suzuki",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:3282,downvotes:38,score:.984,reviews:1},uploaded:"2022-04-09T06:56:40.572610Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17",state:"Published",createdAt:"2022-04-09T06:56:26.910837Z",sageScore:4,diffs:[{njs:12,offset:0,notes:205,bombs:4,obstacles:23,nps:2.352,length:200.5,characteristic:"Standard",difficulty:"Hard",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:181355,environment:"PanicEnvironment"},{njs:15,offset:-.3,notes:306,bombs:4,obstacles:23,nps:3.51,length:200.5,characteristic:"Standard",difficulty:"Expert",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:274275,environment:"PanicEnvironment"},{njs:18,offset:-.6,notes:381,bombs:0,obstacles:23,nps:4.371,length:200.5,characteristic:"Standard",difficulty:"ExpertPlus",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:343275,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.zip",coverURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.jpg",previewURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-04-11T06:44:59.068414Z",createdAt:"2022-04-09T06:56:26.910837Z",updatedAt:"2022-04-11T06:44:59.068414Z",lastPublishedAt:"2022-04-09T06:56:40.572610Z",tags:["dance-style","anime","j-pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"291b9",name:"BLOODY STREAM (TV Size) (2022 Remaster) [JoJo's Bizarre Adventure 2nd Opening] - Coda",description:'---------Map uses the new 1.20 Note mechanics (eg: arc and chains) and won\'t work on any versions of Beat Saber below 1.20---------\n\nThanks to https://twitter.com/EuclaseW for the special request!\n\nThis map is a remap of my old Bloody Stream map. Changes include:\n- Parity fixes\n- Additional difficulties\n- Custom colors!\n- Addition of Arcs and Chains!\n\n"BLOODY STREAM" is the second opening of the JoJo\'s Bizarre Adventure by Japanese musician Kazuso Oda under the stage name "Coda".\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper\'s profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:132,duration:93,songName:"BLOODY STREAM (TV Size) (2022 Remaster)",songSubName:"",songAuthorName:"Coda",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4309,downvotes:54,score:.9838},uploaded:"2022-08-21T14:25:59.776857Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2c6a5186b7e3f4a3b453065ee8ad042d72947102",state:"Published",createdAt:"2022-08-21T14:25:52.329353Z",sageScore:2,diffs:[{njs:12,offset:0,notes:326,bombs:29,obstacles:16,nps:3.659,length:196,characteristic:"Standard",difficulty:"Hard",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:292915,environment:"BigMirrorEnvironment"},{njs:15,offset:-.3,notes:446,bombs:18,obstacles:13,nps:5.006,length:196,characteristic:"Standard",difficulty:"Expert",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:403315,environment:"BigMirrorEnvironment"},{njs:18,offset:-.6,notes:561,bombs:22,obstacles:15,nps:6.297,length:196,characteristic:"Standard",difficulty:"ExpertPlus",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:510715,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.zip",coverURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.jpg",previewURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-09-09T02:00:15.130726Z",createdAt:"2022-08-21T14:25:52.329353Z",updatedAt:"2022-09-09T02:00:15.130726Z",lastPublishedAt:"2022-08-21T14:25:59.776857Z",tags:["dance-style","anime","j-pop","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2ab5b",name:"Handclap - fitz and the tantrums",description:"twitch : https://www.twitch.tv/emiru_milk\ntwitter : https://twitter.com/EmirTart\ndiscord : https://discord.gg/DHwuND8K7K\nEmiru#9999",uploader:{id:4284894,name:"emiru",hash:"5d3dac6586729100069260cc",avatar:"https://cdn.beatsaver.com/avatar/59d2538aa7b938cbd28629073dc6d9be2357bee9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284894/playlist"},metadata:{bpm:139.867,duration:196,songName:"Handclap",songSubName:"",songAuthorName:"Fitz and the Tantrums",levelAuthorName:"Emir"},stats:{plays:0,downloads:0,upvotes:5631,downvotes:75,score:.9836,reviews:3},uploaded:"2022-10-08T08:58:23.778044Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3da135c11207f5f4f2dfe7b18a6416931f66936e",state:"Published",createdAt:"2022-10-08T09:11:55.226599Z",sageScore:3,diffs:[{njs:16,offset:0,notes:196,bombs:0,obstacles:58,nps:1.078,length:423.891,characteristic:"Standard",difficulty:"Easy",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.841,paritySummary:{errors:0,warns:0,resets:0},maxScore:173075,environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:302,bombs:0,obstacles:66,nps:1.655,length:425.39,characteristic:"Standard",difficulty:"Normal",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:270595,environment:"FitBeatEnvironment"},{njs:14,offset:-.168,notes:546,bombs:0,obstacles:184,nps:2.992,length:425.39,characteristic:"Standard",difficulty:"Hard",events:5221,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:495075,environment:"FitBeatEnvironment"},{njs:15,offset:-.368,notes:739,bombs:0,obstacles:130,nps:3.894,length:442.374,characteristic:"Standard",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:0,resets:0},maxScore:672635,environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:925,bombs:8,obstacles:315,nps:5.057,length:426.389,characteristic:"Standard",difficulty:"ExpertPlus",events:4390,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:182.912,paritySummary:{errors:0,warns:0,resets:8},maxScore:843755,environment:"FitBeatEnvironment"},{njs:12,offset:.526,notes:350,bombs:0,obstacles:34,nps:1.844,length:442.374,characteristic:"Lawless",difficulty:"Easy",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:43,warns:22,resets:0},maxScore:314755,label:"Lawless Tutorial",environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:657,bombs:0,obstacles:2,nps:3.462,length:442.374,characteristic:"Lawless",difficulty:"Normal",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:623,warns:0,resets:0},maxScore:597195,label:"Down Notes",environment:"FitBeatEnvironment"},{njs:14,offset:-.002,notes:670,bombs:0,obstacles:2,nps:3.531,length:442.374,characteristic:"Lawless",difficulty:"Hard",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:635,warns:16,resets:0},maxScore:609155,label:"Up Notes",environment:"FitBeatEnvironment"},{njs:15,offset:-.29,notes:1050,bombs:0,obstacles:2,nps:5.533,length:442.374,characteristic:"Lawless",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:78,resets:0},maxScore:958755,label:"90°Directions",environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:1260,bombs:0,obstacles:246,nps:6.625,length:443.373,characteristic:"Lawless",difficulty:"ExpertPlus",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:190.198,paritySummary:{errors:0,warns:6,resets:0},maxScore:1151955,label:"Dodge Walls",environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.zip",coverURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.jpg",previewURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.mp3"}],curator:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},curatedAt:"2022-10-08T09:19:15.538197Z",createdAt:"2022-10-08T08:57:08.316867Z",updatedAt:"2022-10-08T09:19:15.538197Z",lastPublishedAt:"2022-10-08T09:12:01.774147Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"212cf",name:"Someone Else's Hat - David Maxim Micic (modchart)",description:"David Maxim Micic is a prog rock genius. I wish I had the courage to map the 8 minutes of Mbinguni Amina but a few minutes of Someone Else's Hat will have to do. I really encourage you to check his stuff, because it's so good: https://open.spotify.com/artist/0wQa1N4q3HmLwxqkpVcYhs?si=aB4m1yonTg2qk5ounpOEUw\n\nThis modchart was an opportunity for me to have fun with environment animations, and push animations to a new level. The first scene is based on the album cover that Yelka made for Who Bit the Moon, and the rest is random ideas that I thought would be cool with this music.\n\nHuge thanks to the playtesters and in particular Mawntee and Aggrogahu, who took time to give detailed feedback. I appreciate.\n\nPreview: https://youtu.be/RX-payaVsKU\n\nThe map should work on Quest too, though it won't look as good due to the difference in how walls look.\n\nIf you like what I create, tell me, I love to hear from you:\n- YouTube: https://youtube.com/c/nyri0\n- Twitter: https://twitter.com/nyri0z\n- Ko-Fi: https://ko-fi.com/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:130,duration:207,songName:"Someone Else's Hat",songSubName:"",songAuthorName:"David Maxim Micic",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:3304,downvotes:40,score:.9835,reviews:3},uploaded:"2022-02-04T23:50:20.027446Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3662e733501d7a77850c20f0fcea792ed2187943",state:"Published",createdAt:"2022-02-04T23:05:01.786046Z",sageScore:1,diffs:[{njs:16,offset:0,notes:465,bombs:12,obstacles:1460,nps:2.38,length:423.333,characteristic:"Standard",difficulty:"Expert",events:875,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:195.385,paritySummary:{errors:83,warns:0,resets:0},maxScore:420555,label:"haut-de-forme",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.zip",coverURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.jpg",previewURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-02-04T23:50:20.027446Z",createdAt:"2022-02-04T23:05:01.786046Z",updatedAt:"2022-02-04T23:52:36.995020Z",lastPublishedAt:"2022-02-04T23:50:20.027446Z",tags:["balanced","rock"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2c785",name:"[Arc/Chain] Let's Groove - Earth, Wind & Fire",description:"I've been wanting to do a lower tempo dance map for a while and I knew this would be the perfect song. \n\nThanks to @dolledupchaos for playtesting!",uploader:{id:4232648,name:"ramenator05",hash:"60ecf439686b9f0006a67a41",avatar:"https://cdn.beatsaver.com/avatar/4232648.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4232648/playlist"},metadata:{bpm:124,duration:236,songName:"[Arc/Chain] Let's Groove - Earth Wind & Fire",songSubName:"",songAuthorName:"Earth Wind & Fire",levelAuthorName:"ramenator05"},stats:{plays:0,downloads:0,upvotes:3479,downvotes:43,score:.9834,reviews:3},uploaded:"2022-11-28T23:00:29.688269Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf86263deda5f2e09867f3ddad625dfc269709be",state:"Published",createdAt:"2022-11-28T22:59:23.889170Z",sageScore:2,diffs:[{njs:15,offset:.2,notes:550,bombs:0,obstacles:0,nps:2.39,length:480,characteristic:"Standard",difficulty:"Hard",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:500755,environment:"LizzoEnvironment"},{njs:17,offset:-.2,notes:708,bombs:0,obstacles:0,nps:3.076,length:480,characteristic:"Standard",difficulty:"Expert",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:646195,environment:"LizzoEnvironment"},{njs:19,offset:.5,notes:715,bombs:0,obstacles:0,nps:3.107,length:480,characteristic:"Standard",difficulty:"ExpertPlus",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:652635,environment:"LizzoEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.zip",coverURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2022-11-29T21:39:24.794532Z",createdAt:"2022-11-28T22:59:23.889170Z",updatedAt:"2022-11-29T21:39:24.794532Z",lastPublishedAt:"2022-11-28T23:00:29.688269Z",tags:["dance-style","soul","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"21bf8",name:"Marina and the Diamonds - Are You Satisfied?",description:"Thanks, Cryston!\n\nSocials: \nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:124,duration:200,songName:"Are You Satisfied?",songSubName:"",songAuthorName:"Marina and the Diamonds",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:604,downvotes:2,score:.9832,reviews:1},uploaded:"2022-02-15T21:07:43.593089Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7fe7f6e0f0f1687b6821891b42f3ae080d6e1270",state:"Published",createdAt:"2022-02-15T20:59:06.806428Z",sageScore:4,diffs:[{njs:15,offset:-.55,notes:459,bombs:4,obstacles:124,nps:2.585,length:367,characteristic:"Standard",difficulty:"Hard",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:177.581,paritySummary:{errors:0,warns:0,resets:2},maxScore:415035,environment:"DefaultEnvironment"},{njs:17,offset:-.725,notes:679,bombs:16,obstacles:122,nps:3.508,length:400,characteristic:"Standard",difficulty:"Expert",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:617435,environment:"DefaultEnvironment"},{njs:19,offset:.125,notes:944,bombs:24,obstacles:122,nps:4.877,length:400,characteristic:"Standard",difficulty:"ExpertPlus",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:861235,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.zip",coverURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.jpg",previewURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-02-15T21:07:43.593089Z",createdAt:"2022-02-15T20:59:06.806428Z",updatedAt:"2024-08-27T09:23:17.201003Z",lastPublishedAt:"2022-02-15T21:07:43.593089Z",tags:["dance-style","pop","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b514",name:"[[Wall Show + Chroma]] GAS GAS GAS | Manuel",description:"This wall map is a bit more intense than my others, you will need a very hefty pc to run and record this. Have Fun!\n\nHere's a playthrough: https://www.youtube.com/watch?v=hlS6r-Usnro\nHere's a playthrough by Nico (HQ Version): https://youtu.be/F_3qRxDdQc0\n\nREQUIREMENTS: \n -Noodle Extensions\n -Chroma/ChromaLite\n(fixed formatting + removed stupid metadata ;)",uploader:{id:73008,name:"thelightdesigner",hash:"5cff0b7798cc5a672c85627a",avatar:"https://cdn.beatsaver.com/avatar/fa1a30d2b4146dd93cb42537759669dcf961cf29.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/73008/playlist"},metadata:{bpm:154,duration:108,songName:"GAS GAS GAS",songSubName:"(Short Ver.)",songAuthorName:"Manuel",levelAuthorName:"KyleT"},stats:{plays:0,downloads:0,upvotes:9158,downvotes:134,score:.9832,reviews:4},uploaded:"2020-06-22T20:02:06.271Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"95e11f39b2898a38e3b5e61d2156ef5f5835f40f",key:"b514",state:"Published",createdAt:"2020-06-22T20:02:06.271Z",sageScore:3,diffs:[{njs:16.5,offset:0,notes:390,bombs:13,obstacles:13898,nps:3.832,length:261.25,characteristic:"Standard",difficulty:"Expert",events:1462,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:101.786,paritySummary:{errors:0,warns:0,resets:2},maxScore:351555,label:"GAS GAS GAS!!!!!",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.zip",coverURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.jpg",previewURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2020-06-22T20:02:06.271Z",createdAt:"2020-06-22T20:02:06.271Z",updatedAt:"2020-06-22T20:02:06.271Z",lastPublishedAt:"2020-06-22T20:02:06.271Z",tags:["anime","electronic","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1}]},function(e,t,n){if(AFRAME.registerComponent("song-info-positioner",{schema:{victory:{default:!1}},update:function(){this.data.victory?this.el.object3D.position.y=-1.2:this.el.object3D.position.y=-1}}),window.AFRAME){const t=["song-info-positioner"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);if(AFRAME.registerComponent("song-preview-system",{schema:{selectedChallengeId:{type:"string"},selectedChallengeVersion:{type:"string"}},init:function(){this.audio=document.createElement("audio"),this.audio.volume=.5},update:function(e){const t=this.data;console.log("update-song",e,t),t.selectedChallengeId&&e.selectedChallengeId!==t.selectedChallengeId?(this.audio.pause(),this.audio.setAttribute("src","https://cdn.beatsaver.com/"+t.selectedChallengeVersion+".mp3"),this.audio.currentTime=0,this.audio.play()):t.selectedChallengeId||this.audio.pause()}}),window.AFRAME){const t=["song-preview-system"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("song-progress-info",{dependencies:["geometry","material"],schema:{enabled:{default:!1}},init:function(){this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.progress=this.el.getObject3D("mesh"),this.progress.geometry.translate(.285,0,0),this.el.sceneEl.addEventListener("cleargame",()=>{this.progress.scale.x=1e-4})},update:function(e){this.progress.scale.x=1e-4},updateInfo:function(){const e=this.el.sceneEl.components.song.source;if(!e||!e.buffer)return;const t=this.el.sceneEl.components.song.getCurrentTime()/e.buffer.duration;t&&(this.progress.scale.x=t)},tick:function(){this.data.enabled&&this.updateInfo()}}),window.AFRAME){const t=["song-progress-info"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);const r={once:!0};let i=AFRAME.utils.getUrlParameter("skip");if(i=i?parseInt(i)/1e3:0,AFRAME.registerComponent("song",{schema:{audio:{type:"string"},analyserEl:{type:"selector",default:"#audioAnalyser"},challengeId:{default:""},isBeatsPreloaded:{default:!1},isGameOver:{default:!1},isLoading:{default:!1},isPlaying:{default:!1},isVictory:{default:!1}},init:function(){this.analyserSetter={buffer:!0},this.audioAnalyser=this.data.analyserEl.components.audioanalyser,this.context=this.audioAnalyser.context,this.isAudioPlaying=!1,this.songStartTime=0,this.onSongComplete=this.onSongComplete.bind(this),this.audioAnalyser.gainNode.gain.value=.5,this.el.addEventListener("gamemenurestart",this.onRestart.bind(this)),this.el.addEventListener("wallhitstart",this.onWallHitStart.bind(this)),this.el.addEventListener("wallhitend",this.onWallHitEnd.bind(this))},update:function(e){const t=this.data;if(!e.isLoading&&t.isLoading&&t.audio)this.processAudio();else if(!e.audio&&t.audio&&t.isLoading)this.processAudio();else if(e.isGameOver||!t.isGameOver){if(e.isGameOver&&!t.isGameOver&&(this.audioAnalyser.gainNode.value=.5),!e.isVictory&&t.isVictory)return this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.audioAnalyser.resumeContext();const t=this.audioAnalyser.gainNode.gain;t.cancelScheduledValues(0),t.setValueAtTime(.05,0),this.source=e.detail,this.source.start(),this.el.emit("victory")},r),void this.audioAnalyser.refreshSource();!e.isBeatsPreloaded&&this.data.isBeatsPreloaded&&this.source&&this.startAudio(),!e.challengeId||t.challengeId?(e.isPlaying&&!t.isPlaying&&(this.audioAnalyser.suspendContext(),this.isAudioPlaying=!1),!e.isPlaying&&t.isPlaying&&this.source&&(this.audioAnalyser.resumeContext(),this.isAudioPlaying=!0)):this.stopAudio()}else this.onGameOver()},processAudio:function(){this.el.sceneEl.emit("songprocessstart",null,!1),this.getAudio().then(e=>{this.el.sceneEl.emit("songprocessfinish",null,!1)}).catch(console.error)},getAudio:function(){const e=this.data;return this.source&&this.stopAudio(),this.isAudioPlaying=!1,new Promise(t=>{e.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,t(this.source)},r),this.analyserSetter.src=this.data.audio,e.analyserEl.setAttribute("audioanalyser",this.analyserSetter)})},stopAudio:function(){this.source?(this.source.onended=null,this.isAudioPlaying&&this.source.stop(),this.source.disconnect(),this.source=null,this.isAudioPlaying=!1):console.warn("[song] Tried to stopAudio, but not playing.")},onSongComplete:function(){this.data.isPlaying&&this.el.emit("songcomplete")},onGameOver:function(){this.isAudioPlaying=!1;const e=this.source.playbackRate;e.setValueAtTime(e.value,this.context.currentTime),e.linearRampToValueAtTime(0,this.context.currentTime+3.5);const t=this.audioAnalyser.gainNode.gain;t.setValueAtTime(t.value,this.context.currentTime),t.linearRampToValueAtTime(0,this.context.currentTime+3.5),setTimeout(()=>{this.data.isGameOver&&this.stopAudio()},3500)},onRestart:function(){this.isAudioPlaying=!1,this.source&&this.source.disconnect();this.audioAnalyser.gainNode.gain.cancelScheduledValues(0),this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,this.el.sceneEl.emit("songloadfinish",null,!1)},r),this.audioAnalyser.refreshSource()},onWallHitStart:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.1,this.context.currentTime+.1)},onWallHitEnd:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.5,this.context.currentTime+.1)},startAudio:function(){this.audioAnalyser.gainNode.gain.setValueAtTime(.5,this.context.currentTime),this.songStartTime=this.context.currentTime,this.source.onended=this.onSongComplete,this.source.start(0,i||0),this.isAudioPlaying=!0},getCurrentTime:function(){return this.context.currentTime-this.songStartTime}}),window.AFRAME){const t=["song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);const o=[{name:"bgcolor",property:"backglow.color"},{name:"leftglow",property:"leftsideglow.color"},{name:"rightglow",property:"rightsideglow.color"}],a=[{id:"off",dur:500,to:"off"},{id:"primary",dur:5,to:"primary"},{id:"primarybright",dur:500,from:"tertiary",to:"primarybright"},{id:"secondary",dur:5,to:"secondary"},{id:"secondarybright",dur:500,from:"tertiary",to:"secondarybright"}],s=["off","secondary","secondary","secondarybright","","primary","primary","primarybright","primarybright"];AFRAME.registerComponent("stage-colors",{schema:{colorScheme:{default:"default"}},init:function(){this.el.addEventListener("cleargame",this.resetColors.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.resetColors.bind(this)),function(e,t){for(let n=0;n<o.length;n++){const r=o[n];for(let n=0;n<a.length;n++){const o=a[n];e.setAttribute(`animation__${r.name}${o.id}`,{property:"systems.materials."+r.property,type:"color",isRawProperty:!0,easing:"linear",dur:o.dur,from:o.from?i.a.schemes[t][o.from]:"",startEvents:`${r.name}${o.id}`,to:i.a.schemes[t][o.to]})}}}(this.el.sceneEl,this.data.colorScheme)},update:function(e){e.colorScheme&&this.data.colorScheme!==e.colorScheme&&function(e,t){for(let n=0;n<o.length;n++){const r=o[n];for(let n=0;n<a.length;n++){const o=a[n],s=`animation__${r.name}${o.id}`;o.from&&e.setAttribute(s,"from",i.a.schemes[t][o.from]),e.setAttribute(s,"to",i.a.schemes[t][o.to])}}}(this.el.sceneEl,this.data.colorScheme)},play:function(){this.el.emit("bgcolorsecondary",null,!1)},setColor:function(e,t){s[t]||(t=5),e.startsWith("curve")?this.el.emit(e+"stageeventcolor",s[t].replace("bright",""),!1):this.el.emit(`${e}color${s[t]}`,null,!1)},setColorInstant:function(e,t){const n=this.el.sceneEl.systems.materials;if("stars"===e){let e;return e=0===t?i.a.schemes[this.data.colorScheme].secondarybright:i.a.schemes[this.data.colorScheme].secondary,void l(n.stars,"color",e)}const r=i.a.schemes[this.data.colorScheme][s[t]];"moon"===e&&l(n.moon,"tint",r)},resetColors:function(){this.el.emit("bgcolorsecondary",null,!1),this.el.emit("curveevenstageeventcolor","off",!1),this.el.emit("curveoddstageeventcolor","off",!1)}});const c=new THREE.Color;function l(e,t,n){c.set(n),e.uniforms?(e.uniforms[t].value.x=c.r,e.uniforms[t].value.y=c.g,e.uniforms[t].value.z=c.b):e[t].set(n)}if(window.AFRAME){const t=["stage-colors"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stage-lasers",{schema:{enabled:{default:!0}},init:function(){this.speed=0,this.lasers=[this.el.children[0].object3D,this.el.children[1].object3D,this.el.children[2].object3D]},pulse:function(e){this.speed=e/8},tick:function(e,t){0!==this.speed&&(t/=1e3,!this.data.enabled&&(this.speed*=.97,Math.abs(this.speed)<.01)?this.speed=0:(this.lasers[0].rotation.z+=this.speed*t,this.lasers[1].rotation.z-=this.speed*t*1.01,this.lasers[2].rotation.z+=this.speed*t*1.02))}}),window.AFRAME){const t=["stage-lasers"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerComponent("stars",{schema:{color:{type:"color",default:r.initial.secondary},count:{default:500},radius:{default:300}},init:function(){const e=()=>(Math.random()-.5)*this.data.radius*2,t=new THREE.BufferGeometry;this.material=this.el.sceneEl.systems.materials.stars;const n=[];for(let t=0;t<this.data.count;t++)n.push(e(),e(),4*e());t.setAttribute("position",new THREE.Float32BufferAttribute(n,3)),t.computeBoundingSphere();const r=new THREE.Points(t,this.material);this.el.setObject3D("stars",r)},update:function(){this.material.color.setStyle(this.data.color)}}),window.AFRAME){const t=["stars"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stats-param",{init:function(){"true"===AFRAME.utils.getUrlParameter("stats")&&this.el.setAttribute("stats","")}}),window.AFRAME){const t=["stats-param"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stepback",{init:function(){this.message=document.getElementById("stepback"),this.camera=document.getElementById("camera"),this.lastTime=0,this.limit=-.9,this.throttling=300},tick:function(e,t){if(!(e-this.lastTime<this.throttling)){var n=this.camera.object3D.position,r=this.message.object3D.position;n.z<this.limit?(this.throttling=10,this.message.object3D.visible=!0,this.message.getObject3D("mesh").material.opacity=1-Math.abs(n.z-r.z),r.x=n.x,r.y=n.y):(this.message.object3D.visible=!1,this.throttling=500),this.lastTime=e}}}),window.AFRAME){const t=["stepback"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("sub-object",{schema:{from:{type:"selector"},name:{type:"string"}},init:function(){var e=this.el,t=this.data;t.from.addEventListener("model-loaded",n=>{const r=n.detail.model.getObjectByName(t.name);e.setObject3D("mesh",r.clone()),e.setAttribute("material","shader","flat"),e.emit("subobjectloaded",null,!1)})}}),window.AFRAME){const t=["sub-object"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={superkeyboard:{wrapCount:30,inputOffsetY:.008,inputOffsetX:.08,img:"keyboard.png",hoverImg:"keyboard-hover.png",layout:[{key:"1",x:.013,y:.03,w:.093,h:.176},{key:"2",x:.106,y:.03,w:.088,h:.176},{key:"3",x:.194,y:.03,w:.077,h:.176},{key:"4",x:.271,y:.03,w:.085,h:.176},{key:"5",x:.356,y:.03,w:.081,h:.176},{key:"6",x:.437,y:.03,w:.081,h:.176},{key:"8",x:.603,y:.03,w:.082,h:.176},{key:"7",x:.519,y:.03,w:.084,h:.176},{key:"9",x:.685,y:.03,w:.076,h:.176},{key:"0",x:.76,y:.03,w:.088,h:.176},{key:"Delete",x:.867,y:.03,w:.124,h:.176},{key:"q",x:.013,y:.213,w:.098,h:.186},{key:"w",x:.111,y:.213,w:.107,h:.186},{key:"e",x:.218,y:.213,w:.096,h:.186},{key:"r",x:.313,y:.213,w:.095,h:.186},{key:"t",x:.408,y:.213,w:.094,h:.186},{key:"y",x:.503,y:.213,w:.099,h:.186},{key:"u",x:.602,y:.213,w:.097,h:.186},{key:"i",x:.701,y:.213,w:.085,h:.186},{key:"o",x:.786,y:.213,w:.099,h:.186},{key:"p",x:.885,y:.213,w:.097,h:.186},{key:"a",x:.063,y:.408,w:.1,h:.182},{key:"s",x:.163,y:.408,w:.097,h:.182},{key:"d",x:.26,y:.408,w:.098,h:.182},{key:"f",x:.358,y:.408,w:.094,h:.182},{key:"g",x:.452,y:.408,w:.1,h:.182},{key:"h",x:.552,y:.408,w:.105,h:.182},{key:"j",x:.657,y:.408,w:.085,h:.182},{key:"k",x:.743,y:.408,w:.105,h:.182},{key:"l",x:.848,y:.408,w:.1,h:.182},{key:"z",x:.107,y:.596,w:.106,h:.197},{key:"x",x:.213,y:.596,w:.1,h:.197},{key:"c",x:.313,y:.596,w:.093,h:.197},{key:"v",x:.406,y:.596,w:.096,h:.197},{key:"b",x:.502,y:.596,w:.093,h:.197},{key:"n",x:.595,y:.596,w:.099,h:.197},{key:"m",x:.694,y:.596,w:.106,h:.197},{key:" ",x:.372,y:.798,w:.249,h:.169},{key:"Insert",x:.017,y:-.001,w:.038,h:.018}]}};if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var i={roboto:17,aileronsemibold:20,dejavu:20.5,exo2bold:20,exo2semibold:20.3,kelsonsans:22.8,monoid:19.5,mozillavr:9.5,sourcecodepro:20.3};function o(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t)return e[n];return null}if(AFRAME.registerComponent("super-keyboard",{schema:{align:{default:"left",oneOf:["left","center","right"]},blinkingSpeed:{type:"int",default:400},filters:{type:"array"},font:{default:"aileronsemibold"},hand:{type:"selector"},imagePath:{default:"."},injectToRaycasterObjects:{default:!0},inputColor:{type:"color",default:"#6699ff"},interval:{type:"int",default:50},keyBgColor:{type:"color",default:"#000"},keyColor:{type:"color",default:"#6699ff"},keyHoverColor:{type:"color",default:"#1A407F"},keyPressColor:{type:"color",default:"#5290F6"},label:{type:"string",default:""},labelColor:{type:"color",default:"#aaa"},maxLength:{type:"int",default:0},model:{default:"basic"},show:{default:!0},multipleInputs:{default:!1},value:{type:"string",default:""},width:{default:.8}},init:function(){this.el.addEventListener("click",this.click.bind(this)),this.changeEventDetail={},this.textInputObject={},this.keys=null,this.focused=!1,this.keyHover=null,this.prevCheckTime=null,this.shift=!1,this.rawValue=this.data.value,this.defaultValue=this.data.value,this.userFilterFunc=null,this.intervalId=0,this.kbImg=document.createElement("a-entity"),this.kbImg.classList.add("keyboardRaycastable"),this.kbImg.classList.add("superKeyboardImage"),this.kbImg.addEventListener("raycaster-intersected",this.hover.bind(this)),this.kbImg.addEventListener("raycaster-intersected-cleared",this.blur.bind(this)),this.el.appendChild(this.kbImg),this.label=document.createElement("a-entity"),this.label.setAttribute("text",{align:"center",font:this.data.font,baseline:"bottom",lineHeight:40,shader:"msdf",negate:!0,value:this.data.label,color:this.data.labelColor,width:this.data.width,wrapCount:30}),this.el.appendChild(this.label),this.textInput=document.createElement("a-entity"),this.textInput.setAttribute("mixin","superKeyboardTextInput"),this.textInput.setAttribute("text",{align:this.data.align,font:this.data.font,lineHeight:35,shader:"msdf",value:this.data.value,color:this.data.inputColor,width:this.data.width}),this.el.appendChild(this.textInput),this.cursor=document.createElement("a-entity"),this.cursor.object3D.position.set(0,0,.001),this.cursor.setAttribute("material",{shader:"flat",color:this.data.inputColor}),this.textInput.appendChild(this.cursor),this.cursorUpdated=!1,this.keyBgColor=new THREE.Color,this.keyHoverColor=new THREE.Color,this.keyPressColor=new THREE.Color;var e=this;document.addEventListener("keydown",(function(t){if("t"===t.key){for(var n="",r="abcdefghijklmopqrstuvQWIEUTGASDLIGKBXACQWETL102394676457",i=Math.floor(20*Math.random()),o=0;o<i;o++)n+=r[Math.floor(Math.random()*r.length)];e.el.setAttribute("super-keyboard",{value:n})}})),document.addEventListener("show",this.open.bind(this)),this.hand=null,this.handListenersSet=!1,this.raycaster=null},update:function(e){var t=r[this.data.model],n=this.data.width,i=this.data.width/2;if(void 0!==t){e&&this.defaultValue===e.defaultValue?this.updateTextInput(this.filter(this.rawValue)):(this.rawValue=this.data.value,this.defaultValue=this.data.value,this.updateTextInput(this.filter(this.data.value))),this.data.width===e.width&&this.data.height===e.height&&this.data.keyColor===e.keyColor||(this.kbImg.setAttribute("geometry",{primitive:"plane",width:n,height:i}),this.kbImg.setAttribute("material",{shader:"flat",src:this.data.imagePath+"/"+t.img,color:this.data.keyColor,transparent:!0})),this.data.label===e.label&&this.data.labelColor===e.labelColor&&this.data.width===e.width||(this.label.setAttribute("text",{value:this.data.label,color:this.data.labelColor,width:this.data.width}),this.label.object3D.position.set(0,.3*n,-.02)),this.data.width===e.width&&this.data.keyBgColor===e.keyBgColor||this.initKeyColorPlane();var o="center"!==this.data.align?t.inputOffsetX*n:0;"right"===this.data.align&&(o*=-1),this.data.font===e.font&&this.data.inputColor===e.inputColor&&this.data.width===e.width&&this.data.align===e.align||this.textInput.setAttribute("text",{font:this.data.font,color:this.data.inputColor,width:n,wrapCount:t.wrapCount,align:this.data.align});for(var a=0;a<t.layout.length;a++){var s=t.layout[a];"Insert"===s.key&&(this.inputRect=s)}this.textInput.object3D.position.set(o,n/4-(this.inputRect.y+this.inputRect.h/2)*n/2+t.inputOffsetY*n,.002),this.data.width!==e.width&&this.cursor.setAttribute("geometry",{primitive:"plane",width:.03*n,height:.01*n}),this.updateCursorPosition(),this.setupHand(),this.keyBgColor.set(this.data.keyBgColor),this.keyHoverColor.set(this.data.keyHoverColor),this.keyPressColor.set(this.data.keyPressColor),this.data.show?this.open():this.close()}else console.error('super-keyboard ERROR: model "'+this.data.model+'" undefined.')},tick:function(e){var t;if(!(this.prevCheckTime&&e-this.prevCheckTime<this.data.interval))if(this.prevCheckTime){if(this.raycaster&&this.focused&&(t=this.raycaster.getIntersection(this.kbImg)))for(var n=t.uv,i=r[this.data.model].layout,o=0;o<i.length;o++){var a=i[o];if(n.x>a.x&&n.x<a.x+a.w&&1-n.y>a.y&&1-n.y<a.y+a.h){this.keyHover!==a&&(this.keyHover=a,this.updateKeyColorPlane(this.keyHover.key,this.keyHoverColor));break}}}else this.prevCheckTime=e},play:function(){this.cursorUpdated&&this.startBlinking()},pause:function(){this.stopBlinking()},initKeyColorPlane:function(){var e=this.keyColorPlane=document.createElement("a-entity");e.classList.add("superKeyboardKeyColorPlane"),e.object3D.position.z=.001,e.object3D.visible=!1,e.setAttribute("geometry",{primitive:"plane"}),e.setAttribute("material",{shader:"flat",color:this.data.keyBgColor,transparent:!0}),e.addEventListener("componentinitialized",(function(e){"material"===e.detail.name&&(this.getObject3D("mesh").material.blending=THREE.AdditiveBlending)})),this.el.appendChild(e)},updateKeyColorPlane:function(e,t){var n=r[this.data.model],i=this.keyColorPlane;if(e){for(var o=0;o<n.layout.length;o++){var a=n.layout[o];if(a.key===e){var s=this.data.width,c=this.data.width/2,l=s/2,u=c/2,h=a.w*s,d=a.h*c;i.object3D.scale.x=h,i.object3D.scale.y=d,i.object3D.position.x=a.x*s-l+h/2,i.object3D.position.y=(1-a.y)*c-u-d/2,i.getObject3D("mesh").material.color.copy(t);break}}i.object3D.visible=!0}else i.object3D.visible=!1},setupHand:function(){if(this.hand&&this.hand.ownRaycaster&&this.hand.removeAttribute("raycaster"),this.data.hand?this.hand=this.data.hand:this.hand=document.querySelector(["[cursor]","[vive-controls]","[tracked-controls]","[gearvr-controls]","[oculus-go-controls]","[oculus-touch-controls]","[windows-motion-controls]","[hand-controls]","[daydream-controls] [cursor] > [raycaster]"].join(",")),this.hand){if(!this.hand.hasLoaded)return void this.hand.addEventListener("loaded",this.setupHand.bind(this));var e=this.hand.components.raycaster,t={};if(e){if(this.hand.ownRaycaster=!1,this.data.injectToRaycasterObjects){var n=e.data.objects.split(",");-1===n.indexOf(".keyboardRaycastable")&&n.push(".keyboardRaycastable"),t.objects=n.join(",").replace(/^,/,""),this.hand.setAttribute("raycaster",t)}}else this.hand.ownRaycaster=!0,t.showLine=this.data.show,t.enabled=this.data.show,this.data.injectToRaycasterObjects&&(t.objects=".keyboardRaycastable"),this.hand.setAttribute("raycaster",t);this.raycaster=this.hand.components.raycaster}else console.error('super-keyboard: no controller found. Add <a-entity> with controller or specify with super-keyboard="hand: #selectorToController".')},filter:function(e){if(""===e)return"";for(var t=0;t<this.data.filters.length;t++)switch(this.data.filters[t]){case"custom":this.userFilterFunc&&(e=this.userFilterFunc(e));break;case"allupper":e=e.toUpperCase();break;case"alllower":e=e.toLowerCase();break;case"title":e=e.split(" ").map((function(e){return e[0].toUpperCase()+e.substr(1)})).join(" ");break;case"numbers":e=e.split("").filter((function(e){return!isNaN(parseInt(e))||"."===e})).join("");break;case"first":e=e[0].toUpperCase()+e.substr(1);break;case"trim":e=e.trim()}return this.data.maxLength>0?e.substr(0,this.data.maxLength):e},click:function(e){if(this.keyHover){switch(this.keyHover.key){case"Enter":this.accept();break;case"Insert":return;case"Delete":this.rawValue=this.rawValue.substr(0,this.rawValue.length-1);var t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail);break;case"Shift":this.shift=!this.shift,this.keyHover.el.setAttribute("material","color",this.shift?this.data.keyHoverColor:this.data.keyBgColor);break;case"Escape":this.dismiss();break;default:if(this.data.maxLength>0&&this.rawValue.length>this.data.maxLength)break;this.rawValue+=this.shift?this.keyHover.key.toUpperCase():this.keyHover.key;t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail)}this.updateKeyColorPlane(this.keyHover.key,this.keyPressColor);var n=this;setTimeout((function(){n.updateKeyColorPlane(n.keyHover.key,n.keyHoverColor)}),100),this.updateCursorPosition()}},open:function(){this.el.object3D.visible=!0,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!0,enabled:!0})},close:function(){this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1})},accept:function(){this.el.emit("superkeyboardinput",{value:this.data.value}),this.data.multipleInputs?(this.rawValue="",this.data.value="",this.updateTextInput("")):(this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.data.show=!1)},dismiss:function(){this.data.value=this.defaultValue,this.updateTextInput(),this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.el.emit("superkeyboarddismiss"),this.data.show=!1},blur:function(e){this.focused=!1,this.keyHover&&"Shift"!==this.keyHover.key&&this.updateKeyColorPlane(this.keyHover.key,this.keyBgColor),this.keyHover=null},hover:function(e){this.focused=!0},startBlinking:function(){this.stopBlinking(),this.intervalId=window.setInterval(this.blink.bind(this),this.data.blinkingSpeed)},stopBlinking:function(){window.clearInterval(this.intervalId),this.intervalId=0},blink:function(){this.cursor.object3D.visible=!this.cursor.object3D.visible},setCustomFilter:function(e){this.userFilterFunc=e},addCustomModel:function(e,t){e&&(r[e]=t)},updateCursorPosition:function(){var e=this.textInput.components.text.currentFont;if(!e){var t=this;return this.cursor.object3D.visible=!1,void window.setTimeout((function(){t.updateCursorPosition(),t.startBlinking()}),700)}var n=this.data.width,a=r[this.data.model],s=-this.inputRect.h/2*n/2.4+a.inputOffsetY*n,c=this.data.width/this.textInput.components.text.data.wrapCount,l=0,u=i[this.textInput.components.text.data.font];void 0===u&&(u=20);for(var h=0;h<this.data.value.length;h++){var d=o(e.chars,this.data.value.charCodeAt(h));l+=d.width+d.xadvance*(32===d.id?2:1)}"center"===this.data.align?l=l*c*u*.0011/2+.02*n:"left"===this.data.align?(l=l*c*u*.0011+.02*n,l-=n/2):"right"===this.data.align&&(l=-l*c*u*.0011-.02*n,l+=n/2),this.cursor.object3D.position.set(l,s,.001),this.cursorUpdated=!0},updateTextInput:function(e){this.textInputObject.value=e||this.data.value,this.textInput.setAttribute("text",this.textInputObject)}}),window.AFRAME){const t=["super-keyboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercurve-color",{init:function(){const e=this.el;e.sceneEl.addEventListener("curveevenstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color1",e.detail):this.setColor("color1","primary")}),e.sceneEl.addEventListener("curveoddstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color2",e.detail):this.setColor("color2","secondary")})},setColor:function(e,t){const n=this.el.components.material.material.uniforms[e].value,i=this.el.sceneEl.systems.materials.scheme[t];r.set(i),n.x=r.r,n.y=r.g,n.z=r.b}}),window.AFRAME){const t=["supercurve-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("supercurve",{schema:{cameraPercent:{type:"number",is:"uniform"},color1:{type:"color",is:"uniform",default:i.a.initial.primary},color2:{type:"color",is:"uniform",default:i.a.initial.secondary},fogColor:{type:"color",is:"uniform",default:i.a.initial.primary},side:{default:"double"},transparent:{default:!0}},fragmentShader:n(173),vertexShader:n(174),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerCurve(this.material)}}),window.AFRAME){const t=[],n=["supercurve"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 fogColor;\nuniform float opacity;\n\n#define BLACK vec3(0.0)\n#define YELLOW vec3(250.0 / 255.0, 244.0 / 255.0, 180.0 / 255.0)\n\nvoid main() {\n vec3 col;\n\n // Lines.\n float f1 = clamp(sin(vUvs.x * 12.9 + 1.4) - 0.99, 0.0, 1.0) * 80.0;\n float f2 = clamp(sin(3.1416 + vUvs.x * 12.9 + 1.45) - 0.99, 0.0, 1.0) * 80.0;\n\n // Gradients.\n f1 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.4 + 1.4) * 0.1 + 0.1;\n f2 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.3 + 5.5) * 0.1 + 0.1;\n float f3 = sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.1 + 10.3) * 0.1 + 0.1;\n\n // Build color.\n col = mix(BLACK, color1, f1);\n col = mix(col, color2, f2);\n col = mix(col, YELLOW, f3);\n\n // Fog.\n float far = 100.0;\n float fog = 1.0 - clamp(length(vWorldPos - cameraPosition) / 400.0, 0.0, 1.0);\n\n col = mix(fogColor, col, fog);\n\n // fade beginning and end\n float alpha = 0.0;\n alpha += smoothstep(0.0, 0.003, vUvs.y);\n alpha -= smoothstep(0.997, 1.0, vUvs.y);\n\n gl_FragColor = vec4(col, alpha * (fog * fog));\n}\n"},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\n\nvoid main() {\n vWorldPos = (modelMatrix * vec4(position, 1.0)).xyz;\n vUvs = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t,n){n(176),n(177);const r=new THREE.Vector3,i=new THREE.Vector3;if(AFRAME.registerComponent("supercurve",{schema:{debug:{default:!1}},init:function(){this.buffers={},this.curve=null,this.fullLength=null,this.indexes={},this.length=null,this.points=[]},play:function(){this.generateCurve(1500)},generateCurve:function(e){this.length=e,e+=200,this.fullLength=e,this.points.length=0,this.points.push(new THREE.Vector3(0,0,0)),this.points.push(new THREE.Vector3(0,0,-100));let t,n=100;for(let r=2;r<=Math.ceil(e/100)-1;r++)t=this.points[r-1],n+=100,this.points.push(new THREE.Vector3(t.x+(10*Math.random()*2-10),t.y+(10*Math.random()*2-10),-1*n));const r=new THREE.CatmullRomCurve3(this.points),i=e-r.getLength(),o=r.getTangent(1,new THREE.Vector3),a=this.points[this.points.length-1].clone().add(o.multiplyScalar(i));this.points.push(a),this.setCurve(this.points),this.el.emit("supercurvegenerate")},setCurve:function(e){const t=this.buffers,n=(this.data,this.el),o=this.indexes;this.points=e;const a=this.curve=new THREE.CatmullRomCurve3(e),s=a.getLength(),c=a.getSpacedPoints(350),l=s/350,u=new THREE.BufferGeometry;t.position=new Float32Array(2106),t.normal=new Float32Array(2106),t.uvs=new Float32Array(1404),o.position=0,o.normal=0,o.uvs=0;const h=new THREE.Vector3(-1.5,0,-1*l/2),d=new THREE.Vector3(1.5,0,-1*l/2);for(let e=0;e<c.length;e++){const a=e/(c.length-1),s=c[e];if(0===c[e].x&&0===c[e].y&&0===c[e].z?(c[e].set(.001,0,.001),i.y=-1*Math.abs(i.y)):(i.copy(r).cross(c[e]).normalize(),i.y=-1*i.y),this.getPositionRelativeToTangent(a,h,r),t.position[o.position++]=r.x,t.position[o.position++]=r.y,t.position[o.position++]=r.z,t.normal[o.normal++]=i.x,t.normal[o.normal++]=i.y,t.normal[o.normal++]=i.z,t.uvs[o.uvs++]=0,t.uvs[o.uvs++]=a,this.getPositionRelativeToTangent(a,d,r),t.position[o.position++]=r.x,t.position[o.position++]=r.y,t.position[o.position++]=r.z,t.normal[o.normal++]=i.x,t.normal[o.normal++]=i.y,t.normal[o.normal++]=i.z,t.uvs[o.uvs++]=1,t.uvs[o.uvs++]=a,this.data.debug){const e=document.createElement("a-box");e.setAttribute("geometry",{width:.1,height:.1,depth:.1}),e.setAttribute("material",{shader:"flat",color:"#333"}),e.object3D.position.copy(s),e.object3D.position.y+=.1,n.appendChild(e)}}if(u.setAttribute("normal",new THREE.BufferAttribute(t.normal,3)),u.setAttribute("position",new THREE.BufferAttribute(t.position,3)),u.setAttribute("uv",new THREE.BufferAttribute(t.uvs,2)),n.getObject3D("mesh"))n.getObject3D("mesh").geometry=THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode);else{const e=new THREE.Mesh(THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode));n.setObject3D("mesh",e)}},getPointAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getPointAt(e,t)},getTangentAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getTangentAt(e,t)},getPositionRelativeToTangent:function(){const e=new THREE.Object3D,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,o,a){this.curve;return e.parent||this.el.sceneEl.object3D.add(e),r<0?(this.getPointAt(0,e.position),this.getTangentAt(0,n),e.position.addScaledVector(n,r)):r>1?(this.getPointAt(1,e.position),this.getTangentAt(1,n),e.position.addScaledVector(n,r)):(this.getPointAt(r,e.position),this.getTangentAt(r,n)),a?e.lookAt(t.copy(e.position).sub(n)):e.lookAt(t.copy(e.position).add(n)),e.updateMatrixWorld(),o.copy(i),e.localToWorld(o),o}}(),alignToCurve:function(){new THREE.Vector3,new THREE.Vector3;const e=new THREE.Vector3(0,0,-.01),t=new THREE.Vector3;return function(n,r){this.getPositionRelativeToTangent(n,e,t),r.lookAt(t),r.position.y+=.01}}(),songProgressToCurveProgress:function(e){return e*this.length/this.fullLength},curveProgressToSongProgress:function(e){return e*this.fullLength/this.length}}),AFRAME.registerComponent("supercurve-follow",{schema:{enabled:{default:!1},speed:{type:"number"},target:{type:"selector"}},init:function(){this.curveProgress=0,this.songProgress=0},update:function(){this.supercurve=this.data.target.components.supercurve},tick:function(){new THREE.Vector3(0,0,1),new THREE.Vector3;return function(e,t){const n=this.data;this.el;if(!n.enabled||!t)return;if(this.curveProgress>=1)return;const r=this.supercurve,i=r.curve;if(!i)return;this.curveProgress=this.curveProgress||0;const o=n.speed*(t/1e3);if(this.curveProgress+=o/this.supercurve.fullLength,this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress,this.curveProgress>=1)return this.curveProgress=1,void(this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress);i.getPointAt(this.curveProgress,this.el.object3D.position),this.songProgress=r.curveProgressToSongProgress(this.curveProgress),r.alignToCurve(this.songProgress,this.el.object3D)}}()}),window.AFRAME){const t=["supercurve","supercurve-follow"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){const n=THREE.Math,r=THREE.Vector3,i=THREE.Matrix4;function o(){this.type="Curve",this.arcLengthDivisions=200}var a,s,c;Object.assign(o.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPoint(r/e));return n},getSpacedPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n},getLength:(c=[],function(){var e=this.getLengths(void 0,c);return e[e.length-1]}),getLengths:function(e,t){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1,t&&(t.length=0);var n,r,i=t||[],o=this.getPoint(0),a=0;for(i.push(0),r=1;r<=e;r++)a+=(n=this.getPoint(r/e)).distanceTo(o),i.push(a),o=n;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},getTangent:(a=new THREE.Vector3,s=new THREE.Vector3,function(e,t){var n,r=e-1e-4,i=e+1e-4;return r<0&&(r=0),i>1&&(i=1),this.getPoint(r,a),this.getPoint(i,s),t?(n=t).copy(s).sub(a):n=s.clone().sub(a),n.normalize()}),getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var o,a,s,c=new r,l=[],u=[],h=[],d=new r,p=new i;for(o=0;o<=e;o++)a=o/e,l[o]=this.getTangentAt(a),l[o].normalize();u[0]=new r,h[0]=new r;var f=Number.MAX_VALUE,m=Math.abs(l[0].x),g=Math.abs(l[0].y),y=Math.abs(l[0].z);for(m<=f&&(f=m,c.set(1,0,0)),g<=f&&(f=g,c.set(0,1,0)),y<=f&&c.set(0,0,1),d.crossVectors(l[0],c).normalize(),u[0].crossVectors(l[0],d),h[0].crossVectors(l[0],u[0]),o=1;o<=e;o++)u[o]=u[o-1].clone(),h[o]=h[o-1].clone(),d.crossVectors(l[o-1],l[o]),d.length()>Number.EPSILON&&(d.normalize(),s=Math.acos(n.clamp(l[o-1].dot(l[o]),-1,1)),u[o].applyMatrix4(p.makeRotationAxis(d,s))),h[o].crossVectors(l[o],u[o]);if(!0===t)for(s=Math.acos(n.clamp(u[0].dot(u[e]),-1,1)),s/=e,l[0].dot(d.crossVectors(u[0],u[e]))>0&&(s=-s),o=1;o<=e;o++)u[o].applyMatrix4(p.makeRotationAxis(l[o],s*o)),h[o].crossVectors(l[o],u[o]);return{tangents:l,normals:u,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),THREE.Curve=o},function(e,t){const n=THREE.Vector3,r=THREE.Curve;function i(){var e=0,t=0,n=0,r=0;function i(i,o,a,s){e=i,t=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,a,s){var c=(t-e)/o-(n-e)/(o+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+s)+(r-n)/s;i(t,n,c*=a,l*=a)},calc:function(i){var o=i*i;return e+t*i+n*o+r*(o*i)}}}var o=new n,a=new i,s=new i,c=new i;function l(e,t,n,i){r.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.prototype.isCatmullRomCurve3=!0,l.prototype.getPoint=function(e,t){var r,i,l,u,h=t||new n,d=this.points,p=d.length,f=(p-(this.closed?0:1))*e,m=Math.floor(f),g=f-m;if(this.closed?m+=m>0?0:(Math.floor(Math.abs(m)/p)+1)*p:0===g&&m===p-1&&(m=p-2,g=1),this.closed||m>0?r=d[(m-1)%p]:(o.subVectors(d[0],d[1]).add(d[0]),r=o),i=d[m%p],l=d[(m+1)%p],this.closed||m+2<p?u=d[(m+2)%p]:(o.subVectors(d[p-1],d[p-2]).add(d[p-1]),u=o),"centripetal"===this.curveType||"chordal"===this.curveType){var y="chordal"===this.curveType?.5:.25,v=Math.pow(r.distanceToSquared(i),y),b=Math.pow(i.distanceToSquared(l),y),_=Math.pow(l.distanceToSquared(u),y);b<1e-4&&(b=1),v<1e-4&&(v=b),_<1e-4&&(_=b),a.initNonuniformCatmullRom(r.x,i.x,l.x,u.x,v,b,_),s.initNonuniformCatmullRom(r.y,i.y,l.y,u.y,v,b,_),c.initNonuniformCatmullRom(r.z,i.z,l.z,u.z,v,b,_)}else"catmullrom"===this.curveType&&(a.initCatmullRom(r.x,i.x,l.x,u.x,this.tension),s.initCatmullRom(r.y,i.y,l.y,u.y,this.tension),c.initCatmullRom(r.z,i.z,l.z,u.z,this.tension));return h.set(a.calc(g),s.calc(g),c.calc(g)),h},l.prototype.copy=function(e){r.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},l.prototype.toJSON=function(){var e=r.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},l.prototype.fromJSON=function(e){r.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var o=e.points[t];this.points.push((new n).fromArray(o))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},THREE.CatmullRomCurve3=l},function(e,t,n){if(AFRAME.registerShader("superCutFxShader",{schema:{startTime:{type:"float",is:"uniform"},timeMs:{type:"time",is:"uniform"},color:{type:"color",is:"uniform"}},vertexShader:"\n varying vec2 uvs;\n varying vec3 worldPos;\n void main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:"\n uniform float startTime;\n uniform float timeMs;\n uniform vec3 color;\n varying vec2 uvs;\n varying vec3 worldPos;\n\n void main() {\n float time = (timeMs - startTime) / 2000.0;\n vec2 p = uvs.xy - 0.5;\n float r = p.x * p.x + p.y * p.y;\n float alpha = 1.0 - smoothstep(time - 0.01, time, r);\n alpha *= smoothstep(time - 0.1, time, r);\n alpha *= 1.0 - time * 5.5;\n gl_FragColor = vec4(color, alpha);\n }\n "}),window.AFRAME){const t=[],n=["superCutFxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercutfx",{schema:{colorPrimary:{type:"string"},colorSecondary:{type:"string"}},init:function(){this.rigEl=document.getElementById("curveFollowRig"),this.startTime=-1100},createSuperCut:function(e,t){const n=this.el,i=this.el.getObject3D("mesh");i.material.transparent=!0,this.rigEl.object3D.worldToLocal(n.object3D.position.copy(e.position)),n.object3D.position.z-=.25,n.object3D.visible=!0,this.startTime=n.sceneEl.time,r.set("red"===t?this.data.colorPrimary:this.data.colorSecondary);const o=i.material.uniforms.color.value;o.x=r.r,o.y=r.g,o.z=r.b,i.material.uniforms.startTime.value=this.startTime-50,n.play()},tick:function(e){e>this.startTime+1e3&&(this.el.object3D.visible=!1,this.el.pause())}}),window.AFRAME){const t=["supercutfx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tail",{schema:{height:{default:.1},segments:{default:10,type:"int"},target:{type:"selector"},width:{default:1}},init:function(){const e=this.data,t=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,e.segments,1);t.deleteAttribute("normal"),t.translate(e.width/2,0,0);const n=this.el.sceneEl.systems.materials.handStarTrail,r=new THREE.Mesh(t,n);r.frustumCulled=!1,this.el.setObject3D("mesh",r),this.positions=t.attributes.position.array,this.numVerts=2*e.segments+2,this.geometry=t,this.target=e.target.object3D,this.targetPos=new THREE.Vector3},tick:function(e,t){const n=this.positions,r=this.targetPos;let i,o=this.numVerts/2*3,a=this.data.height/2;for(let e=this.numVerts/2-1;e>0;e--)i=3*e,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1],i+=o,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1];this.target.getWorldPosition(r),n[0]=r.x,n[1]=r.y+a,n[2]=r.z-.1,n[o+0]=r.x,n[o+1]=r.y-a,n[o+2]=r.z-.1,this.geometry.attributes.position.needsUpdate=!0}}),window.AFRAME){const t=["tail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-counter",{dependencies:["text"],schema:{decimals:{default:0},dur:{default:2e3,type:"int"},enabled:{default:!1},emit:{default:!1},prefix:{default:""},suffix:{default:""},value:{default:0,type:"float"}},init:function(){this.currentValue=0,this.hasCompleted=!1,this.textValue={value:""}},update:function(e){this.currentValue=0,this.textValue.value=`${this.data.prefix}${this.decimals(0)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue),this.hasCompleted=!1},tick:function(e,t){this.data.enabled&&!this.hasCompleted&&(this.currentValue+=this.data.value*(t/this.data.dur),this.currentValue>=this.data.value&&(this.currentValue=this.data.value,this.data.emit&&this.el.emit("textcounterdone",null,!1),this.hasCompleted=!0),this.textValue.value=`${this.data.prefix}${this.decimals(this.currentValue)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue))},decimals:function(e){var t=Math.pow(10,this.data.decimals);return(parseInt(e*t)/t).toFixed(this.data.decimals)}}),window.AFRAME){const t=["text-counter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-truncate",{schema:{value:{type:"string"},length:{type:"int",default:10}},update:function(){this.el.setAttribute("text","value",function(e,t){if(!e)return"";if(e.length>=t)return e.substring(0,t-3)+"...";return e}(this.data.value,this.data.length))}}),window.AFRAME){const t=["text-truncate"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-uppercase",{schema:{value:{type:"string"}},update:function(){this.el.setAttribute("text","value",this.data.value.toUpperCase())}}),window.AFRAME){const t=["text-uppercase"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("toggle-pause-play",{schema:{isPlaying:{default:!1}},update:function(){const e=this.data.isPlaying?"pause":"play";parent.postMessage(JSON.stringify({verify:"game-action",action:e}),"*")}}),window.AFRAME){const t=["toggle-pause-play"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerComponent("trail",{schema:{color:{default:"primary"},colorScheme:{default:"default"},enabled:{default:!1},hand:{type:"string"}},init:function(){const e=this.geometry=new THREE.BufferGeometry,t=this.maxPoints=12,n=this.vertices=new Float32Array(36*t),r=this.colors=new Float32Array(48*t);this.bladeColor={alpha:1},this.rigContainer=document.getElementById("rigContainer"),this.bladeEl=this.el.querySelector(".blade"),this.layers=0,this.bladeTrajectory=[{top:new THREE.Vector3(-.5,0,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(.5,0,0)},{top:new THREE.Vector3(-.5,.5,0),center:new THREE.Vector3(0,.5,0),bottom:new THREE.Vector3(.5,.5,0)},{top:new THREE.Vector3(-.5,1,0),center:new THREE.Vector3(0,1,0),bottom:new THREE.Vector3(.5,1,0)}],this.newSample=null,e.setAttribute("position",new THREE.BufferAttribute(n,3).setUsage(THREE.DynamicDrawUsage)),e.setAttribute("vertexColor",new THREE.BufferAttribute(r,4).setUsage(THREE.DynamicDrawUsage));const i=new THREE.ShaderMaterial({side:THREE.DoubleSide,vertexColors:THREE.VertexColors,transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,vertexShader:["varying vec4 vColor;","attribute vec4 vertexColor;","void main() {","vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);","vColor = vertexColor;","gl_Position = projectionMatrix * modelViewPosition;","}"].join(""),fragmentShader:["varying vec4 vColor;","uniform float pulse;","void main() {","gl_FragColor = vec4(vColor.xyz, vColor.a + pulse);","}"].join(""),uniforms:{pulse:{value:0}}}),o=this.mesh=new THREE.Mesh(e,i);o.frustumCulled=!1,o.vertices=n,this.rigContainer.setObject3D("trail__"+this.data.hand,o)},update:function(e){if(this.mesh.visible=this.data.enabled,!e.enabled&&this.data.enabled&&(this.enabledTime=this.el.sceneEl.time),e.colorScheme!==this.data.colorScheme){this.bladeColor=new THREE.Color(i.a.schemes[this.data.colorScheme][this.data.color]);this.bladeColor.red=this.bladeColor.r,this.bladeColor.green=this.bladeColor.g,this.bladeColor.blue=this.bladeColor.b}},tock:function(e,t){this.data.enabled&&(!this.mesh.visible&&e>this.enabledTime+250&&(this.mesh.visible=!0),this.mesh.material.uniforms.pulse.value*=.9,this.sampleBladePosition())},pulse:function(){this.mesh.material.uniforms.pulse.value=1},addLayer:function(e){const t=this.bladeColor,n=this.colors,r=this.segments,i=this.vertices;let o=2/r;this.layers>=this.maxLayers&&(this.layers=0);const a=this.layers*e;e=a+e;const s=this.layers*r*18,c=this.layers*r*24;for(let l=0;l<r;++l)i[s+18*l]=l*o-1,i[s+18*l+1]=a,i[s+18*l+2]=0,n[c+24*l]=t.red,n[c+24*l+1]=t.green,n[c+24*l+2]=t.blue,n[c+24*l+3]=t.alpha,i[s+18*l+3]=l*o-1,i[s+18*l+4]=e,i[s+18*l+5]=0,n[c+24*l+4]=t.red,n[c+24*l+5]=t.green,n[c+24*l+6]=t.blue,n[c+24*l+7]=t.alpha,i[s+18*l+6]=l*o-1+o,i[s+18*l+7]=e,i[s+18*l+8]=0,n[c+24*l+8]=t.red,n[c+24*l+9]=t.green,n[c+24*l+10]=t.blue,n[c+24*l+11]=t.alpha,i[s+18*l+9]=l*o-1+o,i[s+18*l+10]=a,i[s+18*l+11]=0,n[c+24*l+12]=t.red,n[c+24*l+13]=t.green,n[c+24*l+14]=t.blue,n[c+24*l+15]=t.alpha,i[s+18*l+12]=l*o-1,i[s+18*l+13]=a,i[s+18*l+14]=0,n[c+24*l+16]=t.red,n[c+24*l+17]=t.green,n[c+24*l+18]=t.blue,n[c+24*l+19]=t.alpha,i[s+18*l+15]=l*o-1+o,i[s+18*l+16]=e,i[s+18*l+17]=0,n[c+24*l+20]=t.red,n[c+24*l+21]=t.green,n[c+24*l+22]=t.blue,n[c+24*l+23]=t.alpha;this.layers++,this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0},initGeometry:function(){const e=this.bladeColor,t=this.geometry.attributes.vertexColor.array,n=this.geometry.attributes.position.array,r=this.bladeTrajectory;let i,o,a;for(let s=1;s<r.length;s++){1===s&&(o=i),i=1-(r.length-s)/r.length;const c=r[s];a=r[s-1],n[36*s]=a.center.x,n[36*s+1]=a.center.y,n[36*s+2]=a.center.z,t[48*s]=e.red,t[48*s+1]=e.green,t[48*s+2]=e.blue,t[48*s+3]=.2*o,n[36*s+3]=c.top.x,n[36*s+4]=c.top.y,n[36*s+5]=c.top.z,t[48*s+4]=e.red,t[48*s+5]=e.green,t[48*s+6]=e.blue,t[48*s+7]=i,n[36*s+6]=a.top.x,n[36*s+7]=a.top.y,n[36*s+8]=a.top.z,t[48*s+8]=e.red,t[48*s+9]=e.green,t[48*s+10]=e.blue,t[48*s+11]=o,n[36*s+9]=a.center.x,n[36*s+10]=a.center.y,n[36*s+11]=a.center.z,t[48*s+12]=e.red,t[48*s+13]=e.green,t[48*s+14]=e.blue,t[48*s+15]=.2*o,n[36*s+12]=c.center.x,n[36*s+13]=c.center.y,n[36*s+14]=c.center.z,t[48*s+16]=e.red,t[48*s+17]=e.green,t[48*s+18]=e.blue,t[48*s+19]=.2*i,n[36*s+15]=c.top.x,n[36*s+16]=c.top.y,n[36*s+17]=c.top.z,t[48*s+20]=e.red,t[48*s+21]=e.green,t[48*s+22]=e.blue,t[48*s+23]=i,n[36*s+18]=a.bottom.x,n[36*s+19]=a.bottom.y,n[36*s+20]=a.bottom.z,t[48*s+24]=e.red,t[48*s+25]=e.green,t[48*s+26]=e.blue,t[48*s+27]=0,n[36*s+21]=c.center.x,n[36*s+22]=c.center.y,n[36*s+23]=c.center.z,t[48*s+28]=e.red,t[48*s+29]=e.green,t[48*s+30]=e.blue,t[48*s+31]=.2*i,n[36*s+24]=a.center.x,n[36*s+25]=a.center.y,n[36*s+26]=a.center.z,t[48*s+32]=e.red,t[48*s+33]=e.green,t[48*s+34]=e.blue,t[48*s+35]=.2*o,n[36*s+27]=a.bottom.x,n[36*s+28]=a.bottom.y,n[36*s+29]=a.bottom.z,t[48*s+36]=e.red,t[48*s+37]=e.green,t[48*s+38]=e.blue,t[48*s+39]=0,n[36*s+30]=c.bottom.x,n[36*s+31]=c.bottom.y,n[36*s+32]=c.bottom.z,t[48*s+40]=e.red,t[48*s+41]=e.green,t[48*s+42]=e.blue,t[48*s+43]=0,n[36*s+33]=c.center.x,n[36*s+34]=c.center.y,n[36*s+35]=c.center.z,t[48*s+44]=e.red,t[48*s+45]=e.green,t[48*s+46]=e.blue,t[48*s+47]=.2*i,o=i}this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0},sampleBladePosition:function(){let e;this.bladeTrajectory.length===this.maxPoints?(e=this.newSample=this.bladeTrajectory.shift(),e.top.set(0,-.5,0),e.center.set(0,0,0),e.bottom.set(0,.5,0)):this.newSample?(this.newSample.top.set(0,-.5,0),this.newSample.center.set(0,0,0),this.newSample.bottom.set(0,.5,0),e=this.newSample):e={top:new THREE.Vector3(0,-.5,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(0,.5,0)};const t=this.bladeEl.object3D;t.localToWorld(e.top),t.localToWorld(e.center),t.localToWorld(e.bottom),this.rigContainer.object3D.worldToLocal(e.top),this.rigContainer.object3D.worldToLocal(e.center),this.rigContainer.object3D.worldToLocal(e.bottom),this.bladeTrajectory.push(e),this.initGeometry()}}),window.AFRAME){const t=["trail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tunnels",{dependencies:["pool_tunnels"],schema:{isPlaying:{default:!1},songDuration:{default:0}},init:function(){this.addTunnel=this.addTunnel.bind(this),this.clearTunnels=this.clearTunnels.bind(this),this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.timeout=0,this.tunnels=[],this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.el.addEventListener("cleargame",this.clearTunnels),this.el.addEventListener("gamemenuexit",this.clearTunnels),this.el.addEventListener("gamemenurestart",this.clearTunnels)},update:function(e){!e.isPlaying&&this.data.isPlaying&&this.requestTunnel(),e.isPlaying&&!this.data.isPlaying&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},play:function(){this.pool=this.el.components.pool__tunnels},requestTunnel:function(){this.timeout=setTimeout(this.addTunnel,Math.floor(3e3+1e4*Math.random()))},addTunnel:function(){const e=this.pool.requestEntity();if(!e)return;e.setAttribute("render-order","tunnel"),e.object3D.visible=!0;const t=this.curveEl.components.supercurve;let n=(this.el.components.song.getCurrentTime()+20)/this.data.songDuration;n>1&&(n=1),t.getPointAt(n,e.object3D.position),t.alignToCurve(n,e.object3D),e.play(),this.tunnels.push(e),this.requestTunnel()},clearTunnels:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);for(let e=0;e<this.tunnels.length;e++)this.tunnels[e].object3D.visible=!1,this.pool.returnEntity(this.tunnels[e]);this.tunnels.length=0},tick:function(e,t){if(0!=this.tunnels.length)for(let e=0;e<this.tunnels.length;e++){if(!(this.tunnels[e].object3D.position.z>this.curveFollowRig.object3D.position.z+5))return;{const t=this.tunnels.splice(e,1)[0];t.object3D.visible=!1,this.pool.returnEntity(t)}}}}),window.AFRAME){const t=["tunnels"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=new THREE.Color;if(AFRAME.registerComponent("vertex-colors-buffer",{schema:{baseColor:{type:"color"},itemSize:{default:3}},update:function(e){var t,n,i,o,a=this.data,s=this.el,c=this;if((o=this.el.getObject3D("mesh"))&&o.geometry)if((i=o.geometry).attributes.position){for(i.attributes.color||i.setAttribute("color",new THREE.BufferAttribute(new Float32Array(i.attributes.position.array.length),3)),t=i.attributes.color.array,r.set(a.baseColor),n=0;n<t.length;n+=a.itemSize)t[n]=r.r,t[n+1]=r.g,t[n+2]=r.b;i.attributes.color.needsUpdate=!0}else console.warn("Geometry has no vertices",s);else s.addEventListener("object3dset",(function t(n){"mesh"===n.detail.type&&(s.removeEventListener("object3dset",t),c.update(e))}))}}),window.AFRAME){const t=["vertex-colors-buffer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("victory-accuracy-ring",{dependencies:["geometry","material"],schema:{accuracy:{default:0}},update:function(){this.el.getObject3D("mesh").material.uniforms.progress.value=0,this.el.setAttribute("animation","to",this.data.accuracy/100),this.el.components.animation.beginAnimation()}}),window.AFRAME){const t=["victory-accuracy-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={sphericalEnvMap:"",roughness:.8,metalness:.4},i={sphericalEnvMap:"#envmapImg",roughness:.2,metalness:.6};if(AFRAME.registerComponent("victory-rank",{schema:{isVictory:{default:!1},rank:{type:"string"}},update:function(e){const t=this.el,n=this.data.rank;if(e.isVictory&&!this.data.isVictory&&this.el.object3D.scale.set(.001,.001,.001),n)switch(t.setAttribute("text-geometry","value",n),n[0]){case"S":t.setAttribute("material",Object.assign({color:"#F0e077"},i));break;case"A":t.setAttribute("material",Object.assign({color:"#6FF9EA"},i));break;case"B":t.setAttribute("material",Object.assign({color:"#F8d"},i));break;case"C":t.setAttribute("material",Object.assign({color:"#F971C3"},r));break;case"D":t.setAttribute("material",Object.assign({color:"#1E6269"},r));break;case"F":t.setAttribute("material",Object.assign({color:"#e3170a"},r))}}}),window.AFRAME){const t=["victory-rank"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("visible-raycastable",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data,this.data?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable","")}}),window.AFRAME){const t=["visible-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerShader("wallShader",{schema:{colorTertiary:{type:"color",is:"uniform",default:r.initial.tertiary},environment:{type:"map",is:"uniform",default:"#envmapImg"},hitLeft:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},hitRight:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},iTime:{type:"time",is:"uniform"},opacity:{type:"number",is:"uniform"}},vertexShader:n(192),fragmentShader:n(193)}),window.AFRAME){const t=[],n=["wallShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\nvoid main() {\n uvs.xy = uv.xy;\n nrml.xyz = normal.xyz;\n vec4 p = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n worldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = p;\n}\n"},function(e,t){e.exports="uniform float iTime;\nuniform float opacity;\nuniform sampler2D environment;\nuniform vec3 colorTertiary;\nuniform vec3 hitLeft;\nuniform vec3 hitRight;\nvarying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\n#define SEED 19.1252\n#define time (3.0 + iTime) / 1000.0\n\nfloat noise(vec3 uv) {\n return fract(sin(uv.x*123243. + uv.y*424. + uv.z*642. + SEED) * 1524.);\n}\n\nvec4 drawHit(vec3 p, vec3 center, vec3 color) {\n center.z -= 0.1;\n float dist = 1.0 - smoothstep(0.0, 0.3, length(p - center));\n float glitch = noise(floor(p*3.0)) * 0.06 - 0.03;\n float alpha = 1.0 - smoothstep(0.0, 0.01, abs(p.z-center.z + glitch));\n alpha += 1.0 - smoothstep(0.0, 0.01, abs(p.y-center.y + glitch));\n return vec4(color * dist, alpha * dist + alpha);\n}\n\nvoid main() {\n vec2 uv1 = uvs.xy-0.5;\n float alpha = 0.0;\n // border\n alpha += smoothstep(0.44, 0.50, abs(uv1.x));\n alpha += smoothstep(0.44, 0.50, abs(uv1.y));\n alpha += smoothstep(0.486, 0.49, abs(uv1.x));\n alpha += smoothstep(0.486, 0.49, abs(uv1.y));\n alpha = min(1.0, alpha * 0.5);\n\n // weapon collision\n vec4 hit;\n hit = drawHit(worldPos, hitRight, colorTertiary);\n hit += drawHit(worldPos, hitLeft, colorTertiary);\n\n // reflection\n vec3 ray = reflect(normalize(cameraPosition - worldPos + sin(worldPos.z) * 0.1 + cos(worldPos.z * 0.3) * 0.3), nrml);\n float m = 2.0 * sqrt(pow(ray.x, 2.0) + pow(ray.y, 2.0) + pow(ray.z, 2.0));\n vec2 uv = ray.xy / m + 0.5;\n vec3 col = texture2D(environment, uv).rgb * 0.3;\n\n gl_FragColor = vec4(mix(col, colorTertiary, alpha) + hit.rgb, (alpha * 0.2 + 0.8) * opacity + hit.a);\n}\n"},function(e,t,n){"use strict";n.r(t);n(24);if(AFRAME.registerComponent("wall",{dependencies:["material"],init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.el.setObject3D("mesh",new THREE.Mesh),this.geometry=null,this.isCeiling=!1,this.isRaycastable=!1,this.localPosition=new THREE.Vector3,this.songPosition=void 0,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3)},play:function(){this.el.object3D.visible=!0},tick:function(e,t){const n=this.curveFollowRig.components["supercurve-follow"].songProgress;!this.isRaycastable&&n+.01>=this.songPosition&&(this.isRaycastable=!0,this.el.setAttribute("data-wall-active",""),this.isCeiling||(this.el.setAttribute("data-weapon-particles",""),this.el.setAttribute("raycastable-game",""))),n>=this.backPosition+.01&&this.returnToPool()},onGenerate:function(e,t,n,r,i,o){const a=this.el;this.isCeiling=i,this.backPosition=o,this.songPosition=e,this.setWallGeometry(e,t,n,r,i),a.getObject3D("mesh").material.uniforms.opacity.value=0,a.object3D.position.y=-5,a.components.animation__fadein.beginAnimation(),a.components.animation__scalein.beginAnimation()},setWallGeometry:function(){const e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,o,a,s){const c=this.el.sceneEl.components["beat-system"],l=this.curveEl.components.supercurve,u=r,h=r+a/l.length,d=s?1.5:2.5,p=-1*c.horizontalPositions[i]-o/2+.25;t.x=p-o/2,n.x=p+o/2;const f=(this.geometry=new THREE.BoxBufferGeometry(o,d,1,1,1,30)).attributes.position.array;for(let r=0;r<f.length;r+=3){const i=f[r+2]+.5;l.getPositionRelativeToTangent(u+i*(h-u),f[r]<0?t:n,e),f[r]=e.x,f[r+1]+=e.y+d/2,f[r+2]=e.z}let m=c.verticalPositions.middle+c.size/2;"punch"===c.data.gameMode&&(m-=.1),this.el.getObject3D("mesh").geometry=this.geometry,this.el.getObject3D("mesh").position.y=s?m:.1}}(),returnToPool:function(){this.el.object3D.visible=!1,this.el.removeAttribute("data-weapon-particles"),this.el.removeAttribute("data-wall-active"),this.el.removeAttribute("raycastable-game"),this.isCeiling=!1,this.isRaycastable=!1,this.el.isPlaying&&this.el.sceneEl.components.pool__wall.returnEntity(this.el),this.geometry&&this.geometry.dispose()}}),window.AFRAME){const t=["wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={direction:{x:0,y:-.25,z:-1}},i={direction:{x:0,y:1,z:-1}};if(AFRAME.registerComponent("weapon-particles",{schema:{enabled:{default:!1},gameMode:{default:""},hand:{type:"string"}},init:function(){this.hiddenIntersection={x:999,y:0,z:0},this.intersectedEl=null,this.weaponEnter=this.weaponEnter.bind(this),this.weaponLeave=this.weaponLeave.bind(this)},update:function(e){e.gameMode!==this.data.gameMode&&this.el.setAttribute("raycaster__game","punch"===this.data.gameMode?r:i)},pause:function(){this.el.removeEventListener("mouseenter",this.weaponEnter),this.el.removeEventListener("mouseleave",this.weaponLeave)},play:function(){this.el.addEventListener("mouseenter",this.weaponEnter),this.el.addEventListener("mouseleave",this.weaponLeave)},weaponEnter:function(e){this.data.enabled&&e.target===this.el&&e.detail.intersectedEl.hasAttribute("data-weapon-particles")&&(this.intersectedEl=e.detail.intersectedEl)},weaponLeave:function(e){if(e.detail.target===this.el){if(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id){const e=this.data.hand===RIGHT?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=this.hiddenIntersection}this.intersectedEl=null}},tick:function(e,t){if(!this.data.enabled||!this.intersectedEl)return;const n=this.el.components.raycaster__game.getIntersection(this.intersectedEl);if(n&&(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id)){const e="right"===this.data.hand?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=n.point}}}),window.AFRAME){const t=["weapon-particles"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){AFRAME.registerComponent("zip-loader",{schema:{difficulties:{type:"array"},isLoading:{default:"false"},version:{type:"string"},directDownload:{type:"string"},bpm:{type:"number"}},init:function(){this.loadingIndicator=document.getElementById("zipLoaderIndicator"),this.cachedZip=null,this.cachedVersion=null,this.message={},this.worker=new Worker("build/zip.js"),this.worker.onmessage=this.onMessage.bind(this),this.worker.onerror=console.error},update:function(e){const t=this.data;e.version&&e.version!==t.version&&this.cachedVersion!==t.version&&(this.message.abort=!0,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e.version,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)),t.version&&e.version!==t.version&&(this.cachedVersion=null,this.cachedZip=null,this.fetchZip(t.version)),e.isLoading||!this.data.isLoading||this.cachedVersion!==this.data.version||this.cachedZip||this.el.emit("songloaderror")},fetchZip:function(e){this.el.emit("ziploaderstart",null,!1),this.message.abort=!1,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)},onMessage:function(e){switch(e.data.message){case"error":this.el.emit("songloaderror");break;case"progress":if(e.data.version!==this.data.version)return;this.loadingIndicator.setAttribute("material","progress",e.data.progress);break;case"load":{let t;this.cachedVersion=e.data.version,this.cachedZip=e.data.data;const n=e.data.data.beats;for(t in n)break;if(!t)return this.cachedZip=null,void(e.data.version===this.data.version&&this.el.emit("songloaderror"));e.data.version===this.data.version&&this.el.emit("ziploaderend",e.data.data,!1);break}}}});if(window.AFRAME){const t=["zip-loader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={"./index.js":198};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=197},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r);n(6);const a=n(29),s={};let c=!1;const l={Easy:"Easy",Expert:"Expert",ExpertPlus:"Expert+",Hard:"Hard",Normal:"Normal"},u={},h={author:"Juancho Pancho",difficulty:"Expert",id:"31",image:"assets/img/molerat.jpg",songDuration:100,songName:"Friday",songLength:100,songSubName:"Rebecca Black"},d="true"===AFRAME.utils.getUrlParameter("skipintro"),p=localStorage.getItem("colorScheme")||"blue";let f=localStorage.getItem("favorites-v2");if(f)try{f=JSON.parse(f)}catch(e){f=[]}else f=[];function m(e){let t=Math.ceil(e.search.results.length/6);e.search.hasPrev=e.search.page>0,e.search.hasNext=e.search.page<t-1,e.search.songNameTexts="",e.search.songSubNameTexts="",e.searchResultsPage.length=0,e.searchResultsPage.__dirty=!0;for(let t=6*e.search.page;t<6*e.search.page+6;t++){const n=e.search.results[t];if(!n)break;e.searchResultsPage.push(n),e.search.songNameTexts+=g(n.metadata.songName,22).toUpperCase()+"\n",e.search.songSubNameTexts+=g(n.metadata.songSubName||n.metadata.songAuthorName||"Unknown Artist",32)+"\n"}for(let t=0;t<e.searchResultsPage.length;t++)e.searchResultsPage[t].index=t;E(e)}function g(e,t){return e?e.length>=t?e.substring(0,t-3)+"...":e:""}AFRAME.registerState({nonBindedStateKeys:["genres"],initialState:{activeHand:localStorage.getItem("hand")||"right",challenge:{audio:"",author:"",difficulty:"",beatmapCharacteristic:"",id:AFRAME.utils.getUrlParameter("challenge"),image:"",isBeatsPreloaded:!1,numBeats:void 0,songDuration:0,songName:"",songNameShort:"",songSubName:"",metadata:{}},colorPrimary:o.a.schemes[p].primary,colorScheme:p,colorSecondary:o.a.schemes[p].secondary,colorSecondaryBright:o.a.schemes[p].secondarybright,colorTertiary:o.a.schemes[p].tertiary,controllerType:"",damage:0,difficultyFilter:"All",difficultyFilterMenuOpen:!1,favorites:f,gameMode:"ride",genre:"",genres:n(199),genreMenuOpen:!1,has3DOFVR:!1,has6DOFVR:!1,hasSongLoadError:!1,hasVR:AFRAME.utils.device.checkHeadsetConnected()||"true"===AFRAME.utils.getUrlParameter("debugvr"),introActive:!d,inVR:"true"===AFRAME.utils.getUrlParameter("debugvr"),isIOS:AFRAME.utils.device.isIOS(),isGameOver:!1,isLoading:!1,isMenuOpening:!d,isPaused:!1,isPlaying:!1,isSearching:!1,isSongProcessing:!1,isVictory:!1,isZipFetching:!1,leaderboard:[],leaderboardFetched:!1,leaderboardQualified:!1,leaderboardNames:"",leaderboardScores:"",mainMenuActive:!1,menuActive:d,multiplayer:{active:!1,lobbyOpen:!1,roomCode:"",shareUrl:"",shareCopied:!1,isHost:!1,uid:"",status:"idle",players:[],playerCount:0,readyCount:0,everyoneReady:!1,myReady:!1,myRank:0,myRankText:"",leaderName:"",leaderScore:0,scoreDelta:0,scoreDeltaText:"",opponentText:"",opponentScores:"",hostName:"",hostUid:"",songName:"",lastError:"",joinCodeInput:"",countdownText:"",countdownActive:!1,keyboardOpen:!1,nameKeyboardOpen:!1,nameInput:"",row0Name:"",row0Score:"",row0Visible:!1,row0IsMe:!1,row0IsHost:!1,row0Ready:!1,row1Name:"",row1Score:"",row1Visible:!1,row1IsMe:!1,row1IsHost:!1,row1Ready:!1,row2Name:"",row2Score:"",row2Visible:!1,row2IsMe:!1,row2IsHost:!1,row2Ready:!1,row3Name:"",row3Score:"",row3Visible:!1,row3IsMe:!1,row3IsHost:!1,row3Ready:!1,resultsText:"",resultsScores:"",winnerName:""},menuDifficulties:[],menuDifficultiesIds:[],menuSelectedChallenge:{author:"",difficulty:"",beatmapCharacteristic:"",downloads:"",downloadsText:"",genre:"",id:"",index:-1,image:"",isFavorited:!1,numBeats:void 0,songDuration:0,songInfoText:"",songLength:void 0,numBeats:void 0,songName:"",songSubName:"",version:"",metadata:{}},optionsMenuOpen:!1,playlist:"",playlists:n(200),playlistMenuOpen:!1,playlistTitle:"",score:{accuracy:100,accuracyScore:0,accuracyInt:100,activePanel:!1,beatsHit:0,beatsMissed:0,beatsText:"",combo:0,finalAccuracy:100,maxCombo:0,rank:"",score:0},search:{activePanel:!0,page:0,hasError:!1,hasNext:!1,hasPrev:!1,query:"",queryText:"",results:[],songNameTexts:"",songSubNameTexts:"",url:"",urlPage:0},searchResultsPage:[],speed:10},handlers:{activehandswap:e=>{e.activeHand="right"===e.activeHand?"left":"right",localStorage.setItem("activeHand",e.activeHand)},beathit:(e,t)=>{e.damage>.25&&(e.damage-=.25),e.score.beatsHit++,e.score.combo++,e.score.combo>e.score.maxCombo&&(e.score.maxCombo=e.score.combo),t.score=isNaN(t.score)?100:t.score,e.score.accuracyScore+=t.percent,e.score.score+=Math.floor(t.score),T(e)},beatmiss:e=>{e.score.beatsMissed++,_(e),T(e)},beatwrong:e=>{e.score.beatsMissed++,_(e),T(e)},beatloaderpreloadfinish:e=>{e.menuActive||(e.challenge.isBeatsPreloaded=!0)},colorschemechange:(e,t)=>{e.colorScheme=t,e.colorPrimary=o.a.schemes[t].primary,e.colorSecondary=o.a.schemes[t].secondary,e.colorSecondaryBright=o.a.schemes[t].secondarybright,e.colorTertiary=o.a.schemes[t].tertiary,localStorage.setItem("colorScheme",t)},controllerconnected:(e,t)=>{e.controllerType=t.name,e.has6DOFVR=-1!==["oculus-quest-controls","oculus-touch-controls","vive-controls","windows-motion-controls","generic-tracked-controller-controls"].indexOf(e.controllerType),e.has3DOFVR=-1!==["oculus-go-controls","daydream-controls"].indexOf(e.controllerType)},debugbeatpositioning:e=>{e.gameMode="classic",e.introActive=!1,e.menuActive=!1},debuggameplay:e=>{w(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.menuSelectedChallenge.id="",e.isSearching=!1,e.isLoading=!1},debuggameover:e=>{e.isGameOver=!0,e.menuActive=!1},debugloading:e=>{h.id="-1",Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.menuActive=!1,e.isSongProcessing=!0},debugvictory:e=>{Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.isVictory=!0,e.leaderboardQualified=!0,e.menuActive=!1,e.score.accuracy=74.99,e.score.beatsHit=125,e.score.beatsMissed=125,e.score.maxCombo=123,e.score.rank="A",e.score.score=9001,e.introActive=!1,A(e)},difficultyfilter:(e,t)=>{e.difficultyFilter=t,e.difficultyFilterMenuOpen=!1,e.menuSelectedChallenge.id=""},difficultyfiltermenuclose:e=>{e.difficultyFilterMenuOpen=!1},difficultyfiltermenuopen:e=>{e.difficultyFilterMenuOpen=!0},displayconnected:e=>{if(e.hasVR=!0,!c)try{"getVRDisplays"in navigator&&navigator.getVRDisplays().then(e=>{e.length&&(c=!0)})}catch(e){}},favoritetoggle:e=>{const t=e.menuSelectedChallenge.id,n=s[t];if(n)if(e.menuSelectedChallenge.isFavorited){e.menuSelectedChallenge.isFavorited=!1;for(let n=0;n<e.favorites.length;n++)if(e.favorites[n].id===t)return e.favorites.splice(n,1),void localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}else{if(e.menuSelectedChallenge.isFavorited=!0,e.favorites.filter(e=>e.id===t).length)return;e.favorites.push(n),localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}},gamemenuresume:e=>{e.isPaused=!1},gamemenurestart:e=>{w(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isLoading=!0,e.isVictory=!1,e.leaderboardQualified=!1},gamemenuexit:e=>{w(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isVictory=!1,e.menuActive=!0,e.menuSelectedChallenge.id=e.challenge.id,e.menuSelectedChallenge.difficulty=e.challenge.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=e.challenge.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=e.challenge.difficultyId,e.challenge.id="",e.leaderboardQualified=!1,e.multiplayer.active&&(e.multiplayer.lobbyOpen=!0)},gamemode:(e,t)=>{e.gameMode=t},genreclear:e=>{e.genre="",e.menuSelectedChallenge.id=""},genreselect:(e,t)=>{e.genre=t,e.genreMenuOpen=!1,e.menuSelectedChallenge.id="",e.playlist="",e.search.query=""},genremenuclose:e=>{e.genreMenuOpen=!1},genremenuopen:e=>{e.genreMenuOpen=!0},keyboardclose:e=>{e.isSearching=!1},keyboardopen:e=>{e.isSearching=!0,e.menuSelectedChallenge.id=""},leaderboard:(e,t)=>{e.leaderboard.length=0,e.leaderboardFetched=!0,e.leaderboardNames="",e.leaderboardScores="";for(let n=0;n<t.scores.length;n++){let r=t.scores[n];e.leaderboard.push(r),e.leaderboardNames+=`#${n+1} ${g(r.username,18)} (${Math.round(r.accuracy||0)}%)\n`,e.leaderboardScores+=r.score+"\n"}e.leaderboardLoading=!1},leaderboardqualify:e=>{e.has6DOFVR&&(e.leaderboardQualified=!0)},leaderboardscoreadded:(e,t)=>{for(let n=0;n<e.leaderboard.length;n++)if(t.scoreData.score>=e.leaderboard[n].score||n>=e.leaderboard.length-1){e.leaderboard.splice(n,0,t.scoreData);break}e.leaderboardNames="",e.leaderboardScores="";for(let t=0;t<e.leaderboard.length;t++){let n=e.leaderboard[t];e.leaderboardNames+=`${n.username} (${n.accuracy||0}%)\n`,e.leaderboardScores+=n.score+"\n"}},leaderboardsubmit:e=>{e.leaderboardQualified=!1},menuback:e=>{e.difficultyFilterMenuOpen=!1,e.genreMenuOpen=!1,e.isSearching=!1,e.optionsMenuOpen=!1,e.playlistMenuOpen=!1},menuchallengeselect:(e,t)=>{let n=s[t];if(!n)return;Object.assign(e.menuSelectedChallenge,n),e.menuSelectedChallenge.songName=g(n.metadata.songName,24),e.menuDifficulties.length=0,e.menuDifficultiesIds.length=0;const r=JSON.parse(n.metadata.characteristics);for(const t of Object.keys(r))if(!["90Degree","360Degree"].includes(t))for(const n of Object.keys(r[t])){if(null===r[t][n])continue;let i=l[n],o=i;"Standard"!==t&&(o=t+"\n"+o),e.menuDifficulties.unshift({id:t+"-"+n,filename:n+t,difficultyName:i,renderName:o,beatmapCharacteristic:t,difficulty:n})}e.menuDifficulties.sort(b);for(const t of e.menuDifficulties)e.menuDifficultiesIds.push(t.id);const i=e.menuDifficulties[0];e.menuSelectedChallenge.difficulty=i.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=i.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=i.id,e.menuSelectedChallenge.image=e.menuSelectedChallenge.coverURL,S(e,n),e.challenge.audio="",E(e),e.isSearching=!1;const o=!!e.favorites.filter(e=>e.id===t).length;e.menuSelectedChallenge.isFavorited=o,x(e),e.leaderboardLoading=!0,e.hasSongLoadError=!1,u[t]&&(e.hasSongLoadError=!0)},menuchallengeunselect:e=>{e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficultyId="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",x(e)},menudifficultyselect:(e,t)=>{let n;for(const r of e.menuDifficulties)if(r.id===t){n=r;break}e.menuSelectedChallenge.difficultyId=t,e.menuSelectedChallenge.difficulty=n.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=n.beatmapCharacteristic,S(e,e.menuSelectedChallenge),x(e),e.leaderboardLoading=!0},menuopeningend:e=>{e.isMenuOpening=!1},minehit:e=>{_(e)},optionsmenuopen:e=>{e.optionsMenuOpen=!0},mpopen:e=>{e.multiplayer.lobbyOpen=!0,e.multiplayer.active=!0,e.multiplayer.status="idle",e.multiplayer.lastError="","ride"===e.gameMode&&(e.gameMode="classic")},mpclose:e=>{e.multiplayer.lobbyOpen=!1,e.multiplayer.active=!1,e.multiplayer.status="idle"},mpcodeinput:(e,t)=>{const n="string"==typeof t?t:t&&t.value||"";e.multiplayer.joinCodeInput=n.toUpperCase().slice(0,4)},mpnameinput:(e,t)=>{const n="string"==typeof t?t:t&&t.value||"";e.multiplayer.nameInput=n.slice(0,14)},mpkeyboardopen:e=>{e.multiplayer.keyboardOpen=!0},mpkeyboardclose:e=>{e.multiplayer.keyboardOpen=!1},mpnamekeyboardopen:e=>{e.multiplayer.nameKeyboardOpen=!0,e.multiplayer.nameInput=localStorage.getItem("threewsusername")||""},mpnamekeyboardclose:e=>{e.multiplayer.nameKeyboardOpen=!1},mpconnecting:e=>{e.multiplayer.status="connecting",e.multiplayer.lastError=""},mproomjoined:(e,t)=>{e.multiplayer.roomCode=t.code,e.multiplayer.isHost=!!t.isHost,e.multiplayer.status="lobby",e.multiplayer.lobbyOpen=!0,e.multiplayer.active=!0},mproomleft:e=>{e.multiplayer.roomCode="",e.multiplayer.isHost=!1,e.multiplayer.status="idle",e.multiplayer.players.length=0,e.multiplayer.players.__dirty=!0,e.multiplayer.playerCount=0,e.multiplayer.readyCount=0,e.multiplayer.everyoneReady=!1,e.multiplayer.opponentText="",e.multiplayer.opponentScores=""},mperror:(e,t)=>{e.multiplayer.lastError=t&&t.message||"Error","connecting"===e.multiplayer.status&&(e.multiplayer.status="idle")},mproomupdate:(e,t)=>{e.multiplayer.uid=t.uid,e.multiplayer.isHost=!!t.isHost,e.multiplayer.hostUid=t.hostUid||"",e.multiplayer.status=t.status||e.multiplayer.status,e.multiplayer.songName=t.song&&t.song.songName||"",e.multiplayer.players.length=0,e.multiplayer.players.__dirty=!0;const n=t.players.slice(),r=n.slice().sort((e,t)=>(0|t.score)-(0|e.score)),i={};r.forEach((e,t)=>{i[e.uid]=t+1});let a=0,s=!1,c=0,l=r[0]||null,u="",h="",d="",p="",f="";for(let r=0;r<n.length;r++){const i=n[r];e.multiplayer.players.push(i),i.ready&&a++,i.uid===t.uid&&(s=!!i.ready),i.uid===t.hostUid&&(u=i.name)}c=i[t.uid]||0;for(let e=0;e<r.length;e++){const n=r[e],i=Math.round(n.accuracy||0)+"%",o=n.uid===t.uid?" (YOU)":"",a=n.finished?" ✓":"";n.uid!==t.uid&&(h+=`#${e+1} ${g(n.name,12)} ${i}${a}\n`,d+=(0|n.score)+"\n"),p+=`#${e+1} ${g(n.name,14)}${o} ${i}\n`,f+=(0|n.score)+"\n"}for(let r=0;r<4;r++){const i=n[r],a="row"+r;if(!i){e.multiplayer[a+"Name"]="",e.multiplayer[a+"Score"]="",e.multiplayer[a+"Visible"]=!1,e.multiplayer[a+"IsMe"]=!1,e.multiplayer[a+"IsHost"]=!1,e.multiplayer[a+"Ready"]=!1,e.multiplayer[a+"NameColor"]="#ffffff",e.multiplayer[a+"ScoreColor"]="#ffffff",e.multiplayer[a+"BgOpacity"]=0;continue}const s=i.uid===t.uid,c=i.uid===t.hostUid,l=(c?"★ ":"")+g(i.name,14)+(s?" (YOU)":""),u="lobby"===e.multiplayer.status?i.ready?"READY":"...":(0|i.score)+" "+Math.round(i.accuracy||0)+"%"+(i.finished?" ✓":"");e.multiplayer[a+"Name"]=l,e.multiplayer[a+"Score"]=u,e.multiplayer[a+"Visible"]=!0,e.multiplayer[a+"IsMe"]=s,e.multiplayer[a+"IsHost"]=c,e.multiplayer[a+"Ready"]=!!i.ready,e.multiplayer[a+"NameColor"]=s?o.a.schemes[e.colorScheme].secondarybright:"#ffffff",e.multiplayer[a+"ScoreColor"]=i.ready?"#5dff80":"#ffffff",e.multiplayer[a+"BgOpacity"]=s?.18:.06}e.multiplayer.playerCount=n.length,e.multiplayer.readyCount=a,e.multiplayer.everyoneReady=n.length>=2&&a===n.length,e.multiplayer.myReady=s,e.multiplayer.myRank=c,e.multiplayer.myRankText=c?"#"+c+" / "+n.length:"",e.multiplayer.leaderName=l?l.name:"",e.multiplayer.leaderScore=l?0|l.score:0;const m=n.find(e=>e.uid===t.uid),y=(m?0|m.score:0)-(l?0|l.score:0);e.multiplayer.scoreDelta=y,e.multiplayer.scoreDeltaText=l&&l.uid!==t.uid?(y>=0?"+"+y:String(y))+" vs leader":l&&l.uid===t.uid&&n.length>1?"LEADING":"",e.multiplayer.opponentText=h,e.multiplayer.opponentScores=d,e.multiplayer.resultsText=p,e.multiplayer.resultsScores=f,e.multiplayer.winnerName=r.length&&r[0].score>0?r[0].name:"",e.multiplayer.hostName=u},mpcountdown:(e,t)=>{e.multiplayer.countdownText=t&&t.value||"",e.multiplayer.countdownActive=!(!t||!t.active)},mpsharelinkcopied:e=>{e.multiplayer.shareCopied=!0},mpsharelinkcleared:e=>{e.multiplayer.shareCopied=!1},mpremotesongselect:(e,t)=>{Object.assign(e.menuSelectedChallenge,{id:t.id,difficulty:t.difficulty,beatmapCharacteristic:t.beatmapCharacteristic,difficultyId:t.difficultyId,songName:t.songName,songSubName:t.songSubName,image:t.image,version:t.version,directDownload:t.directDownload,downloads:t.downloads,downloadsText:t.downloadsText,songDuration:t.songDuration,metadata:t.metadata||{}}),s[t.id]=e.menuSelectedChallenge},mpremoteplaystart:e=>{e.menuSelectedChallenge.id&&(w(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.multiplayer.lobbyOpen=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...")},pausegame:e=>{e.isPlaying&&(e.isPaused=!0)},playbuttonclick:e=>{if(""===e.menuSelectedChallenge.id)return;if(u[e.menuSelectedChallenge.id])return;let t="frontpage";e.playlist&&(t="playlist"),e.search.query&&(t="search"),e.genre&&(t="genre"),gtag("event","songsource",{event_label:t}),w(e),Object.assign(e.challenge,e.menuSelectedChallenge),gtag("event","difficulty",{event_label:e.challenge.difficulty}),e.menuActive=!1,e.multiplayer.lobbyOpen=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...",gtag("event","colorscheme",{event_label:e.colorScheme})},playlistclear:(e,t)=>{e.menuSelectedChallenge.id="",e.playlist=""},playlistselect:(e,t)=>{e.genre="",e.menuSelectedChallenge.id="",e.playlist=t.id,e.playlistTitle=t.title,e.playlistMenuOpen=!1,e.search.query=""},playlistmenuclose:e=>{e.playlistMenuOpen=!1},playlistmenuopen:e=>{e.playlistMenuOpen=!0},searcherror:(e,t)=>{e.search.hasError=!0},searchprevpage:e=>{0!==e.search.page&&(e.search.page--,m(e))},searchnextpage:e=>{e.search.page>Math.floor(e.search.results.length/6)||(e.search.page++,m(e),void 0!==e.search.url&&e.search.page+3>Math.floor(e.search.results.length/6)&&(e.search.urlPage=e.search.urlPage+1,fetch(e.search.url.replaceAll("CURRENT_PAGE_INDEX",e.search.urlPage)).then(e=>e.json()).then(t=>{var n=(t.docs||t.maps).map(a);for(e.search.results.push(...n),i=0;i<n.length;i++){let e=n[i];s[e.id]=e}})))},searchresults:(e,t)=>{var n;for(e.search.hasError=!1,e.search.page=0,e.search.url=t.url,e.search.urlPage=t.urlPage,e.search.query=t.query,e.search.queryText=g(t.query,10),e.search.results=t.results||[],n=0;n<e.search.results.length;n++){let t=e.search.results[n];s[t.id]=t}m(e),e.menuSelectedChallenge.id="",e.isSearching&&(e.genre="",e.playlist="")},songcomplete:e=>{if(gtag("event","songcomplete",{event_label:e.gameMode}),"ride"===e.gameMode||!e.inVR)return e.challenge.isBeatsPreloaded=!1,e.isVictory=!1,e.menuActive=!0,void(e.challenge.id="");e.isVictory=!0,e.score.score=isNaN(e.score.score)?0:e.score.score,T(e),e.score.finalAccuracy=e.score.accuracy;const t=parseFloat(e.score.accuracy);e.score.rank=t>=97?"S":t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F",A(e)},songloadcancel:e=>{e.challenge.isBeatsPreloaded=!1,e.challenge.audio="",e.challenge.id="",e.challenge.version="",e.isZipFetching=!1,e.isLoading=!1,e.isSongProcessing=!1,e.menuActive=!0},songloaderror:e=>{u[e.menuSelectedChallenge.id||e.challenge.id]=!0,e.hasSongLoadError=!0,e.loadingText="Sorry! There was an error loading this song.\nPlease select another song.",e.challenge.id="",e.challenge.isBeatsPreloaded=!1,e.isSongProcessing=!1,e.isZipFetching=!1},songprocessfinish:e=>{e.isSongProcessing=!1,e.isLoading=!1},songprocessstart:e=>{e.isSongProcessing=!0,e.loadingText="Wrapping up..."},"enter-vr":e=>{e.inVR=AFRAME.utils.device.checkHeadsetConnected(),AFRAME.utils.device.isMobile()||(gtag("event","entervr",{}),AFRAME.utils.device.isOculusBrowser()&>ag("event","oculusbrowser",{}))},"exit-vr":e=>{e.inVR=!1,e.isPlaying&&(e.isPaused=!0)},startgame:e=>{e.introActive=!1,e.menuActive=!0},victoryfake:e=>{e.score.accuracy="74.99",e.score.rank="C"},wallhitstart:e=>{_(e)},ziploaderend:(e,t)=>{e.challenge.audio=t.audio,e.hasSongLoadError=!1,e.menuSelectedChallenge.version="",e.isZipFetching=!1},ziploaderstart:e=>{e.challenge.isBeatsPreloaded=!1,e.isZipFetching=!0}},computeState:e=>{e.isPlaying=!(e.menuActive||e.isLoading||e.isPaused||e.isVictory||e.isGameOver||e.isZipFetching||e.isSongProcessing||!e.challenge.id||e.introActive);const t=e.menuActive||e.isPaused||e.isVictory||e.isGameOver||e.isLoading||e.introActive;e.leftRaycasterActive=t&&"left"===e.activeHand&&e.inVR,e.rightRaycasterActive=t&&"right"===e.activeHand&&e.inVR,e.mainMenuActive=e.menuActive&&!e.genreMenuOpen&&!e.difficultyFilterMenuOpen&&!e.playlistMenuOpen&&!e.optionsMenuOpen&&!e.isSearching,e.score.active="ride"!==e.gameMode&&e.inVR&&(e.isPlaying||e.isPaused),e.mpActive=!!e.multiplayer.active,e.mpCanStart=!e.multiplayer.active||e.multiplayer.isHost&&e.multiplayer.players.length>=2,e.mpHostControl=!e.multiplayer.active||e.multiplayer.isHost,e.mpLobbyVisible=e.multiplayer.lobbyOpen&&e.menuActive&&!e.isMenuOpening,e.mpHudVisible=e.multiplayer.active&&e.multiplayer.players.length>1&&(e.isPlaying||e.isPaused||e.isLoading),e.mpResultsVisible=e.multiplayer.active&&e.isVictory&&e.multiplayer.players.length>1,e.mpInRoom=!!e.multiplayer.roomCode,e.mpInLobbyPhase=e.mpInRoom&&"lobby"===e.multiplayer.status,e.mpCountdownVisible=e.multiplayer.countdownActive,e.mpKeyboardOpen=e.multiplayer.keyboardOpen,e.mpNameKeyboardOpen=e.multiplayer.nameKeyboardOpen,e.mpRoomCodeText=e.multiplayer.roomCode?"ROOM "+e.multiplayer.roomCode:"",e.mpShareButtonText=e.multiplayer.shareCopied?"LINK COPIED":"COPY SHARE LINK",e.mpShareButtonColor=e.multiplayer.shareCopied?"#5dff80":"#FFFFFF",e.mpReadyButtonText=e.multiplayer.myReady?"UNREADY":"READY",e.mpReadyButtonColor=e.multiplayer.myReady?"#5dff80":"#FFFFFF",e.mpReadyButtonBrightness=e.multiplayer.myReady?.5:.2,e.mpJoinButtonText=e.multiplayer.joinCodeInput?"JOIN "+e.multiplayer.joinCodeInput:"JOIN ROOM",e.mpRankHudText=e.multiplayer.myRankText?"RANK "+e.multiplayer.myRankText:"",e.mpDeltaColor=e.multiplayer.scoreDelta>=0?"#5dff80":"#ff8080",e.mpStatusText=e.multiplayer.lastError?e.multiplayer.lastError:"connecting"===e.multiplayer.status?"Connecting...":"idle"===e.multiplayer.status?"Create a room or paste a code.":"finished"===e.multiplayer.status?"Round over.":e.multiplayer.players.length<2?e.multiplayer.isHost?"Share the room code below — waiting for a friend.":"Waiting for another player...":e.multiplayer.isHost?e.multiplayer.songName?'Press PLAY to start "'+e.multiplayer.songName+'".':"Pick a song from the menu, then press PLAY.":e.multiplayer.songName?'Host queued "'+e.multiplayer.songName+'". Get ready.':"Waiting for host to pick a song...",e.mpWinnerBanner=e.multiplayer.winnerName?e.multiplayer.winnerName===(e.multiplayer.players.find(t=>t.uid===e.multiplayer.uid)||{}).name?"YOU WON!":e.multiplayer.winnerName.toUpperCase()+" WINS":""}});const y=["easy","normal","hard","expert","expertPlus"],v=["Standard"];function b(e,t){const n=y.indexOf(e.difficulty),r=y.indexOf(t.difficulty);if(n<r)return-1;if(n>r)return 1;const i=v.indexOf(e.beatmapCharacteristic),o=v.indexOf(t.beatmapCharacteristic);return i>o?-1:i<o?1:0}function _(e){e.isPlaying&&e.inVR&&(e.score.combo=0)}function w(e){e.damage=0,e.score.accuracy=100,e.score.accuracyInt=100,e.score.accuracyScore=0,e.score.beatsHit=0,e.score.beatsMissed=0,e.score.finalAccuracy=100,e.score.combo=0,e.score.maxCombo=0,e.score.score=0}function E(e){e.menuSelectedChallenge.index=-1;for(let t=0;t<e.searchResultsPage.length;t++)if(e.searchResultsPage[t].id===e.menuSelectedChallenge.id){e.menuSelectedChallenge.index=t;break}}function A(e){e.score.beatsText=`${e.score.beatsHit} / ${e.score.beatsMissed+e.score.beatsHit} BEATS`}function x(e){e.leaderboard.length=0,e.leaderboard.__dirty=!0,e.leaderboardNames="",e.leaderboardScores="",e.leaderboardFetched=!1}function S(e,t){let n=JSON.parse(t.metadata.characteristics)[e.menuSelectedChallenge.beatmapCharacteristic][e.menuSelectedChallenge.difficulty];e.menuSelectedChallenge.songInfoText=`Mapped by ${g(t.metadata.levelAuthorName,55)}\n${t.genre&&"Uncategorized"!==t.genre?t.genre+"\n":""}${function(e){e/=60;const t=""+Math.floor(e);var n=Math.round(60*(e-t));return n<10&&(n="0"+n),`${t}:${n}`}(t.metadata.duration)} / ${n.notes} notes\n${n.bombs} bombs | ${n.obstacles} obstacles\nNJS: ${n.njs}`}function T(e){const t=e.score.beatsHit+e.score.beatsMissed;e.score.accuracy=e.score.accuracyScore/(100*t)*100,e.score.accuracy=isNaN(e.score.accuracy)?100:e.score.accuracy,e.score.accuracy=e.score.accuracy.toFixed(2),e.score.accuracyInt=parseInt(e.score.accuracy)}},function(e,t){e.exports=[{name:"Pop",row:1,column:1},{name:"R&B",row:1,column:2},{name:"Rap",row:1,column:3},{name:"Rock",row:1,column:4},{name:"Soundtrack",row:1,column:5},{name:"Video Games",row:1,column:6},{name:"Electronic",row:2,column:1},{name:"Hip Hop",row:2,column:2},{name:"House",row:2,column:3},{name:"J-Pop",row:2,column:4},{name:"K-Pop",row:2,column:5},{name:"Meme",row:2,column:6},{name:"Alternative",row:3,column:1},{name:"Anime",row:3,column:2},{name:"Comedy",row:3,column:3},{name:"Dubstep",row:3,column:5},{name:"Dance",row:3,column:6}]},function(e,t){e.exports=[{name:"favorites",author:"You!",title:"Your Saved Favorites"},{name:"3966",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 1"},{name:"3967",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 2"},{name:"3968",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 3"},{name:"4134",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 4"},{name:"4135",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 5"},{name:"7483",author:"BeastSaber",title:"Maps Of The Weeks"},{name:"4137",author:"BeastSaber",title:"Curator's Picks of 2020"},{name:"4139",author:"BeastSaber",title:"Curator's Picks of 2021"},{name:"11584",author:"BeastSaber",title:"Curator's Picks of 2022"},{name:"4405",author:"BeastSaber",title:"Intro to Dance"},{name:"4138",author:"BeastSaber",title:"Mom's Maps"}]},function(e,t,n){var r=n(21);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0},o=n(206)(r,i);r.locals&&(e.exports=r.locals),e.hot.accept(21,(function(){var t=n(21);if("string"==typeof t&&(t=[[e.i,t,""]]),!function(e,t){var n,r=0;for(n in e){if(!t||e[n]!==t[n])return!1;r++}for(n in t)r--;return 0===r}(r.locals,t.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");o(t)})),e.hot.dispose((function(){o()}))},function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(o).concat([i]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU0AAAGDCAMAAACYzLIyAAACWFBMVEUAAAAAkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8BkP8AkP8AkP8AkP8AkP8Bkf8AkP8AkP8Dkf8BkP8BkP8Bkf8Vj/y44P8Rl///drb/drZx/+n/drZx/+n/drb/drZx/+n/drf/drZw/+pu/upx/+n/drdx/+lWtv//drb/drbL6f9w/+r+drdx/+n/drZw/+pu/utx/+ll9exMsv9x/+lx/+lw/+r/drb/drb/drb8drf+drdx/+nh8v9q+uzR7P9w/+phu//e8f8wpf9s++qJzP8Ek/9w/urZ7v9v/url9P9x/+n9drf/drb9drdDrv9x/+l2w/9uwf9u/eps++px/+mt3P//drY7qv//drZ7xv/2d7ml2P9x/+knov9x/+m+4//W7f+03/9I1/H8drf/drYru/iZ0/+AyP/B5P//drZx/+kXp/tpvv/t9/86yvX/draU0P8gnv/+drbp9v//drZ+g9xx/+mSgdZK2fHF5v9x/+nWe8Py+f8Xp/uQz///drYbnP/3/P+f1f9x/+kVpfsxwPZO3vD/drbfecArjPMwi/IktPncesBx/+lV5e9Wh+dx/+khjfY9iu5+g9ucgNMajvhx/+mDyf8Kmv6+fcmOgte4fcr/dra5fcpGiexOiOkpjPSwfs1J2PEVpfuIgtkpufcouPj/drb/drbteLzSe8MPoPyof89KiesPoPzreLxghuQ8y/Rx/+n/drZx/+kktPnGfMc9zfNLierleb64fctd7O3oeL1x/+n/drZb6vj/////drZx/+lv/exr+vEkKZq9AAAAw3RSTlMAeUKEWG9nmlCMKho2YJMVCkolDyEwOgbfoXqEZ5R3Zm6EN0xPI4xUk7iNROZEH1qcLjacCbRgbT8qYFoVP3zxFepKvO+rD8ygVu0p83EPdTCxOsPCHRng2uCuJcUK1+2poeHt3Q8Zox7Rx+LvmEC+9xazz6cG9cVD8g8i5Lkm+SvN6qX806lINy+sQGRXLzfASDW0XEwhFWf4yFIvLBrmIVRDQjYpYjYlUdjPbF5YThhsU0xJx7rOW1RBKUlCPGTZ+uxEzOy6AABDfElEQVR42uycz05iSRTGZ2zaK9oiyP9HuAlb1oQAoUPYEFkQQowBN8pCEw0rE2NsX6Jfhxeb+nu/W/dUUVywp3smfGaSnhm7+9SvvnOq6lThXwcddNBBBx100EEHHXTQ/1dVKfYL8XXQrhzzxQuiIlNeijP+jxGuCnPkDUUDqv6ykeQ5ybOzUulSqyR1FgmAdSx/INiqAKix6YjPrJJD+fQQFMnL09NyufxNqqx0GiliDLgg+1vQgmAE0MRXUu44NYQB8bF8LtFqUZP8VqkcWVThijOO2CbJ/mto4UAABD/g4+bQqiQkhsMHAqKfgPKCoWQkBcjCSUKFk4JUgm/E9jSG1qwIn12cYEAHQM0P8IygC1psUBgRGwmI7ssSKDnITOac6ZjpHMpEigE2nAuyFtcCraa7HV+sHrQAugEa9LQ3Mg6J0YDonjzzjGWEMsMxfhX6+++vho6FANlgywSyEVomghZ0FWGIAVO64F8GO1IACUAnPxkuj/vYKjEWEAXP3YzJWLI/SaJkFJm+GPob+sq/TLwgC7RGPTAKAuhiMaMqSV1KRb+tDH4OgOAHdCpcETuEEYmhRETBc0djMpYFFgdHyUFms9lcXFmIMJZsCVmgBVvDtsZiRlVWwuIBfFsANPCZ3sgmpIcSEd2DZ14Yk7EEylwQBL3mw9Ws359djR86YXM07U0DCIQB17CtURAIWs6WqgIdWSUWDvBzAxQy6eWEAof4aMQQROgxnvnUMIUxOUvlyiBo9petNdGP18dht92YT67v+vdXnXA01YAJWiSQja1WcsNwor/ELyOBHfh5AFJ+YdgZz/pvd9eT2/lLo90edFut1nA47C4aL/Pr/jj8HkREwbN0VkwFs8hgCmMKliyGYPrWXm+r4YDB/XibPYSjUcy2IGthaxR/LY4pjkyvG2AHfG6AhN99/25yu2wPho/+odz+7Eii4MntWaymgMlLpjImz/Bev7HeUY+tdqPGbHvVaY6QQVwGW7qUQQliICe+gM/lwGYzHN+/fUzmjUWL8vNr+PHQ+R7nWUG2bwXz8rRypIzJWALlfnplpl3eCrRhs0nQgi0IQxQb4AFfDOCMObD20u6uPiP04Rg8GU6S7X6Yyphg+bladdsvtclHfzYGWuAVhDlkUzmgM1aPUZNnMCuAt0s48FM1fNA8o2zfEmZZw2T18tfApAWB1/1btpS9sbVszLwLwoZGTE2ObvazLxYPRq+LAvgrNZT5/lVm+3Y48wZMsPwN+vHjx+vr4+NqOGQL7Wr1+Mr+w/p3ahh+z3Gc5wpnfput0R8C80/UkONkPAXO0kV1i32mhvm9vT4oifM9kNl+wmonct0HMxs8d9cHEa1Ytiuc5c2ls3pxBpi91fogm1oC53nGVzqLZ0jz6ev6oA04UTqd1iyVjwqqZrbWNrUn/auHsPNwxTYoT3yHUls2xBHt/yDWcli1uNarVw/OLErnZmueu1fzWg+ba7P1Uq8/T5v8BMwPcN3/Ro1gh94XdjITx4dp771eNwc07Uxart8aBqJ0FljpdJkzr6zpgFmb1gO2eyXCOYVLx9JrdmZ9djJZDNd/kIaLxu31089xOOpJeOgjUuXYOJpPbetEPMvSCXPSPNfWzFpgtkOGMiu6p0rOIzTYRrYNx/2732Ta4YB3XRjA6bMGCHwwh7UlIIi+12y5HjCcMKcrz4U1e9SYQU6ijPpl7BfiS+grRWwYN27aUXjF+xGNwWe7FhksHHjPAN5ogOBH6dF+1Vc5IEk0F9RrNpzZjeZUeQ5rmjC/SJQZ0qxFt5b0u0GWoIVr75+ub18Wrdfd6Q15/4QXwAfJzwswjo7bQinZSD0Wtw4Onh2rOZHol3oJCtemur1AHU8zJwV6k8CVQAy2IOtGq9m+30ybohn+9DFhu4X5fPnSYA3xxaDb7Q4W7XajsZzXbieT6+uPJ7Z2dFj1Y/A0PSQwADr4GfBOINyoF+RY2BgUT4KzazcnEr1yZF2CGu+ydSJRiiuwb5C+sqnYr7koWTda9Cm9QlsU+NwGpHfT9HJafknJwaiLb9XlfU4m7BjmtCY6r5o0zxeBPugLlOJ69hI3sNY7WMAFWQPtOWELup57RAjswM8LMIaPacMVaZmNhAMVPGFPak4ciMhe80s2uQRNoybUtzJ/QnIBmdfcArKMQs0sMgimpWhhW+D1Ceho/aP3zLjahCEZSAEw+dwPAxJjETyVPecmmCtpzool1bHX7CcXoKzKct6+vyjK+6UqF148crE3NppkQQGLl3f9CsXz8MLcLVCp/2l7uhOvfjCgiAZFJ/EkBgYpSmE88lkg56nsmavbzMmaH6WLPFmDsNckq7lq3pcuJEoqwZKhlCRF2IbdzFcoRj2AcSBjccWX+Hfr2gF8yGAzGi4Y2QimzHgWi/bHv5KntGc2meth7otahxKVM88TXVhzav6Outj08yzHPZ2dpQw+o98rJRMTr1AK3BRlvBcCWgEXKjDKkGIGgR593kSjcQdzBJ7WoTEyah+ewPkUSKN9wyYJK3pBrEEvNM/FysX+PjvMvGSp39jI90rJJUStGGIQaginqLVKxpuYCv8i4v9Vy3yNiwJIohHh2IMRQAVP1/iYPy/Leu9Yp6l+LMyZJ2VTJPqNeZ4Mcho/Si3521T0Inh9Isup7XlPtxP4bkYOQg5BjsB4ZqnpArBLtrfiF0IkGrYc63ACvTnNIRg1uzL3ig634FxjmrPJcep1iNJM7txDmefuw31eZILeSOjYg/ro6mPeja7EXhe1p3GvLonqIUSOqEaVH5sFn+KvEvHo3xVNr9OftFuizfa6arGuYgfBsGgUz1OnPc8uxZmbmPNHL1qHyCLEvz14MqtmlOf2mpmXVtDRf5Ek+8u1VbUZH4QaAhyRtzxz9anKREdti6Z3X9sQDAOqeSIYV6uSmnPG1yFdOOkiFMwTVXNjnhfNt188+CaJnbRIxRDgCEzUjkKapI2m1mRANU+9bdncq2yaW07QtC5Cg3VMPVE1keckfLz9QnPAp8aMDQGOwAj2EdIE0TxvE03tWfNkwSDbaa4rc9ZdNL2LUJtZU31z3hk+Tl5+lvA8HOEawY5PJNNHUxP+lME4s73IzUnP3eONNM1j5SRQ5/pS0Rm+sgKJ3uPPEI7ACPaGWUgbDXiqYFylpxiVwpqdprGkX6olvbOOqc8THVXTHj5aAqk0H0lHYAT7w6QNilTJgmxHMHRhud7oTZwrjxnNWaIhKtZ/kLeHnwuaL+vUqt0EOTKCPWAiTULc5aRJFpXtCMakWbFk+gMIEZpoeeAcit2UM3xYIS1PMoI9YaY3Jr1eIMF4aCLT6Xbzbh3TCDS94e8/grPi3jBFxVzuGMxSvCcETgfNtrtu4pWhrSpgp09rMsJ/N2Zrx3qF6rwnzNruwXSnQY7iTE8TNXayjulZ0yyS3dd+4UMvfDnFeeu3wUSuIFX2pmlGU5c0T0HTOBl4w18s5xP+/LfR9Y7gfLfSiTzxRzMctBvLRrs79OMkqeKnWTW/90h879JDE2Y43xh++7o/GsWfpc8WG0eA9PIrfZ50WZ8DD7/Dh/6kuxEnTZV8tLJ8OM5CvhXrVfabjmB6I7Pc4bf7U9314pItMUZ04RpBNs1KlDZPum8MpP5ETXTpHD61UqSKddfjpxkf8CrI4hbJkllZe/jtn7yvYd4oCqQM6NjqiRuSXims6cmTbshQmtGICeZAW06cmNu9aLbigUQ08/bMmtpYdkTw8rrgGFe9fBDcoQvb79lxJUI0gElYGtFwxZ7EdFr2VMHcUpo/vTTRQloZg7TQjD/xHNDor2T0+tpF61x/9JX5c+FML/ghVZ4786Q7FhswFY0Ox3gSc2VZk6aWucVp8Z72NylNFhSP6XUNNUCTtKaM62XwV9Hrz3QX8GRCfixbjGA0sOOEH3bI8zqlMjCikTfr7B/jSYzt1W/3O51bP01fQ24e6O5mPmFNZBbN2Ph7pYq6MFP3h1HnETgtt3nFnfKcnIBWTRKN1JG+zdSn+kdyKiJzSzsZoHm8Hc1b0CTWRGaRo8S5vuPFdaL+cRbRCAb29DpPZ87ihjwf1APVtMwkoynLaDKq4xQ8tzxzi/cGSZr3oOlrb16DJu3ov1uMibdfFf6EAi9R9I9aKWSiptPQ5ustzUmrTkhgKmNyluLFz2UpFgyPRvCUk0uzPUzOLWhe0Z4lpSm/dbSO6U7QROed3DYRGgKmjF7+oCsl9WOA9AhEvRpQP6Q0ZxFVp01hCmOqaEoyGgRzxniiU09xNsjcRjTHW9M05/gtwLcm61SPwMQHEEX0xTz5uUolNQKV7cmtZz0awIWPI606FKY0pj0aRpTzFMmicHrmFv30By9NtN4dRcFXp9po/FZE9FXXzwOqRIa4ed3PnKg6dQtMfPLZGk1V8FSTC5zuuQUiYriMSbMKGzu3pubr46bt013k7Zd1BNoQ2aDpHEBxL2sCZqW8KRoxucDpnlt3+t4RmnQzRS8yUDVlnXqhCzLCBwsLTxgCt81kAIjNraLLmsO6iMb/EyPyfHI5TqSKa279NPOpLjIQvy3Pszr8EsJ3vFrShrBslJ7J9T0VYnZZsxkAJoxpn1zgzAahe25BM5GWH5rmWd57kZEFTSP+uqVoKpg6fJ8hMvI41SUD2HYdQqI8J/M8C5i+WYnjTOb6O+bWSfMaNFNeZCD+0L7xrnj6k8j26Kg/TmTXtqnuTpQuphYwvThlxVg55jZOMztybMnTXWTQ+JHnpEngtZW9dM6kHSreVHcnyhifdgZMD06VKsHMPbc44BiNswloprrIcMc/Jf1AL4mS8AO1ecOwg1MImWwvBtHUAqYXZ9me66McUIFmb3uaczdNxD8m1tR5Xt22kSb9QM15k8WmzOfvii1RwhRTSz8R+WCmOrrlLpq3dpoVAcrsxChMKi4aPzZ3aRu9qnRSa/2EHfxlE4liWvM8Q6bWnyqZc2rOeqzUFX2NIc8l2w/Q3BD/fco+L/xgM+ectFR9ZbNHrCnzHFO71c8sUubsmJmCwpmOJj5CYNLMKJo4L4kyDPWwBPnMQH9KA+oGrS5bls2ZxZqY2rRz+31oHgbBykszzZUl4jd3+AuJHPGnHABSne5xqSwR18ixOd3UwunYcNPCuT/NR3zgwPieOdlwoU6lM+cJUt3RlHGXzVNb2WnmvqS3JrbSODeSTNmJZttO0x1/Ty3CjjrlX5TRfqW3J25hhaU0T1JYk7R9QlvhLO9Fk16n00UI2yNHZvp3SUh1euvspWnrjw2MSp9ubplXsKrTTsVONBdraAiaznPqJMDhJaVIqvuXIXebBvsr91T46zA+4UM7vLvQHNhp+u9FUsePVA+WjuYAke8o3BFlM23ZwR+I4dFj+EV6mkZPpxVPujzaTO4WqF/+l+QdJBeRZ9lE2Uwfjb1wNoAgBU3fwxmnG6apy2b6lz2QZ/qHqcum72Zs8Hk0B3aaNUdephWtHah9oOk7pf/D3pnsphEEYTi77Sw2MUmARxhprpwRYhAR8gUNB4SQZYEvhgOWQD5ZiiySl8jr5MXSK383RdMzwwx2lkoUJ5HiFF9X9VJdXXXhGv4cliG4Z96e7j8uZXeuPtmAJ6PJV7BbT96URzxLxx02iV6aaRIO/VvS7M7Vcty0pN28h7nQbG63lrM8T5b+ZT+nqQrLaGqaM/lP96QZbg+jeeKb3ogctn7/rG0aBpX8XghLzLWDZqHz5vxJzZuRY9703ACnuBf6v6aXMPa+IA3uLH9sR/Vn7DfvitxvejMOfXUo8DDwXz0L3YOmd+zT5Hr48xf/9nM6rMnzBhioHA+q/5AYUidzDKnsiyHRBA73K2lvjpwzvikXvceLbwY5xDcBwB3fJN5A5pY0+Zvu2PvzvyD2LllhdOiuBjTHPpr+3GLnvVD/9C+5F1JD23LcC5F1j1ySQ5Cy5Dg2Oe8sw7zvLE/3ubNcpLuzxHeDozvuLNOcBXGkd5zUCrxPnz/6fbpO9oBv0vt00Iw8cQpytqAngUPlesweI9eDJiLRXA9MLf41k9gxMZQD5SF1HiUPCUlyrjykVHEWegqnCZxwrri4HLn2vjlyrWw5cirXue/KkXNsIqp0B0IrA9D1/6D5m8ep8jd7OeVv0ncZQzgKDR/SgJzzUQbdcP4xucVx1txi+DmtolchgOh+zr3hpFukPybvvfE1W947/VgdPHGhzkuLpHi3SBNMHMnfZDw79JuMVUFvMmp6Dn9XJgsLOXk6JvXIsah53wvhiUvm90JXytGfzHshOYefkYCqJwToYD+E59lv2ULi6+T12KO9ZbtdmdqAJ1XGesvW/k7esmFo3dtNerCk8WJ6GNjZ5aVBXjb631m+PNA7S4wunXI87ywxtHhyTkI02G46o0h0x+V7A4xnq0nfAC9vD/EGWIxuaXuV4M/kDbCj+AANANN3gf5lCBPnGcwBHQscT6o/S56+9+ndQ7xPV2+qNVA8Txfvqd3v01tW8YQybl3cNVL8NHtY13y1E0i1gkPWTggdtRPUe/9zrU5Zl05Qb/1dtRPu7cIeWH+b7iXd39mhg8rFqOuBt6IEp7Oux6fNuh6NA9T10KP75b1WB2U9vqxLmW+r4lM3is6QvaGfJk5qcxK+VMbsqznTXR6d0Joz57rMi6fmTC+3mjPQRo4u1LFKzhzrgkJH7e01ZxAYw2am5VnSaYjL9WTcWw/p1qhA9HGjHhJTv9h6SONt2sjRNQoivTDKIemK0cF3oowZF3NvtH84lnRgQqiePCsmtbpmO2p1vdqo1XVccK2ubQXqump0jWJdZqkuVVuq4ShrB9Okjo7rX3cnMWenDDigXUcuoh/AqtxmNWh8U2QdOVTBsSTi2iigTJQqGiXqntnSNurI2YdYe4kOcEOe9MlMD4tDshqHgf4ETNDekqvvrHE42bPGobt8ZTQ/OjXV4T+Ngot9f41D4uj+aZNeqro3Lv76myOj/uZr8UOXvOzN4eTEGDLW3/SUVo1adQGUiVV+k/n43F9/c1ePjAWmzV3R7NB13ktcG/bnUHVnEqK7NxVTG9Zf9jcK1sVhURo2iBKVUYZpEl9sYdr0VCNwGGeKusU3U6tucS++nORVtzhDSeroIa7rwsVBEC+A0lu3uGQGq/zTJg1xNV0nvlK6mtrN8TXrMjuozrq51tTOWi69ETW/qZLaPpibMxvCAd5pk3a0dG5lc6/3Hq6IMaTHWVS9d3xW130eps3E3VZr5l6QfoDlAXoRoG+Yr3x+e5JZmWab9CKAH5Ibh8CaNqnGpBMwjBPWc7g+GRXV++7MENnSDmTz0wYjC5j2+WBO+6dj2tzVpTogxomZrdAeLgDJIKIv40a/RYYVTIk2+fVwgZ/TGp8BbQKcqnstDIj2FwrCDOq3SX8hxZGDZAjRM3SjFygnC6a5dDua1cnIOmp2wzTh6J5odstzPMje+wrqk95XFebXkuO5arjN5AWRL5wsmJbLlb20QZF6jCxgump2T+3m6Z62jSH1dUyd2fuyQX3Sl02SFBzRM5y32T+G8D+hYfd7wVT0zS5l1gYzpjmy3nNK4M8UrewwTkydsM78egYqknbvdbt9vRY07EbLbm6iWbVBjzv0DESzTscZuvF1vQZVnqU3Tkyd6JdI+1muqkns8ifpZwmSmqPu0v2aCvtbDVW37JYmSrprdprJlEGQG5+OfTgFE37uWoP8xhm4DtNfxOg5e60GHqDVIem1ii72du91dAnRov/GYGp1lbe1YeoMqwmUwQUMOpVKU9cwt5smkuOSGyei8BIn/k9XH+D6Q+hQfir7AEN95lgCJUgyjqRJ96kSNOwGU3SVF0AtbcTwLvuOPsD9JZThTg4vR9d0AyY1TWw2fcZJo6+hjpvBH2iPagWUER1dzoyAVzS+iYdbelTL+y70jTdB6ibd7V7Qn47iVlAftpeqeziYWl3l2TeENmp4OdFVwNSZRHffvn+7iyazy1F9ZSijeyrLT4WG8B8Bk5om1qBsxhliR4Zm4+7+6YLEqj0cXq1qte3905VVHptd7DXHWo8BaDaQwYDu4dcPrTa+o9VVnn9T9KIn/dO1nBJlVFIFPpCYMVwwYZqVpOn9FOdXtBsQ5lne2dv/xNPbn6PEP3oOu75qPVQjb4O/6o3qyC6+M4ByA/2sBmnD2qELVeYcLLV542hF/Rymmcg44euQ5gp7XO5UmmdZ8YTHYg0xVg44Jb+QtVFqnwxuwlTnqTkzUmVnJhsxgUAbqKN0sZVRXfElS0y9Moti/Gubn8M0ExknfN2QyRLeTnnaqwkTsqvRCwY+q5zddN/4cZaY3kNPmqjltwKotUtQComvHyxl3srPAZYvcPE/JKHZi6/kmJ3wpiV0xAawIsuMI60J2TNaW269mVHQYZUcZau6T1yyv1JAbQOFNsfq7lR+OYYy8iPwhA7JEk6OEyr1czz78Bqn8nUnTmO3qJUpVbh9npHzjBacXDBZAuWqE/7aV+7nzEKpgUKbF+Iynf+C4746mFYYSrDEcaqH3b9hmghZlNLetEwcBzHwVCc7EXfEWVvELJjK8oc6VZsosT3tz/ZGiaAUNVChDUIo/IsMm2i9Ncq3YImj/j5+TiPr7Z2nbJjAuY47lhEHYoIwmvY6oMTRKTe572810HOhDoRHn7QFlNYowdJycgrzNX2m6/d1rES087nJE14jI7oI8vIor0CqSWqUjnNfIQYqgdope2zUhYhAqkJps+zNXDDT+DkNRYWOuAsyjrC8KDuEVeqULqz0mCx/OmISec+gGO63wibXVD+JiDRQguUSw0xhws/T4MRKtJvnG+w2pCDGqziuSWIJjzH2BUh1CQOFcnK+hCCQivkHsTw3TLyMynLn377byRMpXAwbYyfXTv47xNY0SeyGCpZqoLVTymFjoQUbD4VSsryCcm6Y8PO0K9HJ0dWFZ46SRFVIF0FexNbWJFOuO41uOL6+XHTieNR5uLkcDMZ3UWKgnCeGWyDlTLVop7Hmn55Lu+8tEyb8PNVKJFOZV66PEI5ULEYiVYJDkB0TqtUTbCwRdUKyyymXdRZOMPox7ibb1CugONhaaZASpDn/ONW7aB+dZIVJrwHdFGbTtiaKeC6ivDqCUxv+JOdGT7fzUzQNh+iAUK8+TZKHMI7JcCMNEl6DzZrTy0+eZ4NJLiWB0yHVUa+mA10QZVC1dqszaCa2yVgltG0G2+1BEkx7wU0CovfTZQ0hUQicxjeVXygvzwgTOBF/7jV2K92t/pi2hiyWqYK8VyzK2+ovqvBJP8lOHcmWRj7tB+ai/Av/qS1KEmU2OkpiorNFa1Ujwy2dphZ0sMFwGKb08mww8fgMT+dYbCrhnPft7uIWifnJUc7ryibpLHcs5JUULG0qrbUXJ8s9Gj/M61eMqZbaVT1eSJv0GCbCuplg0haF8PYipBtroyQr8AtbPq7jU2aP+3pyD7i9aHSb4aRxgbC+1zC1l+P+O53gybG5FrUL4dnt1I3s9M3d4XtLsEtURPWJvx4DaH5yEWjDxAPnPaS8kZLSC3NnaaCUNklOLudacIIBUQEUBpovS2WY8HICM/taJHj2wzxRsq0QUHKSeHh2vg5UnCnRx2uOFXedxnVvfZQHUEyYOqFmLy+na9F7MwOhFeaEsi/MEihlgEJ3O8e714oU8XuRzyk7suPyxzDQICeeDckShgkv3xen8PZ8eXan8HDcd+lQKZIJiSC9kxFVQG0D7UT7swzWLGGYe8GE8nLytHgO9+I56ViTJVBqkkm04kQlUGKg825uLKlh5uTtNs92RgOd/Jj3juzJEiiFTaYYZwEUBprHDNqIN1nmaJjw9g2eWYBOLmNG0rRKaZZAmcFxXAZaj6P0KB8YSsTBOctcDRNK2zw10OG0mUzPcDDSJDVKeDhFmdlA1ftYCXQepUSJPC+whGbF8USCxnA4X4zdakezy2nAQIIkR2lNlvsqXCIGCqBBZxAlIDmIgbJQlpQnVNZEjxjTYLQYXI/vmxN2cptVB5c3i84oriuOJxZJGyUpUbO/gQKoeOHZ6lxHTpDjG0ESKItlSXkCKMLBViIaorwIfIIkUBIPz8tAARRIp4vBOOxG7Ij+7a4RTZqzwWLUCuA12PcWzBI8tQlAZyZ2dBgxXjO2BpL5o6QGCuWeG0iJiKgVnX8Eywwuk3kRtVKrEcm2BCldAiRI5oqSGqgGCt02BhtDDq8xUR6CJXhqlTdSuHhAV4v8g/WIAiSBshjtABTDTUcbXmOGCDjKQ7CkKmuiL9QNoCmKIh74mCQL1bVkAjWRatGXQ5wjAoBA6R/pQoBKoshDE1y50MdnRZOkQKVyQEpGm3jNwVHSo7IOkXGoTL5IeS8FsTWQPJAo5YAUg32M1EMBUpF8FJSUqFQbiWhGkJc82j2k6Cewargx2CrjA6MtSZaePQGpCKYCqhQEeR+JIw3fcaQYbQy4BPlUSFpMKyVLKkyePQWpcCvFaEOewGj/qfKbPTqmAQAAgRgoggH/TiEhePjhbure/tu1rkJuAwAAAAAAAMCwdwariQRBGL6EiLKQQNjVVxC8zlkGFZfQF1kPQWQPiZeNBz0sngSR1ZfI6/hiW2Pb801PMehMxtUFv44QkkvyUfZ4qPrrxo2zUbfIN3JuvRKf6odTPAlx39H/JrgenXT71D/oq3mkV9PCFhAHgt3fco1m0SfamNUGeDhP79zBJD2vwtcDqX5NBPtmL1OzFKAT6Otz+2FqCrabYLSsIQx63H3IEks6jt2mzaL2fG6pQC0Qf2QHEnKR4gubOMoyWtcN+Rb2gFhSfmO3tYRa/0Yo+3LCX7ZA/OkFMXEgmhwvQhajn3WphkWE/SwD3MU4w4JXuZhVVYvavC20deSpCzBboGfP1cYd6BEDjOKz+By1U+myvgU7ZgP3MUm/qMVsrFbQarFrDYMIczxEB3fqAlQCM/2xIMYmgN8r9v8LRvFZrDBrcQ59PKTqkZxjkpPSi1nUeveBdyFgl4cZoG0PITROH/4yBOLPyXLFYU/maJYzis+ChZkaUbbhcFAF5di6VWZRi1vK1sHDDNCGOoEozWMC8RfL8/L+fBi2dUbxWTB8QlyiMhr67AUzicKUSenhrNMMBqPeqAIJw9lmyenUly3AN1C/I3kcf0pglj+2w1QAGGk9BLEVjVIgBondMtWKhLmwlgU2q7nphq1XmUfvv8umlcHICUatbzbbLXrZGyYvd1grhjvtTwvM9teU4ECbkyqD9a0wlHHrdtsY031rLV9/9odubl3FfBSL6GLv0TrcnYp5Frnb9XjWHAwSZYtZ3KIWvK1h8kKZfME98AaWowQqf+/9Xy+Tafh8QpScmXx0xKiKoMkz1GqXBhHK3yu+LGDeDlsNKdsfnUDMWrh0lVoqFzAGPDyov6wKDAJZULTeyqT/Gxt2cmC2M6Km8gfKPRFtWGoW30qKdjrZq20GgVKLWwyD1oY89CUEjqUCG8uwu9iVgBnikxi0XDJtYeKyXBbdcNl42fbHQ9SiV6iKY7DSUCdUYBBE72C5ACdTKrBUzEx85gjiRGacYUoo15mZt6N7fyKPsrU8y4ZSuxj2GAhBpG780d8/PMRelwvwnJhO/pDYR08mLi/AZrNZrebzhTHyoF0s5iv5we5SEMcpqRWEvh//aHQlMq8RQ+wui0dOW0b+PdzdSGH+VKpqWcZxmdXK7+7uxl/2zsI3qiAI4wSHQFIguBxWipQCpRToXaEUKEEqSJEipViRKwR3De7ursHd3f8tZmZ339y92XePu5Ig4SuQd/Ag4cc3M7uzG0ZoBUa7GczGOH1m4eB4jP8iyQmMNEyMU6f/nKaSjZ//KwZOTp0+8wIpZw60TyGeOGzsoi6DF42FBcpSXKE0W5BKW7R/QdByWDEQ9XnFRh+cdfxTZyMx304ObaHFtWy9NG++rKQP7oBxAzfk78gRsOldBzsz2j6UDNVTFPgvVDJ4onaUVJdaep6890zLJPucVR7oTCN7hOoYMWKc3ttn8JRhsDOZOerzH6RRM1NhwM7pcV1GDyV43EcU0vOMlw6y/kMsE/NWRZzLGcCsQV14Wg/JewvNbB3bdhk3bN5vMu2oEdh1AYAlywzACHxeTQGe7WIfCj8QBycKc9rHgg6VxuRJUqYhRl/u/o6bLdu2Fo+cHov9iNQRv9q1HMHkwPkAcLoByPwkPdmvqsHDTcxoMYkz9pxq68hahmmmnIlmLckgVnwZsCYr0bJr5y+dNmvdzIEbE6c3CvsnmAAXKX6+ABmdmgyj5Wqk6klyHjwHW83Jgd5Qxbmc6z9kKMDkCXwuqUNo1lHQXvyOOrn3JKiGP1qaDz69pA81w5dumwirhRkzFqxLhYb4zBFDhgwZMXPQoNTUBTOazZo4cdq0bUuhdgyG7AfwgJ4IYAnwodF1R/eUzqD4OAVVm8eMeY63HGI3Jwd6k6rWEpTKo6lpOiSfcYH4yAa/X7ly5diVY6RLRvtACBa5ohkMVolW9imlZMeZ8UkDRhJ8oXXzxU2lHVoLWeZv08TMO+TRq8vcATuOzWkNdMyaMs5nOoOUCSUdz/IYENcZ7GGlVY4ea2muZFzmShKVzOcc0bOh7GrWX2eICO/JzSdar5R2OtqP2sSqy9NhI8YCN/MwJ2+IxFqzWh13CSoxTSjz37Kj5O0A/PH16+Pnzp27cePqqreg+45W3XfIomsZK5/vuCbj+UmWDqyJJv1RBJP/NMFDbr179y49fdc10FqjuREyo0MbR82ldw2WG6vM2cQS6rzWHOYuQHXMAPq6NI+6qXMllm88gtY8OH4cSF69Chxfou6y8CNC1boMwnygEy4XMi5l+GWX+UV5dae2lgpf40CC17Fjxx6sjqjc7t2JKOAcnwOarZSRAX+f2c5YWx6nDmSa28wJzQ89KlTWIAx0Wc1VlMOmVKGUWkMskeSeN28ePXr0HnQnQvARoBqkN27cOAyqd/kKiM/EWZG11fnS3ww6VtStMkh+9eph9O7alf4OQRLHzFaovih6yszM7DGciPZLT++VnDw+L896+ZdH/dNap5kYpa7rkCtzJmGgkzVLon9Hc1r0Y5TzOZ1keeL4xbNX3+7ZAyRTglmBQNu2bQtbRKiwsJCYKp++fXv16jnQ69fAlK8LOcmf1cAleXcBvyKuN0H6278f4hdRds8FkpmZSDG/DWoAip7ykSoSJaDMU6iROr7V63AXzqW19PRvXiRxRW9ANWidjHOqXJ6TN5quOXHx4tkDCiWQJJAtQV0jBB+RKSF99OjNnj1vr567eBz1+jVPtSKZxQJ+CdFP8/Ua9w0mSHlrQcASUA5HSwJIoNiuXbtOLPiEVPOBKAE1PDPsVwvgaAfjVsb6EIJD5kwSaZMCfXr0ftLEeT3PxuiaE+c3AMvsDoQSSSLH1qCePcvLy3fvhh964kdgSkQDgfcpCPTA2Q0Xz58APQC572vVjS3LXXGsjotBc4FlP2BJKJEkcuzcuaKid+/eZWVl8GNFRefOyBSJElDNszjHas8ksCfVFBnrfRCnqUOSpnvl3sXEuXlfGvP8xQ0HsrM7pABLQtkVUPYsX7Ly9qTwxy9aH8OTbq/cDVCJaGHbQCArpUO24rmmKYkqGS8W/BR5K5Ev/WfMXpw8klgOzySURLJ32faDzz+Urj516uvXr6dOrS798Hz99rLeRJSAZip/jmR7ilNc2nMLc24d6tQhUYTw9VpLo7OmE+f2nNkUjFnU3mHZUpG8feGLVZOIKPBEoEHgmX2gaMP5E029rrlKxb4zOzunOLlXej/Dsp0i+XTCV5smPFVE2xmeyp4ZMVqV0pxTsA6ZxCmLkF5TcdbkOLdGORqzWwfNklBOYnpWoruBJwBtG8gCnt2y229IC02t8iuUMXs8GdOwRJRHmKSV6BEEaniSPTna7b3KPq4lJ9O0FaGokVFDKWtynFuiHI0ZdFhKlFIXVoJBMd6JZ3b7/mmhgl8B0xizh2G5XaC0Ad1uePYge3K0i1gnczb3oulbhAaBNfXLSfYoPwAw0ZiCpY9BwZ+Kp8I5p2Bq5WGyMZUvmaUPT/KntqdXtDdCc8p997iYNKO3lRNxPUVZs5EFpolyMqZg6ePPZ4Yn4iyaTNFeeZhkTKg9gqU/T6hHYE8d7RmSppMKm9lpRpX0hrqkD458dxgGOmdNCROjXBtTsPSz5xLiiTi7UbRPrTxMNqZg6ceT7EnRbsfJhWVaTG/yvrIm0JziaohS/WfyAiZEORpziazi/jwpfVJxZ5yVg4kZE4y5vvRrvCpdD/Zsk4/RrnBKmk0skb6ICQma3PLgfSivpiRMHeXxG5PTJxV3xpkwzF4IMzFjsj0p2hFnL8bpS5MjXS4350W+O1rQFDA5yhPFScmTcBZUxpndCWasjPmN5ZE9VbRDLWJ3SpqDvPMm3zK0ZQWx0jdac55WRirKy+OMclncFc7JcwoqE+Y9FMwJ3hi/G3nwLIXFEiVPDvaEaHKOnRj57jJDs5Eb5mSGicZMXBcoeRLOIo71BHOmhKkoSnnZU+Gk3FmcVymasv43VzTrumg2DaUV/RTM8IVJt27dmjTpQtg3eWaldEswdeYVe8B0g/xkJGhaccIyPh6aTaPfrUrvLvCnOTWU1r99t5SsmDC33Lq9BNZASlDzl6wMx8JZGAh2SAxn3vhkAVOo9MPTg0d6Vyj1Xo89kK+xceb2i65ESU5l2ea7F7JXrI2q31SV95UMs0MwUOgJc8ttBEkNIxI8ENGwF86uLbgSxV/O++XGhFn6HEB2hiYciLqc8AxIn6+OgTMTKpHCKVc9cdCcGXnvE2jKU6QCgJndARftXe0wt6ykvobqD6Oo5UntJQ+HlreOuxJxnGM5z2SYciEJKLE/jM030gD80AmBrvbEibsiSJ2zK0lzoKu1rGgmRcCcwxVot40l7hkJJJxmBLTgEYmiQ8O23xN/JeI4p3LOMAVLRImNduy0k/rm5yNSXJkeXG3F2WlAPuDE1Dlb0jztS5NbSCtcTQ9BkyuQjUx4pWKJILOygsFgSkpKEJSVFVBAwZ/h2JWoIKE472SDWXoQWAJKAEnnakrwhEgBqAfP7ZbUybvF+bK/KWlChwSboZG3gVIlTbKmdwXaQstH3N5gsw3UjQQPwJSAgj+Zp6xEFOsJxXmZBaZmScdpeOabm9sdvsPTcDx8UzzLJM7SMpM6Odb9afo15GbUMt3NJLc1C71gEktASSCz22tlA1EECpYmnmHvSlTE5qxcnJ86QlvFfH2QBkeTY5T6wTMewRFP3NWf8kqdHOuyk8E0a/4czVlMU1jTUoHCSwCmZokgi4r6OyoCogAU/dnCniN261iPx5x5Os4HQJxLg1WAMYllLoBM7wUaicKHdECaSzzBnhXbV9tSp471KJr13TTnM02/9uY0QXMqWZMWR+W2KEeYimVR/8lpaWlztNLSJiNQaIYST5U9pa8LhTn9rGnifL2AqY1JLNN7jUxOTi4uHo8qLobnkb3Siaeyp4z29SbWjTmZ5ljZs5Q01aujI1+dRzSp886rI7amPcqDhmUoFCqYqlUQCiFQ9KdpiJaHZayzOeOwJsV5qYSpjNlRsSyGqzF5GUp5OTnjixXPjmhPjVPGepQ5HZrjfGnaz38313Je5TjX1twtYVKUA0xgmZYWcp1NLEeg4E/gGfSI9nLHnKH4rElxLmEqY44hlq6zHiCKPMegPb1wdmJzRvXTF/nRlK13e1IoUCWIrClgmihvTyyXV2FxmkCegFNFe/nHypkzx7FmmR2mMiazFDzJnh44yxxz5tgRseGqR9NsKmxsXZouDzmroyWuAqRh0qGEZMn+xHDX0d4V/xBpziBnzgStyTDJmIal5Dke7SlxSnN6h+88QVMspuRBhgl0QKFWRxcsBTlAUc7nuXaelD31xjTsZc7Q8p/Mmj0s1lxdxjD5ANLjzJhxbj/lZc6fopkU70FGgSroljhHDLoL5LM1LKDsiThV6pTmxA2RCHUbCi9rHqlgmMKYwp4GZ6eK9V7mzMlgmq7rCT/Yu5YVJ6IgGtSNj4XgIuILRHCh+MLxAT5Q0YiPAR1QUYni20Ui6qZJQBHRLGYhAReSjbocxvWMW/0zu27n9unOuZfqm86MmWh/QEOf1DlVt6rOzUeL5vqN6iBjLdDMEn3PM4do9sFklrN63kVDr0HBmVD9ZAGix8cgo5qdQZ7vzoCpvgVwDnK9Y4IzPhAJ1T1o3gOagYMMEH2ReF6o3Qu2mxgXOKOB4CSqq0RHaEI0dxCYOpyiGD0Kzm0HEqoDzbXXPSV5wCCDiM48L9IAQtXqls7I5CFQXSd6HFL5iOrGonns6CWAWQjOS0dj6Wwu9Jv2Vjl3n06pjgPOHdrfIDT1QYaf6LPguS53yZv6cG4ZDPNvKdVVNFOif2aem4gCmDqcx8H1DJqfU6pn0bxQHM2HfjTrKdEjCk3Lc/BT0c5EOhGcoPrWYlSv3Tg04yL6G7R6a0GNKMP1LtAE1WcO3XhCaHIrg8ZCq/NjoWSnSwYZlp99olOpSTxXHiudVLlGaVav67LJRJfQTHk+FdAkFa6b4EzRBNUT4dykNYaUIdsHoJnKJhM9Cuvz8oG/4cjq8cvqBWRTAOg4QhN93mJwCtcRnECzA+EMQZMtBBbNNQmakM2te2bzqokUBHIWkU4bnBFn9V2n8NNosrngCk3muc51BGc6Hu5COAPQVEeWftlsiGoiBQUH5yDVX4tw7tqrVZxTbtn82QwMTUR6EpzNn4ImC2d5NF/mDAd1t2zOG9VECgoLTqb6DxFOSkOqbCILTyM0Q4Nz27Q0SgVNFs6h0DzrQ1OCySWbszYJcwrSg9NB9dvm11HT0BmLZofQjIUuLDQhw4ImC6egWas8KYEmj9ORhLg8orNgsSrJRfUG0pCCZv/rSTYPxF9PoakHp431Vj6p2V+n8uS5gqaynHAVaCbjNXw8Ez18XZCoTmlIiyVJQrHO4VlIMvqMZA16FB2+IjoswjnwwultSVIfBs3LPjSraShFTpkDMcOpfjsvHQh2PaU3f1EoxbIZRnS8UIK9m33hr2aa1F8Ngeb57D0gGKdbNCWl/8h+++J2I5vX7gYSPVckzDveqKKZpPTmfbdsVkIfCGeu8dFMknoYmvriTNX97a+Hk02c+1Fy4TSAs6VeIGXRbGmyGS7EFs0bpdG8TGjKfI14WQpN1o4IJVKRU3qLv92Uh5WRpKGWLTgFzU8jZPrTfrm5PTvE+G1qd+SMoEdRYh1N2UroEZqhSQjRztrRk/67QbOmohmycAg03zOaQzkAUCUsutGsBxbvOprBStyDdhCaZU6W1f0WzQZVhyNFcx5dpFA0b5lz5b7yaOIx536gyf1NtSPH/c1/PDbPWTSVuRB1ix+70fyvm0BTmwDrc6EVktMPL2VOn9ugbM7wzPKje2a5MurN3pLWm3PKxqF2DwWMgf/PQoKm4iII2PWoqio3Buf07lKe0+dogYM8wLQ4695DGt8e0kKu9T50D6mm9ZCA5j3VJV1gR67t72+eWPn9TTPK8Pc3Bc13rkR9BGgG7W+2fb33LZPQezdEx6/DvXeg+VBHU98trrrnQtGkzIUM0QfRfJBFE8dF55AcD60s8bGp6p5Zfhv1zHL735hZ3hwgOs8sBU1ldOZ3uLD7qvrFztNfT9o83S57gOg8T596btE87x32sDPwqq8lV2mP4a7HsZK7HryIxLJpx0LvXtDtUuREpaGld62r/XSC95CwJOeWzQqhyexVVg7zC5zVr8uwIzdbdkeuG7wjh70ZhCbvyMkggxtym6khRzcDOPO/COdk72/uIF9GB7IpaFINSQ05NmX4z/Ttt5O9W2x5jh8Gsjn1igHiFhIXnP7OcvvrSth7bz0Ycu8dCR3HSrv3zuTlS1LUEukRCgBD9bdFPBmV5fZkPBixJwM5aOe0tV9tfPWOEgsf07lEOs9J3foI2t8VvxAsLiX9QvvHxC8Uv0UEmKa6rsSiJ/U7giaE8+tb1csm5t/68nnZXMHZ62S9bMCTsSzgZdsXd4rNnva6Vc5ykw+W3C9GFwnCCaq7fJawBhb1WW5dHp8lvIHsC9R8ljYHseUcl0ug3FS7SJshnJbqHg8wbKvj5gGGb5U9q34P8P2cQZ0bwOwL1NOQCCeEQajO/nS2VF9L8BwPf3riqe4DCo7fNH5qvz+9m7s8YRPuMlXuSCE0yWppb4cVOPnuBLb7nxI8tbsTDo7y7gQfnEet399enlCzVydYrz/dneC82AO3Fp/1p3T9nx0uZm8uFuV03usBOL33euz/S/d6mLsoZtKLPf4wd94tTkRRFMduxN6SAUUFEaIRbFFBsBDjig1j7IqR2HvFsvbeC/beRVEQUcQ/FFECfi7vfWXOJDeTlyZ6bBtBWX85572Zt+M9i/yxHgso5HrsTLkpPjcxdAZBxybkoonWkR2lt/VBM7dWmjmzYeBwOXNmhZ45M981c2Z3s2fOnN02zMxJGYqhM6MxcmaompESPnMGA5EQdN5V3Fu6xo/bemhvycR3DJ2ROH/trjAPacS/mIekZ/gEBiJNDIxD0vN7wuch4WAPQY+JTQhbumxrwlE9dnUbdTGr62mFWV2TSmZ1Ecu/OqsLY2egnJkvNQHDugKjuiaY2VLKmHI/19bknMug48u/FZrEwpoysA8Vz5HbEDJHjnhijhxJzZEjln9xjhz+07+cfWaAkswYOYtSzj2Tc+SK0HRfLZZNOXIcUZcHH/zAhzCnxbm70ozDwcUzDoll6IzDrQ3POJyLpVPM5TNA1ZBD/k4faZRVzTiUQXcvm3JeF6IOczYwf5MUPn/zYoPzN7F0luNJefcHcE72x29SxpmlHsb7O3z+ZnhHxh6xbIprJNnA6MGcrtmw4En7EUbDmvamUZVnw06qezasGGcqhnD6w2ExGtZM2GeaGLGN2bBmSjmsKUvWUmLZLHuNlAw1Zw1zi9/vL5lb/G5r0+cWu0ftYtru9Zs8uHjstrEE8vrXHCZFE8yKc4t7ov8vVsWyKVsDpwlzorGJcTpmagPpsmXvSI3M1G58DDR0MJe7n8vppRI0y8LEohnYg7yCa9l0N1rCnPznzE70H817FyPKqxNoVpr3jhYxWBNBF8umq20V5jRZx07U/C6C1lBi6A1zdRGczdUNU3YRoPUKexCCjmWzbNTRBCzNWZJ14GxaT0YpzKhpce0RkK60i4b0ZNRXOgJjip4MWIxvuWV/OpbNSi3VcWFOk3WBs5kdLtEgSIKoC4ZZJX2LhFUzlR0uk2tJ+2/6FtrhUtoWWLKbxGUJcG3ttVg6gbORfqGLol/IcGSQhBDl1yVdoEwWTIvKmuZy2m+6ecq+O9kvhJzLDX2KLKgO34dSBZl1LJ3AWX/31VPZfRWNUqwVx96mcJvUVqg/kwXTPuvGBYrEak87xsKj+wowdc5lo/JmUZ5eqbYxIbOOpRM46+1lOyl72VpbqXFVGZK9qCmqmv1gfzJ/62WZdlVM++7aRc3SpuSuzl42YmlSPlLCRAOw3IMQVqloBXNi6Qy4c8X8ZnUG3n1CjcC9u4Cjbaq2JeDBfm8F1vfp8bcbN+6aqme91tsZSCxFZ2AfCxM5R9Bn+nsQlm+3OeXSyTijGue89WTPmvssT8o+yyfP7jz+doNIgiMjJHWQot/VUA3Trl2vHn/LJeiLkXbN80vOnfEvfv8ipRzttdz+a2CKnIs9yG3OeCFk6ewfqP6ex2lvqGuVYR49+vgxNX+/VCQtx0DFfztf5jeCTBXQ/kSUWuVLulZVQai7GtTvBg12ra7btbF3Px9meWvKcmq3OXEKzzj9WnqkvfYeYDam/frR0aNHH715Q13/bTVJy5EZRoy6G5mXFqtiykCJKHXQn+ea/qIe4CG6UTmkB/j6WWVL9NYi5esIJj0qA5hlrYmLTbc504ViJdJqJyIz6LT3DKZ9hOWpgKqO6nfBu3PuqN5d1FFtWT569ebAixe3r3Q2JAGyeyeW56Uz8YWbV2ZT8eTy9F7P49/sDqYEVFv03PbtVOh/6JDfUT1gLjqqj3z5uSSXo5Lq+3SnvuTnl5voqJ47wHYq25SPI5Zv/UZ/wJTWRNBrNmdC7URkBlP0b+8y2Z6Kp+hP5/r03dyfThxtf7pZL9VWTihfHThAKK/cumxI+hy9zMpVW6ZN2Vko1bE1a0+k0p5hykSNRR8yUDIo96ebIoyi/vRtY7W2Ffen2z56YqlTziyvdt1OxuwWBhPWxB7kMKfEyX+LTTvbs4+1p89zUqDbf7jo9ieSbEuV8UvXFMoDn58TynsdtScVSG916kRsesGh6bFNC9MeE1UeNUCNQZnnyKG6kH6C6PanF5qkraJHFz23hu869Lbr9u3amBqmzLmwpsOcyDo07VT3iEk729Pn2dpqeGqgTJSRKjFE5kggmSShpFr/S9eIZTFK7UkvvilRqEGxHWRStqgBSjy1QS+M+WEMykS5oIk1mSCy5s5VJI0tFxBLDrlhycY891AbM9J9Zr5QLuewZlXmFFlnrdmLtJfwfHKUaukVUEuUmVoNYpBM8tN3YvmKFktGSSzv3WMDKFN66c35Qu1KnMiQRS1QGPQ1G5SAMlFGyppAEEnEUZE0tpzNLGcEWG6nkBtjLp9VKNEck3NY021OZL3Mdae2p+ZJ62dUF9M/eUZAr/lEuZ/J1yReKRXJa69evXnDtlQoO9p8e6lYoX7FFp5SQIVBxyzQRJkpazz/xByZJLuSbMkZn6H2Hs2SjalYRpDyMjnv36UvW9NpTmS9PM6IsSd49olGiacGaokyU4hBMsnHhJL2nedXrlwGylMtiUKjOryDHWoN+sE3qCJKSAkqaSj9IIwEUpFUtqTnkwglsVSbTyDknTI4NoI1Tc71eYdTODhhnGskTk/ZEzy7ENCPH1tb6USXgRJR0jXWJV/04tWjx4SSr4bMYmlduXBLoTmKpcsZ9NDrC/SwDDElTZw48QeJOSqSixZPXbfOojwOlirkHozpzrk769iJpD2DPAmoIkoiqJroM2L6CFIk9YWlj7Kd2nUaCbg06EJpUH1RT9ehsy9ovabXJLq359MSoOSN3LBEyCVMDqbIuTvr2IkEztXgae/smGjv3nSUS1TvBPSYRCRvMEmg1LZc7kDZsEGJpwH6mvkZ7SKtU6IP6LVB2TbIMrMlDKbMuTvrITsR4g6efGdnjsj0ce431o0b9F3pBcmQDKI89WCam03jK6gFev7q1atv3/o81S8M8vjxfoSyLaMEy72xggOmyLkbp9yJJE+2gCFq9JKwvrS6/fI2gbQkfZRedkvhLyq2FwZloJ2Z6Hb6vK72Ox6Qf5DaqzOj1Czlgilhcs5hzdp2ovS+UJ64s7PnjoSVxAe7Wu2JY7d7liSuhv6yYnEYVH1yD/0jUSscpBqUmuXqWMENEzmvdSeKdFo9x7FGaaLmSBeHvDhb80nWuO9MmZXIr121pyWbXdlyYtOqpUvz+6ZXDZR54u3WCSKmRvx+2wNArD+ZsM/udCoIEzmvdSdqE+l+KuyfkFjp6cMHjdSIAFq1CZ4JecnqLyyn5zdlk8lOWt1ZnYwy8ZVn8rOqu6jXQHF8x0x9ddMgg+tP6Kc3J90pUh9MLJ04RwmnsGVz2hLFea6FaDiyJ5c/yFcLcmlLKqkZ8l8L4a8jpsnNawpu5bPi7e5oxB8jNQhNSMojbeqECZw440tUNMHKjKf++ZGgjKG8dKpl6bSqPZlNKo54cwyG4jdJMc3EN1VB9PDmvR6ORCGExrWUzzEprxMmcOL8OTOlUFGzYmc2p5af8jxzyLuaTnlTC/fEkEk3yRbKtgGpEJrVmCOqP4CjNFHy6MpqLLplT+qUJ95uHRov3iIuMIQxVcoBsx6ctHb26084zdlUlWvesX1zdp4u1KzpO5LGk3KVM5cHWtjamChbNMtA3cqf2JFcTUytvNXJ7B7tSYcxcawLmPXg7N3F4ETa/4ZmZa0pxQ7ctli9/K9pWqIMNFl9AnbOmTJrWmLNlDk41nca06YcX/+uR1F6Die4F6X/Cs9ZLQal9qQCiavDrkXCVaImaoASzyyANk9z4sqYSDku2utRH+xF+v410XSWAZT4oi4ekCH1tlKv1B0MiCqgMGhzWRpjIuUCZv17keK5MNFMlHQpZFHiDrU/cbTPGbF6GPHH9jmlfpqoAWoNurIpQLFgRmBMkfL69yKVdsszlWgSyoXKlkDJJBklgcSDhaSolvpYPc/JTA1RBho0aLxJPKdoljAmUt4oTpX25vKctRkJNyg1yS5MEg8TCuHxTiJqgBYbtGV64yzjPksYEzAbUVQvnkU8l/9p345ZEwaiOIBLF1uoECzUfgXB1VnElIBbyRIkOCQu6pAh0KlQOvR7917uHv87H4LGS0wh/w4tnR6/9y6YZ3KTZx45F0tQsuQlVZGoBhUDWqy9WcrB9HTaXc/3mgOa/xYfQ/diCcpqJq/pM4FiQH1cQRfxqaXHwcRpP/GsA5pvY5K0plKPJShrHJxzAzqPw+spfxQl9uBk6XUwUbTryaCbw/KyOmdJypJMiRMuKWsP6IgHlECL8EpKOjTCEpU15okHNDaboszOlx0et4epgoQkUToXy1sLDsSAAnQaJeEFkkkMykYtpSdKZtGhMp2mZbLLvpa5unM7viXbfRml8dw4PjmSLiU94ID4GVCAquLmq2gXnoXM9pUkKBu2lJ4MqkWxd+Rgy4vFJyRBKU64rwEFKEgPZZLN1qG6Rf/+XIT58piU6WqKU4PPvQ1bwpNHADWruNth7Hid3Rok/VPKAX3EZgSkInprJa4/xlIemUY8xwyKb1YMKoJlN0NC0iulHFAGRW0nzUbLcWpsyjYs4cklu4/9j2ifyxlVP85LFJAEZTPVARTtlt3GqbFXBETZhqUsmUVp7ahREaOIF3xsyUZrDWxQm5RDghRyxAIQlDU67QO0EsXbUtqVIl8+a0cSoNxukIpui1PTOqW8VeYVGaGqvOo862C3BsmWwsWBlGK+SkfLCZIl70EpRXXZhGpnTBEv7bYZfgXWtBvNftC/0G0tGQw6kIk2pcLt0D/u5YjaiNRsRMnUzdhAdkXSMZ0ETiYqg24k4CPk5v7d/q9Bt19U9F+d6XafPn369Olza/4AHTMK9clhnYAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAwIDE3MSIgd2lkdGg9IjIwMDAiIGhlaWdodD0iMTcxIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0idGV4dEdyYWQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6I2ZhZjQ5OTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSI0NSUiIHN0eWxlPSJzdG9wLWNvbG9yOiNmNjcyYzI7c3RvcC1vcGFjaXR5OjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzZmZjllYTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8ZmlsdGVyIGlkPSJnbG93IiB4PSItMTAlIiB5PSItNTAlIiB3aWR0aD0iMTIwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlR2F1c3NpYW5CbHVyIGluPSJTb3VyY2VHcmFwaGljIiBzdGREZXZpYXRpb249IjUiIHJlc3VsdD0iYmx1ciIgLz4KICAgICAgPGZlTWVyZ2U+CiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJibHVyIiAvPgogICAgICAgIDxmZU1lcmdlTm9kZSBpbj0iU291cmNlR3JhcGhpYyIgLz4KICAgICAgPC9mZU1lcmdlPgogICAgPC9maWx0ZXI+CiAgPC9kZWZzPgogIDx0ZXh0CiAgICB4PSIxMDAwIgogICAgeT0iMTI1IgogICAgZm9udC1mYW1pbHk9IidUdyBDZW4gTVQnLCAnQ2VudHVyeSBHb3RoaWMnLCBGdXR1cmEsICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmIgogICAgZm9udC1zaXplPSIxMTAiCiAgICBmb250LXdlaWdodD0iYm9sZCIKICAgIGxldHRlci1zcGFjaW5nPSIxMiIKICAgIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICBmaWxsPSJ1cmwoI3RleHRHcmFkKSIKICAgIGZpbHRlcj0idXJsKCNnbG93KSI+dGhyZWUud3M8L3RleHQ+Cjwvc3ZnPgo="},function(e,t,n){var r,i,o={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),l=null,u=0,h=[],d=n(207);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(b(r.parts[a],t))}else{var s=[];for(a=0;a<r.parts.length;a++)s.push(b(r.parts[a],t));o[r.id]={id:r.id,refs:1,parts:s}}}}function f(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=h[h.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=o}if(t.singleton){var a=u++;n=l||(l=y(t)),r=E.bind(null,n,a,!1),i=E.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=x.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=A.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return p(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var a=n[i];(s=o[a.id]).refs--,r.push(s)}e&&p(f(e,t),t);for(i=0;i<r.length;i++){var s;if(0===(s=r[i]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete o[s.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function E(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=w(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function A(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=d(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t,n){const r='\x3c!-- https://freesound.org/people/deleted_user_2731495/sounds/183881/ --\x3e\n<audio id="introSong" src="assets/sounds/menu.ogg" loop></audio>\n\n\n\n\n<a-scene\n bind__beat-generator="challengeId: challenge.id; difficulty: challenge.difficulty; beatmapCharacteristic: challenge.beatmapCharacteristic; gameMode: gameMode; has3DOFVR: has3DOFVR; hasSongLoadError: hasSongLoadError; isPlaying: isPlaying; isZipFetching: isZipFetching; menuSelectedChallengeId: menuSelectedChallenge.id; songDuration: challenge.metadata.duration; speed: speed"\n bind__beat-system="gameMode: gameMode; hasVR: hasVR; isLoading: isLoading; isPlaying: isPlaying"\n bind__gameover="isGameOver: isGameOver"\n bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id; isSearching: isSearching"\n bind__leaderboard="difficulty: menuSelectedChallenge.difficulty || challenge.difficulty; beatmapCharacteristic: menuSelectedChallenge.beatmapCharacteristic || challenge.beatmapCharacteristic; gameMode: gameMode; inVR: inVR; isVictory: isVictory; menuSelectedChallengeId: menuSelectedChallenge.id; challengeId: challenge.id"\n bind__search="difficultyFilter: difficultyFilter; genre: genre; playlist: playlist; query: search.query"\n bind__song="audio: challenge.audio; challengeId: challenge.id; isLoading: isLoading; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver; isVictory: isVictory"\n bind__song-preview-system="selectedChallengeId: menuSelectedChallenge.id; selectedChallengeVersion: menuSelectedChallenge.version"\n bind__stage-colors="colorScheme: colorScheme"\n bind__tunnels="isPlaying: isPlaying; songDuration: challenge.metadata.duration"\n bind__zip-loader="difficulties: menuDifficulties; isLoading: isLoading; version: menuSelectedChallenge.version; directDownload: menuSelectedChallenge.directDownload; bpm: menuSelectedChallenge.metadata.bpm"\n animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"\n agent-picker\n console-shortcuts\n debug-beat-generator\n debug-beat-positioning\n debug-controller\n debug-intro\n debug-song-time\n debug-state\n hack\n gpu-preloader\n \n leaderboard="apiKey: REDACTED_FIREBASE_KEY; authDomain: threews-prod.firebaseapp.com; databaseURL: https://threews-prod.firebaseio.com; projectId: threews-prod; storageBucket: threews-prod.appspot.com; messagingSenderId: 172125624222"\n multiplayer="apiKey: REDACTED_FIREBASE_KEY; authDomain: threews-prod.firebaseapp.com; databaseURL: https://threews-prod.firebaseio.com; projectId: threews-prod; storageBucket: threews-prod.appspot.com; messagingSenderId: 172125624222"\n loading-screen="backgroundColor: #000"\n pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-arrow-red="mixin: arrowRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-blue="mixin: dotBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-red="mixin: dotRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-mine="mixin: mine; size: 30; container: #beatContainer"\n pool__plume-arrow-blue="mixin: arrowBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-arrow-red="mixin: arrowRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-blue="mixin: dotBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-red="mixin: dotRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-mine="mixin: minePlume; size: 12; container: #beatContainer; dynamic: true"\n pool__beat-broken-blue="mixin: blueBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red="mixin: redBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-blue-dot="mixin: blueDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red-dot="mixin: redDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-blue-dot="mixin: blueDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-red-dot="mixin: redDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-mine="mixin: mineBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-blue="mixin: blueBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-red="mixin: redBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-mine="mixin: mineFX; size: 12; container: #rigContainer; dynamic: true"\n pool__punch-fx-blue="mixin: bluePunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-red="mixin: redPunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-mine="mixin: yellowPunchFX; size: 12; container: #rigContainer; dynamic: true"\n pool__tunnels="mixin: tunnel; size: 10; container: #tunnelsContainer; dynamic: true"\n pool__wall="mixin: wall; size: 20; container: #wallContainer; dynamic: true"\n proxy-event__cleargame1="event: gamemenuexit; as: cleargame; to: a-scene"\n proxy-event__cleargame2="event: gamemenurestart; as: cleargame; to: a-scene"\n proxy-event__cleargame3="event: songcomplete; as: cleargame; to: a-scene"\n proxy-event__pausegame="event: pausegame; as: textglowoff; to: a-scene"\n proxy-event__resumegame="event: gamemenuresume; as: textglownormal; to: a-scene"\n play-sound__crescendo="sound: #crescendo; event: victory; volume: 0.75"\n render-order="stage, aurora, sideglow, tunnel, curve, curveshadow, beatShadow, score, beats, menu, menuitem, menubutton, menutext, menugenre, cursor, particles, weapon, victory, stepback"\n stats-param\n tunnels\n vr-mode-ui="enterVRButton: #vrButton">\n\n <a-assets timeout="3000">\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/assets.html"> --\x3e\n<a-asset-item id="VigaRegularThree" src="assets/fonts/Viga-Regular-Three.json"></a-asset-item>\n<a-asset-item id="agentGlb" src="assets/avatars/cz.glb"></a-asset-item>\n\n<a-asset-item id="arrowredObj" src="assets/models/arrowred.obj"></a-asset-item>\n<a-asset-item id="arrowblueObj" src="assets/models/arrowblue.obj"></a-asset-item>\n<a-asset-item id="beatObj" src="assets/models/beat.obj"></a-asset-item>\n<a-asset-item id="laserObj" src="assets/models/laser/laser.obj"></a-asset-item>\n\n<a-asset-item id="tunnelObj" src="assets/models/tunnel.obj"></a-asset-item>\n<a-asset-item id="redBeatObj" src="assets/models/redbeat.obj"></a-asset-item>\n<a-asset-item id="blueBeatObj" src="assets/models/bluebeat.obj"></a-asset-item>\n<a-asset-item id="dotRedObj" src="assets/models/dotred.obj"></a-asset-item>\n<a-asset-item id="dotBlueObj" src="assets/models/dotblue.obj"></a-asset-item>\n<a-asset-item id="backGlowObj" src="assets/models/backglow.obj"></a-asset-item>\n<a-asset-item id="aurorasObj" src="assets/models/auroras.obj"></a-asset-item>\n<a-asset-item id="merkabaObj" src="assets/models/merkaba.obj"></a-asset-item>\n<a-asset-item id="ringsObj" src="assets/models/rings.obj"></a-asset-item>\n<a-asset-item id="homeObj" src="assets/models/home.obj"></a-asset-item>\n<a-asset-item id="homeShadowObj" src="assets/models/homeshadow.obj"></a-asset-item>\n<a-asset-item id="weaponObj" src="assets/models/weapon.obj"></a-asset-item>\n<a-asset-item id="weaponHandleObj" src="assets/models/weaponhandle.obj"></a-asset-item>\n<a-asset-item id="weaponGlowObj" src="assets/models/weaponglow.obj"></a-asset-item>\n<a-asset-item id="beatBrokenObj" src="assets/models/beatbroken.obj"></a-asset-item>\n<a-asset-item id="dotBrokenObj" src="assets/models/dotbroken.obj"></a-asset-item>\n<a-asset-item id="dotPunchBrokenObj" src="assets/models/dotbroken.gltf"></a-asset-item>\n<a-asset-item id="cutfxObj" src="assets/models/cutfx.obj"></a-asset-item>\n<a-asset-item id="punchfxObj" src="assets/models/punchfx.obj"></a-asset-item>\n<a-asset-item id="leftFistObj" src="assets/models/leftfist.obj"></a-asset-item>\n<a-asset-item id="leftFistWeaponObj" src="assets/models/leftfistweapon.obj"></a-asset-item>\n<a-asset-item id="rightFistObj" src="assets/models/rightfist.obj"></a-asset-item>\n<a-asset-item id="rightFistWeaponObj" src="assets/models/rightfistweapon.obj"></a-asset-item>\n<a-asset-item id="plumeObj" src="assets/models/plume.obj"></a-asset-item>\n\n<a-asset-item id="mineObj" src="assets/models/mine.obj"></a-asset-item>\n<a-asset-item id="mineBrokenObj" src="assets/models/minebroken.gltf"></a-asset-item>\n\n\x3c!--\n https://freesound.org/people/juskiddink/sounds/70043/\n https://freesound.org/people/Robinhood76/sounds/337436/\n--\x3e\n<audio id="confirmSound" src="assets/sounds/beatHit.ogg"></audio>\n<audio id="clearSound" src="assets/sounds/clear.ogg"></audio>\n<audio id="hoverSound" src="assets/sounds/hover.ogg"></audio>\n<audio id="victorySound" src="assets/sounds/victory.ogg"></audio>\n<audio id="crescendo" src="assets/sounds/crescendo.ogg"></audio>\n\n\n<audio id="hitSound1" src="assets/sounds/hit1.ogg"></audio>\n<audio id="hitSound1left" src="assets/sounds/hit1left.ogg"></audio>\n<audio id="hitSound1right" src="assets/sounds/hit1right.ogg"></audio>\n\n<audio id="hitSound2" src="assets/sounds/hit2.ogg"></audio>\n<audio id="hitSound2left" src="assets/sounds/hit2left.ogg"></audio>\n<audio id="hitSound2right" src="assets/sounds/hit2right.ogg"></audio>\n\n<audio id="hitSound3" src="assets/sounds/hit3.ogg"></audio>\n<audio id="hitSound3left" src="assets/sounds/hit3left.ogg"></audio>\n<audio id="hitSound3right" src="assets/sounds/hit3right.ogg"></audio>\n\n<audio id="hitSound4" src="assets/sounds/hit4.ogg"></audio>\n<audio id="hitSound4left" src="assets/sounds/hit4left.ogg"></audio>\n<audio id="hitSound4right" src="assets/sounds/hit4right.ogg"></audio>\n\n<audio id="hitSound5" src="assets/sounds/hit5.ogg"></audio>\n<audio id="hitSound5left" src="assets/sounds/hit5left.ogg"></audio>\n<audio id="hitSound5right" src="assets/sounds/hit5right.ogg"></audio>\n\n<audio id="hitSound6" src="assets/sounds/hit6.ogg"></audio>\n<audio id="hitSound6left" src="assets/sounds/hit6left.ogg"></audio>\n<audio id="hitSound6right" src="assets/sounds/hit6right.ogg"></audio>\n\n<audio id="hitSound7" src="assets/sounds/hit7.ogg"></audio>\n<audio id="hitSound7left" src="assets/sounds/hit7left.ogg"></audio>\n<audio id="hitSound7right" src="assets/sounds/hit7right.ogg"></audio>\n\n<audio id="hitSound8" src="assets/sounds/hit8.ogg"></audio>\n<audio id="hitSound8left" src="assets/sounds/hit8left.ogg"></audio>\n<audio id="hitSound8right" src="assets/sounds/hit8right.ogg"></audio>\n\n<audio id="hitSound9" src="assets/sounds/hit9.ogg"></audio>\n<audio id="hitSound9left" src="assets/sounds/hit9left.ogg"></audio>\n<audio id="hitSound9right" src="assets/sounds/hit9right.ogg"></audio>\n\n<audio id="hitSound10" src="assets/sounds/hit10.ogg"></audio>\n<audio id="hitSound10left" src="assets/sounds/hit10left.ogg"></audio>\n<audio id="hitSound10right" src="assets/sounds/hit10right.ogg"></audio>\n\n\n<img id="cursorMeshImg" src="assets/models/laser/laser.png">\n<img id="downIconImg" src="assets/img/downIcon.png">\n<img id="envmapTemplateImg" src="assets/img/envmap.png">\n<img id="envmapImg">\n<img id="favoriteImg" src="assets/img/favorite.png">\n<img id="sliceImg" src="assets/img/slice.png">\n<img id="stepbackImg" src="assets/img/stepback.png">\n<img id="soundboxingImg" src="assets/img/soundboxing.jpg">\n<img id="genresImg" src="assets/img/genres.png">\n<img id="starImg" src="assets/img/star.png">\n<img id="merkabaBloomImg" src="assets/img/merkababloom.png">\n<img id="homeShadowImg" src="assets/img/homeshadow.jpg">\n<img id="backGlowImg" src="assets/img/backglow.png">\n<img id="weaponImg" src="assets/img/weapon.jpg">\n<img id="weapon2Img" src="assets/img/weapon2.jpg">\n<img id="weaponHandleImg" src="assets/img/weaponhandle.png">\n<img id="difficultyImg" src="assets/img/difficulty.png">\n<img id="selectedImg" src="assets/img/selected.png">\n<img id="cutfxImg" src="assets/img/cutfx.png">\n\x3c!--\n<img id="cutFxTemplateImg" src="assets/img/cutfx.png">\n<img id="cutFxImg">\n--\x3e\n<img id="minefxImg" src="assets/img/minefx.png">\n<img id="sideglowImg" src="assets/img/sideglow.png">\n<img id="logoImg" src="assets/img/logo.svg">\n<img id="moonImg" src="assets/img/moon.png">\n<img id="plumeImg" src="assets/img/plume.png">\n<img id="tubeImg" src="assets/img/tube.png">\n<img id="tubeColorImg" src="assets/img/tube.jpg">\n<img id="handStarTrailImg" src="assets/img/handstartrail.png">\n\n<img id="modeRideImg" src="assets/img/moderide.jpg">\n<img id="modeClassicImg" src="assets/img/modeclassic.jpg">\n<img id="modePunchImg" src="assets/img/modepunch.jpg">\n<img id="modeViewerImg" src="assets/img/modeviewer.jpg">\n\n<a-mixin id="slice" slice9="color: #050505; transparent: true; opacity: 0.9; src: #sliceImg; left: 50; right: 52; top: 50; bottom: 52; padding: 0.18"></a-mixin>\n<a-mixin id="font" text="font: assets/fonts/Viga-Regular.json; shader: msdf; letterSpacing: 1"></a-mixin>\n\n<a-mixin id="superKeyboardTextInput" mixin="font"></a-mixin>\n\n<a-mixin id="beat"></a-mixin>\n<a-mixin id="beatBlock"></a-mixin>\n<a-mixin id="beatSign"></a-mixin>\n\n<a-mixin id="arrowBlueBeat" mixin="beat" beat="color: blue; type: arrow"></a-mixin>\n<a-mixin id="arrowRedBeat" mixin="beat" beat="color: red; type: arrow"></a-mixin>\n<a-mixin id="dotBlueBeat" mixin="beat" beat="color: blue; type: dot"></a-mixin>\n<a-mixin id="dotRedBeat" mixin="beat" beat="color: red; type: dot"></a-mixin>\n<a-mixin id="mine" mixin="beat" beat="type: mine"></a-mixin>\n<a-mixin id="beatShadow" mixin="beat" geometry="primitive: plane; width: 0.7; height: 0.6" rotation="-90 0 0" material="src: #minefxImg; shader: flat; color: #000; transparent: true; opacity: 0.2" render-order="beatShadow"></a-mixin>\n\n<a-mixin id="plume" plume obj-model="obj: #plumeObj"></a-mixin>\n<a-mixin id="arrowBluePlume" mixin="plume" plume="type: arrow; color: blue" materials="name: arrowBluePlume"></a-mixin>\n<a-mixin id="arrowRedPlume" mixin="plume" plume="type: arrow; color: red" materials="name: arrowRedPlume"></a-mixin>\n<a-mixin id="dotBluePlume" mixin="plume" plume="type: dot; color: blue" materials="name: dotBluePlume"></a-mixin>\n<a-mixin id="dotRedPlume" mixin="plume" plume="type: dot; color: red" materials="name: dotRedPlume"></a-mixin>\n<a-mixin id="minePlume" mixin="plume" plume="type: mine" materials="name: minePlume"></a-mixin>\n\n<a-mixin\n id="superCut"\n bind__supercutfx="colorPrimary: colorPrimary; colorSecondary: colorSecondary"\n supercutfx\n geometry="primitive: plane; width: 3; height: 3"\n material="shader: superCutFxShader; transparent: true; depthWrite: false"></a-mixin>\n\n<a-mixin\n id="redBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: red"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: blue"\n render-order="beats"></a-mixin>\n<a-mixin\n id="redDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redBeatFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="blueBeatFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="mineBroken"\n gltf-model="#mineBrokenObj"\n beat-cut-fx="type: mine"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="mineFX"\n geometry="primitive: plane; width: 0.6; height: 0.6"\n material="shader: flat; transparent: true; src: #minefxImg; color: #fff568; depthWrite: false"\n render-order="menu"\n animation="property: components.material.material.opacity; from:1; to:0; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="redPunchFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="bluePunchFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n bind__material="color: colorTertiary"\n id="yellowPunchFX"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="wall"\n material="shader: wallShader; transparent: true; side: double; opacity: 0"\n animation__fadein="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; easing: easeInCubic; autoplay: false; dur: 1500"\n animation__scalein="property: object3D.position.y; from: -5; to: 0; easing: easeInOutElastic; autoplay: false; dur: 1500"\n render-order\n wall></a-mixin>\n\n<a-mixin\n id="tunnel"\n obj-model="obj: #tunnelObj"\n materials="name: tunnel"></a-mixin>\n\n<a-mixin\n id="bigMenuButton"\n geometry="primitive: plane; width: 1.15; height: 0.23"\n material="shader: panelShader; brightness: 0.5; borderWidth: 0.05; ratio: 4; borderRadius: 0.6"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.04 1.04 1.04; startEvents: mouseenter; pauseEvents: mouseleave; dur: 80"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.04 1.04 1.04; startEvents: mouseleave; pauseEvents: mouseenter; dur: 80"\n render-order="menubutton"></a-mixin>\n\n<a-mixin id="cancelSoundUI" play-sound__cancel="event: click; sound: #clearSound; volume: 0.5"></a-mixin>\n<a-mixin id="clickSoundUI" play-sound__click="event: click; sound: #confirmSound; volume: 0.25"></a-mixin>\n<a-mixin id="hoverSoundUI" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"></a-mixin>\n\x3c!-- </require> --\x3e</require>\n </a-assets>\n\n <a-entity id="beatObjTemplate" obj-model="obj: #beatObj" visible="false"></a-entity>\n <a-entity id="redBeatObjTemplate" obj-model="obj: #redBeatObj" visible="false"></a-entity>\n <a-entity id="blueBeatObjTemplate" obj-model="obj: #blueBeatObj" visible="false"></a-entity>\n <a-entity id="dotRedObjTemplate" obj-model="obj: #dotRedObj" visible="false"></a-entity>\n <a-entity id="dotBlueObjTemplate" obj-model="obj: #dotBlueObj" visible="false"></a-entity>\n <a-entity id="mineObjTemplate" obj-model="obj: #mineObj" visible="false"></a-entity>\n <a-entity id="cursorLaser" obj-model="obj: #laserObj" visible="false"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/loading.html"> --\x3e\n<a-entity\n id="loadingSongInfoContainer"\n bind__animation__scale="enabled: isLoading"\n bind__visible="isLoading"\n animation__scale="property: scale; from: 1 1 1; to: 1.05 1.05 1.05; dir: alternate; loop: true; dur: 1200; easing: easeInOutCubic"\n position="0 1.5 -2">\n\n <a-entity\n id="loadingMenuBackground"\n bind-toggle__raycastable="isLoading"\n render-order="menu"\n geometry="primitive: plane; width: 1.15; height: 1.2"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="loadingSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat; transparent: false"\n position="0 0.24 0"\n render-order="menu"></a-entity>\n\n <a-entity id="loadingSongInfo">\n <a-entity\n position="0 -0.05 0"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.songSubName + \' - \' + challenge.author"\n text="wrapCount: 40; align: center"\n text-truncate="length: 35"\n render-order="menutext"></a-entity>\n\n <a-entity position="0 -0.13 0"\n mixin="font"\n text="align: center; color: #FFF; wrapCount: 21; baseline: top; lineHeight: 36; width: 0.81"\n bind__text="value: challenge.metadata.songName"\n render-order="menutext"></a-entity>\n\n <a-entity\n id="loadingText"\n mixin="font"\n bind__animation__color="enabled: isLoading"\n bind__text="color: colorPrimary; value: loadingText; wrapCount: hasSongLoadError && 24 || 18"\n bind__visible="isLoading"\n text="align: center; wrapCount: 18; width: 0.65"\n render-order="menutext"\n position="0 -0.32 0.001"></a-entity>\n\n <a-entity\n id="zipLoaderIndicator"\n bind__material="color: colorPrimary"\n bind__visible="isZipFetching"\n geometry="primitive: plane; height: 0.1; width: 0.1"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.9; progress: 0; transparent: true"\n render-order="menuitem"\n position="0 -0.4 0.002">\n </a-entity>\n\n <a-entity\n id="songProcessingIndicator"\n bind__animation__spin="enabled: isSongProcessing"\n bind__material="color: colorPrimary"\n bind__visible="isSongProcessing"\n animation__spin="property: object3D.rotation.z; from: 0; to: -360; easing: linear; dur: 1000; loop: true"\n geometry="primitive: plane; height: 0.15; width: 0.15"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.4; transparent: true; progress: 0.2"\n render-order="menutext"\n position="0 -0.4 0.004"\n visible="false">\n </a-entity>\n\n <a-entity\n id="loadingCancelButton"\n mixin="bigMenuButton"\n bind-toggle__raycastable="isLoading"\n position="0 -0.67 0.01"\n proxy-event="event: click; to: a-scene; as: songloadcancel">\n <a-entity mixin="font" text="align: center; color: #FAFAFA; wrapCount: 20; value: CANCEL" position="0 -0.065 0.001"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stage.html"> --\x3e\n<a-entity\n id="audioAnalyser"\n audioanalyser="fftSize: 32; enableBeatDetection: false; enableLevels: false; enableWaveform: false; enableVolume: false"></a-entity>\n\n<a-entity id="stage" no-frustum-cull follow-z="target: #curveFollowRig">\n <a-entity\n id="backglow"\n obj-model="obj: #backGlowObj"\n materials="name: backglow"\n render-order="stage"></a-entity>\n\n <a-entity\n id="rings"\n obj-model="obj: #ringsObj"\n materials="name: rings"\n position="0 0 -1500"\n render-order="stage"></a-entity>\n\n <a-entity\n id="auroras"\n class="aurora"\n obj-model="obj: #aurorasObj"\n materials="name: aurora"\n render-order="aurora"></a-entity>\n\n <a-entity\n id="merkaba"\n obj-model="obj: #merkabaObj"\n bind__visible="!isVictory && !isGameOver"\n materials="name: merkaba"\n animation="property: rotation; from: 0 0 0; to: 360 360 360; dur: 50000; easing: linear; loop: true"\n position="0 46 -1500"></a-entity>\n\n <a-entity\n class="merkababloom"\n geometry="primitive: plane; width: 200; height: 200"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false; color: #888"\n position="0 46 -1400"\n render-order="stage"></a-entity>\n\n <a-entity\n class="merkababloom"\n bind__material="color: colorTertiary"\n geometry="primitive: plane; width: 250; height: 250"\n animation="property: object3D.rotation.z; from: 0; to: 360; loop: true; easing: linear; dur: 30000"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false"\n position="0 46 -1380"\n render-order="stage"></a-entity>\n\n <a-entity\n id="moon"\n geometry="primitive: plane; width: 1000; height: 500"\n position="0 1000 -1000"\n rotation="45 0 0"\n materials="name: moon"\n ></a-entity>\n\n <a-entity class="stars" stars render-order="particles"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/intro.html"> --\x3e\n<a-entity\n id="mainLogo"\n geometry="primitive: plane; width: 9; height: 1.125"\n material="shader: flat; src: #logoImg; transparent: true; depthTest: false; blending: additive; opacity: 0"\n position="0 3.3 -2.5"\n rotation="0 0 0"\n scale="0.8 0.8 0.8"\n bind__visible="introActive || menuActive"\n animation__opacity="property: components.material.material.opacity; from: 0; to: 1; dur: 2000; delay: 1000"\n animation__position="property: object3D.position.y; to: 3.4; dur: 2000; easing: easeInOutQuad; startEvents: startgame"></a-entity>\n\n<a-entity\n id="startButton"\n bind__visible-raycastable="introActive"\n geometry="primitive: plane; width: 1; height: 0.35"\n position="0 1.6 -2.2"\n render-order="menu"\n proxy-event="event: click; to: a-scene, #menu, #mainlogo, #menuTopButtons, #menuBackground; as: startgame"\n delayed-proxy-event="event: click; to: a-scene; as: menuopeningend; delay: 1800"\n mixin="bigMenuButton"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n material="ratio: 3; opacity: 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3000">\n <a-entity\n id="startButtonLabel"\n mixin="font"\n text="value: BEGIN; color: #f0f0f0; align: center; width: 1; wrapCount: 12; opacity: 0"\n position="0 -0.1 0.01"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3500"\n ></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/menu.html"> --\x3e\n\x3c!-- Macro is a templating function. It is rendered into the HTML below with searchResults(). --\x3e\n\n\n\n<template id="searchResultTemplate">\n <a-entity class="searchResult" bind-item__data-id="item.id" bind-item__data-index="item.index">\n <a-entity class="searchResultBackground" bind-item__active-item="active: menuSelectedChallenge.id === item.id"\n bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id"\n bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id"\n bind-toggle__raycastable="mainMenuActive || isSearching" bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.4; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75; delay: 1"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n geometry="primitive: plane; width: 1.1; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #selectedImg" position="0 -0.13 -0.002"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03" render-order="menuitem"></a-entity>\n </a-entity>\n </a-entity>\n</template>\n\n\n\x3c!-- Menu container begins here. --\x3e\n<a-entity id="menu" bind__visible="menuActive" position="0 1.4 -2.3"\n animation__position="property: object3D.position.z; to: -2; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame">\n\n <a-entity id="menuBackground"\n bind__menu-midsection="active: !!menuSelectedChallenge.id && (mainMenuActive || difficultyFilterMenuOpen) || difficultyFilterMenuOpen; selectedChallenge: menuSelectedChallenge.id"\n bind-toggle__raycastable="menuActive || genreMenuOpen || isSearching || difficultyFilterMenuOpen"\n geometry="primitive: plane; width: 3.4; height: 1.82" material="shader: panelShader; ratio: 1.86; opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n animation__midsectionshow="property: components.material.material.uniforms.midSection.value; from: 0; to: 1; dur: 160; startEvents: showdifficultysection; easing: easeOutCubic"\n animation__midsectionhide="property: components.material.material.uniforms.midSection.value; from: 1: to: 0; dur: 160; startEvents: hidedifficultysection; easing: easeOutCubic"\n render-order="menu" position="0 0 -0.005"></a-entity>\n\n <a-entity id="mainMenu" bind__visible="mainMenuActive && !isMenuOpening || isSearching">\n <a-entity id="searchResultsContainer" position="0 0 0.001" class="menuAnimation"\n bind__menu-slide-animation="isSearching: isSearching; menuSelectedChallengeId: menuSelectedChallenge.id"\n animation__menuleft="property: object3D.position.x; to: -0.79; dur: 200; easing: easeOutCubic; autoplay: false"\n animation__menuright="property: object3D.position.x; from: -0.79; to: 0; dur: 200; easing: easeOutCubic; autoplay: false">\n\n \n<a-entity id="searchResultList"\n bind-for="for: item; in: searchResultsPage; key: id; template: #searchResultTemplate; updateInPlace: true; pool: 6; delay: 25"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-index" search-result-list position="0 0.644 0">\n</a-entity>\n\n\x3c!-- All search result text merged and spaced out. --\x3e\n<a-entity id="searchSongNameTexts" mixin="font" bind__text="value: search.songNameTexts" render-order="menutext"\n text="baseline: top; align: left; color: #FAFAFA; wrapCount: 28; lineHeight: 130" position="0.181 0.51943 0.001">\n</a-entity>\n<a-entity id="searchSongSubNameTexts" mixin="font"\n bind__text="color: colorSecondaryBright; value: search.songSubNameTexts" render-order="menutext"\n text="baseline: top; align: left; wrapCount: 42; lineHeight: 190" position="0.181 0.445 0.001">\n</a-entity>\n\n<a-entity id="searchThumbnailImages" bind__search-thumbnail-atlas="dummyUpdater: search.songSubNameTexts"\n bind__visible="searchResultsPage.length > 0" geometry="primitive: plane; buffer: false; width: 0.2; height: 1.2"\n dynamic-texture-atlas="canvasId: thumbnailAtlasMap; canvasWidth: 64; canvasHeight: 512; numColumns: 1; numRows: 6"\n material="shader: flat; transparent: true" render-order="menubutton" position="-0.45 0.0146 0.002"></a-entity>\n\n<a-mixin id="searchPageButton"\n animation__mouseenter="property: components.slice9.material.opacity; from: 0; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"\n animation__mouseleave="property: components.slice9.material.opacity; from: 0.3; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"\n mixin="slice" raycaster-target="width: 1; height: 0.32" render-order="menubutton"\n slice9="width: 0.8; color: #08bfa2; height: 0.130; padding: 0.03; opacity: 0"></a-mixin>\n\n<a-entity id="searchPrevPage" mixin="searchPageButton" bind__slice9="color: colorPrimary"\n bind__visible-raycastable="search.hasPrev && (mainMenuActive || isSearching)"\n raycaster-target="bindToggle: search.hasNext && menuActive; position: 0 0.08 0" position="-0 0.69 0.01"\n proxy-event="event: click; to: a-scene; as: searchprevpage; captureBubbles: true">\n <a-entity id="prevArrow" bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" rotation="0 0 180" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n<a-entity id="searchNextPage" mixin="searchPageButton" bind__slice9="color: colorSecondary"\n raycaster-target="bindToggle: search.hasNext && (mainMenuActive || isSearching); position: 0 -0.08 0"\n position="-0 -0.674 0.01" proxy-event="event: click; to: a-scene; as: searchnextpage; captureBubbles: true"\n bind__visible="search.hasNext">\n <a-entity id="nextArrow" bind__material="color: colorSecondary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="menuDifficultiesGroup" position="0 0.18 0">\n\n \x3c!-- Top-aligned. --\x3e\n \x3c!-- Uses bind-for and bind-item to render difficulties. --\x3e\n <a-entity id="menuDifficulties" bind-for="for: item; in: menuDifficultiesIds; updateInPlace: true; pool: 10"\n bind__visible="!!menuSelectedChallenge.id"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-bind-for-key" position="0 0.34 0"\n menu-difficulty-select>\n \n <template>\n \x3c!-- Item is a string representing the difficulty. --\x3e\n <a-entity class="difficultyOption" bind-item__data-difficulty="item">\n <a-entity class="difficultyBackground"\n bind-item__active-item="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseenter="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseleave="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-background="enabled: menuActive && !!menuSelectedChallenge.id && !(menuSelectedChallenge.difficultyId === item) && !difficultyFilterMenuOpen"\n bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #difficultyImg" position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n event-set__mouseleave="visible: true; _delay: 160" render-order="menuitem"></a-entity>\n <a-entity class="difficultyText" mixin="font"\n bind-item__active-text-color="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-text="id: item" active-text-color="color: #fff"\n text="wrapCount: 30; align: center; color: #8d8d8d" position="0 -0.057 0.001" render-order="menutext">\n </a-entity>\n </a-entity>\n </template>\n \n </a-entity>\n </a-entity>\n\n \x3c!-- Selected challenge info. --\x3e\n <a-entity id="menuSelectedChallengePanel" bind__visible="!!menuSelectedChallenge.id"\n position="0.8394583182784089 0 0.001">\n <a-entity id="menuFavoriteButton" bind__animation__mouseenter="to: menuSelectedChallenge.isFavorited && 0.25 || 1"\n bind__animation__mouseleave="to: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__material="color: colorTertiary; opacity: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__raycastable="menuActive && !!menuSelectedChallenge.id"\n animation__mouseenter="property: components.material.material.opacity; startEvents: mouseenter; dur: 150; easing: easeInOutCubic"\n animation__mouseleave="property: components.material.material.opacity; startEvents: mouseleave; dur: 100; easing: easeInOutCubic"\n geometry="primitive: plane; width: 0.1; height: 0.1"\n material="src: #favoriteImg; shader: flat; transparent: true; opacity: 0.25"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1" position="0.46 0.68 0.001"\n proxy-event="event: click; to: a-scene; as: favoritetoggle" render-order="menuitem"></a-entity>\n\n <a-entity id="menuSelectedChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n geometry="primitive: plane; height: 0.4; width: 0.4" material="shader: flat" position="0 0.42 0"></a-entity>\n\n <a-entity id="menuSelectedChallengeInfoContainer" position="0 0.058 0">\n <a-entity id="menuSelectedChallengeSongAuthor" mixin="font"\n bind__text="color: colorSecondaryBright; value: (menuSelectedChallenge.metadata.songSubName || menuSelectedChallenge.metadata.songAuthorName || \'Unknown Artist\')" position="0 0.042 0"\n render-order="menutext" text="wrapCount: 40; lineHeight: 40; width: 1.185; align: center; baseline: center">\n </a-entity>\n <a-entity id="menuSelectedChallengeSongName" mixin="font"\n bind__text="color: colorPrimary; value: menuSelectedChallenge.metadata.songName" position="0 -0.059 0"\n render-order="menutext" text="align: center; wrapCount: 31; baseline: top; lineHeight: 36; width: 1.4">\n </a-entity>\n <a-entity id="menuSelectedChallengeInfo" mixin="font" bind__text="value: menuSelectedChallenge.songInfoText"\n mixin="font" position="0 -0.18 0" render-order="menutext"\n text="align: center; color: #989898; wrapCount: 55; lineHeight: 72; width: 1.5; baseline: top"></a-entity>\n </a-entity>\n\n <a-entity id="playButton"\n bind__visible-raycastable="menuActive && !!menuSelectedChallenge.id && !genreMenuOpen && !difficultyFilterMenuOpen && !isIOS && !hasSongLoadError && mpHostControl && mpCanStart"\n geometry="primitive: plane; width: 0.7; height: 0.25"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25" position="0 -0.561 0"\n proxy-event="event: click; to: a-scene; as: playbuttonclick"\n material="shader: panelShader; brightness: 0.7; transparent: true; midSection: 0; ratio: 2.8; borderRadius: 0.6; borderWidth: 0.08"\n render-order="menubutton"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 15; value: PLAY" position="0 -0.085 0.01">\n </a-entity>\n </a-entity>\n\n <a-entity id="iOSNotice" bind__visible="mainMenuActive && isIOS" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry, iOS is currently not playable but support is coming soon!">\n </a-entity>\n\n <a-entity id="menuLoadError" bind__visible="hasSongLoadError" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry! There was an error loading this song.">\n </a-entity>\n </a-entity>\n\n <a-entity id="searchError" mixin="font" bind__visible="search.hasError" render-order="menuText"\n text="align: center; value: Sorry, there was an issue fetching search results. Please try again."\n position="0 0 0.01"></a-entity>\n\n <a-entity id="menuNoPlaylists" mixin="font"\n bind__visible="playlist === \'favorites\' && favorites.length === 0 && !menuSelectedChallenge.id"\n render-order="menuText" position="0 0.1 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Add a song to your favorites by clicking the star in the top right of the menu after selected a song.">\n </a-entity>\n\n <a-entity id="searchNoResults" mixin="font"\n bind__visible="!isSearching && search.results.length === 0 && playlist !== \'favorites\'" render-order="menuText"\n text="align: center; value: No search results found. Please try again with another query." position="0 0 0.01">\n </a-entity>\n </a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/genreMenu.html"> --\x3e\n<a-entity\n id="genreMenu"\n bind-for="for: genre; in: genres; updateInPlace: true; key: name"\n bind__visible="genreMenuOpen"\n layout="type: box; columns: 6; marginRow: 0.4; marginColumn: 0.4; align: center"\n menu-genre\n position="0 0 0.05">\n <template>\n <a-entity class="genre" bind-item__data-genre="item">\n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 0.35; left: 70; top: 70; height: 0.35; padding: 0.07"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave2="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: genreMenuOpen; width: 0.35; height: 0.35"\n render-order__nonrecursive="menubutton">\n <a-entity\n mixin="font"\n bind-item__text="value: item.name"\n text="align: center; width: 1.1; color: #888"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #888; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #888; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0 -0.16 0.001"></a-entity>\n <a-entity\n class="genreIcon"\n bind-item__atlas-uvs="totalColumns: 6; totalRows: 3; row: item.row; column: item.column"\n geometry="primitive: plane; width: 0.22; height: 0.22; buffer: false; skipCache: true"\n position="0 0.04 0.002"\n material="shader: flat; src: #genresImg; transparent: true; color: #888"\n render-order="menutext"\n animation__mouseenter="property: components.material.material.color; type: color; from: #888; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.material.material.color; type: color; from: #FAFAFA; to: #888; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/difficultyMenu.html"> --\x3e\n\n\n\n\n<a-entity\n id="difficultyFilterMenu"\n bind__visible="difficultyFilterMenuOpen"\n layout="type: box; columns: 1; marginRow: -0.2"\n difficulty-filter\n position="0 0.5 0">\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="All">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'All\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'All\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'All\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'All\'"\n active-text-color="color: #fff"\n difficulty-text="id: All"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Easy">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Easy\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Easy\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Easy\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Easy\'"\n active-text-color="color: #fff"\n difficulty-text="id: Easy"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Normal">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Normal\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Normal\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Normal\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Normal\'"\n active-text-color="color: #fff"\n difficulty-text="id: Normal"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Hard">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Hard\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Hard\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Hard\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Hard\'"\n active-text-color="color: #fff"\n difficulty-text="id: Hard"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expert">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expert\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expert\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expert\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expert\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expert"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expertplus">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expertplus\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expertplus\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expertplus\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expertplus"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/optionsMenu.html"> --\x3e\n<a-entity\n id="optionsMenu"\n bind__visible="optionsMenuOpen"\n position="0 0.5 0.01"\n render-order="menutext">\n\n <a-entity id="optionsTitle" mixin="font" text="align: center; value: OPTIONS; width: 2.5"></a-entity>\n\n <a-entity id="colorOptionsContainer" position="0 -0.25 0">\n <a-entity id="colorTitle" mixin="font" text="align: center; value: THEMES; width: 2"></a-entity>\n\n <a-entity id="colorOptions" position="-0.79 -0.175 0.00" layout="type: box; columns: 10; margin: 0.2" materials-color-menu>\n \n <a-entity\n class="colorOption"\n data-color-name="Super Medium"\n data-color-scheme="default"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #f971c3; color2: #6ff9ea; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Star Warrior"\n data-color-scheme="blue"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #1e4482; color2: #c27727; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Galactic Royal"\n data-color-scheme="purple"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #6A39B3; color2: #FAF239; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Space Joker"\n data-color-scheme="green"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #779E37; color2: #6A39B3; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Solar Flare"\n data-color-scheme="yellow"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #C2C04C; color2: #E03A3E; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Trail Blazer"\n data-color-scheme="red"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #E03A3E; color2: #DADADA; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Mint Choco"\n data-color-scheme="rgb"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #34eb89; color2: #34ebd8; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Cheetah SoL"\n data-color-scheme="cheetah"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #c27727; color2: #635c54; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Ash Nova"\n data-color-scheme="black"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #555; color2: #FFF; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n </a-entity>\n\n <a-entity\n id="colorName"\n mixin="font"\n text="align: center; color: #CCC; width: 1"\n position="0 -0.35 0.1"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/playlistMenu.html"> --\x3e\n<a-entity\n id="playlistMenu"\n bind-for="for: playlist; in: playlists; updateInPlace: true; key: name"\n bind__visible="playlistMenuOpen"\n layout="type: box; columns: 2; marginRow: -0.23; marginColumn: 1.3; align: center"\n menu-playlist\n position="0 0 0.05">\n <template>\n \n <a-entity class="playlist" data-playlist="{{ item.name }}" data-title="{{ item.title }}">\n \n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 1.2; left: 70; top: 70; height: 0.19; padding: 0.07"\n animation__mouseenter="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: playlistMenuOpen; width: 1.2; height: 0.19"\n render-order__nonrecursive="menubutton">\n <a-entity\n class="playlistTitle"\n mixin="font"\n bind-item__text-uppercase="value: item.title"\n text="align: left; width: 1.3; color: #CCC"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #CCC; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #CCC; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0.11 -0.01 0.001"></a-entity>\n\n <a-entity\n class="playlistAuthor"\n mixin="font"\n bind-item__text="value: item.author"\n bind__text="color: colorPrimary"\n text="align: left; width: 1.1"\n render-order="menutext"\n position="0.01 -0.08 0.001"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\n\x3c!-- Search. --\x3e\n<a-entity id="keyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: isSearching"\n super-keyboard="label: Search on beatsaver.com; inputColor: #fff; labelColor: #f0f0f0; width: 1.5; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff"\n position="0.58 1.2 -1.95" keyboard-raycastable="condition: isSearching" search\n proxy-event__dismiss="event: superkeyboarddismiss; to: a-scene; as: keyboardclose"\n proxy-event__accept="event: superkeyboardinput; to: a-scene; as: keyboardclose" render-order="menubutton"\n render-order-recursive>\n</a-entity>\n\n<a-entity id="backButton" mixin="bigMenuTopButton"\n bind__visible-raycastable="genreMenuOpen || isSearching || difficultyFilterMenuOpen || playlistMenuOpen || optionsMenuOpen"\n position="0 2.32 -1.96" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: menuback">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 20; value: BACK" position="0 -0.07 0.01">\n </a-entity>\n</a-entity>\n\n\x3c!-- Top menu buttons. --\x3e\n<a-mixin id="bigMenuTopButton" mixin="bigMenuButton" geometry="height: 0.17; width: 0.7"></a-mixin>\n<a-mixin id="bigMenuTopButtonFont" mixin="font" text="width: 0.75" position="0 -0.05 0.01"></a-mixin>\n<a-entity id="menuTopButtons"\n animation__position="property: object3D.position.z; to: -1.98; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame"\n layout="type: line; margin: 0.65" position="-0.95 2.30 -1.96"\n proxy-event="event: startgame; to: #searchButton, #difficultyButton, #genreButton, #playlistButton, #optionButton">\n\n \x3c!-- Playlist menu toggle. --\x3e\n <a-entity id="playlistButtons">\n <a-entity id="playlistButton"\n mixin="bigMenuTopButton"\n bind__menu-playlist-button="isFavorited: menuSelectedChallenge.isFavorited; selectedChallenge: menuSelectedChallenge.id"\n bind__visible-raycastable="mainMenuActive && !playlist"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: playlistmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: PLAYLISTS" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearPlaylistButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="menuActive && !!playlist"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: playlistclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR PLAYLIST"></a-entity>\n </a-entity>\n\n <a-entity\n id="playlistText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: playlistTitle"\n bind__visible="mainMenuActive && !!playlist"\n text="align: center; baseline: bottom; wrapCount: 30; width: 0.7"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Search toggle. --\x3e\n <a-entity id="searchButtons">\n <a-entity\n id="searchButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !search.query"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: keyboardopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: SEARCH" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="searchClearButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!search.query"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: searchclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR SEARCH"></a-entity>\n </a-entity>\n\n <a-entity\n id="searchText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: search.queryText"\n bind__visible="mainMenuActive && !!search.query"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Difficulty menu toggle. --\x3e\n \x3c!-- <a-entity id="difficultyFilter">\n <a-entity id="difficultyButton"\n mixin="bigMenuTopButton"\n material="opacity: 0"\n bind__visible-raycastable="mainMenuActive"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: difficultyfiltermenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: DIFFICULTY" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity\n id="difficultyFilterText"\n mixin="font"\n bind__difficulty-text="difficulty: difficultyFilter"\n bind__text="color: colorPrimary"\n bind__visible="mainMenuActive && difficultyFilter !== \'All\'"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity> --\x3e\n\n \x3c!-- Genre menu toggle. --\x3e\n <a-entity id="genreButtons">\n <a-entity id="genreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !genre"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: genremenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: GENRES" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearGenreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!genre"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: genreclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR GENRE"></a-entity>\n </a-entity>\n\n <a-entity\n id="genreText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: genre"\n bind__visible="mainMenuActive && !!genre"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\n\x3c!-- Options menu toggle. --\x3e\n<a-entity id="optionsButtons" position="0 0.45 -1.96">\n <a-entity id="optionButton" mixin="bigMenuButton" bind__visible-raycastable="mainMenuActive" material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: optionsmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: THEMES"\n bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n</a-entity>\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/modes.html"> --\x3e\n<a-mixin\n id="modeAnimations"\n animation__select="property: object3D.position.z; to: 0.06; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: object3D.position.z; to: 0; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeThumbAnimations"\n animation__select="property: components.material.material.color; type: color; to: #FFF; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: components.material.material.color; type: color; to: #888; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeBackgroundHover"\n animation__mouseenter="property: components.material.material.uniforms.borderWidth.value; from: 0.002; to: 0.01; startEvents: mouseenter; pauseEvents: mouseleave; easing: linear; dur: 150"\n animation__mouseleave="property: components.material.material.uniforms.borderWidth.value; from: 0.01; to: 0.002; startEvents: mouseleave; pauseEvents: mouseenter; easing: linear; dur: 150"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.3"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n\n ></a-mixin>\n\n<a-mixin\n id="modeBackgroundSelect"\n animation__select="property: components.material.material.uniforms.brightness.value; to: 0.5; startEvents: select; easing: easeOutQuad; dur: 200"\n animation__deselect="property: components.material.material.uniforms.brightness.value; to: 0.1; startEvents: deselect; easing: easeOutQuad; dur: 200"\n animation__select2="property: components.material.material.uniforms.borderWidth.value; to: 0.015; startEvents: select; easing: linear; dur: 200"\n animation__deselect2="property: components.material.material.uniforms.borderWidth.value; to: 0.002; startEvents: deselect; easing: linear; dur: 200"></a-mixin>\n\n\n\n<a-entity\n id="modes"\n bind__menu-mode="colorScheme: colorScheme; hasVR: hasVR"\n bind__position="hasVR && \'-2.56 1.3 -0.7\' || \'-2.56 1 -0.7\'"\n bind__visible="menuActive && !isMenuOpening"\n rotation="0 60 0"\n render-order="menuitem">\n\n <a-entity id="modeIcon"\n geometry="primitive: cylinder; height: 0.01; segmentsHeight: 1; radius: 0.1; segmentsRadial: 3"\n rotation="0 90 90"\n position="-1.275 0.32 0.1"\n materials="name: merkaba"\n animation="property: object3D.position.x; from: -1.275; to: -1.3; dir: alternate; easing: easeOutQuad; loop: true; dur: 900"></a-entity>\n\n <a-entity id="mode2d" bind__visible="!hasVR">\n \n\n<a-entity\n id="moderide2d"\n class="modeItem"\n data-mode="ride"\n data-name="ride2d"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeviewer2d"\n class="modeItem"\n data-mode="classic"\n data-name="viewer2d"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: VIEWER\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeViewerImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: View the beat map.\n\nConnect a VR headset\nwith controllers\nto experience\nmore modes!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="modeVR" bind__visible="hasVR">\n \n\n<a-entity\n id="modepunchvr"\n class="modeItem"\n data-mode="punch"\n data-name="punchvr"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: PUNCH\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modePunchImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Punch the beats, mind\ncolor.\n\nAvoid all things yellow.\n\nPunch harder\n for better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="moderidevr"\n class="modeItem"\n data-mode="ride"\n data-name="ridevr"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.\n\nTake a quick breather.\n\nNo score!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeclassicvr"\n class="modeItem"\n data-mode="classic"\n data-name="classicvr"\n position="0 -0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: CLASSIC\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeClassicImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Cut the beats, mind\ncolor and direction.\n\nAvoid all things yellow.\n\nSwing fast and accurate\nfor better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n\n <a-entity\n id="modeMultiplayer"\n class="modeItem"\n multiplayer-button\n position="0 -1.50 0">\n <a-entity\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.55"\n material="shader: panelShader; brightness: 0.1; ratio: 5.5; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n mixin="font"\n text="align: left; value: MULTIPLAYER; lineHeight: 45; width: 2.6; color: #FFF"\n render-order="menutext"\n position="-1.0 0.00 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="color: colorPrimary"\n text="value: Race a friend in real time.\nCreate a room or join with a code.; width: 1.6; lineHeight: 47"\n render-order="menutext"\n position="0.50 0.00 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="loadingTipsContainer"\n bind__visible="menuActive"\n position="0 -1.3 0.1"\n rotation="0 0 0">\n\n <a-entity\n id="loadingTipsBackground"\n bind-toggle__raycastable="menuActive"\n render-order="menu"\n geometry="primitive: plane; width: 1.5; height: 0.3"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n render-order="menubutton"\n position="0 0 -0.03"></a-entity>\n\n <a-entity\n id="loadingTipsText"\n mixin="font"\n bind__text="color: colorPrimary"\n text="align: center; wrapCount: 30; width: 1; value: Press down on thumbstick center to open menu while playing."\n render-order="menutext"\n position="0 -0.02 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/victory.html"> --\x3e\n\x3c!-- Victory. --\x3e\n<a-entity\n id="victoryInfoContainer"\n position="0 1.5 -2"\n bind__visible="isVictory">\n\n <a-entity\n id="victoryAccuracyRing"\n bind__material="color: colorPrimary"k\n bind__victory-accuracy-ring="accuracy: score.finalAccuracy"\n animation="property: components.material.material.uniforms.progress.value; from: 0; easing: easeOutQuad; delay: 500; dur: 2500; autoplay: false"\n geometry="primitive: plane; width: 0.7; height: 0.7"\n material="shader: ring; transparent: true; radiusInner: 0.8; blending: additive; depthWrite: false"\n position="0 0.18 0"\n render-order="victory"></a-entity>\n\n <a-entity\n id="victoryInfoRank"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__victory-rank="isVictory: isVictory; rank: score.rank"\n bind-toggle__raycastable="isVictory"\n scale="0 0 0"\n position="0 -0.034 0"\n animation__rotation="property: object3D.rotation.y; from: 0; to: -360; loop: true; easing: linear; dur: 5000; startEvents: textcounterdone"\n animation__scale="property: scale; from: 0 0 0; to: 1 1 1; loop: false; easing: easeOutQuad; dur: 300; startEvents: textcounterdone"\n play-sound="sound: #victorySound; event: textcounterdone"\n render-order="menuitemtext"\n text-geometry="font: #VigaRegularThree; bevelEnabled: true; bevelSize: 0.01; bevelThickness: 0.01; curveSegments: 7; height: 0.15; size: 0.4"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.score + \' POINTS\'"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.2 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoBeatsHit"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.beatsText"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.1 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n mixin="font"\n bind__text="color: colorTertiary"\n text="value: 0; align: center; wrapCount: 15; baseline: top; width: 2.25"\n bind__text-counter="enabled: isVictory; value: score.finalAccuracy"\n text-counter="suffix: %"\n position="0 -0.47 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoMaxCombo"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-counter="enabled: isVictory; value: score.maxCombo"\n text="align: center; wrapCount: 22; baseline: top; width: 1"\n text-counter="prefix: MAX STREAK: ; emit: true"\n proxy-event="event: textcounterdone; to: .accuracyTextCounterSubscribe"\n position="0 -0.58 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryButtons"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n render-order="menubutton">\n <a-entity\n id="victoryRestartButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="-0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: PLAY AGAIN"></a-entity>\n </a-entity>\n\n <a-entity\n id="victoryExitButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: BACK TO MENU"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/leaderboard.html"> --\x3e\n<a-entity\n id="leaderboard"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__scale="isVictory && \'0 0 0\' || \'1 1 1\'"\n bind__visible="(!!menuSelectedChallenge.id || !!challenge.id) && (menuActive || isPaused || isVictory || isLoading) && !genreMenuOpen && gameMode !== \'ride\'"\n position="2.36 1.5 -1.19"\n rotation="0 -60 0"\n animation="property: scale; from: 0 0 0; to: 1 1 1; easing: easeOutBack; startEvents: textcounterdone"\n render-order="menuitem">\n\n <a-entity\n bind-toggle__raycastable="leaderboardActive"\n id="leaderboardBackground" position="0 0 0"\n geometry="primitive: plane; width: 2; height: 2"\n material="shader: panelShader; ratio: 1.16; brightness: 0.2"></a-entity>\n\n <a-entity\n id="leaderboardChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n bind__visible="!isVictory"\n geometry="primitive: plane; height: 0.12; width: 0.12"\n material="shader: flat"\n position="-0.44 0.63 0.001"></a-entity>\n\n <a-entity\n id="leaderboardTitle"\n mixin="font"\n text="align: center; width: 2.5; value: LEADERBOARD"\n position="0.05 0.55 0.001"\n bind__visible="!leaderboardQualified"></a-entity>\n\n <a-entity\n id="leaderboardNames"\n mixin="font"\n bind__text="color: colorSecondary; value: leaderboardNames"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; width: 1.2; anchor: left; wrapCount: 28; lineHeight: 53;"\n position="-0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardScores"\n mixin="font"\n bind__text="value: leaderboardScores"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; align: right; width: 1.2; anchor: right; color: #fff; wrapCount: 28; lineHeight: 53;"\n position="0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardEmpty"\n mixin="font"\n bind__visible="leaderboard.length === 0 && !leaderboardQualified && !leaderboardLoading"\n text="align: center; color: #999; baseline: center; width: 2; value: No high scores. Be the first!"\n position="0 0 0.001"></a-entity>\n\n <a-entity\n id="leaderboardKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: leaderboardQualified"\n super-keyboard="inputColor: #fff; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 15; width: 1.5; label: NEW HIGH SCORE!\nENTER THE LEADERBOARD; labelColor: #FAFAFA"\n position="0 -0.08 0.02"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: leaderboardusername"\n keyboard-raycastable="condition: leaderboardQualified"\n render-order="menutext"\n render-order-recursive>\n </a-entity>\n\n <a-entity id="leaderboardSubmit"\n position="0 -0.67 0.002"\n mixin="bigMenuButton"\n bind__visible-raycastable="leaderboardQualified"\n proxy-event="event: click; to: a-scene; as: leaderboardsubmit">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 26; value: SUBMIT HIGH SCORE" position="0 -0.055 0.01"></a-entity>\n \x3c!--slice9="width: 1.5; height: 0.24"--\x3e\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/multiplayerLobby.html"> --\x3e\n\x3c!--\n Multiplayer lobby panel + in-game HUD + victory results overlay.\n All conditional colors / opacities / labels are precomputed in state to\n avoid ternary expressions in bind__ attributes (aframe-state-component\n evaluates simple property paths reliably; complex JS is fragile).\n--\x3e\n\n\n\n<a-entity\n id="multiplayerLobby"\n bind__visible="mpLobbyVisible"\n position="0 1.55 -1.4"\n render-order="menu">\n\n \x3c!-- Background --\x3e\n <a-entity\n bind-toggle__raycastable="mpLobbyVisible"\n geometry="primitive: plane; width: 1.7; height: 1.35"\n material="shader: panelShader; brightness: 0.18; ratio: 1.26; borderWidth: 0.005; borderRadius: 0.04"\n render-order="menu"\n position="0 0 -0.02"></a-entity>\n\n \x3c!-- Title --\x3e\n <a-entity\n mixin="font"\n text="align: center; value: MULTIPLAYER; width: 1.5; lineHeight: 50; color: #FFF"\n render-order="menutext"\n position="0 0.60 0"></a-entity>\n\n \x3c!-- Room code --\x3e\n <a-entity\n mixin="font"\n bind__text="value: mpRoomCodeText; color: colorSecondaryBright"\n text="align: center; width: 1.5; lineHeight: 80"\n render-order="menutext"\n position="0 0.46 0"></a-entity>\n\n \x3c!-- Status / instructions --\x3e\n <a-entity\n mixin="font"\n bind__text="value: mpStatusText; color: colorPrimary"\n text="align: center; width: 1.5; wrapCount: 38; lineHeight: 50"\n render-order="menutext"\n position="0 0.34 0"></a-entity>\n\n \x3c!-- Player rows --\x3e\n <a-entity position="0 0.13 0">\n \n<a-entity position="0 0 0" bind__visible="multiplayer.row0Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row0BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row0Name; color: multiplayer.row0NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row0Score; color: multiplayer.row0ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n \n<a-entity position="0 -0.13 0" bind__visible="multiplayer.row1Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row1BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row1Name; color: multiplayer.row1NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row1Score; color: multiplayer.row1ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n \n<a-entity position="0 -0.26 0" bind__visible="multiplayer.row2Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row2BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row2Name; color: multiplayer.row2NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row2Score; color: multiplayer.row2ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n \n<a-entity position="0 -0.39 0" bind__visible="multiplayer.row3Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row3BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row3Name; color: multiplayer.row3NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row3Score; color: multiplayer.row3ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n \x3c!-- Action button row 1: idle (no room) --\x3e\n <a-entity position="0 -0.42 0">\n <a-entity\n bind__visible="!mpInRoom"\n bind-toggle__raycastable="mpLobbyVisible && !mpInRoom"\n position="-0.40 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.65; height: 0.16"\n material="shader: panelShader; brightness: 0.30; ratio: 4.0; borderWidth: 0.004"\n proxy-event="event: click; as: mpcreate; to: a-scene"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n text="align: center; value: CREATE ROOM; width: 0.6; lineHeight: 60; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n <a-entity\n bind__visible="!mpInRoom"\n bind-toggle__raycastable="mpLobbyVisible && !mpInRoom"\n position="0.40 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.65; height: 0.16"\n material="shader: panelShader; brightness: 0.30; ratio: 4.0; borderWidth: 0.004"\n multiplayer-join-button\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n bind__text="value: mpJoinButtonText"\n text="align: center; width: 0.6; lineHeight: 60; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n \x3c!-- READY (in lobby phase) --\x3e\n <a-entity\n bind__visible="mpInLobbyPhase"\n bind-toggle__raycastable="mpInLobbyPhase"\n position="-0.55 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.50; height: 0.16"\n bind__material="brightness: mpReadyButtonBrightness"\n material="shader: panelShader; ratio: 3.1; borderWidth: 0.004"\n multiplayer-ready-button\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n bind__text="value: mpReadyButtonText; color: mpReadyButtonColor"\n text="align: center; width: 0.5; lineHeight: 60"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n \x3c!-- Share link (in room) --\x3e\n <a-entity\n bind__visible="mpInRoom"\n bind-toggle__raycastable="mpInRoom"\n position="0 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.55; height: 0.16"\n material="shader: panelShader; brightness: 0.20; ratio: 3.4; borderWidth: 0.004"\n proxy-event="event: click; as: mpsharelink; to: a-scene"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n bind__text="value: mpShareButtonText; color: mpShareButtonColor"\n text="align: center; width: 0.55; lineHeight: 65"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n \x3c!-- Name editor (in room) --\x3e\n <a-entity\n bind__visible="mpInRoom"\n bind-toggle__raycastable="mpInRoom"\n position="0.55 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.50; height: 0.16"\n material="shader: panelShader; brightness: 0.20; ratio: 3.1; borderWidth: 0.004"\n multiplayer-name-button\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n text="align: center; value: SET NAME; width: 0.5; lineHeight: 60; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Action button row 2: leave + back --\x3e\n <a-entity position="0 -0.59 0">\n <a-entity\n bind__visible="mpInRoom"\n bind-toggle__raycastable="mpInRoom"\n position="0 0 0"\n geometry="primitive: plane; width: 0.55; height: 0.13"\n material="shader: panelShader; brightness: 0.10; ratio: 4.2; borderWidth: 0.003"\n proxy-event="event: click; as: mpleave; to: a-scene">\n <a-entity\n mixin="font"\n text="align: center; value: LEAVE ROOM; width: 0.55; lineHeight: 70; color: #888"\n position="0 0 0.001"></a-entity>\n </a-entity>\n <a-entity\n bind__visible="!mpInRoom"\n bind-toggle__raycastable="mpLobbyVisible && !mpInRoom"\n position="0 0 0"\n proxy-event="event: click; as: mpclose; to: a-scene">\n <a-entity\n mixin="font"\n text="align: center; value: < back to modes; width: 1.2; lineHeight: 60; color: #555"\n render-order="menutext"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== IN-GAME COUNTDOWN OVERLAY ===================== --\x3e\n<a-entity\n id="mpCountdown"\n bind__visible="mpCountdownVisible"\n position="0 1.7 -2"\n render-order="menu">\n <a-entity\n geometry="primitive: plane; width: 1.4; height: 0.4"\n material="shader: panelShader; brightness: 0.30; ratio: 3.5; borderWidth: 0.005"\n position="0 0 -0.01"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.countdownText; color: colorSecondaryBright"\n text="align: center; width: 1.3; lineHeight: 30"\n render-order="menutext"></a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== IN-GAME OPPONENT HUD ===================== --\x3e\n<a-entity\n id="mpHud"\n bind__visible="mpHudVisible"\n position="-1.45 1.65 -1.0"\n rotation="0 35 0"\n render-order="menu">\n <a-entity\n geometry="primitive: plane; width: 0.85; height: 0.55"\n material="shader: panelShader; brightness: 0.10; ratio: 1.55; borderWidth: 0.002"\n position="0 0 -0.01"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: mpRankHudText; color: colorSecondaryBright"\n text="align: left; width: 0.75; lineHeight: 60"\n position="-0.34 0.22 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.scoreDeltaText; color: mpDeltaColor"\n text="align: right; width: 0.75; lineHeight: 65"\n position="0.34 0.22 0"></a-entity>\n <a-entity\n mixin="font"\n text="align: left; value: OPPONENTS; width: 0.75; lineHeight: 80; color: #888"\n position="-0.34 0.10 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.opponentText; color: colorPrimary"\n text="align: left; width: 0.75; lineHeight: 60"\n position="-0.34 -0.02 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.opponentScores"\n text="align: right; width: 0.75; lineHeight: 60; color: #FFF"\n position="0.34 -0.02 0"></a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== VICTORY RESULTS ===================== --\x3e\n<a-entity\n id="mpResults"\n bind__visible="mpResultsVisible"\n position="0 1.05 -1.6"\n render-order="menu">\n <a-entity\n geometry="primitive: plane; width: 1.6; height: 0.7"\n material="shader: panelShader; brightness: 0.20; ratio: 2.3; borderWidth: 0.004"\n position="0 0 -0.02"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: mpWinnerBanner; color: colorSecondaryBright"\n text="align: center; width: 1.5; lineHeight: 30"\n position="0 0.27 0"></a-entity>\n <a-entity\n mixin="font"\n text="align: center; value: ROOM RESULTS; width: 1.4; lineHeight: 70; color: #888"\n position="0 0.13 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.resultsText"\n text="align: left; width: 1.4; lineHeight: 50; color: #FFF"\n position="-0.65 -0.02 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.resultsScores"\n text="align: right; width: 1.4; lineHeight: 50; color: #FFF"\n position="0.65 -0.02 0"></a-entity>\n <a-entity\n bind__visible="multiplayer.isHost"\n bind-toggle__raycastable="multiplayer.isHost && mpResultsVisible"\n position="0 -0.27 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.7; height: 0.13"\n material="shader: panelShader; brightness: 0.30; ratio: 5.4; borderWidth: 0.003"\n proxy-event="event: click; as: mprematch; to: a-scene">\n <a-entity\n mixin="font"\n text="align: center; value: REMATCH; width: 0.7; lineHeight: 65; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== ROOM-CODE KEYBOARD (in-VR) ===================== --\x3e\n<a-entity\n id="mpKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: mpKeyboardOpen"\n super-keyboard="hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 4; width: 1.3; label: ENTER ROOM CODE; labelColor: #FAFAFA; inputColor: #fff"\n position="0 1.3 -1.3"\n render-order="menutext"\n multiplayer-keyboard-bridge\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: mpcodeinput"\n proxy-event__submit="event: superkeyboarddismiss; to: a-scene; as: mpkeyboardsubmit"\n bind-toggle__raycastable="mpKeyboardOpen"\n render-order-recursive>\n</a-entity>\n\n\n\x3c!-- ===================== NAME KEYBOARD (in-VR) ===================== --\x3e\n<a-entity\n id="mpNameKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: mpNameKeyboardOpen"\n super-keyboard="hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 14; width: 1.3; label: ENTER YOUR NAME; labelColor: #FAFAFA; inputColor: #fff"\n position="0 1.3 -1.3"\n render-order="menutext"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: mpnameinput"\n proxy-event__submit="event: superkeyboarddismiss; to: a-scene; as: mpnamekeyboardsubmit"\n bind-toggle__raycastable="mpNameKeyboardOpen"\n render-order-recursive>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/news.html"> --\x3e\n\n\n\n\n\n<a-entity\n id="news"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n position="2.365374194652176 1.6 -1.1952715561051024"\n rotation="0 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="newsBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 1.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="newsText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1.6; wrapCount: 50; value: three.ws\n\nGive your AI a body. three.ws is an open-source, browser-native 3D AI agent platform.\n\nDrop a GLB file, add an LLM brain, register on-chain, and embed anywhere — no plugins, no installs.\n\nVisit three.ws to build your agent."\n position="0 -0.04 0.001"></a-entity>\n</a-entity>\n\n<a-entity\n id="support"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening && inVR"\n position="2.365374194652176 0.25 -1.1952715561051024"\n rotation="-15 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="supportBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 0.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="supportImage"\n geometry="primitive: plane; width: 0.6; height: 0.5"\n material="shader: flat; src: assets/img/banner.jpg"\n position="-0.5 0 0.001"></a-entity>\n\n <a-entity\n id="supportText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1; wrapCount: 30; value: Support three.ws development.\n\nVisit three.ws for more."\n position="0.35 -0.04 0.001"></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n <a-mixin\n id="cursorMesh"\n material="shader: flat; transparent: true; src: #cursorMeshImg; depthTest: false"\n sub-object="from: #cursorLaser; name: glow"></a-mixin>\n\n <a-entity\n id="curve"\n material="shader: supercurve"\n supercurve\n supercurve-color\n render-order="curve"></a-entity>\n\n <a-entity\n id="tunnelsContainer"\n render-order="curve"\n bind__visible="isPlaying || isPaused"></a-entity>\n\n <a-entity\n id="beatContainer"\n beat-hit-sound\n bind__visible="isPlaying"></a-entity>\n\n <a-entity\n id="wallContainer"\n bind__visible="isPlaying"></a-entity>\n\n <a-entity id="curveFollowRig"\n bind__curve-follow-rig-reset="isVictory: isVictory"\n bind__supercurve-follow="enabled: isPlaying; speed: speed"\n supercurve-follow="target: #curve">\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stageFollow.html"> --\x3e\n<a-entity\n id="tube"\n bind__visible="isPlaying"\n rotation="90 180 0"\n position="0 0 -5"\n geometry="primitive: cylinder; radius: 3; openEnded: true; height: 20"\n materials="name: tube"\n animation="property: components.materials.material.uniforms.opacity.value; from: 1; to: 0; easing: easeInOutCubic; startEvents: pulse"></a-entity>\n\n<a-entity\n id="platformShadow"\n obj-model="obj: #homeShadowObj"\n position="0 0.02 0"\n material="src: #homeShadowImg; shader: flat; blending: multiply; transparent: true;"\n raycastable-game\n render-order="curveshadow"\n stepback></a-entity>\n\n<a-entity\n id="platform"\n obj-model="obj: #homeObj"\n materials="name: home"\n bind__materials="animate: isPlaying"></a-entity>\n\n<a-entity\n id="sideGlows"\n bind__visible="isPlaying || isPaused">\n <a-entity\n id="leftSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: leftsideglow"\n position="-2.1 .5 -3"\n rotation="20 -90 0"\n render-order="sideglow">\n </a-entity>\n <a-entity\n id="rightSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: rightsideglow"\n position="2.1 .5 -3"\n rotation="-20 -90 0"\n render-order="sideglow">\n </a-entity>\n</a-entity>\n\n<a-entity\n id="light"\n light="type: hemisphere; color: #666"\n position="0 10 20"></a-entity>\n\n\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/score.html"> --\x3e\n<a-mixin\n id="scoreText"\n mixin="font"\n text="lineHeight: 40; color: #FAFAFA; letterSpacing: -2; align: center; opacity: 0.7"></a-mixin>\n\n<a-entity\n id="scoreContainer"\n bind__score-texts="isLoading: isLoading"\n bind__visible="score.active"\n render-order="score">\n\n <a-entity\n id="songProgressRing"\n bind__material="color: colorSecondary"\n bind__song-progress-info="enabled: isPlaying || isPaused && challenge.isBeatsPreloaded"\n geometry="primitive: plane; width: 0.57; height: 0.03"\n material="shader: flat"\n position="1.525 0.1 -3.94"\n rotation="-30 0 0">\n </a-entity>\n\n <a-entity id="scoreNumberContainer" position="1.5 0.13 -4">\n <a-entity\n id="combo"\n mixin="scoreText"\n bind__text="color: colorPrimary; value: \'STREAK \' + score.combo"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"\n position="-0.025 0.175 0"></a-entity>\n\n <a-entity\n id="accuracy"\n mixin="scoreText"\n bind__text="color: colorSecondary; value: score.accuracyInt + \'%\' + \' / \' + score.score"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/gameMenu.html"> --\x3e\n<a-mixin\n id="gameMenuButton"\n mixin="bigMenuButton"\n animation__mouseenter="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 70"\n animation__mouseleave="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 70"\n geometry="height: 0.28"></a-mixin>\n\n<a-mixin\n id="gameMenuButtonText"\n mixin="font"\n position="0 -0.08 0.01"\n render-order="menutext"\n text="align: center; wrapCount: 17"></a-mixin>\n\n\x3c!-- Titles. --\x3e\n<a-entity id="inGameMenuTitles" position="0 2.2 -2.3">\n <a-entity mixin="gameMenuButtonText" text="value: GAME OVER; color: #f01978; width: 3.5" bind__visible="isGameOver"></a-entity>\n <a-entity mixin="gameMenuButtonText" text="value: SONG CLEARED; color: #FFF; width: 3.5" bind__visible="isVictory" position="0 0.1 0"></a-entity>\n <a-entity mixin="gameMenuButtonText" bind__text="color: colorPrimary" text="value: PAUSED; width: 3.5" bind__visible="isPaused"></a-entity>\n</a-entity>\n\n<a-entity\n id="gameMenu"\n bind__visible="isPaused || isVictory"\n position="0 1.5 -2"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25">\n\n \x3c!-- Actions. --\x3e\n <a-entity\n id="resumeButton"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isPaused"\n bind__visible="isPaused"\n position="0 0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuresume">\n <a-entity mixin="gameMenuButtonText" text="value: RESUME"></a-entity>\n </a-entity>\n\n <a-entity\n id="restartButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity mixin="gameMenuButtonText" text="value: RESTART SONG"></a-entity>\n </a-entity>\n\n <a-entity\n id="exitButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n position="0 -0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity mixin="gameMenuButtonText" text="value: EXIT TO MENU"></a-entity>\n </a-entity>\n\n \x3c!-- Song info. --\x3e\n <a-entity id="gameMenuSongInfoContainer"\n position="0 -1 0.15473"\n rotation="-20 0 0"\n song-info-positioner\n bind__song-info-positioner="victory: isVictory">\n <a-entity id="gameMenuSongBackground"\n bind-toggle__raycastable="isPaused || isVictory"\n render-order="menu"\n geometry="primitive: plane; width: 2.5; height: 0.3"\n material="shader: panelShader; transparent: true; ratio: 4; borderRadius: 0.5; borderWidth: 0.02"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="gameMenuSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat"\n position="-1 0 0"></a-entity>\n\n <a-entity id="gameMenuSongInfo">\n <a-entity\n id="gameMenuSongName"\n position="0 0.01 0"\n mixin="font" text="align: center; color: #fff; wrapCount: 30; baseline: top; lineHeight: 36; width: 1.2"\n bind__text="value: challenge.metadata.songName"></a-entity>\n <a-entity\n id="gameMenuSongSubName"\n mixin="font"\n position="0 -0.09 0"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.metadata.songSubName + \' - \' + challenge.metadata.songAuthorName"\n text-truncate="length: 80"\n text="wrapCount: 80; align: center; width: 2.4" bind__text="value: menuSelectedChallenge.songSubName"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n \x3c!-- Beat pieces, explosions, fx, and weapon trail. --\x3e\n <a-entity id="rigContainer"></a-entity>\n\n \x3c!-- Supercut FX rings. --\x3e\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n\n \x3c!-- Player. --\x3e\n <a-entity id="cameraRig">\n <a-entity\n id="camera"\n bind__wasd-controls="enabled: !inVr"\n position="0 1.6 0.5"\n camera="far: 10000"\n look-controls\n player-height\n wasd-controls="acceleration: 15"></a-entity>\n \x3c!-- Agent companion seated next to player. The GLB has its origin at\n the feet, so we drop it ~0.45m below camera height; rider has no\n visible floor at the player position, so the lower legs fade out\n and only the seated upper body is visible. --\x3e\n <a-entity\n id="agentCompanion"\n gltf-model="#agentGlb"\n agent-dance="initial: sitclap"\n position="0.7 0.45 0.5"\n rotation="0 165 0"\n scale="0.9 0.9 0.9"></a-entity>\n <a-entity\n id="cameraWallCollider"\n bind__raycaster__wall="enabled: isPlaying && gameMode !== \'ride\'"\n proxy-event__wallhitstart="event: raycaster-intersection; to: a-scene; as: wallhitstart"\n proxy-event__wallhitend="event: raycaster-intersection-cleared; to: a-scene; as: wallhitend"\n follow-position="target: #camera"\n raycaster__wall="objects: [data-wall-active]; interval: 150; direction: 0 -1 0; far: 5"\n visible="false"></a-entity>\n </a-entity>\n\n <a-entity\n id="controllerRig"\n proxy-event="event: recentered; to: #cameraRig; captureBubbles: true; as: recenter">\n \n\n \n <a-entity id="leftHand"\n class="weapon"\n bind__hand-swapper="enabled: rightRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: leftRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: left"\n desktop-input="hand: left"\n data-hand="left"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: left"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 71; direction: 0 1 -1"\n weapon="hand: left"\n weapon-particles="hand: left"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: left; controllerType: vive-controls"\n render-order="weapon"\n trail="color: primary; hand: left">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="leftLaser"\n class="laser"\n bind__material="color: colorPrimary"\n bind__cursor-laser="enabled: activeHand === \'left\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeleft"\n obj-model="obj: #weaponObj"\n materials="name: leftWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: leftWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="leftpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #leftFistObj"\n materials="name: leftFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #leftFistWeaponObj"\n materials="name: leftFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="leftstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="leftCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: leftRaycasterActive && !isPlaying"\n bind__material="color: colorPrimary"\n cursor-mesh="cursorEl: #leftHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n \n <a-entity id="rightHand"\n class="weapon"\n bind__hand-swapper="enabled: leftRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: rightRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: right"\n desktop-input="hand: right"\n data-hand="right"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: right"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 70; direction: 0 1 -1"\n weapon="hand: right"\n weapon-particles="hand: right"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: right; controllerType: vive-controls"\n render-order="weapon"\n trail="color: secondary; hand: right">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="rightLaser"\n class="laser"\n bind__material="color: colorSecondary"\n bind__cursor-laser="enabled: activeHand === \'right\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeright"\n obj-model="obj: #weaponObj"\n materials="name: rightWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: rightWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="rightpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #rightFistObj"\n materials="name: rightFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #rightFistWeaponObj"\n materials="name: rightFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="rightstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="rightCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: rightRaycasterActive && !isPlaying"\n bind__material="color: colorSecondary"\n cursor-mesh="cursorEl: #rightHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n </a-entity>\n\n <a-entity\n id="stepback"\n position="0 1.6 -1.55"\n geometry="primitive: plane; width: 0.25; height: 0.25;"\n material="shader: flat; src: #stepbackImg; transparent: true; opacity: 0"\n render-order="stepback"></a-entity>\n </a-entity>\n\n <a-entity\n id="mouseCursor"\n bind__raycaster="enabled: !inVR"\n cursor="rayOrigin: mouse"\n raycaster="objects: [raycastable]"></a-entity>\n <a-entity\n id="mouseCursorMesh"\n mixin="cursorMesh"\n cursor-mesh="cursorEl: #mouseCursor"\n bind__cursor-mesh="active: menuActive"\n render-order="cursor"></a-entity>\n\n <a-entity\n tail="target: #leftstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n <a-entity\n tail="target: #rightstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n</a-scene>\n';document.addEventListener("DOMContentLoaded",(function(){let e=document.getElementById("app");e||(e=document.createElement("div"),e.id="app",document.body.appendChild(e));e.innerHTML=r}));{const t=n(240).DiffDOM;if(e.hot.accept(),e.hot.data&&e.hot.data.oldHtml){const n=e.hot.data.oldHtml,i=new t,o=document.createElement("div");o.innerHTML=n;const a=document.createElement("div");a.innerHTML=r;const s=i.diff(o.querySelector("a-scene"),a.querySelector("a-scene"));i.apply(document.querySelector("a-scene"),s)}e.hot.dispose(e=>{e.oldHtml=r})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t,n){let i;return"#text"===e.nodeName?i=n.document.createTextNode(e.data):"#comment"===e.nodeName?i=n.document.createComment(e.data):("svg"===e.nodeName||t?(i=n.document.createElementNS("http://www.w3.org/2000/svg",e.nodeName),t=!0):i=n.document.createElement(e.nodeName),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>i.setAttribute(e,t)),e.childNodes&&e.childNodes.forEach(e=>i.appendChild(r(e,t,n))),n.valueDiffing&&(e.value&&(i.value=e.value),e.checked&&(i.checked=e.checked),e.selected&&(i.selected=e.selected))),i}function i(e,t){for(t=t.slice();t.length>0;){if(!e.childNodes)return!1;const n=t.splice(0,1)[0];e=e.childNodes[n]}return e}function o(e,t,n){let o,a,s,c,l,u=i(e,t[n._const.route]);const h={diff:t,node:u};if(n.preDiffApply(h))return!0;switch(t[n._const.action]){case n._const.addAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.value]);break;case n._const.modifyAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.newValue]),"INPUT"===u.nodeName&&"value"===t[n._const.name]&&(u.value=t[n._const.oldValue]);break;case n._const.removeAttribute:if(!u||!u.removeAttribute)return!1;u.removeAttribute(t[n._const.name]);break;case n._const.modifyTextElement:if(!u||3!==u.nodeType)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyValue:if(!u||void 0===u.value)return!1;u.value=t[n._const.newValue];break;case n._const.modifyComment:if(!u||void 0===u.data)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyChecked:if(!u||void 0===u.checked)return!1;u.checked=t[n._const.newValue];break;case n._const.modifySelected:if(!u||void 0===u.selected)return!1;u.selected=t[n._const.newValue];break;case n._const.replaceElement:u.parentNode.replaceChild(r(t[n._const.newValue],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u);break;case n._const.relocateGroup:c=Array(...new Array(t.groupLength)).map(()=>u.removeChild(u.childNodes[t[n._const.from]])),c.forEach((e,r)=>{0===r&&(a=u.childNodes[t[n._const.to]]),u.insertBefore(e,a||null)});break;case n._const.removeElement:u.parentNode.removeChild(u);break;case n._const.addElement:s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],u=i(e,s),u.insertBefore(r(t[n._const.element],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u.childNodes[l]||null);break;case n._const.removeTextElement:if(!u||3!==u.nodeType)return!1;u.parentNode.removeChild(u);break;case n._const.addTextElement:if(s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],o=n.document.createTextNode(t[n._const.value]),u=i(e,s),!u||!u.childNodes)return!1;u.insertBefore(o,u.childNodes[l]||null);break;default:console.log("unknown action")}return h.newNode=o,n.postDiffApply(h),!0}function a(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function s(e,t,n){t.length||(t=[t]),(t=t.slice()).reverse(),t.forEach(t=>{!function(e,t,n){switch(t[n._const.action]){case n._const.addAttribute:t[n._const.action]=n._const.removeAttribute,o(e,t,n);break;case n._const.modifyAttribute:a(t,n._const.oldValue,n._const.newValue),o(e,t,n);break;case n._const.removeAttribute:t[n._const.action]=n._const.addAttribute,o(e,t,n);break;case n._const.modifyTextElement:case n._const.modifyValue:case n._const.modifyComment:case n._const.modifyChecked:case n._const.modifySelected:case n._const.replaceElement:a(t,n._const.oldValue,n._const.newValue),o(e,t,n);break;case n._const.relocateGroup:a(t,n._const.from,n._const.to),o(e,t,n);break;case n._const.removeElement:t[n._const.action]=n._const.addElement,o(e,t,n);break;case n._const.addElement:t[n._const.action]=n._const.removeElement,o(e,t,n);break;case n._const.removeTextElement:t[n._const.action]=n._const.addTextElement,o(e,t,n);break;case n._const.addTextElement:t[n._const.action]=n._const.removeTextElement,o(e,t,n);break;default:console.log("unknown action")}}(e,t,n)})}n.r(t),n.d(t,"DiffDOM",(function(){return x})),n.d(t,"TraceLogger",(function(){return S}));class c{constructor(e={}){Object.entries(e).forEach(([e,t])=>this[e]=t)}toString(){return JSON.stringify(this)}setValue(e,t){return this[e]=t,this}}function l(e){const t=[];return"#text"!==e.nodeName&&"#comment"!==e.nodeName&&(t.push(e.nodeName),e.attributes&&(e.attributes.class&&t.push(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`),e.attributes.id&&t.push(`${e.nodeName}#${e.attributes.id}`))),t}function u(e){const t={},n={};return e.forEach(e=>{l(e).forEach(e=>{const r=e in t;r||e in n?r&&(delete t[e],n[e]=!0):t[e]=!0})}),t}function h(e,t){const n=u(e),r=u(t),i={};return Object.keys(n).forEach(e=>{r[e]&&(i[e]=!0)}),i}function d(e){return delete e.outerDone,delete e.innerDone,delete e.valueDone,!e.childNodes||e.childNodes.every(d)}function p(e,t){if(!["nodeName","value","checked","selected","data"].every(n=>e[n]===t[n]))return!1;if(Boolean(e.attributes)!==Boolean(t.attributes))return!1;if(Boolean(e.childNodes)!==Boolean(t.childNodes))return!1;if(e.attributes){const n=Object.keys(e.attributes),r=Object.keys(t.attributes);if(n.length!==r.length)return!1;if(!n.every(n=>e.attributes[n]===t.attributes[n]))return!1}if(e.childNodes){if(e.childNodes.length!==t.childNodes.length)return!1;if(!e.childNodes.every((e,n)=>p(e,t.childNodes[n])))return!1}return!0}function f(e,t,n,r,i){if(!e||!t)return!1;if(e.nodeName!==t.nodeName)return!1;if("#text"===e.nodeName)return!!i||e.data===t.data;if(e.nodeName in n)return!0;if(e.attributes&&t.attributes){if(e.attributes.id){if(e.attributes.id!==t.attributes.id)return!1;if(`${e.nodeName}#${e.attributes.id}`in n)return!0}if(e.attributes.class&&e.attributes.class===t.attributes.class){if(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`in n)return!0}}if(r)return!0;const o=e.childNodes?e.childNodes.slice().reverse():[],a=t.childNodes?t.childNodes.slice().reverse():[];if(o.length!==a.length)return!1;if(i)return o.every((e,t)=>e.nodeName===a[t].nodeName);{const e=h(o,a);return o.every((t,n)=>f(t,a[n],e,!0,!0))}}function m(e){return JSON.parse(JSON.stringify(e))}function g(e,t,n,r){let i=0,o=[];const a=e.length,s=t.length,c=Array(...new Array(a+1)).map(()=>[]),u=h(e,t);let d=a===s;d&&e.some((e,n)=>{const r=l(e),i=l(t[n]);return r.length!==i.length?(d=!1,!0):(r.some((e,t)=>{if(e!==i[t])return d=!1,!0}),!d||void 0)});for(let l=0;l<a;l++){const a=e[l];for(let e=0;e<s;e++){const s=t[e];n[l]||r[e]||!f(a,s,u,d)?c[l+1][e+1]=0:(c[l+1][e+1]=c[l][e]?c[l][e]+1:1,c[l+1][e+1]>=i&&(i=c[l+1][e+1],o=[l+1,e+1]))}}return 0!==i&&{oldValue:o[0]-i,newValue:o[1]-i,length:i}}function y(e,t){return Array(...new Array(e)).map(()=>t)}class v{constructor(){this.list=[]}add(e){this.list.push(...e)}forEach(e){this.list.forEach(t=>e(t))}}function b(e,t){let n,r,i=e;for(t=t.slice();t.length>0;){if(!i.childNodes)return!1;r=t.splice(0,1)[0],n=i,i=i.childNodes[r]}return{node:i,parentNode:n,nodeIndex:r}}function _(e,t,n){return t.forEach(t=>{!function(e,t,n){const r=b(e,t[n._const.route]);let i=r.node;const o=r.parentNode,a=r.nodeIndex,s=[],c={diff:t,node:i};if(n.preDiffApply(c))return!0;let l,u,h,d;switch(t[n._const.action]){case n._const.addAttribute:i.attributes||(i.attributes={}),i.attributes[t[n._const.name]]=t[n._const.value],"checked"===t[n._const.name]?i.checked=!0:"selected"===t[n._const.name]?i.selected=!0:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&(i.value=t[n._const.value]);break;case n._const.modifyAttribute:i.attributes[t[n._const.name]]=t[n._const.newValue];break;case n._const.removeAttribute:delete i.attributes[t[n._const.name]],0===Object.keys(i.attributes).length&&delete i.attributes,"checked"===t[n._const.name]?i.checked=!1:"selected"===t[n._const.name]?delete i.selected:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&delete i.value;break;case n._const.modifyTextElement:i.data=t[n._const.newValue];break;case n._const.modifyValue:i.value=t[n._const.newValue];break;case n._const.modifyComment:i.data=t[n._const.newValue];break;case n._const.modifyChecked:i.checked=t[n._const.newValue];break;case n._const.modifySelected:i.selected=t[n._const.newValue];break;case n._const.replaceElement:l=m(t[n._const.newValue]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,o.childNodes[a]=l;break;case n._const.relocateGroup:u=i.childNodes.splice(t[n._const.from],t.groupLength).reverse(),u.forEach(e=>i.childNodes.splice(t[n._const.to],0,e)),i.subsets&&i.subsets.forEach(e=>{if(t[n._const.from]<t[n._const.to]&&e.oldValue<=t[n._const.to]&&e.oldValue>t[n._const.from]){e.oldValue-=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else if(t[n._const.from]>t[n._const.to]&&e.oldValue>t[n._const.to]&&e.oldValue<t[n._const.from]){e.oldValue+=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else e.oldValue===t[n._const.from]&&(e.oldValue=t[n._const.to])});break;case n._const.removeElement:o.childNodes.splice(a,1),o.subsets&&o.subsets.forEach(e=>{e.oldValue>a?e.oldValue-=1:e.oldValue===a?e.delete=!0:e.oldValue<a&&e.oldValue+e.length>a&&(e.oldValue+e.length-1===a?e.length--:(s.push({newValue:e.newValue+a-e.oldValue,oldValue:a,length:e.length-a+e.oldValue-1}),e.length=a-e.oldValue))}),i=o;break;case n._const.addElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],i=b(e,h).node,l=m(t[n._const.element]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d)e.oldValue+=1;else if(e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;case n._const.removeTextElement:o.childNodes.splice(a,1),"TEXTAREA"===o.nodeName&&delete o.value,o.subsets&&o.subsets.forEach(e=>{e.oldValue>a?e.oldValue-=1:e.oldValue===a?e.delete=!0:e.oldValue<a&&e.oldValue+e.length>a&&(e.oldValue+e.length-1===a?e.length--:(s.push({newValue:e.newValue+a-e.oldValue,oldValue:a,length:e.length-a+e.oldValue-1}),e.length=a-e.oldValue))}),i=o;break;case n._const.addTextElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],l={},l.nodeName="#text",l.data=t[n._const.value],i=b(e,h).node,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),"TEXTAREA"===i.nodeName&&(i.value=t[n._const.newValue]),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d&&(e.oldValue+=1),e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;default:console.log("unknown action")}i.subsets&&(i.subsets=i.subsets.filter(e=>!e.delete&&e.oldValue!==e.newValue),s.length&&(i.subsets=i.subsets.concat(s))),c.newNode=l,n.postDiffApply(c)}(e,t,n)}),!0}function w(e,t){const n={};if(n.nodeName=e.nodeName,"#text"===n.nodeName||"#comment"===n.nodeName)n.data=e.data;else{if(e.attributes&&e.attributes.length>0){n.attributes={};Array.prototype.slice.call(e.attributes).forEach(e=>n.attributes[e.name]=e.value)}if("TEXTAREA"===n.nodeName)n.value=e.value;else if(e.childNodes&&e.childNodes.length>0){n.childNodes=[];Array.prototype.slice.call(e.childNodes).forEach(e=>n.childNodes.push(w(e,t)))}t.valueDiffing&&(void 0!==e.checked&&e.type&&["radio","checkbox"].includes(e.type.toLowerCase())?n.checked=e.checked:void 0!==e.value&&(n.value=e.value),void 0!==e.selected&&(n.selected=e.selected))}return n}class E{constructor(e,t,n){this.options=n,this.t1=w(e,this.options),this.t2=w(t,this.options),this.diffcount=0,this.foundAll=!1,this.debug&&(this.t1Orig=w(e,this.options),this.t2Orig=w(t,this.options)),this.tracker=new v}init(){return this.findDiffs(this.t1,this.t2)}findDiffs(e,t){let n;do{if(this.options.debug&&(this.diffcount+=1,this.diffcount>this.options.diffcap))throw window.diffError=[this.t1Orig,this.t2Orig],new Error(`surpassed diffcap:${JSON.stringify(this.t1Orig)} -> ${JSON.stringify(this.t2Orig)}`);n=this.findNextDiff(e,t,[]),0===n.length&&(p(e,t)||(this.foundAll?(console.error("Could not find remaining diffs!"),console.log({t1:e,t2:t})):(this.foundAll=!0,d(e),n=this.findNextDiff(e,t,[])))),n.length>0&&(this.foundAll=!1,this.tracker.add(n),_(e,n,this.options))}while(n.length>0);return this.tracker.list}findNextDiff(e,t,n){let r,i;if(this.options.maxDepth&&n.length>this.options.maxDepth)return[];if(!e.outerDone){if(r=this.findOuterDiff(e,t,n),this.filterOuterDiff&&(i=this.filterOuterDiff(e,t,r),i&&(r=i)),r.length>0)return e.outerDone=!0,r;e.outerDone=!0}if(!e.innerDone){if(r=this.findInnerDiff(e,t,n),r.length>0)return r;e.innerDone=!0}if(this.options.valueDiffing&&!e.valueDone){if(r=this.findValueDiff(e,t,n),r.length>0)return e.valueDone=!0,r;e.valueDone=!0}return[]}findOuterDiff(e,t,n){const r=[];let i,o,a,s,l,u;if(e.nodeName!==t.nodeName)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)];if(n.length&&this.options.maxChildCount&&e.childNodes&&t.childNodes&&e.childNodes.length>this.options.maxChildCount&&t.childNodes.length>this.options.maxChildCount){const r=e.childNodes.length<t.childNodes.length?e.childNodes.length:t.childNodes.length;let i=0,o=0;for(;i<this.options.maxChildDiffCount&&o<r;)p(e.childNodes[o],t.childNodes[o])||i++,o++;if(i===this.options.maxChildDiffCount)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)]}if(e.data!==t.data)return"#text"===e.nodeName?[(new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)]:[(new c).setValue(this.options._const.action,this.options._const.modifyComment).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)];for(o=e.attributes?Object.keys(e.attributes).sort():[],a=t.attributes?Object.keys(t.attributes).sort():[],s=o.length,u=0;u<s;u++)i=o[u],l=a.indexOf(i),-1===l?r.push((new c).setValue(this.options._const.action,this.options._const.removeAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,e.attributes[i])):(a.splice(l,1),e.attributes[i]!==t.attributes[i]&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.oldValue,e.attributes[i]).setValue(this.options._const.newValue,t.attributes[i])));for(s=a.length,u=0;u<s;u++)i=a[u],r.push((new c).setValue(this.options._const.action,this.options._const.addAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,t.attributes[i]));return r}findInnerDiff(e,t,n){const r=e.subsets&&e.subsetsAge--?e.subsets:e.childNodes&&t.childNodes?function(e,t){const n=e.childNodes?e.childNodes:[],r=t.childNodes?t.childNodes:[],i=y(n.length,!1),o=y(r.length,!1),a=[];let s=!0;const c=function(){return arguments[1]},l=e=>{i[s.oldValue+e]=!0,o[s.newValue+e]=!0};for(;s;)if(s=g(n,r,i,o),s){a.push(s);Array(...new Array(s.length)).map(c).forEach(e=>l(e))}return e.subsets=a,e.subsetsAge=100,a}(e,t):[],i=e.childNodes?e.childNodes:[],o=t.childNodes?t.childNodes:[];let a,s=[],l=0;if(r.length>0&&(s=this.attemptGroupRelocation(e,t,r,n),s.length>0))return s;const u=Math.max(i.length,o.length);i.length!==o.length&&(a=!0);for(let e=0;e<u;e+=1){const t=i[e],r=o[e];a&&(t&&!r?"#text"===t.nodeName?(s.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,t.data)),l-=1):(s.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(t))),l-=1):r&&!t&&("#text"===r.nodeName?s.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,r.data)):s.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(r))))),t&&r&&(s=s.concat(this.findNextDiff(t,r,n.concat(l)))),l+=1}return e.innerDone=!0,s}attemptGroupRelocation(e,t,n,r){const i=function(e,t,n){const r=e.childNodes?y(e.childNodes.length,!0):[],i=t.childNodes?y(t.childNodes.length,!0):[];let o=0;return n.forEach(e=>{const t=e.oldValue+e.length,n=e.newValue+e.length;for(let n=e.oldValue;n<t;n+=1)r[n]=o;for(let t=e.newValue;t<n;t+=1)i[t]=o;o+=1}),{gaps1:r,gaps2:i}}(e,t,n),o=i.gaps1,a=i.gaps2;let s,l,u,h,d,p,g=Math.min(o.length,a.length);const v=[];for(let i=0,y=0;i<g;y+=1,i+=1)if(!0===o[i])if(h=e.childNodes[y],"#text"===h.nodeName){if("#text"===t.childNodes[i].nodeName&&h.data!==t.childNodes[i].data){for(p=y;e.childNodes.length>p+1&&"#text"===e.childNodes[p+1].nodeName;)if(p+=1,t.childNodes[i].data===e.childNodes[p].data){d=!0;break}if(!d)return v.push((new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.oldValue,h.data).setValue(this.options._const.newValue,t.childNodes[i].data)),v}v.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),o.splice(i,1),g=Math.min(o.length,a.length),i-=1}else v.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),o.splice(i,1),g=Math.min(o.length,a.length),i-=1;else if(!0===a[i])h=t.childNodes[i],"#text"===h.nodeName?(v.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),o.splice(i,0,!0),g=Math.min(o.length,a.length),y-=1):(v.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),o.splice(i,0,!0),g=Math.min(o.length,a.length),y-=1);else if(o[i]!==a[i]){if(v.length>0)return v;if(u=n[o[i]],l=Math.min(u.newValue,e.childNodes.length-u.length),l!==u.oldValue){s=!1;for(let t=0;t<u.length;t+=1)f(e.childNodes[l+t],e.childNodes[u.oldValue+t],[],!1,!0)||(s=!0);if(s)return[(new c).setValue(this.options._const.action,this.options._const.relocateGroup).setValue("groupLength",u.length).setValue(this.options._const.from,u.oldValue).setValue(this.options._const.to,l).setValue(this.options._const.route,r)]}}return v}findValueDiff(e,t,n){const r=[];return e.selected!==t.selected&&r.push((new c).setValue(this.options._const.action,this.options._const.modifySelected).setValue(this.options._const.oldValue,e.selected).setValue(this.options._const.newValue,t.selected).setValue(this.options._const.route,n)),(e.value||t.value)&&e.value!==t.value&&"OPTION"!==e.nodeName&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyValue).setValue(this.options._const.oldValue,e.value||"").setValue(this.options._const.newValue,t.value||"").setValue(this.options._const.route,n)),e.checked!==t.checked&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyChecked).setValue(this.options._const.oldValue,e.checked).setValue(this.options._const.newValue,t.checked).setValue(this.options._const.route,n)),r}}const A={debug:!1,diffcap:10,maxDepth:!1,maxChildCount:50,maxChildDiffCount:3,valueDiffing:!0,textDiff(e,t,n,r){e.data=r},preVirtualDiffApply(){},postVirtualDiffApply(){},preDiffApply(){},postDiffApply(){},filterOuterDiff:null,compress:!1,_const:!1,document:!(!window||!window.document)&&window.document};class x{constructor(e={}){if(this.options=e,Object.entries(A).forEach(([e,t])=>{Object.prototype.hasOwnProperty.call(this.options,e)||(this.options[e]=t)}),!this.options._const){const e=["addAttribute","modifyAttribute","removeAttribute","modifyTextElement","relocateGroup","removeElement","addElement","removeTextElement","addTextElement","replaceElement","modifyValue","modifyChecked","modifySelected","modifyComment","action","route","oldValue","newValue","element","group","from","to","name","value","data","attributes","nodeName","childNodes","checked","selected"];this.options._const={},this.options.compress?e.forEach((e,t)=>this.options._const[e]=t):e.forEach(e=>this.options._const[e]=e)}this.DiffFinder=E}apply(e,t){return function(e,t,n){return t.every(t=>o(e,t,n))}(e,t,this.options)}undo(e,t){return s(e,t,this.options)}diff(e,t){return new this.DiffFinder(e,t,this.options).init()}}class S{constructor(e={}){this.pad="│ ",this.padding="",this.tick=1,this.messages=[];const t=(e,t)=>{const n=e[t];e[t]=(...r)=>{this.fin(t,Array.prototype.slice.call(r));const i=n.apply(e,r);return this.fout(t,i),i}};for(let n in e)"function"==typeof e[n]&&t(e,n);this.log("┌ TRACELOG START")}fin(e,t){this.padding+=this.pad,this.log("├─> entering "+e,t)}fout(e,t){this.log("│<──┘ generated return value",t),this.padding=this.padding.substring(0,this.padding.length-this.pad.length)}format(e,t){return`${function(e){for(e=""+e;e.length<4;)e="0"+e;return e}(t)}> ${this.padding}${e}`}log(){let e=Array.prototype.slice.call(arguments);const t=function(e){return e?"string"==typeof e?e:e instanceof HTMLElement?e.outerHTML||"<empty>":e instanceof Array?`[${e.map(t).join(",")}]`:e.toString()||e.valueOf()||"<unknown>":"<falsey>"};e=e.map(t).join(", "),this.messages.push(this.format(e,this.tick++))}toString(){let e="└───";for(;e.length<=this.padding.length+this.pad.length;)e+="× ";let t=this.padding;return this.padding="",e=this.format(e,this.tick),this.padding=t,`${this.messages.join("\n")}\n${e}`}}},function(e,t,n){"use strict";n.r(t);var r=THREE.ExtrudeGeometry;class i extends r{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}function o(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),Object.assign(o.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});var a,s,c,l,u,h,d,p,f,m={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16).toUpperCase();return function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&r|128]+e[r>>8&255]+"-"+e[r>>16&255]+e[r>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*m.DEG2RAD},radToDeg:function(e){return e*m.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function g(e,t){this.x=e||0,this.y=t||0}function y(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function v(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function b(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function _(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(g.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(g.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(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:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:(a=new g,s=new g,function(e,t){return a.set(e,e),s.set(t,t),this.clamp(a,s)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}}),Object.assign(y.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,o,a,s,c,l,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new y).fromArray(this.elements)},copy:function(e){var 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:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(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:(p=new b,function(e){var t=this.elements,n=e.elements,r=1/p.setFromMatrixColumn(e,0).length(),i=1/p.setFromMatrixColumn(e,1).length(),o=1/p.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=o*l,d=o*u,p=a*l,f=a*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=d+p*c,t[5]=h-f*c,t[9]=-a*s,t[2]=f-h*c,t[6]=p+d*c,t[10]=o*s}else if("YXZ"===e.order){var m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m+v*a,t[4]=y*a-g,t[8]=o*c,t[1]=o*u,t[5]=o*l,t[9]=-a,t[2]=g*a-y,t[6]=v+m*a,t[10]=o*s}else if("ZXY"===e.order){m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m-v*a,t[4]=-o*u,t[8]=y+g*a,t[1]=g+y*a,t[5]=o*l,t[9]=v-m*a,t[2]=-o*c,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){h=o*l,d=o*u,p=a*l,f=a*u;t[0]=s*l,t[4]=p*c-d,t[8]=h*c+f,t[1]=s*u,t[5]=f*c+h,t[9]=d*c-p,t[2]=-c,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var b=o*s,_=o*c,w=a*s,E=a*c;t[0]=s*l,t[4]=E-b*u,t[8]=w*u+_,t[1]=u,t[5]=o*l,t[9]=-a*l,t[2]=-c*l,t[6]=_*u+w,t[10]=b-E*u}else if("XZY"===e.order){b=o*s,_=o*c,w=a*s,E=a*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=b*u+E,t[5]=o*l,t[9]=_*u-w,t[2]=w*u-_,t[6]=a*l,t[10]=E*u+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,r=e._y,i=e._z,o=e._w,a=n+n,s=r+r,c=i+i,l=n*a,u=n*s,h=n*c,d=r*s,p=r*c,f=i*c,m=o*a,g=o*s,y=o*c;return t[0]=1-(d+f),t[4]=u-y,t[8]=h+g,t[1]=u+y,t[5]=1-(l+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(l+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:(u=new b,h=new b,d=new b,function(e,t,n){var r=this.elements;return d.subVectors(e,t),0===d.lengthSq()&&(d.z=1),d.normalize(),u.crossVectors(n,d),0===u.lengthSq()&&(1===Math.abs(n.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),u.crossVectors(n,d)),u.normalize(),h.crossVectors(d,u),r[0]=u.x,r[4]=h.x,r[8]=d.x,r[1]=u.y,r[5]=h.y,r[9]=d.y,r[2]=u.z,r[6]=h.z,r[10]=d.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],y=n[3],v=n[7],b=n[11],_=n[15],w=r[0],E=r[4],A=r[8],x=r[12],S=r[1],T=r[5],M=r[9],R=r[13],C=r[2],k=r[6],I=r[10],P=r[14],O=r[3],N=r[7],D=r[11],L=r[15];return i[0]=o*w+a*S+s*C+c*O,i[4]=o*E+a*T+s*k+c*N,i[8]=o*A+a*M+s*I+c*D,i[12]=o*x+a*R+s*P+c*L,i[1]=l*w+u*S+h*C+d*O,i[5]=l*E+u*T+h*k+d*N,i[9]=l*A+u*M+h*I+d*D,i[13]=l*x+u*R+h*P+d*L,i[2]=p*w+f*S+m*C+g*O,i[6]=p*E+f*T+m*k+g*N,i[10]=p*A+f*M+m*I+g*D,i[14]=p*x+f*R+m*P+g*L,i[3]=y*w+v*S+b*C+_*O,i[7]=y*E+v*T+b*k+_*N,i[11]=y*A+v*M+b*I+_*D,i[15]=y*x+v*R+b*P+_*L,this},multiplyScalar:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix4(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*c*u-i*a*h+n*c*h+r*a*d-n*s*d)+e[7]*(+t*s*d-t*c*h+i*o*h-r*o*d+r*c*l-i*s*l)+e[11]*(+t*c*u-t*a*d-i*o*u+n*o*d+i*a*l-n*c*l)+e[15]*(-r*a*l-t*s*u+t*a*h+r*o*u-n*o*h+n*s*l)},transpose:function(){var e,t=this.elements;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:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],y=r[13],v=r[14],b=r[15],_=p*v*h-y*f*h+y*u*m-l*v*m-p*u*b+l*f*b,w=g*f*h-d*v*h-g*u*m+c*v*m+d*u*b-c*f*b,E=d*y*h-g*p*h+g*l*m-c*y*m-d*l*b+c*p*b,A=g*p*u-d*y*u-g*l*f+c*y*f+d*l*v-c*p*v,x=i*_+o*w+a*E+s*A;if(0===x){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(S);return console.warn(S),this.identity()}var T=1/x;return n[0]=_*T,n[1]=(y*f*s-p*v*s-y*a*m+o*v*m+p*a*b-o*f*b)*T,n[2]=(l*v*s-y*u*s+y*a*h-o*v*h-l*a*b+o*u*b)*T,n[3]=(p*u*s-l*f*s-p*a*h+o*f*h+l*a*m-o*u*m)*T,n[4]=w*T,n[5]=(d*v*s-g*f*s+g*a*m-i*v*m-d*a*b+i*f*b)*T,n[6]=(g*u*s-c*v*s-g*a*h+i*v*h+c*a*b-i*u*b)*T,n[7]=(c*f*s-d*u*s+d*a*h-i*f*h-c*a*m+i*u*m)*T,n[8]=E*T,n[9]=(g*p*s-d*y*s-g*o*m+i*y*m+d*o*b-i*p*b)*T,n[10]=(c*y*s-g*l*s+g*o*h-i*y*h-c*o*b+i*l*b)*T,n[11]=(d*l*s-c*p*s-d*o*h+i*p*h+c*o*m-i*l*m)*T,n[12]=A*T,n[13]=(d*y*a-g*p*a+g*o*f-i*y*f-d*o*v+i*p*v)*T,n[14]=(g*l*a-c*y*a-g*o*u+i*y*u+c*o*v-i*l*v)*T,n[15]=(c*p*a-d*l*a+d*o*u-i*p*u-c*o*f+i*l*f)*T,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var 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:function(e){var 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:function(e){var 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:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,c=i*o,l=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,l*a+n,l*s-r*o,0,c*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){return this.makeRotationFromQuaternion(t),this.scale(n),this.setPosition(e),this},decompose:(c=new b,l=new y,function(e,t,n){var r=this.elements,i=c.set(r[0],r[1],r[2]).length(),o=c.set(r[4],r[5],r[6]).length(),a=c.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],l.copy(this);var s=1/i,u=1/o,h=1/a;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=u,l.elements[5]*=u,l.elements[6]*=u,l.elements[8]*=h,l.elements[9]*=h,l.elements[10]*=h,t.setFromRotationMatrix(l),n.x=i,n.y=o,n.z=a,this}),makePerspective:function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),c=1/(n-r),l=1/(o-i),u=(t+e)*s,h=(n+r)*c,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}}),Object.assign(v,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,o,a){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[o+0],d=i[o+1],p=i[o+2],f=i[o+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-a,g=s*h+c*d+l*p+u*f,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var b=Math.sqrt(v),_=Math.atan2(b,g*y);m=Math.sin(m*_)/b,a=Math.sin(a*_)/b}var w=a*y;if(s=s*m+h*w,c=c*m+d*w,l=l*m+p*w,u=u*m+f*w,m===1-a){var E=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=E,c*=E,l*=E,u*=E}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}}),Object.defineProperties(v.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(v.prototype,{set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e.order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(r/2),u=a(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"YXZ"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"ZXY"===o?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"ZYX"===o?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"YZX"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p):"XZY"===o&&(this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(u-c)*t,this._y=(o-l)*t,this._z=(a-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-c)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(o+l)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(o-l)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(c+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(a-i)/t,this._x=(o+l)/t,this._y=(c+u)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new b;return function(n,r){return void 0===t&&(t=new b),(e=n.dot(r)+1)<1e-6?(e=0,Math.abs(n.x)>Math.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,r),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(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:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+o*a+r*c-i*s,this._y=r*l+o*s+i*a-n*c,this._z=i*l+o*c+n*s-r*a,this._w=o*l-n*a-r*s-i*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,a),l=Math.sin((1-t)*c)/s,u=Math.sin(t*c)/s;return this._w=o*l+this._w*u,this._x=n*l+this._x*u,this._y=r*l+this._y*u,this._z=i*l+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(b.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(f=new v,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(f.setFromEuler(e))}),applyAxisAngle:function(){var e=new v;return function(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*n,l=s*n+a*t-i*r,u=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=c*s+h*-i+l*-a-u*-o,this.y=l*s+h*-o+u*-i-c*-a,this.z=u*s+h*-a+c*-o-l*-i,this},project:function(){var e=new y;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new y;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(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:function(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:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new b,t=new b;return function(n,r){return e.set(n,n,n),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new b;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new b;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(m.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(_.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,o,a,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var 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},setFromMatrix4:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix3(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],b=r[7],_=r[2],w=r[5],E=r[8];return i[0]=o*f+a*y+s*_,i[3]=o*m+a*v+s*w,i[6]=o*g+a*b+s*E,i[1]=c*f+l*y+u*_,i[4]=c*m+l*v+u*w,i[7]=c*g+l*b+u*E,i[2]=h*f+d*y+p*_,i[5]=h*m+d*v+p*w,i[8]=h*g+d*b+p*E,this},multiplyScalar:function(e){var 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:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8];return t*o*l-t*a*c-n*i*l+n*a*s+r*i*c-r*o*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],p=d*c-l*h,f=l*u-d*s,m=h*s-c*u,g=i*p+o*f+a*m;if(0===g){var y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(y);return console.warn(y),this.identity()}var v=1/g;return r[0]=p*v,r[1]=(a*h-d*o)*v,r[2]=(l*o-a*c)*v,r[3]=f*v,r[4]=(d*i-a*u)*v,r[5]=(a*s-l*i)*v,r[6]=m*v,r[7]=(o*u-h*i)*v,r[8]=(c*i-o*s)*v,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var 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:function(e,t,n,r,i,o,a){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*o+c*a)+o+e,-r*c,r*s,-r*(-c*o+s*a)+a+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*c,r[6]=t*a+n*l,r[1]=-n*i+t*s,r[4]=-n*o+t*c,r[7]=-n*a+t*l,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}});var w=0;function E(e,t,n,r,i,o,a,s,c,l){Object.defineProperty(this,"id",{value:w++}),this.uuid=m.generateUUID(),this.name="",this.image=void 0!==e?e:E.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:E.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==o?o:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:1023,this.type=void 0!==s?s:1009,this.offset=new g(0,0),this.repeat=new g(1,1),this.center=new g(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:3e3,this.version=0,this.onUpdate=null}function A(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function x(e,t,n){this.uuid=m.generateUUID(),this.width=e,this.height=t,this.scissor=new A(0,0,e,t),this.scissorTest=!1,this.viewport=new A(0,0,e,t),void 0===(n=n||{}).minFilter&&(n.minFilter=1006),this.texture=new E(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function S(e,t,n){x.call(this,e,t,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function T(e,t,n,r,i,o,a,s,c,l,u,h){E.call(this,null,o,a,s,c,l,r,i,u,h),this.image={data:e,width:t,height:n},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function M(e,t,n,r,i,o,a,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:301,E.call(this,e,t,n,r,i,o,a,s,c,l),this.flipY=!1}E.DEFAULT_IMAGE=void 0,E.DEFAULT_MAPPING=300,E.prototype=Object.assign(Object.create(o.prototype),{constructor:E,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=m.generateUUID()),t||void 0!==e.images[r.uuid]||(e.images[r.uuid]={uuid:r.uuid,url:function(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height;var n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(r)}),n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.defineProperty(E.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(A.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(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:function(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:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(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},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var 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:function(e){var t,n,r,i,o=e.elements,a=o[0],s=o[4],c=o[8],l=o[1],u=o[5],h=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(a+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(a+1)/2,g=(u+1)/2,y=(f+1)/2,v=(s+l)/4,b=(c+d)/4,_=(h+p)/4;return m>g&&m>y?m<.01?(n=0,r=.707106781,i=.707106781):(r=v/(n=Math.sqrt(m)),i=b/n):g>y?g<.01?(n=.707106781,r=0,i=.707106781):(n=v/(r=Math.sqrt(g)),i=_/r):y<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(y)),r=_/i),this.set(n,r,i,t),this}var w=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(w)<.001&&(w=1),this.x=(p-h)/w,this.y=(c-d)/w,this.z=(l-s)/w,this.w=Math.acos((a+u+f-1)/2),this},min:function(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:function(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:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(n,r){return void 0===e&&(e=new A,t=new A),e.set(n,n,n,n),t.set(r,r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){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:function(){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:function(){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:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),x.prototype=Object.assign(Object.create(o.prototype),{constructor:x,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),S.prototype=Object.create(x.prototype),S.prototype.constructor=S,S.prototype.isWebGLRenderTargetCube=!0,T.prototype=Object.create(E.prototype),T.prototype.constructor=T,T.prototype.isDataTexture=!0,M.prototype=Object.create(E.prototype),M.prototype.constructor=M,M.prototype.isCubeTexture=!0,Object.defineProperty(M.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var R=new E,C=new M;function k(){this.seq=[],this.map={}}var I=[],P=[],O=new Float32Array(16),N=new Float32Array(9);function D(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,o=I[i];if(void 0===o&&(o=new Float32Array(i),I[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function L(e,t){var n=P[t];void 0===n&&(n=new Int32Array(t),P[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocTextureUnit();return n}function F(e,t){e.uniform1f(this.addr,t)}function j(e,t){e.uniform1i(this.addr,t)}function U(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function B(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function V(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function H(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function z(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(N.set(t.elements),e.uniformMatrix3fv(this.addr,!1,N))}function q(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(O.set(t.elements),e.uniformMatrix4fv(this.addr,!1,O))}function G(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTexture2D(t||R,r)}function W(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTextureCube(t||C,r)}function J(e,t){e.uniform2iv(this.addr,t)}function Z(e,t){e.uniform3iv(this.addr,t)}function X(e,t){e.uniform4iv(this.addr,t)}function Y(e,t){e.uniform1fv(this.addr,t)}function Q(e,t){e.uniform1iv(this.addr,t)}function K(e,t){e.uniform2fv(this.addr,D(t,this.size,2))}function $(e,t){e.uniform3fv(this.addr,D(t,this.size,3))}function ee(e,t){e.uniform4fv(this.addr,D(t,this.size,4))}function te(e,t){e.uniformMatrix2fv(this.addr,!1,D(t,this.size,4))}function ne(e,t){e.uniformMatrix3fv(this.addr,!1,D(t,this.size,9))}function re(e,t){e.uniformMatrix4fv(this.addr,!1,D(t,this.size,16))}function ie(e,t,n){var r=t.length,i=L(n,r);e.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTexture2D(t[o]||R,i[o])}function oe(e,t,n){var r=t.length,i=L(n,r);e.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTextureCube(t[o]||C,i[o])}function ae(e,t,n){this.id=e,this.addr=n,this.setValue=function(e){switch(e){case 5126:return F;case 35664:return U;case 35665:return B;case 35666:return V;case 35674:return H;case 35675:return z;case 35676:return q;case 35678:case 36198:return G;case 35680:return W;case 5124:case 35670:return j;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function se(e,t,n){this.id=e,this.addr=n,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Y;case 35664:return K;case 35665:return $;case 35666:return ee;case 35674:return te;case 35675:return ne;case 35676:return re;case 35678:return ie;case 35680:return oe;case 5124:case 35670:return Q;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function ce(e){this.id=e,k.call(this)}ce.prototype.setValue=function(e,t){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var o=n[r];o.setValue(e,t[o.id])}};var le=/([\w\d_]+)(\])?(\[|\.)?/g;function ue(e,t){e.seq.push(t),e.map[t.id]=t}function he(e,t,n){var r=e.name,i=r.length;for(le.lastIndex=0;;){var o=le.exec(r),a=le.lastIndex,s=o[1],c="]"===o[2],l=o[3];if(c&&(s|=0),void 0===l||"["===l&&a+2===i){ue(n,void 0===l?new ae(s,e,t):new se(s,e,t));break}var u=n.map[s];void 0===u&&ue(n,u=new ce(s)),n=u}}function de(e,t,n){k.call(this),this.renderer=n;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<r;++i){var o=e.getActiveUniform(t,i),a=o.name;he(o,e.getUniformLocation(t,a),this)}}de.prototype.setValue=function(e,t,n){var r=this.map[t];void 0!==r&&r.setValue(e,n,this.renderer)},de.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},de.upload=function(e,t,n,r){for(var i=0,o=t.length;i!==o;++i){var a=t[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,r)}},de.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var o=e[r];o.id in t&&n.push(o)}return n};var pe={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};function fe(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}Object.assign(fe.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}return function(t,n,r){if(t=m.euclideanModulo(t,1),n=m.clamp(n,0,1),r=m.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,o=2*r-i;this.r=e(o,i,t+1/3),this.g=e(o,i,t),this.b=e(o,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,u=(l=n[1]).length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(l=pe[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(){var e=this.r,t=this.g,n=this.b;return this.r=e*e,this.g=t*t,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,n,r=e||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),c=Math.min(i,o,a),l=(c+s)/2;if(c===s)t=0,n=0;else{var u=s-c;switch(n=l<=.5?u/(s+c):u/(2-s-c),s){case i:t=(o-a)/u+(o<a?6:0);break;case o:t=(a-i)/u+2;break;case a:t=(i-o)/u+4}t/=6}return r.h=t,r.s=n,r.l=l,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=n,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var me={common:{diffuse:{value:new fe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new _},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new g(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new fe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new _}}},ge={merge:function(e){for(var t={},n=0;n<e.length;n++){var r=this.clone(e[n]);for(var i in r)t[i]=r[i]}return t},clone:function(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}},ye={alphamap_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\r\n\r\n#endif\r\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tuniform sampler2D alphaMap;\r\n\r\n#endif\r\n",alphatest_fragment:"#ifdef ALPHATEST\r\n\r\n\tif ( diffuseColor.a < ALPHATEST ) discard;\r\n\r\n#endif\r\n",aomap_fragment:"#ifdef USE_AOMAP\r\n\r\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\r\n\r\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\r\n\r\n\t#endif\r\n\r\n#endif\r\n",aomap_pars_fragment:"#ifdef USE_AOMAP\r\n\r\n\tuniform sampler2D aoMap;\r\n\tuniform float aoMapIntensity;\r\n\r\n#endif",begin_vertex:"\r\nvec3 transformed = vec3( position );\r\n",beginnormal_vertex:"\r\nvec3 objectNormal = vec3( normal );\r\n",bsdfs:'float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\r\n\r\n\tif( decayExponent > 0.0 ) {\r\n\r\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\r\n\r\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\r\n\t\t// page 32, equation 26: E[window1]\r\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\n\t\t// this is intended to be used on spot and point lights who are represented as luminous intensity\r\n\t\t// but who must be converted to luminous irradiance for surface lighting calculation\r\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\r\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\r\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\r\n\r\n#else\r\n\r\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\r\n\r\n#endif\r\n\r\n\t}\r\n\r\n\treturn 1.0;\r\n\r\n}\r\n\r\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\r\n\r\n\treturn RECIPROCAL_PI * diffuseColor;\r\n\r\n} // validated\r\n\r\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\r\n\r\n\t// Original approximation by Christophe Schlick \'94\r\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\r\n\r\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\r\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\r\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\r\n\r\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\r\n\r\n} // validated\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\r\n\t// also see #12151\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\r\n\treturn 1.0 / ( gl * gv );\r\n\r\n} // validated\r\n\r\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\r\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\r\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\r\n\treturn 0.5 / max( gv + gl, EPSILON );\r\n\r\n}\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat D_GGX( const in float alpha, const in float dotNH ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\r\n\r\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\r\n\r\n}\r\n\r\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\r\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\r\n\r\n\tfloat D = D_GGX( alpha, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// Rect Area Light\r\n\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\r\n// code: https://github.com/selfshadow/ltc_code/\r\n\r\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\r\n\r\n\tconst float LUT_SIZE = 64.0;\r\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\r\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\r\n\r\n\tfloat dotNV = saturate( dot( N, V ) );\r\n\r\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\r\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\r\n\r\n\tuv = uv * LUT_SCALE + LUT_BIAS;\r\n\r\n\treturn uv;\r\n\r\n}\r\n\r\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\r\n\r\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\r\n\t// An approximation of the form factor of a horizon-clipped rectangle.\r\n\r\n\tfloat l = length( f );\r\n\r\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\r\n\r\n}\r\n\r\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\r\n\r\n\tfloat x = dot( v1, v2 );\r\n\r\n\tfloat y = abs( x );\r\n\r\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\r\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\r\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\r\n\tfloat v = a / b;\r\n\r\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\r\n\r\n\treturn cross( v1, v2 ) * theta_sintheta;\r\n\r\n}\r\n\r\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\r\n\r\n\t// bail if point is on back side of plane of light\r\n\t// assumes ccw winding order of light vertices\r\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\r\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\r\n\tvec3 lightNormal = cross( v1, v2 );\r\n\r\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\r\n\r\n\t// construct orthonormal basis around N\r\n\tvec3 T1, T2;\r\n\tT1 = normalize( V - N * dot( V, N ) );\r\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\r\n\r\n\t// compute transform\r\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\r\n\r\n\t// transform rect\r\n\tvec3 coords[ 4 ];\r\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\r\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\r\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\r\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\r\n\r\n\t// project rect onto sphere\r\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\r\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\r\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\r\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\r\n\r\n\t// calculate vector form factor\r\n\tvec3 vectorFormFactor = vec3( 0.0 );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\r\n\r\n\t// adjust for horizon clipping\r\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\r\n\r\n\r\n\r\n\treturn vec3( result );\r\n\r\n}\r\n\r\n// End Rect Area Light\r\n\r\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\r\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\r\n\r\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\r\n\r\n\tvec4 r = roughness * c0 + c1;\r\n\r\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\r\n\r\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\r\n\r\n\treturn specularColor * AB.x + AB.y;\r\n\r\n} // validated\r\n\r\n\r\nfloat G_BlinnPhong_Implicit( ) {\r\n\r\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\r\n\treturn 0.25;\r\n\r\n}\r\n\r\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\r\n\r\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\r\n\r\n}\r\n\r\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_BlinnPhong_Implicit( );\r\n\r\n\tfloat D = D_BlinnPhong( shininess, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\r\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\r\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\r\n}\r\n\r\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\r\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\r\n}\r\n',bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\r\n\r\n\tuniform sampler2D bumpMap;\r\n\tuniform float bumpScale;\r\n\r\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\r\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\r\n\r\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\r\n\r\n\tvec2 dHdxy_fwd() {\r\n\r\n\t\tvec2 dSTdx = dFdx( vUv );\r\n\t\tvec2 dSTdy = dFdy( vUv );\r\n\r\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\r\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\r\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\r\n\r\n\t\treturn vec2( dBx, dBy );\r\n\r\n\t}\r\n\r\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\r\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\r\n\t\tvec3 vN = surf_norm;\t\t// normalized\r\n\r\n\t\tvec3 R1 = cross( vSigmaY, vN );\r\n\t\tvec3 R2 = cross( vN, vSigmaX );\r\n\r\n\t\tfloat fDet = dot( vSigmaX, R1 );\r\n\r\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n\t}\r\n\r\n#endif\r\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\tvec4 plane;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\tplane = clippingPlanes[ i ];\r\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\r\n\r\n\t}\r\n\r\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\r\n\r\n\t\tbool clipped = true;\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\t\tplane = clippingPlanes[ i ];\r\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\r\n\r\n\t\t}\r\n\r\n\t\tif ( clipped ) discard;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\t\tvarying vec3 vViewPosition;\r\n\t#endif\r\n\r\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\r\n\r\n#endif\r\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvarying vec3 vViewPosition;\r\n#endif\r\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvViewPosition = - mvPosition.xyz;\r\n#endif\r\n\r\n",color_fragment:"#ifdef USE_COLOR\r\n\r\n\tdiffuseColor.rgb *= vColor;\r\n\r\n#endif",color_pars_fragment:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif\r\n",color_pars_vertex:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif",color_vertex:"#ifdef USE_COLOR\r\n\r\n\tvColor.xyz = color.xyz;\r\n\r\n#endif",common:"#define PI 3.14159265359\r\n#define PI2 6.28318530718\r\n#define PI_HALF 1.5707963267949\r\n#define RECIPROCAL_PI 0.31830988618\r\n#define RECIPROCAL_PI2 0.15915494\r\n#define LOG2 1.442695\r\n#define EPSILON 1e-6\r\n\r\n#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\r\n\r\nfloat pow2( const in float x ) { return x*x; }\r\nfloat pow3( const in float x ) { return x*x*x; }\r\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\r\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\r\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\r\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\r\nhighp float rand( const in vec2 uv ) {\r\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\r\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\r\n\treturn fract(sin(sn) * c);\r\n}\r\n\r\nstruct IncidentLight {\r\n\tvec3 color;\r\n\tvec3 direction;\r\n\tbool visible;\r\n};\r\n\r\nstruct ReflectedLight {\r\n\tvec3 directDiffuse;\r\n\tvec3 directSpecular;\r\n\tvec3 indirectDiffuse;\r\n\tvec3 indirectSpecular;\r\n};\r\n\r\nstruct GeometricContext {\r\n\tvec3 position;\r\n\tvec3 normal;\r\n\tvec3 viewDir;\r\n};\r\n\r\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\r\n\r\n}\r\n\r\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\r\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\r\n\r\n}\r\n\r\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\r\n\r\n\treturn - distance * planeNormal + point;\r\n\r\n}\r\n\r\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\r\n\r\n}\r\n\r\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\r\n\r\n}\r\n\r\nmat3 transposeMat3( const in mat3 m ) {\r\n\r\n\tmat3 tmp;\r\n\r\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\r\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\r\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\r\n\r\n\treturn tmp;\r\n\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Relative_luminance\r\nfloat linearToRelativeLuminance( const in vec3 color ) {\r\n\r\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\r\n\r\n\treturn dot( weights, color.rgb );\r\n\r\n}\r\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\r\n\r\n#define cubeUV_textureSize (1024.0)\r\n\r\nint getFaceFromDirection(vec3 direction) {\r\n\tvec3 absDirection = abs(direction);\r\n\tint face = -1;\r\n\tif( absDirection.x > absDirection.z ) {\r\n\t\tif(absDirection.x > absDirection.y )\r\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\telse {\r\n\t\tif(absDirection.z > absDirection.y )\r\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\treturn face;\r\n}\r\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\r\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\r\n\r\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\r\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\r\n\tfloat dxRoughness = dFdx(roughness);\r\n\tfloat dyRoughness = dFdy(roughness);\r\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\r\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\r\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\r\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\r\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\r\n\tfloat mipLevel = 0.5 * log2(d);\r\n\treturn vec2(floor(mipLevel), fract(mipLevel));\r\n}\r\n\r\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\r\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\r\n\r\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\r\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\r\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\r\n\r\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\r\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\r\n\t// float powScale = exp2(roughnessLevel + mipLevel);\r\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\r\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\r\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\r\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\r\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\r\n\r\n\tbool bRes = mipLevel == 0.0;\r\n\tscale = bRes && (scale < a) ? a : scale;\r\n\r\n\tvec3 r;\r\n\tvec2 offset;\r\n\tint face = getFaceFromDirection(direction);\r\n\r\n\tfloat rcpPowScale = 1.0 / powScale;\r\n\r\n\tif( face == 0) {\r\n\t\tr = vec3(direction.x, -direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 1) {\r\n\t\tr = vec3(direction.y, direction.x, direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 2) {\r\n\t\tr = vec3(direction.z, direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 3) {\r\n\t\tr = vec3(direction.x, direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse if( face == 4) {\r\n\t\tr = vec3(direction.y, direction.x, -direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse {\r\n\t\tr = vec3(direction.z, -direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\tr = normalize(r);\r\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\r\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\r\n\tvec2 base = offset + vec2( texelOffset );\r\n\treturn base + s * ( scale - 2.0 * texelOffset );\r\n}\r\n\r\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\r\n\r\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\r\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\r\n\tfloat r1 = floor(roughnessVal);\r\n\tfloat r2 = r1 + 1.0;\r\n\tfloat t = fract(roughnessVal);\r\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\r\n\tfloat s = mipInfo.y;\r\n\tfloat level0 = mipInfo.x;\r\n\tfloat level1 = level0 + 1.0;\r\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\r\n\r\n\t// round to nearest mipmap if we are not interpolating.\r\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\r\n\r\n\t// Tri linear interpolation.\r\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\r\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\r\n\r\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\r\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\r\n\r\n\tvec4 result = mix(color10, color20, t);\r\n\r\n\treturn vec4(result.rgb, 1.0);\r\n}\r\n\r\n#endif\r\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\r\n\r\n#ifdef FLIP_SIDED\r\n\r\n\ttransformedNormal = - transformedNormal;\r\n\r\n#endif\r\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\tuniform sampler2D displacementMap;\r\n\tuniform float displacementScale;\r\n\tuniform float displacementBias;\r\n\r\n#endif\r\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\r\n\r\n#endif\r\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\r\n\r\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\r\n\r\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\r\n\r\n#endif\r\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tuniform sampler2D emissiveMap;\r\n\r\n#endif\r\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\r\n",encodings_pars_fragment:"// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nvec4 LinearToLinear( in vec4 value ) {\r\n\treturn value;\r\n}\r\n\r\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\r\n}\r\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\r\n}\r\n\r\nvec4 sRGBToLinear( in vec4 value ) {\r\n\treturn 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.w );\r\n}\r\nvec4 LinearTosRGB( in vec4 value ) {\r\n\treturn 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.w );\r\n}\r\n\r\nvec4 RGBEToLinear( in vec4 value ) {\r\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\r\n}\r\nvec4 LinearToRGBE( in vec4 value ) {\r\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\r\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\r\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\r\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\r\n}\r\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\r\n\tM = ceil( M * 255.0 ) / 255.0;\r\n\treturn vec4( value.rgb / ( M * maxRange ), M );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\r\n}\r\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat D = max( maxRange / maxRGB, 1.0 );\r\n\tD = min( floor( D ) / 255.0, 1.0 );\r\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\r\n}\r\n\r\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\r\n\r\n// M matrix, for encoding\r\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\r\nvec4 LinearToLogLuv( in vec4 value ) {\r\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\r\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\r\n\tvec4 vResult;\r\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\r\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\r\n\tvResult.w = fract(Le);\r\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\r\n\treturn vResult;\r\n}\r\n\r\n// Inverse M matrix, for decoding\r\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\r\nvec4 LogLuvToLinear( in vec4 value ) {\r\n\tfloat Le = value.z * 255.0 + value.w;\r\n\tvec3 Xp_Y_XYZp;\r\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\r\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\r\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\r\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\r\n\treturn vec4( max(vRGB, 0.0), 1.0 );\r\n}\r\n",envmap_fragment:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\r\n\r\n\t\t// Transforming Normal Vectors with the Inverse Transformation\r\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#else\r\n\r\n\t\tvec3 reflectVec = vReflect;\r\n\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\r\n\r\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\tvec2 sampleUV;\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\r\n\r\n\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\r\n\r\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\r\n\r\n\t#else\r\n\r\n\t\tvec4 envColor = vec4( 0.0 );\r\n\r\n\t#endif\r\n\r\n\tenvColor = envMapTexelToLinear( envColor );\r\n\r\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\r\n\r\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_MIX )\r\n\r\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_ADD )\r\n\r\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\r\n\tuniform float reflectivity;\r\n\tuniform float envMapIntensity;\r\n#endif\r\n\r\n#ifdef USE_ENVMAP\r\n\r\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\r\n\t\tvarying vec3 vWorldPosition;\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\t\tuniform samplerCube envMap;\r\n\t#else\r\n\t\tuniform sampler2D envMap;\r\n\t#endif\r\n\tuniform float flipEnvMap;\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\r\n\t\tuniform float refractionRatio;\r\n\t#else\r\n\t\tvarying vec3 vReflect;\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\t\tvarying vec3 vWorldPosition;\r\n\r\n\t#else\r\n\r\n\t\tvarying vec3 vReflect;\r\n\t\tuniform float refractionRatio;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvWorldPosition = worldPosition.xyz;\r\n\r\n\t#else\r\n\r\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n#endif\r\n",fog_vertex:"\r\n#ifdef USE_FOG\r\nfogDepth = -mvPosition.z;\r\n#endif",fog_pars_vertex:"#ifdef USE_FOG\r\n\r\n varying float fogDepth;\r\n\r\n#endif\r\n",fog_fragment:"#ifdef USE_FOG\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\r\n\r\n\t#else\r\n\r\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\r\n\r\n#endif\r\n",fog_pars_fragment:"#ifdef USE_FOG\r\n\r\n\tuniform vec3 fogColor;\r\n\tvarying float fogDepth;\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tuniform float fogDensity;\r\n\r\n\t#else\r\n\r\n\t\tuniform float fogNear;\r\n\t\tuniform float fogFar;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",gradientmap_pars_fragment:"#ifdef TOON\r\n\r\n\tuniform sampler2D gradientMap;\r\n\r\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\r\n\r\n\t\t// dotNL will be from -1.0 to 1.0\r\n\t\tfloat dotNL = dot( normal, lightDirection );\r\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\r\n\r\n\t\t#ifdef USE_GRADIENTMAP\r\n\r\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\r\n\r\n\t\t#else\r\n\r\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\r\n\r\n\t\t#endif\r\n\r\n\r\n\t}\r\n\r\n#endif\r\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\r\n\r\n#endif\r\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\tuniform sampler2D lightMap;\r\n\tuniform float lightMapIntensity;\r\n\r\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\r\n\r\nGeometricContext geometry;\r\ngeometry.position = mvPosition.xyz;\r\ngeometry.normal = normalize( transformedNormal );\r\ngeometry.viewDir = normalize( -mvPosition.xyz );\r\n\r\nGeometricContext backGeometry;\r\nbackGeometry.position = geometry.position;\r\nbackGeometry.normal = -geometry.normal;\r\nbackGeometry.viewDir = geometry.viewDir;\r\n\r\nvLightFront = vec3( 0.0 );\r\n\r\n#ifdef DOUBLE_SIDED\r\n\tvLightBack = vec3( 0.0 );\r\n#endif\r\n\r\nIncidentLight directLight;\r\nfloat dotNL;\r\nvec3 directLightColor_Diffuse;\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_pars:"uniform vec3 ambientLightColor;\r\n\r\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\r\n\r\n\tvec3 irradiance = ambientLightColor;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI;\r\n\r\n\t#endif\r\n\r\n\treturn irradiance;\r\n\r\n}\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tstruct DirectionalLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\r\n\r\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tdirectLight.color = directionalLight.color;\r\n\t\tdirectLight.direction = directionalLight.direction;\r\n\t\tdirectLight.visible = true;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tstruct PointLight {\r\n\t\tvec3 position;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t\tfloat shadowCameraNear;\r\n\t\tfloat shadowCameraFar;\r\n\t};\r\n\r\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = pointLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\r\n\t\tdirectLight.color = pointLight.color;\r\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\r\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tstruct SpotLight {\r\n\t\tvec3 position;\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\t\tfloat coneCos;\r\n\t\tfloat penumbraCos;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = spotLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\r\n\r\n\t\tif ( angleCos > spotLight.coneCos ) {\r\n\r\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\r\n\r\n\t\t\tdirectLight.color = spotLight.color;\r\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\r\n\t\t\tdirectLight.visible = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdirectLight.color = vec3( 0.0 );\r\n\t\t\tdirectLight.visible = false;\r\n\r\n\t\t}\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tstruct RectAreaLight {\r\n\t\tvec3 color;\r\n\t\tvec3 position;\r\n\t\tvec3 halfWidth;\r\n\t\tvec3 halfHeight;\r\n\t};\r\n\r\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\r\n\t// BRDF approximation Texture is 64x64\r\n\tuniform sampler2D ltc_1; // RGBA Float\r\n\tuniform sampler2D ltc_2; // RGBA Float\r\n\r\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\r\n\r\n#endif\r\n\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tstruct HemisphereLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 skyColor;\r\n\t\tvec3 groundColor;\r\n\t};\r\n\r\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\r\n\r\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\r\n\r\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\r\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\r\n\r\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tirradiance *= PI;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn irradiance;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\r\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\r\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec4 envMapColor = vec4( 0.0 );\r\n\r\n\t\t#endif\r\n\r\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n\t// taken from here: http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\r\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t//float envMapWidth = pow( 2.0, maxMIPLevelScalar );\r\n\t\t//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\r\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\t// clamp to allowable LOD ranges.\r\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\r\n\r\n\t}\r\n\r\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\r\n\r\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\t\tvec2 sampleUV;\r\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_phong_fragment:"BlinnPhongMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb;\r\nmaterial.specularColor = specular;\r\nmaterial.specularShininess = shininess;\r\nmaterial.specularStrength = specularStrength;\r\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n\r\nstruct BlinnPhongMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tvec3\tspecularColor;\r\n\tfloat\tspecularShininess;\r\n\tfloat\tspecularStrength;\r\n\r\n};\r\n\r\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifdef TOON\r\n\r\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\r\n\r\n\t#else\r\n\r\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\t\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#endif\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\r\n\r\n#define Material_LightProbeLOD( material )\t(0)\r\n",lights_physical_fragment:"PhysicalMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\r\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\r\n#ifdef STANDARD\r\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\r\n#else\r\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\r\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\r\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\r\n#endif\r\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tfloat\tspecularRoughness;\r\n\tvec3\tspecularColor;\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoat;\r\n\t\tfloat clearCoatRoughness;\r\n\t#endif\r\n\r\n};\r\n\r\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\r\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\r\n\r\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\r\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\r\n\r\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\r\n\r\n}\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t\tvec3 normal = geometry.normal;\r\n\t\tvec3 viewDir = geometry.viewDir;\r\n\t\tvec3 position = geometry.position;\r\n\t\tvec3 lightPos = rectAreaLight.position;\r\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\r\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\r\n\t\tvec3 lightColor = rectAreaLight.color;\r\n\t\tfloat roughness = material.specularRoughness;\r\n\r\n\t\tvec3 rectCoords[ 4 ];\r\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight; // counterclockwise\r\n\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\r\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\r\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\r\n\r\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\r\n\r\n\t\tvec4 t1 = texture2D( ltc_1, uv );\r\n\t\tvec4 t2 = texture2D( ltc_2, uv );\r\n\r\n\t\tmat3 mInv = mat3(\r\n\t\t\tvec3( t1.x, 0, t1.y ),\r\n\t\t\tvec3( 0, 1, 0 ),\r\n\t\t\tvec3( t1.z, 0, t1.w )\r\n\t\t);\r\n\r\n\t\t// LTC Fresnel Approximation by Stephen Hill\r\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\r\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\r\n\r\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\r\n\r\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\r\n\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\r\n\r\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\t\tfloat dotNL = dotNV;\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_Physical\r\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\r\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\r\n\r\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\r\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\r\n\r\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\r\n\r\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\r\n\r\n}\r\n",lights_template:"\r\n\r\nGeometricContext geometry;\r\n\r\ngeometry.position = - vViewPosition;\r\ngeometry.normal = normal;\r\ngeometry.viewDir = normalize( vViewPosition );\r\n\r\nIncidentLight directLight;\r\n\r\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\r\n\r\n\tRectAreaLight rectAreaLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\r\n\r\n\t\trectAreaLight = rectAreaLights[ i ];\r\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if defined( RE_IndirectDiffuse )\r\n\r\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\r\n\r\n\t\t#endif\r\n\r\n\t\tirradiance += lightMapIrradiance;\r\n\r\n\t#endif\r\n\r\n\t#if ( NUM_HEMI_LIGHTS > 0 )\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t// TODO, replace 8 with the real maxMIPLevel\r\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\r\n\r\n\t#endif\r\n\r\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n\r\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\r\n\r\n\t// TODO, replace 8 with the real maxMIPLevel\r\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\r\n\r\n\t#ifndef STANDARD\r\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\r\n\t#else\r\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\r\n\t#endif\r\n\r\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\r\n\r\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\r\n\r\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvFragDepth = 1.0 + gl_Position.w;\r\n\r\n\t#else\r\n\r\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\r\n\r\n\t\tgl_Position.z *= gl_Position.w;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",map_fragment:"#ifdef USE_MAP\r\n\r\n\tvec4 texelColor = texture2D( map, vUv );\r\n\r\n\ttexelColor = mapTexelToLinear( texelColor );\r\n\tdiffuseColor *= texelColor;\r\n\r\n#endif\r\n",map_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",map_particle_fragment:"#ifdef USE_MAP\r\n\r\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\r\n\tvec4 mapTexel = texture2D( map, uv );\r\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\r\n\r\n#endif\r\n",map_particle_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform mat3 uvTransform;\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",metalnessmap_fragment:"float metalnessFactor = metalness;\r\n\r\n#ifdef USE_METALNESSMAP\r\n\r\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\r\n\r\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tmetalnessFactor *= texelMetalness.b;\r\n\r\n#endif\r\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\r\n\r\n\tuniform sampler2D metalnessMap;\r\n\r\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\r\n\r\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\r\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\r\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\r\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\r\n\r\n#endif\r\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\tuniform float morphTargetInfluences[ 8 ];\r\n\r\n\t#else\r\n\r\n\tuniform float morphTargetInfluences[ 4 ];\r\n\r\n\t#endif\r\n\r\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\r\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\r\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\r\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\r\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\r\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\r\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\r\n\r\n\t#endif\r\n\r\n#endif\r\n",normal_fragment:"#ifdef FLAT_SHADED\r\n\r\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\r\n\r\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\r\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\r\n\tvec3 normal = normalize( cross( fdx, fdy ) );\r\n\r\n#else\r\n\r\n\tvec3 normal = normalize( vNormal );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\r\n\r\n\t#endif\r\n\r\n#endif\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\r\n\r\n#elif defined( USE_BUMPMAP )\r\n\r\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n\r\n#endif\r\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform vec2 normalScale;\r\n\r\n\t// Per-Pixel Tangent Space Normal Mapping\r\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\r\n\r\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\r\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\r\n\t\tvec2 st0 = dFdx( vUv.st );\r\n\t\tvec2 st1 = dFdy( vUv.st );\r\n\r\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n\t\tvec3 N = normalize( surf_norm );\r\n\r\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\r\n\t\tmapN.xy = normalScale * mapN.xy;\r\n\t\tmat3 tsn = mat3( S, T, N );\r\n\t\treturn normalize( tsn * mapN );\r\n\r\n\t}\r\n\r\n#endif\r\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\r\n\treturn normalize( normal ) * 0.5 + 0.5;\r\n}\r\n\r\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\r\n\treturn 2.0 * rgb.xyz - 1.0;\r\n}\r\n\r\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\r\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\r\n\r\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\r\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\r\n\r\nconst float ShiftRight8 = 1. / 256.;\r\n\r\nvec4 packDepthToRGBA( const in float v ) {\r\n\tvec4 r = vec4( fract( v * PackFactors ), v );\r\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\r\n\treturn r * PackUpscale;\r\n}\r\n\r\nfloat unpackRGBAToDepth( const in vec4 v ) {\r\n\treturn dot( v, UnpackFactors );\r\n}\r\n\r\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\r\n\r\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn ( viewZ + near ) / ( near - far );\r\n}\r\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\r\n\treturn linearClipZ * ( near - far ) - near;\r\n}\r\n\r\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\r\n}\r\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\r\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\r\n}\r\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\r\n\r\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\r\n\tgl_FragColor.rgb *= gl_FragColor.a;\r\n\r\n#endif\r\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\r\n\r\ngl_Position = projectionMatrix * mvPosition;\r\n",dithering_fragment:"#if defined( DITHERING )\r\n\r\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\r\n\r\n#endif\r\n",dithering_pars_fragment:"#if defined( DITHERING )\r\n\r\n\t// based on https://www.shadertoy.com/view/MslGR8\r\n\tvec3 dithering( vec3 color ) {\r\n\t\t//Calculate grid position\r\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\r\n\r\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\r\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\r\n\r\n\t\t//modify shift acording to grid position.\r\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\r\n\r\n\t\t//shift the color by dither_shift\r\n\t\treturn color + dither_shift_RGB;\r\n\t}\r\n\r\n#endif\r\n",roughnessmap_fragment:"float roughnessFactor = roughness;\r\n\r\n#ifdef USE_ROUGHNESSMAP\r\n\r\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\r\n\r\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\troughnessFactor *= texelRoughness.g;\r\n\r\n#endif\r\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\r\n\r\n\tuniform sampler2D roughnessMap;\r\n\r\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\r\n\r\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\r\n\r\n\t}\r\n\r\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\r\n\r\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\r\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\r\n\r\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\r\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\r\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\r\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\r\n\r\n\t\tvec2 f = fract( uv * size + 0.5 );\r\n\r\n\t\tfloat a = mix( lb, lt, f.y );\r\n\t\tfloat b = mix( rb, rt, f.y );\r\n\t\tfloat c = mix( a, b, f.x );\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\r\n\r\n\t\tfloat shadow = 1.0;\r\n\r\n\t\tshadowCoord.xyz /= shadowCoord.w;\r\n\t\tshadowCoord.z += shadowBias;\r\n\r\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\r\n\t\t// if ( all( something, something ) ) using this instead\r\n\r\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\r\n\t\tbool inFrustum = all( inFrustumVec );\r\n\r\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\r\n\r\n\t\tbool frustumTest = all( frustumTestVec );\r\n\r\n\t\tif ( frustumTest ) {\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering:\r\n\r\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\r\n\r\n\t\t#endif\r\n\r\n\t\t}\r\n\r\n\t\treturn shadow;\r\n\r\n\t}\r\n\r\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\r\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\r\n\t// 2D texture:\r\n\t//\r\n\t// xzXZ\r\n\t// y Y\r\n\t//\r\n\t// Y - Positive y direction\r\n\t// y - Negative y direction\r\n\t// X - Positive x direction\r\n\t// x - Negative x direction\r\n\t// Z - Positive z direction\r\n\t// z - Negative z direction\r\n\t//\r\n\t// Source and test bed:\r\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\r\n\r\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\r\n\r\n\t\t// Number of texels to avoid at the edge of each square\r\n\r\n\t\tvec3 absV = abs( v );\r\n\r\n\t\t// Intersect unit cube\r\n\r\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\r\n\t\tabsV *= scaleToCube;\r\n\r\n\t\t// Apply scale to avoid seams\r\n\r\n\t\t// two texels less per square (one texel will do for NEAREST)\r\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\r\n\r\n\t\t// Unwrap\r\n\r\n\t\t// space: -1 ... 1 range for each square\r\n\t\t//\r\n\t\t// #X##\t\tdim := ( 4 , 2 )\r\n\t\t// # #\t\tcenter := ( 1 , 1 )\r\n\r\n\t\tvec2 planar = v.xy;\r\n\r\n\t\tfloat almostATexel = 1.5 * texelSizeY;\r\n\t\tfloat almostOne = 1.0 - almostATexel;\r\n\r\n\t\tif ( absV.z >= almostOne ) {\r\n\r\n\t\t\tif ( v.z > 0.0 )\r\n\t\t\t\tplanar.x = 4.0 - v.x;\r\n\r\n\t\t} else if ( absV.x >= almostOne ) {\r\n\r\n\t\t\tfloat signX = sign( v.x );\r\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\r\n\r\n\t\t} else if ( absV.y >= almostOne ) {\r\n\r\n\t\t\tfloat signY = sign( v.y );\r\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\r\n\t\t\tplanar.y = v.z * signY - 2.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Transform to UV space\r\n\r\n\t\t// scale := 0.5 / dim\r\n\t\t// translate := ( center + 0.5 ) / dim\r\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\r\n\r\n\t}\r\n\r\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\r\n\r\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\r\n\t\t// the vector from the light to the world-space position of the fragment.\r\n\t\tvec3 lightToPosition = shadowCoord.xyz;\r\n\r\n\t\t// dp = normalized distance from light to fragment position\r\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\r\n\t\tdp += shadowBias;\r\n\r\n\t\t// bd3D = base direction 3D\r\n\t\tvec3 bd3D = normalize( lightToPosition );\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\r\n\r\n\t\t\treturn (\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering\r\n\r\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmask_pars_fragment:"float getShadowMask() {\r\n\r\n\tfloat shadow = 1.0;\r\n\r\n\t#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\t#endif\r\n\r\n\treturn shadow;\r\n\r\n}\r\n",skinbase_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\r\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\r\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\r\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\r\n\r\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\r\n\r\n\tuniform mat4 bindMatrix;\r\n\tuniform mat4 bindMatrixInverse;\r\n\r\n\t#ifdef BONE_TEXTURE\r\n\r\n\t\tuniform sampler2D boneTexture;\r\n\t\tuniform int boneTextureSize;\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tfloat j = i * 4.0;\r\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\r\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\r\n\r\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\r\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\r\n\r\n\t\t\ty = dy * ( y + 0.5 );\r\n\r\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\r\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\r\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\r\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\r\n\r\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\r\n\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#else\r\n\r\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n#endif\r\n",skinning_vertex:"#ifdef USE_SKINNING\r\n\r\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\r\n\r\n\tvec4 skinned = vec4( 0.0 );\r\n\tskinned += boneMatX * skinVertex * skinWeight.x;\r\n\tskinned += boneMatY * skinVertex * skinWeight.y;\r\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\r\n\tskinned += boneMatW * skinVertex * skinWeight.w;\r\n\r\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\r\n\r\n#endif\r\n",skinnormal_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 skinMatrix = mat4( 0.0 );\r\n\tskinMatrix += skinWeight.x * boneMatX;\r\n\tskinMatrix += skinWeight.y * boneMatY;\r\n\tskinMatrix += skinWeight.z * boneMatZ;\r\n\tskinMatrix += skinWeight.w * boneMatW;\r\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\r\n\r\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\r\n\r\n#endif\r\n",specularmap_fragment:"float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n\r\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\r\n\tspecularStrength = texelSpecular.r;\r\n\r\n#else\r\n\r\n\tspecularStrength = 1.0;\r\n\r\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\r\n\r\n\tuniform sampler2D specularMap;\r\n\r\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n",tonemapping_pars_fragment:"#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\tuniform mat3 uvTransform;\r\n\r\n#endif\r\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\r\n\r\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tattribute vec2 uv2;\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvUv2 = uv2;\r\n\r\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\r\n\r\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\r\n\r\n#endif\r\n",cube_frag:"uniform samplerCube tCube;\r\nuniform float tFlip;\r\nuniform float opacity;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\r\n\tgl_FragColor.a *= opacity;\r\n\r\n}\r\n",cube_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tgl_Position.z = gl_Position.w; // set z to camera.far\r\n\r\n}\r\n",depth_frag:"#if DEPTH_PACKING == 3200\r\n\r\n\tuniform float opacity;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tdiffuseColor.a = opacity;\r\n\r\n\t#endif\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\r\n\r\n\t#elif DEPTH_PACKING == 3201\r\n\r\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\r\n\r\n\t#endif\r\n\r\n}\r\n",depth_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",distanceRGBA_frag:"#define DISTANCE\r\n\r\nuniform vec3 referencePosition;\r\nuniform float nearDistance;\r\nuniform float farDistance;\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main () {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\tfloat dist = length( vWorldPosition - referencePosition );\r\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\r\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\r\n\r\n\tgl_FragColor = packDepthToRGBA( dist );\r\n\r\n}\r\n",distanceRGBA_vert:"#define DISTANCE\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvWorldPosition = worldPosition.xyz;\r\n\r\n}\r\n",equirect_frag:"uniform sampler2D tEquirect;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvec3 direction = normalize( vWorldPosition );\r\n\r\n\tvec2 sampleUV;\r\n\r\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\r\n\r\n}\r\n",equirect_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n}\r\n",linedashed_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform float dashSize;\r\nuniform float totalSize;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <color_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb; // simple shader\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",linedashed_vert:"uniform float scale;\r\nattribute float lineDistance;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\r\n\tvLineDistance = scale * lineDistance;\r\n\r\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n\tgl_Position = projectionMatrix * mvPosition;\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshbasic_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\r\n\t// accumulation (baked indirect lighting only)\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\r\n\r\n\t#endif\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\r\n\r\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",meshbasic_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_ENVMAP\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshlambert_frag:"uniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float opacity;\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#include <lightmap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.directDiffuse = vLightFront;\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshlambert_vert:"#define LAMBERT\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <lights_lambert_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphong_frag:"#define PHONG\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <gradientmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <lights_phong_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_phong_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphong_vert:"#define PHONG\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphysical_frag:"#define PHYSICAL\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float roughness;\r\nuniform float metalness;\r\nuniform float opacity;\r\n\r\n#ifndef STANDARD\r\n\tuniform float clearCoat;\r\n\tuniform float clearCoatRoughness;\r\n#endif\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <cube_uv_reflection_fragment>\r\n#include <lights_pars>\r\n#include <lights_physical_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <roughnessmap_pars_fragment>\r\n#include <metalnessmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <roughnessmap_fragment>\r\n\t#include <metalnessmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_physical_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphysical_vert:"#define PHYSICAL\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",normal_frag:"#define NORMAL\r\n\r\nuniform float opacity;\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <normal_fragment>\r\n\r\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\r\n\r\n}\r\n",normal_vert:"#define NORMAL\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n#endif\r\n\r\n}\r\n",points_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <color_pars_fragment>\r\n#include <map_particle_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_particle_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",points_vert:"uniform float size;\r\nuniform float scale;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\t#ifdef USE_SIZEATTENUATION\r\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\r\n\t#else\r\n\t\tgl_PointSize = size;\r\n\t#endif\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",shadow_frag:"uniform vec3 color;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\r\n\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",shadow_vert:"#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n"},ve={basic:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:ye.meshbasic_vert,fragmentShader:ye.meshbasic_frag},lambert:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.fog,me.lights,{emissive:{value:new fe(0)}}]),vertexShader:ye.meshlambert_vert,fragmentShader:ye.meshlambert_frag},phong:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:ye.meshphong_vert,fragmentShader:ye.meshphong_frag},standard:{uniforms:ge.merge([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new fe(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},points:{uniforms:ge.merge([me.points,me.fog]),vertexShader:ye.points_vert,fragmentShader:ye.points_frag},dashed:{uniforms:ge.merge([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ye.linedashed_vert,fragmentShader:ye.linedashed_frag},depth:{uniforms:ge.merge([me.common,me.displacementmap]),vertexShader:ye.depth_vert,fragmentShader:ye.depth_frag},normal:{uniforms:ge.merge([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:ye.normal_vert,fragmentShader:ye.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ye.cube_vert,fragmentShader:ye.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ye.equirect_vert,fragmentShader:ye.equirect_frag},distanceRGBA:{uniforms:ge.merge([me.common,me.displacementmap,{referencePosition:{value:new b},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ye.distanceRGBA_vert,fragmentShader:ye.distanceRGBA_frag},shadow:{uniforms:ge.merge([me.lights,me.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:ye.shadow_vert,fragmentShader:ye.shadow_frag}};function be(e,t,n,r,i,o,a,s,c){E.call(this,e,t,n,r,i,o,a,s,c),this.needsUpdate=!0}function _e(e,t,n,r,i){var o,a,s,c,l,u,h=new b,d=new v,p=new b;function f(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);o=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,o),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),s=function(){var e=t.createProgram(),n=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),t.shaderSource(r,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),t.compileShader(n),t.compileShader(r),t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),e}(),c={position:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},l={uvOffset:t.getUniformLocation(s,"uvOffset"),uvScale:t.getUniformLocation(s,"uvScale"),rotation:t.getUniformLocation(s,"rotation"),center:t.getUniformLocation(s,"center"),scale:t.getUniformLocation(s,"scale"),color:t.getUniformLocation(s,"color"),map:t.getUniformLocation(s,"map"),opacity:t.getUniformLocation(s,"opacity"),modelViewMatrix:t.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(s,"projectionMatrix"),fogType:t.getUniformLocation(s,"fogType"),fogDensity:t.getUniformLocation(s,"fogDensity"),fogNear:t.getUniformLocation(s,"fogNear"),fogFar:t.getUniformLocation(s,"fogFar"),fogColor:t.getUniformLocation(s,"fogColor"),fogDepth:t.getUniformLocation(s,"fogDepth"),alphaTest:t.getUniformLocation(s,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var h=r.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),u=new be(r)}function m(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(i,g,y){if(0!==i.length){void 0===s&&f(),n.useProgram(s),n.initAttributes(),n.enableAttribute(c.position),n.enableAttribute(c.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(c.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(c.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.uniformMatrix4fv(l.projectionMatrix,!1,y.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var v=0,b=0,_=g.fog;_?(t.uniform3f(l.fogColor,_.color.r,_.color.g,_.color.b),_.isFog?(t.uniform1f(l.fogNear,_.near),t.uniform1f(l.fogFar,_.far),t.uniform1i(l.fogType,1),v=1,b=1):_.isFogExp2&&(t.uniform1f(l.fogDensity,_.density),t.uniform1i(l.fogType,2),v=2,b=2)):(t.uniform1i(l.fogType,0),v=0,b=0);for(var w=0,E=i.length;w<E;w++){(S=i[w]).modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}i.sort(m);var A=[],x=[];for(w=0,E=i.length;w<E;w++){var S,T=(S=i[w]).material;if(!1!==T.visible){S.onBeforeRender(e,g,y,void 0,T,void 0),t.uniform1f(l.alphaTest,T.alphaTest),t.uniformMatrix4fv(l.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(h,d,p),A[0]=p.x,A[1]=p.y,x[0]=S.center.x-.5,x[1]=S.center.y-.5;var M=0;g.fog&&T.fog&&(M=b),v!==M&&(t.uniform1i(l.fogType,M),v=M),null!==T.map?(t.uniform2f(l.uvOffset,T.map.offset.x,T.map.offset.y),t.uniform2f(l.uvScale,T.map.repeat.x,T.map.repeat.y)):(t.uniform2f(l.uvOffset,0,0),t.uniform2f(l.uvScale,1,1)),t.uniform1f(l.opacity,T.opacity),t.uniform3f(l.color,T.color.r,T.color.g,T.color.b),t.uniform1f(l.rotation,T.rotation),t.uniform2fv(l.center,x),t.uniform2fv(l.scale,A),n.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst,T.blendEquationAlpha,T.blendSrcAlpha,T.blendDstAlpha,T.premultipliedAlpha),n.buffers.depth.setTest(T.depthTest),n.buffers.depth.setMask(T.depthWrite),n.buffers.color.setMask(T.colorWrite),r.setTexture2D(T.map||u,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),S.onAfterRender(e,g,y,void 0,T,void 0)}}n.enable(t.CULL_FACE),n.reset()}}}ve.physical={uniforms:ge.merge([ve.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},be.prototype=Object.create(E.prototype),be.prototype.constructor=be;var we,Ee,Ae,xe,Se,Te,Me,Re=0;function Ce(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=m.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function ke(e){Ce.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function Ie(e){Ce.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new b,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Pe(e,t){this.min=void 0!==e?e:new b(1/0,1/0,1/0),this.max=void 0!==t?t:new b(-1/0,-1/0,-1/0)}function Oe(e,t){this.center=void 0!==e?e:new b,this.radius=void 0!==t?t:0}function Ne(e,t){this.normal=void 0!==e?e:new b(1,0,0),this.constant=void 0!==t?t:0}function De(e,t,n,r,i,o){this.planes=[void 0!==e?e:new Ne,void 0!==t?t:new Ne,void 0!==n?n:new Ne,void 0!==r?r:new Ne,void 0!==i?i:new Ne,void 0!==o?o:new Ne]}function Le(e,t,n){for(var r=new De,i=new y,o=new g,a=new g(n,n),s=new b,c=new b,l=new Array(4),u=new Array(4),h={},d={0:1,1:0,2:2},p=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],f=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)],m=[new A,new A,new A,new A,new A,new A],v=0;4!==v;++v){var _=0!=(1&v),w=0!=(2&v),E=new ke({depthPacking:3201,morphTargets:_,skinning:w});l[v]=E;var S=new Ie({morphTargets:_,skinning:w});u[v]=S}var T=this;function M(t,n,r,i,o,a){var s=t.geometry,c=null,p=l,f=t.customDepthMaterial;if(r&&(p=u,f=t.customDistanceMaterial),f)c=f;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var g=0;m&&(g|=1),t.isSkinnedMesh&&n.skinning&&(g|=2),c=p[g]}if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var y=c.uuid,v=n.uuid,b=h[y];void 0===b&&(b={},h[y]=b);var _=b[v];void 0===_&&(_=c.clone(),b[v]=_),c=_}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:d[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,r&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=o,c.farDistance=a),c}function R(n,i,o,a){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var s=t.update(n),l=n.material;if(Array.isArray(l))for(var u=s.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=l[p.materialIndex];if(f&&f.visible){var m=M(n,f,a,c,o.near,o.far);e.renderBufferDirect(o,null,s,m,n,p)}}else if(l.visible){m=M(n,l,a,c,o.near,o.far);e.renderBufferDirect(o,null,s,m,n,null)}}for(var g=n.children,y=0,v=g.length;y<v;y++)R(g[y],i,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,l){if(!1!==T.enabled&&(!1!==T.autoUpdate||!1!==T.needsUpdate)&&0!==t.length){var u,h=e.context,d=e.state;d.disable(h.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var g=0,y=t.length;g<y;g++){var v=t[g],b=v.shadow,_=v&&v.isPointLight;if(void 0!==b){var w=b.camera;if(o.copy(b.mapSize),o.min(a),_){var E=o.x,A=o.y;m[0].set(2*E,A,E,A),m[1].set(0,A,E,A),m[2].set(3*E,A,E,A),m[3].set(E,A,E,A),m[4].set(3*E,0,E,A),m[5].set(E,0,E,A),o.x*=4,o.y*=2}if(null===b.map){var S={minFilter:1003,magFilter:1003,format:1023};b.map=new x(o.x,o.y,S),b.map.texture.name=v.name+".shadowMap",w.updateProjectionMatrix()}b.isSpotLightShadow&&b.update(v);var M=b.map,C=b.matrix;c.setFromMatrixPosition(v.matrixWorld),w.position.copy(c),_?(u=6,C.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(v.target.matrixWorld),w.lookAt(s),w.updateMatrixWorld(),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(w.projectionMatrix),C.multiply(w.matrixWorldInverse)),e.setRenderTarget(M),e.clear();for(var k=0;k<u;k++){if(_){s.copy(w.position),s.add(p[k]),w.up.copy(f[k]),w.lookAt(s),w.updateMatrixWorld();var I=m[k];d.viewport(I)}i.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse),r.setFromMatrix(i),R(n,l,w,_)}}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}T.needsUpdate=!1}}}function Fe(e){var t={};return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t[e.uuid]},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=t[n.uuid];r&&(e.deleteBuffer(r.buffer),delete t[n.uuid])},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i=t[n.uuid];void 0===i?t[n.uuid]=function(t,n){var r=t.array,i=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();var a=e.FLOAT;return r instanceof Float32Array?a=e.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=e.UNSIGNED_SHORT:r instanceof Int16Array?a=e.SHORT:r instanceof Uint32Array?a=e.UNSIGNED_INT:r instanceof Int32Array?a=e.INT:r instanceof Int8Array?a=e.BYTE:r instanceof Uint8Array&&(a=e.UNSIGNED_BYTE),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(n,r):i.version<n.version&&(!function(t,n,r){var i=n.array,o=n.updateRange;e.bindBuffer(r,t),!1===n.dynamic?e.bufferData(r,i,e.STATIC_DRAW):-1===o.count?e.bufferSubData(r,0,i):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,o.offset*i.BYTES_PER_ELEMENT,i.subarray(o.offset,o.offset+o.count)),o.count=-1)}(i.buffer,n,r),i.version=n.version)}}}function je(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||je.DefaultOrder}function Ue(){this.mask=1}Ce.prototype=Object.assign(Object.create(o.prototype),{constructor:Ce,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]="overdraw"===t?Number(n):n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.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),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.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.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,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.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,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.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ke.prototype=Object.create(Ce.prototype),ke.prototype.constructor=ke,ke.prototype.isMeshDepthMaterial=!0,ke.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,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},Ie.prototype=Object.create(Ce.prototype),Ie.prototype.constructor=Ie,Ie.prototype.isMeshDistanceMaterial=!0,Ie.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Object.assign(Pe.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new b;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,n,r=new b;function i(i){var o=i.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(t=0,n=a.length;t<n;t++)r.copy(a[t]),r.applyMatrix4(i.matrixWorld),e.expandByPoint(r)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(t=0,n=s.count;t<n;t++)r.fromBufferAttribute(s,t).applyMatrix4(i.matrixWorld),e.expandByPoint(r)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(i),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(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:function(e,t){return(t||new b).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:function(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:(Ee=new b,function(e){return this.clampPoint(e.center,Ee),Ee.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var 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:function(){var e=new b,t=new b,n=new b,r=new b,i=new b,o=new b,a=new b,s=new b,c=new b,l=new b;function u(r){var i,o;for(i=0,o=r.length-3;i<=o;i+=3){a.fromArray(r,i);var s=c.x*Math.abs(a.x)+c.y*Math.abs(a.y)+c.z*Math.abs(a.z),l=e.dot(a),u=t.dot(a),h=n.dot(a);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(a.a,s),t.subVectors(a.b,s),n.subVectors(a.c,s),r.subVectors(t,e),i.subVectors(n,t),o.subVectors(e,n);var h=[0,-r.z,r.y,0,-i.z,i.y,0,-o.z,o.y,r.z,0,-r.x,i.z,0,-i.x,o.z,0,-o.x,-r.y,r.x,0,-i.y,i.x,0,-o.y,o.x,0];return!!u(h)&&(!!u(h=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(r,i),u(h=[l.x,l.y,l.z])))}}(),clampPoint:function(e,t){return(t||new b).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new b;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new b;return function(t){var n=t||new Oe;return this.getCenter(n.center),n.radius=.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(we=[new b,new b,new b,new b,new b,new b,new b,new b],function(e){return this.isEmpty()||(we[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),we[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),we[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),we[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),we[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),we[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),we[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),we[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(we)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Oe.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(Ae=new Pe,function(e,t){var n=this.center;void 0!==t?n.copy(t):Ae.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;i<o;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),r=t||new b;return r.copy(e),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new Pe;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Ne.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new b,t=new b;return function(n,r,i){var o=e.subVectors(i,r).cross(t.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return(t||new b).copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new b;return function(t,n){var r=n||new b,i=t.delta(e),o=this.normal.dot(i);if(0===o)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var a=-(t.start.dot(this.normal)+this.constant)/o;return a<0||a>1?void 0:r.copy(i).multiplyScalar(a).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return(e||new b).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new b,t=new _;return function(n,r){var i=r||t.getNormalMatrix(n),o=this.coplanarPoint(e).applyMatrix4(n),a=this.normal.applyMatrix3(i).normalize();return this.constant=-o.dot(a),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(De.prototype,{set:function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return t[0].setComponents(a-r,u-s,f-h,v-m).normalize(),t[1].setComponents(a+r,u+s,f+h,v+m).normalize(),t[2].setComponents(a+i,u+c,f+d,v+g).normalize(),t[3].setComponents(a-i,u-c,f-d,v-g).normalize(),t[4].setComponents(a-o,u-l,f-p,v-y).normalize(),t[5].setComponents(a+o,u+l,f+p,v+y).normalize(),this},intersectsObject:(Te=new Oe,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Te.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Te)}),intersectsSprite:function(){var e=new Oe;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(xe=new b,Se=new b,function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];xe.x=r.normal.x>0?e.min.x:e.max.x,Se.x=r.normal.x>0?e.max.x:e.min.x,xe.y=r.normal.y>0?e.min.y:e.max.y,Se.y=r.normal.y>0?e.max.y:e.min.y,xe.z=r.normal.z>0?e.min.z:e.max.z,Se.z=r.normal.z>0?e.max.z:e.min.z;var i=r.distanceToPoint(xe),o=r.distanceToPoint(Se);if(i<0&&o<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}),je.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],je.DefaultOrder="XYZ",Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(je.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=m.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new y;return function(t,n,r){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(Me=new v,function(e){return Me.setFromEuler(this),this.setFromQuaternion(Me,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new b(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Ue.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var Be,Ve,He,ze,qe=0;function Ge(){Object.defineProperty(this,"id",{value:qe++}),this.uuid=m.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ge.DefaultUp.clone();var e=new b,t=new je,n=new v,r=new b(1,1,1);t.onChange((function(){n.setFromEuler(t,!1)})),n.onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:r},modelViewMatrix:{value:new y},normalMatrix:{value:new _}}),this.matrix=new y,this.matrixWorld=new y,this.matrixAutoUpdate=Ge.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ue,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function We(){Ge.call(this),this.type="Camera",this.matrixWorldInverse=new y,this.projectionMatrix=new y}function Je(e,t,n,r,i,o){We.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function Ze(e,t,n,r,i,o){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new b,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new fe,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Ge.DefaultUp=new b(0,1,0),Ge.DefaultMatrixAutoUpdate=!0,Ge.prototype=Object.assign(Object.create(o.prototype),{constructor:Ge,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(ze=new v,function(e,t){return ze.setFromAxisAngle(e,t),this.quaternion.multiply(ze),this}),rotateOnWorldAxis:function(){var e=new v;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new b(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new b(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new b(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new b;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translateX:function(){var e=new b(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new b(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new b(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(He=new y,function(e){return e.applyMatrix4(He.getInverse(this.matrixWorld))}),lookAt:function(){var e=new y,t=new b;return function(n,r,i){n.isVector3?t.copy(n):t.set(n,r,i),this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){var t=e||new b;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Be=new b,Ve=new b,function(e){var t=e||new v;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(Be,t,Ve),t}),getWorldRotation:function(){var e=new v;return function(t){var n=t||new je;return this.getWorldQuaternion(e),n.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new b,t=new v;return function(n){var r=n||new b;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.matrix=this.matrix.toArray(),void 0!==this.geometry){r.geometry=i(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,c=a.length;s<c;s++){var l=a[s];i(e.shapes,l)}else i(e.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),d=m(e.materials),p=m(e.textures),f=m(e.images);a=m(e.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),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.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.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),We.prototype=Object.assign(Object.create(Ge.prototype),{constructor:We,isCamera:!0,copy:function(e,t){return Ge.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){Ge.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Je.prototype=Object.assign(Object.create(We.prototype),{constructor:Je,isOrthographicCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;o=(i+=u*(this.view.offsetX/c))+u*(this.view.width/c),s=(a-=h*(this.view.offsetY/l))-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far)},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Object.assign(Ze.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Xe,Ye=0;function Qe(){Object.defineProperty(this,"id",{value:Ye+=2}),this.uuid=m.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ke(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=m.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function $e(e,t,n){Ke.call(this,new Int8Array(e),t,n)}function et(e,t,n){Ke.call(this,new Uint8Array(e),t,n)}function tt(e,t,n){Ke.call(this,new Uint8ClampedArray(e),t,n)}function nt(e,t,n){Ke.call(this,new Int16Array(e),t,n)}function rt(e,t,n){Ke.call(this,new Uint16Array(e),t,n)}function it(e,t,n){Ke.call(this,new Int32Array(e),t,n)}function ot(e,t,n){Ke.call(this,new Uint32Array(e),t,n)}function at(e,t,n){Ke.call(this,new Float32Array(e),t,n)}function st(e,t,n){Ke.call(this,new Float64Array(e),t,n)}function ct(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function lt(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Qe.prototype=Object.assign(Object.create(o.prototype),{constructor:Qe,isGeometry:!0,applyMatrix:function(e){for(var t=(new _).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var o=0,a=i.vertexNormals.length;o<a;o++)i.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:(Xe=new Ge,function(e){Xe.lookAt(e),Xe.updateMatrix(),this.applyMatrix(Xe.matrix)}),fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes,i=r.position.array,o=void 0!==r.normal?r.normal.array:void 0,a=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],h=[],d=0,p=0;d<i.length;d+=3,p+=2)t.vertices.push(new b(i[d],i[d+1],i[d+2])),void 0!==o&&l.push(new b(o[d],o[d+1],o[d+2])),void 0!==a&&t.colors.push(new fe(a[d],a[d+1],a[d+2])),void 0!==s&&u.push(new g(s[p],s[p+1])),void 0!==c&&h.push(new g(c[p],c[p+1]));function f(e,n,r,i){var d=new Ze(e,n,r,void 0!==o?[l[e].clone(),l[n].clone(),l[r].clone()]:[],void 0!==a?[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()]:[],i);t.faces.push(d),void 0!==s&&t.faceVertexUvs[0].push([u[e].clone(),u[n].clone(),u[r].clone()]),void 0!==c&&t.faceVertexUvs[1].push([h[e].clone(),h[n].clone(),h[r].clone()])}var m=e.groups;if(m.length>0)for(d=0;d<m.length;d++)for(var y=m[d],v=y.start,_=(p=v,v+y.count);p<_;p+=3)void 0!==n?f(n[p],n[p+1],n[p+2],y.materialIndex):f(p,p+1,p+2,y.materialIndex);else if(void 0!==n)for(d=0;d<n.length;d+=3)f(n[d],n[d+1],n[d+2]);else for(d=0;d<i.length/3;d+=3)f(d,d+1,d+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new y;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new b,t=new b,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,a),t.subVectors(o,a),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,o,a;for(void 0===e&&(e=!0),a=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)a[t]=new b;if(e){var s,c,l,u=new b,h=new b;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],c=this.vertices[o.b],l=this.vertices[o.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),a[o.a].add(u),a[o.b].add(u),a[o.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a[(o=this.faces[r]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(t=0,n=this.vertices.length;t<n;t++)a[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(o=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var o=new Qe;for(o.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var a=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new b,l={a:new b,b:new b,c:new b},a.push(c),s.push(l)}var c,l,u=this.morphNormals[e];for(o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Oe),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],u=e.faceVertexUvs[0],h=this.colors,d=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new _).getNormalMatrix(t));for(var p=0,f=a.length;p<f;p++){var m=a[p].clone();void 0!==t&&m.applyMatrix4(t),o.push(m)}for(p=0,f=d.length;p<f;p++)h.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,y,v,b=c[p],w=b.vertexNormals,E=b.vertexColors;(g=new Ze(b.a+i,b.b+i,b.c+i)).normal.copy(b.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var A=0,x=w.length;A<x;A++)y=w[A].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),g.vertexNormals.push(y);g.color.copy(b.color);for(A=0,x=E.length;A<x;A++)v=E[A],g.vertexColors.push(v.clone());g.materialIndex=b.materialIndex+n,s.push(g)}for(p=0,f=u.length;p<f;p++){var S=u[p],T=[];if(void 0!==S){for(A=0,x=S.length;A<x;A++)T.push(S[A].clone());l.push(T)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,o,a,s,c={},l=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(c[t]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],o=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(o[p]===o[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new b(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===t&&(r=[]),a&&a.length===t&&(i=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(o[s]),i&&i.push(a[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var o=this.vertices[i];r.push(o.x,o.y,o.z)}var a=[],s=[],c={},l=[],u={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=p.normal.length()>0,g=p.vertexNormals.length>0,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,v=p.vertexColors.length>0,b=0;if(b=A(b,0,0),b=A(b,1,!0),b=A(b,2,!1),b=A(b,3,f),b=A(b,4,m),b=A(b,5,g),b=A(b,6,y),b=A(b,7,v),a.push(b),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var _=this.faceVertexUvs[0][i];a.push(T(_[0]),T(_[1]),T(_[2]))}if(m&&a.push(x(p.normal)),g){var w=p.vertexNormals;a.push(x(w[0]),x(w[1]),x(w[2]))}if(y&&a.push(S(p.color)),v){var E=p.vertexColors;a.push(S(E[0]),S(E[1]),S(E[2]))}}function A(e,t,n){return n?e|1<<t:e&~(1<<t)}function x(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function S(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=l.length,l.push(e.getHex())),u[t]}function T(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=a,e},clone:function(){return(new Qe).copy(this)},copy:function(e){var t,n,r,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],d=[];for(o=0,a=h.length;o<a;o++){var p=h[o];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var y={};if(void 0!==g[t].vertexNormals)for(y.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],b={};b.a=v.a.clone(),b.b=v.b.clone(),b.c=v.c.clone(),y.vertexNormals.push(b)}if(void 0!==g[t].faceNormals)for(y.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)y.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(y)}var _=e.skinWeights;for(t=0,n=_.length;t<n;t++)this.skinWeights.push(_[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var E=e.lineDistances;for(t=0,n=E.length;t<n;t++)this.lineDistances.push(E[t]);var A=e.boundingBox;null!==A&&(this.boundingBox=A.clone());var x=e.boundingSphere;return null!==x&&(this.boundingSphere=x.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ke.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ke.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new fe),t[n++]=o.r,t[n++]=o.g,t[n++]=o.b}return this},copyIndicesArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];t[n++]=o.a,t[n++]=o.b,t[n++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new g),t[n++]=o.x,t[n++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new b),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new A),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),$e.prototype=Object.create(Ke.prototype),$e.prototype.constructor=$e,et.prototype=Object.create(Ke.prototype),et.prototype.constructor=et,tt.prototype=Object.create(Ke.prototype),tt.prototype.constructor=tt,nt.prototype=Object.create(Ke.prototype),nt.prototype.constructor=nt,rt.prototype=Object.create(Ke.prototype),rt.prototype.constructor=rt,it.prototype=Object.create(Ke.prototype),it.prototype.constructor=it,ot.prototype=Object.create(Ke.prototype),ot.prototype.constructor=ot,at.prototype=Object.create(Ke.prototype),at.prototype.constructor=at,st.prototype=Object.create(Ke.prototype),st.prototype.constructor=st,Object.assign(ct.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,o=0;o<i.length;o++){var a=i[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==t&&(t.count=3*o-t.start,n.push(t)),t={start:3*o,materialIndex:r})}void 0!==t&&(t.count=3*o-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,o=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]=[];this.morphTargets.position=t}var u,h=e.morphNormals,d=h.length;if(d>0){u=[];for(l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}var p=e.skinIndices,f=e.skinWeights,m=p.length===r.length,y=f.length===r.length;for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(r[v.a],r[v.b],r[v.c]);var b=v.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var _=v.normal;this.normals.push(_,_,_)}var w,E=v.vertexColors;if(3===E.length)this.colors.push(E[0],E[1],E[2]);else{var A=v.color;this.colors.push(A,A,A)}if(!0===o)void 0!==(w=i[0][l])?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new g,new g,new g));if(!0===a)void 0!==(w=i[1][l])?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new g,new g,new g));for(var x=0;x<c;x++){var S=s[x].vertices;t[x].push(S[v.a],S[v.b],S[v.c])}for(x=0;x<d;x++){var T=h[x].vertexNormals[l];u[x].push(T.a,T.b,T.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),y&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var ut,ht,dt,pt,ft,mt,gt,yt=1;function vt(){Object.defineProperty(this,"id",{value:yt+=2}),this.uuid=m.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function bt(e,t,n,r,i,o){Qe.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new _t(e,t,n,r,i,o)),this.mergeVertices()}function _t(e,t,n,r,i,o){vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};var a=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;var s=[],c=[],l=[],u=[],h=0,d=0;function p(e,t,n,r,i,o,p,f,m,g,y){var v,_,w=o/m,E=p/g,A=o/2,x=p/2,S=f/2,T=m+1,M=g+1,R=0,C=0,k=new b;for(_=0;_<M;_++){var I=_*E-x;for(v=0;v<T;v++){var P=v*w-A;k[e]=P*r,k[t]=I*i,k[n]=S,c.push(k.x,k.y,k.z),k[e]=0,k[t]=0,k[n]=f>0?1:-1,l.push(k.x,k.y,k.z),u.push(v/m),u.push(1-_/g),R+=1}}for(_=0;_<g;_++)for(v=0;v<m;v++){var O=h+v+T*_,N=h+v+T*(_+1),D=h+(v+1)+T*(_+1),L=h+(v+1)+T*_;s.push(O,N,L),s.push(N,D,L),C+=6}a.addGroup(d,C,y),d+=C,h+=R}p("z","y","x",-1,-1,n,t,e,o,i,0),p("z","y","x",1,-1,n,t,-e,o,i,1),p("x","z","y",1,1,e,n,t,r,o,2),p("x","z","y",1,-1,e,n,-t,r,o,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.addAttribute("position",new at(c,3)),this.addAttribute("normal",new at(l,3)),this.addAttribute("uv",new at(u,2))}function wt(e,t,n,r){Qe.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Et(e,t,n,r)),this.mergeVertices()}function Et(e,t,n,r){vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,o,a=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,u=c+1,h=l+1,d=e/c,p=t/l,f=[],m=[],g=[],y=[];for(o=0;o<h;o++){var v=o*p-s;for(i=0;i<u;i++){var b=i*d-a;m.push(b,-v,0),g.push(0,0,1),y.push(i/c),y.push(1-o/l)}}for(o=0;o<l;o++)for(i=0;i<c;i++){var _=i+u*o,w=i+u*(o+1),E=i+1+u*(o+1),A=i+1+u*o;f.push(_,w,A),f.push(w,E,A)}this.setIndex(f),this.addAttribute("position",new at(m,3)),this.addAttribute("normal",new at(g,3)),this.addAttribute("uv",new at(y,2))}function At(e){Ce.call(this),this.type="MeshBasicMaterial",this.color=new fe(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.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function xt(e){Ce.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function St(e,t){this.origin=void 0!==e?e:new b,this.direction=void 0!==t?t:new b}function Tt(e,t){this.start=void 0!==e?e:new b,this.end=void 0!==t?t:new b}function Mt(e,t,n){this.a=void 0!==e?e:new b,this.b=void 0!==t?t:new b,this.c=void 0!==n?n:new b}function Rt(e,t){Ge.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new At({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function Ct(e,t,n,r){var i,o,a,s=new fe(0),c=0;function l(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){l(s,c=e)},render:function(t,r,u,h){var d=r.background;null===d?l(s,c):d&&d.isColor&&(l(d,1),h=!0),(e.autoClear||h)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&d.isCubeTexture?(void 0===a&&((a=new Rt(new _t(1,1,1),new xt({uniforms:ve.cube.uniforms,vertexShader:ve.cube.vertexShader,fragmentShader:ve.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),a.geometry.removeAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(a.geometry)),a.material.uniforms.tCube.value=d,t.push(a,a.geometry,a.material,0,null)):d&&d.isTexture&&(void 0===i&&(i=new Je(-1,1,1,-1,0,1),o=new Rt(new Et(2,2),new At({depthTest:!1,depthWrite:!1,fog:!1})),n.update(o.geometry)),o.material.map=d,e.renderBufferDirect(i,null,o.geometry,o.material,o,null))}}}function kt(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function It(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Pt(){var e=[],t=0,n=[],r=[];return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(i,o,a,s,c){var l=e[t];void 0===l?(l={id:i.id,object:i,geometry:o,material:a,program:a.program,renderOrder:i.renderOrder,z:s,group:c},e[t]=l):(l.id=i.id,l.object=i,l.geometry=o,l.material=a,l.program=a.program,l.renderOrder=i.renderOrder,l.z=s,l.group=c),(!0===a.transparent?r:n).push(l),t++},sort:function(){n.length>1&&n.sort(kt),r.length>1&&r.sort(It)}}}function Ot(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new Pt,e[r]=i),i},dispose:function(){e={}}}}function Nt(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Dt(e){var t={},n=new Float32Array(8);return{update:function(r,i,o,a){var s=r.morphTargetInfluences,c=s.length,l=t[i.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}var h=o.morphTargets&&i.morphAttributes.position,d=o.morphNormals&&i.morphAttributes.normal;for(u=0;u<c;u++){0!==(p=l[u])[1]&&(h&&i.removeAttribute("morphTarget"+u),d&&i.removeAttribute("morphNormal"+u))}for(u=0;u<c;u++){(p=l[u])[0]=u,p[1]=s[u]}for(l.sort(Nt),u=0;u<8;u++){var p;if(p=l[u]){var f=p[0],m=p[1];if(m){h&&i.addAttribute("morphTarget"+u,h[f]),d&&i.addAttribute("morphNormal"+u,d[f]),n[u]=m;continue}}n[u]=0}a.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function Lt(e,t,n){var r,i,o;this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,o=e.bytesPerElement},this.render=function(t,a){e.drawElements(r,a,i,t*o),n.calls++,n.vertices+=a,r===e.TRIANGLES?n.faces+=a/3:r===e.POINTS&&(n.points+=a)},this.renderInstances=function(a,s,c){var l=t.get("ANGLE_instanced_arrays");null!==l?(l.drawElementsInstancedANGLE(r,c,i,s*o,a.maxInstancedCount),n.calls++,n.vertices+=c*a.maxInstancedCount,r===e.TRIANGLES?n.faces+=a.maxInstancedCount*c/3:r===e.POINTS&&(n.points+=a.maxInstancedCount*c)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function Ft(e,t,n){var r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.calls++,n.vertices+=i,r===e.TRIANGLES?n.faces+=i/3:r===e.POINTS&&(n.points+=i)},this.renderInstances=function(i,o,a){var s=t.get("ANGLE_instanced_arrays");if(null!==s){var c=i.attributes.position;c.isInterleavedBufferAttribute?(a=c.data.count,s.drawArraysInstancedANGLE(r,0,a,i.maxInstancedCount)):s.drawArraysInstancedANGLE(r,o,a,i.maxInstancedCount),n.calls++,n.vertices+=a*i.maxInstancedCount,r===e.TRIANGLES?n.faces+=i.maxInstancedCount*a/3:r===e.POINTS&&(n.points+=i.maxInstancedCount*a)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function jt(e,t,n){var r={},i={};function o(e){var a=e.target,s=r[a.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);a.removeEventListener("dispose",o),delete r[a.id];var l=i[a.id];l&&(t.remove(l),delete i[a.id]),(l=i[s.id])&&(t.remove(l),delete i[s.id]),n.geometries--}return{get:function(e,t){var i=r[t.id];return i||(t.addEventListener("dispose",o),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new vt).setFromObject(e)),i=t._bufferGeometry),r[t.id]=i,n.geometries++,i)},update:function(n){var r=n.index,i=n.attributes;for(var o in null!==r&&t.update(r,e.ELEMENT_ARRAY_BUFFER),i)t.update(i[o],e.ARRAY_BUFFER);var a=n.morphAttributes;for(var o in a)for(var s=a[o],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(n){var r=i[n.id];if(r)return r;var o,a=[],s=n.index,c=n.attributes;if(null!==s)for(var l=0,u=(o=s.array).length;l<u;l+=3){var h=o[l+0],d=o[l+1],p=o[l+2];a.push(h,d,d,p,p,h)}else for(l=0,u=(o=c.position.array).length/3-1;l<u;l+=3){h=l+0,d=l+1,p=l+2;a.push(h,d,d,p,p,h)}return r=new(lt(a)>65535?ot:rt)(a,1),t.update(r,e.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function Ut(e,t){var n={};return{update:function(r){var i=t.frame,o=r.geometry,a=e.get(r,o);return n[a.id]!==i&&(o.isGeometry&&a.updateFromObject(r),e.update(a),n[a.id]=i),a},dispose:function(){n={}}}}function Bt(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),!1===e.getShaderParameter(r,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(n)),r}vt.prototype=Object.assign(Object.create(o.prototype),{constructor:vt,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(lt(e)>65535?ot:rt)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new Ke(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new _).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new Ge;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new at(3*t.vertices.length,3),r=new at(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new at(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new at(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ct).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Ke(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Ke(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new Ke(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Ke(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Ke(o,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var a=new(lt(e.indices)>65535?Uint32Array:Uint16Array)(3*e.indices.length);this.setIndex(new Ke(a,1).copyIndicesArray(e.indices))}for(var s in this.groups=e.groups,e.morphTargets){for(var c=[],l=e.morphTargets[s],u=0,h=l.length;u<h;u++){var d=l[u],p=new at(3*d.length,3);c.push(p.copyVector3sArray(d))}this.morphAttributes[s]=c}if(e.skinIndices.length>0){var f=new at(4*e.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new at(4*e.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Pe,t=new b;return function(){null===this.boundingSphere&&(this.boundingSphere=new Oe);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;e.setFromBufferAttribute(n),e.getCenter(r);for(var i=0,o=0,a=n.count;o<a;o++)t.x=n.getX(o),t.y=n.getY(o),t.z=n.getZ(o),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,n=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Ke(new Float32Array(r.length),3));else for(var i=t.normal.array,o=0,a=i.length;o<a;o++)i[o]=0;var s,c,l,u=t.normal.array,h=new b,d=new b,p=new b,f=new b,m=new b;if(e){var g=e.array;0===n.length&&this.addGroup(0,g.length);for(var y=0,v=n.length;y<v;++y){var _=n[y],w=_.start;for(o=w,a=w+_.count;o<a;o+=3)s=3*g[o+0],c=3*g[o+1],l=3*g[o+2],h.fromArray(r,s),d.fromArray(r,c),p.fromArray(r,l),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[c]+=f.x,u[c+1]+=f.y,u[c+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z}}else for(o=0,a=r.length;o<a;o+=9)h.fromArray(r,o),d.fromArray(r,o+3),p.fromArray(r,o+6),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[o]=f.x,u[o+1]=f.y,u[o+2]=f.z,u[o+3]=f.x,u[o+4]=f.y,u[o+5]=f.z,u[o+6]=f.x,u[o+7]=f.y,u[o+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0);var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,o=e.attributes[r],a=o.array,s=0,c=o.itemSize*t;s<a.length;s++,c++)i[c]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new b;return function(){for(var t=this.attributes.normal,n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.normalize(),t.setXYZ(n,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new vt,t=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],o=i.array,a=i.itemSize,s=new o.constructor(t.length*a),c=0,l=0,u=0,h=t.length;u<h;u++){c=t[u]*a;for(var d=0;d<a;d++)s[l++]=o[c++]}e.addAttribute(r,new Ke(s,a))}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:i}}var o=this.attributes;for(var n in o){var a=o[n];i=Array.prototype.slice.call(a.array);e.data.attributes[n]={itemSize:a.itemSize,type:a.array.constructor.name,array:i,normalized:a.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new vt).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var o=e.attributes;for(t in o){var a=o[t];this.addAttribute(t,a.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),bt.prototype=Object.create(Qe.prototype),bt.prototype.constructor=bt,_t.prototype=Object.create(vt.prototype),_t.prototype.constructor=_t,wt.prototype=Object.create(Qe.prototype),wt.prototype.constructor=wt,Et.prototype=Object.create(vt.prototype),Et.prototype.constructor=Et,At.prototype=Object.create(Ce.prototype),At.prototype.constructor=At,At.prototype.isMeshBasicMaterial=!0,At.prototype.copy=function(e){return Ce.prototype.copy.call(this,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.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this},xt.prototype=Object.create(Ce.prototype),xt.prototype.constructor=xt,xt.prototype.isShaderMaterial=!0,xt.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ge.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},xt.prototype.toJSON=function(e){var t=Ce.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(St.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new b).copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new b;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new b;n.subVectors(e,this.origin);var r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new b;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(ht=new b,dt=new b,pt=new b,function(e,t,n,r){ht.copy(e).add(t).multiplyScalar(.5),dt.copy(t).sub(e).normalize(),pt.copy(this.origin).sub(ht);var i,o,a,s,c=.5*e.distanceTo(t),l=-this.direction.dot(dt),u=pt.dot(this.direction),h=-pt.dot(dt),d=pt.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(o=l*u-h,s=c*p,(i=l*h-u)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(i*=f)*(i+l*(o*=f)+2*u)+o*(l*i+o+2*h)+d}else o=c,a=-(i=Math.max(0,-(l*o+u)))*i+o*(o+2*h)+d;else o=-c,a=-(i=Math.max(0,-(l*o+u)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-l*c+u)))*i+(o=i>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+d):a=-(i=Math.max(0,-(l*c+u)))*i+(o=i>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d;else o=l>0?-c:c,a=-(i=Math.max(0,-(l*o+u)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(dt).multiplyScalar(o).add(ht),a}),intersectSphere:function(){var e=new b;return function(t,n){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),i=e.dot(e)-r*r,o=t.radius*t.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=r-a,c=r+a;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,o,a,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,o=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,o=(e.min.y-h.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),u>=0?(a=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:(ut=new b,function(e){return null!==this.intersectBox(e,ut)}),intersectTriangle:function(){var e=new b,t=new b,n=new b,r=new b;return function(i,o,a,s,c){t.subVectors(o,i),n.subVectors(a,i),r.crossVectors(t,n);var l,u=this.direction.dot(r);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}e.subVectors(this.origin,i);var h=l*this.direction.dot(n.crossVectors(e,n));if(h<0)return null;var d=l*this.direction.dot(t.cross(e));if(d<0)return null;if(h+d>u)return null;var p=-l*e.dot(r);return p<0?null:this.at(p/u,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Tt.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return(e||new b).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new b).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new b;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(ft=new b,mt=new b,function(e,t){ft.subVectors(e,this.start),mt.subVectors(this.end,this.start);var n=mt.dot(mt),r=mt.dot(ft)/n;return t&&(r=m.clamp(r,0,1)),r}),closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t),i=n||new b;return this.delta(i).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Mt,{normal:(gt=new b,function(e,t,n,r){var i=r||new b;i.subVectors(n,t),gt.subVectors(e,t),i.cross(gt);var o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}),barycoordFromPoint:function(){var e=new b,t=new b,n=new b;return function(r,i,o,a,s){e.subVectors(a,i),t.subVectors(o,i),n.subVectors(r,i);var c=e.dot(e),l=e.dot(t),u=e.dot(n),h=t.dot(t),d=t.dot(n),p=c*h-l*l,f=s||new b;if(0===p)return f.set(-2,-1,-1);var m=1/p,g=(h*u-l*d)*m,y=(c*d-l*u)*m;return f.set(1-g-y,y,g)}}(),containsPoint:function(){var e=new b;return function(t,n,r,i){var o=Mt.barycoordFromPoint(t,n,r,i,e);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}()}),Object.assign(Mt.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new b,t=new b;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new b).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Mt.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new Ne).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Mt.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Mt.containsPoint(e,this.a,this.b,this.c)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new Ne,t=[new Tt,new Tt,new Tt],n=new b,r=new b;return function(i,o){var a=o||new b,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(i,n),!0===this.containsPoint(n))a.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var c=0;c<t.length;c++){t[c].closestPointToPoint(n,!0,r);var l=n.distanceToSquared(r);l<s&&(s=l,a.copy(r))}}return a}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Rt.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Rt,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return Ge.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=a.length;e<t;e++)n=a[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)n=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}},raycast:function(){var e=new y,t=new St,n=new Oe,r=new b,i=new b,o=new b,a=new b,s=new b,c=new b,l=new g,u=new g,h=new g,d=new b,p=new b,f=new b;function m(e,t,n,r,i,o,a){return Mt.barycoordFromPoint(e,t,n,r,d),i.multiplyScalar(d.x),o.multiplyScalar(d.y),a.multiplyScalar(d.z),i.add(o).add(a),i.clone()}function v(e,t,n,r,i,o,a,s){if(null===(1===t.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==t.side,s)))return null;f.copy(s),f.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(f);return c<n.near||c>n.far?null:{distance:c,point:f.clone(),object:e}}function _(e,t,n,a,s,c,d,f){r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,d),o.fromBufferAttribute(a,f);var g=v(e,e.material,t,n,r,i,o,p);return g&&(s&&(l.fromBufferAttribute(s,c),u.fromBufferAttribute(s,d),h.fromBufferAttribute(s,f),g.uv=m(p,r,i,o,l,u,h)),g.face=new Ze(c,d,f,Mt.normal(r,i,o)),g.faceIndex=c),g}return function(d,f){var g,y=this.geometry,b=this.material,w=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(w),!1!==d.ray.intersectsSphere(n)&&(e.getInverse(w),t.copy(d.ray).applyMatrix4(e),null===y.boundingBox||!1!==t.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var E,A,x,S,T,M=y.index,R=y.attributes.position,C=y.attributes.uv;if(null!==M)for(S=0,T=M.count;S<T;S+=3)E=M.getX(S),A=M.getX(S+1),x=M.getX(S+2),(g=_(this,d,t,R,C,E,A,x))&&(g.faceIndex=Math.floor(S/3),f.push(g));else if(void 0!==R)for(S=0,T=R.count;S<T;S+=3)(g=_(this,d,t,R,C,E=S,A=S+1,x=S+2))&&(g.index=E,f.push(g))}else if(y.isGeometry){var k,I,P,O,N=Array.isArray(b),D=y.vertices,L=y.faces,F=y.faceVertexUvs[0];F.length>0&&(O=F);for(var j=0,U=L.length;j<U;j++){var B=L[j],V=N?b[B.materialIndex]:b;if(void 0!==V){if(k=D[B.a],I=D[B.b],P=D[B.c],!0===V.morphTargets){var H=y.morphTargets,z=this.morphTargetInfluences;r.set(0,0,0),i.set(0,0,0),o.set(0,0,0);for(var q=0,G=H.length;q<G;q++){var W=z[q];if(0!==W){var J=H[q].vertices;r.addScaledVector(a.subVectors(J[B.a],k),W),i.addScaledVector(s.subVectors(J[B.b],I),W),o.addScaledVector(c.subVectors(J[B.c],P),W)}}r.add(k),i.add(I),o.add(P),k=r,I=i,P=o}if(g=v(this,V,d,t,k,I,P,p)){if(O&&O[j]){var Z=O[j];l.copy(Z[0]),u.copy(Z[1]),h.copy(Z[2]),g.uv=m(p,k,I,P,l,u,h)}g.face=B,g.faceIndex=j,f.push(g)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Vt=0;function Ht(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function zt(e,t){var n=Ht(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function qt(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Gt(e){return""!==e}function Wt(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Jt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zt(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,(function(e,t){var n=ye[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zt(n)}))}function Xt(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,n,r){for(var i="",o=parseInt(t);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]");return i}))}function Yt(e,t,n,r,i,o){var a=e.context,s=r.defines,c=i.vertexShader,l=i.fragmentShader,u="SHADOWMAP_TYPE_BASIC";1===o.shadowMapType?u="SHADOWMAP_TYPE_PCF":2===o.shadowMapType&&(u="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(r.envMap.mapping){case 301:case 302:h="ENVMAP_TYPE_CUBE";break;case 306:case 307:h="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:h="ENVMAP_TYPE_EQUIREC";break;case 305:h="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:d="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:p="ENVMAP_BLENDING_MULTIPLY";break;case 1:p="ENVMAP_BLENDING_MIX";break;case 2:p="ENVMAP_BLENDING_ADD"}}var f,m,g,y,v,b=e.gammaFactor>0?e.gammaFactor:1,_=function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Gt).join("\n")}(r.extensions,o,t),w=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),E=a.createProgram();r.isRawShaderMaterial?((f=[w].filter(Gt).join("\n")).length>0&&(f+="\n"),(m=[_,w].filter(Gt).join("\n")).length>0&&(m+="\n")):(f=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,w,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Gt).join("\n"),m=[_,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,w,o.alphaTest?"#define ALPHATEST "+o.alphaTest:"","#define GAMMA_FACTOR "+b,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+h:"",o.envMap?"#define "+d:"",o.envMap?"#define "+p:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==o.toneMapping?"#define TONE_MAPPING":"",0!==o.toneMapping?ye.tonemapping_pars_fragment:"",0!==o.toneMapping?qt("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.envMapEncoding||o.emissiveMapEncoding?ye.encodings_pars_fragment:"",o.mapEncoding?zt("mapTexelToLinear",o.mapEncoding):"",o.envMapEncoding?zt("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?zt("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(g="linearToOutputTexel",y=o.outputEncoding,v=Ht(y),"vec4 "+g+"( vec4 value ) { return LinearTo"+v[0]+v[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Gt).join("\n")),c=Jt(c=Wt(c=Zt(c),o),o),l=Jt(l=Wt(l=Zt(l),o),o);var A=f+(c=Xt(c)),x=m+(l=Xt(l)),S=Bt(a,a.VERTEX_SHADER,A),T=Bt(a,a.FRAGMENT_SHADER,x);a.attachShader(E,S),a.attachShader(E,T),void 0!==r.index0AttributeName?a.bindAttribLocation(E,0,r.index0AttributeName):!0===o.morphTargets&&a.bindAttribLocation(E,0,"position"),a.linkProgram(E);var M,R,C=a.getProgramInfoLog(E).trim(),k=a.getShaderInfoLog(S).trim(),I=a.getShaderInfoLog(T).trim(),P=!0,O=!0;return!1===a.getProgramParameter(E,a.LINK_STATUS)?(P=!1,console.error("THREE.WebGLProgram: shader error: ",a.getError(),"gl.VALIDATE_STATUS",a.getProgramParameter(E,a.VALIDATE_STATUS),"gl.getProgramInfoLog",C,k,I)):""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==k&&""!==I||(O=!1),O&&(this.diagnostics={runnable:P,material:r,programLog:C,vertexShader:{log:k,prefix:f},fragmentShader:{log:I,prefix:m}}),a.deleteShader(S),a.deleteShader(T),this.getUniforms=function(){return void 0===M&&(M=new de(a,E,e)),M},this.getAttributes=function(){return void 0===R&&(R=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<r;i++){var o=e.getActiveAttrib(t,i).name;n[o]=e.getAttribLocation(t,o)}return n}(a,E)),R},this.destroy=function(){a.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Vt++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=S,this.fragmentShader=T,this}function Qt(e,t,n){var r=[],i={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},o=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function a(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=3e3,3e3===n&&t&&(n=3007),n}this.getParameters=function(t,r,o,s,c,l,u){var h=i[t.type],d=u.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(n.floatVertexTextures)return 1024;var r=n.maxVertexUniforms,i=Math.floor((r-20)/4),o=Math.min(i,t.length);return o<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+o+"."),0):o}(u):0,p=n.precision;null!==t.precision&&(p=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:h,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:a(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:a(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:a(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:a(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&o.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(var a=0;a<o.length;a++)r.push(n[o[a]]);return r.push(t.onBeforeCompile.toString()),r.push(e.gammaOutput),r.join()},this.acquireProgram=function(n,i,o,a){for(var s,c=0,l=r.length;c<l;c++){var u=r[c];if(u.code===a){++(s=u).usedTimes;break}}return void 0===s&&(s=new Yt(e,t,a,n,i,o),r.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Kt(e,t,n,r,i,o,a,s){var c,l="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,u={};function h(e,t){if(e.width>t||e.height>t){var n=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(e.width*n),r.height=Math.floor(e.height*n),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function d(e){return m.isPowerOfTwo(e.width)&&m.isPowerOfTwo(e.height)}function p(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function f(t){return 1003===t||1004===t||1005===t?e.NEAREST:e.LINEAR}function g(t){var n=t.target;n.removeEventListener("dispose",g),function(t){var n=r.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture)}r.remove(t)}(n),n.isVideoTexture&&delete u[n.id],a.textures--}function y(t){var n=t.target;n.removeEventListener("dispose",y),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var o=0;o<6;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}(n),a.textures--}function v(t,f){var y=r.get(t);if(t.isVideoTexture&&function(e){var t=e.id,n=s.frame;u[t]!==n&&(u[t]=n,e.update())}(t),t.version>0&&y.__version!==t.version){var v=t.image;if(void 0===v)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==v.complete)return void function(t,r,s){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",g),t.__webglTexture=e.createTexture(),a.textures++);n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var u=h(r.image,i.maxTextureSize);(function(e){return 1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter})(r)&&!1===d(u)&&(u=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===c&&(c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),c.width=m.floorPowerOfTwo(e.width),c.height=m.floorPowerOfTwo(e.height),c.getContext("2d").drawImage(e,0,0,c.width,c.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+c.width+"x"+c.height,e),c):e}(u));var f=d(u),y=o.convert(r.format),v=o.convert(r.type);b(e.TEXTURE_2D,r,f);var _,w=r.mipmaps;if(r.isDepthTexture){var E=e.DEPTH_COMPONENT;if(1015===r.type){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");E=e.DEPTH_COMPONENT32F}else l&&(E=e.DEPTH_COMPONENT16);1026===r.format&&E===e.DEPTH_COMPONENT&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,v=o.convert(r.type)),1027===r.format&&(E=e.DEPTH_STENCIL,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,v=o.convert(r.type))),n.texImage2D(e.TEXTURE_2D,0,E,u.width,u.height,0,y,v,null)}else if(r.isDataTexture)if(w.length>0&&f){for(var A=0,x=w.length;A<x;A++)_=w[A],n.texImage2D(e.TEXTURE_2D,A,y,_.width,_.height,0,y,v,_.data);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,u.width,u.height,0,y,v,u.data);else if(r.isCompressedTexture)for(A=0,x=w.length;A<x;A++)_=w[A],1023!==r.format&&1022!==r.format?n.getCompressedTextureFormats().indexOf(y)>-1?n.compressedTexImage2D(e.TEXTURE_2D,A,y,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,A,y,_.width,_.height,0,y,v,_.data);else if(w.length>0&&f){for(A=0,x=w.length;A<x;A++)_=w[A],n.texImage2D(e.TEXTURE_2D,A,y,y,v,_);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,y,v,u);p(r,f)&&e.generateMipmap(e.TEXTURE_2D);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(y,t,f);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}n.activeTexture(e.TEXTURE0+f),n.bindTexture(e.TEXTURE_2D,y.__webglTexture)}function b(n,a,s){var c;if(s?(e.texParameteri(n,e.TEXTURE_WRAP_S,o.convert(a.wrapS)),e.texParameteri(n,e.TEXTURE_WRAP_T,o.convert(a.wrapT)),e.texParameteri(n,e.TEXTURE_MAG_FILTER,o.convert(a.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,o.convert(a.minFilter))):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),e.texParameteri(n,e.TEXTURE_MAG_FILTER,f(a.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,f(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),c=t.get("EXT_texture_filter_anisotropic")){if(1015===a.type&&null===t.get("OES_texture_float_linear"))return;if(1016===a.type&&null===t.get("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function _(t,i,a,s){var c=o.convert(i.texture.format),l=o.convert(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,a,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function w(t,n){e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,n.width,n.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t){var n=r.get(t),i=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),v(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=e.createRenderbuffer(),w(n.__webglDepthbuffer[o],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),w(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}this.setTexture2D=v,this.setTextureCube=function(t,s){var c=r.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",g),c.__image__webglTextureCube=e.createTexture(),a.textures++),n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var l=t&&t.isCompressedTexture,u=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=l||u?u?t.image[m].image:t.image[m]:h(t.image[m],i.maxCubemapSize);var y=d(f[0]),v=o.convert(t.format),_=o.convert(t.type);b(e.TEXTURE_CUBE_MAP,t,y);for(m=0;m<6;m++)if(l)for(var w,E=f[m].mipmaps,A=0,x=E.length;A<x;A++)w=E[A],1023!==t.format&&1022!==t.format?n.getCompressedTextureFormats().indexOf(v)>-1?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,A,v,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,A,v,w.width,w.height,0,v,_,w.data);else u?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,f[m].width,f[m].height,0,v,_,f[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,v,_,f[m]);p(t,y)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=r.get(t),o=r.get(t.texture);t.addEventListener("dispose",y),o.__webglTexture=e.createTexture(),a.textures++;var s=!0===t.isWebGLRenderTargetCube,c=d(t);if(s){i.__webglFramebuffer=[];for(var l=0;l<6;l++)i.__webglFramebuffer[l]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),b(e.TEXTURE_CUBE_MAP,t.texture,c);for(l=0;l<6;l++)_(i.__webglFramebuffer[l],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+l);p(t.texture,c)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,o.__webglTexture),b(e.TEXTURE_2D,t.texture,c),_(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),p(t.texture,c)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&E(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(p(i,d(t))){var o=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(i).__webglTexture;n.bindTexture(o,a),e.generateMipmap(o),n.bindTexture(o,null)}}}function $t(){var e={};return{get:function(t){var n=t.uuid,r=e[n];return void 0===r&&(r={},e[n]=r),r},remove:function(t){delete e[t.uuid]},update:function(t,n,r){var i=t.uuid;e[i][n]=r},dispose:function(){e={}}}}function en(e,t,n){var r=new function(){var t=!1,n=new A,r=null,i=new A(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,o,a,s){!0===s&&(t*=a,r*=a,o*=a),n.set(t,r,o,a),!1===i.equals(n)&&(e.clearColor(t,r,o,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},i=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(t){t?F(e.DEPTH_TEST):j(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},o=new function(){var t=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,l=null;return{setTest:function(t){t?F(e.STENCIL_TEST):j(e.STENCIL_TEST)},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&o===a||(e.stencilFunc(t,n,a),r=t,i=n,o=a)},setOp:function(t,n,r){a===t&&s===n&&c===r||(e.stencilOp(t,n,r),a=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,l=null}}},a=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),l=new Uint8Array(a),u={},h=null,d=null,p=null,f=null,m=null,g=null,y=null,v=null,b=null,_=!1,w=null,E=null,x=null,S=null,T=null,M=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,C=0,k=e.getParameter(e.VERSION);-1!==k.indexOf("WebGL")?(C=parseFloat(/^WebGL\ ([0-9])/.exec(k)[1]),R=C>=1):-1!==k.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(k)[1]),R=C>=2);var I=null,P={},O=new A,N=new A;function D(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var a=0;a<r;a++)e.texImage2D(n+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);return o}var L={};function F(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function j(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}function U(t,r,i,o,a,s,c,l){if(0!==t?F(e.BLEND):j(e.BLEND),5!==t){if(t!==p||l!==_)switch(t){case 2:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case 3:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case 4:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}f=null,m=null,g=null,y=null,v=null,b=null}else a=a||r,s=s||i,c=c||o,r===f&&a===y||(e.blendEquationSeparate(n.convert(r),n.convert(a)),f=r,y=a),i===m&&o===g&&s===v&&c===b||(e.blendFuncSeparate(n.convert(i),n.convert(o),n.convert(s),n.convert(c)),m=i,g=o,v=s,b=c);p=t,_=l}function B(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function V(t){0!==t?(F(e.CULL_FACE),t!==E&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):j(e.CULL_FACE),E=t}function H(t,n,r){t?(F(e.POLYGON_OFFSET_FILL),S===n&&T===r||(e.polygonOffset(n,r),S=n,T=r)):j(e.POLYGON_OFFSET_FILL)}function z(t){void 0===t&&(t=e.TEXTURE0+M-1),I!==t&&(e.activeTexture(t),I=t)}return L[e.TEXTURE_2D]=D(e.TEXTURE_2D,e.TEXTURE_2D,1),L[e.TEXTURE_CUBE_MAP]=D(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),i.setClear(1),o.setClear(0),F(e.DEPTH_TEST),i.setFunc(3),B(!1),V(1),F(e.CULL_FACE),F(e.BLEND),U(1),{buffers:{color:r,depth:i,stencil:o},initAttributes:function(){for(var e=0,t=s.length;e<t;e++)s[e]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),0!==l[n]&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),l[n]=0)},enableAttributeAndDivisor:function(n,r){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),l[n]!==r&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,r),l[n]=r)},disableUnusedAttributes:function(){for(var t=0,n=c.length;t!==n;++t)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:F,disable:j,getCompressedTextureFormats:function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var n=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<n.length;r++)h.push(n[r]);return h},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:U,setMaterial:function(t,n){2===t.side?j(e.CULL_FACE):F(e.CULL_FACE);var o=1===t.side;n&&(o=!o),B(o),!0===t.transparent?U(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):U(0),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite),H(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:B,setCullFace:V,setLineWidth:function(t){t!==x&&(R&&e.lineWidth(t),x=t)},setPolygonOffset:H,setScissorTest:function(t){t?F(e.SCISSOR_TEST):j(e.SCISSOR_TEST)},activeTexture:z,bindTexture:function(t,n){null===I&&z();var r=P[I];void 0===r&&(r={type:void 0,texture:void 0},P[I]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||L[t]),r.type=t,r.texture=n)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===O.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),O.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);u={},h=null,I=null,P={},d=null,p=null,w=null,E=null,r.reset(),i.reset(),o.reset()}}}function tn(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=void 0!==n.precision?n.precision:"highp",a=i(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);var s=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),p=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,y=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function nn(e,t,n,r){We.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function rn(e){nn.call(this),this.cameras=e||[]}function on(e){var t=this,n=null,r=null,i=null,o=new y,a=new y;"undefined"!=typeof window&&"VRFrameData"in window&&(r=new window.VRFrameData);var s=new y,c=new v,l=new b,u=new nn;u.bounds=new A(0,0,.5,1),u.layers.enable(1);var h=new nn;h.bounds=new A(.5,0,.5,1),h.layers.enable(2);var d,p,f=new rn([u,h]);function m(){if(null!==n&&n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,o=r.renderHeight;p=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*i,o,1)}else t.enabled&&e.setDrawingBufferSize(d.width,d.height,p)}f.layers.enable(1),f.layers.enable(2),"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",m,!1),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e)},this.setPoseTarget=function(e){void 0!==e&&(i=e)},this.getCamera=function(e){if(null===n)return e;n.depthNear=e.near,n.depthFar=e.far,n.getFrameData(r);var d=n.stageParameters;d?o.fromArray(d.sittingToStandingTransform):o.makeTranslation(0,t.userHeight,0);var p=r.pose,m=null!==i?i:e;if(m.matrix.copy(o),m.matrix.decompose(m.position,m.quaternion,m.scale),null!==p.orientation&&(c.fromArray(p.orientation),m.quaternion.multiply(c)),null!==p.position&&(c.setFromRotationMatrix(o),l.fromArray(p.position),l.applyQuaternion(c),m.position.add(l)),m.updateMatrixWorld(),!1===n.isPresenting)return e;u.near=e.near,h.near=e.near,u.far=e.far,h.far=e.far,f.matrixWorld.copy(e.matrixWorld),f.matrixWorldInverse.copy(e.matrixWorldInverse),u.matrixWorldInverse.fromArray(r.leftViewMatrix),h.matrixWorldInverse.fromArray(r.rightViewMatrix),a.getInverse(o),u.matrixWorldInverse.multiply(a),h.matrixWorldInverse.multiply(a);var g=m.parent;null!==g&&(s.getInverse(g.matrixWorld),u.matrixWorldInverse.multiply(s),h.matrixWorldInverse.multiply(s)),u.matrixWorld.getInverse(u.matrixWorldInverse),h.matrixWorld.getInverse(h.matrixWorldInverse),u.projectionMatrix.fromArray(r.leftProjectionMatrix),h.projectionMatrix.fromArray(r.rightProjectionMatrix),f.projectionMatrix.copy(u.projectionMatrix);var y=n.getLayers();if(y.length){var v=y[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&h.bounds.fromArray(v.rightBounds)}return f},this.getStandingMatrix=function(){return o},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function an(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function sn(){var e=this,t=null,n=0,r=!1,i=!1,o=new Ne,a=new _,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var u=r+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var d=0,p=r;d!==c;++d,p+=4)o.copy(t[d]).applyMatrix4(h,a),o.normal.toArray(l,p),l[p+3]=o.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,o){var a=0!==e.length||i||0!==n||r;return r=i,t=l(e,o,0),n=e.length,a},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,o,a,u,h,d){if(!r||null===e||0===e.length||i&&!a)i?l(null):c();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=l(e,u,f,d);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}}}function cn(e,t){return{convert:function(n){var r;if(1e3===n)return e.REPEAT;if(1001===n)return e.CLAMP_TO_EDGE;if(1002===n)return e.MIRRORED_REPEAT;if(1003===n)return e.NEAREST;if(1004===n)return e.NEAREST_MIPMAP_NEAREST;if(1005===n)return e.NEAREST_MIPMAP_LINEAR;if(1006===n)return e.LINEAR;if(1007===n)return e.LINEAR_MIPMAP_NEAREST;if(1008===n)return e.LINEAR_MIPMAP_LINEAR;if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(1019===n)return e.UNSIGNED_SHORT_5_6_5;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n&&null!==(r=t.get("OES_texture_half_float")))return r.HALF_FLOAT_OES;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(100===n)return e.FUNC_ADD;if(101===n)return e.FUNC_SUBTRACT;if(102===n)return e.FUNC_REVERSE_SUBTRACT;if(200===n)return e.ZERO;if(201===n)return e.ONE;if(202===n)return e.SRC_COLOR;if(203===n)return e.ONE_MINUS_SRC_COLOR;if(204===n)return e.SRC_ALPHA;if(205===n)return e.ONE_MINUS_SRC_ALPHA;if(206===n)return e.DST_ALPHA;if(207===n)return e.ONE_MINUS_DST_ALPHA;if(208===n)return e.DST_COLOR;if(209===n)return e.ONE_MINUS_DST_COLOR;if(210===n)return e.SRC_ALPHA_SATURATE;if((33776===n||33777===n||33778===n||33779===n)&&null!==(r=t.get("WEBGL_compressed_texture_s3tc"))){if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===n||35841===n||35842===n||35843===n)&&null!==(r=t.get("WEBGL_compressed_texture_pvrtc"))){if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n&&null!==(r=t.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n)&&null!==(r=t.get("WEBGL_compressed_texture_astc")))return n;if((103===n||104===n)&&null!==(r=t.get("EXT_blend_minmax"))){if(103===n)return r.MIN_EXT;if(104===n)return r.MAX_EXT}return 1020===n&&null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:0}}}function ln(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new b,color:new fe,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"SpotLight":n={position:new b,direction:new b,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"PointLight":n={position:new b,color:new fe,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new b,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":n={color:new fe,position:new b,halfWidth:new b,halfHeight:new b}}return e[t.id]=n,n}}}nn.prototype=Object.assign(Object.create(We.prototype),{constructor:nn,isPerspectiveCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*m.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*m.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*m.RAD2DEG*Math.atan(Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far)},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),rn.prototype=Object.assign(Object.create(nn.prototype),{constructor:rn,isArrayCamera:!0});var un,hn,dn,pn,fn,mn,gn,yn,vn=0;function bn(){var e=new ln,t={id:vn++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new b,r=new y,i=new y;return{setup:function(o,a,s){for(var c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,y=0,v=o.length;y<v;y++){var b=o[y],_=b.color,w=b.intensity,E=b.distance,A=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=_.r*w,l+=_.g*w,u+=_.b*w;else if(b.isDirectionalLight){if((S=e.get(b)).color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=b.castShadow,b.castShadow){var x=b.shadow;S.shadowBias=x.bias,S.shadowRadius=x.radius,S.shadowMapSize=x.mapSize}t.directionalShadowMap[h]=A,t.directionalShadowMatrix[h]=b.shadow.matrix,t.directional[h]=S,h++}else if(b.isSpotLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(_).multiplyScalar(w),S.distance=E,S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){x=b.shadow;S.shadowBias=x.bias,S.shadowRadius=x.radius,S.shadowMapSize=x.mapSize}t.spotShadowMap[p]=A,t.spotShadowMatrix[p]=b.shadow.matrix,t.spot[p]=S,p++}else if(b.isRectAreaLight){(S=e.get(b)).color.copy(_).multiplyScalar(w),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),i.identity(),r.copy(b.matrixWorld),r.premultiply(g),i.extractRotation(r),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(i),S.halfHeight.applyMatrix4(i),t.rectArea[f]=S,f++}else if(b.isPointLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){x=b.shadow;S.shadowBias=x.bias,S.shadowRadius=x.radius,S.shadowMapSize=x.mapSize,S.shadowCameraNear=x.camera.near,S.shadowCameraFar=x.camera.far}t.pointShadowMap[d]=A,t.pointShadowMatrix[d]=b.shadow.matrix,t.point[d]=S,d++}else if(b.isHemisphereLight){var S;(S=e.get(b)).direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(w),S.groundColor.copy(b.groundColor).multiplyScalar(w),t.hemi[m]=S,m++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=u,t.directional.length=h,t.spot.length=p,t.rectArea.length=f,t.point.length=d,t.hemi.length=m,t.hash=t.id+","+h+","+d+","+p+","+f+","+m+","+a.length},state:t}}function _n(){var e=new bn,t=[],n=[],r=[];return{init:function(){t.length=0,n.length=0,r.length=0},state:{lightsArray:t,shadowsArray:n,spritesArray:r,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)},pushSprite:function(e){r.push(e)}}}function wn(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new _n,e[r]=i),i},dispose:function(){e={}}}}function En(e){console.log("THREE.WebGLRenderer","90");var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",u=null,h=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,g,v,_,w,E,x,S,M,R,C,k,I,P,O,N,D=this,L=!1,F=null,j=null,U=-1,B="",V=null,H=null,z=new A,q=new A,G=null,W=0,J=t.width,Z=t.height,X=1,Y=new A(0,0,J,Z),Q=new A(0,0,J,Z),K=!1,$=new De,ee=new sn,te=!1,ne=!1,re=new y,ie=new b,oe={geometries:0,textures:0},ae={frame:0,calls:0,vertices:0,faces:0,points:0};function se(){return null===F?X:1}this.info={render:ae,memory:oe,programs:null,autoReset:!0,reset:function(){ae.frame++,ae.calls=0,ae.vertices=0,ae.faces=0,ae.points=0}};try{var ce={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",fe,!1),null===(d=n||t.getContext("webgl",ce)||t.getContext("experimental-webgl",ce)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){console.error("THREE.WebGLRenderer: "+e.message)}function le(){(p=new an(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),N=new cn(d,p),f=new tn(d,p,e),(g=new en(d,p,N)).scissor(q.copy(Q).multiplyScalar(X)),g.viewport(z.copy(Y).multiplyScalar(X)),v=new $t,_=new Kt(d,p,g,v,f,N,oe,ae),w=new Fe(d),E=new jt(d,w,oe),x=new Ut(E,ae),k=new Dt(d),S=new Qt(D,p,f),M=new Ot,R=new wn,C=new Ct(D,g,E,s),I=new Ft(d,p,ae),P=new Lt(d,p,ae),O=new _e(D,d,g,_,f),D.info.programs=S.programs,D.context=d,D.capabilities=f,D.extensions=p,D.properties=v,D.renderLists=M,D.state=g}le();var ue=new on(D);this.vr=ue;var he=new Le(D,x,f.maxTextureSize);function pe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),L=!0}function fe(){console.log("THREE.WebGLRenderer: Context Restored."),L=!1,le()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){be(e),v.remove(e)}(t)}function be(e){var t=v.get(e).program;e.program=void 0,void 0!==t&&S.releaseProgram(t)}this.shadowMap=he,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=p.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=p.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(e){void 0!==e&&(X=e,this.setSize(J,Z,!1))},this.getSize=function(){return{width:J,height:Z}},this.setSize=function(e,n,r){var i=ue.getDevice();i&&i.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Z=n,t.width=e*X,t.height=n*X,!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(){return{width:J*X,height:Z*X}},this.setDrawingBufferSize=function(e,n,r){J=e,Z=n,X=r,t.width=e*r,t.height=n*r,this.setViewport(0,0,e,n)},this.getCurrentViewport=function(){return z},this.setViewport=function(e,t,n,r){Y.set(e,Z-t-r,n,r),g.viewport(z.copy(Y).multiplyScalar(X))},this.setScissor=function(e,t,n,r){Q.set(e,Z-t-r,n,r),g.scissor(q.copy(Q).multiplyScalar(X))},this.setScissorTest=function(e){g.setScissorTest(K=e)},this.getClearColor=function(){return C.getClearColor()},this.setClearColor=function(){C.setClearColor.apply(C,arguments)},this.getClearAlpha=function(){return C.getClearAlpha()},this.setClearAlpha=function(){C.setClearAlpha.apply(C,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(r|=d.STENCIL_BUFFER_BIT),d.clear(r)},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.clearTarget=function(e,t,n,r){this.setRenderTarget(e),this.clear(t,n,r)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",fe,!1),M.dispose(),R.dispose(),v.dispose(),x.dispose(),ue.dispose(),xe()},this.renderBufferImmediate=function(e,t,n){g.initAttributes();var r=v.get(e);e.hasPositions&&!r.position&&(r.position=d.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=d.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=d.createBuffer()),e.hasColors&&!r.color&&(r.color=d.createBuffer());var i=t.getAttributes();if(e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,r.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(i.position),d.vertexAttribPointer(i.position,3,d.FLOAT,!1,0,0)),e.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,r.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&!0===n.flatShading)for(var o=0,a=3*e.count;o<a;o+=9){var s=e.normalArray,c=(s[o+0]+s[o+3]+s[o+6])/3,l=(s[o+1]+s[o+4]+s[o+7])/3,u=(s[o+2]+s[o+5]+s[o+8])/3;s[o+0]=c,s[o+1]=l,s[o+2]=u,s[o+3]=c,s[o+4]=l,s[o+5]=u,s[o+6]=c,s[o+7]=l,s[o+8]=u}d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(i.normal),d.vertexAttribPointer(i.normal,3,d.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(d.bindBuffer(d.ARRAY_BUFFER,r.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(i.uv),d.vertexAttribPointer(i.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&0!==n.vertexColors&&(d.bindBuffer(d.ARRAY_BUFFER,r.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(i.color),d.vertexAttribPointer(i.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,o){var a=i.isMesh&&i.matrixWorld.determinant()<0;g.setMaterial(r,a);var s=ke(e,t,r,i),c=n.id+"_"+s.id+"_"+(!0===r.wireframe),l=!1;c!==B&&(B=c,l=!0),i.morphTargetInfluences&&(k.update(i,n,r,s),l=!0);var u,h=n.index,f=n.attributes.position,m=1;!0===r.wireframe&&(h=E.getWireframeAttribute(n),m=2);var y=I;null!==h&&(u=w.get(h),(y=P).setIndex(u)),l&&(!function(e,t,n,r){if(n&&n.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0);g.initAttributes();var i=n.attributes,o=t.getAttributes(),a=e.defaultAttributeValues;for(var s in o){var c=o[s];if(c>=0){var l=i[s];if(void 0!==l){var u=l.normalized,h=l.itemSize,f=w.get(l);if(void 0===f)continue;var m=f.buffer,y=f.type,v=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,_=b.stride,E=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,_*v,(r*_+E)*v)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,0,r*h*v)}else if(void 0!==a){var A=a[s];if(void 0!==A)switch(A.length){case 2:d.vertexAttrib2fv(c,A);break;case 3:d.vertexAttrib3fv(c,A);break;case 4:d.vertexAttrib4fv(c,A);break;default:d.vertexAttrib1fv(c,A)}}}}g.disableUnusedAttributes()}(r,s,n),null!==h&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.buffer));var v=1/0;null!==h?v=h.count:void 0!==f&&(v=f.count);var b=n.drawRange.start*m,_=n.drawRange.count*m,A=null!==o?o.start*m:0,x=null!==o?o.count*m:1/0,S=Math.max(b,A),T=Math.min(v,b+_,A+x)-1,M=Math.max(0,T-S+1);if(0!==M){if(i.isMesh)if(!0===r.wireframe)g.setLineWidth(r.wireframeLinewidth*se()),y.setMode(d.LINES);else switch(i.drawMode){case 0:y.setMode(d.TRIANGLES);break;case 1:y.setMode(d.TRIANGLE_STRIP);break;case 2:y.setMode(d.TRIANGLE_FAN)}else if(i.isLine){var R=r.linewidth;void 0===R&&(R=1),g.setLineWidth(R*se()),i.isLineSegments?y.setMode(d.LINES):i.isLineLoop?y.setMode(d.LINE_LOOP):y.setMode(d.LINE_STRIP)}else i.isPoints&&y.setMode(d.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&y.renderInstances(n,S,M):y.render(S,M)}},this.compile=function(e,t){(h=R.get(e,t)).init(),e.traverse((function(e){e.isLight&&(h.pushLight(e),e.castShadow&&h.pushShadow(e))})),h.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)Ce(t.material[n],e.fog,t);else Ce(t.material,e.fog,t)}))};var we,Ee=!1,Ae=null;function xe(){Ee=!1}function Se(){var e=ue.getDevice();e&&e.isPresenting?e.requestAnimationFrame(Te):window.requestAnimationFrame(Te)}function Te(e){!1!==Ee&&(Ae(e),Se())}function Me(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i],s=a.object,c=a.geometry,l=void 0===r?a.material:r,u=a.group;if(n.isArrayCamera){H=n;for(var h=n.cameras,d=0,p=h.length;d<p;d++){var f=h[d];if(s.layers.test(f.layers)){var m=f.bounds,y=m.x*J,v=m.y*Z,b=m.z*J,_=m.w*Z;g.viewport(z.set(y,v,b,_).multiplyScalar(X)),Re(s,t,f,c,l,u)}}}else H=null,Re(s,t,n,c,l,u)}}function Re(e,t,n,r,i,o){if(e.onBeforeRender(D,t,n,r,i,o),h=R.get(t,H||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var a=e.isMesh&&e.matrixWorld.determinant()<0;g.setMaterial(i,a);var s=ke(n,t.fog,i,e);B="",function(e,t,n){e.render((function(e){D.renderBufferImmediate(e,t,n)}))}(e,s,i)}else D.renderBufferDirect(n,t.fog,r,i,e,o);e.onAfterRender(D,t,n,r,i,o),h=R.get(t,H||n)}function Ce(e,t,n){var r=v.get(e),i=h.state.lights,o=h.state.shadowsArray,a=S.getParameters(e,i.state,o,t,ee.numPlanes,ee.numIntersection,n),s=S.getProgramCode(e,a),c=r.program,l=!0;if(void 0===c)e.addEventListener("dispose",ye);else if(c.code!==s)be(e);else if(r.lightsHash!==i.state.hash)v.update(e,"lightsHash",i.state.hash),l=!1;else{if(void 0!==a.shaderID)return;l=!1}if(l){if(a.shaderID){var u=ve[a.shaderID];r.shader={name:e.type,uniforms:ge.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader),c=S.acquireProgram(e,r.shader,a,s),r.program=c,e.program=c}var d=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<D.maxMorphTargets;p++)d["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(p=0;p<D.maxMorphNormals;p++)d["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var f=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ee.numPlanes,r.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),r.fog=t,r.lightsHash=i.state.hash,e.lights&&(f.ambientLightColor.value=i.state.ambient,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=de.seqWithValue(m.seq,f);r.uniformsList=g}function ke(e,t,n,r){W=0;var i=v.get(n),o=h.state.lights;if(te&&(ne||e!==V)){var a=e===V&&n.id===U;ee.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,i,a)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==t||n.lights&&i.lightsHash!==o.state.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===ee.numPlanes&&i.numIntersection===ee.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(Ce(n,t,r),n.needsUpdate=!1);var s,c,l=!1,u=!1,p=!1,y=i.program,b=y.getUniforms(),_=i.shader.uniforms;if(g.useProgram(y.program)&&(l=!0,u=!0,p=!0),n.id!==U&&(U=n.id,u=!0),l||e!==V){if(b.setValue(d,"projectionMatrix",e.projectionMatrix),f.logarithmicDepthBuffer&&b.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),V!==(H||e)&&(V=H||e,u=!0,p=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var w=b.map.cameraPosition;void 0!==w&&w.setValue(d,ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&b.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){b.setOptional(d,r,"bindMatrix"),b.setOptional(d,r,"bindMatrixInverse");var E=r.skeleton;if(E){var A=E.bones;if(f.floatVertexTextures){if(void 0===E.boneTexture){var x=Math.sqrt(4*A.length);x=m.ceilPowerOfTwo(x),x=Math.max(x,4);var S=new Float32Array(x*x*4);S.set(E.boneMatrices);var M=new T(S,x,x,1023,1015);M.needsUpdate=!0,E.boneMatrices=S,E.boneTexture=M,E.boneTextureSize=x}b.setValue(d,"boneTexture",E.boneTexture),b.setValue(d,"boneTextureSize",E.boneTextureSize)}else b.setOptional(d,E,"boneMatrices")}}return u&&(b.setValue(d,"toneMappingExposure",D.toneMappingExposure),b.setValue(d,"toneMappingWhitePoint",D.toneMappingWhitePoint),n.lights&&(c=p,(s=_).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&n.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(_,t),n.isMeshBasicMaterial?Ie(_,n):n.isMeshLambertMaterial?(Ie(_,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(_,n)):n.isMeshPhongMaterial?(Ie(_,n),n.isMeshToonMaterial?function(e,t){Pe(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(_,n):Pe(_,n)):n.isMeshStandardMaterial?(Ie(_,n),n.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,Oe(e,t)}(_,n):Oe(_,n)):n.isMeshDepthMaterial?(Ie(_,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isMeshDistanceMaterial?(Ie(_,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(_,n)):n.isMeshNormalMaterial?(Ie(_,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(_,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(_,n)):n.isPointsMaterial?function(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*X,e.scale.value=.5*Z,e.map.value=t.map,null!==t.map){if(!0===t.map.matrixAutoUpdate){var n=t.map.offset,r=t.map.repeat,i=t.map.rotation,o=t.map.center;t.map.matrix.setUvTransform(n.x,n.y,r.x,r.y,i,o.x,o.y)}e.uvTransform.value.copy(t.map.matrix)}}(_,n):n.isShadowMaterial&&(_.color.value=n.color,_.opacity.value=n.opacity),void 0!==_.ltc_1&&(_.ltc_1.value=me.LTC_1),void 0!==_.ltc_2&&(_.ltc_2.value=me.LTC_2),de.upload(d,i.uniformsList,_,D)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(de.upload(d,i.uniformsList,_,D),n.uniformsNeedUpdate=!1),b.setValue(d,"modelViewMatrix",r.modelViewMatrix),b.setValue(d,"normalMatrix",r.normalMatrix),b.setValue(d,"modelMatrix",r.matrixWorld),y}function Ie(e,t){var n;if(e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n){if(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate){var r=n.offset,i=n.repeat,o=n.rotation,a=n.center;n.matrix.setUvTransform(r.x,r.y,i.x,i.y,o,a.x,a.y)}e.uvTransform.value.copy(n.matrix)}}function Pe(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Oe(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}this.animate=function(e){null!==(Ae=e)?Ee||(Se(),Ee=!0):xe()},this.render=function(e,t,n,r){if(t&&t.isCamera){if(!L){B="",U=-1,V=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ue.enabled&&(t=ue.getCamera(t)),(h=R.get(e,t)).init(),e.onBeforeRender(D,e,t,n),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromMatrix(re),ne=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ne,t),(u=M.get(e,t)).init(),function e(t,n,r){if(!1===t.visible)return;if(t.layers.test(n.layers))if(t.isLight)h.pushLight(t),t.castShadow&&h.pushShadow(t);else if(t.isSprite)t.frustumCulled&&!$.intersectsSprite(t)||h.pushSprite(t);else if(t.isImmediateRenderObject)r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re),u.push(t,null,t.material,ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||$.intersectsObject(t))){r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var i=x.update(t),o=t.material;if(Array.isArray(o))for(var a=i.groups,s=0,c=a.length;s<c;s++){var l=a[s],d=o[l.materialIndex];d&&d.visible&&u.push(t,i,d,ie.z,l)}else o.visible&&u.push(t,i,o,ie.z,null)}var p=t.children;for(s=0,c=p.length;s<c;s++)e(p[s],n,r)}(e,t,D.sortObjects),!0===D.sortObjects&&u.sort(),te&&ee.beginShadows();var i=h.state.shadowsArray;he.render(i,e,t),h.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),C.render(u,e,t,r);var o=u.opaque,a=u.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;o.length&&Me(o,e,t,s),a.length&&Me(a,e,t,s)}else o.length&&Me(o,e,t),a.length&&Me(a,e,t);var c=h.state.spritesArray;O.render(c,e,t),n&&_.updateRenderTargetMipmap(n),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),e.onAfterRender(D,e,t),ue.enabled&&ue.submitFrame(),u=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var e=W;return e>=f.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+f.maxTextures),W+=1,e},this.setTexture2D=(we=!1,function(e,t){e&&e.isWebGLRenderTarget&&(we||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),we=!0),e=e.texture),_.setTexture2D(e,t)}),this.setTexture=function(){var e=!1;return function(t,n){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),_.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function(t,n){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?_.setTextureCube(t,n):_.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return F},this.setRenderTarget=function(e){F=e,e&&void 0===v.get(e).__webglFramebuffer&&_.setupRenderTarget(e);var t=null,n=!1;if(e){var r=v.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=r[e.activeCubeFace],n=!0):t=r,z.copy(e.viewport),q.copy(e.scissor),G=e.scissorTest}else z.copy(Y).multiplyScalar(X),q.copy(Q).multiplyScalar(X),G=K;if(j!==t&&(d.bindFramebuffer(d.FRAMEBUFFER,t),j=t),g.viewport(z),g.scissor(q),g.setScissorTest(G),n){var i=v.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,r,i,o){if(e&&e.isWebGLRenderTarget){var a=v.get(e).__webglFramebuffer;if(a){var s=!1;a!==j&&(d.bindFramebuffer(d.FRAMEBUFFER,a),s=!0);try{var c=e.texture,l=c.format,u=c.type;if(1023!==l&&N.convert(l)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===u||N.convert(u)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||1015===u&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||1016===u&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,N.convert(l),N.convert(u),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,j)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var r=t.image.width,i=t.image.height,o=N.convert(t.format);this.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,n||0,o,e.x,e.y,r,i,0)}}function An(e,t){this.name="",this.color=new fe(e),this.density=void 0!==t?t:25e-5}function xn(e,t,n){this.name="",this.color=new fe(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Sn(){Ge.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Tn(e){Ce.call(this),this.type="SpriteMaterial",this.color=new fe(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Mn(e){Ge.call(this),this.type="Sprite",this.material=void 0!==e?e:new Tn,this.center=new g(.5,.5)}function Rn(){Ge.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Cn(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new y)}}function kn(){Ge.call(this),this.type="Bone"}function In(e,t){Rt.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new y,this.bindMatrixInverse=new y;var n=new Cn(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Pn(e){Ce.call(this),this.type="LineBasicMaterial",this.color=new fe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function On(e,t,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Nn(e,t);Ge.call(this),this.type="Line",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Pn({color:16777215*Math.random()})}function Nn(e,t){On.call(this,e,t),this.type="LineSegments"}function Dn(e,t){On.call(this,e,t),this.type="LineLoop"}function Ln(e){Ce.call(this),this.type="PointsMaterial",this.color=new fe(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Fn(e,t){Ge.call(this),this.type="Points",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Ln({color:16777215*Math.random()})}function jn(){Ge.call(this),this.type="Group"}function Un(e,t,n,r,i,o,a,s,c){E.call(this,e,t,n,r,i,o,a,s,c),this.generateMipmaps=!1}function Bn(e,t,n,r,i,o,a,s,c,l,u,h){E.call(this,null,o,a,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Vn(e,t,n,r,i,o,a,s,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===l&&(n=1012),void 0===n&&1027===l&&(n=1020),E.call(this,null,r,i,o,a,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function Hn(e){vt.call(this),this.type="WireframeGeometry";var t,n,r,i,o,a,s,c,l,u,h=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]})}for(l in p)a=p[l],u=e.vertices[a.index1],h.push(u.x,u.y,u.z),u=e.vertices[a.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,v,_,w,E,A,x;if(u=new b,null!==e.index){for(y=e.attributes.position,v=e.index,0===(_=e.groups).length&&(_=[{start:0,count:v.count,materialIndex:0}]),i=0,o=_.length;i<o;++i)for(t=E=(w=_[i]).start,r=E+w.count;t<r;t+=3)for(n=0;n<3;n++)s=v.getX(t+n),c=v.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]});for(l in p)a=p[l],u.fromBufferAttribute(y,a.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(y,a.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(y=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)A=3*t+n,u.fromBufferAttribute(y,A),h.push(u.x,u.y,u.z),x=3*t+(n+1)%3,u.fromBufferAttribute(y,x),h.push(u.x,u.y,u.z)}this.addAttribute("position",new at(h,3))}function zn(e,t,n){Qe.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new qn(e,t,n)),this.mergeVertices()}function qn(e,t,n){vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,o=[],a=[],s=[],c=[],l=1e-5,u=new b,h=new b,d=new b,p=new b,f=new b,m=t+1;for(r=0;r<=n;r++){var g=r/n;for(i=0;i<=t;i++){var y=i/t;h=e(y,g,h),a.push(h.x,h.y,h.z),y-l>=0?(d=e(y-l,g,d),p.subVectors(h,d)):(d=e(y+l,g,d),p.subVectors(d,h)),g-l>=0?(d=e(y,g-l,d),f.subVectors(h,d)):(d=e(y,g+l,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),s.push(u.x,u.y,u.z),c.push(y,g)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*m+i,_=r*m+i+1,w=(r+1)*m+i+1,E=(r+1)*m+i;o.push(v,_,E),o.push(_,w,E)}this.setIndex(o),this.addAttribute("position",new at(a,3)),this.addAttribute("normal",new at(s,3)),this.addAttribute("uv",new at(c,2))}function Gn(e,t,n,r){Qe.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Wn(e,t,n,r)),this.mergeVertices()}function Wn(e,t,n,r){vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],o=[];function a(e,t,n,r){var i,o,a=Math.pow(2,r),c=[];for(i=0;i<=a;i++){c[i]=[];var l=e.clone().lerp(n,i/a),u=t.clone().lerp(n,i/a),h=a-i;for(o=0;o<=h;o++)c[i][o]=0===o&&i===a?l:l.clone().lerp(u,o/h)}for(i=0;i<a;i++)for(o=0;o<2*(a-i)-1;o++){var d=Math.floor(o/2);o%2==0?(s(c[i][d+1]),s(c[i+1][d]),s(c[i][d])):(s(c[i][d+1]),s(c[i+1][d+1]),s(c[i+1][d]))}}function s(e){i.push(e.x,e.y,e.z)}function c(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var n=new b,r=new b,i=new b,o=0;o<t.length;o+=3)c(t[o+0],n),c(t[o+1],r),c(t[o+2],i),a(n,r,i,e)}(r=r||0),function(e){for(var t=new b,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new b,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=h(e)/Math.PI+.5;o.push(n,1-r)}(function(){for(var e=new b,t=new b,n=new b,r=new b,a=new g,s=new g,c=new g,h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),a.set(o[d+0],o[d+1]),s.set(o[d+2],o[d+3]),c.set(o[d+4],o[d+5]),r.copy(e).add(t).add(n).divideScalar(3);var p=u(r);l(a,d+0,e,p),l(s,d+2,t,p),l(c,d+4,n,p)}})(),function(){for(var e=0;e<o.length;e+=6){var t=o[e+0],n=o[e+2],r=o[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),r<.2&&(o[e+4]+=1))}}()}(),this.addAttribute("position",new at(i,3)),this.addAttribute("normal",new at(i.slice(),3)),this.addAttribute("uv",new at(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Jn(e,t){Qe.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Zn(e,t)),this.mergeVertices()}function Zn(e,t){Wn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Xn(e,t){Qe.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Yn(e,t)),this.mergeVertices()}function Yn(e,t){Wn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Qn(e,t){Qe.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Kn(e,t)),this.mergeVertices()}function Kn(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Wn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function $n(e,t){Qe.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];Wn.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function tr(e,t,n,r,i,o){Qe.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new nr(e,t,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function nr(e,t,n,r,i){vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new b,l=new b,u=new g,h=new b,d=[],p=[],f=[],m=[];function y(i){h=e.getPointAt(i/t,h);var a=o.normals[i],u=o.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*a.x+m*u.x,l.y=g*a.y+m*u.y,l.z=g*a.z+m*u.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(a=0;a<t;a++)y(a);y(!1===i?t:0),function(){for(a=0;a<=t;a++)for(s=0;s<=r;s++)u.x=a/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(a=1;a<=r;a++){var e=(r+1)*(s-1)+(a-1),n=(r+1)*s+(a-1),i=(r+1)*s+a,o=(r+1)*(s-1)+a;m.push(e,n,o),m.push(n,i,o)}}()}(),this.setIndex(m),this.addAttribute("position",new at(d,3)),this.addAttribute("normal",new at(p,3)),this.addAttribute("uv",new at(f,2))}function rr(e,t,n,r,i,o,a){Qe.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ir(e,t,n,r,i,o)),this.mergeVertices()}function ir(e,t,n,r,i,o){vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,o=o||3;var a,s,c=[],l=[],u=[],h=[],d=new b,p=new b,f=new b,m=new b,g=new b,y=new b,v=new b;for(a=0;a<=n;++a){var _=a/n*i*Math.PI*2;for(R(_,i,o,e,f),R(_+.01,i,o,e,m),y.subVectors(m,f),v.addVectors(m,f),g.crossVectors(y,v),v.crossVectors(g,y),g.normalize(),v.normalize(),s=0;s<=r;++s){var w=s/r*Math.PI*2,E=-t*Math.cos(w),A=t*Math.sin(w);d.x=f.x+(E*v.x+A*g.x),d.y=f.y+(E*v.y+A*g.y),d.z=f.z+(E*v.z+A*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(a/n),h.push(s/r)}}for(s=1;s<=n;s++)for(a=1;a<=r;a++){var x=(r+1)*(s-1)+(a-1),S=(r+1)*s+(a-1),T=(r+1)*s+a,M=(r+1)*(s-1)+a;c.push(x,S,M),c.push(S,T,M)}function R(e,t,n,r,i){var o=Math.cos(e),a=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*o,i.y=r*(2+c)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new at(l,3)),this.addAttribute("normal",new at(u,3)),this.addAttribute("uv",new at(h,2))}function or(e,t,n,r,i){Qe.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new ar(e,t,n,r,i)),this.mergeVertices()}function ar(e,t,n,r,i){vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var o,a,s=[],c=[],l=[],u=[],h=new b,d=new b,p=new b;for(o=0;o<=n;o++)for(a=0;a<=r;a++){var f=a/r*i,m=o/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(f),d.y=(e+t*Math.cos(m))*Math.sin(f),d.z=t*Math.sin(m),c.push(d.x,d.y,d.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(a/r),u.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=r;a++){var g=(r+1)*o+a-1,y=(r+1)*(o-1)+a-1,v=(r+1)*(o-1)+a,_=(r+1)*o+a;s.push(g,y,_),s.push(y,v,_)}this.setIndex(s),this.addAttribute("position",new at(c,3)),this.addAttribute("normal",new at(l,3)),this.addAttribute("uv",new at(u,2))}An.prototype.isFogExp2=!0,An.prototype.clone=function(){return new An(this.color.getHex(),this.density)},An.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},xn.prototype.isFog=!0,xn.prototype.clone=function(){return new xn(this.color.getHex(),this.near,this.far)},xn.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Sn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Sn,copy:function(e,t){return Ge.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),Tn.prototype=Object.create(Ce.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isSpriteMaterial=!0,Tn.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},Mn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Mn,isSprite:!0,raycast:(un=new b,hn=new b,dn=new b,function(e,t){hn.setFromMatrixPosition(this.matrixWorld),e.ray.closestPointToPoint(hn,un),dn.setFromMatrixScale(this.matrixWorld);var n=dn.x*dn.y/4;if(!(hn.distanceToSquared(un)>n)){var r=e.ray.origin.distanceTo(un);r<e.near||r>e.far||t.push({distance:r,point:un.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Ge.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),Rn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Rn,copy:function(e){Ge.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);n.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(pn=new b,function(e,t){pn.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(pn);this.getObjectForDistance(n).raycast(e,t)}),update:function(){var e=new b,t=new b;return function(n){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);r[0].object.visible=!0;for(var o=1,a=r.length;o<a&&i>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;o<a;o++)r[o].object.visible=!1}}}(),toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}),Object.assign(Cn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new y;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(fn=new y,mn=new y,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=e.length;i<o;i++){var a=e[i]?e[i].matrixWorld:mn;fn.multiplyMatrices(a,t[i]),fn.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new Cn(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),kn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:kn,isBone:!0}),In.prototype=Object.assign(Object.create(Rt.prototype),{constructor:In,isSkinnedMesh:!0,initBones:function(){var e,t,n,r,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,r=this.geometry.bones.length;n<r;n++)t=this.geometry.bones[n],e=new kn,i.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(n=0,r=this.geometry.bones.length;n<r;n++)-1!==(t=this.geometry.bones[n]).parent&&null!==t.parent&&void 0!==i[t.parent]?i[t.parent].add(i[n]):this.add(i[n])}return this.updateMatrixWorld(!0),i},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var n=this.geometry.skinWeights[t];(e=1/n.manhattanLength())!==1/0?n.multiplyScalar(e):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new A,i=this.geometry.attributes.skinWeight;for(t=0;t<i.count;t++)r.x=i.getX(t),r.y=i.getY(t),r.z=i.getZ(t),r.w=i.getW(t),(e=1/r.manhattanLength())!==1/0?r.multiplyScalar(e):r.set(1,0,0,0),i.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Rt.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Pn.prototype=Object.create(Ce.prototype),Pn.prototype.constructor=Pn,Pn.prototype.isLineBasicMaterial=!0,Pn.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},On.prototype=Object.assign(Object.create(Ge.prototype),{constructor:On,isLine:!0,computeLineDistances:(gn=new b,yn=new b,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)gn.fromBufferAttribute(t,r-1),yn.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=gn.distanceTo(yn);e.addAttribute("lineDistance",new THREE.Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var o=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=o.length;r<i;r++)n[r]=n[r-1],n[r]+=o[r-1].distanceTo(o[r])}return this}),raycast:function(){var e=new y,t=new St,n=new Oe;return function(r,i){var o=r.linePrecision,a=o*o,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var l=new b,u=new b,h=new b,d=new b,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var f=s.index,m=s.attributes.position.array;if(null!==f)for(var g=f.array,y=0,v=g.length-1;y<v;y+=p){var _=g[y],w=g[y+1];if(l.fromArray(m,3*_),u.fromArray(m,3*w),!(t.distanceSqToSegment(l,u,d,h)>a))d.applyMatrix4(this.matrixWorld),(x=r.ray.origin.distanceTo(d))<r.near||x>r.far||i.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,v=m.length/3-1;y<v;y+=p){if(l.fromArray(m,3*y),u.fromArray(m,3*y+3),!(t.distanceSqToSegment(l,u,d,h)>a))d.applyMatrix4(this.matrixWorld),(x=r.ray.origin.distanceTo(d))<r.near||x>r.far||i.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var E=s.vertices,A=E.length;for(y=0;y<A-1;y+=p){var x;if(!(t.distanceSqToSegment(E[y],E[y+1],d,h)>a))d.applyMatrix4(this.matrixWorld),(x=r.ray.origin.distanceTo(d))<r.near||x>r.far||i.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Nn.prototype=Object.assign(Object.create(On.prototype),{constructor:Nn,isLineSegments:!0,computeLineDistances:function(){var e=new b,t=new b;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var r=n.attributes.position,i=[],o=0,a=r.count;o<a;o+=2)e.fromBufferAttribute(r,o),t.fromBufferAttribute(r,o+1),i[o]=0===o?0:i[o-1],i[o+1]=i[o]+e.distanceTo(t);n.addAttribute("lineDistance",new THREE.Float32BufferAttribute(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(i=n.lineDistances,o=0,a=s.length;o<a;o+=2)e.copy(s[o]),t.copy(s[o+1]),i[o]=0===o?0:i[o-1],i[o+1]=i[o]+e.distanceTo(t)}return this}}()}),Dn.prototype=Object.assign(Object.create(On.prototype),{constructor:Dn,isLineLoop:!0}),Ln.prototype=Object.create(Ce.prototype),Ln.prototype.constructor=Ln,Ln.prototype.isPointsMaterial=!0,Ln.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Fn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Fn,isPoints:!0,raycast:function(){var e=new y,t=new St,n=new Oe;return function(r,i){var o=this,a=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){e.getInverse(s),t.copy(r.ray).applyMatrix4(e);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new b;if(a.isBufferGeometry){var d=a.index,p=a.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length;m<g;m++){var y=f[m];h.fromArray(p,3*y),w(h,y)}else{m=0;for(var v=p.length/3;m<v;m++)h.fromArray(p,3*m),w(h,m)}}else{var _=a.vertices;for(m=0,v=_.length;m<v;m++)w(_[m],m)}}function w(e,n){var a=t.distanceSqToPoint(e);if(a<u){var c=t.closestPointToPoint(e);c.applyMatrix4(s);var l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(a),point:c.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),jn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:jn,isGroup:!0}),Un.prototype=Object.assign(Object.create(E.prototype),{constructor:Un,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Bn.prototype=Object.create(E.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isCompressedTexture=!0,Vn.prototype=Object.create(E.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isDepthTexture=!0,Hn.prototype=Object.create(vt.prototype),Hn.prototype.constructor=Hn,zn.prototype=Object.create(Qe.prototype),zn.prototype.constructor=zn,qn.prototype=Object.create(vt.prototype),qn.prototype.constructor=qn,Gn.prototype=Object.create(Qe.prototype),Gn.prototype.constructor=Gn,Wn.prototype=Object.create(vt.prototype),Wn.prototype.constructor=Wn,Jn.prototype=Object.create(Qe.prototype),Jn.prototype.constructor=Jn,Zn.prototype=Object.create(Wn.prototype),Zn.prototype.constructor=Zn,Xn.prototype=Object.create(Qe.prototype),Xn.prototype.constructor=Xn,Yn.prototype=Object.create(Wn.prototype),Yn.prototype.constructor=Yn,Qn.prototype=Object.create(Qe.prototype),Qn.prototype.constructor=Qn,Kn.prototype=Object.create(Wn.prototype),Kn.prototype.constructor=Kn,$n.prototype=Object.create(Qe.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Wn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(Qe.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(vt.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(Qe.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(vt.prototype),ir.prototype.constructor=ir,or.prototype=Object.create(Qe.prototype),or.prototype.constructor=or,ar.prototype=Object.create(vt.prototype),ar.prototype.constructor=ar;var sr=function(e,t,n){n=n||2;var r,i,o,a,s,c,l,u=t&&t.length,h=u?t[0]*n:e.length,d=cr(e,0,h,n,!0),p=[];if(!d)return p;if(u&&(d=function(e,t,n,r){var i,o,a,s,c,l=[];for(i=0,o=t.length;i<o;i++)a=t[i]*r,s=i<o-1?t[i+1]*r:e.length,(c=cr(e,a,s,r,!1))===c.next&&(c.steiner=!0),l.push(vr(c));for(l.sort(mr),i=0;i<l.length;i++)gr(l[i],n),n=lr(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(c=e[f+1])<i&&(i=c),s>o&&(o=s),c>a&&(a=c);l=0!==(l=Math.max(o-r,a-i))?1/l:0}return ur(d,p,n,r,i,l),p};function cr(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}(e,t,n,r)>0)for(o=t;o<n;o+=r)a=Tr(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=Tr(o,e[o],e[o+1],a);return a&&Er(a,a.next)&&(Mr(a),a=a.next),a}function lr(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Er(r,r.next)&&0!==wr(r.prev,r,r.next))r=r.next;else{if(Mr(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function ur(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=yr(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,c,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,o);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,o?dr(e,r,i,o):hr(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Mr(e),e=c.next,l=c.next;else if((e=c)===l){a?1===a?ur(e=pr(e,t,n),t,n,r,i,o,2):2===a&&fr(e,t,n,r,i,o):ur(lr(e),t,n,r,i,o,1);break}}}function hr(e){var t=e.prev,n=e,r=e.next;if(wr(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(br(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&wr(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function dr(e,t,n,r){var i=e.prev,o=e,a=e.next;if(wr(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,c=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=yr(s,c,t,n,r),d=yr(l,u,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&wr(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&wr(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pr(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!Er(i,o)&&Ar(i,r,r.next,o)&&xr(i,o)&&xr(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Mr(r),Mr(r.next),r=e=o),r=r.next}while(r!==e);return r}function fr(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&_r(a,s)){var c=Sr(a,s);return a=lr(a,a.next),c=lr(c,c.next),ur(a,t,n,r,i,o),void ur(c,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function mr(e,t){return e.x-t.x}function gr(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n.prev;var c,l=n,u=n.x,h=n.y,d=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=u&&i!==r.x&&br(o<h?i:a,o,u,h,o<h?a:i,o,r.x,r.y)&&((c=Math.abs(o-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&xr(r,e)&&(n=r,d=c),r=r.next;return n}(e,t)){var n=Sr(t,e);lr(n,n.next)}}function yr(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vr(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function br(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function _r(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ar(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&xr(e,t)&&xr(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function wr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Er(e,t){return e.x===t.x&&e.y===t.y}function Ar(e,t,n,r){return!!(Er(e,t)&&Er(n,r)||Er(e,r)&&Er(n,t))||wr(e,t,n)>0!=wr(e,t,r)>0&&wr(n,r,e)>0!=wr(n,r,t)>0}function xr(e,t){return wr(e.prev,e,e.next)<0?wr(e,t,e.next)>=0&&wr(e,e.prev,t)>=0:wr(e,t,e.prev)<0||wr(e,e.next,t)<0}function Sr(e,t){var n=new Rr(e.i,e.x,e.y),r=new Rr(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Tr(e,t,n,r){var i=new Rr(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Mr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rr(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Cr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return Cr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];kr(e),Ir(n,e);var o=e.length;t.forEach(kr);for(var a=0;a<t.length;a++)r.push(o),o+=t[a].length,Ir(n,t[a]);var s=sr(n,r);for(a=0;a<s.length;a+=3)i.push(s.slice(a,a+3));return i}};function kr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Ir(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Pr(e,t){Qe.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Or(e,t)),this.mergeVertices()}function Or(e,t){void 0!==e&&(vt.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function Nr(e,t){Qe.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Dr(e,t)),this.mergeVertices()}function Dr(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Qe;var r=n.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Or.call(this,r,t),this.type="TextBufferGeometry"}function Lr(e,t,n,r,i,o,a){Qe.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Fr(e,t,n,r,i,o,a)),this.mergeVertices()}function Fr(e,t,n,r,i,o,a){vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,c,l=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),u=0,h=[],d=new b,p=new b,f=[],m=[],g=[],y=[];for(c=0;c<=n;c++){var v=[],_=c/n;for(s=0;s<=t;s++){var w=s/t;d.x=-e*Math.cos(r+w*i)*Math.sin(o+_*a),d.y=e*Math.cos(o+_*a),d.z=e*Math.sin(r+w*i)*Math.sin(o+_*a),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),y.push(w,1-_),v.push(u++)}h.push(v)}for(c=0;c<n;c++)for(s=0;s<t;s++){var E=h[c][s+1],A=h[c][s],x=h[c+1][s],S=h[c+1][s+1];(0!==c||o>0)&&f.push(E,A,S),(c!==n-1||l<Math.PI)&&f.push(A,x,S)}this.setIndex(f),this.addAttribute("position",new at(m,3)),this.addAttribute("normal",new at(g,3)),this.addAttribute("uv",new at(y,2))}function jr(e,t,n,r,i,o){Qe.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new Ur(e,t,n,r,i,o)),this.mergeVertices()}function Ur(e,t,n,r,i,o){vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},e=e||.5,t=t||1,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,c,l=[],u=[],h=[],d=[],p=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new b,y=new g;for(s=0;s<=r;s++){for(c=0;c<=n;c++)a=i+c/n*o,m.x=p*Math.cos(a),m.y=p*Math.sin(a),u.push(m.x,m.y,m.z),h.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,d.push(y.x,y.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var _=a=c+v,w=a+n+1,E=a+n+2,A=a+1;l.push(_,w,A),l.push(w,E,A)}}this.setIndex(l),this.addAttribute("position",new at(u,3)),this.addAttribute("normal",new at(h,3)),this.addAttribute("uv",new at(d,2))}function Br(e,t,n,r){Qe.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Vr(e,t,n,r)),this.mergeVertices()}function Vr(e,t,n,r){vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=m.clamp(r,0,2*Math.PI);var i,o,a,s=[],c=[],l=[],u=1/t,h=new b,d=new g;for(o=0;o<=t;o++){var p=n+o*u*r,f=Math.sin(p),y=Math.cos(p);for(a=0;a<=e.length-1;a++)h.x=e[a].x*f,h.y=e[a].y,h.z=e[a].x*y,c.push(h.x,h.y,h.z),d.x=o/t,d.y=a/(e.length-1),l.push(d.x,d.y)}for(o=0;o<t;o++)for(a=0;a<e.length-1;a++){var v=i=a+o*e.length,_=i+e.length,w=i+e.length+1,E=i+1;s.push(v,_,E),s.push(_,w,E)}if(this.setIndex(s),this.addAttribute("position",new at(c,3)),this.addAttribute("uv",new at(l,2)),this.computeVertexNormals(),r===2*Math.PI){var A=this.attributes.normal.array,x=new b,S=new b,T=new b;for(i=t*e.length*3,o=0,a=0;o<e.length;o++,a+=3)x.x=A[a+0],x.y=A[a+1],x.z=A[a+2],S.x=A[i+a+0],S.y=A[i+a+1],S.z=A[i+a+2],T.addVectors(x,S).normalize(),A[a+0]=A[i+a+0]=T.x,A[a+1]=A[i+a+1]=T.y,A[a+2]=A[i+a+2]=T.z}}function Hr(e,t){Qe.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new zr(e,t)),this.mergeVertices()}function zr(e,t){vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],o=[],a=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(a,s,c),a+=s,s=0;function l(e){var a,c,l,u=r.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;if(!1===Cr.isClockWise(d))for(d=d.reverse(),a=0,c=p.length;a<c;a++)l=p[a],!0===Cr.isClockWise(l)&&(p[a]=l.reverse());var f=Cr.triangulateShape(d,p);for(a=0,c=p.length;a<c;a++)l=p[a],d=d.concat(l);for(a=0,c=d.length;a<c;a++){var m=d[a];r.push(m.x,m.y,0),i.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=f.length;a<c;a++){var g=f[a],y=g[0]+u,v=g[1]+u,b=g[2]+u;n.push(y,v,b),s+=3}}this.setIndex(n),this.addAttribute("position",new at(r,3)),this.addAttribute("normal",new at(i,3)),this.addAttribute("uv",new at(o,2))}function qr(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function Gr(e,t){vt.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,o,a=[],s=Math.cos(m.DEG2RAD*t),c=[0,0],l={},u=["a","b","c"];e.isBufferGeometry?(o=new Qe).fromBufferGeometry(e):o=e.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var g=d[p],y=0;y<3;y++)n=g[u[y]],r=g[u[(y+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===l[i=c[0]+","+c[1]]?l[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:l[i].face2=p;for(i in l){var v=l[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var b=h[v.index1];a.push(b.x,b.y,b.z),b=h[v.index2],a.push(b.x,b.y,b.z)}}this.addAttribute("position",new at(a,3))}function Wr(e,t,n,r,i,o,a,s){Qe.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Jr(e,t,n,r,i,o,a,s)),this.mergeVertices()}function Jr(e,t,n,r,i,o,a,s){vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],d=[],p=0,f=[],m=n/2,y=0;function v(n){var i,o,f,v=new g,_=new b,w=0,E=!0===n?e:t,A=!0===n?1:-1;for(o=p,i=1;i<=r;i++)u.push(0,m*A,0),h.push(0,A,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var x=i/r*s+a,S=Math.cos(x),T=Math.sin(x);_.x=E*T,_.y=m*A,_.z=E*S,u.push(_.x,_.y,_.z),h.push(0,A,0),v.x=.5*S+.5,v.y=.5*T*A+.5,d.push(v.x,v.y),p++}for(i=0;i<r;i++){var M=o+i,R=f+i;!0===n?l.push(R,R+1,M):l.push(R+1,R,M),w+=3}c.addGroup(y,w,!0===n?1:2),y+=w}!function(){var o,g,v=new b,_=new b,w=0,E=(t-e)/n;for(g=0;g<=i;g++){var A=[],x=g/i,S=x*(t-e)+e;for(o=0;o<=r;o++){var T=o/r,M=T*s+a,R=Math.sin(M),C=Math.cos(M);_.x=S*R,_.y=-x*n+m,_.z=S*C,u.push(_.x,_.y,_.z),v.set(R,E,C).normalize(),h.push(v.x,v.y,v.z),d.push(T,1-x),A.push(p++)}f.push(A)}for(o=0;o<r;o++)for(g=0;g<i;g++){var k=f[g][o],I=f[g+1][o],P=f[g+1][o+1],O=f[g][o+1];l.push(k,I,O),l.push(I,P,O),w+=6}c.addGroup(y,w,0),y+=w}(),!1===o&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.addAttribute("position",new at(u,3)),this.addAttribute("normal",new at(h,3)),this.addAttribute("uv",new at(d,2))}function Zr(e,t,n,r,i,o,a){Wr.call(this,0,e,t,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Xr(e,t,n,r,i,o,a){Jr.call(this,0,e,t,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Yr(e,t,n,r){Qe.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Qr(e,t,n,r)),this.mergeVertices()}function Qr(e,t,n,r){vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,o,a=[],s=[],c=[],l=[],u=new b,h=new g;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,i=3;o<=t;o++,i+=3){var d=n+o/t*r;u.x=e*Math.cos(d),u.y=e*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,l.push(h.x,h.y)}for(i=1;i<=t;i++)a.push(i,i+1,0);this.setIndex(a),this.addAttribute("position",new at(s,3)),this.addAttribute("normal",new at(c,3)),this.addAttribute("uv",new at(l,2))}Pr.prototype=Object.create(Qe.prototype),Pr.prototype.constructor=Pr,Or.prototype=Object.create(vt.prototype),Or.prototype.constructor=Or,Or.prototype.getArrays=function(){var e=this.getAttribute("position"),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:t,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},Or.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var r=0;r<n;r++){var i=e[r];this.addShape(i,t)}this.setIndex(t.arrays.index),this.addAttribute("position",new at(t.arrays.position,3)),this.addAttribute("uv",new at(t.arrays.uv,2))},Or.prototype.addShape=function(e,t){var n,r,i,o,a,s,c,l,u=t.arrays?t.arrays:this.getArrays(),h=u.position,d=u.index,p=u.uv,f=[],m=void 0!==t.amount?t.amount:100,y=void 0!==t.bevelThickness?t.bevelThickness:6,v=void 0!==t.bevelSize?t.bevelSize:y-2,_=void 0!==t.bevelSegments?t.bevelSegments:3,w=void 0===t.bevelEnabled||t.bevelEnabled,E=void 0!==t.curveSegments?t.curveSegments:12,A=void 0!==t.steps?t.steps:1,x=t.extrudePath,S=!1,T=void 0!==t.UVGenerator?t.UVGenerator:Pr.WorldUVGenerator;x&&(n=x.getSpacedPoints(A),S=!0,w=!1,r=void 0!==t.frames?t.frames:x.computeFrenetFrames(A,!1),i=new b,o=new b,a=new b),w||(_=0,y=0,v=0);var M=this,R=e.extractPoints(E),C=R.shape,k=R.holes;if(!Cr.isClockWise(C))for(C=C.reverse(),c=0,l=k.length;c<l;c++)s=k[c],Cr.isClockWise(s)&&(k[c]=s.reverse());var I=Cr.triangulateShape(C,k),P=C;for(c=0,l=k.length;c<l;c++)s=k[c],C=C.concat(s);function O(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var N,D,L,F,j,U,B=C.length,V=I.length;function H(e,t,n){var r,i,o,a=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=a*a+s*s,h=a*l-s*c;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=t.x-s/d,m=t.y+a/d,y=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(a*l-s*c),v=(r=f+a*y-e.x)*r+(i=m+s*y-e.y)*i;if(v<=2)return new g(r,i);o=Math.sqrt(v/2)}else{var b=!1;a>Number.EPSILON?c>Number.EPSILON&&(b=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(l)&&(b=!0),b?(r=-s,i=a,o=Math.sqrt(u)):(r=a,i=s,o=Math.sqrt(u/2))}return new g(r/o,i/o)}for(var z=[],q=0,G=P.length,W=G-1,J=q+1;q<G;q++,W++,J++)W===G&&(W=0),J===G&&(J=0),z[q]=H(P[q],P[W],P[J]);var Z,X,Y=[],Q=z.concat();for(c=0,l=k.length;c<l;c++){for(s=k[c],Z=[],q=0,W=(G=s.length)-1,J=q+1;q<G;q++,W++,J++)W===G&&(W=0),J===G&&(J=0),Z[q]=H(s[q],s[W],s[J]);Y.push(Z),Q=Q.concat(Z)}for(N=0;N<_;N++){for(L=N/_,F=y*Math.cos(L*Math.PI/2),D=v*Math.sin(L*Math.PI/2),q=0,G=P.length;q<G;q++)$((j=O(P[q],z[q],D)).x,j.y,-F);for(c=0,l=k.length;c<l;c++)for(s=k[c],Z=Y[c],q=0,G=s.length;q<G;q++)$((j=O(s[q],Z[q],D)).x,j.y,-F)}for(D=v,q=0;q<B;q++)j=w?O(C[q],Q[q],D):C[q],S?(o.copy(r.normals[0]).multiplyScalar(j.x),i.copy(r.binormals[0]).multiplyScalar(j.y),a.copy(n[0]).add(o).add(i),$(a.x,a.y,a.z)):$(j.x,j.y,0);for(X=1;X<=A;X++)for(q=0;q<B;q++)j=w?O(C[q],Q[q],D):C[q],S?(o.copy(r.normals[X]).multiplyScalar(j.x),i.copy(r.binormals[X]).multiplyScalar(j.y),a.copy(n[X]).add(o).add(i),$(a.x,a.y,a.z)):$(j.x,j.y,m/A*X);for(N=_-1;N>=0;N--){for(L=N/_,F=y*Math.cos(L*Math.PI/2),D=v*Math.sin(L*Math.PI/2),q=0,G=P.length;q<G;q++)$((j=O(P[q],z[q],D)).x,j.y,m+F);for(c=0,l=k.length;c<l;c++)for(s=k[c],Z=Y[c],q=0,G=s.length;q<G;q++)j=O(s[q],Z[q],D),S?$(j.x,j.y+n[A-1].y,n[A-1].x+F):$(j.x,j.y,m+F)}function K(e,t){var n,r;for(q=e.length;--q>=0;){n=q,(r=q-1)<0&&(r=e.length-1);var i=0,o=A+2*_;for(i=0;i<o;i++){var a=B*i,s=B*(i+1);te(t+n+a,t+r+a,t+r+s,t+n+s)}}}function $(e,t,n){f.push(e),f.push(t),f.push(n)}function ee(e,t,n){ne(e),ne(t),ne(n);var r=h.length/3,i=T.generateTopUV(M,h,r-3,r-2,r-1);re(i[0]),re(i[1]),re(i[2])}function te(e,t,n,r){ne(e),ne(t),ne(r),ne(t),ne(n),ne(r);var i=h.length/3,o=T.generateSideWallUV(M,h,i-6,i-3,i-2,i-1);re(o[0]),re(o[1]),re(o[3]),re(o[1]),re(o[2]),re(o[3])}function ne(e){d.push(h.length/3),h.push(f[3*e+0]),h.push(f[3*e+1]),h.push(f[3*e+2])}function re(e){p.push(e.x),p.push(e.y)}!function(){var e=h.length/3;if(w){var n=0,r=B*n;for(q=0;q<V;q++)ee((U=I[q])[2]+r,U[1]+r,U[0]+r);for(r=B*(n=A+2*_),q=0;q<V;q++)ee((U=I[q])[0]+r,U[1]+r,U[2]+r)}else{for(q=0;q<V;q++)ee((U=I[q])[2],U[1],U[0]);for(q=0;q<V;q++)ee((U=I[q])[0]+B*A,U[1]+B*A,U[2]+B*A)}M.addGroup(e,h.length/3-e,void 0!==t.material?t.material:0)}(),function(){var e=h.length/3,n=0;for(K(P,n),n+=P.length,c=0,l=k.length;c<l;c++)K(s=k[c],n),n+=s.length;M.addGroup(e,h.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}(),t.arrays||(this.setIndex(d),this.addAttribute("position",new at(h,3)),this.addAttribute("uv",new at(p,2)))},Pr.WorldUVGenerator={generateTopUV:function(e,t,n,r,i){var o=t[3*n],a=t[3*n+1],s=t[3*r],c=t[3*r+1],l=t[3*i],u=t[3*i+1];return[new g(o,a),new g(s,c),new g(l,u)]},generateSideWallUV:function(e,t,n,r,i,o){var a=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*o],y=t[3*o+1],v=t[3*o+2];return Math.abs(s-u)<.01?[new g(a,1-c),new g(l,1-h),new g(d,1-f),new g(m,1-v)]:[new g(s,1-c),new g(u,1-h),new g(p,1-f),new g(y,1-v)]}},Nr.prototype=Object.create(Qe.prototype),Nr.prototype.constructor=Nr,Dr.prototype=Object.create(Or.prototype),Dr.prototype.constructor=Dr,Lr.prototype=Object.create(Qe.prototype),Lr.prototype.constructor=Lr,Fr.prototype=Object.create(vt.prototype),Fr.prototype.constructor=Fr,jr.prototype=Object.create(Qe.prototype),jr.prototype.constructor=jr,Ur.prototype=Object.create(vt.prototype),Ur.prototype.constructor=Ur,Br.prototype=Object.create(Qe.prototype),Br.prototype.constructor=Br,Vr.prototype=Object.create(vt.prototype),Vr.prototype.constructor=Vr,Hr.prototype=Object.create(Qe.prototype),Hr.prototype.constructor=Hr,Hr.prototype.toJSON=function(){var e=Qe.prototype.toJSON.call(this);return qr(this.parameters.shapes,e)},zr.prototype=Object.create(vt.prototype),zr.prototype.constructor=zr,zr.prototype.toJSON=function(){var e=vt.prototype.toJSON.call(this);return qr(this.parameters.shapes,e)},Gr.prototype=Object.create(vt.prototype),Gr.prototype.constructor=Gr,Wr.prototype=Object.create(Qe.prototype),Wr.prototype.constructor=Wr,Jr.prototype=Object.create(vt.prototype),Jr.prototype.constructor=Jr,Zr.prototype=Object.create(Wr.prototype),Zr.prototype.constructor=Zr,Xr.prototype=Object.create(Jr.prototype),Xr.prototype.constructor=Xr,Yr.prototype=Object.create(Qe.prototype),Yr.prototype.constructor=Yr,Qr.prototype=Object.create(vt.prototype),Qr.prototype.constructor=Qr;var Kr=Object.freeze({WireframeGeometry:Hn,ParametricGeometry:zn,ParametricBufferGeometry:qn,TetrahedronGeometry:Jn,TetrahedronBufferGeometry:Zn,OctahedronGeometry:Xn,OctahedronBufferGeometry:Yn,IcosahedronGeometry:Qn,IcosahedronBufferGeometry:Kn,DodecahedronGeometry:$n,DodecahedronBufferGeometry:er,PolyhedronGeometry:Gn,PolyhedronBufferGeometry:Wn,TubeGeometry:tr,TubeBufferGeometry:nr,TorusKnotGeometry:rr,TorusKnotBufferGeometry:ir,TorusGeometry:or,TorusBufferGeometry:ar,TextGeometry:Nr,TextBufferGeometry:Dr,SphereGeometry:Lr,SphereBufferGeometry:Fr,RingGeometry:jr,RingBufferGeometry:Ur,PlaneGeometry:wt,PlaneBufferGeometry:Et,LatheGeometry:Br,LatheBufferGeometry:Vr,ShapeGeometry:Hr,ShapeBufferGeometry:zr,ExtrudeGeometry:Pr,ExtrudeBufferGeometry:Or,EdgesGeometry:Gr,ConeGeometry:Zr,ConeBufferGeometry:Xr,CylinderGeometry:Wr,CylinderBufferGeometry:Jr,CircleGeometry:Yr,CircleBufferGeometry:Qr,BoxGeometry:bt,BoxBufferGeometry:_t});function $r(e){Ce.call(this),this.type="ShadowMaterial",this.color=new fe(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(e)}function ei(e){xt.call(this,e),this.type="RawShaderMaterial"}function ti(e){Ce.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fe(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ni(e){ti.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function ri(e){Ce.call(this),this.type="MeshPhongMaterial",this.color=new fe(16777215),this.specular=new fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ii(e){ri.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function oi(e){Ce.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ai(e){Ce.call(this),this.type="MeshLambertMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function si(e){Pn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}$r.prototype=Object.create(Ce.prototype),$r.prototype.constructor=$r,$r.prototype.isShadowMaterial=!0,ei.prototype=Object.create(xt.prototype),ei.prototype.constructor=ei,ei.prototype.isRawShaderMaterial=!0,ti.prototype=Object.create(Ce.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshStandardMaterial=!0,ti.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ni.prototype=Object.create(ti.prototype),ni.prototype.constructor=ni,ni.prototype.isMeshPhysicalMaterial=!0,ni.prototype.copy=function(e){return ti.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},ri.prototype=Object.create(Ce.prototype),ri.prototype.constructor=ri,ri.prototype.isMeshPhongMaterial=!0,ri.prototype.copy=function(e){return Ce.prototype.copy.call(this,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.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.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ii.prototype=Object.create(ri.prototype),ii.prototype.constructor=ii,ii.prototype.isMeshToonMaterial=!0,ii.prototype.copy=function(e){return ri.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},oi.prototype=Object.create(Ce.prototype),oi.prototype.constructor=oi,oi.prototype.isMeshNormalMaterial=!0,oi.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ai.prototype=Object.create(Ce.prototype),ai.prototype.constructor=ai,ai.prototype.isMeshLambertMaterial=!0,ai.prototype.copy=function(e){return Ce.prototype.copy.call(this,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},si.prototype=Object.create(Pn.prototype),si.prototype.constructor=si,si.prototype.isLineDashedMaterial=!0,si.prototype.copy=function(e){return Pn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ci=Object.freeze({ShadowMaterial:$r,SpriteMaterial:Tn,RawShaderMaterial:ei,ShaderMaterial:xt,PointsMaterial:Ln,MeshPhysicalMaterial:ni,MeshStandardMaterial:ti,MeshPhongMaterial:ri,MeshToonMaterial:ii,MeshNormalMaterial:oi,MeshLambertMaterial:ai,MeshDepthMaterial:ke,MeshDistanceMaterial:Ie,MeshBasicMaterial:At,LineDashedMaterial:si,LineBasicMaterial:Pn,Material:Ce}),li={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ui(e,t,n){var r=this,i=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===i&&void 0!==r.onStart&&r.onStart(e,o,a),i=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var hi=new ui,di={};function pi(e){this.manager=void 0!==e?e:hi}function fi(e){this.manager=void 0!==e?e:hi,this._parser=null}function mi(e){this.manager=void 0!==e?e:hi}function gi(e){this.manager=void 0!==e?e:hi}function yi(e){this.manager=void 0!==e?e:hi}function vi(){this.type="Curve",this.arcLengthDivisions=200}function bi(e,t,n,r,i,o,a,s){vi.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function _i(e,t,n,r,i,o){bi.call(this,e,t,n,n,r,i,o),this.type="ArcCurve"}function wi(){var e=0,t=0,n=0,r=0;function i(i,o,a,s){e=i,t=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,a,s){var c=(t-e)/o-(n-e)/(o+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+s)+(r-n)/s;i(t,n,c*=a,l*=a)},calc:function(i){var o=i*i;return e+t*i+n*o+r*(o*i)}}}Object.assign(pi.prototype,{load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=li.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;if(void 0===di[e]){var a=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],l=a[3];l=window.decodeURIComponent(l),c&&(l=window.atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){window.setTimeout((function(){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),0)}}else{di[e]=[],di[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response;li.add(e,n);var r=di[e];if(delete di[e],200===this.status){for(var o=0,a=r.length;o<a;o++){(s=r[o]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(o=0,a=r.length;o<a;o++){(s=r[o]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(o=0,a=r.length;o<a;o++){var s;(s=r[o]).onError&&s.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=di[e],r=0,i=n.length;r<i;r++){var o=n[r];o.onProgress&&o.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=di[e];delete di[e];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}di[e].push({onLoad:t,onProgress:n,onError:r})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this._parser=null}.prototype,{load:function(e,t,n,r){var i=this,o=[],a=new Bn;a.image=o;var s=new pi(this.manager);function c(c){s.load(e[c],(function(e){var n=i._parser(e,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(a.minFilter=1006),a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,(function(e){var n=i._parser(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=1006),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,r);return a},setPath:function(e){return this.path=e,this}}),Object.assign(fi.prototype,{load:function(e,t,n,r){var i=this,o=new T,a=new pi(this.manager);return a.setResponseType("arraybuffer"),a.load(e,(function(e){var n=i._parser(e);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:1001,o.wrapT=void 0!==n.wrapT?n.wrapT:1001,o.magFilter=void 0!==n.magFilter?n.magFilter:1006,o.minFilter=void 0!==n.minFilter?n.minFilter:1008,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=1006),o.needsUpdate=!0,t&&t(o,n))}),n,r),o}}),Object.assign(mi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=li.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");return a.addEventListener("load",(function(){li.add(e,this),t&&t(this),i.manager.itemEnd(e)}),!1),a.addEventListener("error",(function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(gi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new M,o=new mi(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(e[n],(function(e){i.images[n]=e,6===++a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var c=0;c<e.length;++c)s(c);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(yi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new E,o=new mi(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(n){i.image=n;var r=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(vi.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),o=0;for(r.push(0),n=1;n<=e;n++)o+=(t=this.getPoint(n/e)).distanceTo(i),r.push(o),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,o=new b,a=[],s=[],c=[],l=new b,u=new y;for(n=0;n<=e;n++)r=n/e,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new b,c[0]=new b;var h=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=h&&(h=d,o.set(1,0,0)),p<=h&&(h=p,o.set(0,1,0)),f<=h&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),c[0].crossVectors(a[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(m.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,i))),c[n].crossVectors(a[n],s[n]);if(!0===t)for(i=Math.acos(m.clamp(s[0].dot(s[e]),-1,1)),i/=e,a[0].dot(l.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],i*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),bi.prototype=Object.create(vi.prototype),bi.prototype.constructor=bi,bi.prototype.isEllipseCurve=!0,bi.prototype.getPoint=function(e,t){for(var n=t||new g,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);var a=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=c-this.aY;s=h*l-d*u+this.aX,c=h*u+d*l+this.aY}return n.set(s,c)},bi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},bi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},bi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},_i.prototype=Object.create(bi.prototype),_i.prototype.constructor=_i,_i.prototype.isArcCurve=!0;var Ei=new b,Ai=new wi,xi=new wi,Si=new wi;function Ti(e,t,n,r){vi.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Mi(e,t,n,r,i){var o=.5*(r-t),a=.5*(i-n),s=e*e;return(2*n-2*r+o+a)*(e*s)+(-3*n+3*r-2*o-a)*s+o*e+n}function Ri(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Ci(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function ki(e,t,n,r){vi.call(this),this.type="CubicBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g,this.v3=r||new g}function Ii(e,t,n,r){vi.call(this),this.type="CubicBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function Pi(e,t){vi.call(this),this.type="LineCurve",this.v1=e||new g,this.v2=t||new g}function Oi(e,t){vi.call(this),this.type="LineCurve3",this.v1=e||new b,this.v2=t||new b}function Ni(e,t,n){vi.call(this),this.type="QuadraticBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g}function Di(e,t,n){vi.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function Li(e){vi.call(this),this.type="SplineCurve",this.points=e||[]}Ti.prototype=Object.create(vi.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isCatmullRomCurve3=!0,Ti.prototype.getPoint=function(e,t){var n,r,i,o,a=t||new b,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s.length)+1)*s.length:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(Ei.subVectors(s[0],s[1]).add(s[0]),n=Ei),r=s[u%c],i=s[(u+1)%c],this.closed||u+2<c?o=s[(u+2)%c]:(Ei.subVectors(s[c-1],s[c-2]).add(s[c-1]),o=Ei),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(o),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),Ai.initNonuniformCatmullRom(n.x,r.x,i.x,o.x,p,f,m),xi.initNonuniformCatmullRom(n.y,r.y,i.y,o.y,p,f,m),Si.initNonuniformCatmullRom(n.z,r.z,i.z,o.z,p,f,m)}else"catmullrom"===this.curveType&&(Ai.initCatmullRom(n.x,r.x,i.x,o.x,this.tension),xi.initCatmullRom(n.y,r.y,i.y,o.y,this.tension),Si.initCatmullRom(n.z,r.z,i.z,o.z,this.tension));return a.set(Ai.calc(h),xi.calc(h),Si.calc(h)),a},Ti.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Ti.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Ti.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new b).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ki.prototype=Object.create(vi.prototype),ki.prototype.constructor=ki,ki.prototype.isCubicBezierCurve=!0,ki.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Ci(e,r.x,i.x,o.x,a.x),Ci(e,r.y,i.y,o.y,a.y)),n},ki.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},ki.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},ki.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Ii.prototype=Object.create(vi.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isCubicBezierCurve3=!0,Ii.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Ci(e,r.x,i.x,o.x,a.x),Ci(e,r.y,i.y,o.y,a.y),Ci(e,r.z,i.z,o.z,a.z)),n},Ii.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ii.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ii.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Pi.prototype=Object.create(vi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isLineCurve=!0,Pi.prototype.getPoint=function(e,t){var n=t||new g;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Pi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Pi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Pi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Pi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Pi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Oi.prototype=Object.create(vi.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isLineCurve3=!0,Oi.prototype.getPoint=function(e,t){var n=t||new b;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Oi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Oi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Oi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Oi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ni.prototype=Object.create(vi.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isQuadraticBezierCurve=!0,Ni.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,o=this.v2;return n.set(Ri(e,r.x,i.x,o.x),Ri(e,r.y,i.y,o.y)),n},Ni.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ni.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ni.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Di.prototype=Object.create(vi.prototype),Di.prototype.constructor=Di,Di.prototype.isQuadraticBezierCurve3=!0,Di.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,o=this.v2;return n.set(Ri(e,r.x,i.x,o.x),Ri(e,r.y,i.y,o.y),Ri(e,r.z,i.z,o.z)),n},Di.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Di.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Di.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Li.prototype=Object.create(vi.prototype),Li.prototype.constructor=Li,Li.prototype.isSplineCurve=!0,Li.prototype.getPoint=function(e,t){var n=t||new g,r=this.points,i=(r.length-1)*e,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],c=r[o],l=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(Mi(a,s.x,c.x,l.x,u.x),Mi(a,s.y,c.y,l.y,u.y)),n},Li.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Li.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Li.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new g).fromArray(r))}return this};var Fi=Object.freeze({ArcCurve:_i,CatmullRomCurve3:Ti,CubicBezierCurve:ki,CubicBezierCurve3:Ii,EllipseCurve:bi,LineCurve:Pi,LineCurve3:Oi,QuadraticBezierCurve:Ni,QuadraticBezierCurve3:Di,SplineCurve:Li});function ji(){vi.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ui(e){ji.call(this),this.type="Path",this.currentPoint=new g,e&&this.setFromPoints(e)}function Bi(e){Ui.call(this,e),this.uuid=m.generateUUID(),this.type="Shape",this.holes=[]}function Vi(e,t){Ge.call(this),this.type="Light",this.color=new fe(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Hi(e,t,n){Vi.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.groundColor=new fe(t)}function zi(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new g(512,512),this.map=null,this.matrix=new y}function qi(){zi.call(this,new nn(50,1,.5,500))}function Gi(e,t,n,r,i,o){Vi.call(this,e,t),this.type="SpotLight",this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.target=new Ge,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new qi}function Wi(e,t,n,r){Vi.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new zi(new nn(90,1,.5,500))}function Ji(){zi.call(this,new Je(-5,5,5,-5,.5,500))}function Zi(e,t){Vi.call(this,e,t),this.type="DirectionalLight",this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.target=new Ge,this.shadow=new Ji}function Xi(e,t){Vi.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Yi(e,t,n,r){Vi.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Qi(e,t,n,r){co.call(this,e,t,n,r)}function Ki(e,t,n){co.call(this,e,t,n)}function $i(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function eo(e,t,n,r){$i.call(this,e,t,n,r)}function to(e,t,n,r){co.call(this,e,t,n,r)}function no(e,t,n,r){co.call(this,e,t,n,r)}function ro(e,t,n,r){co.call(this,e,t,n,r)}function io(e,t,n,r){$i.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function oo(e,t,n,r){$i.call(this,e,t,n,r)}function ao(e,t,n,r){$i.call(this,e,t,n,r)}ji.prototype=Object.assign(Object.create(vi.prototype),{constructor:ji,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Pi(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*e:o&&o.isLineCurve?1:o&&o.isSplineCurve?e*o.points.length:e,s=o.getPoints(a),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){vi.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=vi.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){vi.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Fi[r.type]).fromJSON(r))}return this}}),Ui.prototype=Object.assign(Object.create(ji.prototype),{constructor:Ui,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Pi(this.currentPoint.clone(),new g(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,r){var i=new Ni(this.currentPoint.clone(),new g(e,t),new g(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(e,t,n,r,i,o){var a=new ki(this.currentPoint.clone(),new g(e,t),new g(n,r),new g(i,o));this.curves.push(a),this.currentPoint.set(i,o)},splineThru:function(e){var t=new Li([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+a,t+s,n,r,i,o)},absarc:function(e,t,n,r,i,o){this.absellipse(e,t,n,n,r,i,o)},ellipse:function(e,t,n,r,i,o,a,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,n,r,i,o,a,s)},absellipse:function(e,t,n,r,i,o,a,s){var c=new bi(e,t,n,r,i,o,a,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(e){return ji.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=ji.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ji.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Bi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Bi,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Ui.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Ui.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Ui.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Ui).fromJSON(r))}return this}}),Vi.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Vi,isLight:!0,copy:function(e){return Ge.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Hi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Hi,isHemisphereLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(zi.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),qi.prototype=Object.assign(Object.create(zi.prototype),{constructor:qi,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*m.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix())}}),Gi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Gi,isSpotLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,isPointLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Ji.prototype=Object.assign(Object.create(zi.prototype),{constructor:Ji}),Zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Zi,isDirectionalLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Xi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Xi,isAmbientLight:!0}),Yi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Yi,isRectAreaLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Vi.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Qi.prototype=Object.assign(Object.create(co.prototype),{constructor:Qi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ki.prototype=Object.assign(Object.create(co.prototype),{constructor:Ki,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign($i.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var o;n:{r:if(!(e<r)){for(var a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===a)break;if(i=r,e<(r=t[++n]))break t}o=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===a)break;if(r=i,e>=(i=t[--n-1]))break t}o=n,n=0}for(;n<o;){var c=n+o>>>1;e<t[c]?o=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,o=0;o!==r;++o)t[o]=n[i+o];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),+var ln,un=function(){function e(e,t){var n=this;this.app_=e,this.authProvider_=t,this.auth_=null,this.auth_=t.getImmediate({optional:!0}),this.auth_||t.get().then((function(e){return n.auth_=e}))}return e.prototype.getToken=function(e){return this.auth_?this.auth_.getToken(e).catch((function(e){return e&&"auth/token-not-initialized"===e.code?(A("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)})):Promise.resolve(null)},e.prototype.addTokenChangeListener=function(e){this.auth_?this.auth_.addAuthTokenListener(e):(setTimeout((function(){return e(null)}),0),this.authProvider_.get().then((function(t){return t.addAuthTokenListener(e)})))},e.prototype.removeTokenChangeListener=function(e){this.authProvider_.get().then((function(t){return t.removeAuthTokenListener(e)}))},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',M(e)},e}(),hn=function(){function e(){}return e.prototype.getToken=function(t){return Promise.resolve({accessToken:e.EMULATOR_AUTH_TOKEN})},e.prototype.addTokenChangeListener=function(t){t(e.EMULATOR_AUTH_TOKEN)},e.prototype.removeTokenChangeListener=function(e){},e.prototype.notifyForInvalidToken=function(){},e.EMULATOR_AUTH_TOKEN="owner",e}(),dn=function(){function e(){this.repos_={},this.useRestClient_=!1}return e.getInstance=function(){return ln||(ln=new e),ln},e.prototype.interrupt=function(){var e,t,n,r;try{for(var i=s.__values(Object.keys(this.repos_)),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var c=(n=void 0,s.__values(Object.keys(this.repos_[a]))),l=c.next();!l.done;l=c.next()){var u=l.value;this.repos_[a][u].interrupt()}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.resume=function(){var e,t,n,r;try{for(var i=s.__values(Object.keys(this.repos_)),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var c=(n=void 0,s.__values(Object.keys(this.repos_[a]))),l=c.next();!l.done;l=c.next()){var u=l.value;this.repos_[a][u].resume()}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.databaseFromApp=function(e,t,n){var i=n||e.options.databaseURL;void 0===i&&T("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().");var o,a=X(i),s=a.repoInfo,l=void 0;void 0!==r&&(l=r.env.FIREBASE_DATABASE_EMULATOR_HOST),l?(o=!0,i="http://"+l+"?ns="+s.namespace,s=(a=X(i)).repoInfo):o=!a.repoInfo.secure;var u=c.CONSTANTS.NODE_ADMIN&&o?new hn:new un(e,t);return de("Invalid Firebase Database URL",1,a),a.path.isEmpty()||T("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(s,e,u).database},e.prototype.deleteRepo=function(e){var t=c.safeGet(this.repos_,e.app.name);t&&c.safeGet(t,e.repoInfo_.toURLString())===e||T("Database "+e.app.name+"("+e.repoInfo_+") has already been deleted."),e.interrupt(),delete t[e.repoInfo_.toURLString()]},e.prototype.createRepo=function(e,t,n){var r=c.safeGet(this.repos_,t.name);r||(r={},this.repos_[t.name]=r);var i=c.safeGet(r,e.toURLString());return i&&T("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new en(e,this.useRestClient_,t,n),r[e.toURLString()]=i,i},e.prototype.forceRestClient=function(e){this.useRestClient_=e},e}(),pn=function(){function e(e){this.repo_=e,e instanceof en||T("Don't call new Database() directly - please use firebase.database()."),this.root_=new on(e,H.Empty),this.INTERNAL=new fn(this)}return Object.defineProperty(e.prototype,"app",{get:function(){return this.repo_.app},enumerable:!1,configurable:!0}),e.prototype.ref=function(e){return this.checkDeleted_("ref"),c.validateArgCount("database.ref",0,1,arguments.length),e instanceof on?this.refFromURL(e.toString()):void 0!==e?this.root_.child(e):this.root_},e.prototype.refFromURL=function(e){var t="database.refFromURL";this.checkDeleted_(t),c.validateArgCount(t,1,1,arguments.length);var n=X(e);de(t,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&T(t+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},e.prototype.checkDeleted_=function(e){null===this.repo_&&T("Cannot call "+e+" on a deleted database.")},e.prototype.goOffline=function(){c.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},e.prototype.goOnline=function(){c.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},e.ServerValue={TIMESTAMP:{".sv":"timestamp"},increment:function(e){return{".sv":{increment:e}}}},e}(),fn=function(){function e(e){this.database=e}return e.prototype.delete=function(){return s.__awaiter(this,void 0,void 0,(function(){return s.__generator(this,(function(e){return this.database.checkDeleted_("delete"),dn.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]}))}))},e}(),mn=Object.freeze({__proto__:null,forceLongPolling:function(){Zt.forceDisallow(),qt.forceAllow()},forceWebSockets:function(){qt.forceDisallow()},isWebSocketsAvailable:function(){return Zt.isAvailable()},setSecurityDebugCallback:function(e,t){e.repo.persistentConnection_.securityDebugCallback_=t},stats:function(e,t){e.repo.stats(t)},statsIncrementCounter:function(e,t){e.repo.statsIncrementCounter(t)},dataUpdateCount:function(e){return e.repo.dataUpdateCount},interceptServerData:function(e,t){return e.repo.interceptServerData_(t)}}),gn=Kt;Kt.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},Kt.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};var yn=Xt,vn=q,bn=Object.freeze({__proto__:null,DataConnection:gn,RealTimeConnection:yn,hijackHash:function(e){var t=Kt.prototype.put;return Kt.prototype.put=function(n,r,i,o){void 0!==o&&(o=e()),t.call(this,n,r,i,o)},function(){Kt.prototype.put=t}},ConnectionTarget:vn,queryIdentifier:function(e){return e.queryIdentifier()},forceRestClient:function(e){dn.getInstance().forceRestClient(e)}}),_n=pn.ServerValue;function wn(t){!function(e){Wt=e}(t.SDK_VERSION);var n=t.INTERNAL.registerComponent(new u.Component("database",(function(e,t){var n=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal");return dn.getInstance().databaseFromApp(n,r,t)}),"PUBLIC").setServiceProps({Reference:on,Query:Ke,Database:pn,DataSnapshot:Je,enableLogging:E,INTERNAL:mn,ServerValue:_n,TEST_ACCESS:bn}).setMultipleInstances(!0));t.registerVersion("@firebase/database","0.6.11"),c.isNodeSdk()&&(e.exports=n)}wn(a),t.DataSnapshot=Je,t.Database=pn,t.OnDisconnect=fe,t.Query=Ke,t.Reference=on,t.ServerValue=_n,t.enableLogging=E,t.registerDatabase=wn}).call(this,n(2))},function(e,t,n){const r={0:0,1:.5,2:0,3:.25,4:.5,5:.75,6:0,7:.125,8:.25,9:.375,10:.5,11:.625,12:.75,13:.875};if(AFRAME.registerComponent("multiplier-ring",{dependencies:["geometry","material"],schema:{combo:{default:0},multiplier:{default:1}},init:function(){this.animationSet={from:void 0,to:void 0},this.progress=this.el.getObject3D("mesh").material.uniforms.progress,this.el.setAttribute("animation",{property:"components.material.material.uniforms.progress.value",dur:100,autoplay:!1})},update:function(){this.updateRing()},updateRing:function(){const e=this.data,t=this.el,n=this.progress;if(8===e.multiplier)return void(n.value=1);const i=this.animationSet;i.from=n.value,i.to=r[e.combo],t.setAttribute("animation",i),t.components.animation.beginAnimation()}}),window.AFRAME){const t=["multiplier-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("no-frustum-cull",{init:function(){this.el.object3D.frustumCulled=!1}}),window.AFRAME){const t=["no-frustum-cull"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("panelShader",{schema:{activePanel:{type:"number",is:"uniform",default:0},brightness:{type:"number",is:"uniform",default:.3},borderWidth:{type:"number",is:"uniform",default:.004},borderRadius:{type:"number",is:"uniform",default:.15},colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},midSection:{type:"number",is:"uniform",default:0},opacity:{type:"number",is:"uniform",default:1},ratio:{type:"number",is:"uniform",default:.5},transparent:{default:!0}},vertexShader:n(141),fragmentShader:n(142),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerPanel(this.material)}}),window.AFRAME){const t=[],n=["panelShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\n\n#define PI 3.141592\n#define DIFF_SECTION_WIDTH 0.06\n\nuniform float borderWidth;\nuniform float borderRadius;\nuniform float brightness;\nuniform float ratio;\nuniform float midSection;\nuniform float opacity;\nuniform float activePanel;\n\nvarying vec2 uvs;\n\nfloat sdBox( in vec2 p, in vec2 b )\n{\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0.0))) + min(max(d.x,d.y), 0.0);\n}\n\nvoid main()\n{\n vec2 uv = uvs;\n vec2 uv2 = uv * 2.0 - 1.0; // from -1 to 1\n uv2.x *= ratio;\n\n vec3 col = mix(colorSecondary * uv.y, colorPrimary * uv.y, uv.x) * (brightness + activePanel * 0.4);\n vec3 borderCol = mix(colorSecondary, colorPrimary, uv.y);\n\n vec2 size = vec2(0.83 * ratio, 0.86) - borderRadius;\n float grad = sdBox(uv2, size) - borderRadius;\n grad = min(grad, sdBox(uv2 - size, vec2(borderRadius)));\n grad = min(grad, sdBox(uv2 + size, vec2(borderRadius)));\n grad = -grad;\n float aa = fwidth(grad);\n\n float isShape = smoothstep(-aa, 0.0, grad);\n float alpha = clamp(isShape + smoothstep(-0.15, 0.15, grad), 0.0, 1.0);\n float isBorder = smoothstep(-aa - borderWidth, aa - borderWidth, grad) - smoothstep(-aa + borderWidth, aa + borderWidth, grad);\n float mid = clamp(midSection, 0.0, 1.0);\n col *= 1.0 - mid * (step(0.5 - DIFF_SECTION_WIDTH * mid, uv.x) - step(0.5 + DIFF_SECTION_WIDTH * midSection, uv.x)) * 0.3;\n\n gl_FragColor = vec4(mix(col * isShape, borderCol, isBorder), alpha * opacity);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("pause",{schema:{isPaused:{default:!1}},update:function(){this.data.isPaused&&this.el.isPlaying?this.el.pause():this.data.isPaused||this.el.isPlaying||!this.el.sceneEl.isPlaying||this.el.play()}}),window.AFRAME){const t=["pause"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("pauser",{schema:{enabled:{default:!0}},init:function(){this.pauseGame=this.pauseGame.bind(this),document.addEventListener("keydown",e=>{27===e.keyCode&&this.pauseGame()}),this.el.sceneEl.addEventListener("controllerconnected",e=>{"vive-controls"===e.detail.name?this.el.addEventListener("menudown",this.pauseGame):(this.el.addEventListener("thumbstickdown",this.pauseGame),this.el.addEventListener("trackpaddown",this.pauseGame))}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.pauseGame()})},pauseGame:function(){this.data.enabled&&this.el.sceneEl.emit("pausegame",null,!1)}}),window.AFRAME){const t=["pauser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=n(146);if(AFRAME.registerSystem("play-sound",{init:function(){this.lastSoundPlayed="",this.lastSoundPlayedTime=0,this.pools={}},createPool:function(e,t){this.pools[e]||(this.pools[e]=new r(e,t))},playSound:function(e,t){this.pools[e]||this.createPool(e,t),this.pools[e].play(),this.lastSoundPlayed=e,this.lastSoundTime=this.el.time}}),AFRAME.registerComponent("play-sound",{schema:{enabled:{default:!0},event:{type:"string"},sound:{type:"string"},volume:{type:"number",default:1}},multiple:!0,init:function(){this.el.addEventListener(this.data.event,e=>{this.data.enabled&&this.system.playSound(this.src,this.data.volume)})},update:function(){this.src=this.data.sound,this.data.sound.startsWith("#")&&(this.src=document.querySelector(this.data.sound).getAttribute("src"))}}),window.AFRAME){const t=["play-sound"],n=[],r=["play-sound"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports=function(e,t){var n,r=0,i=[];return(n=new Audio(e)).volume=t,i.push(n),{play:function(){0===i[r].currentTime&&i[r].ended||((n=new Audio(e)).volume=t,i.push(n),r++),(0===i[r].currentTime||i[r].ended)&&i[r].play(),r=(r+1)%i.length}}}},function(e,t,n){function r(e,t){return e-t}if(AFRAME.registerComponent("player-height",{init:function(){this.beatOffset=0,this.heights=[],this.height=0,this.el.sceneEl.addEventListener("menuchallengeselect",this.updateHeight.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.updateHeight.bind(this))},pause:function(){this.heights.length=0},updateHeight:function(){const e=this.heights;e.length>3&&e.shift(),e.push(this.el.object3D.position.y),this.height=function(e){e.sort(r);const t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2}(e);const t=(n=this.height,i=1.6,o=2.2,Math.min(Math.max(n,i),o));var n,i,o,a,s;this.beatOffset=(s=0)+(.2-s)*(t-(a=1.6))/(2.2-a)}}),window.AFRAME){const t=["player-height"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("plume",{schema:{color:{default:""},cutDirection:{default:""},horizontalPosition:{default:"middleleft",oneOf:["left","middleleft","middleright","right"]},songPosition:{default:0},type:{default:"arrow",oneOf:["arrow","dot","mine"]},verticalPosition:{default:"middle",oneOf:["bottom","middle","top"]}},horizontalPositions:{left:-.95,middleleft:-.6,middleright:.6,right:.95},init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.handsEls=this.el.sceneEl.querySelectorAll(".handStar"),this.handPos=new THREE.Vector3,this.verticalPositions=this.el.sceneEl.components["beat-system"].verticalPositions,this.el.sceneEl.addEventListener("cleargame",this.returnToPool.bind(this))},update:function(){"mine"===this.data.type?this.poolName="pool__plume-mine":this.poolName=`pool__plume-${this.data.type}-${this.data.color}`},onGenerate:function(e,t,n,r){this.data;const i=this.el,o=this.curveEl.components.supercurve;o.getPointAt(e,i.object3D.position),o.alignToCurve(e,i.object3D),i.object3D.position.x+=this.horizontalPositions[t],i.object3D.position.y+=this.verticalPositions[n]+r,i.object3D.rotation.z=Math.random()*Math.PI*2,this.songPosition=e},tock:function(){if(this.el.object3D.position.z>this.curveFollowRig.object3D.position.z+10)this.returnToPool();else for(let e=0;e<this.handsEls.length;e++){const t=this.handsEls[e];t.object3D.getWorldPosition(this.handPos),this.handPos.distanceToSquared(this.el.object3D.position)<.2&&t.emit("plumepulse")}},returnToPool:function(){this.el.object3D.position.set(0,0,-9999),this.el.object3D.visible=!1,this.el.isPlaying&&this.el.sceneEl.components[this.poolName].returnEntity(this.el)}}),window.AFRAME){const t=["plume"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("punch",{schema:{enabled:{default:!1}},init:function(){this.currentPos=new THREE.Vector3,this.direction=0,this.lastSample=new THREE.Vector3,this.lastSampleTime=0,this.speed=0,this.bbox=new THREE.Box3,this.bboxEl=this.el.querySelector(".punchBbox")},play:function(){this.rig=this.el.closest("#curveFollowRig")},tick:function(e,t){this.data.enabled&&(this.direction=this.currentPos.copy(this.el.object3D.position).sub(this.lastSample),this.speed=this.direction.length()/((e-this.lastSampleTime)/1e3),this.lastSample.copy(this.el.object3D.position),this.lastSampleTime=e)},tickBeatSystem:function(){this.bbox.setFromObject(this.bboxEl.getObject3D("mesh"))},checkCollision:function(){const e=new THREE.Box3,t=new THREE.Vector3(0,0,.2);return function(n){return e.copy(n.bbox).translate(n.el.object3D.position).expandByScalar(.1).expandByVector(t),this.bbox.intersectsBox(e)}}()}),window.AFRAME){const t=["punch"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i;if(AFRAME.registerComponent("raycaster-target",{schema:{bindToggle:{default:""},depth:{type:"number"},height:{type:"number"},position:{type:"vec3",default:{x:0,y:0,z:0}},rotation:{type:"vec3",default:{x:0,y:0,z:0}},useBoxTarget:{default:!1},width:{type:"number"}},init:(r={primitive:"box"},i={primitive:"plane"},function(){var e,t,n=this.data,o=this.el;(t=document.createElement("a-entity")).classList.add("raycasterTarget"),n.bindToggle?t.setAttribute("bind-toggle__raycastable",n.bindToggle):t.setAttribute("data-raycastable",""),n.useBoxTarget?((e=r).depth=n.depth,e.height=n.height,e.width=n.width):((e=i).height=n.height,e.width=n.width),t.setAttribute("geometry",e),t.object3D.visible=!1,t.object3D.position.copy(n.position),t.object3D.rotation.x=THREE.Math.degToRad(n.rotation.x),t.object3D.rotation.y=THREE.Math.degToRad(n.rotation.y),t.object3D.rotation.z=THREE.Math.degToRad(n.rotation.z),o.appendChild(t)})}),window.AFRAME){const t=["raycaster-target"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i,o,a;if(AFRAME.registerComponent("recenter",{schema:{enabled:{default:!0}},init:function(){this.el.sceneEl;this.recenter=this.recenter.bind(this),document.querySelectorAll("[tracked-controls]").forEach(e=>{e.addEventListener("menudown",this.recenter),e.addEventListener("thumbstickdown",this.recenter)}),this.el.addEventListener("recenter",this.recenter)},recenter:(r=new THREE.Euler,i=new THREE.Matrix4,o=new THREE.Matrix4,a=new THREE.Matrix4,function(){const e=this.el;if(!this.data.enabled)return;const t=e.sceneEl.camera.el.object3D;i.identity(),r.set(0,-1*t.rotation.y,0),o.makeRotationFromEuler(r),a.makeTranslation(-1*t.position.x,0,-1*t.position.z),i.multiply(o).multiply(a),i.decompose(e.object3D.position,e.object3D.quaternion,e.object3D.scale),e.object3D.updateMatrixWorld(!0),e.emit("recentered",null,!1)})}),window.AFRAME){const t=["recenter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("ring",{schema:{blur:{default:.01,is:"uniform"},color:{type:"color",is:"uniform"},progress:{default:0,is:"uniform"},radiusInner:{default:.6,is:"uniform"},radiusOuter:{default:1,is:"uniform"}},vertexShader:n(153),fragmentShader:n(154)}),window.AFRAME){const t=[],n=["ring"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUv;\n\nvoid main () {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n#define PI 3.14159265358979\nuniform float blur;\nuniform float progress;\nuniform float radiusInner;\nuniform float radiusOuter;\nuniform vec3 color;\n\nvarying vec2 vUv;\n\nvoid main () {\n // make uvs go from -1 to 1\n vec2 uv = vec2(vUv.x * 2.0 - 1.0, vUv.y * 2.0 - 1.0);\n // calculate distance of fragment to center\n float r = uv.x * uv.x + uv.y * uv.y;\n // calculate antialias\n float aa = fwidth(r);\n // make full circle (radiusOuter - radiusInner)\n float col = (1.0 - smoothstep(radiusOuter - aa, radiusOuter + blur + aa, r)) * smoothstep(radiusInner - aa, radiusInner + blur + aa, r);\n // radial gradient\n float a = smoothstep(-PI-aa, PI+aa, atan(uv.y, uv.x));\n // progress angle\n float p = 1.0 - progress - blur;\n // apply progress to full circle (1 for done part, 0 for part to go)\n col *= smoothstep(p, p + blur, a);\n // multiply by user color\n gl_FragColor = vec4(color * col, col);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("score-texts",{schema:{isLoading:{default:!1}},init:function(){this.textEls=this.el.querySelectorAll("[text]");for(let e=0;e<this.textEls.length;e++)this.textEls[e].setAttribute("animation__fadein",{autoplay:!1,property:"components.text.material.uniforms.opacity.value",delay:250,dur:750,easing:"easeInOutCubic",from:0,to:1})},update:function(e){if(e.isLoading&&!this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.animation__fadein.beginAnimation();this.el.sceneEl.emit("textglownormal",null,!1)}if(!e.isLoading&&this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.text.material.uniforms.opacity.value=0;this.el.sceneEl.emit("textglowoff",null,!1)}}}),window.AFRAME){const t=["score-texts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);n(6);if(AFRAME.registerComponent("search-thumbnail-atlas",{dependencies:["geometry","material"],schema:{dummyUpdater:{type:"string"}},init:function(){const e=this.canvas=document.createElement("canvas");e.setAttribute("id","thumbnailAtlasMap"),e.height=512,e.width=64,e.style.visibility="hidden",this.ctx=e.getContext("2d"),this.clearCanvas(),document.body.appendChild(e);const t=this.alphaCanvas=document.createElement("canvas");t.setAttribute("id","thumbnailAlphaMap"),t.height=512,t.width=64,t.style.visibility="hidden",this.alphaCtx=t.getContext("2d"),document.body.appendChild(t),this.el.components.material.material.alphaMap=new THREE.CanvasTexture(t),this.el.setAttribute("material","src",e),this.images=[],this.lastNumResults=6},update:function(){const e=this.el.sceneEl.systems.state.state.searchResultsPage;for(let t=0;t<e.length;t++){let n=this.images[t]=this.images[t]||document.createElement("img");n.crossOrigin="anonymous",n.src=e[t].coverURL,n.complete?this.draw(n,t):n.onload=()=>{this.draw(n,t)}}e.length!==this.lastNumResults&&this.updateAlphaMap(e.length),this.lastNumResults=e.length},draw:function(e,t){this.ctx.drawImage(e,0,t*(512/384*64),64,512/384*64),this.el.getObject3D("mesh").material.map.needsUpdate=!0},clearCanvas:function(){const e=this.canvas;this.ctx.fillStyle="#111",this.ctx.fillRect(0,0,e.width,e.height)},updateAlphaMap:function(e){const t=this.alphaCanvas,n=this.alphaCtx;n.fillStyle="#FFF",n.fillRect(0,0,t.width,t.height),n.fillStyle="#000",n.fillRect(0,e*(512/384*64),t.width,t.height-e*(512/384*64)),this.el.getObject3D("mesh").material.alphaMap.needsUpdate=!0,this.el.getObject3D("mesh").material.needsUpdate=!0}}),window.AFRAME){const t=["search-thumbnail-atlas"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(158),i=n(29),o=n(159).map(i);if(AFRAME.registerComponent("search",{schema:{difficultyFilter:{default:"All"},genre:{default:""},playlist:{default:""},query:{default:""}},init:function(){this.eventDetail={query:"",results:o,url:"",page:0},this.keyboardEl=document.getElementById("keyboard"),this.popularHits=o,function(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}(this.popularHits),this.queryObject={hitsPerPage:0,query:""},this.el.sceneEl.addEventListener("searchclear",()=>{this.search("")})},update:function(e){this.popularHits&&(e.query&&!this.data.query&&(this.keyboardEl.components["super-keyboard"].data.value="",this.keyboardEl.components["super-keyboard"].updateTextInput("")),this.debouncedSearch=r(this.search.bind(this),1e3),(this.data.genre||this.data.playlist||this.data.query)&&this.search(this.data.query))},play:function(){this.el.sceneEl.emit("searchresults",this.eventDetail),this.search("")},events:{superkeyboardchange:function(e){e.target===this.el&&this.debouncedSearch(e.detail.value)}},search:function(e){if(!e&&"All"===this.data.difficultyFilter&&!this.data.genre&&!this.data.playlist&&this.popularHits)return this.eventDetail.results=this.popularHits,this.eventDetail.query="",void this.el.sceneEl.emit("searchresults",this.eventDetail);if(this.eventDetail.query=e,this.queryObject.query=e,this.queryObject.hitsPerPage=e?30:150,"favorites"===this.data.playlist)return this.eventDetail.results=JSON.parse(localStorage.getItem("favorites-v2")),void this.el.sceneEl.emit("searchresults",this.eventDetail);let t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&q="+encodeURIComponent(e);if(this.data.playlist)t=`https://api.beatsaver.com/playlists/id/${this.data.playlist}/CURRENT_PAGE_INDEX`;else if(this.data.genre){const e={Pop:"pop","R&B":"rb",Rap:"hip-hop-rap",Rock:"rock",Soundtrack:"tv-movie-soundtrack","Video Games":"video-game-soundtrack",Electronic:"electronic","Hip Hop":"hip-hop-rap",House:"house","J-Pop":"j-pop","K-Pop":"k-pop",Meme:"comedy-meme",Alternative:"alternative",Anime:"anime",Comedy:"comedy-meme",Dubstep:"dubstep",Dance:"dance"}[this.data.genre];t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&tags="+encodeURIComponent(e)}else if(e&&e.length<3)return;fetch(t.replaceAll("CURRENT_PAGE_INDEX",0)).then(e=>e.json()).then(e=>{var n=(e.docs||e.maps).map(i);this.eventDetail.results=n,this.eventDetail.url=t,this.eventDetail.urlPage=0,this.el.sceneEl.emit("searchresults",this.eventDetail)})}}),AFRAME.registerComponent("search-result-list",{init:function(){new MutationObserver(e=>{for(let t=0;t<e.length;t++)"data-index"===e[t].attributeName&&this.refreshLayout()}).observe(this.el,{attributes:!0,childList:!1,subtree:!0})},events:{click:function(e){this.el.sceneEl.emit("menuchallengeselect",e.target.closest(".searchResult").dataset.id,!1)}},refreshLayout:function(){this.el.emit("layoutrefresh",null,!1)}}),window.AFRAME){const t=["search","search-result-list"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,p=function(){return l.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,c,l=0,u=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function b(e){return l=e,s=setTimeout(w,t),u?v(e):a}function _(e){var n=e-c;return void 0===c||n>=t||n<0||g&&e-l>=o}function w(){var e=p();if(_(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-c);return g?d(n,o-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=i=void 0,a)}function A(){var e=p(),n=_(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return b(c);if(g)return s=setTimeout(w,t),v(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=m(t)||0,f(n)&&(u=!!n.leading,o=(g="maxWait"in n)?h(m(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),A.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},A.flush=function(){return void 0===s?a:E(p())},A}}).call(this,n(1))},function(e,t){e.exports=[{id:"43a25",name:"[Extra Sensory II] Porter Robinson - Lifelike",description:"// MAP 3 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\nthis is only the beginning...*\n\nVideo:\nhttps://www.youtube.com/watch?v=dlqYqNKcLII",uploader:{id:4340055,name:"nasafrasa",avatar:"https://cdn.beatsaver.com/avatar/16a6108559271b0c0a8d254ceb5ad43f896a0a28.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4340055/playlist"},metadata:{bpm:100.72,duration:96,songName:"Lifelike",songSubName:"",songAuthorName:"Porter Robinson",levelAuthorName:"nasafrasa"},stats:{plays:0,downloads:0,upvotes:3632,downvotes:14,score:.9918,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.030128Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0",state:"Published",createdAt:"2025-01-26T05:53:34.451213Z",sageScore:5,diffs:[{njs:16,offset:0,notes:123,bombs:0,obstacles:0,nps:1.564,length:132,characteristic:"Standard",difficulty:"Easy",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:106395,label:"Nurture",environment:"BillieEnvironment"},{njs:16,offset:0,notes:145,bombs:0,obstacles:0,nps:1.844,length:132,characteristic:"Standard",difficulty:"Normal",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:128235,label:"Lifelike",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.zip",coverURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.jpg",previewURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2025-01-27T00:42:00.509882Z",createdAt:"2025-01-26T05:53:34.451213Z",updatedAt:"2025-11-07T23:01:19.839738Z",lastPublishedAt:"2025-01-26T23:35:01.030128Z",tags:["accuracy","balanced","ambient","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a1f",name:"[Extra Sensory II] Simplifi - you",description:"// MAP 4 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\n====================================================\n\neverything you see in this map was created (from scratch!) by me\n\nlong time coming. this map represents the end of a chapter, and the start of a new one. I've been dreaming of releasing a map with Vivify almost as long as I've been a Beat Saber creative. I was stuck for so long, but I finally had a breakthrough!\n\nand it's yours to keep.\n\n====================================================\n\nproject source: https://github.com/Swifter1243/you_map\ngameplay video: https://youtu.be/2SgLtmqxu-k \nExtra Sensory II website: https://exsii.totalbs.dev/",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:70,duration:157,songName:"you",songSubName:"",songAuthorName:"Simplifi",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:5380,downvotes:28,score:.9914,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.797228Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d265d40935983502ad6f05ddeb5417f3e37c2290",state:"Published",createdAt:"2025-01-26T04:23:47.346441Z",sageScore:3,diffs:[{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Normal",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140835,environment:"BillieEnvironment"},{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140675,environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.zip",coverURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.jpg",previewURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.mp3"}],curator:{id:4331555,name:"TheBlackParrot",avatar:"https://cdn.beatsaver.com/avatar/213097af5fb746f71825aad761723951ce4807ab.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4331555/playlist"},curatedAt:"2025-01-26T23:47:25.274685Z",createdAt:"2025-01-26T04:23:47.346441Z",updatedAt:"2025-02-09T02:00:19.217070Z",lastPublishedAt:"2025-01-26T23:35:01.797228Z",tags:["electronic","accuracy"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b6",name:"[Electro Swing Pack] The Electric Swing Circus - Empires",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/WJy6_2cTPYg\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:173,songName:"Empires",songSubName:"",songAuthorName:"The Electric Swing Circus",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:5096,downvotes:31,score:.9905,reviews:2},uploaded:"2021-07-08T15:24:55.769Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cecc89118b3a75ea7d65ceff5949b3ef19fea716",key:"1a0b6",state:"Published",createdAt:"2021-07-08T15:24:55.769Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:522,bombs:0,obstacles:24,nps:3.173,length:329,characteristic:"Standard",difficulty:"Expert",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:823,bombs:0,obstacles:0,nps:5.003,length:329,characteristic:"Standard",difficulty:"ExpertPlus",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:749915,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.zip",coverURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.jpg",previewURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.mp3"}],curator:{id:57657,name:"Pixelguy",hash:"5cff0b7698cc5a672c8541a8",avatar:"https://cdn.beatsaver.com/avatar/57657.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/57657/playlist"},curatedAt:"2021-07-08T15:24:55.769Z",createdAt:"2021-07-08T15:24:55.769Z",updatedAt:"2024-11-02T11:17:18.878282Z",lastPublishedAt:"2021-07-08T15:24:55.769Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1e6ff",name:"{Modchart} acloudyskye - Somewhere Out There",description:"MAP 10. https://beatsaver.com/playlists/8713\n\nWhat can I say about this map.\n\nI feel like this is the culmination of everything thats happened for modcharting this entire year. All of the advancements I've made with environments, mawntee has made with notemods, and reddek has made with walls come together into this piece that I can only describe as the next step. \n\nI really hope everyone enjoys this one. It's one of a kind.\n\nVideo: https://www.youtube.com/watch?v=rphHsDxJbpg",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:160,duration:323,songName:"Somewhere Out There",songSubName:"",songAuthorName:"acloudyskye",levelAuthorName:"Swifter, Mawntee, Reddek"},stats:{plays:0,downloads:0,upvotes:20023,downvotes:170,score:.9901,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2021-11-30T01:27:30.018531Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"448d219117992026eb23c98dc920ce73a912f289",state:"Published",createdAt:"2022-09-26T15:58:45.498795Z",sageScore:1,diffs:[{njs:19,offset:-.5,notes:892,bombs:8,obstacles:3746,nps:2.973,length:800,characteristic:"Standard",difficulty:"Expert",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:0,warns:0,resets:0},maxScore:813395,label:"Experience Recommended",environment:"BTSEnvironment"},{njs:19,offset:-.5,notes:1134,bombs:8,obstacles:3530,nps:3.78,length:800,characteristic:"Lawless",difficulty:"ExpertPlus",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:719,warns:26,resets:1},maxScore:1036035,label:"Busier Mapping",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.zip",coverURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.jpg",previewURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.mp3"}],curator:{id:4284942,name:"blackjack",hash:"5e96ca3a16c96800062400fe",avatar:"https://cdn.beatsaver.com/avatar/dcd6d334252b91670180855821886983a1818f4a.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284942/playlist"},curatedAt:"2021-11-30T01:27:30.018531Z",createdAt:"2021-11-30T01:03:02.982731Z",updatedAt:"2023-08-26T19:08:38.528705Z",lastPublishedAt:"2022-09-26T16:01:29.467930Z",tags:["pop","balanced"],bookmarked:!1,collaborators:[{id:4233941,name:"reddek",hash:"5dbfb4426dea0b0006bd328d",avatar:"https://cdn.beatsaver.com/avatar/fc462a26fa97d9b2fdadbdf5d7a45ef75026f8e9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4233941/playlist"},{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d7fa",name:"Geoxor - Gloom [Wallmap]",description:"REUPLOAD due to last minute mapping error\n\nSpecial thanks to:\nNyri0 - For providing scripts that were crucial to making this map possible, and for helping me along the way.\nLayanmeta - For giving me so much encouragement throughout the final stages and making a brilliant YouTube video on this map.\nBSMG discord - For the continued support throughout the development process\nAll you people/birds - For playing my map :D\n\nBRIAN HAS BECOME SENTIENT. ALL HAIL BRIAN",uploader:{id:18761,name:"minething",hash:"5e9b4ead16c9680006287387",avatar:"https://www.gravatar.com/avatar/f9bed76044f22e33e287d984993c59797049f1315d399c641b1ea7778975c926?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/18761/playlist"},metadata:{bpm:93,duration:167,songName:"Gloom",songSubName:"",songAuthorName:"Geoxor",levelAuthorName:"Mine Thing"},stats:{plays:0,downloads:0,upvotes:9917,downvotes:81,score:.9896,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-08-16T19:13:40.774Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"823b4e880baac024728ae96a7c20e28026c4585d",key:"d7fa",state:"Published",createdAt:"2020-08-16T19:13:40.774Z",sageScore:3,diffs:[{njs:12,offset:6,notes:0,bombs:0,obstacles:15605,nps:0,length:0,characteristic:"Standard",difficulty:"Easy",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"RocketEnvironment"},{njs:12,offset:6,notes:202,bombs:0,obstacles:15605,nps:1.309,length:239.125,characteristic:"Standard",difficulty:"Hard",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.274,paritySummary:{errors:48,warns:6,resets:0},maxScore:178595,environment:"RocketEnvironment"},{njs:12,offset:6,notes:411,bombs:4,obstacles:15605,nps:2.665,length:239,characteristic:"Standard",difficulty:"Expert",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,environment:"RocketEnvironment"},{njs:12,offset:3,notes:411,bombs:4,obstacles:12340,nps:2.665,length:239,characteristic:"Standard",difficulty:"ExpertPlus",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,label:"Less Lag",environment:"RocketEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.zip",coverURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.jpg",previewURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-16T19:13:40.774Z",createdAt:"2020-08-16T19:13:40.774Z",updatedAt:"2020-08-16T19:13:40.774Z",lastPublishedAt:"2020-08-16T19:13:40.774Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a24",name:"[Extra Sensory II] Andrew Prahlow - End Times",description:"// MAP 2 OF EXTRA SENSORY II\n[https://beatsaver.com/playlists/797071]\n\n=================================================\n\nFirst off, I just want to say thank you. Thank you to the entire TotalBS team (Especially Swifter and Aeroluna) for giving me a chance with this project. When I started on this map, I honestly never thought it would turn into anything like this. At first, it was just going to be something simple with the sun, stars, and you. But as I kept learning more about Unity and Vivify, the project just kept growing little by little, until it became what it is now.\n\nI’ve gotta give a special shoutout to Swifter for helping so much with the shaders, and to Aeroluna for making the custom UI possible. Without those two, this map would not have been able to become what it is now.\n\nOver the past year or so working on this, I feel like my goals and what I want in life have completely shifted. I’ve got more drive and motivation now than I’ve ever had before, and I’m so thankful for that.\n\nI'd like to also thank my closest friend, Azushii, for introducing me to Outer Wilds and encouraging me to start this map in the first place. Rest in peace buddy.. <3\n\n=================================================\nCustom Saber Model: [Coming Soon]\nCustom Note Model: [Coming Soon]\nProject Source: [Coming Soon]\nGameplay Video: https://youtu.be/YtETILVC4V4\nExtra Sensory II Website: https://exsii.totalbs.dev/",uploader:{id:70911,name:"Chaimzy",hash:"605ae0535ab13d000609b331",avatar:"https://cdn.beatsaver.com/avatar/70911.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/70911/playlist"},metadata:{bpm:128,duration:157,songName:"End Times",songSubName:"Outer Wilds",songAuthorName:"Andrew Prahlow",levelAuthorName:"Chaimzy"},stats:{plays:0,downloads:0,upvotes:3127,downvotes:20,score:.9889,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.057933Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b4acc042f6541c06e57a384fa9796a10c45ff558",state:"Published",createdAt:"2025-01-26T05:32:44.984680Z",sageScore:3,diffs:[{njs:16,offset:0,notes:32,bombs:8,obstacles:0,nps:.533,length:128,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:60,paritySummary:{errors:0,warns:0,resets:0},maxScore:22195,label:"There's more to explore here",environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.zip",coverURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.jpg",previewURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.mp3"}],curator:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},curatedAt:"2025-01-27T00:06:25.521273Z",createdAt:"2025-01-26T05:32:44.984680Z",updatedAt:"2025-01-30T01:51:28.961316Z",lastPublishedAt:"2025-01-26T23:35:01.057934Z",tags:["accuracy","ambient","video-game-soundtrack"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d4a5",name:"[FUTURE FUNK PACK] Shiawase No Monosashi (VANTAGE // Short Ver.)",description:'FUTURE FUNK MAP PACK\n2 songs uploaded everyday through August 10th - 14th!\n\n"Shiawase No Monosashi" is performed by Mariya Takeuchi. This version of the song is a short edit I made from VANTAGE //\'s edit. The original length of the song is 5 minutes long\n\nPlease look forward to the upcoming maps!\n\nDM any feedback on Discord\nETAN#8341',uploader:{id:4235140,name:"ETAN",hash:"5cff0b7798cc5a672c855775",avatar:"https://cdn.beatsaver.com/avatar/652a9b5d335007c8668b43aa727c75e84794dbe1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4235140/playlist"},metadata:{bpm:128,duration:171,songName:"Shiawase No Monosashi",songSubName:"(VANTAGE // Short Ver.)",songAuthorName:"Mariya Takeuchi",levelAuthorName:"ETAN"},stats:{plays:0,downloads:0,upvotes:9325,downvotes:95,score:.9876,reviews:2},uploaded:"2020-08-12T18:17:44.285Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d7cb32f23041dec272de3da0ac141dd8f91478ca",key:"d4a5",state:"Published",createdAt:"2020-08-12T18:17:44.285Z",sageScore:7,diffs:[{njs:10,offset:1,notes:168,bombs:16,obstacles:1,nps:1.029,length:348.25,characteristic:"Standard",difficulty:"Easy",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:147315,environment:"BigMirrorEnvironment"},{njs:11,offset:1,notes:255,bombs:16,obstacles:1,nps:1.562,length:348.25,characteristic:"Standard",difficulty:"Normal",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:1,warns:1,resets:0},maxScore:227355,environment:"BigMirrorEnvironment"},{njs:12,offset:1,notes:358,bombs:16,obstacles:1,nps:2.193,length:348.25,characteristic:"Standard",difficulty:"Hard",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:322115,environment:"BigMirrorEnvironment"},{njs:15,offset:0,notes:557,bombs:16,obstacles:1,nps:3.335,length:356.25,characteristic:"Standard",difficulty:"Expert",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:505195,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:778,bombs:16,obstacles:1,nps:4.659,length:356.25,characteristic:"Standard",difficulty:"ExpertPlus",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:708515,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.zip",coverURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.jpg",previewURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-12T18:17:44.285Z",createdAt:"2020-08-12T18:17:44.285Z",updatedAt:"2020-08-12T18:17:44.285Z",lastPublishedAt:"2020-08-12T18:17:44.285Z",tags:["j-pop","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4968d",name:"{Vivify} Jaron - 743⁺Aether*✧ ˳ ⁎ ¹¹¹} ⁺ . ˳",description:"**Originally, this map was going to be my Extra Sensory II map.**\n\nHowever, given the insane density of this song, it demanded rapidly changing visuals that kept up with how dynamic it felt to listen to. I did not have the technical or artistic skill to pull off this song. I tried and failed, for 3 years. Finally, after executing Extra Sensory II this year, I realized it was time to tackle this behemoth of a project. This project took over ~350 hours, and 1000 repository commits. The majority of it was put together over the last 3 months.\n\nI really think that I executed on this vision to a tee, landing every single visual cue that I imagined ever since I heard the song for the first time in 2022. I hope you can feel the electricity of this experience <3\n\n✧\n\n**Special Thanks:**\n- **Frautcres** - Doing extensive technical performance investigations in order to make the map run without a hitch, as well as assisting with technical difficulties\n- **Chaimzy, Astra, HAMCORE, Mawntee, TheBlackParrot, TinyPawb, Klondike, RidgeVR, UGEcko** - Doing loads of playtesting and giving feedback to make the map feel as polished as it does\n- **SKYZA.** - Beautiful ribbon & saber textures\n- **Jaron** - Creating this incredible song, and supporting me over the years as I tried to make visuals that shaped up\n\nvideo: https://youtu.be/qZ1prxep0Wc\nproject source: https://github.com/Swifter1243/aether_map",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:145,duration:274,songName:"743+Aether*✧ . * 111} + , .",songSubName:"",songAuthorName:"Jaron",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:2252,downvotes:15,score:.9876,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2025-08-14T16:00:00.354832Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cc66335f2b8bf50fe49591dd925860b2e596018e",state:"Published",createdAt:"2025-08-14T16:13:20.156249Z",sageScore:3,diffs:[{njs:12,offset:-.5,notes:444,bombs:0,obstacles:0,nps:1.698,length:632,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:401235,label:"✧",environment:"BillieEnvironment"},{njs:16,offset:-.5,notes:703,bombs:0,obstacles:0,nps:2.688,length:632,characteristic:"Lawless",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:639515,label:"\\___*",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.zip",coverURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.jpg",previewURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.mp3"}],curator:{id:4285538,name:"Darkrealm7",hash:"5ffa2803f2cdd000075e24ed",avatar:"https://cdn.beatsaver.com/avatar/7b66a32ba61dcfb938aa0d2207911eb08d28a06f.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285538/playlist"},curatedAt:"2025-08-14T21:11:11.210516Z",createdAt:"2025-08-14T04:02:49.366190Z",updatedAt:"2025-08-20T16:41:30.561039Z",lastPublishedAt:"2025-08-20T16:41:30.561039Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1362d",name:"Ghost Choir - Louie Zong (modchart)",description:"This is a relaxing modchart and a technical proof of concept. If you haven't played my modchart Dondante yet, please check it out: https://beatsaver.com/beatmap/123b5\r\n\r\nThe map requires the mods Noodle Extensions and Chroma. If Noodle Extensions is not available yet on ModAssistant, you can get the latest release at https://github.com/Aeroluna/NoodleExtensions/releases/tag/v1.3.5\r\n\r\nTips for a better experience:\r\n- Disable static lights; there are no lights anyway\r\n- Hide the HUD\r\n- Turn the SFX volume down (0 or low value like 0.2)\r\n- Enable bloom post-processing\r\n\r\nPreview: https://youtu.be/XC7RY9C_EHs\r\n\r\nI adapted this from Louie Zong's original animation: https://youtu.be/kXF3VYYa5TI\r\n\r\n",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:67,duration:90,songName:"Ghost Choir",songSubName:"",songAuthorName:"Louie Zong",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4478,downvotes:42,score:.987,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-30T12:31:29.825Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"1d373506c0b2b82867411f18696a1ad53d4ea01d",key:"1362d",state:"Published",createdAt:"2021-01-30T12:31:29.825Z",sageScore:2,diffs:[{njs:14,offset:0,notes:138,bombs:0,obstacles:1460,nps:1.684,length:91.5,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:81.94,paritySummary:{errors:4,warns:3,resets:0},maxScore:119715,label:"Oooo",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.zip",coverURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.jpg",previewURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.mp3"}],createdAt:"2021-01-30T12:31:29.825Z",updatedAt:"2021-01-30T12:31:29.825Z",lastPublishedAt:"2021-01-30T12:31:29.825Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"198f3",name:"Spider Dance - Toby Fox (Undertale modchart)",description:"There are countless Undertale maps on Beat Saber, but what if you could actually experience a real boss fight? It's now possible thanks to Noodle Extensions, and I'm proud to present to you the first Undertale modchart: Spider Dance, where you will confront Muffet.\r\n\r\nTips for a better experience:\r\n- Don't use static lights; there shouldn't be any lights\r\n- Hide the HUD in player settings\r\n- Enable \"bloom post-processing\"\r\n- Enable \"screen distortion effects\"\r\n\r\nInstallation instructions:\r\n- You will need Noodle Extensions and Chroma and their dependencies. All are now available on ModAssistant.\r\n- If you read this in a future where the update broke the mods and they haven't been approved on ModAssistant yet, install the basic mods from ModAssistant and get the latest releases of Noodle Extensions, Heck, and Chroma from Aeroluna's GitHub: https://github.com/Aeroluna\r\n\r\nVideo: https://youtu.be/fy8KmUor6fI\r\n\r\nI started this a while ago before Ghost Choir and then abandoned the project. But I finally decided to finish the work, so I hope you'll enjoy it :)\r\nThanks to Reaxt and Cyansnow, who testplayed and made detailed suggestions that helped me improve the quality of this map. I really appreciate it.\r\n\r\nMy social media links (please follow/subscribe): https://linktr.ee/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:115,duration:114,songName:"Spider Dance",songSubName:"",songAuthorName:"Toby Fox",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:10995,downvotes:123,score:.9868,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-06-25T17:47:40.296Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"09246637fa63ac55aa518718fd1eb4b876960480",key:"198f3",state:"Published",createdAt:"2021-06-25T17:47:40.296Z",sageScore:2,diffs:[{njs:16,offset:0,notes:434,bombs:88,obstacles:1153,nps:4.377,length:190.063,characteristic:"Standard",difficulty:"ExpertPlus",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:99.163,paritySummary:{errors:13,warns:13,resets:0},maxScore:392035,label:"9999G",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.zip",coverURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.jpg",previewURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-06-25T17:47:40.296Z",createdAt:"2021-06-25T17:47:40.296Z",updatedAt:"2021-06-25T17:47:40.296Z",lastPublishedAt:"2021-06-25T17:47:40.296Z",tags:["electronic","video-game-soundtrack","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"23f6b",name:"acloudyskye & N33T - Nothing Else (Modchart)",description:"9 months ago I created my first chroma map. At this time I didn't think I could make a map that you are about to play\nIn these 9 months, I learned a lot about walls, notes, environment enhancement, etc... but mostly how to properly polish a map.\nI wanted to make something big, something even bigger than SOT(as in scale swifter silly u) and here I am today publishing this map.\nThis map contains 7 different unique environments that connect together with seamless transitions.\nThis map is a big step in the journey of modhcarts just like SOT.\nI hope more people will see this modhcart as a place they can start and learn Noodle Extensions, You can also check the script of the modhcart on my Github. https://github.com/TzurS11/NoodleScript/tree/main/Examples/Scripts\n\nLastly, I wanna thank all the people that helped. even if you are not on this list I appreciate What you've done a lot!\n@GojiCrafter, @tall_chilis_boi, @Swifter, @Mawntee, Stick, kiwii.\n\nShowcase: https://youtu.be/qkSe0gOctEU\n\nbtw HAHA get fucked swifter! I got more environments than in SOT",uploader:{id:4284455,name:"TzurS11",hash:"6040a8135ab13d0006093512",avatar:"https://cdn.beatsaver.com/avatar/87d26d1223ba8840e9dca8d433165f717e7584e1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284455/playlist"},metadata:{bpm:125,duration:291,songName:"Nothing Else",songSubName:"",songAuthorName:"acloudyskye & N33T",levelAuthorName:"TzurS11"},stats:{plays:0,downloads:0,upvotes:2949,downvotes:25,score:.9867,reviews:3},uploaded:"2022-04-10T19:30:00.565807Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"e45b69a9428505e93f73f1bdc43909d43fc844e3",state:"Published",createdAt:"2022-04-10T20:32:24.193634Z",sageScore:3,diffs:[{njs:16,offset:0,notes:919,bombs:0,obstacles:0,nps:3.298,length:580.5,characteristic:"Standard",difficulty:"ExpertPlus",events:18391,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:278.64,paritySummary:{errors:25,warns:13,resets:0},maxScore:838235,label:"You can hide away the fears you face\n\nRead Warnings!",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.zip",coverURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.jpg",previewURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-04-10T20:55:22.272218Z",createdAt:"2022-04-05T14:25:21.240039Z",updatedAt:"2022-08-25T11:32:19.554653Z",lastPublishedAt:"2022-04-10T20:32:58.830331Z",tags:["balanced","electronic","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"32693",name:"Fall Out Boy - The Phoenix",description:"Might be one of my most accessible mapsets yet as a custom-lit full spread of difficulties paired with both a lawless expert+ and one saber difficulties! Made this one for a friend of mine who's a big FoB fan. Enjoy!\n\nFeedback via reviews down below is always appreciated!\n\nPreview: https://youtu.be/2LFQLJd0pOQ\n\nSocials:\nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:138,duration:246,songName:"The Phoenix",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:5122,downvotes:52,score:.9865,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2023-05-31T23:01:59.709120Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf2c367d29b133b66dc27f6f8e20467d0ec3301f",state:"Published",createdAt:"2023-05-31T22:51:42.410637Z",sageScore:5,diffs:[{njs:10,offset:-.95,notes:494,bombs:0,obstacles:44,nps:2.055,length:553,characteristic:"Standard",difficulty:"Easy",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:447235,blStars:2.56,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:545,bombs:0,obstacles:38,nps:2.267,length:553,characteristic:"Standard",difficulty:"Normal",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:494155,blStars:3.04,environment:"NiceEnvironment"},{njs:14,offset:-.2,notes:767,bombs:0,obstacles:6,nps:3.19,length:553,characteristic:"Standard",difficulty:"Hard",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:700075,blStars:4.07,environment:"NiceEnvironment"},{njs:15,offset:-.475,notes:851,bombs:0,obstacles:9,nps:3.539,length:553,characteristic:"Standard",difficulty:"Expert",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:779035,blStars:4.86,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1384,bombs:0,obstacles:4,nps:5.756,length:553,characteristic:"Standard",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1272275,blStars:6.51,environment:"NiceEnvironment"},{njs:16,offset:-.65,notes:816,bombs:0,obstacles:29,nps:3.394,length:553,characteristic:"OneSaber",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:743475,blStars:8.35,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1388,bombs:0,obstacles:4,nps:5.773,length:553,characteristic:"Lawless",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1275955,label:"Double Downs",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.zip",coverURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2023-06-01T02:16:21.699148Z",createdAt:"2023-05-16T06:12:18.475582Z",updatedAt:"2024-08-27T09:34:28.073772Z",lastPublishedAt:"2023-05-31T23:01:59.709120Z",tags:["dance-style","pop","punk"],bookmarked:!1,declaredAi:"None",blRanked:!0,blQualified:!1},{id:"1dcf4",name:"DYES IWASAKI - Bad Hatter ft. Lily Mizusaki",description:'Part of my second custom map pack!\n\nGameplay preview:\nhttps://www.youtube.com/watch?v=ZE5enFMVsv8\n\nGet the pack here:\nhttps://bsaber.com/tokyo-neo-swing/\n\nThis time around I took the extra time and made full spreads and chroma lightshows for each of the 6 songs of the album "Tokyo Neo Swing" by DYES IWASAKI & Lily Mizusaki.\n\nHuge thanks to the lovely playtesters MaybeeMae, Cocci, Monstor, Vaser888, and Kansas!\n\nAlso here is my playthrough of the entire pack on Expert Plus:\nhttps://www.youtube.com/watch?v=lgXR4sBl_kk\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/',uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:122,duration:176,songName:"Bad Hatter",songSubName:"(ft. Lily Mizusaki)",songAuthorName:"DYES IWASAKI",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4470,downvotes:44,score:.9865,reviews:3},uploaded:"2021-11-11T13:06:30.332180Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"ebcf0c8780551bfe0feb96fbc255accad548798b",state:"Published",createdAt:"2021-11-14T11:39:03.473167Z",sageScore:6,diffs:[{njs:12,offset:1,notes:212,bombs:0,obstacles:0,nps:1.249,length:345.167,characteristic:"Standard",difficulty:"Easy",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:46,warns:12,resets:0},maxScore:187795,environment:"FitBeatEnvironment"},{njs:12,offset:.5,notes:320,bombs:0,obstacles:0,nps:1.885,length:345.167,characteristic:"Standard",difficulty:"Normal",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:29,warns:14,resets:0},maxScore:287155,environment:"FitBeatEnvironment"},{njs:14,offset:0,notes:491,bombs:0,obstacles:2,nps:2.89,length:345.5,characteristic:"Standard",difficulty:"Hard",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:4,warns:0,resets:0},maxScore:444475,environment:"FitBeatEnvironment"},{njs:16,offset:-.5,notes:697,bombs:0,obstacles:0,nps:4.102,length:345.5,characteristic:"Standard",difficulty:"Expert",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:9,resets:0},maxScore:633995,environment:"FitBeatEnvironment"},{njs:19,offset:.25,notes:924,bombs:0,obstacles:0,nps:5.438,length:345.5,characteristic:"Standard",difficulty:"ExpertPlus",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:0,resets:0},maxScore:842835,environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.zip",coverURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.jpg",previewURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2021-11-11T13:06:30.332180Z",createdAt:"2021-11-10T18:01:16.390803Z",updatedAt:"2024-11-02T11:19:03.182227Z",lastPublishedAt:"2021-11-14T11:39:08.754762Z",tags:["swing","dance-style","balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b7aa",name:"Powerwolf - Venom of Venus",description:"Back to my more regular style, Powerwolf is a power-metal band that perform around the themes of werewolves and religion, a strange but interesting mixture.\r\n\r\nEx+ has a no-colours mode for those who wish to play without the custom block colours, but unfortunately I can't fit such an option for all difficulties.\r\n\r\nNormal 1.85 NPS\r\nHard 3.15 NPS\r\nExpert 4.43 NPS\r\nExpert+ 5.11 NPS\r\n\r\nThere is no easy difficulty, as that I needed the slot for the no-colour mode.",uploader:{id:4285369,name:"Cyrix",hash:"5eb6eb9a7abb000006c85add",avatar:"https://cdn.beatsaver.com/avatar/4213c7b05b9778149ae4536dd10842c6ed307ec5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285369/playlist"},metadata:{bpm:164,duration:211,songName:"Venom of Venus",songSubName:"",songAuthorName:"Powerwolf",levelAuthorName:"Cyrix"},stats:{plays:0,downloads:0,upvotes:8e3,downvotes:91,score:.9862,reviews:14,sentiment:"VERY_POSITIVE"},uploaded:"2020-06-29T18:24:10.081Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f88b43c770dcd85a4ba18368853fbf062d41a09c",key:"b7aa",state:"Published",createdAt:"2020-06-29T18:24:10.081Z",sageScore:7,diffs:[{njs:12,offset:.5,notes:392,bombs:0,obstacles:63,nps:1.948,length:549.938,characteristic:"Standard",difficulty:"Easy",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:44,warns:15,resets:0},maxScore:353395,label:"Normal",environment:"PanicEnvironment"},{njs:13,offset:1,notes:666,bombs:8,obstacles:36,nps:3.31,length:549.938,characteristic:"Standard",difficulty:"Normal",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:1,warns:0,resets:1},maxScore:605475,label:"Hard",environment:"PanicEnvironment"},{njs:17,offset:0,notes:934,bombs:9,obstacles:7,nps:4.642,length:549.938,characteristic:"Standard",difficulty:"Hard",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:0,warns:0,resets:2},maxScore:852035,label:"Ex",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"Expert",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+ No Colour",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"ExpertPlus",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.zip",coverURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.jpg",previewURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-06-29T18:24:10.081Z",createdAt:"2020-06-29T18:24:10.081Z",updatedAt:"2020-06-29T18:24:10.081Z",lastPublishedAt:"2020-06-29T18:24:10.081Z",tags:["metal","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"210e3",name:"[Modchart] Sarah Cothran - As The World Caves In",description:"This started out as just a simple environment animation test, and then quickly snowballed out into one of my favourite maps I've made so far!\n\nAlso big ups to Fatalution for doing the lighting on this!\nThis is our first collab together, and the first time I've collaborated on a map with someone who shared the same ideas/thought process as myself. \nThis definitely won't be our last collab :)\n\nCheck out their profile and lightshow preview here:\nhttps://beatsaver.com/profile/84945\nhttps://youtu.be/1Fh5jL_UJBc\n\n\nWARNING:\nThis map may cause mild motion sickness! \nIf you feel sick at any point, remember that you can pause and it will stop everything!\n\n(If you have frequent issues with motion sickness in VR, I recommend having a fan on, or keeping smaller carpet with a different texture in your playspace)",uploader:{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"},metadata:{bpm:124,duration:164,songName:"As The World Caves In",songSubName:"",songAuthorName:"Sarah Cothran",levelAuthorName:"Mawntee & Fatalution"},stats:{plays:0,downloads:0,upvotes:8562,downvotes:100,score:.986,reviews:22,sentiment:"VERY_POSITIVE"},uploaded:"2022-02-02T20:18:54.976546Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d4d847465bff16bc936e8281b5e3c703a4ca1c93",state:"Published",createdAt:"2022-02-02T20:27:55.445283Z",sageScore:4,diffs:[{njs:18,offset:1.961111,notes:259,bombs:20,obstacles:0,nps:1.63,length:328.466,characteristic:"Standard",difficulty:"ExpertPlus",events:31028,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:158.935,paritySummary:{errors:403,warns:36,resets:11},maxScore:231035,label:"Our Final Night Alive",environment:"TimbalandEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.zip",coverURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.jpg",previewURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.mp3"}],curator:{id:4234800,name:"AllieeCute",avatar:"https://cdn.beatsaver.com/avatar/f3788635ba87f3e1144e26501fe02c26b29aaccc.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4234800/playlist"},curatedAt:"2022-02-02T20:18:54.976546Z",createdAt:"2022-02-02T20:07:53.311141Z",updatedAt:"2023-10-16T18:16:00.863418Z",lastPublishedAt:"2023-06-06T14:03:19.315272Z",tags:["accuracy","dance-style"],bookmarked:!1,collaborators:[{id:84945,name:"fatalution",hash:"5cff0b7398cc5a672c84f30a",avatar:"https://cdn.beatsaver.com/avatar/7b7e7792dd5a8b250b5205c3a823d7d4006182f5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/84945/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"352d8",name:"Belle - Lend Me Your Voice [Noodle Extension, Chrom+] (Remastered!!!)",description:'If you are seasick in VR, do not play the "ALL EFFECTS" and "NO rotation (360 °)". For you, difficulty - "NO effects"\n\nIf there are performance problems disable "Mirror" in the graphics settings\n\nSong - https://music.youtube.com/watch?v=nSbhUCM5Z6s',uploader:{id:4284370,name:"hickeychan",hash:"6001ba1539ce5b000682a59f",avatar:"https://cdn.beatsaver.com/avatar/ecb540d442d3dbcd21881c32b050977d282a7438.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284370/playlist"},metadata:{bpm:121,duration:304,songName:"Lend Me Your Voice",songSubName:"",songAuthorName:"Kaho Nakamura",levelAuthorName:"HickeyChan"},stats:{plays:0,downloads:0,upvotes:1156,downvotes:6,score:.9859,reviews:3},uploaded:"2023-08-24T10:14:50.865197Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"be0ab6e5f1b5581a9a053f4a4c144c785696d349",state:"Published",createdAt:"2023-08-24T10:12:42.966966Z",sageScore:1,diffs:[{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Hard",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO effects",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Expert",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO rotation (360 °)",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"ExpertPlus",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"ALL EFFECTS",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.zip",coverURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.jpg",previewURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2023-08-25T06:09:54.756879Z",createdAt:"2023-08-24T10:12:42.966966Z",updatedAt:"2023-09-04T05:38:48.731043Z",lastPublishedAt:"2023-08-24T10:14:50.865197Z",tags:["accuracy","balanced","anime","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b8",name:"[Electro Swing Pack] Wolfgang Lohr & The Swinghoppers - Party Like It's 1920",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/ye22W_xrXnk\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:187,songName:"Party Like It's 1920",songSubName:"",songAuthorName:"The Swinghoppers & Wolfgang Lohr",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4194,downvotes:45,score:.9855,reviews:1},uploaded:"2021-07-08T15:25:28.451Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"973bab980b568e41b0a17a772e61377b01ef85ec",key:"1a0b8",state:"Published",createdAt:"2021-07-08T15:25:28.451Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:556,bombs:0,obstacles:0,nps:3.063,length:363,characteristic:"Standard",difficulty:"Expert",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:504275,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:850,bombs:0,obstacles:0,nps:4.683,length:363,characteristic:"Standard",difficulty:"ExpertPlus",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:774755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.zip",coverURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.jpg",previewURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:25:28.451Z",createdAt:"2021-07-08T15:25:28.451Z",updatedAt:"2024-11-02T11:17:34.643709Z",lastPublishedAt:"2021-07-08T15:25:28.451Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1181f",name:"Royal & the Serpent - Overwhelmed",description:"Feeling that finals crunch? Worried about the pandemic? General anxiety with the news, and just feeling overwhelmed? Don't forget to take a step back and take a breath. Maybe by dancing along to this song that perfectly captures all of those feelings! Complete with overwhelming Chroma 2.0 lights! And now the extra details:\n\nBPM: 87\nNPS: Ez - 1.71; N - 2.09; H - 2.75; Ex - 3.19; Ex+ - 4.11\nNotes: Ez - 277; N - 338; H - 444; Ex - 516; Ex+ - 664\nBombs: Ez - 0; N - 0; H - 4; Ex - 4; Ex+ - 4\nWalls: Ez - 136; N - 134; H - 144; Ex - 109; Ex+ - 109\n\nSpecial thanks to qwasyx, Smay, and Cyrix for playtesting!",uploader:{id:4285188,name:"fruhead",hash:"5cff0b7598cc5a672c852683",avatar:"https://cdn.beatsaver.com/avatar/bcfbb8e5ac8665ae28d37b76a402daf0b88a68d0.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285188/playlist"},metadata:{bpm:87,duration:161,songName:"Overwhelmed",songSubName:"",songAuthorName:"Royal & the Serpent",levelAuthorName:"fruhead"},stats:{plays:0,downloads:0,upvotes:7135,downvotes:85,score:.9854,reviews:4},uploaded:"2020-11-29T23:09:47.309Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b748894960a346f1568b9f4876643f1358cfa897",key:"1181f",state:"Published",createdAt:"2020-11-29T23:09:47.309Z",sageScore:6,diffs:[{njs:10,offset:0,notes:277,bombs:0,obstacles:136,nps:1.793,length:224,characteristic:"Standard",difficulty:"Easy",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:43,warns:9,resets:0},maxScore:247595,environment:"PanicEnvironment"},{njs:12,offset:-.3,notes:338,bombs:0,obstacles:134,nps:2.188,length:224,characteristic:"Standard",difficulty:"Normal",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:22,warns:11,resets:0},maxScore:303715,environment:"PanicEnvironment"},{njs:14,offset:.4,notes:444,bombs:4,obstacles:144,nps:2.874,length:224,characteristic:"Standard",difficulty:"Hard",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:14,warns:4,resets:4},maxScore:401235,environment:"PanicEnvironment"},{njs:16,offset:.25,notes:516,bombs:4,obstacles:109,nps:3.34,length:224,characteristic:"Standard",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:467475,environment:"PanicEnvironment"},{njs:18,offset:.1,notes:664,bombs:4,obstacles:109,nps:4.298,length:224,characteristic:"Standard",difficulty:"ExpertPlus",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:603635,environment:"PanicEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Overwhelmed",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.zip",coverURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.jpg",previewURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.mp3"}],curator:{id:76372,name:"brightknight",hash:"5f30421b8a13d900061fe595",avatar:"https://cdn.beatsaver.com/avatar/236b93ff0df8c0f0305e52b6d3d01fa3e588b7ec.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/76372/playlist"},curatedAt:"2020-11-29T23:09:47.309Z",createdAt:"2020-11-29T23:09:47.309Z",updatedAt:"2020-11-29T23:09:47.309Z",lastPublishedAt:"2020-11-29T23:09:47.309Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4980",name:"(Old Version) Paradise - Coldplay",description:"\"Paradise\" is a song by the British rock band Coldplay. The song was released on 12 September 2011. I kinda like this song for relaxing on long car rides and I don't know how it will feel as a beat saber map but I'ma try mapping it anyways. So here it is :)\n\n2022 EDIT: Download the new map here: https://beatsaver.com/maps/28102",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:70,duration:278,songName:"Paradise",songSubName:"",songAuthorName:"Coldplay",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:6216,downvotes:74,score:.9852,reviews:1},uploaded:"2019-04-30T05:45:51Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b14639af36673a43fe32bc7563619deff438d438",key:"4980",state:"Published",createdAt:"2019-04-30T05:45:51Z",sageScore:6,diffs:[{njs:13,offset:0,notes:1023,bombs:0,obstacles:35,nps:3.816,length:312.75,characteristic:"Standard",difficulty:"Expert",events:4651,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:268.071,paritySummary:{errors:28,warns:29,resets:0},maxScore:933915,environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.zip",coverURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.jpg",previewURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2019-04-30T05:45:51Z",createdAt:"2019-04-30T05:45:51Z",updatedAt:"2022-07-22T08:36:01.092595Z",lastPublishedAt:"2019-04-30T05:45:51Z",tags:["alternative","indie"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"bdc7",name:"That's Life - Frank Sinatra",description:"Here is an honest-to-goodness human-mapped version of Frank Sinatra's 1966 hit, That's Life. This song is way too good to just have a crappy beat sage map.\n\nNormal and Hard Standard levels, and Expert Standard, 90, and 360 levels. Note that the expert levels are all essentially the same, just with varying degrees of wobbles.\n\nThanks to Maybeemae for the playtests!\n\nhttps://youtu.be/QXjj2-fgK8U",uploader:{id:78593,name:"techbutterfly",hash:"5cff0b7798cc5a672c8566f7",avatar:"https://cdn.beatsaver.com/avatar/99c0065fcfac5bfcf11adc69a58a8d3251bd748e.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/78593/playlist"},metadata:{bpm:77,duration:187,songName:"That's Life",songSubName:"",songAuthorName:"Frank Sinatra",levelAuthorName:"TechButterfly"},stats:{plays:0,downloads:0,upvotes:3713,downvotes:40,score:.9851,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-07-11T22:35:42.033Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7cca8c1afecd782cfd74f158c312201b780043d8",key:"bdc7",state:"Published",createdAt:"2020-07-11T22:35:42.033Z",sageScore:4,diffs:[{njs:10,offset:-.3,notes:321,bombs:0,obstacles:6,nps:1.768,length:233,characteristic:"Standard",difficulty:"Normal",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:30,warns:41,resets:0},maxScore:288075,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:418,bombs:0,obstacles:8,nps:2.302,length:233,characteristic:"Standard",difficulty:"Hard",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:38,resets:0},maxScore:377315,environment:"NiceEnvironment"},{njs:13,offset:.1,notes:492,bombs:0,obstacles:8,nps:2.71,length:233,characteristic:"Standard",difficulty:"Expert",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:26,resets:0},maxScore:445395,environment:"NiceEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"90Degree",difficulty:"Expert",events:1192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:27,resets:0},maxScore:442635,label:"Expert 90",environment:"GlassDesertEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"360Degree",difficulty:"Expert",events:1166,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:26,resets:0},maxScore:442635,label:"Expert360",environment:"GlassDesertEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.zip",coverURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.jpg",previewURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2020-07-11T22:35:42.033Z",createdAt:"2020-07-11T22:35:42.033Z",updatedAt:"2020-07-11T22:35:42.033Z",lastPublishedAt:"2020-07-11T22:35:42.033Z",tags:["pop","jazz","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"3bbb0",name:"[Modchart] Leslie Wai - Paradigm",description:"MAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\n\nNOTE: If your sabers are in the wrong position after the intro try disabling any room offset/rotation\nNOTE 2: The map is broken on some versions including 1.34 and quest, I am gonna work on report all the issues\nNOTE 3: The map should be playable now on Quest native (just a few visual bugs)\n\nMy biggest project so far!\nenjoy it\n\nMap preview: https://youtu.be/gokZx0QjqZQ\n\nReupload: Thanks for the 429 people that played the map so far! i am reuploading to fix a few bugs:\n- Fix saber positions being wrong for some people\n- Disable left handed option\n- Disable Intro Skip\n\nReupload 2: Thanks for the another 170 plays I hope this is the final reupload:\n- Fix light id errors\n- Fix cinema suggestion not needed\n- Trying another fix for sabers wrong position\n\nReupload 3: And I hope this is the last one, thanks for the 124 new plays!\n- Fix player position bug on quest\n- Fix notes position bug on quest\n- Fix gimmik part on quest\n- Added suggested colors for notes\n- Changed NJS and JD\n- Fix sabers coming from the wrong direction in the intro",uploader:{id:4284535,name:"Elecast",hash:"6069279f5ab13d000609e874",avatar:"https://cdn.beatsaver.com/avatar/4dd111a1ec473c3559cfc73caaac650be56b65a1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284535/playlist"},metadata:{bpm:130,duration:441,songName:"Paradigm",songSubName:"",songAuthorName:"Leslie Wai",levelAuthorName:"Elecast"},stats:{plays:0,downloads:0,upvotes:2734,downvotes:27,score:.9851,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2024-04-13T20:59:13.608905Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"a504aafe70cf723f46503568f65813ef616d030f",state:"Published",createdAt:"2024-04-24T23:51:45.788382Z",sageScore:3,diffs:[{njs:17,offset:-.75,notes:1051,bombs:360,obstacles:249,nps:3.038,length:749.5,characteristic:"Standard",difficulty:"ExpertPlus",events:12016,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:345.923,paritySummary:{errors:0,warns:0,resets:0},maxScore:959675,label:"You can't escape",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.zip",coverURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.jpg",previewURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.mp3"}],curator:{id:4284445,name:"Emilia",hash:"5cff0b7898cc5a672c856ed3",avatar:"https://cdn.beatsaver.com/avatar/4284445.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284445/playlist"},curatedAt:"2024-04-13T23:47:05.160104Z",createdAt:"2024-04-12T23:23:24.101391Z",updatedAt:"2024-08-18T18:18:25.185313Z",lastPublishedAt:"2024-04-24T23:51:50.910171Z",tags:["balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0ba",name:"[Electro Swing Pack] Wolfgang Lohr & Maskarade - Hit The Road Jack",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/0ObNR9n_dDs\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:124,duration:159,songName:"Hit The Road Jack",songSubName:"",songAuthorName:"Wolfgang Lohr & Maskarade",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3787,downvotes:42,score:.9849},uploaded:"2021-07-08T15:26:18.072Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"75f10751d58f6f1ab0bc36e94039a144256adccb",key:"1a0ba",state:"Published",createdAt:"2021-07-08T15:26:18.072Z",sageScore:4,diffs:[{njs:16,offset:-.25,notes:475,bombs:0,obstacles:0,nps:3.089,length:317.75,characteristic:"Standard",difficulty:"Expert",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:429755,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:750,bombs:0,obstacles:0,nps:4.878,length:317.75,characteristic:"Standard",difficulty:"ExpertPlus",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:682755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.zip",coverURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.jpg",previewURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:26:18.072Z",createdAt:"2021-07-08T15:26:18.072Z",updatedAt:"2024-11-02T11:17:50.904586Z",lastPublishedAt:"2021-07-08T15:26:18.072Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b7",name:"[Electro Swing Pack] Jamie Berry - Lost In The Rhythm (ft. Octavia Rose)",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/4O8l7rq4eHI\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:121,duration:187,songName:"Lost In The Rhythm",songSubName:"(ft. Octavia Rose)",songAuthorName:"Jamie Berry",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3307,downvotes:36,score:.9847,reviews:1},uploaded:"2021-07-08T15:24:57.679Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6d006d47880a45a134844f3787f3c184881d4673",key:"1a0b7",state:"Published",createdAt:"2021-07-08T15:24:57.679Z",sageScore:5,diffs:[{njs:16,offset:-.25,notes:591,bombs:0,obstacles:8,nps:3.274,length:364,characteristic:"Standard",difficulty:"Expert",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:536475,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:821,bombs:0,obstacles:8,nps:4.549,length:364,characteristic:"Standard",difficulty:"ExpertPlus",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:748075,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.zip",coverURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.jpg",previewURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:24:57.679Z",createdAt:"2021-07-08T15:24:57.679Z",updatedAt:"2024-11-02T11:17:26.961219Z",lastPublishedAt:"2021-07-08T15:24:57.679Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"77e9",name:"Jingo Jungle [Saga of Tanya the Evil Opening] - AmaLee",description:'AmaLee\'s English cover of "Jingo Jungle", the opening from Saga of Tanya the Evil (Youjo Senki). Original song by MYTH & ROID.',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:130,duration:226,songName:"Jingo Jungle",songSubName:"",songAuthorName:"AmaLee",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4125,downvotes:48,score:.9846,reviews:1},uploaded:"2019-12-21T02:44:34.295Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f90a2e4f8ee7b1f33543cddccb8baea660253d4a",key:"77e9",state:"Published",createdAt:"2019-12-21T02:44:34.295Z",sageScore:5,diffs:[{njs:12,offset:0,notes:581,bombs:104,obstacles:28,nps:2.647,length:475.5,characteristic:"Standard",difficulty:"Hard",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:35,warns:15,resets:10},maxScore:527275,environment:"DefaultEnvironment"},{njs:15,offset:0,notes:950,bombs:78,obstacles:14,nps:4.329,length:475.5,characteristic:"Standard",difficulty:"Expert",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:42,warns:48,resets:8},maxScore:866755,environment:"DefaultEnvironment"},{njs:17,offset:0,notes:1184,bombs:105,obstacles:17,nps:5.395,length:475.5,characteristic:"Standard",difficulty:"ExpertPlus",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:32,warns:43,resets:16},maxScore:1082035,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.zip",coverURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.jpg",previewURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.mp3"}],createdAt:"2019-12-21T02:44:34.295Z",updatedAt:"2019-12-21T02:44:34.295Z",lastPublishedAt:"2019-12-21T02:44:34.295Z",tags:["pop","anime"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"a438",name:"Wait - M83 (wall map)",description:"I wanted to do something special for this great song, and also see the potential of Noodle Extensions. A few tips for a better experience:\r\n- disable the mirror effect in the game settings\r\n- turn the SFX volume down in the player settings\r\n- hide the HUD in the player settings\r\n\r\nVideo: https://youtu.be/oe6ThhijPy0\r\n\r\nThe map has a lot of walls, so you might not be able to run it on the lower-end hardware. I've included a version with less walls in case it helps.",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:148,duration:336,songName:"Wait",songSubName:"",songAuthorName:"M83",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4116,downvotes:48,score:.9845,reviews:9,sentiment:"VERY_POSITIVE"},uploaded:"2020-05-08T23:53:02.030Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0d8921ef06a889cbd9db13afcc43f09a1619b173",key:"a438",state:"Published",createdAt:"2020-05-08T23:53:02.030Z",sageScore:6,diffs:[{njs:8,offset:6,notes:735,bombs:0,obstacles:6684,nps:2.225,length:815,characteristic:"Standard",difficulty:"Easy",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (less lag)",environment:"BigMirrorEnvironment"},{njs:8,offset:6,notes:735,bombs:0,obstacles:10499,nps:2.225,length:815,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (original)",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.zip",coverURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.jpg",previewURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-05-08T23:53:02.030Z",createdAt:"2020-05-08T23:53:02.030Z",updatedAt:"2020-05-08T23:53:02.030Z",lastPublishedAt:"2020-05-08T23:53:02.030Z",tags:["rock","indie","techno"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"12ad1",name:"Minnesota - Colors (ft. Jackie Rain) | Chroma RGB",description:"Chroma 2.0 HIGHLY RECOMMENDED!\n\nHad this map sitting in my project folder for some months and finally got to finish it! \nIt features a Chroma RGB lightshow AND Rainbow notes, for the full COLOR experience :)\n\nPreview: https://www.youtube.com/watch?v=8Omzd7IdJt0",uploader:{id:4284201,name:"nitronik.exe",hash:"5cff0b7798cc5a672c855d84",avatar:"https://cdn.beatsaver.com/avatar/ab054640a94777ed7e92d91a505a85f8c5047be5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284201/playlist"},metadata:{bpm:140,duration:202,songName:"Colors",songSubName:"(ft. Jackie Rain)",songAuthorName:"Minnesota",levelAuthorName:"nitronik.exe"},stats:{plays:0,downloads:0,upvotes:4295,downvotes:51,score:.9844,reviews:7,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-13T15:55:44.846Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"03fcb98091e50600d9d777251d765c53384c2735",key:"12ad1",state:"Published",createdAt:"2021-01-13T15:55:44.846Z",sageScore:4,diffs:[{njs:13,offset:.5,notes:395,bombs:0,obstacles:221,nps:2.057,length:448,characteristic:"Standard",difficulty:"Hard",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:356155,environment:"BigMirrorEnvironment"},{njs:16,offset:0,notes:601,bombs:0,obstacles:113,nps:3.13,length:448,characteristic:"Standard",difficulty:"Expert",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:545675,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:911,bombs:0,obstacles:120,nps:4.745,length:448,characteristic:"Standard",difficulty:"ExpertPlus",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:830875,label:"Colors",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.zip",coverURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.jpg",previewURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2021-01-13T15:55:44.846Z",createdAt:"2021-01-13T15:55:44.846Z",updatedAt:"2021-01-13T15:55:44.846Z",lastPublishedAt:"2021-01-13T15:55:44.846Z",tags:["dubstep","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4a2b3",name:"[Vivify] Turret Orchestra (Cara Mia Addio) - Portal 2",description:"Portal •⩊•\n\nWork done:\nMadChase - Vivify and Standard Mapping\nRateGyro - OneSaber Mapping\nXentha - 3d Modeling \n\nAll Lawless: No Vivify difficulties \n\nThis took FAR too long to make too..... hope you enjoy this product of my sufferings as much as I do :)\n\nGo check out @rategyro, they did the mapping for all the Onesaber diffs and HUGE thanks to @Xentha for making a majority of the env used in this map, this would not have been possible without them. \n\nCredits: https://docs.google.com/document/d/1gR8x4iIk_n2i4ScYRPGEyD8OfZNsrDftmy6Z9cC5L_E/edit?usp=sharing",uploader:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},metadata:{bpm:204,duration:120,songName:"Turret Orchestra",songSubName:"(Cara Mia Addio)",songAuthorName:"Portal 2",levelAuthorName:"MadChase, RateGyro, Xentha\r"},stats:{plays:0,downloads:0,upvotes:758,downvotes:3,score:.9844},uploaded:"2025-09-05T19:09:19.619055Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3a2a0fead6eb8a8ab325aa54efdfb84bd4220375",state:"Published",createdAt:"2025-09-06T02:29:05.366Z",sageScore:4,diffs:[{njs:12,offset:0,notes:107,bombs:0,obstacles:0,nps:1.304,length:279,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:91195,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:149,bombs:0,obstacles:0,nps:1.816,length:279,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:129835,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:714,bombs:0,obstacles:0,nps:8.701,length:279,characteristic:"Standard",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:649635,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:131,bombs:0,obstacles:0,nps:1.591,length:279.937,characteristic:"OneSaber",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:113275,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:612,bombs:0,obstacles:0,nps:7.433,length:279.937,characteristic:"OneSaber",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:555795,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Just Viv",environment:"GagaEnvironment"},{njs:12,offset:0,notes:111,bombs:0,obstacles:473,nps:1.343,length:281,characteristic:"Lawless",difficulty:"Easy",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:94875,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:130,bombs:0,obstacles:473,nps:1.584,length:279,characteristic:"Lawless",difficulty:"Normal",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:112355,label:"One Saber Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:153,bombs:0,obstacles:473,nps:1.851,length:281,characteristic:"Lawless",difficulty:"Hard",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:133515,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:611,bombs:0,obstacles:473,nps:7.446,length:279,characteristic:"Lawless",difficulty:"Expert",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:554875,label:"One Saber Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:734,bombs:0,obstacles:473,nps:8.859,length:281.688,characteristic:"Lawless",difficulty:"ExpertPlus",events:7,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:82.849,paritySummary:{errors:0,warns:0,resets:0},maxScore:668035,label:"Poodles",environment:"GagaEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.zip",coverURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.jpg",previewURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.mp3"}],createdAt:"2025-09-05T18:27:26.937639Z",updatedAt:"2025-09-30T15:48:59.259473Z",lastPublishedAt:"2025-09-06T02:29:10.640787Z",tags:["video-game-soundtrack","balanced","poodle"],bookmarked:!1,collaborators:[{id:103109,name:"Xentha",avatar:"https://cdn.beatsaver.com/avatar/da02df6ec7f6d28e226510b3f8ecb786d24634ca.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/103109/playlist"},{id:4280701,name:"rategyro",hash:"605e50f0cd73ba00060a45e3",avatar:"https://cdn.beatsaver.com/avatar/06d29645455d6652940b240658617d968fc53d91.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4280701/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"14d64",name:"Try - MitiS Feat. RORY",description:"Twenty-Sixth Upload\n\nThis map means the whole world to me, so I hope everyone enjoys this map. My father passed away on Jan. 23, 2021, in the middle of making this map. I am dedicating this map for him because of how much this songs means to me now. \nPouring my heart and soul into this map took a lot out of me, making it as perfect to my little abilities I have for mapping.\n\nBig shout outs to Lonely and Jamman for lighting this beautiful song and for agreeing to light it, it means the world to me.\nBig shout outs to thelightdesigner for making such amazing and beautiful walls. Thank you for taking the time to make this, it means the world to me.\nBig shout outs to Mawntee for giving me advice on how to make this map feel and shout outs to thelitlewiseowl for modding it, showing me what I can improve in this map. \nBiggest shout outs to everyone that play tested it multiple times. I am sorry for bugging them for multiple play test. \n\nAnd Biggest shoutout to my favorite chillstep/melodic dubstep artist, MitiS and Rory for making this beautiful song. \nYou have no idea how much this song means to me, I thank you so much. Keep up the good work MitiS.\n\n**NOODLES AND CHROMA REQUIRED**\n\nI hope this map can show you the feeling in this song, as well as what it portrays. I tried my best, I hope it turns out great and everyone enjoys it. \nThank you everyone for taking the time to download and play this map. I appreciate it everyone.\n\nFeedback is always welcome!",uploader:{id:4285346,name:"remie",hash:"5f6efd989824150006d740ac",avatar:"https://cdn.beatsaver.com/avatar/736cde47222d5d00f4affea115772681d0e070eb.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4285346/playlist"},metadata:{bpm:132,duration:273,songName:"Try",songSubName:"",songAuthorName:"MitiS Feat. RORY",levelAuthorName:"Remie & Lone"},stats:{plays:0,downloads:0,upvotes:7683,downvotes:102,score:.9843,reviews:36,sentiment:"VERY_POSITIVE"},uploaded:"2021-03-01T13:29:26.471Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6db3d9da217b41607d250aa7a28c5dc26a082188",key:"14d64",state:"Published",createdAt:"2021-03-01T13:29:26.471Z",sageScore:3,diffs:[{njs:17,offset:-.7,notes:1447,bombs:21,obstacles:77,nps:6.217,length:512.083,characteristic:"Standard",difficulty:"ExpertPlus",events:36825,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:232.765,paritySummary:{errors:0,warns:0,resets:2},maxScore:1323995,label:"EXPERT+",environment:"OriginsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.zip",coverURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.jpg",previewURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.mp3"}],curator:{id:2381,name:"bearly",hash:"5ea9efbf16c968000636dba4",avatar:"https://cdn.beatsaver.com/avatar/2381.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/2381/playlist"},curatedAt:"2021-03-01T13:29:26.471Z",createdAt:"2021-03-01T13:29:26.471Z",updatedAt:"2021-03-01T13:29:26.471Z",lastPublishedAt:"2021-03-01T13:29:26.471Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"27a13",name:"Jimmy Eat World - The Middle [Arcs][V3 Lights]",description:" - everything'll be alright, alright? \n\nYes, @Bytrius already has a great map of this song in the 2000's Rock Pack (check it out here https://beatsaver.com/maps/157fa) but I thought I'd try it with my own arc map style and provide some lower difficulties as well. \n\nGameplay video by @onespookyboi: https://youtu.be/SjiqMsMkFuU\nLIghtshow: https://streamable.com/zhomzm\n\nThank you testers!\n@maybeemae\n@swukpuff\n@onespookyboi\n@namaki_mono\nFlaemmchenFlame - https://www.twitch.tv/flaemmchenflame\n",uploader:{id:4321171,name:"tetsubeats",avatar:"https://cdn.beatsaver.com/avatar/532b0f3d23e1e795c5e1404c4a807c0dfbe1adf2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4321171/playlist"},metadata:{bpm:162.2,duration:169,songName:"The Middle",songSubName:"",songAuthorName:"Jimmy Eat World",levelAuthorName:"TetsuBeats"},stats:{plays:0,downloads:0,upvotes:3397,downvotes:39,score:.9842,reviews:1},uploaded:"2022-07-10T05:30:32.964512Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"4b980371b6005cc176aed1b402bd104af56c31a3",state:"Published",createdAt:"2022-07-10T04:29:32.041843Z",sageScore:5,diffs:[{njs:10,offset:-1.1,notes:320,bombs:0,obstacles:0,nps:1.951,length:443.5,characteristic:"Standard",difficulty:"Easy",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:287155,environment:"PyroEnvironment"},{njs:12,offset:-1.5,notes:528,bombs:0,obstacles:0,nps:3.218,length:443.5,characteristic:"Standard",difficulty:"Normal",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:478515,environment:"PyroEnvironment"},{njs:14,offset:.1,notes:629,bombs:0,obstacles:0,nps:3.834,length:443.5,characteristic:"Standard",difficulty:"Hard",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:571435,environment:"PyroEnvironment"},{njs:16.5,offset:-.1,notes:758,bombs:0,obstacles:0,nps:4.62,length:443.5,characteristic:"Standard",difficulty:"Expert",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:690115,environment:"PyroEnvironment"},{njs:17.5,offset:-.3,notes:826,bombs:0,obstacles:0,nps:5.035,length:443.5,characteristic:"Standard",difficulty:"ExpertPlus",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:752675,environment:"PyroEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.zip",coverURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.jpg",previewURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-07-10T05:52:53.577094Z",createdAt:"2022-07-10T04:29:32.041843Z",updatedAt:"2022-07-10T14:14:52.319313Z",lastPublishedAt:"2022-07-10T05:30:32.964512Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"271dc",name:"[Electro Swing Pack Vol. 2] Swingrowers - Butterfly (Wolfgang Lohr Remix)",description:"Electro Swing Pack Volume 2: Electric Boogaloo!\n\nFor the anniversary of my first pack, I am making a sequel.\n10 Electro Swing songs, 3 difficulties each + custom vanilla lights!\n\nGet the pack here:\nhttps://bsaber.com/electro-swing-pack-2/\nhttps://beatsaver.com/playlists/6572\n\nPreview this map:\nhttps://youtu.be/91zWh1dLLV4\n\nPack Preview Playlist:\nhttps://youtube.com/playlist?list=PLrVm0whzsGKL5NYTUIEzDyITjl6WuLSJ4\n\n\nThank you to all the Playtesters!\nAlice, MaybeeMae, Pixelguy, Raaknys, Namaki Mono, DeeDee, and WolfieBeat ❤️\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:126,duration:189,songName:"Butterfly",songSubName:"(Wolfgang Lohr Remix)",songAuthorName:"Swingrowers",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:1900,downvotes:18,score:.9842},uploaded:"2022-07-08T13:00:00.564Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7",state:"Published",createdAt:"2022-06-25T18:10:24.485756Z",sageScore:5,diffs:[{njs:14,offset:0,notes:522,bombs:0,obstacles:9,nps:2.818,length:389,characteristic:"Standard",difficulty:"Hard",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:16,offset:-.5,notes:752,bombs:0,obstacles:9,nps:4.06,length:389,characteristic:"Standard",difficulty:"Expert",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:684595,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:903,bombs:0,obstacles:9,nps:4.875,length:389,characteristic:"Standard",difficulty:"ExpertPlus",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:823515,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.zip",coverURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.jpg",previewURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.mp3"}],curator:{id:4284746,name:"Dee-Dee",avatar:"https://cdn.beatsaver.com/avatar/3853d99b74fe4eb9a3954df5946123f67a95da3d.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284746/playlist"},curatedAt:"2022-07-09T12:03:07.374428Z",createdAt:"2022-06-25T18:10:24.485756Z",updatedAt:"2024-11-09T20:31:57.830788Z",lastPublishedAt:"2022-07-08T13:00:00.559037Z",tags:["balanced","electronic","swing","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"39624",name:"[Chroma] DNCE - Cake By The Ocean",description:"[Explicit Lyrics]\n[Flashing Lights Warning]\n\nMy first full spread map!\n\nJan 28th 2024: Reupload with fixed lighting\n-----------------------------------------------------\nSong: Cake By The Ocean by DNCE\nhttps://www.youtube.com/watch?v=vWaRiD5ym74\n\nMap Preview (Expert+):\nhttps://www.youtube.com/watch?v=UZyrFB9vKDo\n-----------------------------------------------------\nThank you to @Noveliniel for playtesting this map.\n-----------------------------------------------------\nMessage wunkoo on Discord for any feedback (must be in the BeastSaber discord).\nOr just leave a BeatSaver review",uploader:{id:4302396,name:"Koreami",avatar:"https://cdn.beatsaver.com/avatar/f5542fc9f09f21504d7e82a61b06d494389ba3d3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4302396/playlist"},metadata:{bpm:119,duration:221,songName:"Cake By The Ocean",songSubName:"",songAuthorName:"DNCE",levelAuthorName:"Koreami"},stats:{plays:0,downloads:0,upvotes:2819,downvotes:31,score:.9841,reviews:3},uploaded:"2024-01-27T19:00:00.269841Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2cb2f496ef6e33a09a56d301923ade73b9a53c3d",state:"Published",createdAt:"2024-01-28T18:55:36.350370Z",sageScore:5,diffs:[{njs:12,offset:-.1,notes:431,bombs:6,obstacles:37,nps:2.021,length:423,characteristic:"Standard",difficulty:"Easy",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:389275,label:"Puddle",environment:"DragonsEnvironment"},{njs:12,offset:-.2,notes:554,bombs:0,obstacles:21,nps:2.598,length:423,characteristic:"Standard",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:502515,label:"Pond",environment:"DragonsEnvironment"},{njs:13,offset:-.25,notes:677,bombs:0,obstacles:31,nps:3.174,length:423,characteristic:"Standard",difficulty:"Hard",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:615595,label:"Lake",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:800,bombs:0,obstacles:33,nps:3.751,length:423,characteristic:"Standard",difficulty:"Expert",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:728755,label:"Sea",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:971,bombs:4,obstacles:41,nps:4.553,length:423,characteristic:"Standard",difficulty:"ExpertPlus",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:886075,label:"Ocean",environment:"DragonsEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Fluorescent Coral",environment:"DragonsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.zip",coverURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.jpg",previewURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.mp3"}],curator:{id:169636,name:"Duffelsalat",avatar:"https://cdn.beatsaver.com/avatar/42f17c520f53b67cf400a66f65e49038263042de.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/169636/playlist"},curatedAt:"2024-01-28T15:09:46.809093Z",createdAt:"2024-01-27T18:49:42.362618Z",updatedAt:"2025-05-27T05:59:37.010902Z",lastPublishedAt:"2024-01-28T18:55:43.801969Z",tags:["accuracy","balanced","pop","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"9a0c",name:"Thnks fr th Mmrs - Fall Out Boy",description:"Thnks fr th Mmrs (or Thanks for the Memories) from Fall Out Boy.\nSo far the map that I have put the most work into (and which probably made me age by 3 years). Hope you enjoy it!\n\nThe map has Chroma lighting but can also be played without the Chroma mod.\nExpert+ contains single saber sections and polyrhythm parts. Just so you are warned ;)\n\nBig thanks to Sorukun for playtesting this map and especially to Timeweaver for pointing out all issues it had during its creation!",uploader:{id:21367,name:"hamsta",hash:"5de27451fffaa600066f2842",avatar:"https://www.gravatar.com/avatar/36e8d99105e1e9c1d2173853194691e2b2d5c0552b6e96bfd7a2fd8108310685?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/21367/playlist"},metadata:{bpm:154.791,duration:198,songName:"Thnks fr th Mmrs",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Hamsta"},stats:{plays:0,downloads:0,upvotes:10577,downvotes:148,score:.984,reviews:2},uploaded:"2020-04-12T09:50:46.516Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0e8ef3006db854c67f04fe72322bccea410f69ee",key:"9a0c",state:"Published",createdAt:"2020-04-12T09:50:46.516Z",sageScore:5,diffs:[{njs:14,offset:0,notes:580,bombs:0,obstacles:51,nps:3.092,length:484,characteristic:"Standard",difficulty:"Hard",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:526355,environment:"PanicEnvironment"},{njs:14,offset:0,notes:637,bombs:0,obstacles:51,nps:3.395,length:484,characteristic:"Standard",difficulty:"Expert",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:578795,environment:"PanicEnvironment"},{njs:16,offset:0,notes:844,bombs:0,obstacles:39,nps:4.499,length:484,characteristic:"Standard",difficulty:"ExpertPlus",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:1,warns:2,resets:0},maxScore:769235,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.zip",coverURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.jpg",previewURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2020-04-12T09:50:46.516Z",createdAt:"2020-04-12T09:50:46.516Z",updatedAt:"2020-04-12T09:50:46.516Z",lastPublishedAt:"2020-04-12T09:50:46.516Z",tags:["pop","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"11b7a",name:"Still Alive - Portal",description:"I've wanted to map this song for a while now. And since this one's probably the last Portal song I'll map, I gave it my best. \r\n\r\nP.S. - I'm so glad to be back mapping this month. I had to take a break due to overwhelming stress, but now I'm feeling ready again.\r\nI hope you enjoy.\r\n\r\nPortal on Steam:\r\nhttps://store.steampowered.com/app/400/Portal/",uploader:{id:4284694,name:"Jokidum",hash:"5e15518d47f1600006e912cc",avatar:"https://cdn.beatsaver.com/avatar/da6133c71c7c84b75622f59dd2fce215f8c444f3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284694/playlist"},metadata:{bpm:120,duration:176,songName:"Still Alive",songSubName:"- Portal",songAuthorName:"Jonathan Coulton",levelAuthorName:"Jokidum"},stats:{plays:0,downloads:0,upvotes:6908,downvotes:92,score:.984,reviews:2},uploaded:"2020-12-04T20:30:44.132Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8c03b43484b0dd1fc7d8a3104a82f0992a001c6c",key:"11b7a",state:"Published",createdAt:"2020-12-04T20:30:44.132Z",sageScore:4,diffs:[{njs:12,offset:0,notes:490,bombs:0,obstacles:13,nps:2.853,length:343.5,characteristic:"Standard",difficulty:"Expert",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:171.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:443555,environment:"TriangleEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Easy",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.zip",coverURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.jpg",previewURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.mp3"}],createdAt:"2020-12-04T20:30:44.132Z",updatedAt:"2020-12-04T20:30:44.132Z",lastPublishedAt:"2020-12-04T20:30:44.132Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"24227",name:"DADDY! DADDY! DO! (TV Size) (2022 Remaster) [Kaguya-sama: Love Is War Season 2 Opening] - Masayuki Suzuki ft. Airi Suzuki ",description:"Just a small remaster of my old daddy daddy do map from 2020, fixed a few parity errors and updated the NJS. There's also 2 additional down maps now. \n\nThanks to https://twitter.com/WicKedBassline for the special request!\n\nDADDY! DADDY! DO! is opening theme for the second season of the Kaguya-sama: Love Is War anime adaptation.\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper's profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:138,duration:91,songName:"DADDY! DADDY! DO! (TV Size) (2022 Remaster)",songSubName:"ft. Airi Suzuki",songAuthorName:"Masayuki Suzuki",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:3282,downvotes:38,score:.984,reviews:1},uploaded:"2022-04-09T06:56:40.572610Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17",state:"Published",createdAt:"2022-04-09T06:56:26.910837Z",sageScore:4,diffs:[{njs:12,offset:0,notes:205,bombs:4,obstacles:23,nps:2.352,length:200.5,characteristic:"Standard",difficulty:"Hard",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:181355,environment:"PanicEnvironment"},{njs:15,offset:-.3,notes:306,bombs:4,obstacles:23,nps:3.51,length:200.5,characteristic:"Standard",difficulty:"Expert",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:274275,environment:"PanicEnvironment"},{njs:18,offset:-.6,notes:381,bombs:0,obstacles:23,nps:4.371,length:200.5,characteristic:"Standard",difficulty:"ExpertPlus",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:343275,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.zip",coverURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.jpg",previewURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-04-11T06:44:59.068414Z",createdAt:"2022-04-09T06:56:26.910837Z",updatedAt:"2022-04-11T06:44:59.068414Z",lastPublishedAt:"2022-04-09T06:56:40.572610Z",tags:["dance-style","anime","j-pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"291b9",name:"BLOODY STREAM (TV Size) (2022 Remaster) [JoJo's Bizarre Adventure 2nd Opening] - Coda",description:'---------Map uses the new 1.20 Note mechanics (eg: arc and chains) and won\'t work on any versions of Beat Saber below 1.20---------\n\nThanks to https://twitter.com/EuclaseW for the special request!\n\nThis map is a remap of my old Bloody Stream map. Changes include:\n- Parity fixes\n- Additional difficulties\n- Custom colors!\n- Addition of Arcs and Chains!\n\n"BLOODY STREAM" is the second opening of the JoJo\'s Bizarre Adventure by Japanese musician Kazuso Oda under the stage name "Coda".\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper\'s profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:132,duration:93,songName:"BLOODY STREAM (TV Size) (2022 Remaster)",songSubName:"",songAuthorName:"Coda",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4309,downvotes:54,score:.9838},uploaded:"2022-08-21T14:25:59.776857Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2c6a5186b7e3f4a3b453065ee8ad042d72947102",state:"Published",createdAt:"2022-08-21T14:25:52.329353Z",sageScore:2,diffs:[{njs:12,offset:0,notes:326,bombs:29,obstacles:16,nps:3.659,length:196,characteristic:"Standard",difficulty:"Hard",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:292915,environment:"BigMirrorEnvironment"},{njs:15,offset:-.3,notes:446,bombs:18,obstacles:13,nps:5.006,length:196,characteristic:"Standard",difficulty:"Expert",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:403315,environment:"BigMirrorEnvironment"},{njs:18,offset:-.6,notes:561,bombs:22,obstacles:15,nps:6.297,length:196,characteristic:"Standard",difficulty:"ExpertPlus",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:510715,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.zip",coverURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.jpg",previewURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-09-09T02:00:15.130726Z",createdAt:"2022-08-21T14:25:52.329353Z",updatedAt:"2022-09-09T02:00:15.130726Z",lastPublishedAt:"2022-08-21T14:25:59.776857Z",tags:["dance-style","anime","j-pop","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2ab5b",name:"Handclap - fitz and the tantrums",description:"twitch : https://www.twitch.tv/emiru_milk\ntwitter : https://twitter.com/EmirTart\ndiscord : https://discord.gg/DHwuND8K7K\nEmiru#9999",uploader:{id:4284894,name:"emiru",hash:"5d3dac6586729100069260cc",avatar:"https://cdn.beatsaver.com/avatar/59d2538aa7b938cbd28629073dc6d9be2357bee9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284894/playlist"},metadata:{bpm:139.867,duration:196,songName:"Handclap",songSubName:"",songAuthorName:"Fitz and the Tantrums",levelAuthorName:"Emir"},stats:{plays:0,downloads:0,upvotes:5631,downvotes:75,score:.9836,reviews:3},uploaded:"2022-10-08T08:58:23.778044Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3da135c11207f5f4f2dfe7b18a6416931f66936e",state:"Published",createdAt:"2022-10-08T09:11:55.226599Z",sageScore:3,diffs:[{njs:16,offset:0,notes:196,bombs:0,obstacles:58,nps:1.078,length:423.891,characteristic:"Standard",difficulty:"Easy",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.841,paritySummary:{errors:0,warns:0,resets:0},maxScore:173075,environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:302,bombs:0,obstacles:66,nps:1.655,length:425.39,characteristic:"Standard",difficulty:"Normal",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:270595,environment:"FitBeatEnvironment"},{njs:14,offset:-.168,notes:546,bombs:0,obstacles:184,nps:2.992,length:425.39,characteristic:"Standard",difficulty:"Hard",events:5221,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:495075,environment:"FitBeatEnvironment"},{njs:15,offset:-.368,notes:739,bombs:0,obstacles:130,nps:3.894,length:442.374,characteristic:"Standard",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:0,resets:0},maxScore:672635,environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:925,bombs:8,obstacles:315,nps:5.057,length:426.389,characteristic:"Standard",difficulty:"ExpertPlus",events:4390,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:182.912,paritySummary:{errors:0,warns:0,resets:8},maxScore:843755,environment:"FitBeatEnvironment"},{njs:12,offset:.526,notes:350,bombs:0,obstacles:34,nps:1.844,length:442.374,characteristic:"Lawless",difficulty:"Easy",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:43,warns:22,resets:0},maxScore:314755,label:"Lawless Tutorial",environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:657,bombs:0,obstacles:2,nps:3.462,length:442.374,characteristic:"Lawless",difficulty:"Normal",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:623,warns:0,resets:0},maxScore:597195,label:"Down Notes",environment:"FitBeatEnvironment"},{njs:14,offset:-.002,notes:670,bombs:0,obstacles:2,nps:3.531,length:442.374,characteristic:"Lawless",difficulty:"Hard",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:635,warns:16,resets:0},maxScore:609155,label:"Up Notes",environment:"FitBeatEnvironment"},{njs:15,offset:-.29,notes:1050,bombs:0,obstacles:2,nps:5.533,length:442.374,characteristic:"Lawless",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:78,resets:0},maxScore:958755,label:"90°Directions",environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:1260,bombs:0,obstacles:246,nps:6.625,length:443.373,characteristic:"Lawless",difficulty:"ExpertPlus",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:190.198,paritySummary:{errors:0,warns:6,resets:0},maxScore:1151955,label:"Dodge Walls",environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.zip",coverURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.jpg",previewURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.mp3"}],curator:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},curatedAt:"2022-10-08T09:19:15.538197Z",createdAt:"2022-10-08T08:57:08.316867Z",updatedAt:"2022-10-08T09:19:15.538197Z",lastPublishedAt:"2022-10-08T09:12:01.774147Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"212cf",name:"Someone Else's Hat - David Maxim Micic (modchart)",description:"David Maxim Micic is a prog rock genius. I wish I had the courage to map the 8 minutes of Mbinguni Amina but a few minutes of Someone Else's Hat will have to do. I really encourage you to check his stuff, because it's so good: https://open.spotify.com/artist/0wQa1N4q3HmLwxqkpVcYhs?si=aB4m1yonTg2qk5ounpOEUw\n\nThis modchart was an opportunity for me to have fun with environment animations, and push animations to a new level. The first scene is based on the album cover that Yelka made for Who Bit the Moon, and the rest is random ideas that I thought would be cool with this music.\n\nHuge thanks to the playtesters and in particular Mawntee and Aggrogahu, who took time to give detailed feedback. I appreciate.\n\nPreview: https://youtu.be/RX-payaVsKU\n\nThe map should work on Quest too, though it won't look as good due to the difference in how walls look.\n\nIf you like what I create, tell me, I love to hear from you:\n- YouTube: https://youtube.com/c/nyri0\n- Twitter: https://twitter.com/nyri0z\n- Ko-Fi: https://ko-fi.com/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:130,duration:207,songName:"Someone Else's Hat",songSubName:"",songAuthorName:"David Maxim Micic",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:3304,downvotes:40,score:.9835,reviews:3},uploaded:"2022-02-04T23:50:20.027446Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3662e733501d7a77850c20f0fcea792ed2187943",state:"Published",createdAt:"2022-02-04T23:05:01.786046Z",sageScore:1,diffs:[{njs:16,offset:0,notes:465,bombs:12,obstacles:1460,nps:2.38,length:423.333,characteristic:"Standard",difficulty:"Expert",events:875,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:195.385,paritySummary:{errors:83,warns:0,resets:0},maxScore:420555,label:"haut-de-forme",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.zip",coverURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.jpg",previewURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-02-04T23:50:20.027446Z",createdAt:"2022-02-04T23:05:01.786046Z",updatedAt:"2022-02-04T23:52:36.995020Z",lastPublishedAt:"2022-02-04T23:50:20.027446Z",tags:["balanced","rock"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2c785",name:"[Arc/Chain] Let's Groove - Earth, Wind & Fire",description:"I've been wanting to do a lower tempo dance map for a while and I knew this would be the perfect song. \n\nThanks to @dolledupchaos for playtesting!",uploader:{id:4232648,name:"ramenator05",hash:"60ecf439686b9f0006a67a41",avatar:"https://cdn.beatsaver.com/avatar/4232648.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4232648/playlist"},metadata:{bpm:124,duration:236,songName:"[Arc/Chain] Let's Groove - Earth Wind & Fire",songSubName:"",songAuthorName:"Earth Wind & Fire",levelAuthorName:"ramenator05"},stats:{plays:0,downloads:0,upvotes:3479,downvotes:43,score:.9834,reviews:3},uploaded:"2022-11-28T23:00:29.688269Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf86263deda5f2e09867f3ddad625dfc269709be",state:"Published",createdAt:"2022-11-28T22:59:23.889170Z",sageScore:2,diffs:[{njs:15,offset:.2,notes:550,bombs:0,obstacles:0,nps:2.39,length:480,characteristic:"Standard",difficulty:"Hard",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:500755,environment:"LizzoEnvironment"},{njs:17,offset:-.2,notes:708,bombs:0,obstacles:0,nps:3.076,length:480,characteristic:"Standard",difficulty:"Expert",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:646195,environment:"LizzoEnvironment"},{njs:19,offset:.5,notes:715,bombs:0,obstacles:0,nps:3.107,length:480,characteristic:"Standard",difficulty:"ExpertPlus",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:652635,environment:"LizzoEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.zip",coverURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2022-11-29T21:39:24.794532Z",createdAt:"2022-11-28T22:59:23.889170Z",updatedAt:"2022-11-29T21:39:24.794532Z",lastPublishedAt:"2022-11-28T23:00:29.688269Z",tags:["dance-style","soul","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"21bf8",name:"Marina and the Diamonds - Are You Satisfied?",description:"Thanks, Cryston!\n\nSocials: \nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:124,duration:200,songName:"Are You Satisfied?",songSubName:"",songAuthorName:"Marina and the Diamonds",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:604,downvotes:2,score:.9832,reviews:1},uploaded:"2022-02-15T21:07:43.593089Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7fe7f6e0f0f1687b6821891b42f3ae080d6e1270",state:"Published",createdAt:"2022-02-15T20:59:06.806428Z",sageScore:4,diffs:[{njs:15,offset:-.55,notes:459,bombs:4,obstacles:124,nps:2.585,length:367,characteristic:"Standard",difficulty:"Hard",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:177.581,paritySummary:{errors:0,warns:0,resets:2},maxScore:415035,environment:"DefaultEnvironment"},{njs:17,offset:-.725,notes:679,bombs:16,obstacles:122,nps:3.508,length:400,characteristic:"Standard",difficulty:"Expert",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:617435,environment:"DefaultEnvironment"},{njs:19,offset:.125,notes:944,bombs:24,obstacles:122,nps:4.877,length:400,characteristic:"Standard",difficulty:"ExpertPlus",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:861235,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.zip",coverURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.jpg",previewURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-02-15T21:07:43.593089Z",createdAt:"2022-02-15T20:59:06.806428Z",updatedAt:"2024-08-27T09:23:17.201003Z",lastPublishedAt:"2022-02-15T21:07:43.593089Z",tags:["dance-style","pop","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b514",name:"[[Wall Show + Chroma]] GAS GAS GAS | Manuel",description:"This wall map is a bit more intense than my others, you will need a very hefty pc to run and record this. Have Fun!\n\nHere's a playthrough: https://www.youtube.com/watch?v=hlS6r-Usnro\nHere's a playthrough by Nico (HQ Version): https://youtu.be/F_3qRxDdQc0\n\nREQUIREMENTS: \n -Noodle Extensions\n -Chroma/ChromaLite\n(fixed formatting + removed stupid metadata ;)",uploader:{id:73008,name:"thelightdesigner",hash:"5cff0b7798cc5a672c85627a",avatar:"https://cdn.beatsaver.com/avatar/fa1a30d2b4146dd93cb42537759669dcf961cf29.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/73008/playlist"},metadata:{bpm:154,duration:108,songName:"GAS GAS GAS",songSubName:"(Short Ver.)",songAuthorName:"Manuel",levelAuthorName:"KyleT"},stats:{plays:0,downloads:0,upvotes:9158,downvotes:134,score:.9832,reviews:4},uploaded:"2020-06-22T20:02:06.271Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"95e11f39b2898a38e3b5e61d2156ef5f5835f40f",key:"b514",state:"Published",createdAt:"2020-06-22T20:02:06.271Z",sageScore:3,diffs:[{njs:16.5,offset:0,notes:390,bombs:13,obstacles:13898,nps:3.832,length:261.25,characteristic:"Standard",difficulty:"Expert",events:1462,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:101.786,paritySummary:{errors:0,warns:0,resets:2},maxScore:351555,label:"GAS GAS GAS!!!!!",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.zip",coverURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.jpg",previewURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2020-06-22T20:02:06.271Z",createdAt:"2020-06-22T20:02:06.271Z",updatedAt:"2020-06-22T20:02:06.271Z",lastPublishedAt:"2020-06-22T20:02:06.271Z",tags:["anime","electronic","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1}]},function(e,t,n){if(AFRAME.registerComponent("song-info-positioner",{schema:{victory:{default:!1}},update:function(){this.data.victory?this.el.object3D.position.y=-1.2:this.el.object3D.position.y=-1}}),window.AFRAME){const t=["song-info-positioner"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);if(AFRAME.registerComponent("song-preview-system",{schema:{selectedChallengeId:{type:"string"},selectedChallengeVersion:{type:"string"}},init:function(){this.audio=document.createElement("audio"),this.audio.volume=.5},update:function(e){const t=this.data;console.log("update-song",e,t),t.selectedChallengeId&&e.selectedChallengeId!==t.selectedChallengeId?(this.audio.pause(),this.audio.setAttribute("src","https://cdn.beatsaver.com/"+t.selectedChallengeVersion+".mp3"),this.audio.currentTime=0,this.audio.play()):t.selectedChallengeId||this.audio.pause()}}),window.AFRAME){const t=["song-preview-system"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("song-progress-info",{dependencies:["geometry","material"],schema:{enabled:{default:!1}},init:function(){this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.progress=this.el.getObject3D("mesh"),this.progress.geometry.translate(.285,0,0),this.el.sceneEl.addEventListener("cleargame",()=>{this.progress.scale.x=1e-4})},update:function(e){this.progress.scale.x=1e-4},updateInfo:function(){const e=this.el.sceneEl.components.song.source;if(!e||!e.buffer)return;const t=this.el.sceneEl.components.song.getCurrentTime()/e.buffer.duration;t&&(this.progress.scale.x=t)},tick:function(){this.data.enabled&&this.updateInfo()}}),window.AFRAME){const t=["song-progress-info"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);const r={once:!0};let i=AFRAME.utils.getUrlParameter("skip");if(i=i?parseInt(i)/1e3:0,AFRAME.registerComponent("song",{schema:{audio:{type:"string"},analyserEl:{type:"selector",default:"#audioAnalyser"},challengeId:{default:""},isBeatsPreloaded:{default:!1},isGameOver:{default:!1},isLoading:{default:!1},isPlaying:{default:!1},isVictory:{default:!1}},init:function(){this.analyserSetter={buffer:!0},this.audioAnalyser=this.data.analyserEl.components.audioanalyser,this.context=this.audioAnalyser.context,this.isAudioPlaying=!1,this.songStartTime=0,this.onSongComplete=this.onSongComplete.bind(this),this.audioAnalyser.gainNode.gain.value=.5,this.el.addEventListener("gamemenurestart",this.onRestart.bind(this)),this.el.addEventListener("wallhitstart",this.onWallHitStart.bind(this)),this.el.addEventListener("wallhitend",this.onWallHitEnd.bind(this))},update:function(e){const t=this.data;if(!e.isLoading&&t.isLoading&&t.audio)this.processAudio();else if(!e.audio&&t.audio&&t.isLoading)this.processAudio();else if(e.isGameOver||!t.isGameOver){if(e.isGameOver&&!t.isGameOver&&(this.audioAnalyser.gainNode.value=.5),!e.isVictory&&t.isVictory)return this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.audioAnalyser.resumeContext();const t=this.audioAnalyser.gainNode.gain;t.cancelScheduledValues(0),t.setValueAtTime(.05,0),this.source=e.detail,this.source.start(),this.el.emit("victory")},r),void this.audioAnalyser.refreshSource();!e.isBeatsPreloaded&&this.data.isBeatsPreloaded&&this.source&&this.startAudio(),!e.challengeId||t.challengeId?(e.isPlaying&&!t.isPlaying&&(this.audioAnalyser.suspendContext(),this.isAudioPlaying=!1),!e.isPlaying&&t.isPlaying&&this.source&&(this.audioAnalyser.resumeContext(),this.isAudioPlaying=!0)):this.stopAudio()}else this.onGameOver()},processAudio:function(){this.el.sceneEl.emit("songprocessstart",null,!1),this.getAudio().then(e=>{this.el.sceneEl.emit("songprocessfinish",null,!1)}).catch(console.error)},getAudio:function(){const e=this.data;return this.source&&this.stopAudio(),this.isAudioPlaying=!1,new Promise(t=>{e.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,t(this.source)},r),this.analyserSetter.src=this.data.audio,e.analyserEl.setAttribute("audioanalyser",this.analyserSetter)})},stopAudio:function(){this.source?(this.source.onended=null,this.isAudioPlaying&&this.source.stop(),this.source.disconnect(),this.source=null,this.isAudioPlaying=!1):console.warn("[song] Tried to stopAudio, but not playing.")},onSongComplete:function(){this.data.isPlaying&&this.el.emit("songcomplete")},onGameOver:function(){this.isAudioPlaying=!1;const e=this.source.playbackRate;e.setValueAtTime(e.value,this.context.currentTime),e.linearRampToValueAtTime(0,this.context.currentTime+3.5);const t=this.audioAnalyser.gainNode.gain;t.setValueAtTime(t.value,this.context.currentTime),t.linearRampToValueAtTime(0,this.context.currentTime+3.5),setTimeout(()=>{this.data.isGameOver&&this.stopAudio()},3500)},onRestart:function(){this.isAudioPlaying=!1,this.source&&this.source.disconnect();this.audioAnalyser.gainNode.gain.cancelScheduledValues(0),this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,this.el.sceneEl.emit("songloadfinish",null,!1)},r),this.audioAnalyser.refreshSource()},onWallHitStart:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.1,this.context.currentTime+.1)},onWallHitEnd:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.5,this.context.currentTime+.1)},startAudio:function(){this.audioAnalyser.gainNode.gain.setValueAtTime(.5,this.context.currentTime),this.songStartTime=this.context.currentTime,this.source.onended=this.onSongComplete,this.source.start(0,i||0),this.isAudioPlaying=!0},getCurrentTime:function(){return this.context.currentTime-this.songStartTime}}),window.AFRAME){const t=["song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);const o=[{name:"bgcolor",property:"backglow.color"},{name:"leftglow",property:"leftsideglow.color"},{name:"rightglow",property:"rightsideglow.color"}],a=[{id:"off",dur:500,to:"off"},{id:"primary",dur:5,to:"primary"},{id:"primarybright",dur:500,from:"tertiary",to:"primarybright"},{id:"secondary",dur:5,to:"secondary"},{id:"secondarybright",dur:500,from:"tertiary",to:"secondarybright"}],s=["off","secondary","secondary","secondarybright","","primary","primary","primarybright","primarybright"];AFRAME.registerComponent("stage-colors",{schema:{colorScheme:{default:"default"}},init:function(){this.el.addEventListener("cleargame",this.resetColors.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.resetColors.bind(this)),function(e,t){for(let n=0;n<o.length;n++){const r=o[n];for(let n=0;n<a.length;n++){const o=a[n];e.setAttribute(`animation__${r.name}${o.id}`,{property:"systems.materials."+r.property,type:"color",isRawProperty:!0,easing:"linear",dur:o.dur,from:o.from?i.a.schemes[t][o.from]:"",startEvents:`${r.name}${o.id}`,to:i.a.schemes[t][o.to]})}}}(this.el.sceneEl,this.data.colorScheme)},update:function(e){e.colorScheme&&this.data.colorScheme!==e.colorScheme&&function(e,t){for(let n=0;n<o.length;n++){const r=o[n];for(let n=0;n<a.length;n++){const o=a[n],s=`animation__${r.name}${o.id}`;o.from&&e.setAttribute(s,"from",i.a.schemes[t][o.from]),e.setAttribute(s,"to",i.a.schemes[t][o.to])}}}(this.el.sceneEl,this.data.colorScheme)},play:function(){this.el.emit("bgcolorsecondary",null,!1)},setColor:function(e,t){s[t]||(t=5),e.startsWith("curve")?this.el.emit(e+"stageeventcolor",s[t].replace("bright",""),!1):this.el.emit(`${e}color${s[t]}`,null,!1)},setColorInstant:function(e,t){const n=this.el.sceneEl.systems.materials;if("stars"===e){let e;return e=0===t?i.a.schemes[this.data.colorScheme].secondarybright:i.a.schemes[this.data.colorScheme].secondary,void l(n.stars,"color",e)}const r=i.a.schemes[this.data.colorScheme][s[t]];"moon"===e&&l(n.moon,"tint",r)},resetColors:function(){this.el.emit("bgcolorsecondary",null,!1),this.el.emit("curveevenstageeventcolor","off",!1),this.el.emit("curveoddstageeventcolor","off",!1)}});const c=new THREE.Color;function l(e,t,n){c.set(n),e.uniforms?(e.uniforms[t].value.x=c.r,e.uniforms[t].value.y=c.g,e.uniforms[t].value.z=c.b):e[t].set(n)}if(window.AFRAME){const t=["stage-colors"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stage-lasers",{schema:{enabled:{default:!0}},init:function(){this.speed=0,this.lasers=[this.el.children[0].object3D,this.el.children[1].object3D,this.el.children[2].object3D]},pulse:function(e){this.speed=e/8},tick:function(e,t){0!==this.speed&&(t/=1e3,!this.data.enabled&&(this.speed*=.97,Math.abs(this.speed)<.01)?this.speed=0:(this.lasers[0].rotation.z+=this.speed*t,this.lasers[1].rotation.z-=this.speed*t*1.01,this.lasers[2].rotation.z+=this.speed*t*1.02))}}),window.AFRAME){const t=["stage-lasers"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerComponent("stars",{schema:{color:{type:"color",default:r.initial.secondary},count:{default:500},radius:{default:300}},init:function(){const e=()=>(Math.random()-.5)*this.data.radius*2,t=new THREE.BufferGeometry;this.material=this.el.sceneEl.systems.materials.stars;const n=[];for(let t=0;t<this.data.count;t++)n.push(e(),e(),4*e());t.setAttribute("position",new THREE.Float32BufferAttribute(n,3)),t.computeBoundingSphere();const r=new THREE.Points(t,this.material);this.el.setObject3D("stars",r)},update:function(){this.material.color.setStyle(this.data.color)}}),window.AFRAME){const t=["stars"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stats-param",{init:function(){"true"===AFRAME.utils.getUrlParameter("stats")&&this.el.setAttribute("stats","")}}),window.AFRAME){const t=["stats-param"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stepback",{init:function(){this.message=document.getElementById("stepback"),this.camera=document.getElementById("camera"),this.lastTime=0,this.limit=-.9,this.throttling=300},tick:function(e,t){if(!(e-this.lastTime<this.throttling)){var n=this.camera.object3D.position,r=this.message.object3D.position;n.z<this.limit?(this.throttling=10,this.message.object3D.visible=!0,this.message.getObject3D("mesh").material.opacity=1-Math.abs(n.z-r.z),r.x=n.x,r.y=n.y):(this.message.object3D.visible=!1,this.throttling=500),this.lastTime=e}}}),window.AFRAME){const t=["stepback"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("sub-object",{schema:{from:{type:"selector"},name:{type:"string"}},init:function(){var e=this.el,t=this.data;t.from.addEventListener("model-loaded",n=>{const r=n.detail.model.getObjectByName(t.name);e.setObject3D("mesh",r.clone()),e.setAttribute("material","shader","flat"),e.emit("subobjectloaded",null,!1)})}}),window.AFRAME){const t=["sub-object"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={superkeyboard:{wrapCount:30,inputOffsetY:.008,inputOffsetX:.08,img:"keyboard.png",hoverImg:"keyboard-hover.png",layout:[{key:"1",x:.013,y:.03,w:.093,h:.176},{key:"2",x:.106,y:.03,w:.088,h:.176},{key:"3",x:.194,y:.03,w:.077,h:.176},{key:"4",x:.271,y:.03,w:.085,h:.176},{key:"5",x:.356,y:.03,w:.081,h:.176},{key:"6",x:.437,y:.03,w:.081,h:.176},{key:"8",x:.603,y:.03,w:.082,h:.176},{key:"7",x:.519,y:.03,w:.084,h:.176},{key:"9",x:.685,y:.03,w:.076,h:.176},{key:"0",x:.76,y:.03,w:.088,h:.176},{key:"Delete",x:.867,y:.03,w:.124,h:.176},{key:"q",x:.013,y:.213,w:.098,h:.186},{key:"w",x:.111,y:.213,w:.107,h:.186},{key:"e",x:.218,y:.213,w:.096,h:.186},{key:"r",x:.313,y:.213,w:.095,h:.186},{key:"t",x:.408,y:.213,w:.094,h:.186},{key:"y",x:.503,y:.213,w:.099,h:.186},{key:"u",x:.602,y:.213,w:.097,h:.186},{key:"i",x:.701,y:.213,w:.085,h:.186},{key:"o",x:.786,y:.213,w:.099,h:.186},{key:"p",x:.885,y:.213,w:.097,h:.186},{key:"a",x:.063,y:.408,w:.1,h:.182},{key:"s",x:.163,y:.408,w:.097,h:.182},{key:"d",x:.26,y:.408,w:.098,h:.182},{key:"f",x:.358,y:.408,w:.094,h:.182},{key:"g",x:.452,y:.408,w:.1,h:.182},{key:"h",x:.552,y:.408,w:.105,h:.182},{key:"j",x:.657,y:.408,w:.085,h:.182},{key:"k",x:.743,y:.408,w:.105,h:.182},{key:"l",x:.848,y:.408,w:.1,h:.182},{key:"z",x:.107,y:.596,w:.106,h:.197},{key:"x",x:.213,y:.596,w:.1,h:.197},{key:"c",x:.313,y:.596,w:.093,h:.197},{key:"v",x:.406,y:.596,w:.096,h:.197},{key:"b",x:.502,y:.596,w:.093,h:.197},{key:"n",x:.595,y:.596,w:.099,h:.197},{key:"m",x:.694,y:.596,w:.106,h:.197},{key:" ",x:.372,y:.798,w:.249,h:.169},{key:"Insert",x:.017,y:-.001,w:.038,h:.018}]}};if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var i={roboto:17,aileronsemibold:20,dejavu:20.5,exo2bold:20,exo2semibold:20.3,kelsonsans:22.8,monoid:19.5,mozillavr:9.5,sourcecodepro:20.3};function o(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t)return e[n];return null}if(AFRAME.registerComponent("super-keyboard",{schema:{align:{default:"left",oneOf:["left","center","right"]},blinkingSpeed:{type:"int",default:400},filters:{type:"array"},font:{default:"aileronsemibold"},hand:{type:"selector"},imagePath:{default:"."},injectToRaycasterObjects:{default:!0},inputColor:{type:"color",default:"#6699ff"},interval:{type:"int",default:50},keyBgColor:{type:"color",default:"#000"},keyColor:{type:"color",default:"#6699ff"},keyHoverColor:{type:"color",default:"#1A407F"},keyPressColor:{type:"color",default:"#5290F6"},label:{type:"string",default:""},labelColor:{type:"color",default:"#aaa"},maxLength:{type:"int",default:0},model:{default:"basic"},show:{default:!0},multipleInputs:{default:!1},value:{type:"string",default:""},width:{default:.8}},init:function(){this.el.addEventListener("click",this.click.bind(this)),this.changeEventDetail={},this.textInputObject={},this.keys=null,this.focused=!1,this.keyHover=null,this.prevCheckTime=null,this.shift=!1,this.rawValue=this.data.value,this.defaultValue=this.data.value,this.userFilterFunc=null,this.intervalId=0,this.kbImg=document.createElement("a-entity"),this.kbImg.classList.add("keyboardRaycastable"),this.kbImg.classList.add("superKeyboardImage"),this.kbImg.addEventListener("raycaster-intersected",this.hover.bind(this)),this.kbImg.addEventListener("raycaster-intersected-cleared",this.blur.bind(this)),this.el.appendChild(this.kbImg),this.label=document.createElement("a-entity"),this.label.setAttribute("text",{align:"center",font:this.data.font,baseline:"bottom",lineHeight:40,shader:"msdf",negate:!0,value:this.data.label,color:this.data.labelColor,width:this.data.width,wrapCount:30}),this.el.appendChild(this.label),this.textInput=document.createElement("a-entity"),this.textInput.setAttribute("mixin","superKeyboardTextInput"),this.textInput.setAttribute("text",{align:this.data.align,font:this.data.font,lineHeight:35,shader:"msdf",value:this.data.value,color:this.data.inputColor,width:this.data.width}),this.el.appendChild(this.textInput),this.cursor=document.createElement("a-entity"),this.cursor.object3D.position.set(0,0,.001),this.cursor.setAttribute("material",{shader:"flat",color:this.data.inputColor}),this.textInput.appendChild(this.cursor),this.cursorUpdated=!1,this.keyBgColor=new THREE.Color,this.keyHoverColor=new THREE.Color,this.keyPressColor=new THREE.Color;var e=this;document.addEventListener("keydown",(function(t){if("t"===t.key){for(var n="",r="abcdefghijklmopqrstuvQWIEUTGASDLIGKBXACQWETL102394676457",i=Math.floor(20*Math.random()),o=0;o<i;o++)n+=r[Math.floor(Math.random()*r.length)];e.el.setAttribute("super-keyboard",{value:n})}})),document.addEventListener("show",this.open.bind(this)),this.hand=null,this.handListenersSet=!1,this.raycaster=null},update:function(e){var t=r[this.data.model],n=this.data.width,i=this.data.width/2;if(void 0!==t){e&&this.defaultValue===e.defaultValue?this.updateTextInput(this.filter(this.rawValue)):(this.rawValue=this.data.value,this.defaultValue=this.data.value,this.updateTextInput(this.filter(this.data.value))),this.data.width===e.width&&this.data.height===e.height&&this.data.keyColor===e.keyColor||(this.kbImg.setAttribute("geometry",{primitive:"plane",width:n,height:i}),this.kbImg.setAttribute("material",{shader:"flat",src:this.data.imagePath+"/"+t.img,color:this.data.keyColor,transparent:!0})),this.data.label===e.label&&this.data.labelColor===e.labelColor&&this.data.width===e.width||(this.label.setAttribute("text",{value:this.data.label,color:this.data.labelColor,width:this.data.width}),this.label.object3D.position.set(0,.3*n,-.02)),this.data.width===e.width&&this.data.keyBgColor===e.keyBgColor||this.initKeyColorPlane();var o="center"!==this.data.align?t.inputOffsetX*n:0;"right"===this.data.align&&(o*=-1),this.data.font===e.font&&this.data.inputColor===e.inputColor&&this.data.width===e.width&&this.data.align===e.align||this.textInput.setAttribute("text",{font:this.data.font,color:this.data.inputColor,width:n,wrapCount:t.wrapCount,align:this.data.align});for(var a=0;a<t.layout.length;a++){var s=t.layout[a];"Insert"===s.key&&(this.inputRect=s)}this.textInput.object3D.position.set(o,n/4-(this.inputRect.y+this.inputRect.h/2)*n/2+t.inputOffsetY*n,.002),this.data.width!==e.width&&this.cursor.setAttribute("geometry",{primitive:"plane",width:.03*n,height:.01*n}),this.updateCursorPosition(),this.setupHand(),this.keyBgColor.set(this.data.keyBgColor),this.keyHoverColor.set(this.data.keyHoverColor),this.keyPressColor.set(this.data.keyPressColor),this.data.show?this.open():this.close()}else console.error('super-keyboard ERROR: model "'+this.data.model+'" undefined.')},tick:function(e){var t;if(!(this.prevCheckTime&&e-this.prevCheckTime<this.data.interval))if(this.prevCheckTime){if(this.raycaster&&this.focused&&(t=this.raycaster.getIntersection(this.kbImg)))for(var n=t.uv,i=r[this.data.model].layout,o=0;o<i.length;o++){var a=i[o];if(n.x>a.x&&n.x<a.x+a.w&&1-n.y>a.y&&1-n.y<a.y+a.h){this.keyHover!==a&&(this.keyHover=a,this.updateKeyColorPlane(this.keyHover.key,this.keyHoverColor));break}}}else this.prevCheckTime=e},play:function(){this.cursorUpdated&&this.startBlinking()},pause:function(){this.stopBlinking()},initKeyColorPlane:function(){var e=this.keyColorPlane=document.createElement("a-entity");e.classList.add("superKeyboardKeyColorPlane"),e.object3D.position.z=.001,e.object3D.visible=!1,e.setAttribute("geometry",{primitive:"plane"}),e.setAttribute("material",{shader:"flat",color:this.data.keyBgColor,transparent:!0}),e.addEventListener("componentinitialized",(function(e){"material"===e.detail.name&&(this.getObject3D("mesh").material.blending=THREE.AdditiveBlending)})),this.el.appendChild(e)},updateKeyColorPlane:function(e,t){var n=r[this.data.model],i=this.keyColorPlane;if(e){for(var o=0;o<n.layout.length;o++){var a=n.layout[o];if(a.key===e){var s=this.data.width,c=this.data.width/2,l=s/2,u=c/2,h=a.w*s,d=a.h*c;i.object3D.scale.x=h,i.object3D.scale.y=d,i.object3D.position.x=a.x*s-l+h/2,i.object3D.position.y=(1-a.y)*c-u-d/2,i.getObject3D("mesh").material.color.copy(t);break}}i.object3D.visible=!0}else i.object3D.visible=!1},setupHand:function(){if(this.hand&&this.hand.ownRaycaster&&this.hand.removeAttribute("raycaster"),this.data.hand?this.hand=this.data.hand:this.hand=document.querySelector(["[cursor]","[vive-controls]","[tracked-controls]","[gearvr-controls]","[oculus-go-controls]","[oculus-touch-controls]","[windows-motion-controls]","[hand-controls]","[daydream-controls] [cursor] > [raycaster]"].join(",")),this.hand){if(!this.hand.hasLoaded)return void this.hand.addEventListener("loaded",this.setupHand.bind(this));var e=this.hand.components.raycaster,t={};if(e){if(this.hand.ownRaycaster=!1,this.data.injectToRaycasterObjects){var n=e.data.objects.split(",");-1===n.indexOf(".keyboardRaycastable")&&n.push(".keyboardRaycastable"),t.objects=n.join(",").replace(/^,/,""),this.hand.setAttribute("raycaster",t)}}else this.hand.ownRaycaster=!0,t.showLine=this.data.show,t.enabled=this.data.show,this.data.injectToRaycasterObjects&&(t.objects=".keyboardRaycastable"),this.hand.setAttribute("raycaster",t);this.raycaster=this.hand.components.raycaster}else console.error('super-keyboard: no controller found. Add <a-entity> with controller or specify with super-keyboard="hand: #selectorToController".')},filter:function(e){if(""===e)return"";for(var t=0;t<this.data.filters.length;t++)switch(this.data.filters[t]){case"custom":this.userFilterFunc&&(e=this.userFilterFunc(e));break;case"allupper":e=e.toUpperCase();break;case"alllower":e=e.toLowerCase();break;case"title":e=e.split(" ").map((function(e){return e[0].toUpperCase()+e.substr(1)})).join(" ");break;case"numbers":e=e.split("").filter((function(e){return!isNaN(parseInt(e))||"."===e})).join("");break;case"first":e=e[0].toUpperCase()+e.substr(1);break;case"trim":e=e.trim()}return this.data.maxLength>0?e.substr(0,this.data.maxLength):e},click:function(e){if(this.keyHover){switch(this.keyHover.key){case"Enter":this.accept();break;case"Insert":return;case"Delete":this.rawValue=this.rawValue.substr(0,this.rawValue.length-1);var t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail);break;case"Shift":this.shift=!this.shift,this.keyHover.el.setAttribute("material","color",this.shift?this.data.keyHoverColor:this.data.keyBgColor);break;case"Escape":this.dismiss();break;default:if(this.data.maxLength>0&&this.rawValue.length>this.data.maxLength)break;this.rawValue+=this.shift?this.keyHover.key.toUpperCase():this.keyHover.key;t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail)}this.updateKeyColorPlane(this.keyHover.key,this.keyPressColor);var n=this;setTimeout((function(){n.updateKeyColorPlane(n.keyHover.key,n.keyHoverColor)}),100),this.updateCursorPosition()}},open:function(){this.el.object3D.visible=!0,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!0,enabled:!0})},close:function(){this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1})},accept:function(){this.el.emit("superkeyboardinput",{value:this.data.value}),this.data.multipleInputs?(this.rawValue="",this.data.value="",this.updateTextInput("")):(this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.data.show=!1)},dismiss:function(){this.data.value=this.defaultValue,this.updateTextInput(),this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.el.emit("superkeyboarddismiss"),this.data.show=!1},blur:function(e){this.focused=!1,this.keyHover&&"Shift"!==this.keyHover.key&&this.updateKeyColorPlane(this.keyHover.key,this.keyBgColor),this.keyHover=null},hover:function(e){this.focused=!0},startBlinking:function(){this.stopBlinking(),this.intervalId=window.setInterval(this.blink.bind(this),this.data.blinkingSpeed)},stopBlinking:function(){window.clearInterval(this.intervalId),this.intervalId=0},blink:function(){this.cursor.object3D.visible=!this.cursor.object3D.visible},setCustomFilter:function(e){this.userFilterFunc=e},addCustomModel:function(e,t){e&&(r[e]=t)},updateCursorPosition:function(){var e=this.textInput.components.text.currentFont;if(!e){var t=this;return this.cursor.object3D.visible=!1,void window.setTimeout((function(){t.updateCursorPosition(),t.startBlinking()}),700)}var n=this.data.width,a=r[this.data.model],s=-this.inputRect.h/2*n/2.4+a.inputOffsetY*n,c=this.data.width/this.textInput.components.text.data.wrapCount,l=0,u=i[this.textInput.components.text.data.font];void 0===u&&(u=20);for(var h=0;h<this.data.value.length;h++){var d=o(e.chars,this.data.value.charCodeAt(h));l+=d.width+d.xadvance*(32===d.id?2:1)}"center"===this.data.align?l=l*c*u*.0011/2+.02*n:"left"===this.data.align?(l=l*c*u*.0011+.02*n,l-=n/2):"right"===this.data.align&&(l=-l*c*u*.0011-.02*n,l+=n/2),this.cursor.object3D.position.set(l,s,.001),this.cursorUpdated=!0},updateTextInput:function(e){this.textInputObject.value=e||this.data.value,this.textInput.setAttribute("text",this.textInputObject)}}),window.AFRAME){const t=["super-keyboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercurve-color",{init:function(){const e=this.el;e.sceneEl.addEventListener("curveevenstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color1",e.detail):this.setColor("color1","primary")}),e.sceneEl.addEventListener("curveoddstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color2",e.detail):this.setColor("color2","secondary")})},setColor:function(e,t){const n=this.el.components.material.material.uniforms[e].value,i=this.el.sceneEl.systems.materials.scheme[t];r.set(i),n.x=r.r,n.y=r.g,n.z=r.b}}),window.AFRAME){const t=["supercurve-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("supercurve",{schema:{cameraPercent:{type:"number",is:"uniform"},color1:{type:"color",is:"uniform",default:i.a.initial.primary},color2:{type:"color",is:"uniform",default:i.a.initial.secondary},fogColor:{type:"color",is:"uniform",default:i.a.initial.primary},side:{default:"double"},transparent:{default:!0}},fragmentShader:n(173),vertexShader:n(174),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerCurve(this.material)}}),window.AFRAME){const t=[],n=["supercurve"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 fogColor;\nuniform float opacity;\n\n#define BLACK vec3(0.0)\n#define YELLOW vec3(250.0 / 255.0, 244.0 / 255.0, 180.0 / 255.0)\n\nvoid main() {\n vec3 col;\n\n // Lines.\n float f1 = clamp(sin(vUvs.x * 12.9 + 1.4) - 0.99, 0.0, 1.0) * 80.0;\n float f2 = clamp(sin(3.1416 + vUvs.x * 12.9 + 1.45) - 0.99, 0.0, 1.0) * 80.0;\n\n // Gradients.\n f1 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.4 + 1.4) * 0.1 + 0.1;\n f2 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.3 + 5.5) * 0.1 + 0.1;\n float f3 = sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.1 + 10.3) * 0.1 + 0.1;\n\n // Build color.\n col = mix(BLACK, color1, f1);\n col = mix(col, color2, f2);\n col = mix(col, YELLOW, f3);\n\n // Fog.\n float far = 100.0;\n float fog = 1.0 - clamp(length(vWorldPos - cameraPosition) / 400.0, 0.0, 1.0);\n\n col = mix(fogColor, col, fog);\n\n // fade beginning and end\n float alpha = 0.0;\n alpha += smoothstep(0.0, 0.003, vUvs.y);\n alpha -= smoothstep(0.997, 1.0, vUvs.y);\n\n gl_FragColor = vec4(col, alpha * (fog * fog));\n}\n"},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\n\nvoid main() {\n vWorldPos = (modelMatrix * vec4(position, 1.0)).xyz;\n vUvs = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t,n){n(176),n(177);const r=new THREE.Vector3,i=new THREE.Vector3;if(AFRAME.registerComponent("supercurve",{schema:{debug:{default:!1}},init:function(){this.buffers={},this.curve=null,this.fullLength=null,this.indexes={},this.length=null,this.points=[]},play:function(){this.generateCurve(1500)},generateCurve:function(e){this.length=e,e+=200,this.fullLength=e,this.points.length=0,this.points.push(new THREE.Vector3(0,0,0)),this.points.push(new THREE.Vector3(0,0,-100));let t,n=100;for(let r=2;r<=Math.ceil(e/100)-1;r++)t=this.points[r-1],n+=100,this.points.push(new THREE.Vector3(t.x+(10*Math.random()*2-10),t.y+(10*Math.random()*2-10),-1*n));const r=new THREE.CatmullRomCurve3(this.points),i=e-r.getLength(),o=r.getTangent(1,new THREE.Vector3),a=this.points[this.points.length-1].clone().add(o.multiplyScalar(i));this.points.push(a),this.setCurve(this.points),this.el.emit("supercurvegenerate")},setCurve:function(e){const t=this.buffers,n=(this.data,this.el),o=this.indexes;this.points=e;const a=this.curve=new THREE.CatmullRomCurve3(e),s=a.getLength(),c=a.getSpacedPoints(350),l=s/350,u=new THREE.BufferGeometry;t.position=new Float32Array(2106),t.normal=new Float32Array(2106),t.uvs=new Float32Array(1404),o.position=0,o.normal=0,o.uvs=0;const h=new THREE.Vector3(-1.5,0,-1*l/2),d=new THREE.Vector3(1.5,0,-1*l/2);for(let e=0;e<c.length;e++){const a=e/(c.length-1),s=c[e];if(0===c[e].x&&0===c[e].y&&0===c[e].z?(c[e].set(.001,0,.001),i.y=-1*Math.abs(i.y)):(i.copy(r).cross(c[e]).normalize(),i.y=-1*i.y),this.getPositionRelativeToTangent(a,h,r),t.position[o.position++]=r.x,t.position[o.position++]=r.y,t.position[o.position++]=r.z,t.normal[o.normal++]=i.x,t.normal[o.normal++]=i.y,t.normal[o.normal++]=i.z,t.uvs[o.uvs++]=0,t.uvs[o.uvs++]=a,this.getPositionRelativeToTangent(a,d,r),t.position[o.position++]=r.x,t.position[o.position++]=r.y,t.position[o.position++]=r.z,t.normal[o.normal++]=i.x,t.normal[o.normal++]=i.y,t.normal[o.normal++]=i.z,t.uvs[o.uvs++]=1,t.uvs[o.uvs++]=a,this.data.debug){const e=document.createElement("a-box");e.setAttribute("geometry",{width:.1,height:.1,depth:.1}),e.setAttribute("material",{shader:"flat",color:"#333"}),e.object3D.position.copy(s),e.object3D.position.y+=.1,n.appendChild(e)}}if(u.setAttribute("normal",new THREE.BufferAttribute(t.normal,3)),u.setAttribute("position",new THREE.BufferAttribute(t.position,3)),u.setAttribute("uv",new THREE.BufferAttribute(t.uvs,2)),n.getObject3D("mesh"))n.getObject3D("mesh").geometry=THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode);else{const e=new THREE.Mesh(THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode));n.setObject3D("mesh",e)}},getPointAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getPointAt(e,t)},getTangentAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getTangentAt(e,t)},getPositionRelativeToTangent:function(){const e=new THREE.Object3D,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,o,a){this.curve;return e.parent||this.el.sceneEl.object3D.add(e),r<0?(this.getPointAt(0,e.position),this.getTangentAt(0,n),e.position.addScaledVector(n,r)):r>1?(this.getPointAt(1,e.position),this.getTangentAt(1,n),e.position.addScaledVector(n,r)):(this.getPointAt(r,e.position),this.getTangentAt(r,n)),a?e.lookAt(t.copy(e.position).sub(n)):e.lookAt(t.copy(e.position).add(n)),e.updateMatrixWorld(),o.copy(i),e.localToWorld(o),o}}(),alignToCurve:function(){new THREE.Vector3,new THREE.Vector3;const e=new THREE.Vector3(0,0,-.01),t=new THREE.Vector3;return function(n,r){this.getPositionRelativeToTangent(n,e,t),r.lookAt(t),r.position.y+=.01}}(),songProgressToCurveProgress:function(e){return e*this.length/this.fullLength},curveProgressToSongProgress:function(e){return e*this.fullLength/this.length}}),AFRAME.registerComponent("supercurve-follow",{schema:{enabled:{default:!1},speed:{type:"number"},target:{type:"selector"}},init:function(){this.curveProgress=0,this.songProgress=0},update:function(){this.supercurve=this.data.target.components.supercurve},tick:function(){new THREE.Vector3(0,0,1),new THREE.Vector3;return function(e,t){const n=this.data;this.el;if(!n.enabled||!t)return;if(this.curveProgress>=1)return;const r=this.supercurve,i=r.curve;if(!i)return;this.curveProgress=this.curveProgress||0;const o=n.speed*(t/1e3);if(this.curveProgress+=o/this.supercurve.fullLength,this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress,this.curveProgress>=1)return this.curveProgress=1,void(this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress);i.getPointAt(this.curveProgress,this.el.object3D.position),this.songProgress=r.curveProgressToSongProgress(this.curveProgress),r.alignToCurve(this.songProgress,this.el.object3D)}}()}),window.AFRAME){const t=["supercurve","supercurve-follow"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){const n=THREE.Math,r=THREE.Vector3,i=THREE.Matrix4;function o(){this.type="Curve",this.arcLengthDivisions=200}var a,s,c;Object.assign(o.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPoint(r/e));return n},getSpacedPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n},getLength:(c=[],function(){var e=this.getLengths(void 0,c);return e[e.length-1]}),getLengths:function(e,t){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1,t&&(t.length=0);var n,r,i=t||[],o=this.getPoint(0),a=0;for(i.push(0),r=1;r<=e;r++)a+=(n=this.getPoint(r/e)).distanceTo(o),i.push(a),o=n;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},getTangent:(a=new THREE.Vector3,s=new THREE.Vector3,function(e,t){var n,r=e-1e-4,i=e+1e-4;return r<0&&(r=0),i>1&&(i=1),this.getPoint(r,a),this.getPoint(i,s),t?(n=t).copy(s).sub(a):n=s.clone().sub(a),n.normalize()}),getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var o,a,s,c=new r,l=[],u=[],h=[],d=new r,p=new i;for(o=0;o<=e;o++)a=o/e,l[o]=this.getTangentAt(a),l[o].normalize();u[0]=new r,h[0]=new r;var f=Number.MAX_VALUE,m=Math.abs(l[0].x),g=Math.abs(l[0].y),y=Math.abs(l[0].z);for(m<=f&&(f=m,c.set(1,0,0)),g<=f&&(f=g,c.set(0,1,0)),y<=f&&c.set(0,0,1),d.crossVectors(l[0],c).normalize(),u[0].crossVectors(l[0],d),h[0].crossVectors(l[0],u[0]),o=1;o<=e;o++)u[o]=u[o-1].clone(),h[o]=h[o-1].clone(),d.crossVectors(l[o-1],l[o]),d.length()>Number.EPSILON&&(d.normalize(),s=Math.acos(n.clamp(l[o-1].dot(l[o]),-1,1)),u[o].applyMatrix4(p.makeRotationAxis(d,s))),h[o].crossVectors(l[o],u[o]);if(!0===t)for(s=Math.acos(n.clamp(u[0].dot(u[e]),-1,1)),s/=e,l[0].dot(d.crossVectors(u[0],u[e]))>0&&(s=-s),o=1;o<=e;o++)u[o].applyMatrix4(p.makeRotationAxis(l[o],s*o)),h[o].crossVectors(l[o],u[o]);return{tangents:l,normals:u,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),THREE.Curve=o},function(e,t){const n=THREE.Vector3,r=THREE.Curve;function i(){var e=0,t=0,n=0,r=0;function i(i,o,a,s){e=i,t=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,a,s){var c=(t-e)/o-(n-e)/(o+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+s)+(r-n)/s;i(t,n,c*=a,l*=a)},calc:function(i){var o=i*i;return e+t*i+n*o+r*(o*i)}}}var o=new n,a=new i,s=new i,c=new i;function l(e,t,n,i){r.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.prototype.isCatmullRomCurve3=!0,l.prototype.getPoint=function(e,t){var r,i,l,u,h=t||new n,d=this.points,p=d.length,f=(p-(this.closed?0:1))*e,m=Math.floor(f),g=f-m;if(this.closed?m+=m>0?0:(Math.floor(Math.abs(m)/p)+1)*p:0===g&&m===p-1&&(m=p-2,g=1),this.closed||m>0?r=d[(m-1)%p]:(o.subVectors(d[0],d[1]).add(d[0]),r=o),i=d[m%p],l=d[(m+1)%p],this.closed||m+2<p?u=d[(m+2)%p]:(o.subVectors(d[p-1],d[p-2]).add(d[p-1]),u=o),"centripetal"===this.curveType||"chordal"===this.curveType){var y="chordal"===this.curveType?.5:.25,v=Math.pow(r.distanceToSquared(i),y),b=Math.pow(i.distanceToSquared(l),y),_=Math.pow(l.distanceToSquared(u),y);b<1e-4&&(b=1),v<1e-4&&(v=b),_<1e-4&&(_=b),a.initNonuniformCatmullRom(r.x,i.x,l.x,u.x,v,b,_),s.initNonuniformCatmullRom(r.y,i.y,l.y,u.y,v,b,_),c.initNonuniformCatmullRom(r.z,i.z,l.z,u.z,v,b,_)}else"catmullrom"===this.curveType&&(a.initCatmullRom(r.x,i.x,l.x,u.x,this.tension),s.initCatmullRom(r.y,i.y,l.y,u.y,this.tension),c.initCatmullRom(r.z,i.z,l.z,u.z,this.tension));return h.set(a.calc(g),s.calc(g),c.calc(g)),h},l.prototype.copy=function(e){r.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},l.prototype.toJSON=function(){var e=r.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},l.prototype.fromJSON=function(e){r.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var o=e.points[t];this.points.push((new n).fromArray(o))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},THREE.CatmullRomCurve3=l},function(e,t,n){if(AFRAME.registerShader("superCutFxShader",{schema:{startTime:{type:"float",is:"uniform"},timeMs:{type:"time",is:"uniform"},color:{type:"color",is:"uniform"}},vertexShader:"\n varying vec2 uvs;\n varying vec3 worldPos;\n void main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:"\n uniform float startTime;\n uniform float timeMs;\n uniform vec3 color;\n varying vec2 uvs;\n varying vec3 worldPos;\n\n void main() {\n float time = (timeMs - startTime) / 2000.0;\n vec2 p = uvs.xy - 0.5;\n float r = p.x * p.x + p.y * p.y;\n float alpha = 1.0 - smoothstep(time - 0.01, time, r);\n alpha *= smoothstep(time - 0.1, time, r);\n alpha *= 1.0 - time * 5.5;\n gl_FragColor = vec4(color, alpha);\n }\n "}),window.AFRAME){const t=[],n=["superCutFxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercutfx",{schema:{colorPrimary:{type:"string"},colorSecondary:{type:"string"}},init:function(){this.rigEl=document.getElementById("curveFollowRig"),this.startTime=-1100},createSuperCut:function(e,t){const n=this.el,i=this.el.getObject3D("mesh");i.material.transparent=!0,this.rigEl.object3D.worldToLocal(n.object3D.position.copy(e.position)),n.object3D.position.z-=.25,n.object3D.visible=!0,this.startTime=n.sceneEl.time,r.set("red"===t?this.data.colorPrimary:this.data.colorSecondary);const o=i.material.uniforms.color.value;o.x=r.r,o.y=r.g,o.z=r.b,i.material.uniforms.startTime.value=this.startTime-50,n.play()},tick:function(e){e>this.startTime+1e3&&(this.el.object3D.visible=!1,this.el.pause())}}),window.AFRAME){const t=["supercutfx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tail",{schema:{height:{default:.1},segments:{default:10,type:"int"},target:{type:"selector"},width:{default:1}},init:function(){const e=this.data,t=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,e.segments,1);t.deleteAttribute("normal"),t.translate(e.width/2,0,0);const n=this.el.sceneEl.systems.materials.handStarTrail,r=new THREE.Mesh(t,n);r.frustumCulled=!1,this.el.setObject3D("mesh",r),this.positions=t.attributes.position.array,this.numVerts=2*e.segments+2,this.geometry=t,this.target=e.target.object3D,this.targetPos=new THREE.Vector3},tick:function(e,t){const n=this.positions,r=this.targetPos;let i,o=this.numVerts/2*3,a=this.data.height/2;for(let e=this.numVerts/2-1;e>0;e--)i=3*e,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1],i+=o,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1];this.target.getWorldPosition(r),n[0]=r.x,n[1]=r.y+a,n[2]=r.z-.1,n[o+0]=r.x,n[o+1]=r.y-a,n[o+2]=r.z-.1,this.geometry.attributes.position.needsUpdate=!0}}),window.AFRAME){const t=["tail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-counter",{dependencies:["text"],schema:{decimals:{default:0},dur:{default:2e3,type:"int"},enabled:{default:!1},emit:{default:!1},prefix:{default:""},suffix:{default:""},value:{default:0,type:"float"}},init:function(){this.currentValue=0,this.hasCompleted=!1,this.textValue={value:""}},update:function(e){this.currentValue=0,this.textValue.value=`${this.data.prefix}${this.decimals(0)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue),this.hasCompleted=!1},tick:function(e,t){this.data.enabled&&!this.hasCompleted&&(this.currentValue+=this.data.value*(t/this.data.dur),this.currentValue>=this.data.value&&(this.currentValue=this.data.value,this.data.emit&&this.el.emit("textcounterdone",null,!1),this.hasCompleted=!0),this.textValue.value=`${this.data.prefix}${this.decimals(this.currentValue)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue))},decimals:function(e){var t=Math.pow(10,this.data.decimals);return(parseInt(e*t)/t).toFixed(this.data.decimals)}}),window.AFRAME){const t=["text-counter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-truncate",{schema:{value:{type:"string"},length:{type:"int",default:10}},update:function(){this.el.setAttribute("text","value",function(e,t){if(!e)return"";if(e.length>=t)return e.substring(0,t-3)+"...";return e}(this.data.value,this.data.length))}}),window.AFRAME){const t=["text-truncate"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-uppercase",{schema:{value:{type:"string"}},update:function(){this.el.setAttribute("text","value",this.data.value.toUpperCase())}}),window.AFRAME){const t=["text-uppercase"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("toggle-pause-play",{schema:{isPlaying:{default:!1}},update:function(){const e=this.data.isPlaying?"pause":"play";parent.postMessage(JSON.stringify({verify:"game-action",action:e}),"*")}}),window.AFRAME){const t=["toggle-pause-play"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerComponent("trail",{schema:{color:{default:"primary"},colorScheme:{default:"default"},enabled:{default:!1},hand:{type:"string"}},init:function(){const e=this.geometry=new THREE.BufferGeometry,t=this.maxPoints=12,n=this.vertices=new Float32Array(36*t),r=this.colors=new Float32Array(48*t);this.bladeColor={alpha:1},this.rigContainer=document.getElementById("rigContainer"),this.bladeEl=this.el.querySelector(".blade"),this.layers=0,this.bladeTrajectory=[{top:new THREE.Vector3(-.5,0,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(.5,0,0)},{top:new THREE.Vector3(-.5,.5,0),center:new THREE.Vector3(0,.5,0),bottom:new THREE.Vector3(.5,.5,0)},{top:new THREE.Vector3(-.5,1,0),center:new THREE.Vector3(0,1,0),bottom:new THREE.Vector3(.5,1,0)}],this.newSample=null,e.setAttribute("position",new THREE.BufferAttribute(n,3).setUsage(THREE.DynamicDrawUsage)),e.setAttribute("vertexColor",new THREE.BufferAttribute(r,4).setUsage(THREE.DynamicDrawUsage));const i=new THREE.ShaderMaterial({side:THREE.DoubleSide,vertexColors:THREE.VertexColors,transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,vertexShader:["varying vec4 vColor;","attribute vec4 vertexColor;","void main() {","vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);","vColor = vertexColor;","gl_Position = projectionMatrix * modelViewPosition;","}"].join(""),fragmentShader:["varying vec4 vColor;","uniform float pulse;","void main() {","gl_FragColor = vec4(vColor.xyz, vColor.a + pulse);","}"].join(""),uniforms:{pulse:{value:0}}}),o=this.mesh=new THREE.Mesh(e,i);o.frustumCulled=!1,o.vertices=n,this.rigContainer.setObject3D("trail__"+this.data.hand,o)},update:function(e){if(this.mesh.visible=this.data.enabled,!e.enabled&&this.data.enabled&&(this.enabledTime=this.el.sceneEl.time),e.colorScheme!==this.data.colorScheme){this.bladeColor=new THREE.Color(i.a.schemes[this.data.colorScheme][this.data.color]);this.bladeColor.red=this.bladeColor.r,this.bladeColor.green=this.bladeColor.g,this.bladeColor.blue=this.bladeColor.b}},tock:function(e,t){this.data.enabled&&(!this.mesh.visible&&e>this.enabledTime+250&&(this.mesh.visible=!0),this.mesh.material.uniforms.pulse.value*=.9,this.sampleBladePosition())},pulse:function(){this.mesh.material.uniforms.pulse.value=1},addLayer:function(e){const t=this.bladeColor,n=this.colors,r=this.segments,i=this.vertices;let o=2/r;this.layers>=this.maxLayers&&(this.layers=0);const a=this.layers*e;e=a+e;const s=this.layers*r*18,c=this.layers*r*24;for(let l=0;l<r;++l)i[s+18*l]=l*o-1,i[s+18*l+1]=a,i[s+18*l+2]=0,n[c+24*l]=t.red,n[c+24*l+1]=t.green,n[c+24*l+2]=t.blue,n[c+24*l+3]=t.alpha,i[s+18*l+3]=l*o-1,i[s+18*l+4]=e,i[s+18*l+5]=0,n[c+24*l+4]=t.red,n[c+24*l+5]=t.green,n[c+24*l+6]=t.blue,n[c+24*l+7]=t.alpha,i[s+18*l+6]=l*o-1+o,i[s+18*l+7]=e,i[s+18*l+8]=0,n[c+24*l+8]=t.red,n[c+24*l+9]=t.green,n[c+24*l+10]=t.blue,n[c+24*l+11]=t.alpha,i[s+18*l+9]=l*o-1+o,i[s+18*l+10]=a,i[s+18*l+11]=0,n[c+24*l+12]=t.red,n[c+24*l+13]=t.green,n[c+24*l+14]=t.blue,n[c+24*l+15]=t.alpha,i[s+18*l+12]=l*o-1,i[s+18*l+13]=a,i[s+18*l+14]=0,n[c+24*l+16]=t.red,n[c+24*l+17]=t.green,n[c+24*l+18]=t.blue,n[c+24*l+19]=t.alpha,i[s+18*l+15]=l*o-1+o,i[s+18*l+16]=e,i[s+18*l+17]=0,n[c+24*l+20]=t.red,n[c+24*l+21]=t.green,n[c+24*l+22]=t.blue,n[c+24*l+23]=t.alpha;this.layers++,this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0},initGeometry:function(){const e=this.bladeColor,t=this.geometry.attributes.vertexColor.array,n=this.geometry.attributes.position.array,r=this.bladeTrajectory;let i,o,a;for(let s=1;s<r.length;s++){1===s&&(o=i),i=1-(r.length-s)/r.length;const c=r[s];a=r[s-1],n[36*s]=a.center.x,n[36*s+1]=a.center.y,n[36*s+2]=a.center.z,t[48*s]=e.red,t[48*s+1]=e.green,t[48*s+2]=e.blue,t[48*s+3]=.2*o,n[36*s+3]=c.top.x,n[36*s+4]=c.top.y,n[36*s+5]=c.top.z,t[48*s+4]=e.red,t[48*s+5]=e.green,t[48*s+6]=e.blue,t[48*s+7]=i,n[36*s+6]=a.top.x,n[36*s+7]=a.top.y,n[36*s+8]=a.top.z,t[48*s+8]=e.red,t[48*s+9]=e.green,t[48*s+10]=e.blue,t[48*s+11]=o,n[36*s+9]=a.center.x,n[36*s+10]=a.center.y,n[36*s+11]=a.center.z,t[48*s+12]=e.red,t[48*s+13]=e.green,t[48*s+14]=e.blue,t[48*s+15]=.2*o,n[36*s+12]=c.center.x,n[36*s+13]=c.center.y,n[36*s+14]=c.center.z,t[48*s+16]=e.red,t[48*s+17]=e.green,t[48*s+18]=e.blue,t[48*s+19]=.2*i,n[36*s+15]=c.top.x,n[36*s+16]=c.top.y,n[36*s+17]=c.top.z,t[48*s+20]=e.red,t[48*s+21]=e.green,t[48*s+22]=e.blue,t[48*s+23]=i,n[36*s+18]=a.bottom.x,n[36*s+19]=a.bottom.y,n[36*s+20]=a.bottom.z,t[48*s+24]=e.red,t[48*s+25]=e.green,t[48*s+26]=e.blue,t[48*s+27]=0,n[36*s+21]=c.center.x,n[36*s+22]=c.center.y,n[36*s+23]=c.center.z,t[48*s+28]=e.red,t[48*s+29]=e.green,t[48*s+30]=e.blue,t[48*s+31]=.2*i,n[36*s+24]=a.center.x,n[36*s+25]=a.center.y,n[36*s+26]=a.center.z,t[48*s+32]=e.red,t[48*s+33]=e.green,t[48*s+34]=e.blue,t[48*s+35]=.2*o,n[36*s+27]=a.bottom.x,n[36*s+28]=a.bottom.y,n[36*s+29]=a.bottom.z,t[48*s+36]=e.red,t[48*s+37]=e.green,t[48*s+38]=e.blue,t[48*s+39]=0,n[36*s+30]=c.bottom.x,n[36*s+31]=c.bottom.y,n[36*s+32]=c.bottom.z,t[48*s+40]=e.red,t[48*s+41]=e.green,t[48*s+42]=e.blue,t[48*s+43]=0,n[36*s+33]=c.center.x,n[36*s+34]=c.center.y,n[36*s+35]=c.center.z,t[48*s+44]=e.red,t[48*s+45]=e.green,t[48*s+46]=e.blue,t[48*s+47]=.2*i,o=i}this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0},sampleBladePosition:function(){let e;this.bladeTrajectory.length===this.maxPoints?(e=this.newSample=this.bladeTrajectory.shift(),e.top.set(0,-.5,0),e.center.set(0,0,0),e.bottom.set(0,.5,0)):this.newSample?(this.newSample.top.set(0,-.5,0),this.newSample.center.set(0,0,0),this.newSample.bottom.set(0,.5,0),e=this.newSample):e={top:new THREE.Vector3(0,-.5,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(0,.5,0)};const t=this.bladeEl.object3D;t.localToWorld(e.top),t.localToWorld(e.center),t.localToWorld(e.bottom),this.rigContainer.object3D.worldToLocal(e.top),this.rigContainer.object3D.worldToLocal(e.center),this.rigContainer.object3D.worldToLocal(e.bottom),this.bladeTrajectory.push(e),this.initGeometry()}}),window.AFRAME){const t=["trail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tunnels",{dependencies:["pool_tunnels"],schema:{isPlaying:{default:!1},songDuration:{default:0}},init:function(){this.addTunnel=this.addTunnel.bind(this),this.clearTunnels=this.clearTunnels.bind(this),this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.timeout=0,this.tunnels=[],this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.el.addEventListener("cleargame",this.clearTunnels),this.el.addEventListener("gamemenuexit",this.clearTunnels),this.el.addEventListener("gamemenurestart",this.clearTunnels)},update:function(e){!e.isPlaying&&this.data.isPlaying&&this.requestTunnel(),e.isPlaying&&!this.data.isPlaying&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},play:function(){this.pool=this.el.components.pool__tunnels},requestTunnel:function(){this.timeout=setTimeout(this.addTunnel,Math.floor(3e3+1e4*Math.random()))},addTunnel:function(){const e=this.pool.requestEntity();if(!e)return;e.setAttribute("render-order","tunnel"),e.object3D.visible=!0;const t=this.curveEl.components.supercurve;let n=(this.el.components.song.getCurrentTime()+20)/this.data.songDuration;n>1&&(n=1),t.getPointAt(n,e.object3D.position),t.alignToCurve(n,e.object3D),e.play(),this.tunnels.push(e),this.requestTunnel()},clearTunnels:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);for(let e=0;e<this.tunnels.length;e++)this.tunnels[e].object3D.visible=!1,this.pool.returnEntity(this.tunnels[e]);this.tunnels.length=0},tick:function(e,t){if(0!=this.tunnels.length)for(let e=0;e<this.tunnels.length;e++){if(!(this.tunnels[e].object3D.position.z>this.curveFollowRig.object3D.position.z+5))return;{const t=this.tunnels.splice(e,1)[0];t.object3D.visible=!1,this.pool.returnEntity(t)}}}}),window.AFRAME){const t=["tunnels"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=new THREE.Color;if(AFRAME.registerComponent("vertex-colors-buffer",{schema:{baseColor:{type:"color"},itemSize:{default:3}},update:function(e){var t,n,i,o,a=this.data,s=this.el,c=this;if((o=this.el.getObject3D("mesh"))&&o.geometry)if((i=o.geometry).attributes.position){for(i.attributes.color||i.setAttribute("color",new THREE.BufferAttribute(new Float32Array(i.attributes.position.array.length),3)),t=i.attributes.color.array,r.set(a.baseColor),n=0;n<t.length;n+=a.itemSize)t[n]=r.r,t[n+1]=r.g,t[n+2]=r.b;i.attributes.color.needsUpdate=!0}else console.warn("Geometry has no vertices",s);else s.addEventListener("object3dset",(function t(n){"mesh"===n.detail.type&&(s.removeEventListener("object3dset",t),c.update(e))}))}}),window.AFRAME){const t=["vertex-colors-buffer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("victory-accuracy-ring",{dependencies:["geometry","material"],schema:{accuracy:{default:0}},update:function(){this.el.getObject3D("mesh").material.uniforms.progress.value=0,this.el.setAttribute("animation","to",this.data.accuracy/100),this.el.components.animation.beginAnimation()}}),window.AFRAME){const t=["victory-accuracy-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={sphericalEnvMap:"",roughness:.8,metalness:.4},i={sphericalEnvMap:"#envmapImg",roughness:.2,metalness:.6};if(AFRAME.registerComponent("victory-rank",{schema:{isVictory:{default:!1},rank:{type:"string"}},update:function(e){const t=this.el,n=this.data.rank;if(e.isVictory&&!this.data.isVictory&&this.el.object3D.scale.set(.001,.001,.001),n)switch(t.setAttribute("text-geometry","value",n),n[0]){case"S":t.setAttribute("material",Object.assign({color:"#F0e077"},i));break;case"A":t.setAttribute("material",Object.assign({color:"#6FF9EA"},i));break;case"B":t.setAttribute("material",Object.assign({color:"#F8d"},i));break;case"C":t.setAttribute("material",Object.assign({color:"#F971C3"},r));break;case"D":t.setAttribute("material",Object.assign({color:"#1E6269"},r));break;case"F":t.setAttribute("material",Object.assign({color:"#e3170a"},r))}}}),window.AFRAME){const t=["victory-rank"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("visible-raycastable",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data,this.data?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable","")}}),window.AFRAME){const t=["visible-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerShader("wallShader",{schema:{colorTertiary:{type:"color",is:"uniform",default:r.initial.tertiary},environment:{type:"map",is:"uniform",default:"#envmapImg"},hitLeft:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},hitRight:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},iTime:{type:"time",is:"uniform"},opacity:{type:"number",is:"uniform"}},vertexShader:n(192),fragmentShader:n(193)}),window.AFRAME){const t=[],n=["wallShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\nvoid main() {\n uvs.xy = uv.xy;\n nrml.xyz = normal.xyz;\n vec4 p = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n worldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = p;\n}\n"},function(e,t){e.exports="uniform float iTime;\nuniform float opacity;\nuniform sampler2D environment;\nuniform vec3 colorTertiary;\nuniform vec3 hitLeft;\nuniform vec3 hitRight;\nvarying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\n#define SEED 19.1252\n#define time (3.0 + iTime) / 1000.0\n\nfloat noise(vec3 uv) {\n return fract(sin(uv.x*123243. + uv.y*424. + uv.z*642. + SEED) * 1524.);\n}\n\nvec4 drawHit(vec3 p, vec3 center, vec3 color) {\n center.z -= 0.1;\n float dist = 1.0 - smoothstep(0.0, 0.3, length(p - center));\n float glitch = noise(floor(p*3.0)) * 0.06 - 0.03;\n float alpha = 1.0 - smoothstep(0.0, 0.01, abs(p.z-center.z + glitch));\n alpha += 1.0 - smoothstep(0.0, 0.01, abs(p.y-center.y + glitch));\n return vec4(color * dist, alpha * dist + alpha);\n}\n\nvoid main() {\n vec2 uv1 = uvs.xy-0.5;\n float alpha = 0.0;\n // border\n alpha += smoothstep(0.44, 0.50, abs(uv1.x));\n alpha += smoothstep(0.44, 0.50, abs(uv1.y));\n alpha += smoothstep(0.486, 0.49, abs(uv1.x));\n alpha += smoothstep(0.486, 0.49, abs(uv1.y));\n alpha = min(1.0, alpha * 0.5);\n\n // weapon collision\n vec4 hit;\n hit = drawHit(worldPos, hitRight, colorTertiary);\n hit += drawHit(worldPos, hitLeft, colorTertiary);\n\n // reflection\n vec3 ray = reflect(normalize(cameraPosition - worldPos + sin(worldPos.z) * 0.1 + cos(worldPos.z * 0.3) * 0.3), nrml);\n float m = 2.0 * sqrt(pow(ray.x, 2.0) + pow(ray.y, 2.0) + pow(ray.z, 2.0));\n vec2 uv = ray.xy / m + 0.5;\n vec3 col = texture2D(environment, uv).rgb * 0.3;\n\n gl_FragColor = vec4(mix(col, colorTertiary, alpha) + hit.rgb, (alpha * 0.2 + 0.8) * opacity + hit.a);\n}\n"},function(e,t,n){"use strict";n.r(t);n(24);if(AFRAME.registerComponent("wall",{dependencies:["material"],init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.el.setObject3D("mesh",new THREE.Mesh),this.geometry=null,this.isCeiling=!1,this.isRaycastable=!1,this.localPosition=new THREE.Vector3,this.songPosition=void 0,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3)},play:function(){this.el.object3D.visible=!0},tick:function(e,t){const n=this.curveFollowRig.components["supercurve-follow"].songProgress;!this.isRaycastable&&n+.01>=this.songPosition&&(this.isRaycastable=!0,this.el.setAttribute("data-wall-active",""),this.isCeiling||(this.el.setAttribute("data-weapon-particles",""),this.el.setAttribute("raycastable-game",""))),n>=this.backPosition+.01&&this.returnToPool()},onGenerate:function(e,t,n,r,i,o){const a=this.el;this.isCeiling=i,this.backPosition=o,this.songPosition=e,this.setWallGeometry(e,t,n,r,i),a.getObject3D("mesh").material.uniforms.opacity.value=0,a.object3D.position.y=-5,a.components.animation__fadein.beginAnimation(),a.components.animation__scalein.beginAnimation()},setWallGeometry:function(){const e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,o,a,s){const c=this.el.sceneEl.components["beat-system"],l=this.curveEl.components.supercurve,u=r,h=r+a/l.length,d=s?1.5:2.5,p=-1*c.horizontalPositions[i]-o/2+.25;t.x=p-o/2,n.x=p+o/2;const f=(this.geometry=new THREE.BoxBufferGeometry(o,d,1,1,1,30)).attributes.position.array;for(let r=0;r<f.length;r+=3){const i=f[r+2]+.5;l.getPositionRelativeToTangent(u+i*(h-u),f[r]<0?t:n,e),f[r]=e.x,f[r+1]+=e.y+d/2,f[r+2]=e.z}let m=c.verticalPositions.middle+c.size/2;"punch"===c.data.gameMode&&(m-=.1),this.el.getObject3D("mesh").geometry=this.geometry,this.el.getObject3D("mesh").position.y=s?m:.1}}(),returnToPool:function(){this.el.object3D.visible=!1,this.el.removeAttribute("data-weapon-particles"),this.el.removeAttribute("data-wall-active"),this.el.removeAttribute("raycastable-game"),this.isCeiling=!1,this.isRaycastable=!1,this.el.isPlaying&&this.el.sceneEl.components.pool__wall.returnEntity(this.el),this.geometry&&this.geometry.dispose()}}),window.AFRAME){const t=["wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={direction:{x:0,y:-.25,z:-1}},i={direction:{x:0,y:1,z:-1}};if(AFRAME.registerComponent("weapon-particles",{schema:{enabled:{default:!1},gameMode:{default:""},hand:{type:"string"}},init:function(){this.hiddenIntersection={x:999,y:0,z:0},this.intersectedEl=null,this.weaponEnter=this.weaponEnter.bind(this),this.weaponLeave=this.weaponLeave.bind(this)},update:function(e){e.gameMode!==this.data.gameMode&&this.el.setAttribute("raycaster__game","punch"===this.data.gameMode?r:i)},pause:function(){this.el.removeEventListener("mouseenter",this.weaponEnter),this.el.removeEventListener("mouseleave",this.weaponLeave)},play:function(){this.el.addEventListener("mouseenter",this.weaponEnter),this.el.addEventListener("mouseleave",this.weaponLeave)},weaponEnter:function(e){this.data.enabled&&e.target===this.el&&e.detail.intersectedEl.hasAttribute("data-weapon-particles")&&(this.intersectedEl=e.detail.intersectedEl)},weaponLeave:function(e){if(e.detail.target===this.el){if(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id){const e=this.data.hand===RIGHT?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=this.hiddenIntersection}this.intersectedEl=null}},tick:function(e,t){if(!this.data.enabled||!this.intersectedEl)return;const n=this.el.components.raycaster__game.getIntersection(this.intersectedEl);if(n&&(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id)){const e="right"===this.data.hand?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=n.point}}}),window.AFRAME){const t=["weapon-particles"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){AFRAME.registerComponent("zip-loader",{schema:{difficulties:{type:"array"},isLoading:{default:"false"},version:{type:"string"},directDownload:{type:"string"},bpm:{type:"number"}},init:function(){this.loadingIndicator=document.getElementById("zipLoaderIndicator"),this.cachedZip=null,this.cachedVersion=null,this.message={},this.worker=new Worker("build/zip.js"),this.worker.onmessage=this.onMessage.bind(this),this.worker.onerror=console.error},update:function(e){const t=this.data;e.version&&e.version!==t.version&&this.cachedVersion!==t.version&&(this.message.abort=!0,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e.version,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)),t.version&&e.version!==t.version&&(this.cachedVersion=null,this.cachedZip=null,this.fetchZip(t.version)),e.isLoading||!this.data.isLoading||this.cachedVersion!==this.data.version||this.cachedZip||this.el.emit("songloaderror")},fetchZip:function(e){this.el.emit("ziploaderstart",null,!1),this.message.abort=!1,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)},onMessage:function(e){switch(e.data.message){case"error":this.el.emit("songloaderror");break;case"progress":if(e.data.version!==this.data.version)return;this.loadingIndicator.setAttribute("material","progress",e.data.progress);break;case"load":{let t;this.cachedVersion=e.data.version,this.cachedZip=e.data.data;const n=e.data.data.beats;for(t in n)break;if(!t)return this.cachedZip=null,void(e.data.version===this.data.version&&this.el.emit("songloaderror"));e.data.version===this.data.version&&this.el.emit("ziploaderend",e.data.data,!1);break}}}});if(window.AFRAME){const t=["zip-loader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={"./index.js":198};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=197},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r);n(6);const a=n(29),s={};let c=!1;const l={Easy:"Easy",Expert:"Expert",ExpertPlus:"Expert+",Hard:"Hard",Normal:"Normal"},u={},h={author:"Juancho Pancho",difficulty:"Expert",id:"31",image:"assets/img/molerat.jpg",songDuration:100,songName:"Friday",songLength:100,songSubName:"Rebecca Black"},d="true"===AFRAME.utils.getUrlParameter("skipintro"),p=localStorage.getItem("colorScheme")||"blue";let f=localStorage.getItem("favorites-v2");if(f)try{f=JSON.parse(f)}catch(e){f=[]}else f=[];function m(e){let t=Math.ceil(e.search.results.length/6);e.search.hasPrev=e.search.page>0,e.search.hasNext=e.search.page<t-1,e.search.songNameTexts="",e.search.songSubNameTexts="",e.searchResultsPage.length=0,e.searchResultsPage.__dirty=!0;for(let t=6*e.search.page;t<6*e.search.page+6;t++){const n=e.search.results[t];if(!n)break;e.searchResultsPage.push(n),e.search.songNameTexts+=g(n.metadata.songName,22).toUpperCase()+"\n",e.search.songSubNameTexts+=g(n.metadata.songSubName||n.metadata.songAuthorName||"Unknown Artist",32)+"\n"}for(let t=0;t<e.searchResultsPage.length;t++)e.searchResultsPage[t].index=t;E(e)}function g(e,t){return e?e.length>=t?e.substring(0,t-3)+"...":e:""}AFRAME.registerState({nonBindedStateKeys:["genres"],initialState:{activeHand:localStorage.getItem("hand")||"right",challenge:{audio:"",author:"",difficulty:"",beatmapCharacteristic:"",id:AFRAME.utils.getUrlParameter("challenge"),image:"",isBeatsPreloaded:!1,numBeats:void 0,songDuration:0,songName:"",songNameShort:"",songSubName:"",metadata:{}},colorPrimary:o.a.schemes[p].primary,colorScheme:p,colorSecondary:o.a.schemes[p].secondary,colorSecondaryBright:o.a.schemes[p].secondarybright,colorTertiary:o.a.schemes[p].tertiary,controllerType:"",damage:0,difficultyFilter:"All",difficultyFilterMenuOpen:!1,favorites:f,gameMode:"ride",genre:"",genres:n(199),genreMenuOpen:!1,has3DOFVR:!1,has6DOFVR:!1,hasSongLoadError:!1,hasVR:AFRAME.utils.device.checkHeadsetConnected()||"true"===AFRAME.utils.getUrlParameter("debugvr"),introActive:!d,inVR:"true"===AFRAME.utils.getUrlParameter("debugvr"),isIOS:AFRAME.utils.device.isIOS(),isGameOver:!1,isLoading:!1,isMenuOpening:!d,isPaused:!1,isPlaying:!1,isSearching:!1,isSongProcessing:!1,isVictory:!1,isZipFetching:!1,leaderboard:[],leaderboardFetched:!1,leaderboardQualified:!1,leaderboardNames:"",leaderboardScores:"",mainMenuActive:!1,menuActive:d,multiplayer:{active:!1,lobbyOpen:!1,roomCode:"",shareUrl:"",shareCopied:!1,isHost:!1,uid:"",status:"idle",players:[],playerCount:0,readyCount:0,everyoneReady:!1,myReady:!1,myRank:0,myRankText:"",leaderName:"",leaderScore:0,scoreDelta:0,scoreDeltaText:"",opponentText:"",opponentScores:"",hostName:"",hostUid:"",songName:"",lastError:"",joinCodeInput:"",countdownText:"",countdownActive:!1,keyboardOpen:!1,nameKeyboardOpen:!1,nameInput:"",row0Name:"",row0Score:"",row0Visible:!1,row0IsMe:!1,row0IsHost:!1,row0Ready:!1,row1Name:"",row1Score:"",row1Visible:!1,row1IsMe:!1,row1IsHost:!1,row1Ready:!1,row2Name:"",row2Score:"",row2Visible:!1,row2IsMe:!1,row2IsHost:!1,row2Ready:!1,row3Name:"",row3Score:"",row3Visible:!1,row3IsMe:!1,row3IsHost:!1,row3Ready:!1,resultsText:"",resultsScores:"",winnerName:""},menuDifficulties:[],menuDifficultiesIds:[],menuSelectedChallenge:{author:"",difficulty:"",beatmapCharacteristic:"",downloads:"",downloadsText:"",genre:"",id:"",index:-1,image:"",isFavorited:!1,numBeats:void 0,songDuration:0,songInfoText:"",songLength:void 0,numBeats:void 0,songName:"",songSubName:"",version:"",metadata:{}},optionsMenuOpen:!1,playlist:"",playlists:n(200),playlistMenuOpen:!1,playlistTitle:"",score:{accuracy:100,accuracyScore:0,accuracyInt:100,activePanel:!1,beatsHit:0,beatsMissed:0,beatsText:"",combo:0,finalAccuracy:100,maxCombo:0,rank:"",score:0},search:{activePanel:!0,page:0,hasError:!1,hasNext:!1,hasPrev:!1,query:"",queryText:"",results:[],songNameTexts:"",songSubNameTexts:"",url:"",urlPage:0},searchResultsPage:[],speed:10},handlers:{activehandswap:e=>{e.activeHand="right"===e.activeHand?"left":"right",localStorage.setItem("activeHand",e.activeHand)},beathit:(e,t)=>{e.damage>.25&&(e.damage-=.25),e.score.beatsHit++,e.score.combo++,e.score.combo>e.score.maxCombo&&(e.score.maxCombo=e.score.combo),t.score=isNaN(t.score)?100:t.score,e.score.accuracyScore+=t.percent,e.score.score+=Math.floor(t.score),T(e)},beatmiss:e=>{e.score.beatsMissed++,_(e),T(e)},beatwrong:e=>{e.score.beatsMissed++,_(e),T(e)},beatloaderpreloadfinish:e=>{e.menuActive||(e.challenge.isBeatsPreloaded=!0)},colorschemechange:(e,t)=>{e.colorScheme=t,e.colorPrimary=o.a.schemes[t].primary,e.colorSecondary=o.a.schemes[t].secondary,e.colorSecondaryBright=o.a.schemes[t].secondarybright,e.colorTertiary=o.a.schemes[t].tertiary,localStorage.setItem("colorScheme",t)},controllerconnected:(e,t)=>{e.controllerType=t.name,e.has6DOFVR=-1!==["oculus-quest-controls","oculus-touch-controls","vive-controls","windows-motion-controls","generic-tracked-controller-controls"].indexOf(e.controllerType),e.has3DOFVR=-1!==["oculus-go-controls","daydream-controls"].indexOf(e.controllerType)},debugbeatpositioning:e=>{e.gameMode="classic",e.introActive=!1,e.menuActive=!1},debuggameplay:e=>{w(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.menuSelectedChallenge.id="",e.isSearching=!1,e.isLoading=!1},debuggameover:e=>{e.isGameOver=!0,e.menuActive=!1},debugloading:e=>{h.id="-1",Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.menuActive=!1,e.isSongProcessing=!0},debugvictory:e=>{Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.isVictory=!0,e.leaderboardQualified=!0,e.menuActive=!1,e.score.accuracy=74.99,e.score.beatsHit=125,e.score.beatsMissed=125,e.score.maxCombo=123,e.score.rank="A",e.score.score=9001,e.introActive=!1,A(e)},difficultyfilter:(e,t)=>{e.difficultyFilter=t,e.difficultyFilterMenuOpen=!1,e.menuSelectedChallenge.id=""},difficultyfiltermenuclose:e=>{e.difficultyFilterMenuOpen=!1},difficultyfiltermenuopen:e=>{e.difficultyFilterMenuOpen=!0},displayconnected:e=>{if(e.hasVR=!0,!c)try{"getVRDisplays"in navigator&&navigator.getVRDisplays().then(e=>{e.length&&(c=!0)})}catch(e){}},favoritetoggle:e=>{const t=e.menuSelectedChallenge.id,n=s[t];if(n)if(e.menuSelectedChallenge.isFavorited){e.menuSelectedChallenge.isFavorited=!1;for(let n=0;n<e.favorites.length;n++)if(e.favorites[n].id===t)return e.favorites.splice(n,1),void localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}else{if(e.menuSelectedChallenge.isFavorited=!0,e.favorites.filter(e=>e.id===t).length)return;e.favorites.push(n),localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}},gamemenuresume:e=>{e.isPaused=!1},gamemenurestart:e=>{w(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isLoading=!0,e.isVictory=!1,e.leaderboardQualified=!1},gamemenuexit:e=>{w(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isVictory=!1,e.menuActive=!0,e.menuSelectedChallenge.id=e.challenge.id,e.menuSelectedChallenge.difficulty=e.challenge.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=e.challenge.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=e.challenge.difficultyId,e.challenge.id="",e.leaderboardQualified=!1,e.multiplayer.active&&(e.multiplayer.lobbyOpen=!0)},gamemode:(e,t)=>{e.gameMode=t},genreclear:e=>{e.genre="",e.menuSelectedChallenge.id=""},genreselect:(e,t)=>{e.genre=t,e.genreMenuOpen=!1,e.menuSelectedChallenge.id="",e.playlist="",e.search.query=""},genremenuclose:e=>{e.genreMenuOpen=!1},genremenuopen:e=>{e.genreMenuOpen=!0},keyboardclose:e=>{e.isSearching=!1},keyboardopen:e=>{e.isSearching=!0,e.menuSelectedChallenge.id=""},leaderboard:(e,t)=>{e.leaderboard.length=0,e.leaderboardFetched=!0,e.leaderboardNames="",e.leaderboardScores="";for(let n=0;n<t.scores.length;n++){let r=t.scores[n];e.leaderboard.push(r),e.leaderboardNames+=`#${n+1} ${g(r.username,18)} (${Math.round(r.accuracy||0)}%)\n`,e.leaderboardScores+=r.score+"\n"}e.leaderboardLoading=!1},leaderboardqualify:e=>{e.has6DOFVR&&(e.leaderboardQualified=!0)},leaderboardscoreadded:(e,t)=>{for(let n=0;n<e.leaderboard.length;n++)if(t.scoreData.score>=e.leaderboard[n].score||n>=e.leaderboard.length-1){e.leaderboard.splice(n,0,t.scoreData);break}e.leaderboardNames="",e.leaderboardScores="";for(let t=0;t<e.leaderboard.length;t++){let n=e.leaderboard[t];e.leaderboardNames+=`${n.username} (${n.accuracy||0}%)\n`,e.leaderboardScores+=n.score+"\n"}},leaderboardsubmit:e=>{e.leaderboardQualified=!1},menuback:e=>{e.difficultyFilterMenuOpen=!1,e.genreMenuOpen=!1,e.isSearching=!1,e.optionsMenuOpen=!1,e.playlistMenuOpen=!1},menuchallengeselect:(e,t)=>{let n=s[t];if(!n)return;Object.assign(e.menuSelectedChallenge,n),e.menuSelectedChallenge.songName=g(n.metadata.songName,24),e.menuDifficulties.length=0,e.menuDifficultiesIds.length=0;const r=JSON.parse(n.metadata.characteristics);for(const t of Object.keys(r))if(!["90Degree","360Degree"].includes(t))for(const n of Object.keys(r[t])){if(null===r[t][n])continue;let i=l[n],o=i;"Standard"!==t&&(o=t+"\n"+o),e.menuDifficulties.unshift({id:t+"-"+n,filename:n+t,difficultyName:i,renderName:o,beatmapCharacteristic:t,difficulty:n})}e.menuDifficulties.sort(b);for(const t of e.menuDifficulties)e.menuDifficultiesIds.push(t.id);const i=e.menuDifficulties[0];e.menuSelectedChallenge.difficulty=i.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=i.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=i.id,e.menuSelectedChallenge.image=e.menuSelectedChallenge.coverURL,S(e,n),e.challenge.audio="",E(e),e.isSearching=!1;const o=!!e.favorites.filter(e=>e.id===t).length;e.menuSelectedChallenge.isFavorited=o,x(e),e.leaderboardLoading=!0,e.hasSongLoadError=!1,u[t]&&(e.hasSongLoadError=!0)},menuchallengeunselect:e=>{e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficultyId="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",x(e)},menudifficultyselect:(e,t)=>{let n;for(const r of e.menuDifficulties)if(r.id===t){n=r;break}e.menuSelectedChallenge.difficultyId=t,e.menuSelectedChallenge.difficulty=n.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=n.beatmapCharacteristic,S(e,e.menuSelectedChallenge),x(e),e.leaderboardLoading=!0},menuopeningend:e=>{e.isMenuOpening=!1},minehit:e=>{_(e)},optionsmenuopen:e=>{e.optionsMenuOpen=!0},mpopen:e=>{e.multiplayer.lobbyOpen=!0,e.multiplayer.active=!0,e.multiplayer.status="idle",e.multiplayer.lastError="","ride"===e.gameMode&&(e.gameMode="classic")},mpclose:e=>{e.multiplayer.lobbyOpen=!1,e.multiplayer.active=!1,e.multiplayer.status="idle"},mpcodeinput:(e,t)=>{const n="string"==typeof t?t:t&&t.value||"";e.multiplayer.joinCodeInput=n.toUpperCase().slice(0,4)},mpnameinput:(e,t)=>{const n="string"==typeof t?t:t&&t.value||"";e.multiplayer.nameInput=n.slice(0,14)},mpkeyboardopen:e=>{e.multiplayer.keyboardOpen=!0},mpkeyboardclose:e=>{e.multiplayer.keyboardOpen=!1},mpnamekeyboardopen:e=>{e.multiplayer.nameKeyboardOpen=!0,e.multiplayer.nameInput=localStorage.getItem("threewsusername")||""},mpnamekeyboardclose:e=>{e.multiplayer.nameKeyboardOpen=!1},mpconnecting:e=>{e.multiplayer.status="connecting",e.multiplayer.lastError=""},mproomjoined:(e,t)=>{e.multiplayer.roomCode=t.code,e.multiplayer.isHost=!!t.isHost,e.multiplayer.status="lobby",e.multiplayer.lobbyOpen=!0,e.multiplayer.active=!0},mproomleft:e=>{e.multiplayer.roomCode="",e.multiplayer.isHost=!1,e.multiplayer.status="idle",e.multiplayer.players.length=0,e.multiplayer.players.__dirty=!0,e.multiplayer.playerCount=0,e.multiplayer.readyCount=0,e.multiplayer.everyoneReady=!1,e.multiplayer.opponentText="",e.multiplayer.opponentScores=""},mperror:(e,t)=>{e.multiplayer.lastError=t&&t.message||"Error","connecting"===e.multiplayer.status&&(e.multiplayer.status="idle")},mproomupdate:(e,t)=>{e.multiplayer.uid=t.uid,e.multiplayer.isHost=!!t.isHost,e.multiplayer.hostUid=t.hostUid||"",e.multiplayer.status=t.status||e.multiplayer.status,e.multiplayer.songName=t.song&&t.song.songName||"",e.multiplayer.players.length=0,e.multiplayer.players.__dirty=!0;const n=t.players.slice(),r=n.slice().sort((e,t)=>(0|t.score)-(0|e.score)),i={};r.forEach((e,t)=>{i[e.uid]=t+1});let a=0,s=!1,c=0,l=r[0]||null,u="",h="",d="",p="",f="";for(let r=0;r<n.length;r++){const i=n[r];e.multiplayer.players.push(i),i.ready&&a++,i.uid===t.uid&&(s=!!i.ready),i.uid===t.hostUid&&(u=i.name)}c=i[t.uid]||0;for(let e=0;e<r.length;e++){const n=r[e],i=Math.round(n.accuracy||0)+"%",o=n.uid===t.uid?" (YOU)":"",a=n.finished?" ✓":"";n.uid!==t.uid&&(h+=`#${e+1} ${g(n.name,12)} ${i}${a}\n`,d+=(0|n.score)+"\n"),p+=`#${e+1} ${g(n.name,14)}${o} ${i}\n`,f+=(0|n.score)+"\n"}for(let r=0;r<4;r++){const i=n[r],a="row"+r;if(!i){e.multiplayer[a+"Name"]="",e.multiplayer[a+"Score"]="",e.multiplayer[a+"Visible"]=!1,e.multiplayer[a+"IsMe"]=!1,e.multiplayer[a+"IsHost"]=!1,e.multiplayer[a+"Ready"]=!1,e.multiplayer[a+"NameColor"]="#ffffff",e.multiplayer[a+"ScoreColor"]="#ffffff",e.multiplayer[a+"BgOpacity"]=0;continue}const s=i.uid===t.uid,c=i.uid===t.hostUid,l=(c?"★ ":"")+g(i.name,14)+(s?" (YOU)":""),u="lobby"===e.multiplayer.status?i.ready?"READY":"...":(0|i.score)+" "+Math.round(i.accuracy||0)+"%"+(i.finished?" ✓":"");e.multiplayer[a+"Name"]=l,e.multiplayer[a+"Score"]=u,e.multiplayer[a+"Visible"]=!0,e.multiplayer[a+"IsMe"]=s,e.multiplayer[a+"IsHost"]=c,e.multiplayer[a+"Ready"]=!!i.ready,e.multiplayer[a+"NameColor"]=s?o.a.schemes[e.colorScheme].secondarybright:"#ffffff",e.multiplayer[a+"ScoreColor"]=i.ready?"#5dff80":"#ffffff",e.multiplayer[a+"BgOpacity"]=s?.18:.06}e.multiplayer.playerCount=n.length,e.multiplayer.readyCount=a,e.multiplayer.everyoneReady=n.length>=2&&a===n.length,e.multiplayer.myReady=s,e.multiplayer.myRank=c,e.multiplayer.myRankText=c?"#"+c+" / "+n.length:"",e.multiplayer.leaderName=l?l.name:"",e.multiplayer.leaderScore=l?0|l.score:0;const m=n.find(e=>e.uid===t.uid),y=(m?0|m.score:0)-(l?0|l.score:0);e.multiplayer.scoreDelta=y,e.multiplayer.scoreDeltaText=l&&l.uid!==t.uid?(y>=0?"+"+y:String(y))+" vs leader":l&&l.uid===t.uid&&n.length>1?"LEADING":"",e.multiplayer.opponentText=h,e.multiplayer.opponentScores=d,e.multiplayer.resultsText=p,e.multiplayer.resultsScores=f,e.multiplayer.winnerName=r.length&&r[0].score>0?r[0].name:"",e.multiplayer.hostName=u},mpcountdown:(e,t)=>{e.multiplayer.countdownText=t&&t.value||"",e.multiplayer.countdownActive=!(!t||!t.active)},mpsharelinkcopied:e=>{e.multiplayer.shareCopied=!0},mpsharelinkcleared:e=>{e.multiplayer.shareCopied=!1},mpremotesongselect:(e,t)=>{Object.assign(e.menuSelectedChallenge,{id:t.id,difficulty:t.difficulty,beatmapCharacteristic:t.beatmapCharacteristic,difficultyId:t.difficultyId,songName:t.songName,songSubName:t.songSubName,image:t.image,version:t.version,directDownload:t.directDownload,downloads:t.downloads,downloadsText:t.downloadsText,songDuration:t.songDuration,metadata:t.metadata||{}}),s[t.id]=e.menuSelectedChallenge},mpremoteplaystart:e=>{e.menuSelectedChallenge.id&&(w(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.multiplayer.lobbyOpen=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...")},pausegame:e=>{e.isPlaying&&(e.isPaused=!0)},playbuttonclick:e=>{if(""===e.menuSelectedChallenge.id)return;if(u[e.menuSelectedChallenge.id])return;let t="frontpage";e.playlist&&(t="playlist"),e.search.query&&(t="search"),e.genre&&(t="genre"),gtag("event","songsource",{event_label:t}),w(e),Object.assign(e.challenge,e.menuSelectedChallenge),gtag("event","difficulty",{event_label:e.challenge.difficulty}),e.menuActive=!1,e.multiplayer.lobbyOpen=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...",gtag("event","colorscheme",{event_label:e.colorScheme})},playlistclear:(e,t)=>{e.menuSelectedChallenge.id="",e.playlist=""},playlistselect:(e,t)=>{e.genre="",e.menuSelectedChallenge.id="",e.playlist=t.id,e.playlistTitle=t.title,e.playlistMenuOpen=!1,e.search.query=""},playlistmenuclose:e=>{e.playlistMenuOpen=!1},playlistmenuopen:e=>{e.playlistMenuOpen=!0},searcherror:(e,t)=>{e.search.hasError=!0},searchprevpage:e=>{0!==e.search.page&&(e.search.page--,m(e))},searchnextpage:e=>{e.search.page>Math.floor(e.search.results.length/6)||(e.search.page++,m(e),void 0!==e.search.url&&e.search.page+3>Math.floor(e.search.results.length/6)&&(e.search.urlPage=e.search.urlPage+1,fetch(e.search.url.replaceAll("CURRENT_PAGE_INDEX",e.search.urlPage)).then(e=>e.json()).then(t=>{var n=(t.docs||t.maps).map(a);for(e.search.results.push(...n),i=0;i<n.length;i++){let e=n[i];s[e.id]=e}})))},searchresults:(e,t)=>{var n;for(e.search.hasError=!1,e.search.page=0,e.search.url=t.url,e.search.urlPage=t.urlPage,e.search.query=t.query,e.search.queryText=g(t.query,10),e.search.results=t.results||[],n=0;n<e.search.results.length;n++){let t=e.search.results[n];s[t.id]=t}m(e),e.menuSelectedChallenge.id="",e.isSearching&&(e.genre="",e.playlist="")},songcomplete:e=>{if(gtag("event","songcomplete",{event_label:e.gameMode}),"ride"===e.gameMode||!e.inVR)return e.challenge.isBeatsPreloaded=!1,e.isVictory=!1,e.menuActive=!0,void(e.challenge.id="");e.isVictory=!0,e.score.score=isNaN(e.score.score)?0:e.score.score,T(e),e.score.finalAccuracy=e.score.accuracy;const t=parseFloat(e.score.accuracy);e.score.rank=t>=97?"S":t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F",A(e)},songloadcancel:e=>{e.challenge.isBeatsPreloaded=!1,e.challenge.audio="",e.challenge.id="",e.challenge.version="",e.isZipFetching=!1,e.isLoading=!1,e.isSongProcessing=!1,e.menuActive=!0},songloaderror:e=>{u[e.menuSelectedChallenge.id||e.challenge.id]=!0,e.hasSongLoadError=!0,e.loadingText="Sorry! There was an error loading this song.\nPlease select another song.",e.challenge.id="",e.challenge.isBeatsPreloaded=!1,e.isSongProcessing=!1,e.isZipFetching=!1},songprocessfinish:e=>{e.isSongProcessing=!1,e.isLoading=!1},songprocessstart:e=>{e.isSongProcessing=!0,e.loadingText="Wrapping up..."},"enter-vr":e=>{e.inVR=AFRAME.utils.device.checkHeadsetConnected(),AFRAME.utils.device.isMobile()||(gtag("event","entervr",{}),AFRAME.utils.device.isOculusBrowser()&>ag("event","oculusbrowser",{}))},"exit-vr":e=>{e.inVR=!1,e.isPlaying&&(e.isPaused=!0)},startgame:e=>{e.introActive=!1,e.menuActive=!0},victoryfake:e=>{e.score.accuracy="74.99",e.score.rank="C"},wallhitstart:e=>{_(e)},ziploaderend:(e,t)=>{e.challenge.audio=t.audio,e.hasSongLoadError=!1,e.menuSelectedChallenge.version="",e.isZipFetching=!1},ziploaderstart:e=>{e.challenge.isBeatsPreloaded=!1,e.isZipFetching=!0}},computeState:e=>{e.isPlaying=!(e.menuActive||e.isLoading||e.isPaused||e.isVictory||e.isGameOver||e.isZipFetching||e.isSongProcessing||!e.challenge.id||e.introActive);const t=e.menuActive||e.isPaused||e.isVictory||e.isGameOver||e.isLoading||e.introActive;e.leftRaycasterActive=t&&"left"===e.activeHand&&e.inVR,e.rightRaycasterActive=t&&"right"===e.activeHand&&e.inVR,e.mainMenuActive=e.menuActive&&!e.genreMenuOpen&&!e.difficultyFilterMenuOpen&&!e.playlistMenuOpen&&!e.optionsMenuOpen&&!e.isSearching,e.score.active="ride"!==e.gameMode&&e.inVR&&(e.isPlaying||e.isPaused),e.mpActive=!!e.multiplayer.active,e.mpCanStart=!e.multiplayer.active||e.multiplayer.isHost&&e.multiplayer.players.length>=2,e.mpHostControl=!e.multiplayer.active||e.multiplayer.isHost,e.mpLobbyVisible=e.multiplayer.lobbyOpen&&e.menuActive&&!e.isMenuOpening,e.mpHudVisible=e.multiplayer.active&&e.multiplayer.players.length>1&&(e.isPlaying||e.isPaused||e.isLoading),e.mpResultsVisible=e.multiplayer.active&&e.isVictory&&e.multiplayer.players.length>1,e.mpInRoom=!!e.multiplayer.roomCode,e.mpInLobbyPhase=e.mpInRoom&&"lobby"===e.multiplayer.status,e.mpCountdownVisible=e.multiplayer.countdownActive,e.mpKeyboardOpen=e.multiplayer.keyboardOpen,e.mpNameKeyboardOpen=e.multiplayer.nameKeyboardOpen,e.mpRoomCodeText=e.multiplayer.roomCode?"ROOM "+e.multiplayer.roomCode:"",e.mpShareButtonText=e.multiplayer.shareCopied?"LINK COPIED":"COPY SHARE LINK",e.mpShareButtonColor=e.multiplayer.shareCopied?"#5dff80":"#FFFFFF",e.mpReadyButtonText=e.multiplayer.myReady?"UNREADY":"READY",e.mpReadyButtonColor=e.multiplayer.myReady?"#5dff80":"#FFFFFF",e.mpReadyButtonBrightness=e.multiplayer.myReady?.5:.2,e.mpJoinButtonText=e.multiplayer.joinCodeInput?"JOIN "+e.multiplayer.joinCodeInput:"JOIN ROOM",e.mpRankHudText=e.multiplayer.myRankText?"RANK "+e.multiplayer.myRankText:"",e.mpDeltaColor=e.multiplayer.scoreDelta>=0?"#5dff80":"#ff8080",e.mpStatusText=e.multiplayer.lastError?e.multiplayer.lastError:"connecting"===e.multiplayer.status?"Connecting...":"idle"===e.multiplayer.status?"Create a room or paste a code.":"finished"===e.multiplayer.status?"Round over.":e.multiplayer.players.length<2?e.multiplayer.isHost?"Share the room code below — waiting for a friend.":"Waiting for another player...":e.multiplayer.isHost?e.multiplayer.songName?'Press PLAY to start "'+e.multiplayer.songName+'".':"Pick a song from the menu, then press PLAY.":e.multiplayer.songName?'Host queued "'+e.multiplayer.songName+'". Get ready.':"Waiting for host to pick a song...",e.mpWinnerBanner=e.multiplayer.winnerName?e.multiplayer.winnerName===(e.multiplayer.players.find(t=>t.uid===e.multiplayer.uid)||{}).name?"YOU WON!":e.multiplayer.winnerName.toUpperCase()+" WINS":""}});const y=["easy","normal","hard","expert","expertPlus"],v=["Standard"];function b(e,t){const n=y.indexOf(e.difficulty),r=y.indexOf(t.difficulty);if(n<r)return-1;if(n>r)return 1;const i=v.indexOf(e.beatmapCharacteristic),o=v.indexOf(t.beatmapCharacteristic);return i>o?-1:i<o?1:0}function _(e){e.isPlaying&&e.inVR&&(e.score.combo=0)}function w(e){e.damage=0,e.score.accuracy=100,e.score.accuracyInt=100,e.score.accuracyScore=0,e.score.beatsHit=0,e.score.beatsMissed=0,e.score.finalAccuracy=100,e.score.combo=0,e.score.maxCombo=0,e.score.score=0}function E(e){e.menuSelectedChallenge.index=-1;for(let t=0;t<e.searchResultsPage.length;t++)if(e.searchResultsPage[t].id===e.menuSelectedChallenge.id){e.menuSelectedChallenge.index=t;break}}function A(e){e.score.beatsText=`${e.score.beatsHit} / ${e.score.beatsMissed+e.score.beatsHit} BEATS`}function x(e){e.leaderboard.length=0,e.leaderboard.__dirty=!0,e.leaderboardNames="",e.leaderboardScores="",e.leaderboardFetched=!1}function S(e,t){let n=JSON.parse(t.metadata.characteristics)[e.menuSelectedChallenge.beatmapCharacteristic][e.menuSelectedChallenge.difficulty];e.menuSelectedChallenge.songInfoText=`Mapped by ${g(t.metadata.levelAuthorName,55)}\n${t.genre&&"Uncategorized"!==t.genre?t.genre+"\n":""}${function(e){e/=60;const t=""+Math.floor(e);var n=Math.round(60*(e-t));return n<10&&(n="0"+n),`${t}:${n}`}(t.metadata.duration)} / ${n.notes} notes\n${n.bombs} bombs | ${n.obstacles} obstacles\nNJS: ${n.njs}`}function T(e){const t=e.score.beatsHit+e.score.beatsMissed;e.score.accuracy=e.score.accuracyScore/(100*t)*100,e.score.accuracy=isNaN(e.score.accuracy)?100:e.score.accuracy,e.score.accuracy=e.score.accuracy.toFixed(2),e.score.accuracyInt=parseInt(e.score.accuracy)}},function(e,t){e.exports=[{name:"Pop",row:1,column:1},{name:"R&B",row:1,column:2},{name:"Rap",row:1,column:3},{name:"Rock",row:1,column:4},{name:"Soundtrack",row:1,column:5},{name:"Video Games",row:1,column:6},{name:"Electronic",row:2,column:1},{name:"Hip Hop",row:2,column:2},{name:"House",row:2,column:3},{name:"J-Pop",row:2,column:4},{name:"K-Pop",row:2,column:5},{name:"Meme",row:2,column:6},{name:"Alternative",row:3,column:1},{name:"Anime",row:3,column:2},{name:"Comedy",row:3,column:3},{name:"Dubstep",row:3,column:5},{name:"Dance",row:3,column:6}]},function(e,t){e.exports=[{name:"favorites",author:"You!",title:"Your Saved Favorites"},{name:"3966",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 1"},{name:"3967",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 2"},{name:"3968",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 3"},{name:"4134",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 4"},{name:"4135",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 5"},{name:"7483",author:"BeastSaber",title:"Maps Of The Weeks"},{name:"4137",author:"BeastSaber",title:"Curator's Picks of 2020"},{name:"4139",author:"BeastSaber",title:"Curator's Picks of 2021"},{name:"11584",author:"BeastSaber",title:"Curator's Picks of 2022"},{name:"4405",author:"BeastSaber",title:"Intro to Dance"},{name:"4138",author:"BeastSaber",title:"Mom's Maps"}]},function(e,t,n){var r=n(21);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0},o=n(206)(r,i);r.locals&&(e.exports=r.locals),e.hot.accept(21,(function(){var t=n(21);if("string"==typeof t&&(t=[[e.i,t,""]]),!function(e,t){var n,r=0;for(n in e){if(!t||e[n]!==t[n])return!1;r++}for(n in t)r--;return 0===r}(r.locals,t.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");o(t)})),e.hot.dispose((function(){o()}))},function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(o).concat([i]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU0AAAGDCAMAAACYzLIyAAACWFBMVEUAAAAAkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8BkP8AkP8AkP8AkP8AkP8Bkf8AkP8AkP8Dkf8BkP8BkP8Bkf8Vj/y44P8Rl///drb/drZx/+n/drZx/+n/drb/drZx/+n/drf/drZw/+pu/upx/+n/drdx/+lWtv//drb/drbL6f9w/+r+drdx/+n/drZw/+pu/utx/+ll9exMsv9x/+lx/+lw/+r/drb/drb/drb8drf+drdx/+nh8v9q+uzR7P9w/+phu//e8f8wpf9s++qJzP8Ek/9w/urZ7v9v/url9P9x/+n9drf/drb9drdDrv9x/+l2w/9uwf9u/eps++px/+mt3P//drY7qv//drZ7xv/2d7ml2P9x/+knov9x/+m+4//W7f+03/9I1/H8drf/drYru/iZ0/+AyP/B5P//drZx/+kXp/tpvv/t9/86yvX/draU0P8gnv/+drbp9v//drZ+g9xx/+mSgdZK2fHF5v9x/+nWe8Py+f8Xp/uQz///drYbnP/3/P+f1f9x/+kVpfsxwPZO3vD/drbfecArjPMwi/IktPncesBx/+lV5e9Wh+dx/+khjfY9iu5+g9ucgNMajvhx/+mDyf8Kmv6+fcmOgte4fcr/dra5fcpGiexOiOkpjPSwfs1J2PEVpfuIgtkpufcouPj/drb/drbteLzSe8MPoPyof89KiesPoPzreLxghuQ8y/Rx/+n/drZx/+kktPnGfMc9zfNLierleb64fctd7O3oeL1x/+n/drZb6vj/////drZx/+lv/exr+vEkKZq9AAAAw3RSTlMAeUKEWG9nmlCMKho2YJMVCkolDyEwOgbfoXqEZ5R3Zm6EN0xPI4xUk7iNROZEH1qcLjacCbRgbT8qYFoVP3zxFepKvO+rD8ygVu0p83EPdTCxOsPCHRng2uCuJcUK1+2poeHt3Q8Zox7Rx+LvmEC+9xazz6cG9cVD8g8i5Lkm+SvN6qX806lINy+sQGRXLzfASDW0XEwhFWf4yFIvLBrmIVRDQjYpYjYlUdjPbF5YThhsU0xJx7rOW1RBKUlCPGTZ+uxEzOy6AABDfElEQVR42uycz05iSRTGZ2zaK9oiyP9HuAlb1oQAoUPYEFkQQowBN8pCEw0rE2NsX6Jfhxeb+nu/W/dUUVywp3smfGaSnhm7+9SvvnOq6lThXwcddNBBBx100EEHHXTQ/1dVKfYL8XXQrhzzxQuiIlNeijP+jxGuCnPkDUUDqv6ykeQ5ybOzUulSqyR1FgmAdSx/INiqAKix6YjPrJJD+fQQFMnL09NyufxNqqx0GiliDLgg+1vQgmAE0MRXUu44NYQB8bF8LtFqUZP8VqkcWVThijOO2CbJ/mto4UAABD/g4+bQqiQkhsMHAqKfgPKCoWQkBcjCSUKFk4JUgm/E9jSG1qwIn12cYEAHQM0P8IygC1psUBgRGwmI7ssSKDnITOac6ZjpHMpEigE2nAuyFtcCraa7HV+sHrQAugEa9LQ3Mg6J0YDonjzzjGWEMsMxfhX6+++vho6FANlgywSyEVomghZ0FWGIAVO64F8GO1IACUAnPxkuj/vYKjEWEAXP3YzJWLI/SaJkFJm+GPob+sq/TLwgC7RGPTAKAuhiMaMqSV1KRb+tDH4OgOAHdCpcETuEEYmhRETBc0djMpYFFgdHyUFms9lcXFmIMJZsCVmgBVvDtsZiRlVWwuIBfFsANPCZ3sgmpIcSEd2DZ14Yk7EEylwQBL3mw9Ws359djR86YXM07U0DCIQB17CtURAIWs6WqgIdWSUWDvBzAxQy6eWEAof4aMQQROgxnvnUMIUxOUvlyiBo9petNdGP18dht92YT67v+vdXnXA01YAJWiSQja1WcsNwor/ELyOBHfh5AFJ+YdgZz/pvd9eT2/lLo90edFut1nA47C4aL/Pr/jj8HkREwbN0VkwFs8hgCmMKliyGYPrWXm+r4YDB/XibPYSjUcy2IGthaxR/LY4pjkyvG2AHfG6AhN99/25yu2wPho/+odz+7Eii4MntWaymgMlLpjImz/Bev7HeUY+tdqPGbHvVaY6QQVwGW7qUQQliICe+gM/lwGYzHN+/fUzmjUWL8vNr+PHQ+R7nWUG2bwXz8rRypIzJWALlfnplpl3eCrRhs0nQgi0IQxQb4AFfDOCMObD20u6uPiP04Rg8GU6S7X6Yyphg+bladdsvtclHfzYGWuAVhDlkUzmgM1aPUZNnMCuAt0s48FM1fNA8o2zfEmZZw2T18tfApAWB1/1btpS9sbVszLwLwoZGTE2ObvazLxYPRq+LAvgrNZT5/lVm+3Y48wZMsPwN+vHjx+vr4+NqOGQL7Wr1+Mr+w/p3ahh+z3Gc5wpnfput0R8C80/UkONkPAXO0kV1i32mhvm9vT4oifM9kNl+wmonct0HMxs8d9cHEa1Ytiuc5c2ls3pxBpi91fogm1oC53nGVzqLZ0jz6ev6oA04UTqd1iyVjwqqZrbWNrUn/auHsPNwxTYoT3yHUls2xBHt/yDWcli1uNarVw/OLErnZmueu1fzWg+ba7P1Uq8/T5v8BMwPcN3/Ro1gh94XdjITx4dp771eNwc07Uxart8aBqJ0FljpdJkzr6zpgFmb1gO2eyXCOYVLx9JrdmZ9djJZDNd/kIaLxu31089xOOpJeOgjUuXYOJpPbetEPMvSCXPSPNfWzFpgtkOGMiu6p0rOIzTYRrYNx/2732Ta4YB3XRjA6bMGCHwwh7UlIIi+12y5HjCcMKcrz4U1e9SYQU6ijPpl7BfiS+grRWwYN27aUXjF+xGNwWe7FhksHHjPAN5ogOBH6dF+1Vc5IEk0F9RrNpzZjeZUeQ5rmjC/SJQZ0qxFt5b0u0GWoIVr75+ub18Wrdfd6Q15/4QXwAfJzwswjo7bQinZSD0Wtw4Onh2rOZHol3oJCtemur1AHU8zJwV6k8CVQAy2IOtGq9m+30ybohn+9DFhu4X5fPnSYA3xxaDb7Q4W7XajsZzXbieT6+uPJ7Z2dFj1Y/A0PSQwADr4GfBOINyoF+RY2BgUT4KzazcnEr1yZF2CGu+ydSJRiiuwb5C+sqnYr7koWTda9Cm9QlsU+NwGpHfT9HJafknJwaiLb9XlfU4m7BjmtCY6r5o0zxeBPugLlOJ69hI3sNY7WMAFWQPtOWELup57RAjswM8LMIaPacMVaZmNhAMVPGFPak4ciMhe80s2uQRNoybUtzJ/QnIBmdfcArKMQs0sMgimpWhhW+D1Ceho/aP3zLjahCEZSAEw+dwPAxJjETyVPecmmCtpzool1bHX7CcXoKzKct6+vyjK+6UqF148crE3NppkQQGLl3f9CsXz8MLcLVCp/2l7uhOvfjCgiAZFJ/EkBgYpSmE88lkg56nsmavbzMmaH6WLPFmDsNckq7lq3pcuJEoqwZKhlCRF2IbdzFcoRj2AcSBjccWX+Hfr2gF8yGAzGi4Y2QimzHgWi/bHv5KntGc2meth7otahxKVM88TXVhzav6Outj08yzHPZ2dpQw+o98rJRMTr1AK3BRlvBcCWgEXKjDKkGIGgR593kSjcQdzBJ7WoTEyah+ewPkUSKN9wyYJK3pBrEEvNM/FysX+PjvMvGSp39jI90rJJUStGGIQaginqLVKxpuYCv8i4v9Vy3yNiwJIohHh2IMRQAVP1/iYPy/Leu9Yp6l+LMyZJ2VTJPqNeZ4Mcho/Si3521T0Inh9Isup7XlPtxP4bkYOQg5BjsB4ZqnpArBLtrfiF0IkGrYc63ACvTnNIRg1uzL3ig634FxjmrPJcep1iNJM7txDmefuw31eZILeSOjYg/ro6mPeja7EXhe1p3GvLonqIUSOqEaVH5sFn+KvEvHo3xVNr9OftFuizfa6arGuYgfBsGgUz1OnPc8uxZmbmPNHL1qHyCLEvz14MqtmlOf2mpmXVtDRf5Ek+8u1VbUZH4QaAhyRtzxz9anKREdti6Z3X9sQDAOqeSIYV6uSmnPG1yFdOOkiFMwTVXNjnhfNt188+CaJnbRIxRDgCEzUjkKapI2m1mRANU+9bdncq2yaW07QtC5Cg3VMPVE1keckfLz9QnPAp8aMDQGOwAj2EdIE0TxvE03tWfNkwSDbaa4rc9ZdNL2LUJtZU31z3hk+Tl5+lvA8HOEawY5PJNNHUxP+lME4s73IzUnP3eONNM1j5SRQ5/pS0Rm+sgKJ3uPPEI7ACPaGWUgbDXiqYFylpxiVwpqdprGkX6olvbOOqc8THVXTHj5aAqk0H0lHYAT7w6QNilTJgmxHMHRhud7oTZwrjxnNWaIhKtZ/kLeHnwuaL+vUqt0EOTKCPWAiTULc5aRJFpXtCMakWbFk+gMIEZpoeeAcit2UM3xYIS1PMoI9YaY3Jr1eIMF4aCLT6Xbzbh3TCDS94e8/grPi3jBFxVzuGMxSvCcETgfNtrtu4pWhrSpgp09rMsJ/N2Zrx3qF6rwnzNruwXSnQY7iTE8TNXayjulZ0yyS3dd+4UMvfDnFeeu3wUSuIFX2pmlGU5c0T0HTOBl4w18s5xP+/LfR9Y7gfLfSiTzxRzMctBvLRrs79OMkqeKnWTW/90h879JDE2Y43xh++7o/GsWfpc8WG0eA9PIrfZ50WZ8DD7/Dh/6kuxEnTZV8tLJ8OM5CvhXrVfabjmB6I7Pc4bf7U9314pItMUZ04RpBNs1KlDZPum8MpP5ETXTpHD61UqSKddfjpxkf8CrI4hbJkllZe/jtn7yvYd4oCqQM6NjqiRuSXims6cmTbshQmtGICeZAW06cmNu9aLbigUQ08/bMmtpYdkTw8rrgGFe9fBDcoQvb79lxJUI0gElYGtFwxZ7EdFr2VMHcUpo/vTTRQloZg7TQjD/xHNDor2T0+tpF61x/9JX5c+FML/ghVZ4786Q7FhswFY0Ox3gSc2VZk6aWucVp8Z72NylNFhSP6XUNNUCTtKaM62XwV9Hrz3QX8GRCfixbjGA0sOOEH3bI8zqlMjCikTfr7B/jSYzt1W/3O51bP01fQ24e6O5mPmFNZBbN2Ph7pYq6MFP3h1HnETgtt3nFnfKcnIBWTRKN1JG+zdSn+kdyKiJzSzsZoHm8Hc1b0CTWRGaRo8S5vuPFdaL+cRbRCAb29DpPZ87ihjwf1APVtMwkoynLaDKq4xQ8tzxzi/cGSZr3oOlrb16DJu3ov1uMibdfFf6EAi9R9I9aKWSiptPQ5ustzUmrTkhgKmNyluLFz2UpFgyPRvCUk0uzPUzOLWhe0Z4lpSm/dbSO6U7QROed3DYRGgKmjF7+oCsl9WOA9AhEvRpQP6Q0ZxFVp01hCmOqaEoyGgRzxniiU09xNsjcRjTHW9M05/gtwLcm61SPwMQHEEX0xTz5uUolNQKV7cmtZz0awIWPI606FKY0pj0aRpTzFMmicHrmFv30By9NtN4dRcFXp9po/FZE9FXXzwOqRIa4ed3PnKg6dQtMfPLZGk1V8FSTC5zuuQUiYriMSbMKGzu3pubr46bt013k7Zd1BNoQ2aDpHEBxL2sCZqW8KRoxucDpnlt3+t4RmnQzRS8yUDVlnXqhCzLCBwsLTxgCt81kAIjNraLLmsO6iMb/EyPyfHI5TqSKa279NPOpLjIQvy3Pszr8EsJ3vFrShrBslJ7J9T0VYnZZsxkAJoxpn1zgzAahe25BM5GWH5rmWd57kZEFTSP+uqVoKpg6fJ8hMvI41SUD2HYdQqI8J/M8C5i+WYnjTOb6O+bWSfMaNFNeZCD+0L7xrnj6k8j26Kg/TmTXtqnuTpQuphYwvThlxVg55jZOMztybMnTXWTQ+JHnpEngtZW9dM6kHSreVHcnyhifdgZMD06VKsHMPbc44BiNswloprrIcMc/Jf1AL4mS8AO1ecOwg1MImWwvBtHUAqYXZ9me66McUIFmb3uaczdNxD8m1tR5Xt22kSb9QM15k8WmzOfvii1RwhRTSz8R+WCmOrrlLpq3dpoVAcrsxChMKi4aPzZ3aRu9qnRSa/2EHfxlE4liWvM8Q6bWnyqZc2rOeqzUFX2NIc8l2w/Q3BD/fco+L/xgM+ectFR9ZbNHrCnzHFO71c8sUubsmJmCwpmOJj5CYNLMKJo4L4kyDPWwBPnMQH9KA+oGrS5bls2ZxZqY2rRz+31oHgbBykszzZUl4jd3+AuJHPGnHABSne5xqSwR18ixOd3UwunYcNPCuT/NR3zgwPieOdlwoU6lM+cJUt3RlHGXzVNb2WnmvqS3JrbSODeSTNmJZttO0x1/Ty3CjjrlX5TRfqW3J25hhaU0T1JYk7R9QlvhLO9Fk16n00UI2yNHZvp3SUh1euvspWnrjw2MSp9ubplXsKrTTsVONBdraAiaznPqJMDhJaVIqvuXIXebBvsr91T46zA+4UM7vLvQHNhp+u9FUsePVA+WjuYAke8o3BFlM23ZwR+I4dFj+EV6mkZPpxVPujzaTO4WqF/+l+QdJBeRZ9lE2Uwfjb1wNoAgBU3fwxmnG6apy2b6lz2QZ/qHqcum72Zs8Hk0B3aaNUdephWtHah9oOk7pf/D3pnsphEEYTi77Sw2MUmARxhprpwRYhAR8gUNB4SQZYEvhgOWQD5ZiiySl8jr5MXSK383RdMzwwx2lkoUJ5HiFF9X9VJdXXXhGv4cliG4Z96e7j8uZXeuPtmAJ6PJV7BbT96URzxLxx02iV6aaRIO/VvS7M7Vcty0pN28h7nQbG63lrM8T5b+ZT+nqQrLaGqaM/lP96QZbg+jeeKb3ogctn7/rG0aBpX8XghLzLWDZqHz5vxJzZuRY9703ACnuBf6v6aXMPa+IA3uLH9sR/Vn7DfvitxvejMOfXUo8DDwXz0L3YOmd+zT5Hr48xf/9nM6rMnzBhioHA+q/5AYUidzDKnsiyHRBA73K2lvjpwzvikXvceLbwY5xDcBwB3fJN5A5pY0+Zvu2PvzvyD2LllhdOiuBjTHPpr+3GLnvVD/9C+5F1JD23LcC5F1j1ySQ5Cy5Dg2Oe8sw7zvLE/3ubNcpLuzxHeDozvuLNOcBXGkd5zUCrxPnz/6fbpO9oBv0vt00Iw8cQpytqAngUPlesweI9eDJiLRXA9MLf41k9gxMZQD5SF1HiUPCUlyrjykVHEWegqnCZxwrri4HLn2vjlyrWw5cirXue/KkXNsIqp0B0IrA9D1/6D5m8ep8jd7OeVv0ncZQzgKDR/SgJzzUQbdcP4xucVx1txi+DmtolchgOh+zr3hpFukPybvvfE1W947/VgdPHGhzkuLpHi3SBNMHMnfZDw79JuMVUFvMmp6Dn9XJgsLOXk6JvXIsah53wvhiUvm90JXytGfzHshOYefkYCqJwToYD+E59lv2ULi6+T12KO9ZbtdmdqAJ1XGesvW/k7esmFo3dtNerCk8WJ6GNjZ5aVBXjb631m+PNA7S4wunXI87ywxtHhyTkI02G46o0h0x+V7A4xnq0nfAC9vD/EGWIxuaXuV4M/kDbCj+AANANN3gf5lCBPnGcwBHQscT6o/S56+9+ndQ7xPV2+qNVA8Txfvqd3v01tW8YQybl3cNVL8NHtY13y1E0i1gkPWTggdtRPUe/9zrU5Zl05Qb/1dtRPu7cIeWH+b7iXd39mhg8rFqOuBt6IEp7Oux6fNuh6NA9T10KP75b1WB2U9vqxLmW+r4lM3is6QvaGfJk5qcxK+VMbsqznTXR6d0Joz57rMi6fmTC+3mjPQRo4u1LFKzhzrgkJH7e01ZxAYw2am5VnSaYjL9WTcWw/p1qhA9HGjHhJTv9h6SONt2sjRNQoivTDKIemK0cF3oowZF3NvtH84lnRgQqiePCsmtbpmO2p1vdqo1XVccK2ubQXqump0jWJdZqkuVVuq4ShrB9Okjo7rX3cnMWenDDigXUcuoh/AqtxmNWh8U2QdOVTBsSTi2iigTJQqGiXqntnSNurI2YdYe4kOcEOe9MlMD4tDshqHgf4ETNDekqvvrHE42bPGobt8ZTQ/OjXV4T+Ngot9f41D4uj+aZNeqro3Lv76myOj/uZr8UOXvOzN4eTEGDLW3/SUVo1adQGUiVV+k/n43F9/c1ePjAWmzV3R7NB13ktcG/bnUHVnEqK7NxVTG9Zf9jcK1sVhURo2iBKVUYZpEl9sYdr0VCNwGGeKusU3U6tucS++nORVtzhDSeroIa7rwsVBEC+A0lu3uGQGq/zTJg1xNV0nvlK6mtrN8TXrMjuozrq51tTOWi69ETW/qZLaPpibMxvCAd5pk3a0dG5lc6/3Hq6IMaTHWVS9d3xW130eps3E3VZr5l6QfoDlAXoRoG+Yr3x+e5JZmWab9CKAH5Ibh8CaNqnGpBMwjBPWc7g+GRXV++7MENnSDmTz0wYjC5j2+WBO+6dj2tzVpTogxomZrdAeLgDJIKIv40a/RYYVTIk2+fVwgZ/TGp8BbQKcqnstDIj2FwrCDOq3SX8hxZGDZAjRM3SjFygnC6a5dDua1cnIOmp2wzTh6J5odstzPMje+wrqk95XFebXkuO5arjN5AWRL5wsmJbLlb20QZF6jCxgump2T+3m6Z62jSH1dUyd2fuyQX3Sl02SFBzRM5y32T+G8D+hYfd7wVT0zS5l1gYzpjmy3nNK4M8UrewwTkydsM78egYqknbvdbt9vRY07EbLbm6iWbVBjzv0DESzTscZuvF1vQZVnqU3Tkyd6JdI+1muqkns8ifpZwmSmqPu0v2aCvtbDVW37JYmSrprdprJlEGQG5+OfTgFE37uWoP8xhm4DtNfxOg5e60GHqDVIem1ii72du91dAnRov/GYGp1lbe1YeoMqwmUwQUMOpVKU9cwt5smkuOSGyei8BIn/k9XH+D6Q+hQfir7AEN95lgCJUgyjqRJ96kSNOwGU3SVF0AtbcTwLvuOPsD9JZThTg4vR9d0AyY1TWw2fcZJo6+hjpvBH2iPagWUER1dzoyAVzS+iYdbelTL+y70jTdB6ibd7V7Qn47iVlAftpeqeziYWl3l2TeENmp4OdFVwNSZRHffvn+7iyazy1F9ZSijeyrLT4WG8B8Bk5om1qBsxhliR4Zm4+7+6YLEqj0cXq1qte3905VVHptd7DXHWo8BaDaQwYDu4dcPrTa+o9VVnn9T9KIn/dO1nBJlVFIFPpCYMVwwYZqVpOn9FOdXtBsQ5lne2dv/xNPbn6PEP3oOu75qPVQjb4O/6o3qyC6+M4ByA/2sBmnD2qELVeYcLLV542hF/Rymmcg44euQ5gp7XO5UmmdZ8YTHYg0xVg44Jb+QtVFqnwxuwlTnqTkzUmVnJhsxgUAbqKN0sZVRXfElS0y9Moti/Gubn8M0ExknfN2QyRLeTnnaqwkTsqvRCwY+q5zddN/4cZaY3kNPmqjltwKotUtQComvHyxl3srPAZYvcPE/JKHZi6/kmJ3wpiV0xAawIsuMI60J2TNaW269mVHQYZUcZau6T1yyv1JAbQOFNsfq7lR+OYYy8iPwhA7JEk6OEyr1czz78Bqn8nUnTmO3qJUpVbh9npHzjBacXDBZAuWqE/7aV+7nzEKpgUKbF+Iynf+C4746mFYYSrDEcaqH3b9hmghZlNLetEwcBzHwVCc7EXfEWVvELJjK8oc6VZsosT3tz/ZGiaAUNVChDUIo/IsMm2i9Ncq3YImj/j5+TiPr7Z2nbJjAuY47lhEHYoIwmvY6oMTRKTe572810HOhDoRHn7QFlNYowdJycgrzNX2m6/d1rES087nJE14jI7oI8vIor0CqSWqUjnNfIQYqgdope2zUhYhAqkJps+zNXDDT+DkNRYWOuAsyjrC8KDuEVeqULqz0mCx/OmISec+gGO63wibXVD+JiDRQguUSw0xhws/T4MRKtJvnG+w2pCDGqziuSWIJjzH2BUh1CQOFcnK+hCCQivkHsTw3TLyMynLn377byRMpXAwbYyfXTv47xNY0SeyGCpZqoLVTymFjoQUbD4VSsryCcm6Y8PO0K9HJ0dWFZ46SRFVIF0FexNbWJFOuO41uOL6+XHTieNR5uLkcDMZ3UWKgnCeGWyDlTLVop7Hmn55Lu+8tEyb8PNVKJFOZV66PEI5ULEYiVYJDkB0TqtUTbCwRdUKyyymXdRZOMPox7ibb1CugONhaaZASpDn/ONW7aB+dZIVJrwHdFGbTtiaKeC6ivDqCUxv+JOdGT7fzUzQNh+iAUK8+TZKHMI7JcCMNEl6DzZrTy0+eZ4NJLiWB0yHVUa+mA10QZVC1dqszaCa2yVgltG0G2+1BEkx7wU0CovfTZQ0hUQicxjeVXygvzwgTOBF/7jV2K92t/pi2hiyWqYK8VyzK2+ovqvBJP8lOHcmWRj7tB+ai/Av/qS1KEmU2OkpiorNFa1Ujwy2dphZ0sMFwGKb08mww8fgMT+dYbCrhnPft7uIWifnJUc7ryibpLHcs5JUULG0qrbUXJ8s9Gj/M61eMqZbaVT1eSJv0GCbCuplg0haF8PYipBtroyQr8AtbPq7jU2aP+3pyD7i9aHSb4aRxgbC+1zC1l+P+O53gybG5FrUL4dnt1I3s9M3d4XtLsEtURPWJvx4DaH5yEWjDxAPnPaS8kZLSC3NnaaCUNklOLudacIIBUQEUBpovS2WY8HICM/taJHj2wzxRsq0QUHKSeHh2vg5UnCnRx2uOFXedxnVvfZQHUEyYOqFmLy+na9F7MwOhFeaEsi/MEihlgEJ3O8e714oU8XuRzyk7suPyxzDQICeeDckShgkv3xen8PZ8eXan8HDcd+lQKZIJiSC9kxFVQG0D7UT7swzWLGGYe8GE8nLytHgO9+I56ViTJVBqkkm04kQlUGKg825uLKlh5uTtNs92RgOd/Jj3juzJEiiFTaYYZwEUBprHDNqIN1nmaJjw9g2eWYBOLmNG0rRKaZZAmcFxXAZaj6P0KB8YSsTBOctcDRNK2zw10OG0mUzPcDDSJDVKeDhFmdlA1ftYCXQepUSJPC+whGbF8USCxnA4X4zdakezy2nAQIIkR2lNlvsqXCIGCqBBZxAlIDmIgbJQlpQnVNZEjxjTYLQYXI/vmxN2cptVB5c3i84oriuOJxZJGyUpUbO/gQKoeOHZ6lxHTpDjG0ESKItlSXkCKMLBViIaorwIfIIkUBIPz8tAARRIp4vBOOxG7Ij+7a4RTZqzwWLUCuA12PcWzBI8tQlAZyZ2dBgxXjO2BpL5o6QGCuWeG0iJiKgVnX8Eywwuk3kRtVKrEcm2BCldAiRI5oqSGqgGCt02BhtDDq8xUR6CJXhqlTdSuHhAV4v8g/WIAiSBshjtABTDTUcbXmOGCDjKQ7CkKmuiL9QNoCmKIh74mCQL1bVkAjWRatGXQ5wjAoBA6R/pQoBKoshDE1y50MdnRZOkQKVyQEpGm3jNwVHSo7IOkXGoTL5IeS8FsTWQPJAo5YAUg32M1EMBUpF8FJSUqFQbiWhGkJc82j2k6Cewargx2CrjA6MtSZaePQGpCKYCqhQEeR+JIw3fcaQYbQy4BPlUSFpMKyVLKkyePQWpcCvFaEOewGj/qfKbPTqmAQAAgRgoggH/TiEhePjhbure/tu1rkJuAwAAAAAAAMCwdwariQRBGL6EiLKQQNjVVxC8zlkGFZfQF1kPQWQPiZeNBz0sngSR1ZfI6/hiW2Pb801PMehMxtUFv44QkkvyUfZ4qPrrxo2zUbfIN3JuvRKf6odTPAlx39H/JrgenXT71D/oq3mkV9PCFhAHgt3fco1m0SfamNUGeDhP79zBJD2vwtcDqX5NBPtmL1OzFKAT6Otz+2FqCrabYLSsIQx63H3IEks6jt2mzaL2fG6pQC0Qf2QHEnKR4gubOMoyWtcN+Rb2gFhSfmO3tYRa/0Yo+3LCX7ZA/OkFMXEgmhwvQhajn3WphkWE/SwD3MU4w4JXuZhVVYvavC20deSpCzBboGfP1cYd6BEDjOKz+By1U+myvgU7ZgP3MUm/qMVsrFbQarFrDYMIczxEB3fqAlQCM/2xIMYmgN8r9v8LRvFZrDBrcQ59PKTqkZxjkpPSi1nUeveBdyFgl4cZoG0PITROH/4yBOLPyXLFYU/maJYzis+ChZkaUbbhcFAF5di6VWZRi1vK1sHDDNCGOoEozWMC8RfL8/L+fBi2dUbxWTB8QlyiMhr67AUzicKUSenhrNMMBqPeqAIJw9lmyenUly3AN1C/I3kcf0pglj+2w1QAGGk9BLEVjVIgBondMtWKhLmwlgU2q7nphq1XmUfvv8umlcHICUatbzbbLXrZGyYvd1grhjvtTwvM9teU4ECbkyqD9a0wlHHrdtsY031rLV9/9odubl3FfBSL6GLv0TrcnYp5Frnb9XjWHAwSZYtZ3KIWvK1h8kKZfME98AaWowQqf+/9Xy+Tafh8QpScmXx0xKiKoMkz1GqXBhHK3yu+LGDeDlsNKdsfnUDMWrh0lVoqFzAGPDyov6wKDAJZULTeyqT/Gxt2cmC2M6Km8gfKPRFtWGoW30qKdjrZq20GgVKLWwyD1oY89CUEjqUCG8uwu9iVgBnikxi0XDJtYeKyXBbdcNl42fbHQ9SiV6iKY7DSUCdUYBBE72C5ACdTKrBUzEx85gjiRGacYUoo15mZt6N7fyKPsrU8y4ZSuxj2GAhBpG780d8/PMRelwvwnJhO/pDYR08mLi/AZrNZrebzhTHyoF0s5iv5we5SEMcpqRWEvh//aHQlMq8RQ+wui0dOW0b+PdzdSGH+VKpqWcZxmdXK7+7uxl/2zsI3qiAI4wSHQFIguBxWipQCpRToXaEUKEEqSJEipViRKwR3De7ursHd3f8tZmZ339y92XePu5Ig4SuQd/Ag4cc3M7uzG0ZoBUa7GczGOH1m4eB4jP8iyQmMNEyMU6f/nKaSjZ//KwZOTp0+8wIpZw60TyGeOGzsoi6DF42FBcpSXKE0W5BKW7R/QdByWDEQ9XnFRh+cdfxTZyMx304ObaHFtWy9NG++rKQP7oBxAzfk78gRsOldBzsz2j6UDNVTFPgvVDJ4onaUVJdaep6890zLJPucVR7oTCN7hOoYMWKc3ttn8JRhsDOZOerzH6RRM1NhwM7pcV1GDyV43EcU0vOMlw6y/kMsE/NWRZzLGcCsQV14Wg/JewvNbB3bdhk3bN5vMu2oEdh1AYAlywzACHxeTQGe7WIfCj8QBycKc9rHgg6VxuRJUqYhRl/u/o6bLdu2Fo+cHov9iNQRv9q1HMHkwPkAcLoByPwkPdmvqsHDTcxoMYkz9pxq68hahmmmnIlmLckgVnwZsCYr0bJr5y+dNmvdzIEbE6c3CvsnmAAXKX6+ABmdmgyj5Wqk6klyHjwHW83Jgd5Qxbmc6z9kKMDkCXwuqUNo1lHQXvyOOrn3JKiGP1qaDz69pA81w5dumwirhRkzFqxLhYb4zBFDhgwZMXPQoNTUBTOazZo4cdq0bUuhdgyG7AfwgJ4IYAnwodF1R/eUzqD4OAVVm8eMeY63HGI3Jwd6k6rWEpTKo6lpOiSfcYH4yAa/X7ly5diVY6RLRvtACBa5ohkMVolW9imlZMeZ8UkDRhJ8oXXzxU2lHVoLWeZv08TMO+TRq8vcATuOzWkNdMyaMs5nOoOUCSUdz/IYENcZ7GGlVY4ea2muZFzmShKVzOcc0bOh7GrWX2eICO/JzSdar5R2OtqP2sSqy9NhI8YCN/MwJ2+IxFqzWh13CSoxTSjz37Kj5O0A/PH16+Pnzp27cePqqreg+45W3XfIomsZK5/vuCbj+UmWDqyJJv1RBJP/NMFDbr179y49fdc10FqjuREyo0MbR82ldw2WG6vM2cQS6rzWHOYuQHXMAPq6NI+6qXMllm88gtY8OH4cSF69Chxfou6y8CNC1boMwnygEy4XMi5l+GWX+UV5dae2lgpf40CC17Fjxx6sjqjc7t2JKOAcnwOarZSRAX+f2c5YWx6nDmSa28wJzQ89KlTWIAx0Wc1VlMOmVKGUWkMskeSeN28ePXr0HnQnQvARoBqkN27cOAyqd/kKiM/EWZG11fnS3ww6VtStMkh+9eph9O7alf4OQRLHzFaovih6yszM7DGciPZLT++VnDw+L896+ZdH/dNap5kYpa7rkCtzJmGgkzVLon9Hc1r0Y5TzOZ1keeL4xbNX3+7ZAyRTglmBQNu2bQtbRKiwsJCYKp++fXv16jnQ69fAlK8LOcmf1cAleXcBvyKuN0H6278f4hdRds8FkpmZSDG/DWoAip7ykSoSJaDMU6iROr7V63AXzqW19PRvXiRxRW9ANWidjHOqXJ6TN5quOXHx4tkDCiWQJJAtQV0jBB+RKSF99OjNnj1vr567eBz1+jVPtSKZxQJ+CdFP8/Ua9w0mSHlrQcASUA5HSwJIoNiuXbtOLPiEVPOBKAE1PDPsVwvgaAfjVsb6EIJD5kwSaZMCfXr0ftLEeT3PxuiaE+c3AMvsDoQSSSLH1qCePcvLy3fvhh964kdgSkQDgfcpCPTA2Q0Xz58APQC572vVjS3LXXGsjotBc4FlP2BJKJEkcuzcuaKid+/eZWVl8GNFRefOyBSJElDNszjHas8ksCfVFBnrfRCnqUOSpnvl3sXEuXlfGvP8xQ0HsrM7pABLQtkVUPYsX7Ly9qTwxy9aH8OTbq/cDVCJaGHbQCArpUO24rmmKYkqGS8W/BR5K5Ev/WfMXpw8klgOzySURLJ32faDzz+Urj516uvXr6dOrS798Hz99rLeRJSAZip/jmR7ilNc2nMLc24d6tQhUYTw9VpLo7OmE+f2nNkUjFnU3mHZUpG8feGLVZOIKPBEoEHgmX2gaMP5E029rrlKxb4zOzunOLlXej/Dsp0i+XTCV5smPFVE2xmeyp4ZMVqV0pxTsA6ZxCmLkF5TcdbkOLdGORqzWwfNklBOYnpWoruBJwBtG8gCnt2y229IC02t8iuUMXs8GdOwRJRHmKSV6BEEaniSPTna7b3KPq4lJ9O0FaGokVFDKWtynFuiHI0ZdFhKlFIXVoJBMd6JZ3b7/mmhgl8B0xizh2G5XaC0Ad1uePYge3K0i1gnczb3oulbhAaBNfXLSfYoPwAw0ZiCpY9BwZ+Kp8I5p2Bq5WGyMZUvmaUPT/KntqdXtDdCc8p997iYNKO3lRNxPUVZs5EFpolyMqZg6ePPZ4Yn4iyaTNFeeZhkTKg9gqU/T6hHYE8d7RmSppMKm9lpRpX0hrqkD458dxgGOmdNCROjXBtTsPSz5xLiiTi7UbRPrTxMNqZg6ceT7EnRbsfJhWVaTG/yvrIm0JziaohS/WfyAiZEORpziazi/jwpfVJxZ5yVg4kZE4y5vvRrvCpdD/Zsk4/RrnBKmk0skb6ICQma3PLgfSivpiRMHeXxG5PTJxV3xpkwzF4IMzFjsj0p2hFnL8bpS5MjXS4350W+O1rQFDA5yhPFScmTcBZUxpndCWasjPmN5ZE9VbRDLWJ3SpqDvPMm3zK0ZQWx0jdac55WRirKy+OMclncFc7JcwoqE+Y9FMwJ3hi/G3nwLIXFEiVPDvaEaHKOnRj57jJDs5Eb5mSGicZMXBcoeRLOIo71BHOmhKkoSnnZU+Gk3FmcVymasv43VzTrumg2DaUV/RTM8IVJt27dmjTpQtg3eWaldEswdeYVe8B0g/xkJGhaccIyPh6aTaPfrUrvLvCnOTWU1r99t5SsmDC33Lq9BNZASlDzl6wMx8JZGAh2SAxn3vhkAVOo9MPTg0d6Vyj1Xo89kK+xceb2i65ESU5l2ea7F7JXrI2q31SV95UMs0MwUOgJc8ttBEkNIxI8ENGwF86uLbgSxV/O++XGhFn6HEB2hiYciLqc8AxIn6+OgTMTKpHCKVc9cdCcGXnvE2jKU6QCgJndARftXe0wt6ykvobqD6Oo5UntJQ+HlreOuxJxnGM5z2SYciEJKLE/jM030gD80AmBrvbEibsiSJ2zK0lzoKu1rGgmRcCcwxVot40l7hkJJJxmBLTgEYmiQ8O23xN/JeI4p3LOMAVLRImNduy0k/rm5yNSXJkeXG3F2WlAPuDE1Dlb0jztS5NbSCtcTQ9BkyuQjUx4pWKJILOygsFgSkpKEJSVFVBAwZ/h2JWoIKE472SDWXoQWAJKAEnnakrwhEgBqAfP7ZbUybvF+bK/KWlChwSboZG3gVIlTbKmdwXaQstH3N5gsw3UjQQPwJSAgj+Zp6xEFOsJxXmZBaZmScdpeOabm9sdvsPTcDx8UzzLJM7SMpM6Odb9afo15GbUMt3NJLc1C71gEktASSCz22tlA1EECpYmnmHvSlTE5qxcnJ86QlvFfH2QBkeTY5T6wTMewRFP3NWf8kqdHOuyk8E0a/4czVlMU1jTUoHCSwCmZokgi4r6OyoCogAU/dnCniN261iPx5x5Os4HQJxLg1WAMYllLoBM7wUaicKHdECaSzzBnhXbV9tSp471KJr13TTnM02/9uY0QXMqWZMWR+W2KEeYimVR/8lpaWlztNLSJiNQaIYST5U9pa8LhTn9rGnifL2AqY1JLNN7jUxOTi4uHo8qLobnkb3Siaeyp4z29SbWjTmZ5ljZs5Q01aujI1+dRzSp886rI7amPcqDhmUoFCqYqlUQCiFQ9KdpiJaHZayzOeOwJsV5qYSpjNlRsSyGqzF5GUp5OTnjixXPjmhPjVPGepQ5HZrjfGnaz38313Je5TjX1twtYVKUA0xgmZYWcp1NLEeg4E/gGfSI9nLHnKH4rElxLmEqY44hlq6zHiCKPMegPb1wdmJzRvXTF/nRlK13e1IoUCWIrClgmihvTyyXV2FxmkCegFNFe/nHypkzx7FmmR2mMiazFDzJnh44yxxz5tgRseGqR9NsKmxsXZouDzmroyWuAqRh0qGEZMn+xHDX0d4V/xBpziBnzgStyTDJmIal5Dke7SlxSnN6h+88QVMspuRBhgl0QKFWRxcsBTlAUc7nuXaelD31xjTsZc7Q8p/Mmj0s1lxdxjD5ANLjzJhxbj/lZc6fopkU70FGgSroljhHDLoL5LM1LKDsiThV6pTmxA2RCHUbCi9rHqlgmMKYwp4GZ6eK9V7mzMlgmq7rCT/Yu5YVJ6IgGtSNj4XgIuILRHCh+MLxAT5Q0YiPAR1QUYni20Ui6qZJQBHRLGYhAReSjbocxvWMW/0zu27n9unOuZfqm86MmWh/QEOf1DlVt6rOzUeL5vqN6iBjLdDMEn3PM4do9sFklrN63kVDr0HBmVD9ZAGix8cgo5qdQZ7vzoCpvgVwDnK9Y4IzPhAJ1T1o3gOagYMMEH2ReF6o3Qu2mxgXOKOB4CSqq0RHaEI0dxCYOpyiGD0Kzm0HEqoDzbXXPSV5wCCDiM48L9IAQtXqls7I5CFQXSd6HFL5iOrGonns6CWAWQjOS0dj6Wwu9Jv2Vjl3n06pjgPOHdrfIDT1QYaf6LPguS53yZv6cG4ZDPNvKdVVNFOif2aem4gCmDqcx8H1DJqfU6pn0bxQHM2HfjTrKdEjCk3Lc/BT0c5EOhGcoPrWYlSv3Tg04yL6G7R6a0GNKMP1LtAE1WcO3XhCaHIrg8ZCq/NjoWSnSwYZlp99olOpSTxXHiudVLlGaVav67LJRJfQTHk+FdAkFa6b4EzRBNUT4dykNYaUIdsHoJnKJhM9Cuvz8oG/4cjq8cvqBWRTAOg4QhN93mJwCtcRnECzA+EMQZMtBBbNNQmakM2te2bzqokUBHIWkU4bnBFn9V2n8NNosrngCk3muc51BGc6Hu5COAPQVEeWftlsiGoiBQUH5yDVX4tw7tqrVZxTbtn82QwMTUR6EpzNn4ImC2d5NF/mDAd1t2zOG9VECgoLTqb6DxFOSkOqbCILTyM0Q4Nz27Q0SgVNFs6h0DzrQ1OCySWbszYJcwrSg9NB9dvm11HT0BmLZofQjIUuLDQhw4ImC6egWas8KYEmj9ORhLg8orNgsSrJRfUG0pCCZv/rSTYPxF9PoakHp431Vj6p2V+n8uS5gqaynHAVaCbjNXw8Ez18XZCoTmlIiyVJQrHO4VlIMvqMZA16FB2+IjoswjnwwultSVIfBs3LPjSraShFTpkDMcOpfjsvHQh2PaU3f1EoxbIZRnS8UIK9m33hr2aa1F8Ngeb57D0gGKdbNCWl/8h+++J2I5vX7gYSPVckzDveqKKZpPTmfbdsVkIfCGeu8dFMknoYmvriTNX97a+Hk02c+1Fy4TSAs6VeIGXRbGmyGS7EFs0bpdG8TGjKfI14WQpN1o4IJVKRU3qLv92Uh5WRpKGWLTgFzU8jZPrTfrm5PTvE+G1qd+SMoEdRYh1N2UroEZqhSQjRztrRk/67QbOmohmycAg03zOaQzkAUCUsutGsBxbvOprBStyDdhCaZU6W1f0WzQZVhyNFcx5dpFA0b5lz5b7yaOIx536gyf1NtSPH/c1/PDbPWTSVuRB1ix+70fyvm0BTmwDrc6EVktMPL2VOn9ugbM7wzPKje2a5MurN3pLWm3PKxqF2DwWMgf/PQoKm4iII2PWoqio3Buf07lKe0+dogYM8wLQ4695DGt8e0kKu9T50D6mm9ZCA5j3VJV1gR67t72+eWPn9TTPK8Pc3Bc13rkR9BGgG7W+2fb33LZPQezdEx6/DvXeg+VBHU98trrrnQtGkzIUM0QfRfJBFE8dF55AcD60s8bGp6p5Zfhv1zHL735hZ3hwgOs8sBU1ldOZ3uLD7qvrFztNfT9o83S57gOg8T596btE87x32sDPwqq8lV2mP4a7HsZK7HryIxLJpx0LvXtDtUuREpaGld62r/XSC95CwJOeWzQqhyexVVg7zC5zVr8uwIzdbdkeuG7wjh70ZhCbvyMkggxtym6khRzcDOPO/COdk72/uIF9GB7IpaFINSQ05NmX4z/Ttt5O9W2x5jh8Gsjn1igHiFhIXnP7OcvvrSth7bz0Ycu8dCR3HSrv3zuTlS1LUEukRCgBD9bdFPBmV5fZkPBixJwM5aOe0tV9tfPWOEgsf07lEOs9J3foI2t8VvxAsLiX9QvvHxC8Uv0UEmKa6rsSiJ/U7giaE8+tb1csm5t/68nnZXMHZ62S9bMCTsSzgZdsXd4rNnva6Vc5ykw+W3C9GFwnCCaq7fJawBhb1WW5dHp8lvIHsC9R8ljYHseUcl0ug3FS7SJshnJbqHg8wbKvj5gGGb5U9q34P8P2cQZ0bwOwL1NOQCCeEQajO/nS2VF9L8BwPf3riqe4DCo7fNH5qvz+9m7s8YRPuMlXuSCE0yWppb4cVOPnuBLb7nxI8tbsTDo7y7gQfnEet399enlCzVydYrz/dneC82AO3Fp/1p3T9nx0uZm8uFuV03usBOL33euz/S/d6mLsoZtKLPf4wd94tTkRRFMduxN6SAUUFEaIRbFFBsBDjig1j7IqR2HvFsvbeC/beRVEQUcQ/FFECfi7vfWXOJDeTlyZ6bBtBWX85572Zt+M9i/yxHgso5HrsTLkpPjcxdAZBxybkoonWkR2lt/VBM7dWmjmzYeBwOXNmhZ45M981c2Z3s2fOnN02zMxJGYqhM6MxcmaompESPnMGA5EQdN5V3Fu6xo/bemhvycR3DJ2ROH/trjAPacS/mIekZ/gEBiJNDIxD0vN7wuch4WAPQY+JTQhbumxrwlE9dnUbdTGr62mFWV2TSmZ1Ecu/OqsLY2egnJkvNQHDugKjuiaY2VLKmHI/19bknMug48u/FZrEwpoysA8Vz5HbEDJHjnhijhxJzZEjln9xjhz+07+cfWaAkswYOYtSzj2Tc+SK0HRfLZZNOXIcUZcHH/zAhzCnxbm70ozDwcUzDoll6IzDrQ3POJyLpVPM5TNA1ZBD/k4faZRVzTiUQXcvm3JeF6IOczYwf5MUPn/zYoPzN7F0luNJefcHcE72x29SxpmlHsb7O3z+ZnhHxh6xbIprJNnA6MGcrtmw4En7EUbDmvamUZVnw06qezasGGcqhnD6w2ExGtZM2GeaGLGN2bBmSjmsKUvWUmLZLHuNlAw1Zw1zi9/vL5lb/G5r0+cWu0ftYtru9Zs8uHjstrEE8vrXHCZFE8yKc4t7ov8vVsWyKVsDpwlzorGJcTpmagPpsmXvSI3M1G58DDR0MJe7n8vppRI0y8LEohnYg7yCa9l0N1rCnPznzE70H817FyPKqxNoVpr3jhYxWBNBF8umq20V5jRZx07U/C6C1lBi6A1zdRGczdUNU3YRoPUKexCCjmWzbNTRBCzNWZJ14GxaT0YpzKhpce0RkK60i4b0ZNRXOgJjip4MWIxvuWV/OpbNSi3VcWFOk3WBs5kdLtEgSIKoC4ZZJX2LhFUzlR0uk2tJ+2/6FtrhUtoWWLKbxGUJcG3ttVg6gbORfqGLol/IcGSQhBDl1yVdoEwWTIvKmuZy2m+6ecq+O9kvhJzLDX2KLKgO34dSBZl1LJ3AWX/31VPZfRWNUqwVx96mcJvUVqg/kwXTPuvGBYrEak87xsKj+wowdc5lo/JmUZ5eqbYxIbOOpRM46+1lOyl72VpbqXFVGZK9qCmqmv1gfzJ/62WZdlVM++7aRc3SpuSuzl42YmlSPlLCRAOw3IMQVqloBXNi6Qy4c8X8ZnUG3n1CjcC9u4Cjbaq2JeDBfm8F1vfp8bcbN+6aqme91tsZSCxFZ2AfCxM5R9Bn+nsQlm+3OeXSyTijGue89WTPmvssT8o+yyfP7jz+doNIgiMjJHWQot/VUA3Trl2vHn/LJeiLkXbN80vOnfEvfv8ipRzttdz+a2CKnIs9yG3OeCFk6ewfqP6ex2lvqGuVYR49+vgxNX+/VCQtx0DFfztf5jeCTBXQ/kSUWuVLulZVQai7GtTvBg12ra7btbF3Px9meWvKcmq3OXEKzzj9WnqkvfYeYDam/frR0aNHH715Q13/bTVJy5EZRoy6G5mXFqtiykCJKHXQn+ea/qIe4CG6UTmkB/j6WWVL9NYi5esIJj0qA5hlrYmLTbc504ViJdJqJyIz6LT3DKZ9hOWpgKqO6nfBu3PuqN5d1FFtWT569ebAixe3r3Q2JAGyeyeW56Uz8YWbV2ZT8eTy9F7P49/sDqYEVFv03PbtVOh/6JDfUT1gLjqqj3z5uSSXo5Lq+3SnvuTnl5voqJ47wHYq25SPI5Zv/UZ/wJTWRNBrNmdC7URkBlP0b+8y2Z6Kp+hP5/r03dyfThxtf7pZL9VWTihfHThAKK/cumxI+hy9zMpVW6ZN2Vko1bE1a0+k0p5hykSNRR8yUDIo96ebIoyi/vRtY7W2Ffen2z56YqlTziyvdt1OxuwWBhPWxB7kMKfEyX+LTTvbs4+1p89zUqDbf7jo9ieSbEuV8UvXFMoDn58TynsdtScVSG916kRsesGh6bFNC9MeE1UeNUCNQZnnyKG6kH6C6PanF5qkraJHFz23hu869Lbr9u3amBqmzLmwpsOcyDo07VT3iEk729Pn2dpqeGqgTJSRKjFE5kggmSShpFr/S9eIZTFK7UkvvilRqEGxHWRStqgBSjy1QS+M+WEMykS5oIk1mSCy5s5VJI0tFxBLDrlhycY891AbM9J9Zr5QLuewZlXmFFlnrdmLtJfwfHKUaukVUEuUmVoNYpBM8tN3YvmKFktGSSzv3WMDKFN66c35Qu1KnMiQRS1QGPQ1G5SAMlFGyppAEEnEUZE0tpzNLGcEWG6nkBtjLp9VKNEck3NY021OZL3Mdae2p+ZJ62dUF9M/eUZAr/lEuZ/J1yReKRXJa69evXnDtlQoO9p8e6lYoX7FFp5SQIVBxyzQRJkpazz/xByZJLuSbMkZn6H2Hs2SjalYRpDyMjnv36UvW9NpTmS9PM6IsSd49olGiacGaokyU4hBMsnHhJL2nedXrlwGylMtiUKjOryDHWoN+sE3qCJKSAkqaSj9IIwEUpFUtqTnkwglsVSbTyDknTI4NoI1Tc71eYdTODhhnGskTk/ZEzy7ENCPH1tb6USXgRJR0jXWJV/04tWjx4SSr4bMYmlduXBLoTmKpcsZ9NDrC/SwDDElTZw48QeJOSqSixZPXbfOojwOlirkHozpzrk769iJpD2DPAmoIkoiqJroM2L6CFIk9YWlj7Kd2nUaCbg06EJpUH1RT9ehsy9ovabXJLq359MSoOSN3LBEyCVMDqbIuTvr2IkEztXgae/smGjv3nSUS1TvBPSYRCRvMEmg1LZc7kDZsEGJpwH6mvkZ7SKtU6IP6LVB2TbIMrMlDKbMuTvrITsR4g6efGdnjsj0ce431o0b9F3pBcmQDKI89WCam03jK6gFev7q1atv3/o81S8M8vjxfoSyLaMEy72xggOmyLkbp9yJJE+2gCFq9JKwvrS6/fI2gbQkfZRedkvhLyq2FwZloJ2Z6Hb6vK72Ox6Qf5DaqzOj1Czlgilhcs5hzdp2ovS+UJ64s7PnjoSVxAe7Wu2JY7d7liSuhv6yYnEYVH1yD/0jUSscpBqUmuXqWMENEzmvdSeKdFo9x7FGaaLmSBeHvDhb80nWuO9MmZXIr121pyWbXdlyYtOqpUvz+6ZXDZR54u3WCSKmRvx+2wNArD+ZsM/udCoIEzmvdSdqE+l+KuyfkFjp6cMHjdSIAFq1CZ4JecnqLyyn5zdlk8lOWt1ZnYwy8ZVn8rOqu6jXQHF8x0x9ddMgg+tP6Kc3J90pUh9MLJ04RwmnsGVz2hLFea6FaDiyJ5c/yFcLcmlLKqkZ8l8L4a8jpsnNawpu5bPi7e5oxB8jNQhNSMojbeqECZw440tUNMHKjKf++ZGgjKG8dKpl6bSqPZlNKo54cwyG4jdJMc3EN1VB9PDmvR6ORCGExrWUzzEprxMmcOL8OTOlUFGzYmc2p5af8jxzyLuaTnlTC/fEkEk3yRbKtgGpEJrVmCOqP4CjNFHy6MpqLLplT+qUJ95uHRov3iIuMIQxVcoBsx6ctHb26084zdlUlWvesX1zdp4u1KzpO5LGk3KVM5cHWtjamChbNMtA3cqf2JFcTUytvNXJ7B7tSYcxcawLmPXg7N3F4ETa/4ZmZa0pxQ7ctli9/K9pWqIMNFl9AnbOmTJrWmLNlDk41nca06YcX/+uR1F6Die4F6X/Cs9ZLQal9qQCiavDrkXCVaImaoASzyyANk9z4sqYSDku2utRH+xF+v410XSWAZT4oi4ekCH1tlKv1B0MiCqgMGhzWRpjIuUCZv17keK5MNFMlHQpZFHiDrU/cbTPGbF6GPHH9jmlfpqoAWoNurIpQLFgRmBMkfL69yKVdsszlWgSyoXKlkDJJBklgcSDhaSolvpYPc/JTA1RBho0aLxJPKdoljAmUt4oTpX25vKctRkJNyg1yS5MEg8TCuHxTiJqgBYbtGV64yzjPksYEzAbUVQvnkU8l/9p345ZEwaiOIBLF1uoECzUfgXB1VnElIBbyRIkOCQu6pAh0KlQOvR7917uHv87H4LGS0wh/w4tnR6/9y6YZ3KTZx45F0tQsuQlVZGoBhUDWqy9WcrB9HTaXc/3mgOa/xYfQ/diCcpqJq/pM4FiQH1cQRfxqaXHwcRpP/GsA5pvY5K0plKPJShrHJxzAzqPw+spfxQl9uBk6XUwUbTryaCbw/KyOmdJypJMiRMuKWsP6IgHlECL8EpKOjTCEpU15okHNDaboszOlx0et4epgoQkUToXy1sLDsSAAnQaJeEFkkkMykYtpSdKZtGhMp2mZbLLvpa5unM7viXbfRml8dw4PjmSLiU94ID4GVCAquLmq2gXnoXM9pUkKBu2lJ4MqkWxd+Rgy4vFJyRBKU64rwEFKEgPZZLN1qG6Rf/+XIT58piU6WqKU4PPvQ1bwpNHADWruNth7Hid3Rok/VPKAX3EZgSkInprJa4/xlIemUY8xwyKb1YMKoJlN0NC0iulHFAGRW0nzUbLcWpsyjYs4cklu4/9j2ifyxlVP85LFJAEZTPVARTtlt3GqbFXBETZhqUsmUVp7ahREaOIF3xsyUZrDWxQm5RDghRyxAIQlDU67QO0EsXbUtqVIl8+a0cSoNxukIpui1PTOqW8VeYVGaGqvOo862C3BsmWwsWBlGK+SkfLCZIl70EpRXXZhGpnTBEv7bYZfgXWtBvNftC/0G0tGQw6kIk2pcLt0D/u5YjaiNRsRMnUzdhAdkXSMZ0ETiYqg24k4CPk5v7d/q9Bt19U9F+d6XafPn369Olza/4AHTMK9clhnYAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAwIDE3MSIgd2lkdGg9IjIwMDAiIGhlaWdodD0iMTcxIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0idGV4dEdyYWQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6I2ZhZjQ5OTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSI0NSUiIHN0eWxlPSJzdG9wLWNvbG9yOiNmNjcyYzI7c3RvcC1vcGFjaXR5OjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzZmZjllYTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8ZmlsdGVyIGlkPSJnbG93IiB4PSItMTAlIiB5PSItNTAlIiB3aWR0aD0iMTIwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlR2F1c3NpYW5CbHVyIGluPSJTb3VyY2VHcmFwaGljIiBzdGREZXZpYXRpb249IjUiIHJlc3VsdD0iYmx1ciIgLz4KICAgICAgPGZlTWVyZ2U+CiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJibHVyIiAvPgogICAgICAgIDxmZU1lcmdlTm9kZSBpbj0iU291cmNlR3JhcGhpYyIgLz4KICAgICAgPC9mZU1lcmdlPgogICAgPC9maWx0ZXI+CiAgPC9kZWZzPgogIDx0ZXh0CiAgICB4PSIxMDAwIgogICAgeT0iMTI1IgogICAgZm9udC1mYW1pbHk9IidUdyBDZW4gTVQnLCAnQ2VudHVyeSBHb3RoaWMnLCBGdXR1cmEsICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmIgogICAgZm9udC1zaXplPSIxMTAiCiAgICBmb250LXdlaWdodD0iYm9sZCIKICAgIGxldHRlci1zcGFjaW5nPSIxMiIKICAgIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICBmaWxsPSJ1cmwoI3RleHRHcmFkKSIKICAgIGZpbHRlcj0idXJsKCNnbG93KSI+dGhyZWUud3M8L3RleHQ+Cjwvc3ZnPgo="},function(e,t,n){var r,i,o={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),l=null,u=0,h=[],d=n(207);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(b(r.parts[a],t))}else{var s=[];for(a=0;a<r.parts.length;a++)s.push(b(r.parts[a],t));o[r.id]={id:r.id,refs:1,parts:s}}}}function f(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=h[h.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=o}if(t.singleton){var a=u++;n=l||(l=y(t)),r=E.bind(null,n,a,!1),i=E.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=x.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=A.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return p(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var a=n[i];(s=o[a.id]).refs--,r.push(s)}e&&p(f(e,t),t);for(i=0;i<r.length;i++){var s;if(0===(s=r[i]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete o[s.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function E(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=w(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function A(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=d(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t,n){const r='<a-scene\n bind__beat-generator="challengeId: challenge.id; difficulty: challenge.difficulty; beatmapCharacteristic: challenge.beatmapCharacteristic; gameMode: gameMode; has3DOFVR: has3DOFVR; hasSongLoadError: hasSongLoadError; isPlaying: isPlaying; isZipFetching: isZipFetching; menuSelectedChallengeId: menuSelectedChallenge.id; songDuration: challenge.metadata.duration; speed: speed"\n bind__beat-system="gameMode: gameMode; hasVR: hasVR; isLoading: isLoading; isPlaying: isPlaying"\n bind__gameover="isGameOver: isGameOver"\n bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id; isSearching: isSearching"\n bind__leaderboard="difficulty: menuSelectedChallenge.difficulty || challenge.difficulty; beatmapCharacteristic: menuSelectedChallenge.beatmapCharacteristic || challenge.beatmapCharacteristic; gameMode: gameMode; inVR: inVR; isVictory: isVictory; menuSelectedChallengeId: menuSelectedChallenge.id; challengeId: challenge.id"\n bind__search="difficultyFilter: difficultyFilter; genre: genre; playlist: playlist; query: search.query"\n bind__song="audio: challenge.audio; challengeId: challenge.id; isLoading: isLoading; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver; isVictory: isVictory"\n bind__song-preview-system="selectedChallengeId: menuSelectedChallenge.id; selectedChallengeVersion: menuSelectedChallenge.version"\n bind__stage-colors="colorScheme: colorScheme"\n bind__tunnels="isPlaying: isPlaying; songDuration: challenge.metadata.duration"\n bind__zip-loader="difficulties: menuDifficulties; isLoading: isLoading; version: menuSelectedChallenge.version; directDownload: menuSelectedChallenge.directDownload; bpm: menuSelectedChallenge.metadata.bpm"\n animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"\n agent-picker\n console-shortcuts\n debug-beat-generator\n debug-beat-positioning\n debug-controller\n debug-intro\n debug-song-time\n debug-state\n hack\n gpu-preloader\n \n leaderboard\n multiplayer\n loading-screen="backgroundColor: #000"\n pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-arrow-red="mixin: arrowRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-blue="mixin: dotBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-red="mixin: dotRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-mine="mixin: mine; size: 30; container: #beatContainer"\n pool__plume-arrow-blue="mixin: arrowBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-arrow-red="mixin: arrowRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-blue="mixin: dotBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-red="mixin: dotRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-mine="mixin: minePlume; size: 12; container: #beatContainer; dynamic: true"\n pool__beat-broken-blue="mixin: blueBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red="mixin: redBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-blue-dot="mixin: blueDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red-dot="mixin: redDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-blue-dot="mixin: blueDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-red-dot="mixin: redDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-mine="mixin: mineBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-blue="mixin: blueBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-red="mixin: redBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-mine="mixin: mineFX; size: 12; container: #rigContainer; dynamic: true"\n pool__punch-fx-blue="mixin: bluePunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-red="mixin: redPunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-mine="mixin: yellowPunchFX; size: 12; container: #rigContainer; dynamic: true"\n pool__tunnels="mixin: tunnel; size: 10; container: #tunnelsContainer; dynamic: true"\n pool__wall="mixin: wall; size: 20; container: #wallContainer; dynamic: true"\n proxy-event__cleargame1="event: gamemenuexit; as: cleargame; to: a-scene"\n proxy-event__cleargame2="event: gamemenurestart; as: cleargame; to: a-scene"\n proxy-event__cleargame3="event: songcomplete; as: cleargame; to: a-scene"\n proxy-event__pausegame="event: pausegame; as: textglowoff; to: a-scene"\n proxy-event__resumegame="event: gamemenuresume; as: textglownormal; to: a-scene"\n play-sound__crescendo="sound: #crescendo; event: victory; volume: 0.75"\n render-order="stage, aurora, sideglow, tunnel, curve, curveshadow, beatShadow, score, beats, menu, menuitem, menubutton, menutext, menugenre, cursor, particles, weapon, victory, stepback"\n stats-param\n tunnels\n vr-mode-ui="enterVRButton: #vrButton">\n\n <a-assets timeout="3000">\n \x3c!-- <require path="/workspaces/three.ws/rider/src/assets.html"> --\x3e\n<a-asset-item id="VigaRegularThree" src="assets/fonts/Viga-Regular-Three.json"></a-asset-item>\n<a-asset-item id="agentGlb" src="assets/avatars/cz.glb"></a-asset-item>\n\n<a-asset-item id="arrowredObj" src="assets/models/arrowred.obj"></a-asset-item>\n<a-asset-item id="arrowblueObj" src="assets/models/arrowblue.obj"></a-asset-item>\n<a-asset-item id="beatObj" src="assets/models/beat.obj"></a-asset-item>\n<a-asset-item id="laserObj" src="assets/models/laser/laser.obj"></a-asset-item>\n\n<a-asset-item id="tunnelObj" src="assets/models/tunnel.obj"></a-asset-item>\n<a-asset-item id="redBeatObj" src="assets/models/redbeat.obj"></a-asset-item>\n<a-asset-item id="blueBeatObj" src="assets/models/bluebeat.obj"></a-asset-item>\n<a-asset-item id="dotRedObj" src="assets/models/dotred.obj"></a-asset-item>\n<a-asset-item id="dotBlueObj" src="assets/models/dotblue.obj"></a-asset-item>\n<a-asset-item id="backGlowObj" src="assets/models/backglow.obj"></a-asset-item>\n<a-asset-item id="aurorasObj" src="assets/models/auroras.obj"></a-asset-item>\n<a-asset-item id="merkabaObj" src="assets/models/merkaba.obj"></a-asset-item>\n<a-asset-item id="ringsObj" src="assets/models/rings.obj"></a-asset-item>\n<a-asset-item id="homeObj" src="assets/models/home.obj"></a-asset-item>\n<a-asset-item id="homeShadowObj" src="assets/models/homeshadow.obj"></a-asset-item>\n<a-asset-item id="weaponObj" src="assets/models/weapon.obj"></a-asset-item>\n<a-asset-item id="weaponHandleObj" src="assets/models/weaponhandle.obj"></a-asset-item>\n<a-asset-item id="weaponGlowObj" src="assets/models/weaponglow.obj"></a-asset-item>\n<a-asset-item id="beatBrokenObj" src="assets/models/beatbroken.obj"></a-asset-item>\n<a-asset-item id="dotBrokenObj" src="assets/models/dotbroken.obj"></a-asset-item>\n<a-asset-item id="dotPunchBrokenObj" src="assets/models/dotbroken.gltf"></a-asset-item>\n<a-asset-item id="cutfxObj" src="assets/models/cutfx.obj"></a-asset-item>\n<a-asset-item id="punchfxObj" src="assets/models/punchfx.obj"></a-asset-item>\n<a-asset-item id="leftFistObj" src="assets/models/leftfist.obj"></a-asset-item>\n<a-asset-item id="leftFistWeaponObj" src="assets/models/leftfistweapon.obj"></a-asset-item>\n<a-asset-item id="rightFistObj" src="assets/models/rightfist.obj"></a-asset-item>\n<a-asset-item id="rightFistWeaponObj" src="assets/models/rightfistweapon.obj"></a-asset-item>\n<a-asset-item id="plumeObj" src="assets/models/plume.obj"></a-asset-item>\n\n<a-asset-item id="mineObj" src="assets/models/mine.obj"></a-asset-item>\n<a-asset-item id="mineBrokenObj" src="assets/models/minebroken.gltf"></a-asset-item>\n\n\x3c!--\n https://freesound.org/people/juskiddink/sounds/70043/\n https://freesound.org/people/Robinhood76/sounds/337436/\n--\x3e\n<audio id="confirmSound" src="assets/sounds/beatHit.ogg"></audio>\n<audio id="clearSound" src="assets/sounds/clear.ogg"></audio>\n<audio id="hoverSound" src="assets/sounds/hover.ogg"></audio>\n<audio id="victorySound" src="assets/sounds/victory.ogg"></audio>\n<audio id="crescendo" src="assets/sounds/crescendo.ogg"></audio>\n\n\n<audio id="hitSound1" src="assets/sounds/hit1.ogg"></audio>\n<audio id="hitSound1left" src="assets/sounds/hit1left.ogg"></audio>\n<audio id="hitSound1right" src="assets/sounds/hit1right.ogg"></audio>\n\n<audio id="hitSound2" src="assets/sounds/hit2.ogg"></audio>\n<audio id="hitSound2left" src="assets/sounds/hit2left.ogg"></audio>\n<audio id="hitSound2right" src="assets/sounds/hit2right.ogg"></audio>\n\n<audio id="hitSound3" src="assets/sounds/hit3.ogg"></audio>\n<audio id="hitSound3left" src="assets/sounds/hit3left.ogg"></audio>\n<audio id="hitSound3right" src="assets/sounds/hit3right.ogg"></audio>\n\n<audio id="hitSound4" src="assets/sounds/hit4.ogg"></audio>\n<audio id="hitSound4left" src="assets/sounds/hit4left.ogg"></audio>\n<audio id="hitSound4right" src="assets/sounds/hit4right.ogg"></audio>\n\n<audio id="hitSound5" src="assets/sounds/hit5.ogg"></audio>\n<audio id="hitSound5left" src="assets/sounds/hit5left.ogg"></audio>\n<audio id="hitSound5right" src="assets/sounds/hit5right.ogg"></audio>\n\n<audio id="hitSound6" src="assets/sounds/hit6.ogg"></audio>\n<audio id="hitSound6left" src="assets/sounds/hit6left.ogg"></audio>\n<audio id="hitSound6right" src="assets/sounds/hit6right.ogg"></audio>\n\n<audio id="hitSound7" src="assets/sounds/hit7.ogg"></audio>\n<audio id="hitSound7left" src="assets/sounds/hit7left.ogg"></audio>\n<audio id="hitSound7right" src="assets/sounds/hit7right.ogg"></audio>\n\n<audio id="hitSound8" src="assets/sounds/hit8.ogg"></audio>\n<audio id="hitSound8left" src="assets/sounds/hit8left.ogg"></audio>\n<audio id="hitSound8right" src="assets/sounds/hit8right.ogg"></audio>\n\n<audio id="hitSound9" src="assets/sounds/hit9.ogg"></audio>\n<audio id="hitSound9left" src="assets/sounds/hit9left.ogg"></audio>\n<audio id="hitSound9right" src="assets/sounds/hit9right.ogg"></audio>\n\n<audio id="hitSound10" src="assets/sounds/hit10.ogg"></audio>\n<audio id="hitSound10left" src="assets/sounds/hit10left.ogg"></audio>\n<audio id="hitSound10right" src="assets/sounds/hit10right.ogg"></audio>\n\n\n<img id="cursorMeshImg" src="assets/models/laser/laser.png">\n<img id="downIconImg" src="assets/img/downIcon.png">\n<img id="envmapTemplateImg" src="assets/img/envmap.png">\n<img id="envmapImg">\n<img id="favoriteImg" src="assets/img/favorite.png">\n<img id="sliceImg" src="assets/img/slice.png">\n<img id="stepbackImg" src="assets/img/stepback.png">\n<img id="soundboxingImg" src="assets/img/soundboxing.jpg">\n<img id="genresImg" src="assets/img/genres.png">\n<img id="starImg" src="assets/img/star.png">\n<img id="merkabaBloomImg" src="assets/img/merkababloom.png">\n<img id="homeShadowImg" src="assets/img/homeshadow.jpg">\n<img id="backGlowImg" src="assets/img/backglow.png">\n<img id="weaponImg" src="assets/img/weapon.jpg">\n<img id="weapon2Img" src="assets/img/weapon2.jpg">\n<img id="weaponHandleImg" src="assets/img/weaponhandle.png">\n<img id="difficultyImg" src="assets/img/difficulty.png">\n<img id="selectedImg" src="assets/img/selected.png">\n<img id="cutfxImg" src="assets/img/cutfx.png">\n\x3c!--\n<img id="cutFxTemplateImg" src="assets/img/cutfx.png">\n<img id="cutFxImg">\n--\x3e\n<img id="minefxImg" src="assets/img/minefx.png">\n<img id="sideglowImg" src="assets/img/sideglow.png">\n<img id="logoImg" src="assets/img/logo.svg">\n<img id="moonImg" src="assets/img/moon.png">\n<img id="plumeImg" src="assets/img/plume.png">\n<img id="tubeImg" src="assets/img/tube.png">\n<img id="tubeColorImg" src="assets/img/tube.jpg">\n<img id="handStarTrailImg" src="assets/img/handstartrail.png">\n\n<img id="modeRideImg" src="assets/img/moderide.jpg">\n<img id="modeClassicImg" src="assets/img/modeclassic.jpg">\n<img id="modePunchImg" src="assets/img/modepunch.jpg">\n<img id="modeViewerImg" src="assets/img/modeviewer.jpg">\n\n<a-mixin id="slice" slice9="color: #050505; transparent: true; opacity: 0.9; src: #sliceImg; left: 50; right: 52; top: 50; bottom: 52; padding: 0.18"></a-mixin>\n<a-mixin id="font" text="font: assets/fonts/Viga-Regular.json; shader: msdf; letterSpacing: 1"></a-mixin>\n\n<a-mixin id="superKeyboardTextInput" mixin="font"></a-mixin>\n\n<a-mixin id="beat"></a-mixin>\n<a-mixin id="beatBlock"></a-mixin>\n<a-mixin id="beatSign"></a-mixin>\n\n<a-mixin id="arrowBlueBeat" mixin="beat" beat="color: blue; type: arrow"></a-mixin>\n<a-mixin id="arrowRedBeat" mixin="beat" beat="color: red; type: arrow"></a-mixin>\n<a-mixin id="dotBlueBeat" mixin="beat" beat="color: blue; type: dot"></a-mixin>\n<a-mixin id="dotRedBeat" mixin="beat" beat="color: red; type: dot"></a-mixin>\n<a-mixin id="mine" mixin="beat" beat="type: mine"></a-mixin>\n<a-mixin id="beatShadow" mixin="beat" geometry="primitive: plane; width: 0.7; height: 0.6" rotation="-90 0 0" material="src: #minefxImg; shader: flat; color: #000; transparent: true; opacity: 0.2" render-order="beatShadow"></a-mixin>\n\n<a-mixin id="plume" plume obj-model="obj: #plumeObj"></a-mixin>\n<a-mixin id="arrowBluePlume" mixin="plume" plume="type: arrow; color: blue" materials="name: arrowBluePlume"></a-mixin>\n<a-mixin id="arrowRedPlume" mixin="plume" plume="type: arrow; color: red" materials="name: arrowRedPlume"></a-mixin>\n<a-mixin id="dotBluePlume" mixin="plume" plume="type: dot; color: blue" materials="name: dotBluePlume"></a-mixin>\n<a-mixin id="dotRedPlume" mixin="plume" plume="type: dot; color: red" materials="name: dotRedPlume"></a-mixin>\n<a-mixin id="minePlume" mixin="plume" plume="type: mine" materials="name: minePlume"></a-mixin>\n\n<a-mixin\n id="superCut"\n bind__supercutfx="colorPrimary: colorPrimary; colorSecondary: colorSecondary"\n supercutfx\n geometry="primitive: plane; width: 3; height: 3"\n material="shader: superCutFxShader; transparent: true; depthWrite: false"></a-mixin>\n\n<a-mixin\n id="redBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: red"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: blue"\n render-order="beats"></a-mixin>\n<a-mixin\n id="redDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redBeatFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="blueBeatFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="mineBroken"\n gltf-model="#mineBrokenObj"\n beat-cut-fx="type: mine"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="mineFX"\n geometry="primitive: plane; width: 0.6; height: 0.6"\n material="shader: flat; transparent: true; src: #minefxImg; color: #fff568; depthWrite: false"\n render-order="menu"\n animation="property: components.material.material.opacity; from:1; to:0; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="redPunchFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="bluePunchFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n bind__material="color: colorTertiary"\n id="yellowPunchFX"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="wall"\n material="shader: wallShader; transparent: true; side: double; opacity: 0"\n animation__fadein="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; easing: easeInCubic; autoplay: false; dur: 1500"\n animation__scalein="property: object3D.position.y; from: -5; to: 0; easing: easeInOutElastic; autoplay: false; dur: 1500"\n render-order\n wall></a-mixin>\n\n<a-mixin\n id="tunnel"\n obj-model="obj: #tunnelObj"\n materials="name: tunnel"></a-mixin>\n\n<a-mixin\n id="bigMenuButton"\n geometry="primitive: plane; width: 1.15; height: 0.23"\n material="shader: panelShader; brightness: 0.5; borderWidth: 0.05; ratio: 4; borderRadius: 0.6"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.04 1.04 1.04; startEvents: mouseenter; pauseEvents: mouseleave; dur: 80"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.04 1.04 1.04; startEvents: mouseleave; pauseEvents: mouseenter; dur: 80"\n render-order="menubutton"></a-mixin>\n\n<a-mixin id="cancelSoundUI" play-sound__cancel="event: click; sound: #clearSound; volume: 0.5"></a-mixin>\n<a-mixin id="clickSoundUI" play-sound__click="event: click; sound: #confirmSound; volume: 0.25"></a-mixin>\n<a-mixin id="hoverSoundUI" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"></a-mixin>\n\x3c!-- </require> --\x3e</require>\n </a-assets>\n\n <a-entity id="beatObjTemplate" obj-model="obj: #beatObj" visible="false"></a-entity>\n <a-entity id="redBeatObjTemplate" obj-model="obj: #redBeatObj" visible="false"></a-entity>\n <a-entity id="blueBeatObjTemplate" obj-model="obj: #blueBeatObj" visible="false"></a-entity>\n <a-entity id="dotRedObjTemplate" obj-model="obj: #dotRedObj" visible="false"></a-entity>\n <a-entity id="dotBlueObjTemplate" obj-model="obj: #dotBlueObj" visible="false"></a-entity>\n <a-entity id="mineObjTemplate" obj-model="obj: #mineObj" visible="false"></a-entity>\n <a-entity id="cursorLaser" obj-model="obj: #laserObj" visible="false"></a-entity>\n\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/loading.html"> --\x3e\n<a-entity\n id="loadingSongInfoContainer"\n bind__animation__scale="enabled: isLoading"\n bind__visible="isLoading"\n animation__scale="property: scale; from: 1 1 1; to: 1.05 1.05 1.05; dir: alternate; loop: true; dur: 1200; easing: easeInOutCubic"\n position="0 1.5 -2">\n\n <a-entity\n id="loadingMenuBackground"\n bind-toggle__raycastable="isLoading"\n render-order="menu"\n geometry="primitive: plane; width: 1.15; height: 1.2"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="loadingSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat; transparent: false"\n position="0 0.24 0"\n render-order="menu"></a-entity>\n\n <a-entity id="loadingSongInfo">\n <a-entity\n position="0 -0.05 0"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.songSubName + \' - \' + challenge.author"\n text="wrapCount: 40; align: center"\n text-truncate="length: 35"\n render-order="menutext"></a-entity>\n\n <a-entity position="0 -0.13 0"\n mixin="font"\n text="align: center; color: #FFF; wrapCount: 21; baseline: top; lineHeight: 36; width: 0.81"\n bind__text="value: challenge.metadata.songName"\n render-order="menutext"></a-entity>\n\n <a-entity\n id="loadingText"\n mixin="font"\n bind__animation__color="enabled: isLoading"\n bind__text="color: colorPrimary; value: loadingText; wrapCount: hasSongLoadError && 24 || 18"\n bind__visible="isLoading"\n text="align: center; wrapCount: 18; width: 0.65"\n render-order="menutext"\n position="0 -0.32 0.001"></a-entity>\n\n <a-entity\n id="zipLoaderIndicator"\n bind__material="color: colorPrimary"\n bind__visible="isZipFetching"\n geometry="primitive: plane; height: 0.1; width: 0.1"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.9; progress: 0; transparent: true"\n render-order="menuitem"\n position="0 -0.4 0.002">\n </a-entity>\n\n <a-entity\n id="songProcessingIndicator"\n bind__animation__spin="enabled: isSongProcessing"\n bind__material="color: colorPrimary"\n bind__visible="isSongProcessing"\n animation__spin="property: object3D.rotation.z; from: 0; to: -360; easing: linear; dur: 1000; loop: true"\n geometry="primitive: plane; height: 0.15; width: 0.15"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.4; transparent: true; progress: 0.2"\n render-order="menutext"\n position="0 -0.4 0.004"\n visible="false">\n </a-entity>\n\n <a-entity\n id="loadingCancelButton"\n mixin="bigMenuButton"\n bind-toggle__raycastable="isLoading"\n position="0 -0.67 0.01"\n proxy-event="event: click; to: a-scene; as: songloadcancel">\n <a-entity mixin="font" text="align: center; color: #FAFAFA; wrapCount: 20; value: CANCEL" position="0 -0.065 0.001"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/stage.html"> --\x3e\n<a-entity\n id="audioAnalyser"\n audioanalyser="fftSize: 32; enableBeatDetection: false; enableLevels: false; enableWaveform: false; enableVolume: false"></a-entity>\n\n<a-entity id="stage" no-frustum-cull follow-z="target: #curveFollowRig">\n <a-entity\n id="backglow"\n obj-model="obj: #backGlowObj"\n materials="name: backglow"\n render-order="stage"></a-entity>\n\n <a-entity\n id="rings"\n obj-model="obj: #ringsObj"\n materials="name: rings"\n position="0 0 -1500"\n render-order="stage"></a-entity>\n\n <a-entity\n id="auroras"\n class="aurora"\n obj-model="obj: #aurorasObj"\n materials="name: aurora"\n render-order="aurora"></a-entity>\n\n <a-entity\n id="merkaba"\n obj-model="obj: #merkabaObj"\n bind__visible="!isVictory && !isGameOver"\n materials="name: merkaba"\n animation="property: rotation; from: 0 0 0; to: 360 360 360; dur: 50000; easing: linear; loop: true"\n position="0 46 -1500"></a-entity>\n\n <a-entity\n class="merkababloom"\n geometry="primitive: plane; width: 200; height: 200"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false; color: #888"\n position="0 46 -1400"\n render-order="stage"></a-entity>\n\n <a-entity\n class="merkababloom"\n bind__material="color: colorTertiary"\n geometry="primitive: plane; width: 250; height: 250"\n animation="property: object3D.rotation.z; from: 0; to: 360; loop: true; easing: linear; dur: 30000"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false"\n position="0 46 -1380"\n render-order="stage"></a-entity>\n\n <a-entity\n id="moon"\n geometry="primitive: plane; width: 1000; height: 500"\n position="0 1000 -1000"\n rotation="45 0 0"\n materials="name: moon"\n ></a-entity>\n\n <a-entity class="stars" stars render-order="particles"></a-entity>\n\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/intro.html"> --\x3e\n<a-entity\n id="mainLogo"\n geometry="primitive: plane; width: 9; height: 1.125"\n material="shader: flat; src: #logoImg; transparent: true; depthTest: false; blending: additive; opacity: 0"\n position="0 3.3 -2.5"\n rotation="0 0 0"\n scale="0.8 0.8 0.8"\n bind__visible="introActive || menuActive"\n animation__opacity="property: components.material.material.opacity; from: 0; to: 1; dur: 2000; delay: 1000"\n animation__position="property: object3D.position.y; to: 3.4; dur: 2000; easing: easeInOutQuad; startEvents: startgame"></a-entity>\n\n<a-entity\n id="startButton"\n bind__visible-raycastable="introActive"\n geometry="primitive: plane; width: 1; height: 0.35"\n position="0 1.6 -2.2"\n render-order="menu"\n proxy-event="event: click; to: a-scene, #menu, #mainlogo, #menuTopButtons, #menuBackground; as: startgame"\n delayed-proxy-event="event: click; to: a-scene; as: menuopeningend; delay: 1800"\n mixin="bigMenuButton"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n material="ratio: 3; opacity: 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3000">\n <a-entity\n id="startButtonLabel"\n mixin="font"\n text="value: BEGIN; color: #f0f0f0; align: center; width: 1; wrapCount: 12; opacity: 0"\n position="0 -0.1 0.01"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3500"\n ></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/menu.html"> --\x3e\n\x3c!-- Macro is a templating function. It is rendered into the HTML below with searchResults(). --\x3e\n\n\n\n<template id="searchResultTemplate">\n <a-entity class="searchResult" bind-item__data-id="item.id" bind-item__data-index="item.index">\n <a-entity class="searchResultBackground" bind-item__active-item="active: menuSelectedChallenge.id === item.id"\n bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id"\n bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id"\n bind-toggle__raycastable="mainMenuActive || isSearching" bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.4; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75; delay: 1"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n geometry="primitive: plane; width: 1.1; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #selectedImg" position="0 -0.13 -0.002"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03" render-order="menuitem"></a-entity>\n </a-entity>\n </a-entity>\n</template>\n\n\n\x3c!-- Menu container begins here. --\x3e\n<a-entity id="menu" bind__visible="menuActive" position="0 1.4 -2.3"\n animation__position="property: object3D.position.z; to: -2; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame">\n\n <a-entity id="menuBackground"\n bind__menu-midsection="active: !!menuSelectedChallenge.id && (mainMenuActive || difficultyFilterMenuOpen) || difficultyFilterMenuOpen; selectedChallenge: menuSelectedChallenge.id"\n bind-toggle__raycastable="menuActive || genreMenuOpen || isSearching || difficultyFilterMenuOpen"\n geometry="primitive: plane; width: 3.4; height: 1.82" material="shader: panelShader; ratio: 1.86; opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n animation__midsectionshow="property: components.material.material.uniforms.midSection.value; from: 0; to: 1; dur: 160; startEvents: showdifficultysection; easing: easeOutCubic"\n animation__midsectionhide="property: components.material.material.uniforms.midSection.value; from: 1: to: 0; dur: 160; startEvents: hidedifficultysection; easing: easeOutCubic"\n render-order="menu" position="0 0 -0.005"></a-entity>\n\n <a-entity id="mainMenu" bind__visible="mainMenuActive && !isMenuOpening || isSearching">\n <a-entity id="searchResultsContainer" position="0 0 0.001" class="menuAnimation"\n bind__menu-slide-animation="isSearching: isSearching; menuSelectedChallengeId: menuSelectedChallenge.id"\n animation__menuleft="property: object3D.position.x; to: -0.79; dur: 200; easing: easeOutCubic; autoplay: false"\n animation__menuright="property: object3D.position.x; from: -0.79; to: 0; dur: 200; easing: easeOutCubic; autoplay: false">\n\n \n<a-entity id="searchResultList"\n bind-for="for: item; in: searchResultsPage; key: id; template: #searchResultTemplate; updateInPlace: true; pool: 6; delay: 25"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-index" search-result-list position="0 0.644 0">\n</a-entity>\n\n\x3c!-- All search result text merged and spaced out. --\x3e\n<a-entity id="searchSongNameTexts" mixin="font" bind__text="value: search.songNameTexts" render-order="menutext"\n text="baseline: top; align: left; color: #FAFAFA; wrapCount: 28; lineHeight: 130" position="0.181 0.51943 0.001">\n</a-entity>\n<a-entity id="searchSongSubNameTexts" mixin="font"\n bind__text="color: colorSecondaryBright; value: search.songSubNameTexts" render-order="menutext"\n text="baseline: top; align: left; wrapCount: 42; lineHeight: 190" position="0.181 0.445 0.001">\n</a-entity>\n\n<a-entity id="searchThumbnailImages" bind__search-thumbnail-atlas="dummyUpdater: search.songSubNameTexts"\n bind__visible="searchResultsPage.length > 0" geometry="primitive: plane; buffer: false; width: 0.2; height: 1.2"\n dynamic-texture-atlas="canvasId: thumbnailAtlasMap; canvasWidth: 64; canvasHeight: 512; numColumns: 1; numRows: 6"\n material="shader: flat; transparent: true" render-order="menubutton" position="-0.45 0.0146 0.002"></a-entity>\n\n<a-mixin id="searchPageButton"\n animation__mouseenter="property: components.slice9.material.opacity; from: 0; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"\n animation__mouseleave="property: components.slice9.material.opacity; from: 0.3; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"\n mixin="slice" raycaster-target="width: 1; height: 0.32" render-order="menubutton"\n slice9="width: 0.8; color: #08bfa2; height: 0.130; padding: 0.03; opacity: 0"></a-mixin>\n\n<a-entity id="searchPrevPage" mixin="searchPageButton" bind__slice9="color: colorPrimary"\n bind__visible-raycastable="search.hasPrev && (mainMenuActive || isSearching)"\n raycaster-target="bindToggle: search.hasNext && menuActive; position: 0 0.08 0" position="-0 0.69 0.01"\n proxy-event="event: click; to: a-scene; as: searchprevpage; captureBubbles: true">\n <a-entity id="prevArrow" bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" rotation="0 0 180" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n<a-entity id="searchNextPage" mixin="searchPageButton" bind__slice9="color: colorSecondary"\n raycaster-target="bindToggle: search.hasNext && (mainMenuActive || isSearching); position: 0 -0.08 0"\n position="-0 -0.674 0.01" proxy-event="event: click; to: a-scene; as: searchnextpage; captureBubbles: true"\n bind__visible="search.hasNext">\n <a-entity id="nextArrow" bind__material="color: colorSecondary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="menuDifficultiesGroup" position="0 0.18 0">\n\n \x3c!-- Top-aligned. --\x3e\n \x3c!-- Uses bind-for and bind-item to render difficulties. --\x3e\n <a-entity id="menuDifficulties" bind-for="for: item; in: menuDifficultiesIds; updateInPlace: true; pool: 10"\n bind__visible="!!menuSelectedChallenge.id"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-bind-for-key" position="0 0.34 0"\n menu-difficulty-select>\n \n <template>\n \x3c!-- Item is a string representing the difficulty. --\x3e\n <a-entity class="difficultyOption" bind-item__data-difficulty="item">\n <a-entity class="difficultyBackground"\n bind-item__active-item="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseenter="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseleave="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-background="enabled: menuActive && !!menuSelectedChallenge.id && !(menuSelectedChallenge.difficultyId === item) && !difficultyFilterMenuOpen"\n bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #difficultyImg" position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n event-set__mouseleave="visible: true; _delay: 160" render-order="menuitem"></a-entity>\n <a-entity class="difficultyText" mixin="font"\n bind-item__active-text-color="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-text="id: item" active-text-color="color: #fff"\n text="wrapCount: 30; align: center; color: #8d8d8d" position="0 -0.057 0.001" render-order="menutext">\n </a-entity>\n </a-entity>\n </template>\n \n </a-entity>\n </a-entity>\n\n \x3c!-- Selected challenge info. --\x3e\n <a-entity id="menuSelectedChallengePanel" bind__visible="!!menuSelectedChallenge.id"\n position="0.8394583182784089 0 0.001">\n <a-entity id="menuFavoriteButton" bind__animation__mouseenter="to: menuSelectedChallenge.isFavorited && 0.25 || 1"\n bind__animation__mouseleave="to: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__material="color: colorTertiary; opacity: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__raycastable="menuActive && !!menuSelectedChallenge.id"\n animation__mouseenter="property: components.material.material.opacity; startEvents: mouseenter; dur: 150; easing: easeInOutCubic"\n animation__mouseleave="property: components.material.material.opacity; startEvents: mouseleave; dur: 100; easing: easeInOutCubic"\n geometry="primitive: plane; width: 0.1; height: 0.1"\n material="src: #favoriteImg; shader: flat; transparent: true; opacity: 0.25"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1" position="0.46 0.68 0.001"\n proxy-event="event: click; to: a-scene; as: favoritetoggle" render-order="menuitem"></a-entity>\n\n <a-entity id="menuSelectedChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n geometry="primitive: plane; height: 0.4; width: 0.4" material="shader: flat" position="0 0.42 0"></a-entity>\n\n <a-entity id="menuSelectedChallengeInfoContainer" position="0 0.058 0">\n <a-entity id="menuSelectedChallengeSongAuthor" mixin="font"\n bind__text="color: colorSecondaryBright; value: (menuSelectedChallenge.metadata.songSubName || menuSelectedChallenge.metadata.songAuthorName || \'Unknown Artist\')" position="0 0.042 0"\n render-order="menutext" text="wrapCount: 40; lineHeight: 40; width: 1.185; align: center; baseline: center">\n </a-entity>\n <a-entity id="menuSelectedChallengeSongName" mixin="font"\n bind__text="color: colorPrimary; value: menuSelectedChallenge.metadata.songName" position="0 -0.059 0"\n render-order="menutext" text="align: center; wrapCount: 31; baseline: top; lineHeight: 36; width: 1.4">\n </a-entity>\n <a-entity id="menuSelectedChallengeInfo" mixin="font" bind__text="value: menuSelectedChallenge.songInfoText"\n mixin="font" position="0 -0.18 0" render-order="menutext"\n text="align: center; color: #989898; wrapCount: 55; lineHeight: 72; width: 1.5; baseline: top"></a-entity>\n </a-entity>\n\n <a-entity id="playButton"\n bind__visible-raycastable="menuActive && !!menuSelectedChallenge.id && !genreMenuOpen && !difficultyFilterMenuOpen && !isIOS && !hasSongLoadError && mpHostControl && mpCanStart"\n geometry="primitive: plane; width: 0.7; height: 0.25"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25" position="0 -0.561 0"\n proxy-event="event: click; to: a-scene; as: playbuttonclick"\n material="shader: panelShader; brightness: 0.7; transparent: true; midSection: 0; ratio: 2.8; borderRadius: 0.6; borderWidth: 0.08"\n render-order="menubutton"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 15; value: PLAY" position="0 -0.085 0.01">\n </a-entity>\n </a-entity>\n\n <a-entity id="iOSNotice" bind__visible="mainMenuActive && isIOS" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry, iOS is currently not playable but support is coming soon!">\n </a-entity>\n\n <a-entity id="menuLoadError" bind__visible="hasSongLoadError" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry! There was an error loading this song.">\n </a-entity>\n </a-entity>\n\n <a-entity id="searchError" mixin="font" bind__visible="search.hasError" render-order="menuText"\n text="align: center; value: Sorry, there was an issue fetching search results. Please try again."\n position="0 0 0.01"></a-entity>\n\n <a-entity id="menuNoPlaylists" mixin="font"\n bind__visible="playlist === \'favorites\' && favorites.length === 0 && !menuSelectedChallenge.id"\n render-order="menuText" position="0 0.1 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Add a song to your favorites by clicking the star in the top right of the menu after selected a song.">\n </a-entity>\n\n <a-entity id="searchNoResults" mixin="font"\n bind__visible="!isSearching && search.results.length === 0 && playlist !== \'favorites\'" render-order="menuText"\n text="align: center; value: No search results found. Please try again with another query." position="0 0 0.01">\n </a-entity>\n </a-entity>\n\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/genreMenu.html"> --\x3e\n<a-entity\n id="genreMenu"\n bind-for="for: genre; in: genres; updateInPlace: true; key: name"\n bind__visible="genreMenuOpen"\n layout="type: box; columns: 6; marginRow: 0.4; marginColumn: 0.4; align: center"\n menu-genre\n position="0 0 0.05">\n <template>\n <a-entity class="genre" bind-item__data-genre="item">\n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 0.35; left: 70; top: 70; height: 0.35; padding: 0.07"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave2="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: genreMenuOpen; width: 0.35; height: 0.35"\n render-order__nonrecursive="menubutton">\n <a-entity\n mixin="font"\n bind-item__text="value: item.name"\n text="align: center; width: 1.1; color: #888"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #888; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #888; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0 -0.16 0.001"></a-entity>\n <a-entity\n class="genreIcon"\n bind-item__atlas-uvs="totalColumns: 6; totalRows: 3; row: item.row; column: item.column"\n geometry="primitive: plane; width: 0.22; height: 0.22; buffer: false; skipCache: true"\n position="0 0.04 0.002"\n material="shader: flat; src: #genresImg; transparent: true; color: #888"\n render-order="menutext"\n animation__mouseenter="property: components.material.material.color; type: color; from: #888; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.material.material.color; type: color; from: #FAFAFA; to: #888; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/difficultyMenu.html"> --\x3e\n\n\n\n\n<a-entity\n id="difficultyFilterMenu"\n bind__visible="difficultyFilterMenuOpen"\n layout="type: box; columns: 1; marginRow: -0.2"\n difficulty-filter\n position="0 0.5 0">\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="All">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'All\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'All\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'All\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'All\'"\n active-text-color="color: #fff"\n difficulty-text="id: All"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Easy">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Easy\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Easy\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Easy\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Easy\'"\n active-text-color="color: #fff"\n difficulty-text="id: Easy"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Normal">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Normal\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Normal\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Normal\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Normal\'"\n active-text-color="color: #fff"\n difficulty-text="id: Normal"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Hard">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Hard\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Hard\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Hard\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Hard\'"\n active-text-color="color: #fff"\n difficulty-text="id: Hard"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expert">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expert\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expert\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expert\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expert\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expert"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expertplus">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expertplus\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expertplus\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expertplus\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expertplus"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/optionsMenu.html"> --\x3e\n<a-entity\n id="optionsMenu"\n bind__visible="optionsMenuOpen"\n position="0 0.5 0.01"\n render-order="menutext">\n\n <a-entity id="optionsTitle" mixin="font" text="align: center; value: OPTIONS; width: 2.5"></a-entity>\n\n <a-entity id="colorOptionsContainer" position="0 -0.25 0">\n <a-entity id="colorTitle" mixin="font" text="align: center; value: THEMES; width: 2"></a-entity>\n\n <a-entity id="colorOptions" position="-0.79 -0.175 0.00" layout="type: box; columns: 10; margin: 0.2" materials-color-menu>\n \n <a-entity\n class="colorOption"\n data-color-name="Super Medium"\n data-color-scheme="default"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #f971c3; color2: #6ff9ea; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Star Warrior"\n data-color-scheme="blue"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #1e4482; color2: #c27727; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Galactic Royal"\n data-color-scheme="purple"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #6A39B3; color2: #FAF239; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Space Joker"\n data-color-scheme="green"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #779E37; color2: #6A39B3; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Solar Flare"\n data-color-scheme="yellow"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #C2C04C; color2: #E03A3E; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Trail Blazer"\n data-color-scheme="red"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #E03A3E; color2: #DADADA; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Mint Choco"\n data-color-scheme="rgb"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #34eb89; color2: #34ebd8; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Cheetah SoL"\n data-color-scheme="cheetah"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #c27727; color2: #635c54; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Ash Nova"\n data-color-scheme="black"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #555; color2: #FFF; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n </a-entity>\n\n <a-entity\n id="colorName"\n mixin="font"\n text="align: center; color: #CCC; width: 1"\n position="0 -0.35 0.1"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/playlistMenu.html"> --\x3e\n<a-entity\n id="playlistMenu"\n bind-for="for: playlist; in: playlists; updateInPlace: true; key: name"\n bind__visible="playlistMenuOpen"\n layout="type: box; columns: 2; marginRow: -0.23; marginColumn: 1.3; align: center"\n menu-playlist\n position="0 0 0.05">\n <template>\n \n <a-entity class="playlist" data-playlist="{{ item.name }}" data-title="{{ item.title }}">\n \n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 1.2; left: 70; top: 70; height: 0.19; padding: 0.07"\n animation__mouseenter="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: playlistMenuOpen; width: 1.2; height: 0.19"\n render-order__nonrecursive="menubutton">\n <a-entity\n class="playlistTitle"\n mixin="font"\n bind-item__text-uppercase="value: item.title"\n text="align: left; width: 1.3; color: #CCC"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #CCC; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #CCC; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0.11 -0.01 0.001"></a-entity>\n\n <a-entity\n class="playlistAuthor"\n mixin="font"\n bind-item__text="value: item.author"\n bind__text="color: colorPrimary"\n text="align: left; width: 1.1"\n render-order="menutext"\n position="0.01 -0.08 0.001"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\n\x3c!-- Search. --\x3e\n<a-entity id="keyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: isSearching"\n super-keyboard="label: Search on beatsaver.com; inputColor: #fff; labelColor: #f0f0f0; width: 1.5; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff"\n position="0.58 1.2 -1.95" keyboard-raycastable="condition: isSearching" search\n proxy-event__dismiss="event: superkeyboarddismiss; to: a-scene; as: keyboardclose"\n proxy-event__accept="event: superkeyboardinput; to: a-scene; as: keyboardclose" render-order="menubutton"\n render-order-recursive>\n</a-entity>\n\n<a-entity id="backButton" mixin="bigMenuTopButton"\n bind__visible-raycastable="genreMenuOpen || isSearching || difficultyFilterMenuOpen || playlistMenuOpen || optionsMenuOpen"\n position="0 2.32 -1.96" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: menuback">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 20; value: BACK" position="0 -0.07 0.01">\n </a-entity>\n</a-entity>\n\n\x3c!-- Top menu buttons. --\x3e\n<a-mixin id="bigMenuTopButton" mixin="bigMenuButton" geometry="height: 0.17; width: 0.7"></a-mixin>\n<a-mixin id="bigMenuTopButtonFont" mixin="font" text="width: 0.75" position="0 -0.05 0.01"></a-mixin>\n<a-entity id="menuTopButtons"\n animation__position="property: object3D.position.z; to: -1.98; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame"\n layout="type: line; margin: 0.65" position="-0.95 2.30 -1.96"\n proxy-event="event: startgame; to: #searchButton, #difficultyButton, #genreButton, #playlistButton, #optionButton">\n\n \x3c!-- Playlist menu toggle. --\x3e\n <a-entity id="playlistButtons">\n <a-entity id="playlistButton"\n mixin="bigMenuTopButton"\n bind__menu-playlist-button="isFavorited: menuSelectedChallenge.isFavorited; selectedChallenge: menuSelectedChallenge.id"\n bind__visible-raycastable="mainMenuActive && !playlist"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: playlistmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: PLAYLISTS" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearPlaylistButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="menuActive && !!playlist"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: playlistclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR PLAYLIST"></a-entity>\n </a-entity>\n\n <a-entity\n id="playlistText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: playlistTitle"\n bind__visible="mainMenuActive && !!playlist"\n text="align: center; baseline: bottom; wrapCount: 30; width: 0.7"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Search toggle. --\x3e\n <a-entity id="searchButtons">\n <a-entity\n id="searchButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !search.query"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: keyboardopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: SEARCH" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="searchClearButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!search.query"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: searchclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR SEARCH"></a-entity>\n </a-entity>\n\n <a-entity\n id="searchText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: search.queryText"\n bind__visible="mainMenuActive && !!search.query"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Difficulty menu toggle. --\x3e\n \x3c!-- <a-entity id="difficultyFilter">\n <a-entity id="difficultyButton"\n mixin="bigMenuTopButton"\n material="opacity: 0"\n bind__visible-raycastable="mainMenuActive"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: difficultyfiltermenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: DIFFICULTY" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity\n id="difficultyFilterText"\n mixin="font"\n bind__difficulty-text="difficulty: difficultyFilter"\n bind__text="color: colorPrimary"\n bind__visible="mainMenuActive && difficultyFilter !== \'All\'"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity> --\x3e\n\n \x3c!-- Genre menu toggle. --\x3e\n <a-entity id="genreButtons">\n <a-entity id="genreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !genre"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: genremenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: GENRES" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearGenreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!genre"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: genreclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR GENRE"></a-entity>\n </a-entity>\n\n <a-entity\n id="genreText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: genre"\n bind__visible="mainMenuActive && !!genre"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\n\x3c!-- Options menu toggle. --\x3e\n<a-entity id="optionsButtons" position="0 0.45 -1.96">\n <a-entity id="optionButton" mixin="bigMenuButton" bind__visible-raycastable="mainMenuActive" material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: optionsmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: THEMES"\n bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n</a-entity>\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/modes.html"> --\x3e\n<a-mixin\n id="modeAnimations"\n animation__select="property: object3D.position.z; to: 0.06; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: object3D.position.z; to: 0; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeThumbAnimations"\n animation__select="property: components.material.material.color; type: color; to: #FFF; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: components.material.material.color; type: color; to: #888; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeBackgroundHover"\n animation__mouseenter="property: components.material.material.uniforms.borderWidth.value; from: 0.002; to: 0.01; startEvents: mouseenter; pauseEvents: mouseleave; easing: linear; dur: 150"\n animation__mouseleave="property: components.material.material.uniforms.borderWidth.value; from: 0.01; to: 0.002; startEvents: mouseleave; pauseEvents: mouseenter; easing: linear; dur: 150"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.3"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n\n ></a-mixin>\n\n<a-mixin\n id="modeBackgroundSelect"\n animation__select="property: components.material.material.uniforms.brightness.value; to: 0.5; startEvents: select; easing: easeOutQuad; dur: 200"\n animation__deselect="property: components.material.material.uniforms.brightness.value; to: 0.1; startEvents: deselect; easing: easeOutQuad; dur: 200"\n animation__select2="property: components.material.material.uniforms.borderWidth.value; to: 0.015; startEvents: select; easing: linear; dur: 200"\n animation__deselect2="property: components.material.material.uniforms.borderWidth.value; to: 0.002; startEvents: deselect; easing: linear; dur: 200"></a-mixin>\n\n\n\n<a-entity\n id="modes"\n bind__menu-mode="colorScheme: colorScheme; hasVR: hasVR"\n bind__position="hasVR && \'-2.56 1.3 -0.7\' || \'-2.56 1 -0.7\'"\n bind__visible="menuActive && !isMenuOpening"\n rotation="0 60 0"\n render-order="menuitem">\n\n <a-entity id="modeIcon"\n geometry="primitive: cylinder; height: 0.01; segmentsHeight: 1; radius: 0.1; segmentsRadial: 3"\n rotation="0 90 90"\n position="-1.275 0.32 0.1"\n materials="name: merkaba"\n animation="property: object3D.position.x; from: -1.275; to: -1.3; dir: alternate; easing: easeOutQuad; loop: true; dur: 900"></a-entity>\n\n <a-entity id="mode2d" bind__visible="!hasVR">\n \n\n<a-entity\n id="moderide2d"\n class="modeItem"\n data-mode="ride"\n data-name="ride2d"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeviewer2d"\n class="modeItem"\n data-mode="classic"\n data-name="viewer2d"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: VIEWER\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeViewerImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: View the beat map.\n\nConnect a VR headset\nwith controllers\nto experience\nmore modes!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="modeVR" bind__visible="hasVR">\n \n\n<a-entity\n id="modepunchvr"\n class="modeItem"\n data-mode="punch"\n data-name="punchvr"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: PUNCH\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modePunchImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Punch the beats, mind\ncolor.\n\nAvoid all things yellow.\n\nPunch harder\n for better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="moderidevr"\n class="modeItem"\n data-mode="ride"\n data-name="ridevr"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.\n\nTake a quick breather.\n\nNo score!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeclassicvr"\n class="modeItem"\n data-mode="classic"\n data-name="classicvr"\n position="0 -0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: CLASSIC\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeClassicImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Cut the beats, mind\ncolor and direction.\n\nAvoid all things yellow.\n\nSwing fast and accurate\nfor better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n\n <a-entity\n id="modeMultiplayer"\n class="modeItem"\n multiplayer-button\n position="0 -1.50 0">\n <a-entity\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.55"\n material="shader: panelShader; brightness: 0.1; ratio: 5.5; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n mixin="font"\n text="align: left; value: MULTIPLAYER; lineHeight: 45; width: 2.6; color: #FFF"\n render-order="menutext"\n position="-1.0 0.00 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="color: colorPrimary"\n text="value: Race a friend in real time.\nCreate a room or join with a code.; width: 1.6; lineHeight: 47"\n render-order="menutext"\n position="0.50 0.00 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="loadingTipsContainer"\n bind__visible="menuActive"\n position="0 -1.3 0.1"\n rotation="0 0 0">\n\n <a-entity\n id="loadingTipsBackground"\n bind-toggle__raycastable="menuActive"\n render-order="menu"\n geometry="primitive: plane; width: 1.5; height: 0.3"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n render-order="menubutton"\n position="0 0 -0.03"></a-entity>\n\n <a-entity\n id="loadingTipsText"\n mixin="font"\n bind__text="color: colorPrimary"\n text="align: center; wrapCount: 30; width: 1; value: Press down on thumbstick center to open menu while playing."\n render-order="menutext"\n position="0 -0.02 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/victory.html"> --\x3e\n\x3c!-- Victory. --\x3e\n<a-entity\n id="victoryInfoContainer"\n position="0 1.5 -2"\n bind__visible="isVictory">\n\n <a-entity\n id="victoryAccuracyRing"\n bind__material="color: colorPrimary"k\n bind__victory-accuracy-ring="accuracy: score.finalAccuracy"\n animation="property: components.material.material.uniforms.progress.value; from: 0; easing: easeOutQuad; delay: 500; dur: 2500; autoplay: false"\n geometry="primitive: plane; width: 0.7; height: 0.7"\n material="shader: ring; transparent: true; radiusInner: 0.8; blending: additive; depthWrite: false"\n position="0 0.18 0"\n render-order="victory"></a-entity>\n\n <a-entity\n id="victoryInfoRank"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__victory-rank="isVictory: isVictory; rank: score.rank"\n bind-toggle__raycastable="isVictory"\n scale="0 0 0"\n position="0 -0.034 0"\n animation__rotation="property: object3D.rotation.y; from: 0; to: -360; loop: true; easing: linear; dur: 5000; startEvents: textcounterdone"\n animation__scale="property: scale; from: 0 0 0; to: 1 1 1; loop: false; easing: easeOutQuad; dur: 300; startEvents: textcounterdone"\n play-sound="sound: #victorySound; event: textcounterdone"\n render-order="menuitemtext"\n text-geometry="font: #VigaRegularThree; bevelEnabled: true; bevelSize: 0.01; bevelThickness: 0.01; curveSegments: 7; height: 0.15; size: 0.4"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.score + \' POINTS\'"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.2 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoBeatsHit"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.beatsText"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.1 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n mixin="font"\n bind__text="color: colorTertiary"\n text="value: 0; align: center; wrapCount: 15; baseline: top; width: 2.25"\n bind__text-counter="enabled: isVictory; value: score.finalAccuracy"\n text-counter="suffix: %"\n position="0 -0.47 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoMaxCombo"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-counter="enabled: isVictory; value: score.maxCombo"\n text="align: center; wrapCount: 22; baseline: top; width: 1"\n text-counter="prefix: MAX STREAK: ; emit: true"\n proxy-event="event: textcounterdone; to: .accuracyTextCounterSubscribe"\n position="0 -0.58 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryButtons"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n render-order="menubutton">\n <a-entity\n id="victoryRestartButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="-0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: PLAY AGAIN"></a-entity>\n </a-entity>\n\n <a-entity\n id="victoryExitButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: BACK TO MENU"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/leaderboard.html"> --\x3e\n<a-entity\n id="leaderboard"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__scale="isVictory && \'0 0 0\' || \'1 1 1\'"\n bind__visible="(!!menuSelectedChallenge.id || !!challenge.id) && (menuActive || isPaused || isVictory || isLoading) && !genreMenuOpen && gameMode !== \'ride\'"\n position="2.36 1.5 -1.19"\n rotation="0 -60 0"\n animation="property: scale; from: 0 0 0; to: 1 1 1; easing: easeOutBack; startEvents: textcounterdone"\n render-order="menuitem">\n\n <a-entity\n bind-toggle__raycastable="leaderboardActive"\n id="leaderboardBackground" position="0 0 0"\n geometry="primitive: plane; width: 2; height: 2"\n material="shader: panelShader; ratio: 1.16; brightness: 0.2"></a-entity>\n\n <a-entity\n id="leaderboardChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n bind__visible="!isVictory"\n geometry="primitive: plane; height: 0.12; width: 0.12"\n material="shader: flat"\n position="-0.44 0.63 0.001"></a-entity>\n\n <a-entity\n id="leaderboardTitle"\n mixin="font"\n text="align: center; width: 2.5; value: LEADERBOARD"\n position="0.05 0.55 0.001"\n bind__visible="!leaderboardQualified"></a-entity>\n\n <a-entity\n id="leaderboardNames"\n mixin="font"\n bind__text="color: colorSecondary; value: leaderboardNames"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; width: 1.2; anchor: left; wrapCount: 28; lineHeight: 53;"\n position="-0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardScores"\n mixin="font"\n bind__text="value: leaderboardScores"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; align: right; width: 1.2; anchor: right; color: #fff; wrapCount: 28; lineHeight: 53;"\n position="0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardEmpty"\n mixin="font"\n bind__visible="leaderboard.length === 0 && !leaderboardQualified && !leaderboardLoading"\n text="align: center; color: #999; baseline: center; width: 2; value: No high scores. Be the first!"\n position="0 0 0.001"></a-entity>\n\n <a-entity\n id="leaderboardKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: leaderboardQualified"\n super-keyboard="inputColor: #fff; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 15; width: 1.5; label: NEW HIGH SCORE!\nENTER THE LEADERBOARD; labelColor: #FAFAFA"\n position="0 -0.08 0.02"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: leaderboardusername"\n keyboard-raycastable="condition: leaderboardQualified"\n render-order="menutext"\n render-order-recursive>\n </a-entity>\n\n <a-entity id="leaderboardSubmit"\n position="0 -0.67 0.002"\n mixin="bigMenuButton"\n bind__visible-raycastable="leaderboardQualified"\n proxy-event="event: click; to: a-scene; as: leaderboardsubmit">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 26; value: SUBMIT HIGH SCORE" position="0 -0.055 0.01"></a-entity>\n \x3c!--slice9="width: 1.5; height: 0.24"--\x3e\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/multiplayerLobby.html"> --\x3e\n\x3c!--\n Multiplayer lobby panel + in-game HUD + victory results overlay.\n All conditional colors / opacities / labels are precomputed in state to\n avoid ternary expressions in bind__ attributes (aframe-state-component\n evaluates simple property paths reliably; complex JS is fragile).\n--\x3e\n\n\n\n<a-entity\n id="multiplayerLobby"\n bind__visible="mpLobbyVisible"\n position="0 1.55 -1.4"\n render-order="menu">\n\n \x3c!-- Background --\x3e\n <a-entity\n bind-toggle__raycastable="mpLobbyVisible"\n geometry="primitive: plane; width: 1.7; height: 1.35"\n material="shader: panelShader; brightness: 0.18; ratio: 1.26; borderWidth: 0.005; borderRadius: 0.04"\n render-order="menu"\n position="0 0 -0.02"></a-entity>\n\n \x3c!-- Title --\x3e\n <a-entity\n mixin="font"\n text="align: center; value: MULTIPLAYER; width: 1.5; lineHeight: 50; color: #FFF"\n render-order="menutext"\n position="0 0.60 0"></a-entity>\n\n \x3c!-- Room code --\x3e\n <a-entity\n mixin="font"\n bind__text="value: mpRoomCodeText; color: colorSecondaryBright"\n text="align: center; width: 1.5; lineHeight: 80"\n render-order="menutext"\n position="0 0.46 0"></a-entity>\n\n \x3c!-- Status / instructions --\x3e\n <a-entity\n mixin="font"\n bind__text="value: mpStatusText; color: colorPrimary"\n text="align: center; width: 1.5; wrapCount: 38; lineHeight: 50"\n render-order="menutext"\n position="0 0.34 0"></a-entity>\n\n \x3c!-- Player rows --\x3e\n <a-entity position="0 0.13 0">\n \n<a-entity position="0 0 0" bind__visible="multiplayer.row0Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row0BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row0Name; color: multiplayer.row0NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row0Score; color: multiplayer.row0ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n \n<a-entity position="0 -0.13 0" bind__visible="multiplayer.row1Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row1BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row1Name; color: multiplayer.row1NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row1Score; color: multiplayer.row1ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n \n<a-entity position="0 -0.26 0" bind__visible="multiplayer.row2Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row2BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row2Name; color: multiplayer.row2NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row2Score; color: multiplayer.row2ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n \n<a-entity position="0 -0.39 0" bind__visible="multiplayer.row3Visible">\n <a-entity\n geometry="primitive: plane; width: 1.45; height: 0.115"\n bind__material="opacity: multiplayer.row3BgOpacity"\n material="shader: flat; color: #ffffff; transparent: true"\n position="0 0 -0.005"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row3Name; color: multiplayer.row3NameColor"\n text="align: left; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="-0.62 0 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.row3Score; color: multiplayer.row3ScoreColor"\n text="align: right; width: 1.4; lineHeight: 55"\n render-order="menutext"\n position="0.62 0 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n \x3c!-- Action button row 1: idle (no room) --\x3e\n <a-entity position="0 -0.42 0">\n <a-entity\n bind__visible="!mpInRoom"\n bind-toggle__raycastable="mpLobbyVisible && !mpInRoom"\n position="-0.40 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.65; height: 0.16"\n material="shader: panelShader; brightness: 0.30; ratio: 4.0; borderWidth: 0.004"\n proxy-event="event: click; as: mpcreate; to: a-scene"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n text="align: center; value: CREATE ROOM; width: 0.6; lineHeight: 60; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n <a-entity\n bind__visible="!mpInRoom"\n bind-toggle__raycastable="mpLobbyVisible && !mpInRoom"\n position="0.40 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.65; height: 0.16"\n material="shader: panelShader; brightness: 0.30; ratio: 4.0; borderWidth: 0.004"\n multiplayer-join-button\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n bind__text="value: mpJoinButtonText"\n text="align: center; width: 0.6; lineHeight: 60; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n \x3c!-- READY (in lobby phase) --\x3e\n <a-entity\n bind__visible="mpInLobbyPhase"\n bind-toggle__raycastable="mpInLobbyPhase"\n position="-0.55 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.50; height: 0.16"\n bind__material="brightness: mpReadyButtonBrightness"\n material="shader: panelShader; ratio: 3.1; borderWidth: 0.004"\n multiplayer-ready-button\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n bind__text="value: mpReadyButtonText; color: mpReadyButtonColor"\n text="align: center; width: 0.5; lineHeight: 60"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n \x3c!-- Share link (in room) --\x3e\n <a-entity\n bind__visible="mpInRoom"\n bind-toggle__raycastable="mpInRoom"\n position="0 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.55; height: 0.16"\n material="shader: panelShader; brightness: 0.20; ratio: 3.4; borderWidth: 0.004"\n proxy-event="event: click; as: mpsharelink; to: a-scene"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n bind__text="value: mpShareButtonText; color: mpShareButtonColor"\n text="align: center; width: 0.55; lineHeight: 65"\n position="0 0 0.001"></a-entity>\n </a-entity>\n\n \x3c!-- Name editor (in room) --\x3e\n <a-entity\n bind__visible="mpInRoom"\n bind-toggle__raycastable="mpInRoom"\n position="0.55 0 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.50; height: 0.16"\n material="shader: panelShader; brightness: 0.20; ratio: 3.1; borderWidth: 0.004"\n multiplayer-name-button\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1">\n <a-entity\n mixin="font"\n text="align: center; value: SET NAME; width: 0.5; lineHeight: 60; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Action button row 2: leave + back --\x3e\n <a-entity position="0 -0.59 0">\n <a-entity\n bind__visible="mpInRoom"\n bind-toggle__raycastable="mpInRoom"\n position="0 0 0"\n geometry="primitive: plane; width: 0.55; height: 0.13"\n material="shader: panelShader; brightness: 0.10; ratio: 4.2; borderWidth: 0.003"\n proxy-event="event: click; as: mpleave; to: a-scene">\n <a-entity\n mixin="font"\n text="align: center; value: LEAVE ROOM; width: 0.55; lineHeight: 70; color: #888"\n position="0 0 0.001"></a-entity>\n </a-entity>\n <a-entity\n bind__visible="!mpInRoom"\n bind-toggle__raycastable="mpLobbyVisible && !mpInRoom"\n position="0 0 0"\n proxy-event="event: click; as: mpclose; to: a-scene">\n <a-entity\n mixin="font"\n text="align: center; value: < back to modes; width: 1.2; lineHeight: 60; color: #555"\n render-order="menutext"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== IN-GAME COUNTDOWN OVERLAY ===================== --\x3e\n<a-entity\n id="mpCountdown"\n bind__visible="mpCountdownVisible"\n position="0 1.7 -2"\n render-order="menu">\n <a-entity\n geometry="primitive: plane; width: 1.4; height: 0.4"\n material="shader: panelShader; brightness: 0.30; ratio: 3.5; borderWidth: 0.005"\n position="0 0 -0.01"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.countdownText; color: colorSecondaryBright"\n text="align: center; width: 1.3; lineHeight: 30"\n render-order="menutext"></a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== IN-GAME OPPONENT HUD ===================== --\x3e\n<a-entity\n id="mpHud"\n bind__visible="mpHudVisible"\n position="-1.45 1.65 -1.0"\n rotation="0 35 0"\n render-order="menu">\n <a-entity\n geometry="primitive: plane; width: 0.85; height: 0.55"\n material="shader: panelShader; brightness: 0.10; ratio: 1.55; borderWidth: 0.002"\n position="0 0 -0.01"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: mpRankHudText; color: colorSecondaryBright"\n text="align: left; width: 0.75; lineHeight: 60"\n position="-0.34 0.22 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.scoreDeltaText; color: mpDeltaColor"\n text="align: right; width: 0.75; lineHeight: 65"\n position="0.34 0.22 0"></a-entity>\n <a-entity\n mixin="font"\n text="align: left; value: OPPONENTS; width: 0.75; lineHeight: 80; color: #888"\n position="-0.34 0.10 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.opponentText; color: colorPrimary"\n text="align: left; width: 0.75; lineHeight: 60"\n position="-0.34 -0.02 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.opponentScores"\n text="align: right; width: 0.75; lineHeight: 60; color: #FFF"\n position="0.34 -0.02 0"></a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== VICTORY RESULTS ===================== --\x3e\n<a-entity\n id="mpResults"\n bind__visible="mpResultsVisible"\n position="0 1.05 -1.6"\n render-order="menu">\n <a-entity\n geometry="primitive: plane; width: 1.6; height: 0.7"\n material="shader: panelShader; brightness: 0.20; ratio: 2.3; borderWidth: 0.004"\n position="0 0 -0.02"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: mpWinnerBanner; color: colorSecondaryBright"\n text="align: center; width: 1.5; lineHeight: 30"\n position="0 0.27 0"></a-entity>\n <a-entity\n mixin="font"\n text="align: center; value: ROOM RESULTS; width: 1.4; lineHeight: 70; color: #888"\n position="0 0.13 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.resultsText"\n text="align: left; width: 1.4; lineHeight: 50; color: #FFF"\n position="-0.65 -0.02 0"></a-entity>\n <a-entity\n mixin="font"\n bind__text="value: multiplayer.resultsScores"\n text="align: right; width: 1.4; lineHeight: 50; color: #FFF"\n position="0.65 -0.02 0"></a-entity>\n <a-entity\n bind__visible="multiplayer.isHost"\n bind-toggle__raycastable="multiplayer.isHost && mpResultsVisible"\n position="0 -0.27 0"\n mixin="modeBackgroundHover"\n geometry="primitive: plane; width: 0.7; height: 0.13"\n material="shader: panelShader; brightness: 0.30; ratio: 5.4; borderWidth: 0.003"\n proxy-event="event: click; as: mprematch; to: a-scene">\n <a-entity\n mixin="font"\n text="align: center; value: REMATCH; width: 0.7; lineHeight: 65; color: #FFF"\n position="0 0 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\n\n\x3c!-- ===================== ROOM-CODE KEYBOARD (in-VR) ===================== --\x3e\n<a-entity\n id="mpKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: mpKeyboardOpen"\n super-keyboard="hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 4; width: 1.3; label: ENTER ROOM CODE; labelColor: #FAFAFA; inputColor: #fff"\n position="0 1.3 -1.3"\n render-order="menutext"\n multiplayer-keyboard-bridge\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: mpcodeinput"\n proxy-event__submit="event: superkeyboarddismiss; to: a-scene; as: mpkeyboardsubmit"\n bind-toggle__raycastable="mpKeyboardOpen"\n render-order-recursive>\n</a-entity>\n\n\n\x3c!-- ===================== NAME KEYBOARD (in-VR) ===================== --\x3e\n<a-entity\n id="mpNameKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: mpNameKeyboardOpen"\n super-keyboard="hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 14; width: 1.3; label: ENTER YOUR NAME; labelColor: #FAFAFA; inputColor: #fff"\n position="0 1.3 -1.3"\n render-order="menutext"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: mpnameinput"\n proxy-event__submit="event: superkeyboarddismiss; to: a-scene; as: mpnamekeyboardsubmit"\n bind-toggle__raycastable="mpNameKeyboardOpen"\n render-order-recursive>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/news.html"> --\x3e\n\n\n\n\n\n<a-entity\n id="news"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n position="2.365374194652176 1.6 -1.1952715561051024"\n rotation="0 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="newsBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 1.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="newsText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1.6; wrapCount: 50; value: three.ws\n\nGive your AI a body. three.ws is an open-source, browser-native 3D AI agent platform.\n\nDrop a GLB file, add an LLM brain, register on-chain, and embed anywhere — no plugins, no installs.\n\nVisit three.ws to build your agent."\n position="0 -0.04 0.001"></a-entity>\n</a-entity>\n\n<a-entity\n id="support"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening && inVR"\n position="2.365374194652176 0.25 -1.1952715561051024"\n rotation="-15 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="supportBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 0.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="supportImage"\n geometry="primitive: plane; width: 0.6; height: 0.5"\n material="shader: flat; src: assets/img/banner.jpg"\n position="-0.5 0 0.001"></a-entity>\n\n <a-entity\n id="supportText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1; wrapCount: 30; value: Support three.ws development.\n\nVisit three.ws for more."\n position="0.35 -0.04 0.001"></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n <a-mixin\n id="cursorMesh"\n material="shader: flat; transparent: true; src: #cursorMeshImg; depthTest: false"\n sub-object="from: #cursorLaser; name: glow"></a-mixin>\n\n <a-entity\n id="curve"\n material="shader: supercurve"\n supercurve\n supercurve-color\n render-order="curve"></a-entity>\n\n <a-entity\n id="tunnelsContainer"\n render-order="curve"\n bind__visible="isPlaying || isPaused"></a-entity>\n\n <a-entity\n id="beatContainer"\n beat-hit-sound\n bind__visible="isPlaying"></a-entity>\n\n <a-entity\n id="wallContainer"\n bind__visible="isPlaying"></a-entity>\n\n <a-entity id="curveFollowRig"\n bind__curve-follow-rig-reset="isVictory: isVictory"\n bind__supercurve-follow="enabled: isPlaying; speed: speed"\n supercurve-follow="target: #curve">\n\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/stageFollow.html"> --\x3e\n<a-entity\n id="tube"\n bind__visible="isPlaying"\n rotation="90 180 0"\n position="0 0 -5"\n geometry="primitive: cylinder; radius: 3; openEnded: true; height: 20"\n materials="name: tube"\n animation="property: components.materials.material.uniforms.opacity.value; from: 1; to: 0; easing: easeInOutCubic; startEvents: pulse"></a-entity>\n\n<a-entity\n id="platformShadow"\n obj-model="obj: #homeShadowObj"\n position="0 0.02 0"\n material="src: #homeShadowImg; shader: flat; blending: multiply; transparent: true;"\n raycastable-game\n render-order="curveshadow"\n stepback></a-entity>\n\n<a-entity\n id="platform"\n obj-model="obj: #homeObj"\n materials="name: home"\n bind__materials="animate: isPlaying"></a-entity>\n\n<a-entity\n id="sideGlows"\n bind__visible="isPlaying || isPaused">\n <a-entity\n id="leftSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: leftsideglow"\n position="-2.1 .5 -3"\n rotation="20 -90 0"\n render-order="sideglow">\n </a-entity>\n <a-entity\n id="rightSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: rightsideglow"\n position="2.1 .5 -3"\n rotation="-20 -90 0"\n render-order="sideglow">\n </a-entity>\n</a-entity>\n\n<a-entity\n id="light"\n light="type: hemisphere; color: #666"\n position="0 10 20"></a-entity>\n\n\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/score.html"> --\x3e\n<a-mixin\n id="scoreText"\n mixin="font"\n text="lineHeight: 40; color: #FAFAFA; letterSpacing: -2; align: center; opacity: 0.7"></a-mixin>\n\n<a-entity\n id="scoreContainer"\n bind__score-texts="isLoading: isLoading"\n bind__visible="score.active"\n render-order="score">\n\n <a-entity\n id="songProgressRing"\n bind__material="color: colorSecondary"\n bind__song-progress-info="enabled: isPlaying || isPaused && challenge.isBeatsPreloaded"\n geometry="primitive: plane; width: 0.57; height: 0.03"\n material="shader: flat"\n position="1.525 0.1 -3.94"\n rotation="-30 0 0">\n </a-entity>\n\n <a-entity id="scoreNumberContainer" position="1.5 0.13 -4">\n <a-entity\n id="combo"\n mixin="scoreText"\n bind__text="color: colorPrimary; value: \'STREAK \' + score.combo"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"\n position="-0.025 0.175 0"></a-entity>\n\n <a-entity\n id="accuracy"\n mixin="scoreText"\n bind__text="color: colorSecondary; value: score.accuracyInt + \'%\' + \' / \' + score.score"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/three.ws/rider/src/templates/gameMenu.html"> --\x3e\n<a-mixin\n id="gameMenuButton"\n mixin="bigMenuButton"\n animation__mouseenter="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 70"\n animation__mouseleave="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 70"\n geometry="height: 0.28"></a-mixin>\n\n<a-mixin\n id="gameMenuButtonText"\n mixin="font"\n position="0 -0.08 0.01"\n render-order="menutext"\n text="align: center; wrapCount: 17"></a-mixin>\n\n\x3c!-- Titles. --\x3e\n<a-entity id="inGameMenuTitles" position="0 2.2 -2.3">\n <a-entity mixin="gameMenuButtonText" text="value: GAME OVER; color: #f01978; width: 3.5" bind__visible="isGameOver"></a-entity>\n <a-entity mixin="gameMenuButtonText" text="value: SONG CLEARED; color: #FFF; width: 3.5" bind__visible="isVictory" position="0 0.1 0"></a-entity>\n <a-entity mixin="gameMenuButtonText" bind__text="color: colorPrimary" text="value: PAUSED; width: 3.5" bind__visible="isPaused"></a-entity>\n</a-entity>\n\n<a-entity\n id="gameMenu"\n bind__visible="isPaused || isVictory"\n position="0 1.5 -2"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25">\n\n \x3c!-- Actions. --\x3e\n <a-entity\n id="resumeButton"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isPaused"\n bind__visible="isPaused"\n position="0 0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuresume">\n <a-entity mixin="gameMenuButtonText" text="value: RESUME"></a-entity>\n </a-entity>\n\n <a-entity\n id="restartButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity mixin="gameMenuButtonText" text="value: RESTART SONG"></a-entity>\n </a-entity>\n\n <a-entity\n id="exitButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n position="0 -0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity mixin="gameMenuButtonText" text="value: EXIT TO MENU"></a-entity>\n </a-entity>\n\n \x3c!-- Song info. --\x3e\n <a-entity id="gameMenuSongInfoContainer"\n position="0 -1 0.15473"\n rotation="-20 0 0"\n song-info-positioner\n bind__song-info-positioner="victory: isVictory">\n <a-entity id="gameMenuSongBackground"\n bind-toggle__raycastable="isPaused || isVictory"\n render-order="menu"\n geometry="primitive: plane; width: 2.5; height: 0.3"\n material="shader: panelShader; transparent: true; ratio: 4; borderRadius: 0.5; borderWidth: 0.02"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="gameMenuSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat"\n position="-1 0 0"></a-entity>\n\n <a-entity id="gameMenuSongInfo">\n <a-entity\n id="gameMenuSongName"\n position="0 0.01 0"\n mixin="font" text="align: center; color: #fff; wrapCount: 30; baseline: top; lineHeight: 36; width: 1.2"\n bind__text="value: challenge.metadata.songName"></a-entity>\n <a-entity\n id="gameMenuSongSubName"\n mixin="font"\n position="0 -0.09 0"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.metadata.songSubName + \' - \' + challenge.metadata.songAuthorName"\n text-truncate="length: 80"\n text="wrapCount: 80; align: center; width: 2.4" bind__text="value: menuSelectedChallenge.songSubName"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n \x3c!-- Beat pieces, explosions, fx, and weapon trail. --\x3e\n <a-entity id="rigContainer"></a-entity>\n\n \x3c!-- Supercut FX rings. --\x3e\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n\n \x3c!-- Player. --\x3e\n <a-entity id="cameraRig">\n <a-entity\n id="camera"\n bind__wasd-controls="enabled: !inVr"\n position="0 1.6 0.5"\n camera="far: 10000"\n look-controls\n player-height\n wasd-controls="acceleration: 15"></a-entity>\n \x3c!-- Agent companion seated next to player. The GLB has its origin at\n the feet, so we drop it ~0.45m below camera height; rider has no\n visible floor at the player position, so the lower legs fade out\n and only the seated upper body is visible. --\x3e\n <a-entity\n id="agentCompanion"\n gltf-model="#agentGlb"\n agent-dance="initial: idle"\n position="0.7 0.45 0.5"\n rotation="0 165 0"\n scale="0.9 0.9 0.9"></a-entity>\n <a-entity\n id="cameraWallCollider"\n bind__raycaster__wall="enabled: isPlaying && gameMode !== \'ride\'"\n proxy-event__wallhitstart="event: raycaster-intersection; to: a-scene; as: wallhitstart"\n proxy-event__wallhitend="event: raycaster-intersection-cleared; to: a-scene; as: wallhitend"\n follow-position="target: #camera"\n raycaster__wall="objects: [data-wall-active]; interval: 150; direction: 0 -1 0; far: 5"\n visible="false"></a-entity>\n </a-entity>\n\n <a-entity\n id="controllerRig"\n proxy-event="event: recentered; to: #cameraRig; captureBubbles: true; as: recenter">\n \n\n \n <a-entity id="leftHand"\n class="weapon"\n bind__hand-swapper="enabled: rightRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: leftRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: left"\n desktop-input="hand: left"\n data-hand="left"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: left"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 71; direction: 0 1 -1"\n weapon="hand: left"\n weapon-particles="hand: left"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: left; controllerType: vive-controls"\n render-order="weapon"\n trail="color: primary; hand: left">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="leftLaser"\n class="laser"\n bind__material="color: colorPrimary"\n bind__cursor-laser="enabled: activeHand === \'left\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeleft"\n obj-model="obj: #weaponObj"\n materials="name: leftWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: leftWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="leftpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #leftFistObj"\n materials="name: leftFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #leftFistWeaponObj"\n materials="name: leftFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="leftstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="leftCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: leftRaycasterActive && !isPlaying"\n bind__material="color: colorPrimary"\n cursor-mesh="cursorEl: #leftHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n \n <a-entity id="rightHand"\n class="weapon"\n bind__hand-swapper="enabled: leftRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: rightRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: right"\n desktop-input="hand: right"\n data-hand="right"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: right"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 70; direction: 0 1 -1"\n weapon="hand: right"\n weapon-particles="hand: right"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: right; controllerType: vive-controls"\n render-order="weapon"\n trail="color: secondary; hand: right">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="rightLaser"\n class="laser"\n bind__material="color: colorSecondary"\n bind__cursor-laser="enabled: activeHand === \'right\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeright"\n obj-model="obj: #weaponObj"\n materials="name: rightWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: rightWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="rightpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #rightFistObj"\n materials="name: rightFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #rightFistWeaponObj"\n materials="name: rightFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="rightstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="rightCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: rightRaycasterActive && !isPlaying"\n bind__material="color: colorSecondary"\n cursor-mesh="cursorEl: #rightHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n </a-entity>\n\n <a-entity\n id="stepback"\n position="0 1.6 -1.55"\n geometry="primitive: plane; width: 0.25; height: 0.25;"\n material="shader: flat; src: #stepbackImg; transparent: true; opacity: 0"\n render-order="stepback"></a-entity>\n </a-entity>\n\n <a-entity\n id="mouseCursor"\n bind__raycaster="enabled: !inVR"\n cursor="rayOrigin: mouse"\n raycaster="objects: [raycastable]"></a-entity>\n <a-entity\n id="mouseCursorMesh"\n mixin="cursorMesh"\n cursor-mesh="cursorEl: #mouseCursor"\n bind__cursor-mesh="active: menuActive"\n render-order="cursor"></a-entity>\n\n <a-entity\n tail="target: #leftstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n <a-entity\n tail="target: #rightstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n</a-scene>\n';document.addEventListener("DOMContentLoaded",(function(){let e=document.getElementById("app");e||(e=document.createElement("div"),e.id="app",document.body.appendChild(e));e.innerHTML=r}));{const t=n(240).DiffDOM;if(e.hot.accept(),e.hot.data&&e.hot.data.oldHtml){const n=e.hot.data.oldHtml,i=new t,o=document.createElement("div");o.innerHTML=n;const a=document.createElement("div");a.innerHTML=r;const s=i.diff(o.querySelector("a-scene"),a.querySelector("a-scene"));i.apply(document.querySelector("a-scene"),s)}e.hot.dispose(e=>{e.oldHtml=r})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t,n){let i;return"#text"===e.nodeName?i=n.document.createTextNode(e.data):"#comment"===e.nodeName?i=n.document.createComment(e.data):("svg"===e.nodeName||t?(i=n.document.createElementNS("http://www.w3.org/2000/svg",e.nodeName),t=!0):i=n.document.createElement(e.nodeName),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>i.setAttribute(e,t)),e.childNodes&&e.childNodes.forEach(e=>i.appendChild(r(e,t,n))),n.valueDiffing&&(e.value&&(i.value=e.value),e.checked&&(i.checked=e.checked),e.selected&&(i.selected=e.selected))),i}function i(e,t){for(t=t.slice();t.length>0;){if(!e.childNodes)return!1;const n=t.splice(0,1)[0];e=e.childNodes[n]}return e}function o(e,t,n){let o,a,s,c,l,u=i(e,t[n._const.route]);const h={diff:t,node:u};if(n.preDiffApply(h))return!0;switch(t[n._const.action]){case n._const.addAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.value]);break;case n._const.modifyAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.newValue]),"INPUT"===u.nodeName&&"value"===t[n._const.name]&&(u.value=t[n._const.oldValue]);break;case n._const.removeAttribute:if(!u||!u.removeAttribute)return!1;u.removeAttribute(t[n._const.name]);break;case n._const.modifyTextElement:if(!u||3!==u.nodeType)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyValue:if(!u||void 0===u.value)return!1;u.value=t[n._const.newValue];break;case n._const.modifyComment:if(!u||void 0===u.data)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyChecked:if(!u||void 0===u.checked)return!1;u.checked=t[n._const.newValue];break;case n._const.modifySelected:if(!u||void 0===u.selected)return!1;u.selected=t[n._const.newValue];break;case n._const.replaceElement:u.parentNode.replaceChild(r(t[n._const.newValue],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u);break;case n._const.relocateGroup:c=Array(...new Array(t.groupLength)).map(()=>u.removeChild(u.childNodes[t[n._const.from]])),c.forEach((e,r)=>{0===r&&(a=u.childNodes[t[n._const.to]]),u.insertBefore(e,a||null)});break;case n._const.removeElement:u.parentNode.removeChild(u);break;case n._const.addElement:s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],u=i(e,s),u.insertBefore(r(t[n._const.element],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u.childNodes[l]||null);break;case n._const.removeTextElement:if(!u||3!==u.nodeType)return!1;u.parentNode.removeChild(u);break;case n._const.addTextElement:if(s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],o=n.document.createTextNode(t[n._const.value]),u=i(e,s),!u||!u.childNodes)return!1;u.insertBefore(o,u.childNodes[l]||null);break;default:console.log("unknown action")}return h.newNode=o,n.postDiffApply(h),!0}function a(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function s(e,t,n){t.length||(t=[t]),(t=t.slice()).reverse(),t.forEach(t=>{!function(e,t,n){switch(t[n._const.action]){case n._const.addAttribute:t[n._const.action]=n._const.removeAttribute,o(e,t,n);break;case n._const.modifyAttribute:a(t,n._const.oldValue,n._const.newValue),o(e,t,n);break;case n._const.removeAttribute:t[n._const.action]=n._const.addAttribute,o(e,t,n);break;case n._const.modifyTextElement:case n._const.modifyValue:case n._const.modifyComment:case n._const.modifyChecked:case n._const.modifySelected:case n._const.replaceElement:a(t,n._const.oldValue,n._const.newValue),o(e,t,n);break;case n._const.relocateGroup:a(t,n._const.from,n._const.to),o(e,t,n);break;case n._const.removeElement:t[n._const.action]=n._const.addElement,o(e,t,n);break;case n._const.addElement:t[n._const.action]=n._const.removeElement,o(e,t,n);break;case n._const.removeTextElement:t[n._const.action]=n._const.addTextElement,o(e,t,n);break;case n._const.addTextElement:t[n._const.action]=n._const.removeTextElement,o(e,t,n);break;default:console.log("unknown action")}}(e,t,n)})}n.r(t),n.d(t,"DiffDOM",(function(){return x})),n.d(t,"TraceLogger",(function(){return S}));class c{constructor(e={}){Object.entries(e).forEach(([e,t])=>this[e]=t)}toString(){return JSON.stringify(this)}setValue(e,t){return this[e]=t,this}}function l(e){const t=[];return"#text"!==e.nodeName&&"#comment"!==e.nodeName&&(t.push(e.nodeName),e.attributes&&(e.attributes.class&&t.push(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`),e.attributes.id&&t.push(`${e.nodeName}#${e.attributes.id}`))),t}function u(e){const t={},n={};return e.forEach(e=>{l(e).forEach(e=>{const r=e in t;r||e in n?r&&(delete t[e],n[e]=!0):t[e]=!0})}),t}function h(e,t){const n=u(e),r=u(t),i={};return Object.keys(n).forEach(e=>{r[e]&&(i[e]=!0)}),i}function d(e){return delete e.outerDone,delete e.innerDone,delete e.valueDone,!e.childNodes||e.childNodes.every(d)}function p(e,t){if(!["nodeName","value","checked","selected","data"].every(n=>e[n]===t[n]))return!1;if(Boolean(e.attributes)!==Boolean(t.attributes))return!1;if(Boolean(e.childNodes)!==Boolean(t.childNodes))return!1;if(e.attributes){const n=Object.keys(e.attributes),r=Object.keys(t.attributes);if(n.length!==r.length)return!1;if(!n.every(n=>e.attributes[n]===t.attributes[n]))return!1}if(e.childNodes){if(e.childNodes.length!==t.childNodes.length)return!1;if(!e.childNodes.every((e,n)=>p(e,t.childNodes[n])))return!1}return!0}function f(e,t,n,r,i){if(!e||!t)return!1;if(e.nodeName!==t.nodeName)return!1;if("#text"===e.nodeName)return!!i||e.data===t.data;if(e.nodeName in n)return!0;if(e.attributes&&t.attributes){if(e.attributes.id){if(e.attributes.id!==t.attributes.id)return!1;if(`${e.nodeName}#${e.attributes.id}`in n)return!0}if(e.attributes.class&&e.attributes.class===t.attributes.class){if(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`in n)return!0}}if(r)return!0;const o=e.childNodes?e.childNodes.slice().reverse():[],a=t.childNodes?t.childNodes.slice().reverse():[];if(o.length!==a.length)return!1;if(i)return o.every((e,t)=>e.nodeName===a[t].nodeName);{const e=h(o,a);return o.every((t,n)=>f(t,a[n],e,!0,!0))}}function m(e){return JSON.parse(JSON.stringify(e))}function g(e,t,n,r){let i=0,o=[];const a=e.length,s=t.length,c=Array(...new Array(a+1)).map(()=>[]),u=h(e,t);let d=a===s;d&&e.some((e,n)=>{const r=l(e),i=l(t[n]);return r.length!==i.length?(d=!1,!0):(r.some((e,t)=>{if(e!==i[t])return d=!1,!0}),!d||void 0)});for(let l=0;l<a;l++){const a=e[l];for(let e=0;e<s;e++){const s=t[e];n[l]||r[e]||!f(a,s,u,d)?c[l+1][e+1]=0:(c[l+1][e+1]=c[l][e]?c[l][e]+1:1,c[l+1][e+1]>=i&&(i=c[l+1][e+1],o=[l+1,e+1]))}}return 0!==i&&{oldValue:o[0]-i,newValue:o[1]-i,length:i}}function y(e,t){return Array(...new Array(e)).map(()=>t)}class v{constructor(){this.list=[]}add(e){this.list.push(...e)}forEach(e){this.list.forEach(t=>e(t))}}function b(e,t){let n,r,i=e;for(t=t.slice();t.length>0;){if(!i.childNodes)return!1;r=t.splice(0,1)[0],n=i,i=i.childNodes[r]}return{node:i,parentNode:n,nodeIndex:r}}function _(e,t,n){return t.forEach(t=>{!function(e,t,n){const r=b(e,t[n._const.route]);let i=r.node;const o=r.parentNode,a=r.nodeIndex,s=[],c={diff:t,node:i};if(n.preDiffApply(c))return!0;let l,u,h,d;switch(t[n._const.action]){case n._const.addAttribute:i.attributes||(i.attributes={}),i.attributes[t[n._const.name]]=t[n._const.value],"checked"===t[n._const.name]?i.checked=!0:"selected"===t[n._const.name]?i.selected=!0:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&(i.value=t[n._const.value]);break;case n._const.modifyAttribute:i.attributes[t[n._const.name]]=t[n._const.newValue];break;case n._const.removeAttribute:delete i.attributes[t[n._const.name]],0===Object.keys(i.attributes).length&&delete i.attributes,"checked"===t[n._const.name]?i.checked=!1:"selected"===t[n._const.name]?delete i.selected:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&delete i.value;break;case n._const.modifyTextElement:i.data=t[n._const.newValue];break;case n._const.modifyValue:i.value=t[n._const.newValue];break;case n._const.modifyComment:i.data=t[n._const.newValue];break;case n._const.modifyChecked:i.checked=t[n._const.newValue];break;case n._const.modifySelected:i.selected=t[n._const.newValue];break;case n._const.replaceElement:l=m(t[n._const.newValue]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,o.childNodes[a]=l;break;case n._const.relocateGroup:u=i.childNodes.splice(t[n._const.from],t.groupLength).reverse(),u.forEach(e=>i.childNodes.splice(t[n._const.to],0,e)),i.subsets&&i.subsets.forEach(e=>{if(t[n._const.from]<t[n._const.to]&&e.oldValue<=t[n._const.to]&&e.oldValue>t[n._const.from]){e.oldValue-=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else if(t[n._const.from]>t[n._const.to]&&e.oldValue>t[n._const.to]&&e.oldValue<t[n._const.from]){e.oldValue+=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else e.oldValue===t[n._const.from]&&(e.oldValue=t[n._const.to])});break;case n._const.removeElement:o.childNodes.splice(a,1),o.subsets&&o.subsets.forEach(e=>{e.oldValue>a?e.oldValue-=1:e.oldValue===a?e.delete=!0:e.oldValue<a&&e.oldValue+e.length>a&&(e.oldValue+e.length-1===a?e.length--:(s.push({newValue:e.newValue+a-e.oldValue,oldValue:a,length:e.length-a+e.oldValue-1}),e.length=a-e.oldValue))}),i=o;break;case n._const.addElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],i=b(e,h).node,l=m(t[n._const.element]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d)e.oldValue+=1;else if(e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;case n._const.removeTextElement:o.childNodes.splice(a,1),"TEXTAREA"===o.nodeName&&delete o.value,o.subsets&&o.subsets.forEach(e=>{e.oldValue>a?e.oldValue-=1:e.oldValue===a?e.delete=!0:e.oldValue<a&&e.oldValue+e.length>a&&(e.oldValue+e.length-1===a?e.length--:(s.push({newValue:e.newValue+a-e.oldValue,oldValue:a,length:e.length-a+e.oldValue-1}),e.length=a-e.oldValue))}),i=o;break;case n._const.addTextElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],l={},l.nodeName="#text",l.data=t[n._const.value],i=b(e,h).node,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),"TEXTAREA"===i.nodeName&&(i.value=t[n._const.newValue]),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d&&(e.oldValue+=1),e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;default:console.log("unknown action")}i.subsets&&(i.subsets=i.subsets.filter(e=>!e.delete&&e.oldValue!==e.newValue),s.length&&(i.subsets=i.subsets.concat(s))),c.newNode=l,n.postDiffApply(c)}(e,t,n)}),!0}function w(e,t){const n={};if(n.nodeName=e.nodeName,"#text"===n.nodeName||"#comment"===n.nodeName)n.data=e.data;else{if(e.attributes&&e.attributes.length>0){n.attributes={};Array.prototype.slice.call(e.attributes).forEach(e=>n.attributes[e.name]=e.value)}if("TEXTAREA"===n.nodeName)n.value=e.value;else if(e.childNodes&&e.childNodes.length>0){n.childNodes=[];Array.prototype.slice.call(e.childNodes).forEach(e=>n.childNodes.push(w(e,t)))}t.valueDiffing&&(void 0!==e.checked&&e.type&&["radio","checkbox"].includes(e.type.toLowerCase())?n.checked=e.checked:void 0!==e.value&&(n.value=e.value),void 0!==e.selected&&(n.selected=e.selected))}return n}class E{constructor(e,t,n){this.options=n,this.t1=w(e,this.options),this.t2=w(t,this.options),this.diffcount=0,this.foundAll=!1,this.debug&&(this.t1Orig=w(e,this.options),this.t2Orig=w(t,this.options)),this.tracker=new v}init(){return this.findDiffs(this.t1,this.t2)}findDiffs(e,t){let n;do{if(this.options.debug&&(this.diffcount+=1,this.diffcount>this.options.diffcap))throw window.diffError=[this.t1Orig,this.t2Orig],new Error(`surpassed diffcap:${JSON.stringify(this.t1Orig)} -> ${JSON.stringify(this.t2Orig)}`);n=this.findNextDiff(e,t,[]),0===n.length&&(p(e,t)||(this.foundAll?(console.error("Could not find remaining diffs!"),console.log({t1:e,t2:t})):(this.foundAll=!0,d(e),n=this.findNextDiff(e,t,[])))),n.length>0&&(this.foundAll=!1,this.tracker.add(n),_(e,n,this.options))}while(n.length>0);return this.tracker.list}findNextDiff(e,t,n){let r,i;if(this.options.maxDepth&&n.length>this.options.maxDepth)return[];if(!e.outerDone){if(r=this.findOuterDiff(e,t,n),this.filterOuterDiff&&(i=this.filterOuterDiff(e,t,r),i&&(r=i)),r.length>0)return e.outerDone=!0,r;e.outerDone=!0}if(!e.innerDone){if(r=this.findInnerDiff(e,t,n),r.length>0)return r;e.innerDone=!0}if(this.options.valueDiffing&&!e.valueDone){if(r=this.findValueDiff(e,t,n),r.length>0)return e.valueDone=!0,r;e.valueDone=!0}return[]}findOuterDiff(e,t,n){const r=[];let i,o,a,s,l,u;if(e.nodeName!==t.nodeName)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)];if(n.length&&this.options.maxChildCount&&e.childNodes&&t.childNodes&&e.childNodes.length>this.options.maxChildCount&&t.childNodes.length>this.options.maxChildCount){const r=e.childNodes.length<t.childNodes.length?e.childNodes.length:t.childNodes.length;let i=0,o=0;for(;i<this.options.maxChildDiffCount&&o<r;)p(e.childNodes[o],t.childNodes[o])||i++,o++;if(i===this.options.maxChildDiffCount)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)]}if(e.data!==t.data)return"#text"===e.nodeName?[(new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)]:[(new c).setValue(this.options._const.action,this.options._const.modifyComment).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)];for(o=e.attributes?Object.keys(e.attributes).sort():[],a=t.attributes?Object.keys(t.attributes).sort():[],s=o.length,u=0;u<s;u++)i=o[u],l=a.indexOf(i),-1===l?r.push((new c).setValue(this.options._const.action,this.options._const.removeAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,e.attributes[i])):(a.splice(l,1),e.attributes[i]!==t.attributes[i]&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.oldValue,e.attributes[i]).setValue(this.options._const.newValue,t.attributes[i])));for(s=a.length,u=0;u<s;u++)i=a[u],r.push((new c).setValue(this.options._const.action,this.options._const.addAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,t.attributes[i]));return r}findInnerDiff(e,t,n){const r=e.subsets&&e.subsetsAge--?e.subsets:e.childNodes&&t.childNodes?function(e,t){const n=e.childNodes?e.childNodes:[],r=t.childNodes?t.childNodes:[],i=y(n.length,!1),o=y(r.length,!1),a=[];let s=!0;const c=function(){return arguments[1]},l=e=>{i[s.oldValue+e]=!0,o[s.newValue+e]=!0};for(;s;)if(s=g(n,r,i,o),s){a.push(s);Array(...new Array(s.length)).map(c).forEach(e=>l(e))}return e.subsets=a,e.subsetsAge=100,a}(e,t):[],i=e.childNodes?e.childNodes:[],o=t.childNodes?t.childNodes:[];let a,s=[],l=0;if(r.length>0&&(s=this.attemptGroupRelocation(e,t,r,n),s.length>0))return s;const u=Math.max(i.length,o.length);i.length!==o.length&&(a=!0);for(let e=0;e<u;e+=1){const t=i[e],r=o[e];a&&(t&&!r?"#text"===t.nodeName?(s.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,t.data)),l-=1):(s.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(t))),l-=1):r&&!t&&("#text"===r.nodeName?s.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,r.data)):s.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(r))))),t&&r&&(s=s.concat(this.findNextDiff(t,r,n.concat(l)))),l+=1}return e.innerDone=!0,s}attemptGroupRelocation(e,t,n,r){const i=function(e,t,n){const r=e.childNodes?y(e.childNodes.length,!0):[],i=t.childNodes?y(t.childNodes.length,!0):[];let o=0;return n.forEach(e=>{const t=e.oldValue+e.length,n=e.newValue+e.length;for(let n=e.oldValue;n<t;n+=1)r[n]=o;for(let t=e.newValue;t<n;t+=1)i[t]=o;o+=1}),{gaps1:r,gaps2:i}}(e,t,n),o=i.gaps1,a=i.gaps2;let s,l,u,h,d,p,g=Math.min(o.length,a.length);const v=[];for(let i=0,y=0;i<g;y+=1,i+=1)if(!0===o[i])if(h=e.childNodes[y],"#text"===h.nodeName){if("#text"===t.childNodes[i].nodeName&&h.data!==t.childNodes[i].data){for(p=y;e.childNodes.length>p+1&&"#text"===e.childNodes[p+1].nodeName;)if(p+=1,t.childNodes[i].data===e.childNodes[p].data){d=!0;break}if(!d)return v.push((new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.oldValue,h.data).setValue(this.options._const.newValue,t.childNodes[i].data)),v}v.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),o.splice(i,1),g=Math.min(o.length,a.length),i-=1}else v.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),o.splice(i,1),g=Math.min(o.length,a.length),i-=1;else if(!0===a[i])h=t.childNodes[i],"#text"===h.nodeName?(v.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),o.splice(i,0,!0),g=Math.min(o.length,a.length),y-=1):(v.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),o.splice(i,0,!0),g=Math.min(o.length,a.length),y-=1);else if(o[i]!==a[i]){if(v.length>0)return v;if(u=n[o[i]],l=Math.min(u.newValue,e.childNodes.length-u.length),l!==u.oldValue){s=!1;for(let t=0;t<u.length;t+=1)f(e.childNodes[l+t],e.childNodes[u.oldValue+t],[],!1,!0)||(s=!0);if(s)return[(new c).setValue(this.options._const.action,this.options._const.relocateGroup).setValue("groupLength",u.length).setValue(this.options._const.from,u.oldValue).setValue(this.options._const.to,l).setValue(this.options._const.route,r)]}}return v}findValueDiff(e,t,n){const r=[];return e.selected!==t.selected&&r.push((new c).setValue(this.options._const.action,this.options._const.modifySelected).setValue(this.options._const.oldValue,e.selected).setValue(this.options._const.newValue,t.selected).setValue(this.options._const.route,n)),(e.value||t.value)&&e.value!==t.value&&"OPTION"!==e.nodeName&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyValue).setValue(this.options._const.oldValue,e.value||"").setValue(this.options._const.newValue,t.value||"").setValue(this.options._const.route,n)),e.checked!==t.checked&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyChecked).setValue(this.options._const.oldValue,e.checked).setValue(this.options._const.newValue,t.checked).setValue(this.options._const.route,n)),r}}const A={debug:!1,diffcap:10,maxDepth:!1,maxChildCount:50,maxChildDiffCount:3,valueDiffing:!0,textDiff(e,t,n,r){e.data=r},preVirtualDiffApply(){},postVirtualDiffApply(){},preDiffApply(){},postDiffApply(){},filterOuterDiff:null,compress:!1,_const:!1,document:!(!window||!window.document)&&window.document};class x{constructor(e={}){if(this.options=e,Object.entries(A).forEach(([e,t])=>{Object.prototype.hasOwnProperty.call(this.options,e)||(this.options[e]=t)}),!this.options._const){const e=["addAttribute","modifyAttribute","removeAttribute","modifyTextElement","relocateGroup","removeElement","addElement","removeTextElement","addTextElement","replaceElement","modifyValue","modifyChecked","modifySelected","modifyComment","action","route","oldValue","newValue","element","group","from","to","name","value","data","attributes","nodeName","childNodes","checked","selected"];this.options._const={},this.options.compress?e.forEach((e,t)=>this.options._const[e]=t):e.forEach(e=>this.options._const[e]=e)}this.DiffFinder=E}apply(e,t){return function(e,t,n){return t.every(t=>o(e,t,n))}(e,t,this.options)}undo(e,t){return s(e,t,this.options)}diff(e,t){return new this.DiffFinder(e,t,this.options).init()}}class S{constructor(e={}){this.pad="│ ",this.padding="",this.tick=1,this.messages=[];const t=(e,t)=>{const n=e[t];e[t]=(...r)=>{this.fin(t,Array.prototype.slice.call(r));const i=n.apply(e,r);return this.fout(t,i),i}};for(let n in e)"function"==typeof e[n]&&t(e,n);this.log("┌ TRACELOG START")}fin(e,t){this.padding+=this.pad,this.log("├─> entering "+e,t)}fout(e,t){this.log("│<──┘ generated return value",t),this.padding=this.padding.substring(0,this.padding.length-this.pad.length)}format(e,t){return`${function(e){for(e=""+e;e.length<4;)e="0"+e;return e}(t)}> ${this.padding}${e}`}log(){let e=Array.prototype.slice.call(arguments);const t=function(e){return e?"string"==typeof e?e:e instanceof HTMLElement?e.outerHTML||"<empty>":e instanceof Array?`[${e.map(t).join(",")}]`:e.toString()||e.valueOf()||"<unknown>":"<falsey>"};e=e.map(t).join(", "),this.messages.push(this.format(e,this.tick++))}toString(){let e="└───";for(;e.length<=this.padding.length+this.pad.length;)e+="× ";let t=this.padding;return this.padding="",e=this.format(e,this.tick),this.padding=t,`${this.messages.join("\n")}\n${e}`}}},function(e,t,n){"use strict";n.r(t);var r=THREE.ExtrudeGeometry;class i extends r{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}function o(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),Object.assign(o.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});var a,s,c,l,u,h,d,p,f,m={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16).toUpperCase();return function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&r|128]+e[r>>8&255]+"-"+e[r>>16&255]+e[r>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*m.DEG2RAD},radToDeg:function(e){return e*m.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function g(e,t){this.x=e||0,this.y=t||0}function y(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function v(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function b(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function _(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(g.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(g.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(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:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:(a=new g,s=new g,function(e,t){return a.set(e,e),s.set(t,t),this.clamp(a,s)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}}),Object.assign(y.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,o,a,s,c,l,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new y).fromArray(this.elements)},copy:function(e){var 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:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(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:(p=new b,function(e){var t=this.elements,n=e.elements,r=1/p.setFromMatrixColumn(e,0).length(),i=1/p.setFromMatrixColumn(e,1).length(),o=1/p.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=o*l,d=o*u,p=a*l,f=a*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=d+p*c,t[5]=h-f*c,t[9]=-a*s,t[2]=f-h*c,t[6]=p+d*c,t[10]=o*s}else if("YXZ"===e.order){var m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m+v*a,t[4]=y*a-g,t[8]=o*c,t[1]=o*u,t[5]=o*l,t[9]=-a,t[2]=g*a-y,t[6]=v+m*a,t[10]=o*s}else if("ZXY"===e.order){m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m-v*a,t[4]=-o*u,t[8]=y+g*a,t[1]=g+y*a,t[5]=o*l,t[9]=v-m*a,t[2]=-o*c,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){h=o*l,d=o*u,p=a*l,f=a*u;t[0]=s*l,t[4]=p*c-d,t[8]=h*c+f,t[1]=s*u,t[5]=f*c+h,t[9]=d*c-p,t[2]=-c,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var b=o*s,_=o*c,w=a*s,E=a*c;t[0]=s*l,t[4]=E-b*u,t[8]=w*u+_,t[1]=u,t[5]=o*l,t[9]=-a*l,t[2]=-c*l,t[6]=_*u+w,t[10]=b-E*u}else if("XZY"===e.order){b=o*s,_=o*c,w=a*s,E=a*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=b*u+E,t[5]=o*l,t[9]=_*u-w,t[2]=w*u-_,t[6]=a*l,t[10]=E*u+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,r=e._y,i=e._z,o=e._w,a=n+n,s=r+r,c=i+i,l=n*a,u=n*s,h=n*c,d=r*s,p=r*c,f=i*c,m=o*a,g=o*s,y=o*c;return t[0]=1-(d+f),t[4]=u-y,t[8]=h+g,t[1]=u+y,t[5]=1-(l+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(l+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:(u=new b,h=new b,d=new b,function(e,t,n){var r=this.elements;return d.subVectors(e,t),0===d.lengthSq()&&(d.z=1),d.normalize(),u.crossVectors(n,d),0===u.lengthSq()&&(1===Math.abs(n.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),u.crossVectors(n,d)),u.normalize(),h.crossVectors(d,u),r[0]=u.x,r[4]=h.x,r[8]=d.x,r[1]=u.y,r[5]=h.y,r[9]=d.y,r[2]=u.z,r[6]=h.z,r[10]=d.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],y=n[3],v=n[7],b=n[11],_=n[15],w=r[0],E=r[4],A=r[8],x=r[12],S=r[1],T=r[5],M=r[9],R=r[13],C=r[2],k=r[6],I=r[10],P=r[14],O=r[3],N=r[7],D=r[11],L=r[15];return i[0]=o*w+a*S+s*C+c*O,i[4]=o*E+a*T+s*k+c*N,i[8]=o*A+a*M+s*I+c*D,i[12]=o*x+a*R+s*P+c*L,i[1]=l*w+u*S+h*C+d*O,i[5]=l*E+u*T+h*k+d*N,i[9]=l*A+u*M+h*I+d*D,i[13]=l*x+u*R+h*P+d*L,i[2]=p*w+f*S+m*C+g*O,i[6]=p*E+f*T+m*k+g*N,i[10]=p*A+f*M+m*I+g*D,i[14]=p*x+f*R+m*P+g*L,i[3]=y*w+v*S+b*C+_*O,i[7]=y*E+v*T+b*k+_*N,i[11]=y*A+v*M+b*I+_*D,i[15]=y*x+v*R+b*P+_*L,this},multiplyScalar:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix4(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*c*u-i*a*h+n*c*h+r*a*d-n*s*d)+e[7]*(+t*s*d-t*c*h+i*o*h-r*o*d+r*c*l-i*s*l)+e[11]*(+t*c*u-t*a*d-i*o*u+n*o*d+i*a*l-n*c*l)+e[15]*(-r*a*l-t*s*u+t*a*h+r*o*u-n*o*h+n*s*l)},transpose:function(){var e,t=this.elements;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:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],y=r[13],v=r[14],b=r[15],_=p*v*h-y*f*h+y*u*m-l*v*m-p*u*b+l*f*b,w=g*f*h-d*v*h-g*u*m+c*v*m+d*u*b-c*f*b,E=d*y*h-g*p*h+g*l*m-c*y*m-d*l*b+c*p*b,A=g*p*u-d*y*u-g*l*f+c*y*f+d*l*v-c*p*v,x=i*_+o*w+a*E+s*A;if(0===x){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(S);return console.warn(S),this.identity()}var T=1/x;return n[0]=_*T,n[1]=(y*f*s-p*v*s-y*a*m+o*v*m+p*a*b-o*f*b)*T,n[2]=(l*v*s-y*u*s+y*a*h-o*v*h-l*a*b+o*u*b)*T,n[3]=(p*u*s-l*f*s-p*a*h+o*f*h+l*a*m-o*u*m)*T,n[4]=w*T,n[5]=(d*v*s-g*f*s+g*a*m-i*v*m-d*a*b+i*f*b)*T,n[6]=(g*u*s-c*v*s-g*a*h+i*v*h+c*a*b-i*u*b)*T,n[7]=(c*f*s-d*u*s+d*a*h-i*f*h-c*a*m+i*u*m)*T,n[8]=E*T,n[9]=(g*p*s-d*y*s-g*o*m+i*y*m+d*o*b-i*p*b)*T,n[10]=(c*y*s-g*l*s+g*o*h-i*y*h-c*o*b+i*l*b)*T,n[11]=(d*l*s-c*p*s-d*o*h+i*p*h+c*o*m-i*l*m)*T,n[12]=A*T,n[13]=(d*y*a-g*p*a+g*o*f-i*y*f-d*o*v+i*p*v)*T,n[14]=(g*l*a-c*y*a-g*o*u+i*y*u+c*o*v-i*l*v)*T,n[15]=(c*p*a-d*l*a+d*o*u-i*p*u-c*o*f+i*l*f)*T,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var 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:function(e){var 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:function(e){var 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:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,c=i*o,l=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,l*a+n,l*s-r*o,0,c*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){return this.makeRotationFromQuaternion(t),this.scale(n),this.setPosition(e),this},decompose:(c=new b,l=new y,function(e,t,n){var r=this.elements,i=c.set(r[0],r[1],r[2]).length(),o=c.set(r[4],r[5],r[6]).length(),a=c.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],l.copy(this);var s=1/i,u=1/o,h=1/a;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=u,l.elements[5]*=u,l.elements[6]*=u,l.elements[8]*=h,l.elements[9]*=h,l.elements[10]*=h,t.setFromRotationMatrix(l),n.x=i,n.y=o,n.z=a,this}),makePerspective:function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),c=1/(n-r),l=1/(o-i),u=(t+e)*s,h=(n+r)*c,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}}),Object.assign(v,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,o,a){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[o+0],d=i[o+1],p=i[o+2],f=i[o+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-a,g=s*h+c*d+l*p+u*f,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var b=Math.sqrt(v),_=Math.atan2(b,g*y);m=Math.sin(m*_)/b,a=Math.sin(a*_)/b}var w=a*y;if(s=s*m+h*w,c=c*m+d*w,l=l*m+p*w,u=u*m+f*w,m===1-a){var E=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=E,c*=E,l*=E,u*=E}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}}),Object.defineProperties(v.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(v.prototype,{set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e.order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(r/2),u=a(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"YXZ"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"ZXY"===o?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"ZYX"===o?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"YZX"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p):"XZY"===o&&(this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(u-c)*t,this._y=(o-l)*t,this._z=(a-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-c)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(o+l)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(o-l)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(c+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(a-i)/t,this._x=(o+l)/t,this._y=(c+u)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new b;return function(n,r){return void 0===t&&(t=new b),(e=n.dot(r)+1)<1e-6?(e=0,Math.abs(n.x)>Math.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,r),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(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:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+o*a+r*c-i*s,this._y=r*l+o*s+i*a-n*c,this._z=i*l+o*c+n*s-r*a,this._w=o*l-n*a-r*s-i*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,a),l=Math.sin((1-t)*c)/s,u=Math.sin(t*c)/s;return this._w=o*l+this._w*u,this._x=n*l+this._x*u,this._y=r*l+this._y*u,this._z=i*l+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(b.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(f=new v,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(f.setFromEuler(e))}),applyAxisAngle:function(){var e=new v;return function(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*n,l=s*n+a*t-i*r,u=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=c*s+h*-i+l*-a-u*-o,this.y=l*s+h*-o+u*-i-c*-a,this.z=u*s+h*-a+c*-o-l*-i,this},project:function(){var e=new y;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new y;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(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:function(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:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new b,t=new b;return function(n,r){return e.set(n,n,n),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new b;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new b;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(m.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(_.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,o,a,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var 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},setFromMatrix4:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix3(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],b=r[7],_=r[2],w=r[5],E=r[8];return i[0]=o*f+a*y+s*_,i[3]=o*m+a*v+s*w,i[6]=o*g+a*b+s*E,i[1]=c*f+l*y+u*_,i[4]=c*m+l*v+u*w,i[7]=c*g+l*b+u*E,i[2]=h*f+d*y+p*_,i[5]=h*m+d*v+p*w,i[8]=h*g+d*b+p*E,this},multiplyScalar:function(e){var 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:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8];return t*o*l-t*a*c-n*i*l+n*a*s+r*i*c-r*o*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],p=d*c-l*h,f=l*u-d*s,m=h*s-c*u,g=i*p+o*f+a*m;if(0===g){var y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(y);return console.warn(y),this.identity()}var v=1/g;return r[0]=p*v,r[1]=(a*h-d*o)*v,r[2]=(l*o-a*c)*v,r[3]=f*v,r[4]=(d*i-a*u)*v,r[5]=(a*s-l*i)*v,r[6]=m*v,r[7]=(o*u-h*i)*v,r[8]=(c*i-o*s)*v,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var 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:function(e,t,n,r,i,o,a){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*o+c*a)+o+e,-r*c,r*s,-r*(-c*o+s*a)+a+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*c,r[6]=t*a+n*l,r[1]=-n*i+t*s,r[4]=-n*o+t*c,r[7]=-n*a+t*l,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}});var w=0;function E(e,t,n,r,i,o,a,s,c,l){Object.defineProperty(this,"id",{value:w++}),this.uuid=m.generateUUID(),this.name="",this.image=void 0!==e?e:E.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:E.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==o?o:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:1023,this.type=void 0!==s?s:1009,this.offset=new g(0,0),this.repeat=new g(1,1),this.center=new g(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:3e3,this.version=0,this.onUpdate=null}function A(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function x(e,t,n){this.uuid=m.generateUUID(),this.width=e,this.height=t,this.scissor=new A(0,0,e,t),this.scissorTest=!1,this.viewport=new A(0,0,e,t),void 0===(n=n||{}).minFilter&&(n.minFilter=1006),this.texture=new E(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function S(e,t,n){x.call(this,e,t,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function T(e,t,n,r,i,o,a,s,c,l,u,h){E.call(this,null,o,a,s,c,l,r,i,u,h),this.image={data:e,width:t,height:n},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function M(e,t,n,r,i,o,a,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:301,E.call(this,e,t,n,r,i,o,a,s,c,l),this.flipY=!1}E.DEFAULT_IMAGE=void 0,E.DEFAULT_MAPPING=300,E.prototype=Object.assign(Object.create(o.prototype),{constructor:E,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=m.generateUUID()),t||void 0!==e.images[r.uuid]||(e.images[r.uuid]={uuid:r.uuid,url:function(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height;var n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(r)}),n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.defineProperty(E.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(A.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(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:function(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:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(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},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var 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:function(e){var t,n,r,i,o=e.elements,a=o[0],s=o[4],c=o[8],l=o[1],u=o[5],h=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(a+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(a+1)/2,g=(u+1)/2,y=(f+1)/2,v=(s+l)/4,b=(c+d)/4,_=(h+p)/4;return m>g&&m>y?m<.01?(n=0,r=.707106781,i=.707106781):(r=v/(n=Math.sqrt(m)),i=b/n):g>y?g<.01?(n=.707106781,r=0,i=.707106781):(n=v/(r=Math.sqrt(g)),i=_/r):y<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(y)),r=_/i),this.set(n,r,i,t),this}var w=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(w)<.001&&(w=1),this.x=(p-h)/w,this.y=(c-d)/w,this.z=(l-s)/w,this.w=Math.acos((a+u+f-1)/2),this},min:function(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:function(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:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(n,r){return void 0===e&&(e=new A,t=new A),e.set(n,n,n,n),t.set(r,r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){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:function(){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:function(){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:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),x.prototype=Object.assign(Object.create(o.prototype),{constructor:x,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),S.prototype=Object.create(x.prototype),S.prototype.constructor=S,S.prototype.isWebGLRenderTargetCube=!0,T.prototype=Object.create(E.prototype),T.prototype.constructor=T,T.prototype.isDataTexture=!0,M.prototype=Object.create(E.prototype),M.prototype.constructor=M,M.prototype.isCubeTexture=!0,Object.defineProperty(M.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var R=new E,C=new M;function k(){this.seq=[],this.map={}}var I=[],P=[],O=new Float32Array(16),N=new Float32Array(9);function D(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,o=I[i];if(void 0===o&&(o=new Float32Array(i),I[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function L(e,t){var n=P[t];void 0===n&&(n=new Int32Array(t),P[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocTextureUnit();return n}function F(e,t){e.uniform1f(this.addr,t)}function j(e,t){e.uniform1i(this.addr,t)}function U(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function B(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function V(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function H(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function z(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(N.set(t.elements),e.uniformMatrix3fv(this.addr,!1,N))}function q(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(O.set(t.elements),e.uniformMatrix4fv(this.addr,!1,O))}function G(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTexture2D(t||R,r)}function W(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTextureCube(t||C,r)}function J(e,t){e.uniform2iv(this.addr,t)}function Z(e,t){e.uniform3iv(this.addr,t)}function Y(e,t){e.uniform4iv(this.addr,t)}function X(e,t){e.uniform1fv(this.addr,t)}function Q(e,t){e.uniform1iv(this.addr,t)}function K(e,t){e.uniform2fv(this.addr,D(t,this.size,2))}function $(e,t){e.uniform3fv(this.addr,D(t,this.size,3))}function ee(e,t){e.uniform4fv(this.addr,D(t,this.size,4))}function te(e,t){e.uniformMatrix2fv(this.addr,!1,D(t,this.size,4))}function ne(e,t){e.uniformMatrix3fv(this.addr,!1,D(t,this.size,9))}function re(e,t){e.uniformMatrix4fv(this.addr,!1,D(t,this.size,16))}function ie(e,t,n){var r=t.length,i=L(n,r);e.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTexture2D(t[o]||R,i[o])}function oe(e,t,n){var r=t.length,i=L(n,r);e.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTextureCube(t[o]||C,i[o])}function ae(e,t,n){this.id=e,this.addr=n,this.setValue=function(e){switch(e){case 5126:return F;case 35664:return U;case 35665:return B;case 35666:return V;case 35674:return H;case 35675:return z;case 35676:return q;case 35678:case 36198:return G;case 35680:return W;case 5124:case 35670:return j;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return Y}}(t.type)}function se(e,t,n){this.id=e,this.addr=n,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return X;case 35664:return K;case 35665:return $;case 35666:return ee;case 35674:return te;case 35675:return ne;case 35676:return re;case 35678:return ie;case 35680:return oe;case 5124:case 35670:return Q;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return Y}}(t.type)}function ce(e){this.id=e,k.call(this)}ce.prototype.setValue=function(e,t){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var o=n[r];o.setValue(e,t[o.id])}};var le=/([\w\d_]+)(\])?(\[|\.)?/g;function ue(e,t){e.seq.push(t),e.map[t.id]=t}function he(e,t,n){var r=e.name,i=r.length;for(le.lastIndex=0;;){var o=le.exec(r),a=le.lastIndex,s=o[1],c="]"===o[2],l=o[3];if(c&&(s|=0),void 0===l||"["===l&&a+2===i){ue(n,void 0===l?new ae(s,e,t):new se(s,e,t));break}var u=n.map[s];void 0===u&&ue(n,u=new ce(s)),n=u}}function de(e,t,n){k.call(this),this.renderer=n;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<r;++i){var o=e.getActiveUniform(t,i),a=o.name;he(o,e.getUniformLocation(t,a),this)}}de.prototype.setValue=function(e,t,n){var r=this.map[t];void 0!==r&&r.setValue(e,n,this.renderer)},de.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},de.upload=function(e,t,n,r){for(var i=0,o=t.length;i!==o;++i){var a=t[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,r)}},de.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var o=e[r];o.id in t&&n.push(o)}return n};var pe={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};function fe(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}Object.assign(fe.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}return function(t,n,r){if(t=m.euclideanModulo(t,1),n=m.clamp(n,0,1),r=m.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,o=2*r-i;this.r=e(o,i,t+1/3),this.g=e(o,i,t),this.b=e(o,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,u=(l=n[1]).length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(l=pe[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(){var e=this.r,t=this.g,n=this.b;return this.r=e*e,this.g=t*t,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,n,r=e||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),c=Math.min(i,o,a),l=(c+s)/2;if(c===s)t=0,n=0;else{var u=s-c;switch(n=l<=.5?u/(s+c):u/(2-s-c),s){case i:t=(o-a)/u+(o<a?6:0);break;case o:t=(a-i)/u+2;break;case a:t=(i-o)/u+4}t/=6}return r.h=t,r.s=n,r.l=l,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=n,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var me={common:{diffuse:{value:new fe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new _},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new g(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new fe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new _}}},ge={merge:function(e){for(var t={},n=0;n<e.length;n++){var r=this.clone(e[n]);for(var i in r)t[i]=r[i]}return t},clone:function(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}},ye={alphamap_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\r\n\r\n#endif\r\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tuniform sampler2D alphaMap;\r\n\r\n#endif\r\n",alphatest_fragment:"#ifdef ALPHATEST\r\n\r\n\tif ( diffuseColor.a < ALPHATEST ) discard;\r\n\r\n#endif\r\n",aomap_fragment:"#ifdef USE_AOMAP\r\n\r\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\r\n\r\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\r\n\r\n\t#endif\r\n\r\n#endif\r\n",aomap_pars_fragment:"#ifdef USE_AOMAP\r\n\r\n\tuniform sampler2D aoMap;\r\n\tuniform float aoMapIntensity;\r\n\r\n#endif",begin_vertex:"\r\nvec3 transformed = vec3( position );\r\n",beginnormal_vertex:"\r\nvec3 objectNormal = vec3( normal );\r\n",bsdfs:'float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\r\n\r\n\tif( decayExponent > 0.0 ) {\r\n\r\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\r\n\r\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\r\n\t\t// page 32, equation 26: E[window1]\r\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\n\t\t// this is intended to be used on spot and point lights who are represented as luminous intensity\r\n\t\t// but who must be converted to luminous irradiance for surface lighting calculation\r\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\r\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\r\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\r\n\r\n#else\r\n\r\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\r\n\r\n#endif\r\n\r\n\t}\r\n\r\n\treturn 1.0;\r\n\r\n}\r\n\r\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\r\n\r\n\treturn RECIPROCAL_PI * diffuseColor;\r\n\r\n} // validated\r\n\r\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\r\n\r\n\t// Original approximation by Christophe Schlick \'94\r\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\r\n\r\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\r\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\r\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\r\n\r\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\r\n\r\n} // validated\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\r\n\t// also see #12151\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\r\n\treturn 1.0 / ( gl * gv );\r\n\r\n} // validated\r\n\r\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\r\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\r\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\r\n\treturn 0.5 / max( gv + gl, EPSILON );\r\n\r\n}\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat D_GGX( const in float alpha, const in float dotNH ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\r\n\r\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\r\n\r\n}\r\n\r\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\r\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\r\n\r\n\tfloat D = D_GGX( alpha, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// Rect Area Light\r\n\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\r\n// code: https://github.com/selfshadow/ltc_code/\r\n\r\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\r\n\r\n\tconst float LUT_SIZE = 64.0;\r\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\r\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\r\n\r\n\tfloat dotNV = saturate( dot( N, V ) );\r\n\r\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\r\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\r\n\r\n\tuv = uv * LUT_SCALE + LUT_BIAS;\r\n\r\n\treturn uv;\r\n\r\n}\r\n\r\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\r\n\r\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\r\n\t// An approximation of the form factor of a horizon-clipped rectangle.\r\n\r\n\tfloat l = length( f );\r\n\r\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\r\n\r\n}\r\n\r\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\r\n\r\n\tfloat x = dot( v1, v2 );\r\n\r\n\tfloat y = abs( x );\r\n\r\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\r\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\r\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\r\n\tfloat v = a / b;\r\n\r\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\r\n\r\n\treturn cross( v1, v2 ) * theta_sintheta;\r\n\r\n}\r\n\r\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\r\n\r\n\t// bail if point is on back side of plane of light\r\n\t// assumes ccw winding order of light vertices\r\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\r\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\r\n\tvec3 lightNormal = cross( v1, v2 );\r\n\r\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\r\n\r\n\t// construct orthonormal basis around N\r\n\tvec3 T1, T2;\r\n\tT1 = normalize( V - N * dot( V, N ) );\r\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\r\n\r\n\t// compute transform\r\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\r\n\r\n\t// transform rect\r\n\tvec3 coords[ 4 ];\r\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\r\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\r\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\r\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\r\n\r\n\t// project rect onto sphere\r\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\r\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\r\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\r\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\r\n\r\n\t// calculate vector form factor\r\n\tvec3 vectorFormFactor = vec3( 0.0 );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\r\n\r\n\t// adjust for horizon clipping\r\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\r\n\r\n\r\n\r\n\treturn vec3( result );\r\n\r\n}\r\n\r\n// End Rect Area Light\r\n\r\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\r\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\r\n\r\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\r\n\r\n\tvec4 r = roughness * c0 + c1;\r\n\r\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\r\n\r\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\r\n\r\n\treturn specularColor * AB.x + AB.y;\r\n\r\n} // validated\r\n\r\n\r\nfloat G_BlinnPhong_Implicit( ) {\r\n\r\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\r\n\treturn 0.25;\r\n\r\n}\r\n\r\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\r\n\r\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\r\n\r\n}\r\n\r\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_BlinnPhong_Implicit( );\r\n\r\n\tfloat D = D_BlinnPhong( shininess, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\r\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\r\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\r\n}\r\n\r\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\r\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\r\n}\r\n',bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\r\n\r\n\tuniform sampler2D bumpMap;\r\n\tuniform float bumpScale;\r\n\r\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\r\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\r\n\r\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\r\n\r\n\tvec2 dHdxy_fwd() {\r\n\r\n\t\tvec2 dSTdx = dFdx( vUv );\r\n\t\tvec2 dSTdy = dFdy( vUv );\r\n\r\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\r\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\r\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\r\n\r\n\t\treturn vec2( dBx, dBy );\r\n\r\n\t}\r\n\r\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\r\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\r\n\t\tvec3 vN = surf_norm;\t\t// normalized\r\n\r\n\t\tvec3 R1 = cross( vSigmaY, vN );\r\n\t\tvec3 R2 = cross( vN, vSigmaX );\r\n\r\n\t\tfloat fDet = dot( vSigmaX, R1 );\r\n\r\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n\t}\r\n\r\n#endif\r\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\tvec4 plane;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\tplane = clippingPlanes[ i ];\r\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\r\n\r\n\t}\r\n\r\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\r\n\r\n\t\tbool clipped = true;\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\t\tplane = clippingPlanes[ i ];\r\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\r\n\r\n\t\t}\r\n\r\n\t\tif ( clipped ) discard;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\t\tvarying vec3 vViewPosition;\r\n\t#endif\r\n\r\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\r\n\r\n#endif\r\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvarying vec3 vViewPosition;\r\n#endif\r\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvViewPosition = - mvPosition.xyz;\r\n#endif\r\n\r\n",color_fragment:"#ifdef USE_COLOR\r\n\r\n\tdiffuseColor.rgb *= vColor;\r\n\r\n#endif",color_pars_fragment:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif\r\n",color_pars_vertex:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif",color_vertex:"#ifdef USE_COLOR\r\n\r\n\tvColor.xyz = color.xyz;\r\n\r\n#endif",common:"#define PI 3.14159265359\r\n#define PI2 6.28318530718\r\n#define PI_HALF 1.5707963267949\r\n#define RECIPROCAL_PI 0.31830988618\r\n#define RECIPROCAL_PI2 0.15915494\r\n#define LOG2 1.442695\r\n#define EPSILON 1e-6\r\n\r\n#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\r\n\r\nfloat pow2( const in float x ) { return x*x; }\r\nfloat pow3( const in float x ) { return x*x*x; }\r\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\r\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\r\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\r\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\r\nhighp float rand( const in vec2 uv ) {\r\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\r\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\r\n\treturn fract(sin(sn) * c);\r\n}\r\n\r\nstruct IncidentLight {\r\n\tvec3 color;\r\n\tvec3 direction;\r\n\tbool visible;\r\n};\r\n\r\nstruct ReflectedLight {\r\n\tvec3 directDiffuse;\r\n\tvec3 directSpecular;\r\n\tvec3 indirectDiffuse;\r\n\tvec3 indirectSpecular;\r\n};\r\n\r\nstruct GeometricContext {\r\n\tvec3 position;\r\n\tvec3 normal;\r\n\tvec3 viewDir;\r\n};\r\n\r\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\r\n\r\n}\r\n\r\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\r\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\r\n\r\n}\r\n\r\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\r\n\r\n\treturn - distance * planeNormal + point;\r\n\r\n}\r\n\r\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\r\n\r\n}\r\n\r\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\r\n\r\n}\r\n\r\nmat3 transposeMat3( const in mat3 m ) {\r\n\r\n\tmat3 tmp;\r\n\r\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\r\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\r\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\r\n\r\n\treturn tmp;\r\n\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Relative_luminance\r\nfloat linearToRelativeLuminance( const in vec3 color ) {\r\n\r\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\r\n\r\n\treturn dot( weights, color.rgb );\r\n\r\n}\r\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\r\n\r\n#define cubeUV_textureSize (1024.0)\r\n\r\nint getFaceFromDirection(vec3 direction) {\r\n\tvec3 absDirection = abs(direction);\r\n\tint face = -1;\r\n\tif( absDirection.x > absDirection.z ) {\r\n\t\tif(absDirection.x > absDirection.y )\r\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\telse {\r\n\t\tif(absDirection.z > absDirection.y )\r\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\treturn face;\r\n}\r\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\r\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\r\n\r\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\r\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\r\n\tfloat dxRoughness = dFdx(roughness);\r\n\tfloat dyRoughness = dFdy(roughness);\r\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\r\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\r\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\r\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\r\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\r\n\tfloat mipLevel = 0.5 * log2(d);\r\n\treturn vec2(floor(mipLevel), fract(mipLevel));\r\n}\r\n\r\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\r\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\r\n\r\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\r\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\r\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\r\n\r\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\r\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\r\n\t// float powScale = exp2(roughnessLevel + mipLevel);\r\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\r\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\r\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\r\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\r\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\r\n\r\n\tbool bRes = mipLevel == 0.0;\r\n\tscale = bRes && (scale < a) ? a : scale;\r\n\r\n\tvec3 r;\r\n\tvec2 offset;\r\n\tint face = getFaceFromDirection(direction);\r\n\r\n\tfloat rcpPowScale = 1.0 / powScale;\r\n\r\n\tif( face == 0) {\r\n\t\tr = vec3(direction.x, -direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 1) {\r\n\t\tr = vec3(direction.y, direction.x, direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 2) {\r\n\t\tr = vec3(direction.z, direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 3) {\r\n\t\tr = vec3(direction.x, direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse if( face == 4) {\r\n\t\tr = vec3(direction.y, direction.x, -direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse {\r\n\t\tr = vec3(direction.z, -direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\tr = normalize(r);\r\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\r\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\r\n\tvec2 base = offset + vec2( texelOffset );\r\n\treturn base + s * ( scale - 2.0 * texelOffset );\r\n}\r\n\r\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\r\n\r\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\r\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\r\n\tfloat r1 = floor(roughnessVal);\r\n\tfloat r2 = r1 + 1.0;\r\n\tfloat t = fract(roughnessVal);\r\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\r\n\tfloat s = mipInfo.y;\r\n\tfloat level0 = mipInfo.x;\r\n\tfloat level1 = level0 + 1.0;\r\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\r\n\r\n\t// round to nearest mipmap if we are not interpolating.\r\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\r\n\r\n\t// Tri linear interpolation.\r\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\r\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\r\n\r\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\r\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\r\n\r\n\tvec4 result = mix(color10, color20, t);\r\n\r\n\treturn vec4(result.rgb, 1.0);\r\n}\r\n\r\n#endif\r\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\r\n\r\n#ifdef FLIP_SIDED\r\n\r\n\ttransformedNormal = - transformedNormal;\r\n\r\n#endif\r\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\tuniform sampler2D displacementMap;\r\n\tuniform float displacementScale;\r\n\tuniform float displacementBias;\r\n\r\n#endif\r\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\r\n\r\n#endif\r\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\r\n\r\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\r\n\r\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\r\n\r\n#endif\r\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tuniform sampler2D emissiveMap;\r\n\r\n#endif\r\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\r\n",encodings_pars_fragment:"// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nvec4 LinearToLinear( in vec4 value ) {\r\n\treturn value;\r\n}\r\n\r\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\r\n}\r\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\r\n}\r\n\r\nvec4 sRGBToLinear( in vec4 value ) {\r\n\treturn 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.w );\r\n}\r\nvec4 LinearTosRGB( in vec4 value ) {\r\n\treturn 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.w );\r\n}\r\n\r\nvec4 RGBEToLinear( in vec4 value ) {\r\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\r\n}\r\nvec4 LinearToRGBE( in vec4 value ) {\r\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\r\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\r\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\r\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\r\n}\r\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\r\n\tM = ceil( M * 255.0 ) / 255.0;\r\n\treturn vec4( value.rgb / ( M * maxRange ), M );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\r\n}\r\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat D = max( maxRange / maxRGB, 1.0 );\r\n\tD = min( floor( D ) / 255.0, 1.0 );\r\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\r\n}\r\n\r\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\r\n\r\n// M matrix, for encoding\r\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\r\nvec4 LinearToLogLuv( in vec4 value ) {\r\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\r\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\r\n\tvec4 vResult;\r\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\r\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\r\n\tvResult.w = fract(Le);\r\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\r\n\treturn vResult;\r\n}\r\n\r\n// Inverse M matrix, for decoding\r\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\r\nvec4 LogLuvToLinear( in vec4 value ) {\r\n\tfloat Le = value.z * 255.0 + value.w;\r\n\tvec3 Xp_Y_XYZp;\r\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\r\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\r\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\r\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\r\n\treturn vec4( max(vRGB, 0.0), 1.0 );\r\n}\r\n",envmap_fragment:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\r\n\r\n\t\t// Transforming Normal Vectors with the Inverse Transformation\r\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#else\r\n\r\n\t\tvec3 reflectVec = vReflect;\r\n\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\r\n\r\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\tvec2 sampleUV;\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\r\n\r\n\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\r\n\r\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\r\n\r\n\t#else\r\n\r\n\t\tvec4 envColor = vec4( 0.0 );\r\n\r\n\t#endif\r\n\r\n\tenvColor = envMapTexelToLinear( envColor );\r\n\r\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\r\n\r\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_MIX )\r\n\r\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_ADD )\r\n\r\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\r\n\tuniform float reflectivity;\r\n\tuniform float envMapIntensity;\r\n#endif\r\n\r\n#ifdef USE_ENVMAP\r\n\r\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\r\n\t\tvarying vec3 vWorldPosition;\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\t\tuniform samplerCube envMap;\r\n\t#else\r\n\t\tuniform sampler2D envMap;\r\n\t#endif\r\n\tuniform float flipEnvMap;\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\r\n\t\tuniform float refractionRatio;\r\n\t#else\r\n\t\tvarying vec3 vReflect;\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\t\tvarying vec3 vWorldPosition;\r\n\r\n\t#else\r\n\r\n\t\tvarying vec3 vReflect;\r\n\t\tuniform float refractionRatio;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvWorldPosition = worldPosition.xyz;\r\n\r\n\t#else\r\n\r\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n#endif\r\n",fog_vertex:"\r\n#ifdef USE_FOG\r\nfogDepth = -mvPosition.z;\r\n#endif",fog_pars_vertex:"#ifdef USE_FOG\r\n\r\n varying float fogDepth;\r\n\r\n#endif\r\n",fog_fragment:"#ifdef USE_FOG\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\r\n\r\n\t#else\r\n\r\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\r\n\r\n#endif\r\n",fog_pars_fragment:"#ifdef USE_FOG\r\n\r\n\tuniform vec3 fogColor;\r\n\tvarying float fogDepth;\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tuniform float fogDensity;\r\n\r\n\t#else\r\n\r\n\t\tuniform float fogNear;\r\n\t\tuniform float fogFar;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",gradientmap_pars_fragment:"#ifdef TOON\r\n\r\n\tuniform sampler2D gradientMap;\r\n\r\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\r\n\r\n\t\t// dotNL will be from -1.0 to 1.0\r\n\t\tfloat dotNL = dot( normal, lightDirection );\r\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\r\n\r\n\t\t#ifdef USE_GRADIENTMAP\r\n\r\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\r\n\r\n\t\t#else\r\n\r\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\r\n\r\n\t\t#endif\r\n\r\n\r\n\t}\r\n\r\n#endif\r\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\r\n\r\n#endif\r\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\tuniform sampler2D lightMap;\r\n\tuniform float lightMapIntensity;\r\n\r\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\r\n\r\nGeometricContext geometry;\r\ngeometry.position = mvPosition.xyz;\r\ngeometry.normal = normalize( transformedNormal );\r\ngeometry.viewDir = normalize( -mvPosition.xyz );\r\n\r\nGeometricContext backGeometry;\r\nbackGeometry.position = geometry.position;\r\nbackGeometry.normal = -geometry.normal;\r\nbackGeometry.viewDir = geometry.viewDir;\r\n\r\nvLightFront = vec3( 0.0 );\r\n\r\n#ifdef DOUBLE_SIDED\r\n\tvLightBack = vec3( 0.0 );\r\n#endif\r\n\r\nIncidentLight directLight;\r\nfloat dotNL;\r\nvec3 directLightColor_Diffuse;\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_pars:"uniform vec3 ambientLightColor;\r\n\r\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\r\n\r\n\tvec3 irradiance = ambientLightColor;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI;\r\n\r\n\t#endif\r\n\r\n\treturn irradiance;\r\n\r\n}\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tstruct DirectionalLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\r\n\r\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tdirectLight.color = directionalLight.color;\r\n\t\tdirectLight.direction = directionalLight.direction;\r\n\t\tdirectLight.visible = true;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tstruct PointLight {\r\n\t\tvec3 position;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t\tfloat shadowCameraNear;\r\n\t\tfloat shadowCameraFar;\r\n\t};\r\n\r\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = pointLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\r\n\t\tdirectLight.color = pointLight.color;\r\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\r\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tstruct SpotLight {\r\n\t\tvec3 position;\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\t\tfloat coneCos;\r\n\t\tfloat penumbraCos;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = spotLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\r\n\r\n\t\tif ( angleCos > spotLight.coneCos ) {\r\n\r\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\r\n\r\n\t\t\tdirectLight.color = spotLight.color;\r\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\r\n\t\t\tdirectLight.visible = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdirectLight.color = vec3( 0.0 );\r\n\t\t\tdirectLight.visible = false;\r\n\r\n\t\t}\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tstruct RectAreaLight {\r\n\t\tvec3 color;\r\n\t\tvec3 position;\r\n\t\tvec3 halfWidth;\r\n\t\tvec3 halfHeight;\r\n\t};\r\n\r\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\r\n\t// BRDF approximation Texture is 64x64\r\n\tuniform sampler2D ltc_1; // RGBA Float\r\n\tuniform sampler2D ltc_2; // RGBA Float\r\n\r\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\r\n\r\n#endif\r\n\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tstruct HemisphereLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 skyColor;\r\n\t\tvec3 groundColor;\r\n\t};\r\n\r\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\r\n\r\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\r\n\r\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\r\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\r\n\r\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tirradiance *= PI;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn irradiance;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\r\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\r\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec4 envMapColor = vec4( 0.0 );\r\n\r\n\t\t#endif\r\n\r\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n\t// taken from here: http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\r\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t//float envMapWidth = pow( 2.0, maxMIPLevelScalar );\r\n\t\t//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\r\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\t// clamp to allowable LOD ranges.\r\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\r\n\r\n\t}\r\n\r\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\r\n\r\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\t\tvec2 sampleUV;\r\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_phong_fragment:"BlinnPhongMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb;\r\nmaterial.specularColor = specular;\r\nmaterial.specularShininess = shininess;\r\nmaterial.specularStrength = specularStrength;\r\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n\r\nstruct BlinnPhongMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tvec3\tspecularColor;\r\n\tfloat\tspecularShininess;\r\n\tfloat\tspecularStrength;\r\n\r\n};\r\n\r\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifdef TOON\r\n\r\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\r\n\r\n\t#else\r\n\r\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\t\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#endif\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\r\n\r\n#define Material_LightProbeLOD( material )\t(0)\r\n",lights_physical_fragment:"PhysicalMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\r\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\r\n#ifdef STANDARD\r\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\r\n#else\r\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\r\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\r\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\r\n#endif\r\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tfloat\tspecularRoughness;\r\n\tvec3\tspecularColor;\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoat;\r\n\t\tfloat clearCoatRoughness;\r\n\t#endif\r\n\r\n};\r\n\r\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\r\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\r\n\r\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\r\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\r\n\r\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\r\n\r\n}\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t\tvec3 normal = geometry.normal;\r\n\t\tvec3 viewDir = geometry.viewDir;\r\n\t\tvec3 position = geometry.position;\r\n\t\tvec3 lightPos = rectAreaLight.position;\r\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\r\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\r\n\t\tvec3 lightColor = rectAreaLight.color;\r\n\t\tfloat roughness = material.specularRoughness;\r\n\r\n\t\tvec3 rectCoords[ 4 ];\r\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight; // counterclockwise\r\n\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\r\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\r\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\r\n\r\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\r\n\r\n\t\tvec4 t1 = texture2D( ltc_1, uv );\r\n\t\tvec4 t2 = texture2D( ltc_2, uv );\r\n\r\n\t\tmat3 mInv = mat3(\r\n\t\t\tvec3( t1.x, 0, t1.y ),\r\n\t\t\tvec3( 0, 1, 0 ),\r\n\t\t\tvec3( t1.z, 0, t1.w )\r\n\t\t);\r\n\r\n\t\t// LTC Fresnel Approximation by Stephen Hill\r\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\r\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\r\n\r\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\r\n\r\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\r\n\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\r\n\r\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\t\tfloat dotNL = dotNV;\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_Physical\r\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\r\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\r\n\r\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\r\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\r\n\r\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\r\n\r\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\r\n\r\n}\r\n",lights_template:"\r\n\r\nGeometricContext geometry;\r\n\r\ngeometry.position = - vViewPosition;\r\ngeometry.normal = normal;\r\ngeometry.viewDir = normalize( vViewPosition );\r\n\r\nIncidentLight directLight;\r\n\r\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\r\n\r\n\tRectAreaLight rectAreaLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\r\n\r\n\t\trectAreaLight = rectAreaLights[ i ];\r\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if defined( RE_IndirectDiffuse )\r\n\r\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\r\n\r\n\t\t#endif\r\n\r\n\t\tirradiance += lightMapIrradiance;\r\n\r\n\t#endif\r\n\r\n\t#if ( NUM_HEMI_LIGHTS > 0 )\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t// TODO, replace 8 with the real maxMIPLevel\r\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\r\n\r\n\t#endif\r\n\r\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n\r\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\r\n\r\n\t// TODO, replace 8 with the real maxMIPLevel\r\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\r\n\r\n\t#ifndef STANDARD\r\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\r\n\t#else\r\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\r\n\t#endif\r\n\r\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\r\n\r\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\r\n\r\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvFragDepth = 1.0 + gl_Position.w;\r\n\r\n\t#else\r\n\r\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\r\n\r\n\t\tgl_Position.z *= gl_Position.w;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",map_fragment:"#ifdef USE_MAP\r\n\r\n\tvec4 texelColor = texture2D( map, vUv );\r\n\r\n\ttexelColor = mapTexelToLinear( texelColor );\r\n\tdiffuseColor *= texelColor;\r\n\r\n#endif\r\n",map_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",map_particle_fragment:"#ifdef USE_MAP\r\n\r\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\r\n\tvec4 mapTexel = texture2D( map, uv );\r\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\r\n\r\n#endif\r\n",map_particle_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform mat3 uvTransform;\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",metalnessmap_fragment:"float metalnessFactor = metalness;\r\n\r\n#ifdef USE_METALNESSMAP\r\n\r\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\r\n\r\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tmetalnessFactor *= texelMetalness.b;\r\n\r\n#endif\r\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\r\n\r\n\tuniform sampler2D metalnessMap;\r\n\r\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\r\n\r\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\r\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\r\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\r\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\r\n\r\n#endif\r\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\tuniform float morphTargetInfluences[ 8 ];\r\n\r\n\t#else\r\n\r\n\tuniform float morphTargetInfluences[ 4 ];\r\n\r\n\t#endif\r\n\r\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\r\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\r\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\r\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\r\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\r\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\r\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\r\n\r\n\t#endif\r\n\r\n#endif\r\n",normal_fragment:"#ifdef FLAT_SHADED\r\n\r\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\r\n\r\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\r\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\r\n\tvec3 normal = normalize( cross( fdx, fdy ) );\r\n\r\n#else\r\n\r\n\tvec3 normal = normalize( vNormal );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\r\n\r\n\t#endif\r\n\r\n#endif\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\r\n\r\n#elif defined( USE_BUMPMAP )\r\n\r\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n\r\n#endif\r\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform vec2 normalScale;\r\n\r\n\t// Per-Pixel Tangent Space Normal Mapping\r\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\r\n\r\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\r\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\r\n\t\tvec2 st0 = dFdx( vUv.st );\r\n\t\tvec2 st1 = dFdy( vUv.st );\r\n\r\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n\t\tvec3 N = normalize( surf_norm );\r\n\r\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\r\n\t\tmapN.xy = normalScale * mapN.xy;\r\n\t\tmat3 tsn = mat3( S, T, N );\r\n\t\treturn normalize( tsn * mapN );\r\n\r\n\t}\r\n\r\n#endif\r\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\r\n\treturn normalize( normal ) * 0.5 + 0.5;\r\n}\r\n\r\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\r\n\treturn 2.0 * rgb.xyz - 1.0;\r\n}\r\n\r\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\r\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\r\n\r\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\r\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\r\n\r\nconst float ShiftRight8 = 1. / 256.;\r\n\r\nvec4 packDepthToRGBA( const in float v ) {\r\n\tvec4 r = vec4( fract( v * PackFactors ), v );\r\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\r\n\treturn r * PackUpscale;\r\n}\r\n\r\nfloat unpackRGBAToDepth( const in vec4 v ) {\r\n\treturn dot( v, UnpackFactors );\r\n}\r\n\r\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\r\n\r\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn ( viewZ + near ) / ( near - far );\r\n}\r\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\r\n\treturn linearClipZ * ( near - far ) - near;\r\n}\r\n\r\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\r\n}\r\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\r\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\r\n}\r\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\r\n\r\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\r\n\tgl_FragColor.rgb *= gl_FragColor.a;\r\n\r\n#endif\r\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\r\n\r\ngl_Position = projectionMatrix * mvPosition;\r\n",dithering_fragment:"#if defined( DITHERING )\r\n\r\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\r\n\r\n#endif\r\n",dithering_pars_fragment:"#if defined( DITHERING )\r\n\r\n\t// based on https://www.shadertoy.com/view/MslGR8\r\n\tvec3 dithering( vec3 color ) {\r\n\t\t//Calculate grid position\r\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\r\n\r\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\r\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\r\n\r\n\t\t//modify shift acording to grid position.\r\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\r\n\r\n\t\t//shift the color by dither_shift\r\n\t\treturn color + dither_shift_RGB;\r\n\t}\r\n\r\n#endif\r\n",roughnessmap_fragment:"float roughnessFactor = roughness;\r\n\r\n#ifdef USE_ROUGHNESSMAP\r\n\r\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\r\n\r\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\troughnessFactor *= texelRoughness.g;\r\n\r\n#endif\r\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\r\n\r\n\tuniform sampler2D roughnessMap;\r\n\r\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\r\n\r\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\r\n\r\n\t}\r\n\r\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\r\n\r\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\r\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\r\n\r\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\r\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\r\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\r\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\r\n\r\n\t\tvec2 f = fract( uv * size + 0.5 );\r\n\r\n\t\tfloat a = mix( lb, lt, f.y );\r\n\t\tfloat b = mix( rb, rt, f.y );\r\n\t\tfloat c = mix( a, b, f.x );\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\r\n\r\n\t\tfloat shadow = 1.0;\r\n\r\n\t\tshadowCoord.xyz /= shadowCoord.w;\r\n\t\tshadowCoord.z += shadowBias;\r\n\r\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\r\n\t\t// if ( all( something, something ) ) using this instead\r\n\r\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\r\n\t\tbool inFrustum = all( inFrustumVec );\r\n\r\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\r\n\r\n\t\tbool frustumTest = all( frustumTestVec );\r\n\r\n\t\tif ( frustumTest ) {\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering:\r\n\r\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\r\n\r\n\t\t#endif\r\n\r\n\t\t}\r\n\r\n\t\treturn shadow;\r\n\r\n\t}\r\n\r\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\r\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\r\n\t// 2D texture:\r\n\t//\r\n\t// xzXZ\r\n\t// y Y\r\n\t//\r\n\t// Y - Positive y direction\r\n\t// y - Negative y direction\r\n\t// X - Positive x direction\r\n\t// x - Negative x direction\r\n\t// Z - Positive z direction\r\n\t// z - Negative z direction\r\n\t//\r\n\t// Source and test bed:\r\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\r\n\r\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\r\n\r\n\t\t// Number of texels to avoid at the edge of each square\r\n\r\n\t\tvec3 absV = abs( v );\r\n\r\n\t\t// Intersect unit cube\r\n\r\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\r\n\t\tabsV *= scaleToCube;\r\n\r\n\t\t// Apply scale to avoid seams\r\n\r\n\t\t// two texels less per square (one texel will do for NEAREST)\r\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\r\n\r\n\t\t// Unwrap\r\n\r\n\t\t// space: -1 ... 1 range for each square\r\n\t\t//\r\n\t\t// #X##\t\tdim := ( 4 , 2 )\r\n\t\t// # #\t\tcenter := ( 1 , 1 )\r\n\r\n\t\tvec2 planar = v.xy;\r\n\r\n\t\tfloat almostATexel = 1.5 * texelSizeY;\r\n\t\tfloat almostOne = 1.0 - almostATexel;\r\n\r\n\t\tif ( absV.z >= almostOne ) {\r\n\r\n\t\t\tif ( v.z > 0.0 )\r\n\t\t\t\tplanar.x = 4.0 - v.x;\r\n\r\n\t\t} else if ( absV.x >= almostOne ) {\r\n\r\n\t\t\tfloat signX = sign( v.x );\r\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\r\n\r\n\t\t} else if ( absV.y >= almostOne ) {\r\n\r\n\t\t\tfloat signY = sign( v.y );\r\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\r\n\t\t\tplanar.y = v.z * signY - 2.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Transform to UV space\r\n\r\n\t\t// scale := 0.5 / dim\r\n\t\t// translate := ( center + 0.5 ) / dim\r\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\r\n\r\n\t}\r\n\r\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\r\n\r\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\r\n\t\t// the vector from the light to the world-space position of the fragment.\r\n\t\tvec3 lightToPosition = shadowCoord.xyz;\r\n\r\n\t\t// dp = normalized distance from light to fragment position\r\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\r\n\t\tdp += shadowBias;\r\n\r\n\t\t// bd3D = base direction 3D\r\n\t\tvec3 bd3D = normalize( lightToPosition );\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\r\n\r\n\t\t\treturn (\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering\r\n\r\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmask_pars_fragment:"float getShadowMask() {\r\n\r\n\tfloat shadow = 1.0;\r\n\r\n\t#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\t#endif\r\n\r\n\treturn shadow;\r\n\r\n}\r\n",skinbase_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\r\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\r\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\r\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\r\n\r\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\r\n\r\n\tuniform mat4 bindMatrix;\r\n\tuniform mat4 bindMatrixInverse;\r\n\r\n\t#ifdef BONE_TEXTURE\r\n\r\n\t\tuniform sampler2D boneTexture;\r\n\t\tuniform int boneTextureSize;\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tfloat j = i * 4.0;\r\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\r\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\r\n\r\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\r\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\r\n\r\n\t\t\ty = dy * ( y + 0.5 );\r\n\r\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\r\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\r\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\r\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\r\n\r\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\r\n\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#else\r\n\r\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n#endif\r\n",skinning_vertex:"#ifdef USE_SKINNING\r\n\r\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\r\n\r\n\tvec4 skinned = vec4( 0.0 );\r\n\tskinned += boneMatX * skinVertex * skinWeight.x;\r\n\tskinned += boneMatY * skinVertex * skinWeight.y;\r\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\r\n\tskinned += boneMatW * skinVertex * skinWeight.w;\r\n\r\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\r\n\r\n#endif\r\n",skinnormal_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 skinMatrix = mat4( 0.0 );\r\n\tskinMatrix += skinWeight.x * boneMatX;\r\n\tskinMatrix += skinWeight.y * boneMatY;\r\n\tskinMatrix += skinWeight.z * boneMatZ;\r\n\tskinMatrix += skinWeight.w * boneMatW;\r\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\r\n\r\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\r\n\r\n#endif\r\n",specularmap_fragment:"float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n\r\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\r\n\tspecularStrength = texelSpecular.r;\r\n\r\n#else\r\n\r\n\tspecularStrength = 1.0;\r\n\r\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\r\n\r\n\tuniform sampler2D specularMap;\r\n\r\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n",tonemapping_pars_fragment:"#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\tuniform mat3 uvTransform;\r\n\r\n#endif\r\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\r\n\r\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tattribute vec2 uv2;\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvUv2 = uv2;\r\n\r\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\r\n\r\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\r\n\r\n#endif\r\n",cube_frag:"uniform samplerCube tCube;\r\nuniform float tFlip;\r\nuniform float opacity;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\r\n\tgl_FragColor.a *= opacity;\r\n\r\n}\r\n",cube_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tgl_Position.z = gl_Position.w; // set z to camera.far\r\n\r\n}\r\n",depth_frag:"#if DEPTH_PACKING == 3200\r\n\r\n\tuniform float opacity;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tdiffuseColor.a = opacity;\r\n\r\n\t#endif\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\r\n\r\n\t#elif DEPTH_PACKING == 3201\r\n\r\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\r\n\r\n\t#endif\r\n\r\n}\r\n",depth_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",distanceRGBA_frag:"#define DISTANCE\r\n\r\nuniform vec3 referencePosition;\r\nuniform float nearDistance;\r\nuniform float farDistance;\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main () {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\tfloat dist = length( vWorldPosition - referencePosition );\r\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\r\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\r\n\r\n\tgl_FragColor = packDepthToRGBA( dist );\r\n\r\n}\r\n",distanceRGBA_vert:"#define DISTANCE\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvWorldPosition = worldPosition.xyz;\r\n\r\n}\r\n",equirect_frag:"uniform sampler2D tEquirect;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvec3 direction = normalize( vWorldPosition );\r\n\r\n\tvec2 sampleUV;\r\n\r\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\r\n\r\n}\r\n",equirect_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n}\r\n",linedashed_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform float dashSize;\r\nuniform float totalSize;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <color_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb; // simple shader\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",linedashed_vert:"uniform float scale;\r\nattribute float lineDistance;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\r\n\tvLineDistance = scale * lineDistance;\r\n\r\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n\tgl_Position = projectionMatrix * mvPosition;\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshbasic_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\r\n\t// accumulation (baked indirect lighting only)\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\r\n\r\n\t#endif\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\r\n\r\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",meshbasic_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_ENVMAP\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshlambert_frag:"uniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float opacity;\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#include <lightmap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.directDiffuse = vLightFront;\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshlambert_vert:"#define LAMBERT\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <lights_lambert_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphong_frag:"#define PHONG\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <gradientmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <lights_phong_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_phong_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphong_vert:"#define PHONG\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphysical_frag:"#define PHYSICAL\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float roughness;\r\nuniform float metalness;\r\nuniform float opacity;\r\n\r\n#ifndef STANDARD\r\n\tuniform float clearCoat;\r\n\tuniform float clearCoatRoughness;\r\n#endif\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <cube_uv_reflection_fragment>\r\n#include <lights_pars>\r\n#include <lights_physical_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <roughnessmap_pars_fragment>\r\n#include <metalnessmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <roughnessmap_fragment>\r\n\t#include <metalnessmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_physical_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphysical_vert:"#define PHYSICAL\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",normal_frag:"#define NORMAL\r\n\r\nuniform float opacity;\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <normal_fragment>\r\n\r\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\r\n\r\n}\r\n",normal_vert:"#define NORMAL\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n#endif\r\n\r\n}\r\n",points_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <color_pars_fragment>\r\n#include <map_particle_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_particle_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",points_vert:"uniform float size;\r\nuniform float scale;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\t#ifdef USE_SIZEATTENUATION\r\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\r\n\t#else\r\n\t\tgl_PointSize = size;\r\n\t#endif\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",shadow_frag:"uniform vec3 color;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\r\n\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",shadow_vert:"#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n"},ve={basic:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:ye.meshbasic_vert,fragmentShader:ye.meshbasic_frag},lambert:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.fog,me.lights,{emissive:{value:new fe(0)}}]),vertexShader:ye.meshlambert_vert,fragmentShader:ye.meshlambert_frag},phong:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:ye.meshphong_vert,fragmentShader:ye.meshphong_frag},standard:{uniforms:ge.merge([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new fe(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},points:{uniforms:ge.merge([me.points,me.fog]),vertexShader:ye.points_vert,fragmentShader:ye.points_frag},dashed:{uniforms:ge.merge([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ye.linedashed_vert,fragmentShader:ye.linedashed_frag},depth:{uniforms:ge.merge([me.common,me.displacementmap]),vertexShader:ye.depth_vert,fragmentShader:ye.depth_frag},normal:{uniforms:ge.merge([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:ye.normal_vert,fragmentShader:ye.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ye.cube_vert,fragmentShader:ye.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ye.equirect_vert,fragmentShader:ye.equirect_frag},distanceRGBA:{uniforms:ge.merge([me.common,me.displacementmap,{referencePosition:{value:new b},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ye.distanceRGBA_vert,fragmentShader:ye.distanceRGBA_frag},shadow:{uniforms:ge.merge([me.lights,me.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:ye.shadow_vert,fragmentShader:ye.shadow_frag}};function be(e,t,n,r,i,o,a,s,c){E.call(this,e,t,n,r,i,o,a,s,c),this.needsUpdate=!0}function _e(e,t,n,r,i){var o,a,s,c,l,u,h=new b,d=new v,p=new b;function f(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);o=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,o),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),s=function(){var e=t.createProgram(),n=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),t.shaderSource(r,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),t.compileShader(n),t.compileShader(r),t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),e}(),c={position:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},l={uvOffset:t.getUniformLocation(s,"uvOffset"),uvScale:t.getUniformLocation(s,"uvScale"),rotation:t.getUniformLocation(s,"rotation"),center:t.getUniformLocation(s,"center"),scale:t.getUniformLocation(s,"scale"),color:t.getUniformLocation(s,"color"),map:t.getUniformLocation(s,"map"),opacity:t.getUniformLocation(s,"opacity"),modelViewMatrix:t.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(s,"projectionMatrix"),fogType:t.getUniformLocation(s,"fogType"),fogDensity:t.getUniformLocation(s,"fogDensity"),fogNear:t.getUniformLocation(s,"fogNear"),fogFar:t.getUniformLocation(s,"fogFar"),fogColor:t.getUniformLocation(s,"fogColor"),fogDepth:t.getUniformLocation(s,"fogDepth"),alphaTest:t.getUniformLocation(s,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var h=r.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),u=new be(r)}function m(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(i,g,y){if(0!==i.length){void 0===s&&f(),n.useProgram(s),n.initAttributes(),n.enableAttribute(c.position),n.enableAttribute(c.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(c.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(c.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.uniformMatrix4fv(l.projectionMatrix,!1,y.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var v=0,b=0,_=g.fog;_?(t.uniform3f(l.fogColor,_.color.r,_.color.g,_.color.b),_.isFog?(t.uniform1f(l.fogNear,_.near),t.uniform1f(l.fogFar,_.far),t.uniform1i(l.fogType,1),v=1,b=1):_.isFogExp2&&(t.uniform1f(l.fogDensity,_.density),t.uniform1i(l.fogType,2),v=2,b=2)):(t.uniform1i(l.fogType,0),v=0,b=0);for(var w=0,E=i.length;w<E;w++){(S=i[w]).modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}i.sort(m);var A=[],x=[];for(w=0,E=i.length;w<E;w++){var S,T=(S=i[w]).material;if(!1!==T.visible){S.onBeforeRender(e,g,y,void 0,T,void 0),t.uniform1f(l.alphaTest,T.alphaTest),t.uniformMatrix4fv(l.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(h,d,p),A[0]=p.x,A[1]=p.y,x[0]=S.center.x-.5,x[1]=S.center.y-.5;var M=0;g.fog&&T.fog&&(M=b),v!==M&&(t.uniform1i(l.fogType,M),v=M),null!==T.map?(t.uniform2f(l.uvOffset,T.map.offset.x,T.map.offset.y),t.uniform2f(l.uvScale,T.map.repeat.x,T.map.repeat.y)):(t.uniform2f(l.uvOffset,0,0),t.uniform2f(l.uvScale,1,1)),t.uniform1f(l.opacity,T.opacity),t.uniform3f(l.color,T.color.r,T.color.g,T.color.b),t.uniform1f(l.rotation,T.rotation),t.uniform2fv(l.center,x),t.uniform2fv(l.scale,A),n.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst,T.blendEquationAlpha,T.blendSrcAlpha,T.blendDstAlpha,T.premultipliedAlpha),n.buffers.depth.setTest(T.depthTest),n.buffers.depth.setMask(T.depthWrite),n.buffers.color.setMask(T.colorWrite),r.setTexture2D(T.map||u,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),S.onAfterRender(e,g,y,void 0,T,void 0)}}n.enable(t.CULL_FACE),n.reset()}}}ve.physical={uniforms:ge.merge([ve.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},be.prototype=Object.create(E.prototype),be.prototype.constructor=be;var we,Ee,Ae,xe,Se,Te,Me,Re=0;function Ce(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=m.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function ke(e){Ce.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function Ie(e){Ce.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new b,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Pe(e,t){this.min=void 0!==e?e:new b(1/0,1/0,1/0),this.max=void 0!==t?t:new b(-1/0,-1/0,-1/0)}function Oe(e,t){this.center=void 0!==e?e:new b,this.radius=void 0!==t?t:0}function Ne(e,t){this.normal=void 0!==e?e:new b(1,0,0),this.constant=void 0!==t?t:0}function De(e,t,n,r,i,o){this.planes=[void 0!==e?e:new Ne,void 0!==t?t:new Ne,void 0!==n?n:new Ne,void 0!==r?r:new Ne,void 0!==i?i:new Ne,void 0!==o?o:new Ne]}function Le(e,t,n){for(var r=new De,i=new y,o=new g,a=new g(n,n),s=new b,c=new b,l=new Array(4),u=new Array(4),h={},d={0:1,1:0,2:2},p=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],f=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)],m=[new A,new A,new A,new A,new A,new A],v=0;4!==v;++v){var _=0!=(1&v),w=0!=(2&v),E=new ke({depthPacking:3201,morphTargets:_,skinning:w});l[v]=E;var S=new Ie({morphTargets:_,skinning:w});u[v]=S}var T=this;function M(t,n,r,i,o,a){var s=t.geometry,c=null,p=l,f=t.customDepthMaterial;if(r&&(p=u,f=t.customDistanceMaterial),f)c=f;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var g=0;m&&(g|=1),t.isSkinnedMesh&&n.skinning&&(g|=2),c=p[g]}if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var y=c.uuid,v=n.uuid,b=h[y];void 0===b&&(b={},h[y]=b);var _=b[v];void 0===_&&(_=c.clone(),b[v]=_),c=_}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:d[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,r&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=o,c.farDistance=a),c}function R(n,i,o,a){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var s=t.update(n),l=n.material;if(Array.isArray(l))for(var u=s.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=l[p.materialIndex];if(f&&f.visible){var m=M(n,f,a,c,o.near,o.far);e.renderBufferDirect(o,null,s,m,n,p)}}else if(l.visible){m=M(n,l,a,c,o.near,o.far);e.renderBufferDirect(o,null,s,m,n,null)}}for(var g=n.children,y=0,v=g.length;y<v;y++)R(g[y],i,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,l){if(!1!==T.enabled&&(!1!==T.autoUpdate||!1!==T.needsUpdate)&&0!==t.length){var u,h=e.context,d=e.state;d.disable(h.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var g=0,y=t.length;g<y;g++){var v=t[g],b=v.shadow,_=v&&v.isPointLight;if(void 0!==b){var w=b.camera;if(o.copy(b.mapSize),o.min(a),_){var E=o.x,A=o.y;m[0].set(2*E,A,E,A),m[1].set(0,A,E,A),m[2].set(3*E,A,E,A),m[3].set(E,A,E,A),m[4].set(3*E,0,E,A),m[5].set(E,0,E,A),o.x*=4,o.y*=2}if(null===b.map){var S={minFilter:1003,magFilter:1003,format:1023};b.map=new x(o.x,o.y,S),b.map.texture.name=v.name+".shadowMap",w.updateProjectionMatrix()}b.isSpotLightShadow&&b.update(v);var M=b.map,C=b.matrix;c.setFromMatrixPosition(v.matrixWorld),w.position.copy(c),_?(u=6,C.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(v.target.matrixWorld),w.lookAt(s),w.updateMatrixWorld(),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(w.projectionMatrix),C.multiply(w.matrixWorldInverse)),e.setRenderTarget(M),e.clear();for(var k=0;k<u;k++){if(_){s.copy(w.position),s.add(p[k]),w.up.copy(f[k]),w.lookAt(s),w.updateMatrixWorld();var I=m[k];d.viewport(I)}i.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse),r.setFromMatrix(i),R(n,l,w,_)}}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}T.needsUpdate=!1}}}function Fe(e){var t={};return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t[e.uuid]},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=t[n.uuid];r&&(e.deleteBuffer(r.buffer),delete t[n.uuid])},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i=t[n.uuid];void 0===i?t[n.uuid]=function(t,n){var r=t.array,i=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();var a=e.FLOAT;return r instanceof Float32Array?a=e.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=e.UNSIGNED_SHORT:r instanceof Int16Array?a=e.SHORT:r instanceof Uint32Array?a=e.UNSIGNED_INT:r instanceof Int32Array?a=e.INT:r instanceof Int8Array?a=e.BYTE:r instanceof Uint8Array&&(a=e.UNSIGNED_BYTE),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(n,r):i.version<n.version&&(!function(t,n,r){var i=n.array,o=n.updateRange;e.bindBuffer(r,t),!1===n.dynamic?e.bufferData(r,i,e.STATIC_DRAW):-1===o.count?e.bufferSubData(r,0,i):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,o.offset*i.BYTES_PER_ELEMENT,i.subarray(o.offset,o.offset+o.count)),o.count=-1)}(i.buffer,n,r),i.version=n.version)}}}function je(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||je.DefaultOrder}function Ue(){this.mask=1}Ce.prototype=Object.assign(Object.create(o.prototype),{constructor:Ce,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]="overdraw"===t?Number(n):n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.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),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.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.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,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.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,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.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ke.prototype=Object.create(Ce.prototype),ke.prototype.constructor=ke,ke.prototype.isMeshDepthMaterial=!0,ke.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,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},Ie.prototype=Object.create(Ce.prototype),Ie.prototype.constructor=Ie,Ie.prototype.isMeshDistanceMaterial=!0,Ie.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Object.assign(Pe.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new b;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,n,r=new b;function i(i){var o=i.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(t=0,n=a.length;t<n;t++)r.copy(a[t]),r.applyMatrix4(i.matrixWorld),e.expandByPoint(r)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(t=0,n=s.count;t<n;t++)r.fromBufferAttribute(s,t).applyMatrix4(i.matrixWorld),e.expandByPoint(r)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(i),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(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:function(e,t){return(t||new b).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:function(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:(Ee=new b,function(e){return this.clampPoint(e.center,Ee),Ee.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var 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:function(){var e=new b,t=new b,n=new b,r=new b,i=new b,o=new b,a=new b,s=new b,c=new b,l=new b;function u(r){var i,o;for(i=0,o=r.length-3;i<=o;i+=3){a.fromArray(r,i);var s=c.x*Math.abs(a.x)+c.y*Math.abs(a.y)+c.z*Math.abs(a.z),l=e.dot(a),u=t.dot(a),h=n.dot(a);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(a.a,s),t.subVectors(a.b,s),n.subVectors(a.c,s),r.subVectors(t,e),i.subVectors(n,t),o.subVectors(e,n);var h=[0,-r.z,r.y,0,-i.z,i.y,0,-o.z,o.y,r.z,0,-r.x,i.z,0,-i.x,o.z,0,-o.x,-r.y,r.x,0,-i.y,i.x,0,-o.y,o.x,0];return!!u(h)&&(!!u(h=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(r,i),u(h=[l.x,l.y,l.z])))}}(),clampPoint:function(e,t){return(t||new b).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new b;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new b;return function(t){var n=t||new Oe;return this.getCenter(n.center),n.radius=.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(we=[new b,new b,new b,new b,new b,new b,new b,new b],function(e){return this.isEmpty()||(we[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),we[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),we[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),we[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),we[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),we[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),we[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),we[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(we)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Oe.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(Ae=new Pe,function(e,t){var n=this.center;void 0!==t?n.copy(t):Ae.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;i<o;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),r=t||new b;return r.copy(e),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new Pe;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Ne.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new b,t=new b;return function(n,r,i){var o=e.subVectors(i,r).cross(t.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return(t||new b).copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new b;return function(t,n){var r=n||new b,i=t.delta(e),o=this.normal.dot(i);if(0===o)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var a=-(t.start.dot(this.normal)+this.constant)/o;return a<0||a>1?void 0:r.copy(i).multiplyScalar(a).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return(e||new b).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new b,t=new _;return function(n,r){var i=r||t.getNormalMatrix(n),o=this.coplanarPoint(e).applyMatrix4(n),a=this.normal.applyMatrix3(i).normalize();return this.constant=-o.dot(a),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(De.prototype,{set:function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return t[0].setComponents(a-r,u-s,f-h,v-m).normalize(),t[1].setComponents(a+r,u+s,f+h,v+m).normalize(),t[2].setComponents(a+i,u+c,f+d,v+g).normalize(),t[3].setComponents(a-i,u-c,f-d,v-g).normalize(),t[4].setComponents(a-o,u-l,f-p,v-y).normalize(),t[5].setComponents(a+o,u+l,f+p,v+y).normalize(),this},intersectsObject:(Te=new Oe,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Te.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Te)}),intersectsSprite:function(){var e=new Oe;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(xe=new b,Se=new b,function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];xe.x=r.normal.x>0?e.min.x:e.max.x,Se.x=r.normal.x>0?e.max.x:e.min.x,xe.y=r.normal.y>0?e.min.y:e.max.y,Se.y=r.normal.y>0?e.max.y:e.min.y,xe.z=r.normal.z>0?e.min.z:e.max.z,Se.z=r.normal.z>0?e.max.z:e.min.z;var i=r.distanceToPoint(xe),o=r.distanceToPoint(Se);if(i<0&&o<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}),je.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],je.DefaultOrder="XYZ",Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(je.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=m.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new y;return function(t,n,r){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(Me=new v,function(e){return Me.setFromEuler(this),this.setFromQuaternion(Me,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new b(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Ue.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var Be,Ve,He,ze,qe=0;function Ge(){Object.defineProperty(this,"id",{value:qe++}),this.uuid=m.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ge.DefaultUp.clone();var e=new b,t=new je,n=new v,r=new b(1,1,1);t.onChange((function(){n.setFromEuler(t,!1)})),n.onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:r},modelViewMatrix:{value:new y},normalMatrix:{value:new _}}),this.matrix=new y,this.matrixWorld=new y,this.matrixAutoUpdate=Ge.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ue,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function We(){Ge.call(this),this.type="Camera",this.matrixWorldInverse=new y,this.projectionMatrix=new y}function Je(e,t,n,r,i,o){We.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function Ze(e,t,n,r,i,o){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new b,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new fe,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Ge.DefaultUp=new b(0,1,0),Ge.DefaultMatrixAutoUpdate=!0,Ge.prototype=Object.assign(Object.create(o.prototype),{constructor:Ge,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(ze=new v,function(e,t){return ze.setFromAxisAngle(e,t),this.quaternion.multiply(ze),this}),rotateOnWorldAxis:function(){var e=new v;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new b(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new b(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new b(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new b;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translateX:function(){var e=new b(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new b(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new b(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(He=new y,function(e){return e.applyMatrix4(He.getInverse(this.matrixWorld))}),lookAt:function(){var e=new y,t=new b;return function(n,r,i){n.isVector3?t.copy(n):t.set(n,r,i),this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){var t=e||new b;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Be=new b,Ve=new b,function(e){var t=e||new v;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(Be,t,Ve),t}),getWorldRotation:function(){var e=new v;return function(t){var n=t||new je;return this.getWorldQuaternion(e),n.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new b,t=new v;return function(n){var r=n||new b;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.matrix=this.matrix.toArray(),void 0!==this.geometry){r.geometry=i(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,c=a.length;s<c;s++){var l=a[s];i(e.shapes,l)}else i(e.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),d=m(e.materials),p=m(e.textures),f=m(e.images);a=m(e.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),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.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.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),We.prototype=Object.assign(Object.create(Ge.prototype),{constructor:We,isCamera:!0,copy:function(e,t){return Ge.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){Ge.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Je.prototype=Object.assign(Object.create(We.prototype),{constructor:Je,isOrthographicCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;o=(i+=u*(this.view.offsetX/c))+u*(this.view.width/c),s=(a-=h*(this.view.offsetY/l))-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far)},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Object.assign(Ze.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Ye,Xe=0;function Qe(){Object.defineProperty(this,"id",{value:Xe+=2}),this.uuid=m.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ke(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=m.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function $e(e,t,n){Ke.call(this,new Int8Array(e),t,n)}function et(e,t,n){Ke.call(this,new Uint8Array(e),t,n)}function tt(e,t,n){Ke.call(this,new Uint8ClampedArray(e),t,n)}function nt(e,t,n){Ke.call(this,new Int16Array(e),t,n)}function rt(e,t,n){Ke.call(this,new Uint16Array(e),t,n)}function it(e,t,n){Ke.call(this,new Int32Array(e),t,n)}function ot(e,t,n){Ke.call(this,new Uint32Array(e),t,n)}function at(e,t,n){Ke.call(this,new Float32Array(e),t,n)}function st(e,t,n){Ke.call(this,new Float64Array(e),t,n)}function ct(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function lt(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Qe.prototype=Object.assign(Object.create(o.prototype),{constructor:Qe,isGeometry:!0,applyMatrix:function(e){for(var t=(new _).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var o=0,a=i.vertexNormals.length;o<a;o++)i.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:(Ye=new Ge,function(e){Ye.lookAt(e),Ye.updateMatrix(),this.applyMatrix(Ye.matrix)}),fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes,i=r.position.array,o=void 0!==r.normal?r.normal.array:void 0,a=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],h=[],d=0,p=0;d<i.length;d+=3,p+=2)t.vertices.push(new b(i[d],i[d+1],i[d+2])),void 0!==o&&l.push(new b(o[d],o[d+1],o[d+2])),void 0!==a&&t.colors.push(new fe(a[d],a[d+1],a[d+2])),void 0!==s&&u.push(new g(s[p],s[p+1])),void 0!==c&&h.push(new g(c[p],c[p+1]));function f(e,n,r,i){var d=new Ze(e,n,r,void 0!==o?[l[e].clone(),l[n].clone(),l[r].clone()]:[],void 0!==a?[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()]:[],i);t.faces.push(d),void 0!==s&&t.faceVertexUvs[0].push([u[e].clone(),u[n].clone(),u[r].clone()]),void 0!==c&&t.faceVertexUvs[1].push([h[e].clone(),h[n].clone(),h[r].clone()])}var m=e.groups;if(m.length>0)for(d=0;d<m.length;d++)for(var y=m[d],v=y.start,_=(p=v,v+y.count);p<_;p+=3)void 0!==n?f(n[p],n[p+1],n[p+2],y.materialIndex):f(p,p+1,p+2,y.materialIndex);else if(void 0!==n)for(d=0;d<n.length;d+=3)f(n[d],n[d+1],n[d+2]);else for(d=0;d<i.length/3;d+=3)f(d,d+1,d+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new y;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new b,t=new b,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,a),t.subVectors(o,a),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,o,a;for(void 0===e&&(e=!0),a=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)a[t]=new b;if(e){var s,c,l,u=new b,h=new b;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],c=this.vertices[o.b],l=this.vertices[o.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),a[o.a].add(u),a[o.b].add(u),a[o.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a[(o=this.faces[r]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(t=0,n=this.vertices.length;t<n;t++)a[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(o=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var o=new Qe;for(o.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var a=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new b,l={a:new b,b:new b,c:new b},a.push(c),s.push(l)}var c,l,u=this.morphNormals[e];for(o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Oe),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],u=e.faceVertexUvs[0],h=this.colors,d=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new _).getNormalMatrix(t));for(var p=0,f=a.length;p<f;p++){var m=a[p].clone();void 0!==t&&m.applyMatrix4(t),o.push(m)}for(p=0,f=d.length;p<f;p++)h.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,y,v,b=c[p],w=b.vertexNormals,E=b.vertexColors;(g=new Ze(b.a+i,b.b+i,b.c+i)).normal.copy(b.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var A=0,x=w.length;A<x;A++)y=w[A].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),g.vertexNormals.push(y);g.color.copy(b.color);for(A=0,x=E.length;A<x;A++)v=E[A],g.vertexColors.push(v.clone());g.materialIndex=b.materialIndex+n,s.push(g)}for(p=0,f=u.length;p<f;p++){var S=u[p],T=[];if(void 0!==S){for(A=0,x=S.length;A<x;A++)T.push(S[A].clone());l.push(T)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,o,a,s,c={},l=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(c[t]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],o=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(o[p]===o[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new b(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===t&&(r=[]),a&&a.length===t&&(i=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(o[s]),i&&i.push(a[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var o=this.vertices[i];r.push(o.x,o.y,o.z)}var a=[],s=[],c={},l=[],u={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=p.normal.length()>0,g=p.vertexNormals.length>0,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,v=p.vertexColors.length>0,b=0;if(b=A(b,0,0),b=A(b,1,!0),b=A(b,2,!1),b=A(b,3,f),b=A(b,4,m),b=A(b,5,g),b=A(b,6,y),b=A(b,7,v),a.push(b),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var _=this.faceVertexUvs[0][i];a.push(T(_[0]),T(_[1]),T(_[2]))}if(m&&a.push(x(p.normal)),g){var w=p.vertexNormals;a.push(x(w[0]),x(w[1]),x(w[2]))}if(y&&a.push(S(p.color)),v){var E=p.vertexColors;a.push(S(E[0]),S(E[1]),S(E[2]))}}function A(e,t,n){return n?e|1<<t:e&~(1<<t)}function x(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function S(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=l.length,l.push(e.getHex())),u[t]}function T(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=a,e},clone:function(){return(new Qe).copy(this)},copy:function(e){var t,n,r,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],d=[];for(o=0,a=h.length;o<a;o++){var p=h[o];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var y={};if(void 0!==g[t].vertexNormals)for(y.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],b={};b.a=v.a.clone(),b.b=v.b.clone(),b.c=v.c.clone(),y.vertexNormals.push(b)}if(void 0!==g[t].faceNormals)for(y.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)y.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(y)}var _=e.skinWeights;for(t=0,n=_.length;t<n;t++)this.skinWeights.push(_[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var E=e.lineDistances;for(t=0,n=E.length;t<n;t++)this.lineDistances.push(E[t]);var A=e.boundingBox;null!==A&&(this.boundingBox=A.clone());var x=e.boundingSphere;return null!==x&&(this.boundingSphere=x.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ke.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ke.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new fe),t[n++]=o.r,t[n++]=o.g,t[n++]=o.b}return this},copyIndicesArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];t[n++]=o.a,t[n++]=o.b,t[n++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new g),t[n++]=o.x,t[n++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new b),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new A),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),$e.prototype=Object.create(Ke.prototype),$e.prototype.constructor=$e,et.prototype=Object.create(Ke.prototype),et.prototype.constructor=et,tt.prototype=Object.create(Ke.prototype),tt.prototype.constructor=tt,nt.prototype=Object.create(Ke.prototype),nt.prototype.constructor=nt,rt.prototype=Object.create(Ke.prototype),rt.prototype.constructor=rt,it.prototype=Object.create(Ke.prototype),it.prototype.constructor=it,ot.prototype=Object.create(Ke.prototype),ot.prototype.constructor=ot,at.prototype=Object.create(Ke.prototype),at.prototype.constructor=at,st.prototype=Object.create(Ke.prototype),st.prototype.constructor=st,Object.assign(ct.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,o=0;o<i.length;o++){var a=i[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==t&&(t.count=3*o-t.start,n.push(t)),t={start:3*o,materialIndex:r})}void 0!==t&&(t.count=3*o-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,o=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]=[];this.morphTargets.position=t}var u,h=e.morphNormals,d=h.length;if(d>0){u=[];for(l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}var p=e.skinIndices,f=e.skinWeights,m=p.length===r.length,y=f.length===r.length;for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(r[v.a],r[v.b],r[v.c]);var b=v.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var _=v.normal;this.normals.push(_,_,_)}var w,E=v.vertexColors;if(3===E.length)this.colors.push(E[0],E[1],E[2]);else{var A=v.color;this.colors.push(A,A,A)}if(!0===o)void 0!==(w=i[0][l])?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new g,new g,new g));if(!0===a)void 0!==(w=i[1][l])?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new g,new g,new g));for(var x=0;x<c;x++){var S=s[x].vertices;t[x].push(S[v.a],S[v.b],S[v.c])}for(x=0;x<d;x++){var T=h[x].vertexNormals[l];u[x].push(T.a,T.b,T.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),y&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var ut,ht,dt,pt,ft,mt,gt,yt=1;function vt(){Object.defineProperty(this,"id",{value:yt+=2}),this.uuid=m.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function bt(e,t,n,r,i,o){Qe.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new _t(e,t,n,r,i,o)),this.mergeVertices()}function _t(e,t,n,r,i,o){vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};var a=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;var s=[],c=[],l=[],u=[],h=0,d=0;function p(e,t,n,r,i,o,p,f,m,g,y){var v,_,w=o/m,E=p/g,A=o/2,x=p/2,S=f/2,T=m+1,M=g+1,R=0,C=0,k=new b;for(_=0;_<M;_++){var I=_*E-x;for(v=0;v<T;v++){var P=v*w-A;k[e]=P*r,k[t]=I*i,k[n]=S,c.push(k.x,k.y,k.z),k[e]=0,k[t]=0,k[n]=f>0?1:-1,l.push(k.x,k.y,k.z),u.push(v/m),u.push(1-_/g),R+=1}}for(_=0;_<g;_++)for(v=0;v<m;v++){var O=h+v+T*_,N=h+v+T*(_+1),D=h+(v+1)+T*(_+1),L=h+(v+1)+T*_;s.push(O,N,L),s.push(N,D,L),C+=6}a.addGroup(d,C,y),d+=C,h+=R}p("z","y","x",-1,-1,n,t,e,o,i,0),p("z","y","x",1,-1,n,t,-e,o,i,1),p("x","z","y",1,1,e,n,t,r,o,2),p("x","z","y",1,-1,e,n,-t,r,o,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.addAttribute("position",new at(c,3)),this.addAttribute("normal",new at(l,3)),this.addAttribute("uv",new at(u,2))}function wt(e,t,n,r){Qe.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Et(e,t,n,r)),this.mergeVertices()}function Et(e,t,n,r){vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,o,a=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,u=c+1,h=l+1,d=e/c,p=t/l,f=[],m=[],g=[],y=[];for(o=0;o<h;o++){var v=o*p-s;for(i=0;i<u;i++){var b=i*d-a;m.push(b,-v,0),g.push(0,0,1),y.push(i/c),y.push(1-o/l)}}for(o=0;o<l;o++)for(i=0;i<c;i++){var _=i+u*o,w=i+u*(o+1),E=i+1+u*(o+1),A=i+1+u*o;f.push(_,w,A),f.push(w,E,A)}this.setIndex(f),this.addAttribute("position",new at(m,3)),this.addAttribute("normal",new at(g,3)),this.addAttribute("uv",new at(y,2))}function At(e){Ce.call(this),this.type="MeshBasicMaterial",this.color=new fe(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.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function xt(e){Ce.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function St(e,t){this.origin=void 0!==e?e:new b,this.direction=void 0!==t?t:new b}function Tt(e,t){this.start=void 0!==e?e:new b,this.end=void 0!==t?t:new b}function Mt(e,t,n){this.a=void 0!==e?e:new b,this.b=void 0!==t?t:new b,this.c=void 0!==n?n:new b}function Rt(e,t){Ge.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new At({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function Ct(e,t,n,r){var i,o,a,s=new fe(0),c=0;function l(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){l(s,c=e)},render:function(t,r,u,h){var d=r.background;null===d?l(s,c):d&&d.isColor&&(l(d,1),h=!0),(e.autoClear||h)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&d.isCubeTexture?(void 0===a&&((a=new Rt(new _t(1,1,1),new xt({uniforms:ve.cube.uniforms,vertexShader:ve.cube.vertexShader,fragmentShader:ve.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),a.geometry.removeAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(a.geometry)),a.material.uniforms.tCube.value=d,t.push(a,a.geometry,a.material,0,null)):d&&d.isTexture&&(void 0===i&&(i=new Je(-1,1,1,-1,0,1),o=new Rt(new Et(2,2),new At({depthTest:!1,depthWrite:!1,fog:!1})),n.update(o.geometry)),o.material.map=d,e.renderBufferDirect(i,null,o.geometry,o.material,o,null))}}}function kt(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function It(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Pt(){var e=[],t=0,n=[],r=[];return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(i,o,a,s,c){var l=e[t];void 0===l?(l={id:i.id,object:i,geometry:o,material:a,program:a.program,renderOrder:i.renderOrder,z:s,group:c},e[t]=l):(l.id=i.id,l.object=i,l.geometry=o,l.material=a,l.program=a.program,l.renderOrder=i.renderOrder,l.z=s,l.group=c),(!0===a.transparent?r:n).push(l),t++},sort:function(){n.length>1&&n.sort(kt),r.length>1&&r.sort(It)}}}function Ot(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new Pt,e[r]=i),i},dispose:function(){e={}}}}function Nt(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Dt(e){var t={},n=new Float32Array(8);return{update:function(r,i,o,a){var s=r.morphTargetInfluences,c=s.length,l=t[i.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}var h=o.morphTargets&&i.morphAttributes.position,d=o.morphNormals&&i.morphAttributes.normal;for(u=0;u<c;u++){0!==(p=l[u])[1]&&(h&&i.removeAttribute("morphTarget"+u),d&&i.removeAttribute("morphNormal"+u))}for(u=0;u<c;u++){(p=l[u])[0]=u,p[1]=s[u]}for(l.sort(Nt),u=0;u<8;u++){var p;if(p=l[u]){var f=p[0],m=p[1];if(m){h&&i.addAttribute("morphTarget"+u,h[f]),d&&i.addAttribute("morphNormal"+u,d[f]),n[u]=m;continue}}n[u]=0}a.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function Lt(e,t,n){var r,i,o;this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,o=e.bytesPerElement},this.render=function(t,a){e.drawElements(r,a,i,t*o),n.calls++,n.vertices+=a,r===e.TRIANGLES?n.faces+=a/3:r===e.POINTS&&(n.points+=a)},this.renderInstances=function(a,s,c){var l=t.get("ANGLE_instanced_arrays");null!==l?(l.drawElementsInstancedANGLE(r,c,i,s*o,a.maxInstancedCount),n.calls++,n.vertices+=c*a.maxInstancedCount,r===e.TRIANGLES?n.faces+=a.maxInstancedCount*c/3:r===e.POINTS&&(n.points+=a.maxInstancedCount*c)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function Ft(e,t,n){var r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.calls++,n.vertices+=i,r===e.TRIANGLES?n.faces+=i/3:r===e.POINTS&&(n.points+=i)},this.renderInstances=function(i,o,a){var s=t.get("ANGLE_instanced_arrays");if(null!==s){var c=i.attributes.position;c.isInterleavedBufferAttribute?(a=c.data.count,s.drawArraysInstancedANGLE(r,0,a,i.maxInstancedCount)):s.drawArraysInstancedANGLE(r,o,a,i.maxInstancedCount),n.calls++,n.vertices+=a*i.maxInstancedCount,r===e.TRIANGLES?n.faces+=i.maxInstancedCount*a/3:r===e.POINTS&&(n.points+=i.maxInstancedCount*a)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function jt(e,t,n){var r={},i={};function o(e){var a=e.target,s=r[a.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);a.removeEventListener("dispose",o),delete r[a.id];var l=i[a.id];l&&(t.remove(l),delete i[a.id]),(l=i[s.id])&&(t.remove(l),delete i[s.id]),n.geometries--}return{get:function(e,t){var i=r[t.id];return i||(t.addEventListener("dispose",o),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new vt).setFromObject(e)),i=t._bufferGeometry),r[t.id]=i,n.geometries++,i)},update:function(n){var r=n.index,i=n.attributes;for(var o in null!==r&&t.update(r,e.ELEMENT_ARRAY_BUFFER),i)t.update(i[o],e.ARRAY_BUFFER);var a=n.morphAttributes;for(var o in a)for(var s=a[o],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(n){var r=i[n.id];if(r)return r;var o,a=[],s=n.index,c=n.attributes;if(null!==s)for(var l=0,u=(o=s.array).length;l<u;l+=3){var h=o[l+0],d=o[l+1],p=o[l+2];a.push(h,d,d,p,p,h)}else for(l=0,u=(o=c.position.array).length/3-1;l<u;l+=3){h=l+0,d=l+1,p=l+2;a.push(h,d,d,p,p,h)}return r=new(lt(a)>65535?ot:rt)(a,1),t.update(r,e.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function Ut(e,t){var n={};return{update:function(r){var i=t.frame,o=r.geometry,a=e.get(r,o);return n[a.id]!==i&&(o.isGeometry&&a.updateFromObject(r),e.update(a),n[a.id]=i),a},dispose:function(){n={}}}}function Bt(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),!1===e.getShaderParameter(r,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(n)),r}vt.prototype=Object.assign(Object.create(o.prototype),{constructor:vt,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(lt(e)>65535?ot:rt)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new Ke(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new _).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new Ge;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new at(3*t.vertices.length,3),r=new at(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new at(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new at(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ct).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Ke(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Ke(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new Ke(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Ke(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Ke(o,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var a=new(lt(e.indices)>65535?Uint32Array:Uint16Array)(3*e.indices.length);this.setIndex(new Ke(a,1).copyIndicesArray(e.indices))}for(var s in this.groups=e.groups,e.morphTargets){for(var c=[],l=e.morphTargets[s],u=0,h=l.length;u<h;u++){var d=l[u],p=new at(3*d.length,3);c.push(p.copyVector3sArray(d))}this.morphAttributes[s]=c}if(e.skinIndices.length>0){var f=new at(4*e.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new at(4*e.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Pe,t=new b;return function(){null===this.boundingSphere&&(this.boundingSphere=new Oe);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;e.setFromBufferAttribute(n),e.getCenter(r);for(var i=0,o=0,a=n.count;o<a;o++)t.x=n.getX(o),t.y=n.getY(o),t.z=n.getZ(o),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,n=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Ke(new Float32Array(r.length),3));else for(var i=t.normal.array,o=0,a=i.length;o<a;o++)i[o]=0;var s,c,l,u=t.normal.array,h=new b,d=new b,p=new b,f=new b,m=new b;if(e){var g=e.array;0===n.length&&this.addGroup(0,g.length);for(var y=0,v=n.length;y<v;++y){var _=n[y],w=_.start;for(o=w,a=w+_.count;o<a;o+=3)s=3*g[o+0],c=3*g[o+1],l=3*g[o+2],h.fromArray(r,s),d.fromArray(r,c),p.fromArray(r,l),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[c]+=f.x,u[c+1]+=f.y,u[c+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z}}else for(o=0,a=r.length;o<a;o+=9)h.fromArray(r,o),d.fromArray(r,o+3),p.fromArray(r,o+6),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[o]=f.x,u[o+1]=f.y,u[o+2]=f.z,u[o+3]=f.x,u[o+4]=f.y,u[o+5]=f.z,u[o+6]=f.x,u[o+7]=f.y,u[o+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0);var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,o=e.attributes[r],a=o.array,s=0,c=o.itemSize*t;s<a.length;s++,c++)i[c]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new b;return function(){for(var t=this.attributes.normal,n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.normalize(),t.setXYZ(n,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new vt,t=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],o=i.array,a=i.itemSize,s=new o.constructor(t.length*a),c=0,l=0,u=0,h=t.length;u<h;u++){c=t[u]*a;for(var d=0;d<a;d++)s[l++]=o[c++]}e.addAttribute(r,new Ke(s,a))}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:i}}var o=this.attributes;for(var n in o){var a=o[n];i=Array.prototype.slice.call(a.array);e.data.attributes[n]={itemSize:a.itemSize,type:a.array.constructor.name,array:i,normalized:a.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new vt).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var o=e.attributes;for(t in o){var a=o[t];this.addAttribute(t,a.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),bt.prototype=Object.create(Qe.prototype),bt.prototype.constructor=bt,_t.prototype=Object.create(vt.prototype),_t.prototype.constructor=_t,wt.prototype=Object.create(Qe.prototype),wt.prototype.constructor=wt,Et.prototype=Object.create(vt.prototype),Et.prototype.constructor=Et,At.prototype=Object.create(Ce.prototype),At.prototype.constructor=At,At.prototype.isMeshBasicMaterial=!0,At.prototype.copy=function(e){return Ce.prototype.copy.call(this,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.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this},xt.prototype=Object.create(Ce.prototype),xt.prototype.constructor=xt,xt.prototype.isShaderMaterial=!0,xt.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ge.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},xt.prototype.toJSON=function(e){var t=Ce.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(St.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new b).copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new b;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new b;n.subVectors(e,this.origin);var r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new b;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(ht=new b,dt=new b,pt=new b,function(e,t,n,r){ht.copy(e).add(t).multiplyScalar(.5),dt.copy(t).sub(e).normalize(),pt.copy(this.origin).sub(ht);var i,o,a,s,c=.5*e.distanceTo(t),l=-this.direction.dot(dt),u=pt.dot(this.direction),h=-pt.dot(dt),d=pt.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(o=l*u-h,s=c*p,(i=l*h-u)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(i*=f)*(i+l*(o*=f)+2*u)+o*(l*i+o+2*h)+d}else o=c,a=-(i=Math.max(0,-(l*o+u)))*i+o*(o+2*h)+d;else o=-c,a=-(i=Math.max(0,-(l*o+u)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-l*c+u)))*i+(o=i>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+d):a=-(i=Math.max(0,-(l*c+u)))*i+(o=i>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d;else o=l>0?-c:c,a=-(i=Math.max(0,-(l*o+u)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(dt).multiplyScalar(o).add(ht),a}),intersectSphere:function(){var e=new b;return function(t,n){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),i=e.dot(e)-r*r,o=t.radius*t.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=r-a,c=r+a;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,o,a,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,o=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,o=(e.min.y-h.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),u>=0?(a=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:(ut=new b,function(e){return null!==this.intersectBox(e,ut)}),intersectTriangle:function(){var e=new b,t=new b,n=new b,r=new b;return function(i,o,a,s,c){t.subVectors(o,i),n.subVectors(a,i),r.crossVectors(t,n);var l,u=this.direction.dot(r);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}e.subVectors(this.origin,i);var h=l*this.direction.dot(n.crossVectors(e,n));if(h<0)return null;var d=l*this.direction.dot(t.cross(e));if(d<0)return null;if(h+d>u)return null;var p=-l*e.dot(r);return p<0?null:this.at(p/u,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Tt.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return(e||new b).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new b).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new b;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(ft=new b,mt=new b,function(e,t){ft.subVectors(e,this.start),mt.subVectors(this.end,this.start);var n=mt.dot(mt),r=mt.dot(ft)/n;return t&&(r=m.clamp(r,0,1)),r}),closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t),i=n||new b;return this.delta(i).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Mt,{normal:(gt=new b,function(e,t,n,r){var i=r||new b;i.subVectors(n,t),gt.subVectors(e,t),i.cross(gt);var o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}),barycoordFromPoint:function(){var e=new b,t=new b,n=new b;return function(r,i,o,a,s){e.subVectors(a,i),t.subVectors(o,i),n.subVectors(r,i);var c=e.dot(e),l=e.dot(t),u=e.dot(n),h=t.dot(t),d=t.dot(n),p=c*h-l*l,f=s||new b;if(0===p)return f.set(-2,-1,-1);var m=1/p,g=(h*u-l*d)*m,y=(c*d-l*u)*m;return f.set(1-g-y,y,g)}}(),containsPoint:function(){var e=new b;return function(t,n,r,i){var o=Mt.barycoordFromPoint(t,n,r,i,e);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}()}),Object.assign(Mt.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new b,t=new b;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new b).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Mt.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new Ne).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Mt.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Mt.containsPoint(e,this.a,this.b,this.c)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new Ne,t=[new Tt,new Tt,new Tt],n=new b,r=new b;return function(i,o){var a=o||new b,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(i,n),!0===this.containsPoint(n))a.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var c=0;c<t.length;c++){t[c].closestPointToPoint(n,!0,r);var l=n.distanceToSquared(r);l<s&&(s=l,a.copy(r))}}return a}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Rt.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Rt,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return Ge.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=a.length;e<t;e++)n=a[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)n=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}},raycast:function(){var e=new y,t=new St,n=new Oe,r=new b,i=new b,o=new b,a=new b,s=new b,c=new b,l=new g,u=new g,h=new g,d=new b,p=new b,f=new b;function m(e,t,n,r,i,o,a){return Mt.barycoordFromPoint(e,t,n,r,d),i.multiplyScalar(d.x),o.multiplyScalar(d.y),a.multiplyScalar(d.z),i.add(o).add(a),i.clone()}function v(e,t,n,r,i,o,a,s){if(null===(1===t.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==t.side,s)))return null;f.copy(s),f.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(f);return c<n.near||c>n.far?null:{distance:c,point:f.clone(),object:e}}function _(e,t,n,a,s,c,d,f){r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,d),o.fromBufferAttribute(a,f);var g=v(e,e.material,t,n,r,i,o,p);return g&&(s&&(l.fromBufferAttribute(s,c),u.fromBufferAttribute(s,d),h.fromBufferAttribute(s,f),g.uv=m(p,r,i,o,l,u,h)),g.face=new Ze(c,d,f,Mt.normal(r,i,o)),g.faceIndex=c),g}return function(d,f){var g,y=this.geometry,b=this.material,w=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(w),!1!==d.ray.intersectsSphere(n)&&(e.getInverse(w),t.copy(d.ray).applyMatrix4(e),null===y.boundingBox||!1!==t.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var E,A,x,S,T,M=y.index,R=y.attributes.position,C=y.attributes.uv;if(null!==M)for(S=0,T=M.count;S<T;S+=3)E=M.getX(S),A=M.getX(S+1),x=M.getX(S+2),(g=_(this,d,t,R,C,E,A,x))&&(g.faceIndex=Math.floor(S/3),f.push(g));else if(void 0!==R)for(S=0,T=R.count;S<T;S+=3)(g=_(this,d,t,R,C,E=S,A=S+1,x=S+2))&&(g.index=E,f.push(g))}else if(y.isGeometry){var k,I,P,O,N=Array.isArray(b),D=y.vertices,L=y.faces,F=y.faceVertexUvs[0];F.length>0&&(O=F);for(var j=0,U=L.length;j<U;j++){var B=L[j],V=N?b[B.materialIndex]:b;if(void 0!==V){if(k=D[B.a],I=D[B.b],P=D[B.c],!0===V.morphTargets){var H=y.morphTargets,z=this.morphTargetInfluences;r.set(0,0,0),i.set(0,0,0),o.set(0,0,0);for(var q=0,G=H.length;q<G;q++){var W=z[q];if(0!==W){var J=H[q].vertices;r.addScaledVector(a.subVectors(J[B.a],k),W),i.addScaledVector(s.subVectors(J[B.b],I),W),o.addScaledVector(c.subVectors(J[B.c],P),W)}}r.add(k),i.add(I),o.add(P),k=r,I=i,P=o}if(g=v(this,V,d,t,k,I,P,p)){if(O&&O[j]){var Z=O[j];l.copy(Z[0]),u.copy(Z[1]),h.copy(Z[2]),g.uv=m(p,k,I,P,l,u,h)}g.face=B,g.faceIndex=j,f.push(g)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Vt=0;function Ht(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function zt(e,t){var n=Ht(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function qt(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Gt(e){return""!==e}function Wt(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Jt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zt(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,(function(e,t){var n=ye[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zt(n)}))}function Yt(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,n,r){for(var i="",o=parseInt(t);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]");return i}))}function Xt(e,t,n,r,i,o){var a=e.context,s=r.defines,c=i.vertexShader,l=i.fragmentShader,u="SHADOWMAP_TYPE_BASIC";1===o.shadowMapType?u="SHADOWMAP_TYPE_PCF":2===o.shadowMapType&&(u="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(r.envMap.mapping){case 301:case 302:h="ENVMAP_TYPE_CUBE";break;case 306:case 307:h="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:h="ENVMAP_TYPE_EQUIREC";break;case 305:h="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:d="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:p="ENVMAP_BLENDING_MULTIPLY";break;case 1:p="ENVMAP_BLENDING_MIX";break;case 2:p="ENVMAP_BLENDING_ADD"}}var f,m,g,y,v,b=e.gammaFactor>0?e.gammaFactor:1,_=function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Gt).join("\n")}(r.extensions,o,t),w=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),E=a.createProgram();r.isRawShaderMaterial?((f=[w].filter(Gt).join("\n")).length>0&&(f+="\n"),(m=[_,w].filter(Gt).join("\n")).length>0&&(m+="\n")):(f=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,w,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Gt).join("\n"),m=[_,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,w,o.alphaTest?"#define ALPHATEST "+o.alphaTest:"","#define GAMMA_FACTOR "+b,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+h:"",o.envMap?"#define "+d:"",o.envMap?"#define "+p:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==o.toneMapping?"#define TONE_MAPPING":"",0!==o.toneMapping?ye.tonemapping_pars_fragment:"",0!==o.toneMapping?qt("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.envMapEncoding||o.emissiveMapEncoding?ye.encodings_pars_fragment:"",o.mapEncoding?zt("mapTexelToLinear",o.mapEncoding):"",o.envMapEncoding?zt("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?zt("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(g="linearToOutputTexel",y=o.outputEncoding,v=Ht(y),"vec4 "+g+"( vec4 value ) { return LinearTo"+v[0]+v[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Gt).join("\n")),c=Jt(c=Wt(c=Zt(c),o),o),l=Jt(l=Wt(l=Zt(l),o),o);var A=f+(c=Yt(c)),x=m+(l=Yt(l)),S=Bt(a,a.VERTEX_SHADER,A),T=Bt(a,a.FRAGMENT_SHADER,x);a.attachShader(E,S),a.attachShader(E,T),void 0!==r.index0AttributeName?a.bindAttribLocation(E,0,r.index0AttributeName):!0===o.morphTargets&&a.bindAttribLocation(E,0,"position"),a.linkProgram(E);var M,R,C=a.getProgramInfoLog(E).trim(),k=a.getShaderInfoLog(S).trim(),I=a.getShaderInfoLog(T).trim(),P=!0,O=!0;return!1===a.getProgramParameter(E,a.LINK_STATUS)?(P=!1,console.error("THREE.WebGLProgram: shader error: ",a.getError(),"gl.VALIDATE_STATUS",a.getProgramParameter(E,a.VALIDATE_STATUS),"gl.getProgramInfoLog",C,k,I)):""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==k&&""!==I||(O=!1),O&&(this.diagnostics={runnable:P,material:r,programLog:C,vertexShader:{log:k,prefix:f},fragmentShader:{log:I,prefix:m}}),a.deleteShader(S),a.deleteShader(T),this.getUniforms=function(){return void 0===M&&(M=new de(a,E,e)),M},this.getAttributes=function(){return void 0===R&&(R=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<r;i++){var o=e.getActiveAttrib(t,i).name;n[o]=e.getAttribLocation(t,o)}return n}(a,E)),R},this.destroy=function(){a.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Vt++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=S,this.fragmentShader=T,this}function Qt(e,t,n){var r=[],i={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},o=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function a(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=3e3,3e3===n&&t&&(n=3007),n}this.getParameters=function(t,r,o,s,c,l,u){var h=i[t.type],d=u.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(n.floatVertexTextures)return 1024;var r=n.maxVertexUniforms,i=Math.floor((r-20)/4),o=Math.min(i,t.length);return o<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+o+"."),0):o}(u):0,p=n.precision;null!==t.precision&&(p=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:h,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:a(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:a(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:a(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:a(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&o.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(var a=0;a<o.length;a++)r.push(n[o[a]]);return r.push(t.onBeforeCompile.toString()),r.push(e.gammaOutput),r.join()},this.acquireProgram=function(n,i,o,a){for(var s,c=0,l=r.length;c<l;c++){var u=r[c];if(u.code===a){++(s=u).usedTimes;break}}return void 0===s&&(s=new Xt(e,t,a,n,i,o),r.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Kt(e,t,n,r,i,o,a,s){var c,l="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,u={};function h(e,t){if(e.width>t||e.height>t){var n=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(e.width*n),r.height=Math.floor(e.height*n),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function d(e){return m.isPowerOfTwo(e.width)&&m.isPowerOfTwo(e.height)}function p(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function f(t){return 1003===t||1004===t||1005===t?e.NEAREST:e.LINEAR}function g(t){var n=t.target;n.removeEventListener("dispose",g),function(t){var n=r.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture)}r.remove(t)}(n),n.isVideoTexture&&delete u[n.id],a.textures--}function y(t){var n=t.target;n.removeEventListener("dispose",y),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var o=0;o<6;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}(n),a.textures--}function v(t,f){var y=r.get(t);if(t.isVideoTexture&&function(e){var t=e.id,n=s.frame;u[t]!==n&&(u[t]=n,e.update())}(t),t.version>0&&y.__version!==t.version){var v=t.image;if(void 0===v)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==v.complete)return void function(t,r,s){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",g),t.__webglTexture=e.createTexture(),a.textures++);n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var u=h(r.image,i.maxTextureSize);(function(e){return 1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter})(r)&&!1===d(u)&&(u=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===c&&(c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),c.width=m.floorPowerOfTwo(e.width),c.height=m.floorPowerOfTwo(e.height),c.getContext("2d").drawImage(e,0,0,c.width,c.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+c.width+"x"+c.height,e),c):e}(u));var f=d(u),y=o.convert(r.format),v=o.convert(r.type);b(e.TEXTURE_2D,r,f);var _,w=r.mipmaps;if(r.isDepthTexture){var E=e.DEPTH_COMPONENT;if(1015===r.type){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");E=e.DEPTH_COMPONENT32F}else l&&(E=e.DEPTH_COMPONENT16);1026===r.format&&E===e.DEPTH_COMPONENT&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,v=o.convert(r.type)),1027===r.format&&(E=e.DEPTH_STENCIL,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,v=o.convert(r.type))),n.texImage2D(e.TEXTURE_2D,0,E,u.width,u.height,0,y,v,null)}else if(r.isDataTexture)if(w.length>0&&f){for(var A=0,x=w.length;A<x;A++)_=w[A],n.texImage2D(e.TEXTURE_2D,A,y,_.width,_.height,0,y,v,_.data);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,u.width,u.height,0,y,v,u.data);else if(r.isCompressedTexture)for(A=0,x=w.length;A<x;A++)_=w[A],1023!==r.format&&1022!==r.format?n.getCompressedTextureFormats().indexOf(y)>-1?n.compressedTexImage2D(e.TEXTURE_2D,A,y,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,A,y,_.width,_.height,0,y,v,_.data);else if(w.length>0&&f){for(A=0,x=w.length;A<x;A++)_=w[A],n.texImage2D(e.TEXTURE_2D,A,y,y,v,_);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,y,v,u);p(r,f)&&e.generateMipmap(e.TEXTURE_2D);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(y,t,f);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}n.activeTexture(e.TEXTURE0+f),n.bindTexture(e.TEXTURE_2D,y.__webglTexture)}function b(n,a,s){var c;if(s?(e.texParameteri(n,e.TEXTURE_WRAP_S,o.convert(a.wrapS)),e.texParameteri(n,e.TEXTURE_WRAP_T,o.convert(a.wrapT)),e.texParameteri(n,e.TEXTURE_MAG_FILTER,o.convert(a.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,o.convert(a.minFilter))):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),e.texParameteri(n,e.TEXTURE_MAG_FILTER,f(a.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,f(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),c=t.get("EXT_texture_filter_anisotropic")){if(1015===a.type&&null===t.get("OES_texture_float_linear"))return;if(1016===a.type&&null===t.get("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function _(t,i,a,s){var c=o.convert(i.texture.format),l=o.convert(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,a,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function w(t,n){e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,n.width,n.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t){var n=r.get(t),i=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),v(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=e.createRenderbuffer(),w(n.__webglDepthbuffer[o],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),w(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}this.setTexture2D=v,this.setTextureCube=function(t,s){var c=r.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",g),c.__image__webglTextureCube=e.createTexture(),a.textures++),n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var l=t&&t.isCompressedTexture,u=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=l||u?u?t.image[m].image:t.image[m]:h(t.image[m],i.maxCubemapSize);var y=d(f[0]),v=o.convert(t.format),_=o.convert(t.type);b(e.TEXTURE_CUBE_MAP,t,y);for(m=0;m<6;m++)if(l)for(var w,E=f[m].mipmaps,A=0,x=E.length;A<x;A++)w=E[A],1023!==t.format&&1022!==t.format?n.getCompressedTextureFormats().indexOf(v)>-1?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,A,v,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,A,v,w.width,w.height,0,v,_,w.data);else u?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,f[m].width,f[m].height,0,v,_,f[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,v,_,f[m]);p(t,y)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=r.get(t),o=r.get(t.texture);t.addEventListener("dispose",y),o.__webglTexture=e.createTexture(),a.textures++;var s=!0===t.isWebGLRenderTargetCube,c=d(t);if(s){i.__webglFramebuffer=[];for(var l=0;l<6;l++)i.__webglFramebuffer[l]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),b(e.TEXTURE_CUBE_MAP,t.texture,c);for(l=0;l<6;l++)_(i.__webglFramebuffer[l],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+l);p(t.texture,c)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,o.__webglTexture),b(e.TEXTURE_2D,t.texture,c),_(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),p(t.texture,c)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&E(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(p(i,d(t))){var o=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(i).__webglTexture;n.bindTexture(o,a),e.generateMipmap(o),n.bindTexture(o,null)}}}function $t(){var e={};return{get:function(t){var n=t.uuid,r=e[n];return void 0===r&&(r={},e[n]=r),r},remove:function(t){delete e[t.uuid]},update:function(t,n,r){var i=t.uuid;e[i][n]=r},dispose:function(){e={}}}}function en(e,t,n){var r=new function(){var t=!1,n=new A,r=null,i=new A(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,o,a,s){!0===s&&(t*=a,r*=a,o*=a),n.set(t,r,o,a),!1===i.equals(n)&&(e.clearColor(t,r,o,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},i=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(t){t?F(e.DEPTH_TEST):j(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},o=new function(){var t=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,l=null;return{setTest:function(t){t?F(e.STENCIL_TEST):j(e.STENCIL_TEST)},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&o===a||(e.stencilFunc(t,n,a),r=t,i=n,o=a)},setOp:function(t,n,r){a===t&&s===n&&c===r||(e.stencilOp(t,n,r),a=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,l=null}}},a=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),l=new Uint8Array(a),u={},h=null,d=null,p=null,f=null,m=null,g=null,y=null,v=null,b=null,_=!1,w=null,E=null,x=null,S=null,T=null,M=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,C=0,k=e.getParameter(e.VERSION);-1!==k.indexOf("WebGL")?(C=parseFloat(/^WebGL\ ([0-9])/.exec(k)[1]),R=C>=1):-1!==k.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(k)[1]),R=C>=2);var I=null,P={},O=new A,N=new A;function D(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var a=0;a<r;a++)e.texImage2D(n+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);return o}var L={};function F(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function j(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}function U(t,r,i,o,a,s,c,l){if(0!==t?F(e.BLEND):j(e.BLEND),5!==t){if(t!==p||l!==_)switch(t){case 2:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case 3:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case 4:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}f=null,m=null,g=null,y=null,v=null,b=null}else a=a||r,s=s||i,c=c||o,r===f&&a===y||(e.blendEquationSeparate(n.convert(r),n.convert(a)),f=r,y=a),i===m&&o===g&&s===v&&c===b||(e.blendFuncSeparate(n.convert(i),n.convert(o),n.convert(s),n.convert(c)),m=i,g=o,v=s,b=c);p=t,_=l}function B(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function V(t){0!==t?(F(e.CULL_FACE),t!==E&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):j(e.CULL_FACE),E=t}function H(t,n,r){t?(F(e.POLYGON_OFFSET_FILL),S===n&&T===r||(e.polygonOffset(n,r),S=n,T=r)):j(e.POLYGON_OFFSET_FILL)}function z(t){void 0===t&&(t=e.TEXTURE0+M-1),I!==t&&(e.activeTexture(t),I=t)}return L[e.TEXTURE_2D]=D(e.TEXTURE_2D,e.TEXTURE_2D,1),L[e.TEXTURE_CUBE_MAP]=D(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),i.setClear(1),o.setClear(0),F(e.DEPTH_TEST),i.setFunc(3),B(!1),V(1),F(e.CULL_FACE),F(e.BLEND),U(1),{buffers:{color:r,depth:i,stencil:o},initAttributes:function(){for(var e=0,t=s.length;e<t;e++)s[e]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),0!==l[n]&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),l[n]=0)},enableAttributeAndDivisor:function(n,r){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),l[n]!==r&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,r),l[n]=r)},disableUnusedAttributes:function(){for(var t=0,n=c.length;t!==n;++t)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:F,disable:j,getCompressedTextureFormats:function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var n=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<n.length;r++)h.push(n[r]);return h},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:U,setMaterial:function(t,n){2===t.side?j(e.CULL_FACE):F(e.CULL_FACE);var o=1===t.side;n&&(o=!o),B(o),!0===t.transparent?U(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):U(0),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite),H(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:B,setCullFace:V,setLineWidth:function(t){t!==x&&(R&&e.lineWidth(t),x=t)},setPolygonOffset:H,setScissorTest:function(t){t?F(e.SCISSOR_TEST):j(e.SCISSOR_TEST)},activeTexture:z,bindTexture:function(t,n){null===I&&z();var r=P[I];void 0===r&&(r={type:void 0,texture:void 0},P[I]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||L[t]),r.type=t,r.texture=n)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===O.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),O.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);u={},h=null,I=null,P={},d=null,p=null,w=null,E=null,r.reset(),i.reset(),o.reset()}}}function tn(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=void 0!==n.precision?n.precision:"highp",a=i(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);var s=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),p=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,y=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function nn(e,t,n,r){We.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function rn(e){nn.call(this),this.cameras=e||[]}function on(e){var t=this,n=null,r=null,i=null,o=new y,a=new y;"undefined"!=typeof window&&"VRFrameData"in window&&(r=new window.VRFrameData);var s=new y,c=new v,l=new b,u=new nn;u.bounds=new A(0,0,.5,1),u.layers.enable(1);var h=new nn;h.bounds=new A(.5,0,.5,1),h.layers.enable(2);var d,p,f=new rn([u,h]);function m(){if(null!==n&&n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,o=r.renderHeight;p=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*i,o,1)}else t.enabled&&e.setDrawingBufferSize(d.width,d.height,p)}f.layers.enable(1),f.layers.enable(2),"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",m,!1),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e)},this.setPoseTarget=function(e){void 0!==e&&(i=e)},this.getCamera=function(e){if(null===n)return e;n.depthNear=e.near,n.depthFar=e.far,n.getFrameData(r);var d=n.stageParameters;d?o.fromArray(d.sittingToStandingTransform):o.makeTranslation(0,t.userHeight,0);var p=r.pose,m=null!==i?i:e;if(m.matrix.copy(o),m.matrix.decompose(m.position,m.quaternion,m.scale),null!==p.orientation&&(c.fromArray(p.orientation),m.quaternion.multiply(c)),null!==p.position&&(c.setFromRotationMatrix(o),l.fromArray(p.position),l.applyQuaternion(c),m.position.add(l)),m.updateMatrixWorld(),!1===n.isPresenting)return e;u.near=e.near,h.near=e.near,u.far=e.far,h.far=e.far,f.matrixWorld.copy(e.matrixWorld),f.matrixWorldInverse.copy(e.matrixWorldInverse),u.matrixWorldInverse.fromArray(r.leftViewMatrix),h.matrixWorldInverse.fromArray(r.rightViewMatrix),a.getInverse(o),u.matrixWorldInverse.multiply(a),h.matrixWorldInverse.multiply(a);var g=m.parent;null!==g&&(s.getInverse(g.matrixWorld),u.matrixWorldInverse.multiply(s),h.matrixWorldInverse.multiply(s)),u.matrixWorld.getInverse(u.matrixWorldInverse),h.matrixWorld.getInverse(h.matrixWorldInverse),u.projectionMatrix.fromArray(r.leftProjectionMatrix),h.projectionMatrix.fromArray(r.rightProjectionMatrix),f.projectionMatrix.copy(u.projectionMatrix);var y=n.getLayers();if(y.length){var v=y[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&h.bounds.fromArray(v.rightBounds)}return f},this.getStandingMatrix=function(){return o},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function an(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function sn(){var e=this,t=null,n=0,r=!1,i=!1,o=new Ne,a=new _,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var u=r+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var d=0,p=r;d!==c;++d,p+=4)o.copy(t[d]).applyMatrix4(h,a),o.normal.toArray(l,p),l[p+3]=o.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,o){var a=0!==e.length||i||0!==n||r;return r=i,t=l(e,o,0),n=e.length,a},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,o,a,u,h,d){if(!r||null===e||0===e.length||i&&!a)i?l(null):c();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=l(e,u,f,d);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}}}function cn(e,t){return{convert:function(n){var r;if(1e3===n)return e.REPEAT;if(1001===n)return e.CLAMP_TO_EDGE;if(1002===n)return e.MIRRORED_REPEAT;if(1003===n)return e.NEAREST;if(1004===n)return e.NEAREST_MIPMAP_NEAREST;if(1005===n)return e.NEAREST_MIPMAP_LINEAR;if(1006===n)return e.LINEAR;if(1007===n)return e.LINEAR_MIPMAP_NEAREST;if(1008===n)return e.LINEAR_MIPMAP_LINEAR;if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(1019===n)return e.UNSIGNED_SHORT_5_6_5;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n&&null!==(r=t.get("OES_texture_half_float")))return r.HALF_FLOAT_OES;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(100===n)return e.FUNC_ADD;if(101===n)return e.FUNC_SUBTRACT;if(102===n)return e.FUNC_REVERSE_SUBTRACT;if(200===n)return e.ZERO;if(201===n)return e.ONE;if(202===n)return e.SRC_COLOR;if(203===n)return e.ONE_MINUS_SRC_COLOR;if(204===n)return e.SRC_ALPHA;if(205===n)return e.ONE_MINUS_SRC_ALPHA;if(206===n)return e.DST_ALPHA;if(207===n)return e.ONE_MINUS_DST_ALPHA;if(208===n)return e.DST_COLOR;if(209===n)return e.ONE_MINUS_DST_COLOR;if(210===n)return e.SRC_ALPHA_SATURATE;if((33776===n||33777===n||33778===n||33779===n)&&null!==(r=t.get("WEBGL_compressed_texture_s3tc"))){if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===n||35841===n||35842===n||35843===n)&&null!==(r=t.get("WEBGL_compressed_texture_pvrtc"))){if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n&&null!==(r=t.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n)&&null!==(r=t.get("WEBGL_compressed_texture_astc")))return n;if((103===n||104===n)&&null!==(r=t.get("EXT_blend_minmax"))){if(103===n)return r.MIN_EXT;if(104===n)return r.MAX_EXT}return 1020===n&&null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:0}}}function ln(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new b,color:new fe,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"SpotLight":n={position:new b,direction:new b,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"PointLight":n={position:new b,color:new fe,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new b,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":n={color:new fe,position:new b,halfWidth:new b,halfHeight:new b}}return e[t.id]=n,n}}}nn.prototype=Object.assign(Object.create(We.prototype),{constructor:nn,isPerspectiveCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*m.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*m.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*m.RAD2DEG*Math.atan(Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far)},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),rn.prototype=Object.assign(Object.create(nn.prototype),{constructor:rn,isArrayCamera:!0});var un,hn,dn,pn,fn,mn,gn,yn,vn=0;function bn(){var e=new ln,t={id:vn++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new b,r=new y,i=new y;return{setup:function(o,a,s){for(var c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,y=0,v=o.length;y<v;y++){var b=o[y],_=b.color,w=b.intensity,E=b.distance,A=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=_.r*w,l+=_.g*w,u+=_.b*w;else if(b.isDirectionalLight){if((S=e.get(b)).color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=b.castShadow,b.castShadow){var x=b.shadow;S.shadowBias=x.bias,S.shadowRadius=x.radius,S.shadowMapSize=x.mapSize}t.directionalShadowMap[h]=A,t.directionalShadowMatrix[h]=b.shadow.matrix,t.directional[h]=S,h++}else if(b.isSpotLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(_).multiplyScalar(w),S.distance=E,S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){x=b.shadow;S.shadowBias=x.bias,S.shadowRadius=x.radius,S.shadowMapSize=x.mapSize}t.spotShadowMap[p]=A,t.spotShadowMatrix[p]=b.shadow.matrix,t.spot[p]=S,p++}else if(b.isRectAreaLight){(S=e.get(b)).color.copy(_).multiplyScalar(w),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),i.identity(),r.copy(b.matrixWorld),r.premultiply(g),i.extractRotation(r),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(i),S.halfHeight.applyMatrix4(i),t.rectArea[f]=S,f++}else if(b.isPointLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){x=b.shadow;S.shadowBias=x.bias,S.shadowRadius=x.radius,S.shadowMapSize=x.mapSize,S.shadowCameraNear=x.camera.near,S.shadowCameraFar=x.camera.far}t.pointShadowMap[d]=A,t.pointShadowMatrix[d]=b.shadow.matrix,t.point[d]=S,d++}else if(b.isHemisphereLight){var S;(S=e.get(b)).direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(w),S.groundColor.copy(b.groundColor).multiplyScalar(w),t.hemi[m]=S,m++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=u,t.directional.length=h,t.spot.length=p,t.rectArea.length=f,t.point.length=d,t.hemi.length=m,t.hash=t.id+","+h+","+d+","+p+","+f+","+m+","+a.length},state:t}}function _n(){var e=new bn,t=[],n=[],r=[];return{init:function(){t.length=0,n.length=0,r.length=0},state:{lightsArray:t,shadowsArray:n,spritesArray:r,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)},pushSprite:function(e){r.push(e)}}}function wn(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new _n,e[r]=i),i},dispose:function(){e={}}}}function En(e){console.log("THREE.WebGLRenderer","90");var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",u=null,h=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,g,v,_,w,E,x,S,M,R,C,k,I,P,O,N,D=this,L=!1,F=null,j=null,U=-1,B="",V=null,H=null,z=new A,q=new A,G=null,W=0,J=t.width,Z=t.height,Y=1,X=new A(0,0,J,Z),Q=new A(0,0,J,Z),K=!1,$=new De,ee=new sn,te=!1,ne=!1,re=new y,ie=new b,oe={geometries:0,textures:0},ae={frame:0,calls:0,vertices:0,faces:0,points:0};function se(){return null===F?Y:1}this.info={render:ae,memory:oe,programs:null,autoReset:!0,reset:function(){ae.frame++,ae.calls=0,ae.vertices=0,ae.faces=0,ae.points=0}};try{var ce={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",fe,!1),null===(d=n||t.getContext("webgl",ce)||t.getContext("experimental-webgl",ce)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){console.error("THREE.WebGLRenderer: "+e.message)}function le(){(p=new an(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),N=new cn(d,p),f=new tn(d,p,e),(g=new en(d,p,N)).scissor(q.copy(Q).multiplyScalar(Y)),g.viewport(z.copy(X).multiplyScalar(Y)),v=new $t,_=new Kt(d,p,g,v,f,N,oe,ae),w=new Fe(d),E=new jt(d,w,oe),x=new Ut(E,ae),k=new Dt(d),S=new Qt(D,p,f),M=new Ot,R=new wn,C=new Ct(D,g,E,s),I=new Ft(d,p,ae),P=new Lt(d,p,ae),O=new _e(D,d,g,_,f),D.info.programs=S.programs,D.context=d,D.capabilities=f,D.extensions=p,D.properties=v,D.renderLists=M,D.state=g}le();var ue=new on(D);this.vr=ue;var he=new Le(D,x,f.maxTextureSize);function pe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),L=!0}function fe(){console.log("THREE.WebGLRenderer: Context Restored."),L=!1,le()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){be(e),v.remove(e)}(t)}function be(e){var t=v.get(e).program;e.program=void 0,void 0!==t&&S.releaseProgram(t)}this.shadowMap=he,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=p.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=p.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(e){void 0!==e&&(Y=e,this.setSize(J,Z,!1))},this.getSize=function(){return{width:J,height:Z}},this.setSize=function(e,n,r){var i=ue.getDevice();i&&i.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Z=n,t.width=e*Y,t.height=n*Y,!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(){return{width:J*Y,height:Z*Y}},this.setDrawingBufferSize=function(e,n,r){J=e,Z=n,Y=r,t.width=e*r,t.height=n*r,this.setViewport(0,0,e,n)},this.getCurrentViewport=function(){return z},this.setViewport=function(e,t,n,r){X.set(e,Z-t-r,n,r),g.viewport(z.copy(X).multiplyScalar(Y))},this.setScissor=function(e,t,n,r){Q.set(e,Z-t-r,n,r),g.scissor(q.copy(Q).multiplyScalar(Y))},this.setScissorTest=function(e){g.setScissorTest(K=e)},this.getClearColor=function(){return C.getClearColor()},this.setClearColor=function(){C.setClearColor.apply(C,arguments)},this.getClearAlpha=function(){return C.getClearAlpha()},this.setClearAlpha=function(){C.setClearAlpha.apply(C,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(r|=d.STENCIL_BUFFER_BIT),d.clear(r)},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.clearTarget=function(e,t,n,r){this.setRenderTarget(e),this.clear(t,n,r)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",fe,!1),M.dispose(),R.dispose(),v.dispose(),x.dispose(),ue.dispose(),xe()},this.renderBufferImmediate=function(e,t,n){g.initAttributes();var r=v.get(e);e.hasPositions&&!r.position&&(r.position=d.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=d.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=d.createBuffer()),e.hasColors&&!r.color&&(r.color=d.createBuffer());var i=t.getAttributes();if(e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,r.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(i.position),d.vertexAttribPointer(i.position,3,d.FLOAT,!1,0,0)),e.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,r.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&!0===n.flatShading)for(var o=0,a=3*e.count;o<a;o+=9){var s=e.normalArray,c=(s[o+0]+s[o+3]+s[o+6])/3,l=(s[o+1]+s[o+4]+s[o+7])/3,u=(s[o+2]+s[o+5]+s[o+8])/3;s[o+0]=c,s[o+1]=l,s[o+2]=u,s[o+3]=c,s[o+4]=l,s[o+5]=u,s[o+6]=c,s[o+7]=l,s[o+8]=u}d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(i.normal),d.vertexAttribPointer(i.normal,3,d.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(d.bindBuffer(d.ARRAY_BUFFER,r.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(i.uv),d.vertexAttribPointer(i.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&0!==n.vertexColors&&(d.bindBuffer(d.ARRAY_BUFFER,r.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(i.color),d.vertexAttribPointer(i.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,o){var a=i.isMesh&&i.matrixWorld.determinant()<0;g.setMaterial(r,a);var s=ke(e,t,r,i),c=n.id+"_"+s.id+"_"+(!0===r.wireframe),l=!1;c!==B&&(B=c,l=!0),i.morphTargetInfluences&&(k.update(i,n,r,s),l=!0);var u,h=n.index,f=n.attributes.position,m=1;!0===r.wireframe&&(h=E.getWireframeAttribute(n),m=2);var y=I;null!==h&&(u=w.get(h),(y=P).setIndex(u)),l&&(!function(e,t,n,r){if(n&&n.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0);g.initAttributes();var i=n.attributes,o=t.getAttributes(),a=e.defaultAttributeValues;for(var s in o){var c=o[s];if(c>=0){var l=i[s];if(void 0!==l){var u=l.normalized,h=l.itemSize,f=w.get(l);if(void 0===f)continue;var m=f.buffer,y=f.type,v=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,_=b.stride,E=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,_*v,(r*_+E)*v)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,0,r*h*v)}else if(void 0!==a){var A=a[s];if(void 0!==A)switch(A.length){case 2:d.vertexAttrib2fv(c,A);break;case 3:d.vertexAttrib3fv(c,A);break;case 4:d.vertexAttrib4fv(c,A);break;default:d.vertexAttrib1fv(c,A)}}}}g.disableUnusedAttributes()}(r,s,n),null!==h&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.buffer));var v=1/0;null!==h?v=h.count:void 0!==f&&(v=f.count);var b=n.drawRange.start*m,_=n.drawRange.count*m,A=null!==o?o.start*m:0,x=null!==o?o.count*m:1/0,S=Math.max(b,A),T=Math.min(v,b+_,A+x)-1,M=Math.max(0,T-S+1);if(0!==M){if(i.isMesh)if(!0===r.wireframe)g.setLineWidth(r.wireframeLinewidth*se()),y.setMode(d.LINES);else switch(i.drawMode){case 0:y.setMode(d.TRIANGLES);break;case 1:y.setMode(d.TRIANGLE_STRIP);break;case 2:y.setMode(d.TRIANGLE_FAN)}else if(i.isLine){var R=r.linewidth;void 0===R&&(R=1),g.setLineWidth(R*se()),i.isLineSegments?y.setMode(d.LINES):i.isLineLoop?y.setMode(d.LINE_LOOP):y.setMode(d.LINE_STRIP)}else i.isPoints&&y.setMode(d.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&y.renderInstances(n,S,M):y.render(S,M)}},this.compile=function(e,t){(h=R.get(e,t)).init(),e.traverse((function(e){e.isLight&&(h.pushLight(e),e.castShadow&&h.pushShadow(e))})),h.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)Ce(t.material[n],e.fog,t);else Ce(t.material,e.fog,t)}))};var we,Ee=!1,Ae=null;function xe(){Ee=!1}function Se(){var e=ue.getDevice();e&&e.isPresenting?e.requestAnimationFrame(Te):window.requestAnimationFrame(Te)}function Te(e){!1!==Ee&&(Ae(e),Se())}function Me(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i],s=a.object,c=a.geometry,l=void 0===r?a.material:r,u=a.group;if(n.isArrayCamera){H=n;for(var h=n.cameras,d=0,p=h.length;d<p;d++){var f=h[d];if(s.layers.test(f.layers)){var m=f.bounds,y=m.x*J,v=m.y*Z,b=m.z*J,_=m.w*Z;g.viewport(z.set(y,v,b,_).multiplyScalar(Y)),Re(s,t,f,c,l,u)}}}else H=null,Re(s,t,n,c,l,u)}}function Re(e,t,n,r,i,o){if(e.onBeforeRender(D,t,n,r,i,o),h=R.get(t,H||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var a=e.isMesh&&e.matrixWorld.determinant()<0;g.setMaterial(i,a);var s=ke(n,t.fog,i,e);B="",function(e,t,n){e.render((function(e){D.renderBufferImmediate(e,t,n)}))}(e,s,i)}else D.renderBufferDirect(n,t.fog,r,i,e,o);e.onAfterRender(D,t,n,r,i,o),h=R.get(t,H||n)}function Ce(e,t,n){var r=v.get(e),i=h.state.lights,o=h.state.shadowsArray,a=S.getParameters(e,i.state,o,t,ee.numPlanes,ee.numIntersection,n),s=S.getProgramCode(e,a),c=r.program,l=!0;if(void 0===c)e.addEventListener("dispose",ye);else if(c.code!==s)be(e);else if(r.lightsHash!==i.state.hash)v.update(e,"lightsHash",i.state.hash),l=!1;else{if(void 0!==a.shaderID)return;l=!1}if(l){if(a.shaderID){var u=ve[a.shaderID];r.shader={name:e.type,uniforms:ge.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader),c=S.acquireProgram(e,r.shader,a,s),r.program=c,e.program=c}var d=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<D.maxMorphTargets;p++)d["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(p=0;p<D.maxMorphNormals;p++)d["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var f=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ee.numPlanes,r.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),r.fog=t,r.lightsHash=i.state.hash,e.lights&&(f.ambientLightColor.value=i.state.ambient,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=de.seqWithValue(m.seq,f);r.uniformsList=g}function ke(e,t,n,r){W=0;var i=v.get(n),o=h.state.lights;if(te&&(ne||e!==V)){var a=e===V&&n.id===U;ee.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,i,a)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==t||n.lights&&i.lightsHash!==o.state.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===ee.numPlanes&&i.numIntersection===ee.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(Ce(n,t,r),n.needsUpdate=!1);var s,c,l=!1,u=!1,p=!1,y=i.program,b=y.getUniforms(),_=i.shader.uniforms;if(g.useProgram(y.program)&&(l=!0,u=!0,p=!0),n.id!==U&&(U=n.id,u=!0),l||e!==V){if(b.setValue(d,"projectionMatrix",e.projectionMatrix),f.logarithmicDepthBuffer&&b.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),V!==(H||e)&&(V=H||e,u=!0,p=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var w=b.map.cameraPosition;void 0!==w&&w.setValue(d,ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&b.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){b.setOptional(d,r,"bindMatrix"),b.setOptional(d,r,"bindMatrixInverse");var E=r.skeleton;if(E){var A=E.bones;if(f.floatVertexTextures){if(void 0===E.boneTexture){var x=Math.sqrt(4*A.length);x=m.ceilPowerOfTwo(x),x=Math.max(x,4);var S=new Float32Array(x*x*4);S.set(E.boneMatrices);var M=new T(S,x,x,1023,1015);M.needsUpdate=!0,E.boneMatrices=S,E.boneTexture=M,E.boneTextureSize=x}b.setValue(d,"boneTexture",E.boneTexture),b.setValue(d,"boneTextureSize",E.boneTextureSize)}else b.setOptional(d,E,"boneMatrices")}}return u&&(b.setValue(d,"toneMappingExposure",D.toneMappingExposure),b.setValue(d,"toneMappingWhitePoint",D.toneMappingWhitePoint),n.lights&&(c=p,(s=_).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&n.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(_,t),n.isMeshBasicMaterial?Ie(_,n):n.isMeshLambertMaterial?(Ie(_,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(_,n)):n.isMeshPhongMaterial?(Ie(_,n),n.isMeshToonMaterial?function(e,t){Pe(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(_,n):Pe(_,n)):n.isMeshStandardMaterial?(Ie(_,n),n.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,Oe(e,t)}(_,n):Oe(_,n)):n.isMeshDepthMaterial?(Ie(_,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isMeshDistanceMaterial?(Ie(_,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(_,n)):n.isMeshNormalMaterial?(Ie(_,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(_,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(_,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(_,n)):n.isPointsMaterial?function(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*Y,e.scale.value=.5*Z,e.map.value=t.map,null!==t.map){if(!0===t.map.matrixAutoUpdate){var n=t.map.offset,r=t.map.repeat,i=t.map.rotation,o=t.map.center;t.map.matrix.setUvTransform(n.x,n.y,r.x,r.y,i,o.x,o.y)}e.uvTransform.value.copy(t.map.matrix)}}(_,n):n.isShadowMaterial&&(_.color.value=n.color,_.opacity.value=n.opacity),void 0!==_.ltc_1&&(_.ltc_1.value=me.LTC_1),void 0!==_.ltc_2&&(_.ltc_2.value=me.LTC_2),de.upload(d,i.uniformsList,_,D)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(de.upload(d,i.uniformsList,_,D),n.uniformsNeedUpdate=!1),b.setValue(d,"modelViewMatrix",r.modelViewMatrix),b.setValue(d,"normalMatrix",r.normalMatrix),b.setValue(d,"modelMatrix",r.matrixWorld),y}function Ie(e,t){var n;if(e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n){if(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate){var r=n.offset,i=n.repeat,o=n.rotation,a=n.center;n.matrix.setUvTransform(r.x,r.y,i.x,i.y,o,a.x,a.y)}e.uvTransform.value.copy(n.matrix)}}function Pe(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Oe(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}this.animate=function(e){null!==(Ae=e)?Ee||(Se(),Ee=!0):xe()},this.render=function(e,t,n,r){if(t&&t.isCamera){if(!L){B="",U=-1,V=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ue.enabled&&(t=ue.getCamera(t)),(h=R.get(e,t)).init(),e.onBeforeRender(D,e,t,n),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromMatrix(re),ne=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ne,t),(u=M.get(e,t)).init(),function e(t,n,r){if(!1===t.visible)return;if(t.layers.test(n.layers))if(t.isLight)h.pushLight(t),t.castShadow&&h.pushShadow(t);else if(t.isSprite)t.frustumCulled&&!$.intersectsSprite(t)||h.pushSprite(t);else if(t.isImmediateRenderObject)r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re),u.push(t,null,t.material,ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||$.intersectsObject(t))){r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var i=x.update(t),o=t.material;if(Array.isArray(o))for(var a=i.groups,s=0,c=a.length;s<c;s++){var l=a[s],d=o[l.materialIndex];d&&d.visible&&u.push(t,i,d,ie.z,l)}else o.visible&&u.push(t,i,o,ie.z,null)}var p=t.children;for(s=0,c=p.length;s<c;s++)e(p[s],n,r)}(e,t,D.sortObjects),!0===D.sortObjects&&u.sort(),te&&ee.beginShadows();var i=h.state.shadowsArray;he.render(i,e,t),h.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),C.render(u,e,t,r);var o=u.opaque,a=u.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;o.length&&Me(o,e,t,s),a.length&&Me(a,e,t,s)}else o.length&&Me(o,e,t),a.length&&Me(a,e,t);var c=h.state.spritesArray;O.render(c,e,t),n&&_.updateRenderTargetMipmap(n),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),e.onAfterRender(D,e,t),ue.enabled&&ue.submitFrame(),u=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var e=W;return e>=f.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+f.maxTextures),W+=1,e},this.setTexture2D=(we=!1,function(e,t){e&&e.isWebGLRenderTarget&&(we||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),we=!0),e=e.texture),_.setTexture2D(e,t)}),this.setTexture=function(){var e=!1;return function(t,n){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),_.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function(t,n){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?_.setTextureCube(t,n):_.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return F},this.setRenderTarget=function(e){F=e,e&&void 0===v.get(e).__webglFramebuffer&&_.setupRenderTarget(e);var t=null,n=!1;if(e){var r=v.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=r[e.activeCubeFace],n=!0):t=r,z.copy(e.viewport),q.copy(e.scissor),G=e.scissorTest}else z.copy(X).multiplyScalar(Y),q.copy(Q).multiplyScalar(Y),G=K;if(j!==t&&(d.bindFramebuffer(d.FRAMEBUFFER,t),j=t),g.viewport(z),g.scissor(q),g.setScissorTest(G),n){var i=v.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,r,i,o){if(e&&e.isWebGLRenderTarget){var a=v.get(e).__webglFramebuffer;if(a){var s=!1;a!==j&&(d.bindFramebuffer(d.FRAMEBUFFER,a),s=!0);try{var c=e.texture,l=c.format,u=c.type;if(1023!==l&&N.convert(l)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===u||N.convert(u)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||1015===u&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||1016===u&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,N.convert(l),N.convert(u),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,j)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var r=t.image.width,i=t.image.height,o=N.convert(t.format);this.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,n||0,o,e.x,e.y,r,i,0)}}function An(e,t){this.name="",this.color=new fe(e),this.density=void 0!==t?t:25e-5}function xn(e,t,n){this.name="",this.color=new fe(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Sn(){Ge.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Tn(e){Ce.call(this),this.type="SpriteMaterial",this.color=new fe(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Mn(e){Ge.call(this),this.type="Sprite",this.material=void 0!==e?e:new Tn,this.center=new g(.5,.5)}function Rn(){Ge.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Cn(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new y)}}function kn(){Ge.call(this),this.type="Bone"}function In(e,t){Rt.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new y,this.bindMatrixInverse=new y;var n=new Cn(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Pn(e){Ce.call(this),this.type="LineBasicMaterial",this.color=new fe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function On(e,t,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Nn(e,t);Ge.call(this),this.type="Line",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Pn({color:16777215*Math.random()})}function Nn(e,t){On.call(this,e,t),this.type="LineSegments"}function Dn(e,t){On.call(this,e,t),this.type="LineLoop"}function Ln(e){Ce.call(this),this.type="PointsMaterial",this.color=new fe(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Fn(e,t){Ge.call(this),this.type="Points",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Ln({color:16777215*Math.random()})}function jn(){Ge.call(this),this.type="Group"}function Un(e,t,n,r,i,o,a,s,c){E.call(this,e,t,n,r,i,o,a,s,c),this.generateMipmaps=!1}function Bn(e,t,n,r,i,o,a,s,c,l,u,h){E.call(this,null,o,a,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Vn(e,t,n,r,i,o,a,s,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===l&&(n=1012),void 0===n&&1027===l&&(n=1020),E.call(this,null,r,i,o,a,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function Hn(e){vt.call(this),this.type="WireframeGeometry";var t,n,r,i,o,a,s,c,l,u,h=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]})}for(l in p)a=p[l],u=e.vertices[a.index1],h.push(u.x,u.y,u.z),u=e.vertices[a.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,v,_,w,E,A,x;if(u=new b,null!==e.index){for(y=e.attributes.position,v=e.index,0===(_=e.groups).length&&(_=[{start:0,count:v.count,materialIndex:0}]),i=0,o=_.length;i<o;++i)for(t=E=(w=_[i]).start,r=E+w.count;t<r;t+=3)for(n=0;n<3;n++)s=v.getX(t+n),c=v.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]});for(l in p)a=p[l],u.fromBufferAttribute(y,a.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(y,a.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(y=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)A=3*t+n,u.fromBufferAttribute(y,A),h.push(u.x,u.y,u.z),x=3*t+(n+1)%3,u.fromBufferAttribute(y,x),h.push(u.x,u.y,u.z)}this.addAttribute("position",new at(h,3))}function zn(e,t,n){Qe.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new qn(e,t,n)),this.mergeVertices()}function qn(e,t,n){vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,o=[],a=[],s=[],c=[],l=1e-5,u=new b,h=new b,d=new b,p=new b,f=new b,m=t+1;for(r=0;r<=n;r++){var g=r/n;for(i=0;i<=t;i++){var y=i/t;h=e(y,g,h),a.push(h.x,h.y,h.z),y-l>=0?(d=e(y-l,g,d),p.subVectors(h,d)):(d=e(y+l,g,d),p.subVectors(d,h)),g-l>=0?(d=e(y,g-l,d),f.subVectors(h,d)):(d=e(y,g+l,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),s.push(u.x,u.y,u.z),c.push(y,g)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*m+i,_=r*m+i+1,w=(r+1)*m+i+1,E=(r+1)*m+i;o.push(v,_,E),o.push(_,w,E)}this.setIndex(o),this.addAttribute("position",new at(a,3)),this.addAttribute("normal",new at(s,3)),this.addAttribute("uv",new at(c,2))}function Gn(e,t,n,r){Qe.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Wn(e,t,n,r)),this.mergeVertices()}function Wn(e,t,n,r){vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],o=[];function a(e,t,n,r){var i,o,a=Math.pow(2,r),c=[];for(i=0;i<=a;i++){c[i]=[];var l=e.clone().lerp(n,i/a),u=t.clone().lerp(n,i/a),h=a-i;for(o=0;o<=h;o++)c[i][o]=0===o&&i===a?l:l.clone().lerp(u,o/h)}for(i=0;i<a;i++)for(o=0;o<2*(a-i)-1;o++){var d=Math.floor(o/2);o%2==0?(s(c[i][d+1]),s(c[i+1][d]),s(c[i][d])):(s(c[i][d+1]),s(c[i+1][d+1]),s(c[i+1][d]))}}function s(e){i.push(e.x,e.y,e.z)}function c(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var n=new b,r=new b,i=new b,o=0;o<t.length;o+=3)c(t[o+0],n),c(t[o+1],r),c(t[o+2],i),a(n,r,i,e)}(r=r||0),function(e){for(var t=new b,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new b,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=h(e)/Math.PI+.5;o.push(n,1-r)}(function(){for(var e=new b,t=new b,n=new b,r=new b,a=new g,s=new g,c=new g,h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),a.set(o[d+0],o[d+1]),s.set(o[d+2],o[d+3]),c.set(o[d+4],o[d+5]),r.copy(e).add(t).add(n).divideScalar(3);var p=u(r);l(a,d+0,e,p),l(s,d+2,t,p),l(c,d+4,n,p)}})(),function(){for(var e=0;e<o.length;e+=6){var t=o[e+0],n=o[e+2],r=o[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),r<.2&&(o[e+4]+=1))}}()}(),this.addAttribute("position",new at(i,3)),this.addAttribute("normal",new at(i.slice(),3)),this.addAttribute("uv",new at(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Jn(e,t){Qe.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Zn(e,t)),this.mergeVertices()}function Zn(e,t){Wn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Yn(e,t){Qe.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Xn(e,t)),this.mergeVertices()}function Xn(e,t){Wn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Qn(e,t){Qe.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Kn(e,t)),this.mergeVertices()}function Kn(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Wn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function $n(e,t){Qe.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];Wn.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function tr(e,t,n,r,i,o){Qe.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new nr(e,t,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function nr(e,t,n,r,i){vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new b,l=new b,u=new g,h=new b,d=[],p=[],f=[],m=[];function y(i){h=e.getPointAt(i/t,h);var a=o.normals[i],u=o.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*a.x+m*u.x,l.y=g*a.y+m*u.y,l.z=g*a.z+m*u.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(a=0;a<t;a++)y(a);y(!1===i?t:0),function(){for(a=0;a<=t;a++)for(s=0;s<=r;s++)u.x=a/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(a=1;a<=r;a++){var e=(r+1)*(s-1)+(a-1),n=(r+1)*s+(a-1),i=(r+1)*s+a,o=(r+1)*(s-1)+a;m.push(e,n,o),m.push(n,i,o)}}()}(),this.setIndex(m),this.addAttribute("position",new at(d,3)),this.addAttribute("normal",new at(p,3)),this.addAttribute("uv",new at(f,2))}function rr(e,t,n,r,i,o,a){Qe.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ir(e,t,n,r,i,o)),this.mergeVertices()}function ir(e,t,n,r,i,o){vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,o=o||3;var a,s,c=[],l=[],u=[],h=[],d=new b,p=new b,f=new b,m=new b,g=new b,y=new b,v=new b;for(a=0;a<=n;++a){var _=a/n*i*Math.PI*2;for(R(_,i,o,e,f),R(_+.01,i,o,e,m),y.subVectors(m,f),v.addVectors(m,f),g.crossVectors(y,v),v.crossVectors(g,y),g.normalize(),v.normalize(),s=0;s<=r;++s){var w=s/r*Math.PI*2,E=-t*Math.cos(w),A=t*Math.sin(w);d.x=f.x+(E*v.x+A*g.x),d.y=f.y+(E*v.y+A*g.y),d.z=f.z+(E*v.z+A*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(a/n),h.push(s/r)}}for(s=1;s<=n;s++)for(a=1;a<=r;a++){var x=(r+1)*(s-1)+(a-1),S=(r+1)*s+(a-1),T=(r+1)*s+a,M=(r+1)*(s-1)+a;c.push(x,S,M),c.push(S,T,M)}function R(e,t,n,r,i){var o=Math.cos(e),a=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*o,i.y=r*(2+c)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new at(l,3)),this.addAttribute("normal",new at(u,3)),this.addAttribute("uv",new at(h,2))}function or(e,t,n,r,i){Qe.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new ar(e,t,n,r,i)),this.mergeVertices()}function ar(e,t,n,r,i){vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var o,a,s=[],c=[],l=[],u=[],h=new b,d=new b,p=new b;for(o=0;o<=n;o++)for(a=0;a<=r;a++){var f=a/r*i,m=o/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(f),d.y=(e+t*Math.cos(m))*Math.sin(f),d.z=t*Math.sin(m),c.push(d.x,d.y,d.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(a/r),u.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=r;a++){var g=(r+1)*o+a-1,y=(r+1)*(o-1)+a-1,v=(r+1)*(o-1)+a,_=(r+1)*o+a;s.push(g,y,_),s.push(y,v,_)}this.setIndex(s),this.addAttribute("position",new at(c,3)),this.addAttribute("normal",new at(l,3)),this.addAttribute("uv",new at(u,2))}An.prototype.isFogExp2=!0,An.prototype.clone=function(){return new An(this.color.getHex(),this.density)},An.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},xn.prototype.isFog=!0,xn.prototype.clone=function(){return new xn(this.color.getHex(),this.near,this.far)},xn.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Sn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Sn,copy:function(e,t){return Ge.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),Tn.prototype=Object.create(Ce.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isSpriteMaterial=!0,Tn.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},Mn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Mn,isSprite:!0,raycast:(un=new b,hn=new b,dn=new b,function(e,t){hn.setFromMatrixPosition(this.matrixWorld),e.ray.closestPointToPoint(hn,un),dn.setFromMatrixScale(this.matrixWorld);var n=dn.x*dn.y/4;if(!(hn.distanceToSquared(un)>n)){var r=e.ray.origin.distanceTo(un);r<e.near||r>e.far||t.push({distance:r,point:un.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Ge.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),Rn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Rn,copy:function(e){Ge.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);n.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(pn=new b,function(e,t){pn.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(pn);this.getObjectForDistance(n).raycast(e,t)}),update:function(){var e=new b,t=new b;return function(n){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);r[0].object.visible=!0;for(var o=1,a=r.length;o<a&&i>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;o<a;o++)r[o].object.visible=!1}}}(),toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}),Object.assign(Cn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new y;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(fn=new y,mn=new y,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=e.length;i<o;i++){var a=e[i]?e[i].matrixWorld:mn;fn.multiplyMatrices(a,t[i]),fn.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new Cn(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),kn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:kn,isBone:!0}),In.prototype=Object.assign(Object.create(Rt.prototype),{constructor:In,isSkinnedMesh:!0,initBones:function(){var e,t,n,r,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,r=this.geometry.bones.length;n<r;n++)t=this.geometry.bones[n],e=new kn,i.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(n=0,r=this.geometry.bones.length;n<r;n++)-1!==(t=this.geometry.bones[n]).parent&&null!==t.parent&&void 0!==i[t.parent]?i[t.parent].add(i[n]):this.add(i[n])}return this.updateMatrixWorld(!0),i},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var n=this.geometry.skinWeights[t];(e=1/n.manhattanLength())!==1/0?n.multiplyScalar(e):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new A,i=this.geometry.attributes.skinWeight;for(t=0;t<i.count;t++)r.x=i.getX(t),r.y=i.getY(t),r.z=i.getZ(t),r.w=i.getW(t),(e=1/r.manhattanLength())!==1/0?r.multiplyScalar(e):r.set(1,0,0,0),i.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Rt.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Pn.prototype=Object.create(Ce.prototype),Pn.prototype.constructor=Pn,Pn.prototype.isLineBasicMaterial=!0,Pn.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},On.prototype=Object.assign(Object.create(Ge.prototype),{constructor:On,isLine:!0,computeLineDistances:(gn=new b,yn=new b,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)gn.fromBufferAttribute(t,r-1),yn.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=gn.distanceTo(yn);e.addAttribute("lineDistance",new THREE.Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var o=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=o.length;r<i;r++)n[r]=n[r-1],n[r]+=o[r-1].distanceTo(o[r])}return this}),raycast:function(){var e=new y,t=new St,n=new Oe;return function(r,i){var o=r.linePrecision,a=o*o,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var l=new b,u=new b,h=new b,d=new b,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var f=s.index,m=s.attributes.position.array;if(null!==f)for(var g=f.array,y=0,v=g.length-1;y<v;y+=p){var _=g[y],w=g[y+1];if(l.fromArray(m,3*_),u.fromArray(m,3*w),!(t.distanceSqToSegment(l,u,d,h)>a))d.applyMatrix4(this.matrixWorld),(x=r.ray.origin.distanceTo(d))<r.near||x>r.far||i.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,v=m.length/3-1;y<v;y+=p){if(l.fromArray(m,3*y),u.fromArray(m,3*y+3),!(t.distanceSqToSegment(l,u,d,h)>a))d.applyMatrix4(this.matrixWorld),(x=r.ray.origin.distanceTo(d))<r.near||x>r.far||i.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var E=s.vertices,A=E.length;for(y=0;y<A-1;y+=p){var x;if(!(t.distanceSqToSegment(E[y],E[y+1],d,h)>a))d.applyMatrix4(this.matrixWorld),(x=r.ray.origin.distanceTo(d))<r.near||x>r.far||i.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Nn.prototype=Object.assign(Object.create(On.prototype),{constructor:Nn,isLineSegments:!0,computeLineDistances:function(){var e=new b,t=new b;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var r=n.attributes.position,i=[],o=0,a=r.count;o<a;o+=2)e.fromBufferAttribute(r,o),t.fromBufferAttribute(r,o+1),i[o]=0===o?0:i[o-1],i[o+1]=i[o]+e.distanceTo(t);n.addAttribute("lineDistance",new THREE.Float32BufferAttribute(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(i=n.lineDistances,o=0,a=s.length;o<a;o+=2)e.copy(s[o]),t.copy(s[o+1]),i[o]=0===o?0:i[o-1],i[o+1]=i[o]+e.distanceTo(t)}return this}}()}),Dn.prototype=Object.assign(Object.create(On.prototype),{constructor:Dn,isLineLoop:!0}),Ln.prototype=Object.create(Ce.prototype),Ln.prototype.constructor=Ln,Ln.prototype.isPointsMaterial=!0,Ln.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Fn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Fn,isPoints:!0,raycast:function(){var e=new y,t=new St,n=new Oe;return function(r,i){var o=this,a=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){e.getInverse(s),t.copy(r.ray).applyMatrix4(e);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new b;if(a.isBufferGeometry){var d=a.index,p=a.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length;m<g;m++){var y=f[m];h.fromArray(p,3*y),w(h,y)}else{m=0;for(var v=p.length/3;m<v;m++)h.fromArray(p,3*m),w(h,m)}}else{var _=a.vertices;for(m=0,v=_.length;m<v;m++)w(_[m],m)}}function w(e,n){var a=t.distanceSqToPoint(e);if(a<u){var c=t.closestPointToPoint(e);c.applyMatrix4(s);var l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(a),point:c.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),jn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:jn,isGroup:!0}),Un.prototype=Object.assign(Object.create(E.prototype),{constructor:Un,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Bn.prototype=Object.create(E.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isCompressedTexture=!0,Vn.prototype=Object.create(E.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isDepthTexture=!0,Hn.prototype=Object.create(vt.prototype),Hn.prototype.constructor=Hn,zn.prototype=Object.create(Qe.prototype),zn.prototype.constructor=zn,qn.prototype=Object.create(vt.prototype),qn.prototype.constructor=qn,Gn.prototype=Object.create(Qe.prototype),Gn.prototype.constructor=Gn,Wn.prototype=Object.create(vt.prototype),Wn.prototype.constructor=Wn,Jn.prototype=Object.create(Qe.prototype),Jn.prototype.constructor=Jn,Zn.prototype=Object.create(Wn.prototype),Zn.prototype.constructor=Zn,Yn.prototype=Object.create(Qe.prototype),Yn.prototype.constructor=Yn,Xn.prototype=Object.create(Wn.prototype),Xn.prototype.constructor=Xn,Qn.prototype=Object.create(Qe.prototype),Qn.prototype.constructor=Qn,Kn.prototype=Object.create(Wn.prototype),Kn.prototype.constructor=Kn,$n.prototype=Object.create(Qe.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Wn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(Qe.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(vt.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(Qe.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(vt.prototype),ir.prototype.constructor=ir,or.prototype=Object.create(Qe.prototype),or.prototype.constructor=or,ar.prototype=Object.create(vt.prototype),ar.prototype.constructor=ar;var sr=function(e,t,n){n=n||2;var r,i,o,a,s,c,l,u=t&&t.length,h=u?t[0]*n:e.length,d=cr(e,0,h,n,!0),p=[];if(!d)return p;if(u&&(d=function(e,t,n,r){var i,o,a,s,c,l=[];for(i=0,o=t.length;i<o;i++)a=t[i]*r,s=i<o-1?t[i+1]*r:e.length,(c=cr(e,a,s,r,!1))===c.next&&(c.steiner=!0),l.push(vr(c));for(l.sort(mr),i=0;i<l.length;i++)gr(l[i],n),n=lr(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(c=e[f+1])<i&&(i=c),s>o&&(o=s),c>a&&(a=c);l=0!==(l=Math.max(o-r,a-i))?1/l:0}return ur(d,p,n,r,i,l),p};function cr(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}(e,t,n,r)>0)for(o=t;o<n;o+=r)a=Tr(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=Tr(o,e[o],e[o+1],a);return a&&Er(a,a.next)&&(Mr(a),a=a.next),a}function lr(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Er(r,r.next)&&0!==wr(r.prev,r,r.next))r=r.next;else{if(Mr(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function ur(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=yr(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,c,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,o);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,o?dr(e,r,i,o):hr(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Mr(e),e=c.next,l=c.next;else if((e=c)===l){a?1===a?ur(e=pr(e,t,n),t,n,r,i,o,2):2===a&&fr(e,t,n,r,i,o):ur(lr(e),t,n,r,i,o,1);break}}}function hr(e){var t=e.prev,n=e,r=e.next;if(wr(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(br(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&wr(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function dr(e,t,n,r){var i=e.prev,o=e,a=e.next;if(wr(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,c=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=yr(s,c,t,n,r),d=yr(l,u,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&wr(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&wr(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pr(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!Er(i,o)&&Ar(i,r,r.next,o)&&xr(i,o)&&xr(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Mr(r),Mr(r.next),r=e=o),r=r.next}while(r!==e);return r}function fr(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&_r(a,s)){var c=Sr(a,s);return a=lr(a,a.next),c=lr(c,c.next),ur(a,t,n,r,i,o),void ur(c,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function mr(e,t){return e.x-t.x}function gr(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n.prev;var c,l=n,u=n.x,h=n.y,d=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=u&&i!==r.x&&br(o<h?i:a,o,u,h,o<h?a:i,o,r.x,r.y)&&((c=Math.abs(o-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&xr(r,e)&&(n=r,d=c),r=r.next;return n}(e,t)){var n=Sr(t,e);lr(n,n.next)}}function yr(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vr(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function br(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function _r(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ar(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&xr(e,t)&&xr(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function wr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Er(e,t){return e.x===t.x&&e.y===t.y}function Ar(e,t,n,r){return!!(Er(e,t)&&Er(n,r)||Er(e,r)&&Er(n,t))||wr(e,t,n)>0!=wr(e,t,r)>0&&wr(n,r,e)>0!=wr(n,r,t)>0}function xr(e,t){return wr(e.prev,e,e.next)<0?wr(e,t,e.next)>=0&&wr(e,e.prev,t)>=0:wr(e,t,e.prev)<0||wr(e,e.next,t)<0}function Sr(e,t){var n=new Rr(e.i,e.x,e.y),r=new Rr(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Tr(e,t,n,r){var i=new Rr(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Mr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rr(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Cr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return Cr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];kr(e),Ir(n,e);var o=e.length;t.forEach(kr);for(var a=0;a<t.length;a++)r.push(o),o+=t[a].length,Ir(n,t[a]);var s=sr(n,r);for(a=0;a<s.length;a+=3)i.push(s.slice(a,a+3));return i}};function kr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Ir(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Pr(e,t){Qe.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Or(e,t)),this.mergeVertices()}function Or(e,t){void 0!==e&&(vt.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function Nr(e,t){Qe.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Dr(e,t)),this.mergeVertices()}function Dr(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Qe;var r=n.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Or.call(this,r,t),this.type="TextBufferGeometry"}function Lr(e,t,n,r,i,o,a){Qe.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Fr(e,t,n,r,i,o,a)),this.mergeVertices()}function Fr(e,t,n,r,i,o,a){vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,c,l=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),u=0,h=[],d=new b,p=new b,f=[],m=[],g=[],y=[];for(c=0;c<=n;c++){var v=[],_=c/n;for(s=0;s<=t;s++){var w=s/t;d.x=-e*Math.cos(r+w*i)*Math.sin(o+_*a),d.y=e*Math.cos(o+_*a),d.z=e*Math.sin(r+w*i)*Math.sin(o+_*a),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),y.push(w,1-_),v.push(u++)}h.push(v)}for(c=0;c<n;c++)for(s=0;s<t;s++){var E=h[c][s+1],A=h[c][s],x=h[c+1][s],S=h[c+1][s+1];(0!==c||o>0)&&f.push(E,A,S),(c!==n-1||l<Math.PI)&&f.push(A,x,S)}this.setIndex(f),this.addAttribute("position",new at(m,3)),this.addAttribute("normal",new at(g,3)),this.addAttribute("uv",new at(y,2))}function jr(e,t,n,r,i,o){Qe.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new Ur(e,t,n,r,i,o)),this.mergeVertices()}function Ur(e,t,n,r,i,o){vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},e=e||.5,t=t||1,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,c,l=[],u=[],h=[],d=[],p=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new b,y=new g;for(s=0;s<=r;s++){for(c=0;c<=n;c++)a=i+c/n*o,m.x=p*Math.cos(a),m.y=p*Math.sin(a),u.push(m.x,m.y,m.z),h.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,d.push(y.x,y.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var _=a=c+v,w=a+n+1,E=a+n+2,A=a+1;l.push(_,w,A),l.push(w,E,A)}}this.setIndex(l),this.addAttribute("position",new at(u,3)),this.addAttribute("normal",new at(h,3)),this.addAttribute("uv",new at(d,2))}function Br(e,t,n,r){Qe.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Vr(e,t,n,r)),this.mergeVertices()}function Vr(e,t,n,r){vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=m.clamp(r,0,2*Math.PI);var i,o,a,s=[],c=[],l=[],u=1/t,h=new b,d=new g;for(o=0;o<=t;o++){var p=n+o*u*r,f=Math.sin(p),y=Math.cos(p);for(a=0;a<=e.length-1;a++)h.x=e[a].x*f,h.y=e[a].y,h.z=e[a].x*y,c.push(h.x,h.y,h.z),d.x=o/t,d.y=a/(e.length-1),l.push(d.x,d.y)}for(o=0;o<t;o++)for(a=0;a<e.length-1;a++){var v=i=a+o*e.length,_=i+e.length,w=i+e.length+1,E=i+1;s.push(v,_,E),s.push(_,w,E)}if(this.setIndex(s),this.addAttribute("position",new at(c,3)),this.addAttribute("uv",new at(l,2)),this.computeVertexNormals(),r===2*Math.PI){var A=this.attributes.normal.array,x=new b,S=new b,T=new b;for(i=t*e.length*3,o=0,a=0;o<e.length;o++,a+=3)x.x=A[a+0],x.y=A[a+1],x.z=A[a+2],S.x=A[i+a+0],S.y=A[i+a+1],S.z=A[i+a+2],T.addVectors(x,S).normalize(),A[a+0]=A[i+a+0]=T.x,A[a+1]=A[i+a+1]=T.y,A[a+2]=A[i+a+2]=T.z}}function Hr(e,t){Qe.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new zr(e,t)),this.mergeVertices()}function zr(e,t){vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],o=[],a=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(a,s,c),a+=s,s=0;function l(e){var a,c,l,u=r.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;if(!1===Cr.isClockWise(d))for(d=d.reverse(),a=0,c=p.length;a<c;a++)l=p[a],!0===Cr.isClockWise(l)&&(p[a]=l.reverse());var f=Cr.triangulateShape(d,p);for(a=0,c=p.length;a<c;a++)l=p[a],d=d.concat(l);for(a=0,c=d.length;a<c;a++){var m=d[a];r.push(m.x,m.y,0),i.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=f.length;a<c;a++){var g=f[a],y=g[0]+u,v=g[1]+u,b=g[2]+u;n.push(y,v,b),s+=3}}this.setIndex(n),this.addAttribute("position",new at(r,3)),this.addAttribute("normal",new at(i,3)),this.addAttribute("uv",new at(o,2))}function qr(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function Gr(e,t){vt.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,o,a=[],s=Math.cos(m.DEG2RAD*t),c=[0,0],l={},u=["a","b","c"];e.isBufferGeometry?(o=new Qe).fromBufferGeometry(e):o=e.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var g=d[p],y=0;y<3;y++)n=g[u[y]],r=g[u[(y+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===l[i=c[0]+","+c[1]]?l[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:l[i].face2=p;for(i in l){var v=l[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var b=h[v.index1];a.push(b.x,b.y,b.z),b=h[v.index2],a.push(b.x,b.y,b.z)}}this.addAttribute("position",new at(a,3))}function Wr(e,t,n,r,i,o,a,s){Qe.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Jr(e,t,n,r,i,o,a,s)),this.mergeVertices()}function Jr(e,t,n,r,i,o,a,s){vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],d=[],p=0,f=[],m=n/2,y=0;function v(n){var i,o,f,v=new g,_=new b,w=0,E=!0===n?e:t,A=!0===n?1:-1;for(o=p,i=1;i<=r;i++)u.push(0,m*A,0),h.push(0,A,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var x=i/r*s+a,S=Math.cos(x),T=Math.sin(x);_.x=E*T,_.y=m*A,_.z=E*S,u.push(_.x,_.y,_.z),h.push(0,A,0),v.x=.5*S+.5,v.y=.5*T*A+.5,d.push(v.x,v.y),p++}for(i=0;i<r;i++){var M=o+i,R=f+i;!0===n?l.push(R,R+1,M):l.push(R+1,R,M),w+=3}c.addGroup(y,w,!0===n?1:2),y+=w}!function(){var o,g,v=new b,_=new b,w=0,E=(t-e)/n;for(g=0;g<=i;g++){var A=[],x=g/i,S=x*(t-e)+e;for(o=0;o<=r;o++){var T=o/r,M=T*s+a,R=Math.sin(M),C=Math.cos(M);_.x=S*R,_.y=-x*n+m,_.z=S*C,u.push(_.x,_.y,_.z),v.set(R,E,C).normalize(),h.push(v.x,v.y,v.z),d.push(T,1-x),A.push(p++)}f.push(A)}for(o=0;o<r;o++)for(g=0;g<i;g++){var k=f[g][o],I=f[g+1][o],P=f[g+1][o+1],O=f[g][o+1];l.push(k,I,O),l.push(I,P,O),w+=6}c.addGroup(y,w,0),y+=w}(),!1===o&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.addAttribute("position",new at(u,3)),this.addAttribute("normal",new at(h,3)),this.addAttribute("uv",new at(d,2))}function Zr(e,t,n,r,i,o,a){Wr.call(this,0,e,t,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Yr(e,t,n,r,i,o,a){Jr.call(this,0,e,t,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Xr(e,t,n,r){Qe.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Qr(e,t,n,r)),this.mergeVertices()}function Qr(e,t,n,r){vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,o,a=[],s=[],c=[],l=[],u=new b,h=new g;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,i=3;o<=t;o++,i+=3){var d=n+o/t*r;u.x=e*Math.cos(d),u.y=e*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,l.push(h.x,h.y)}for(i=1;i<=t;i++)a.push(i,i+1,0);this.setIndex(a),this.addAttribute("position",new at(s,3)),this.addAttribute("normal",new at(c,3)),this.addAttribute("uv",new at(l,2))}Pr.prototype=Object.create(Qe.prototype),Pr.prototype.constructor=Pr,Or.prototype=Object.create(vt.prototype),Or.prototype.constructor=Or,Or.prototype.getArrays=function(){var e=this.getAttribute("position"),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:t,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},Or.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var r=0;r<n;r++){var i=e[r];this.addShape(i,t)}this.setIndex(t.arrays.index),this.addAttribute("position",new at(t.arrays.position,3)),this.addAttribute("uv",new at(t.arrays.uv,2))},Or.prototype.addShape=function(e,t){var n,r,i,o,a,s,c,l,u=t.arrays?t.arrays:this.getArrays(),h=u.position,d=u.index,p=u.uv,f=[],m=void 0!==t.amount?t.amount:100,y=void 0!==t.bevelThickness?t.bevelThickness:6,v=void 0!==t.bevelSize?t.bevelSize:y-2,_=void 0!==t.bevelSegments?t.bevelSegments:3,w=void 0===t.bevelEnabled||t.bevelEnabled,E=void 0!==t.curveSegments?t.curveSegments:12,A=void 0!==t.steps?t.steps:1,x=t.extrudePath,S=!1,T=void 0!==t.UVGenerator?t.UVGenerator:Pr.WorldUVGenerator;x&&(n=x.getSpacedPoints(A),S=!0,w=!1,r=void 0!==t.frames?t.frames:x.computeFrenetFrames(A,!1),i=new b,o=new b,a=new b),w||(_=0,y=0,v=0);var M=this,R=e.extractPoints(E),C=R.shape,k=R.holes;if(!Cr.isClockWise(C))for(C=C.reverse(),c=0,l=k.length;c<l;c++)s=k[c],Cr.isClockWise(s)&&(k[c]=s.reverse());var I=Cr.triangulateShape(C,k),P=C;for(c=0,l=k.length;c<l;c++)s=k[c],C=C.concat(s);function O(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var N,D,L,F,j,U,B=C.length,V=I.length;function H(e,t,n){var r,i,o,a=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=a*a+s*s,h=a*l-s*c;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=t.x-s/d,m=t.y+a/d,y=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(a*l-s*c),v=(r=f+a*y-e.x)*r+(i=m+s*y-e.y)*i;if(v<=2)return new g(r,i);o=Math.sqrt(v/2)}else{var b=!1;a>Number.EPSILON?c>Number.EPSILON&&(b=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(l)&&(b=!0),b?(r=-s,i=a,o=Math.sqrt(u)):(r=a,i=s,o=Math.sqrt(u/2))}return new g(r/o,i/o)}for(var z=[],q=0,G=P.length,W=G-1,J=q+1;q<G;q++,W++,J++)W===G&&(W=0),J===G&&(J=0),z[q]=H(P[q],P[W],P[J]);var Z,Y,X=[],Q=z.concat();for(c=0,l=k.length;c<l;c++){for(s=k[c],Z=[],q=0,W=(G=s.length)-1,J=q+1;q<G;q++,W++,J++)W===G&&(W=0),J===G&&(J=0),Z[q]=H(s[q],s[W],s[J]);X.push(Z),Q=Q.concat(Z)}for(N=0;N<_;N++){for(L=N/_,F=y*Math.cos(L*Math.PI/2),D=v*Math.sin(L*Math.PI/2),q=0,G=P.length;q<G;q++)$((j=O(P[q],z[q],D)).x,j.y,-F);for(c=0,l=k.length;c<l;c++)for(s=k[c],Z=X[c],q=0,G=s.length;q<G;q++)$((j=O(s[q],Z[q],D)).x,j.y,-F)}for(D=v,q=0;q<B;q++)j=w?O(C[q],Q[q],D):C[q],S?(o.copy(r.normals[0]).multiplyScalar(j.x),i.copy(r.binormals[0]).multiplyScalar(j.y),a.copy(n[0]).add(o).add(i),$(a.x,a.y,a.z)):$(j.x,j.y,0);for(Y=1;Y<=A;Y++)for(q=0;q<B;q++)j=w?O(C[q],Q[q],D):C[q],S?(o.copy(r.normals[Y]).multiplyScalar(j.x),i.copy(r.binormals[Y]).multiplyScalar(j.y),a.copy(n[Y]).add(o).add(i),$(a.x,a.y,a.z)):$(j.x,j.y,m/A*Y);for(N=_-1;N>=0;N--){for(L=N/_,F=y*Math.cos(L*Math.PI/2),D=v*Math.sin(L*Math.PI/2),q=0,G=P.length;q<G;q++)$((j=O(P[q],z[q],D)).x,j.y,m+F);for(c=0,l=k.length;c<l;c++)for(s=k[c],Z=X[c],q=0,G=s.length;q<G;q++)j=O(s[q],Z[q],D),S?$(j.x,j.y+n[A-1].y,n[A-1].x+F):$(j.x,j.y,m+F)}function K(e,t){var n,r;for(q=e.length;--q>=0;){n=q,(r=q-1)<0&&(r=e.length-1);var i=0,o=A+2*_;for(i=0;i<o;i++){var a=B*i,s=B*(i+1);te(t+n+a,t+r+a,t+r+s,t+n+s)}}}function $(e,t,n){f.push(e),f.push(t),f.push(n)}function ee(e,t,n){ne(e),ne(t),ne(n);var r=h.length/3,i=T.generateTopUV(M,h,r-3,r-2,r-1);re(i[0]),re(i[1]),re(i[2])}function te(e,t,n,r){ne(e),ne(t),ne(r),ne(t),ne(n),ne(r);var i=h.length/3,o=T.generateSideWallUV(M,h,i-6,i-3,i-2,i-1);re(o[0]),re(o[1]),re(o[3]),re(o[1]),re(o[2]),re(o[3])}function ne(e){d.push(h.length/3),h.push(f[3*e+0]),h.push(f[3*e+1]),h.push(f[3*e+2])}function re(e){p.push(e.x),p.push(e.y)}!function(){var e=h.length/3;if(w){var n=0,r=B*n;for(q=0;q<V;q++)ee((U=I[q])[2]+r,U[1]+r,U[0]+r);for(r=B*(n=A+2*_),q=0;q<V;q++)ee((U=I[q])[0]+r,U[1]+r,U[2]+r)}else{for(q=0;q<V;q++)ee((U=I[q])[2],U[1],U[0]);for(q=0;q<V;q++)ee((U=I[q])[0]+B*A,U[1]+B*A,U[2]+B*A)}M.addGroup(e,h.length/3-e,void 0!==t.material?t.material:0)}(),function(){var e=h.length/3,n=0;for(K(P,n),n+=P.length,c=0,l=k.length;c<l;c++)K(s=k[c],n),n+=s.length;M.addGroup(e,h.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}(),t.arrays||(this.setIndex(d),this.addAttribute("position",new at(h,3)),this.addAttribute("uv",new at(p,2)))},Pr.WorldUVGenerator={generateTopUV:function(e,t,n,r,i){var o=t[3*n],a=t[3*n+1],s=t[3*r],c=t[3*r+1],l=t[3*i],u=t[3*i+1];return[new g(o,a),new g(s,c),new g(l,u)]},generateSideWallUV:function(e,t,n,r,i,o){var a=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*o],y=t[3*o+1],v=t[3*o+2];return Math.abs(s-u)<.01?[new g(a,1-c),new g(l,1-h),new g(d,1-f),new g(m,1-v)]:[new g(s,1-c),new g(u,1-h),new g(p,1-f),new g(y,1-v)]}},Nr.prototype=Object.create(Qe.prototype),Nr.prototype.constructor=Nr,Dr.prototype=Object.create(Or.prototype),Dr.prototype.constructor=Dr,Lr.prototype=Object.create(Qe.prototype),Lr.prototype.constructor=Lr,Fr.prototype=Object.create(vt.prototype),Fr.prototype.constructor=Fr,jr.prototype=Object.create(Qe.prototype),jr.prototype.constructor=jr,Ur.prototype=Object.create(vt.prototype),Ur.prototype.constructor=Ur,Br.prototype=Object.create(Qe.prototype),Br.prototype.constructor=Br,Vr.prototype=Object.create(vt.prototype),Vr.prototype.constructor=Vr,Hr.prototype=Object.create(Qe.prototype),Hr.prototype.constructor=Hr,Hr.prototype.toJSON=function(){var e=Qe.prototype.toJSON.call(this);return qr(this.parameters.shapes,e)},zr.prototype=Object.create(vt.prototype),zr.prototype.constructor=zr,zr.prototype.toJSON=function(){var e=vt.prototype.toJSON.call(this);return qr(this.parameters.shapes,e)},Gr.prototype=Object.create(vt.prototype),Gr.prototype.constructor=Gr,Wr.prototype=Object.create(Qe.prototype),Wr.prototype.constructor=Wr,Jr.prototype=Object.create(vt.prototype),Jr.prototype.constructor=Jr,Zr.prototype=Object.create(Wr.prototype),Zr.prototype.constructor=Zr,Yr.prototype=Object.create(Jr.prototype),Yr.prototype.constructor=Yr,Xr.prototype=Object.create(Qe.prototype),Xr.prototype.constructor=Xr,Qr.prototype=Object.create(vt.prototype),Qr.prototype.constructor=Qr;var Kr=Object.freeze({WireframeGeometry:Hn,ParametricGeometry:zn,ParametricBufferGeometry:qn,TetrahedronGeometry:Jn,TetrahedronBufferGeometry:Zn,OctahedronGeometry:Yn,OctahedronBufferGeometry:Xn,IcosahedronGeometry:Qn,IcosahedronBufferGeometry:Kn,DodecahedronGeometry:$n,DodecahedronBufferGeometry:er,PolyhedronGeometry:Gn,PolyhedronBufferGeometry:Wn,TubeGeometry:tr,TubeBufferGeometry:nr,TorusKnotGeometry:rr,TorusKnotBufferGeometry:ir,TorusGeometry:or,TorusBufferGeometry:ar,TextGeometry:Nr,TextBufferGeometry:Dr,SphereGeometry:Lr,SphereBufferGeometry:Fr,RingGeometry:jr,RingBufferGeometry:Ur,PlaneGeometry:wt,PlaneBufferGeometry:Et,LatheGeometry:Br,LatheBufferGeometry:Vr,ShapeGeometry:Hr,ShapeBufferGeometry:zr,ExtrudeGeometry:Pr,ExtrudeBufferGeometry:Or,EdgesGeometry:Gr,ConeGeometry:Zr,ConeBufferGeometry:Yr,CylinderGeometry:Wr,CylinderBufferGeometry:Jr,CircleGeometry:Xr,CircleBufferGeometry:Qr,BoxGeometry:bt,BoxBufferGeometry:_t});function $r(e){Ce.call(this),this.type="ShadowMaterial",this.color=new fe(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(e)}function ei(e){xt.call(this,e),this.type="RawShaderMaterial"}function ti(e){Ce.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fe(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ni(e){ti.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function ri(e){Ce.call(this),this.type="MeshPhongMaterial",this.color=new fe(16777215),this.specular=new fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ii(e){ri.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function oi(e){Ce.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ai(e){Ce.call(this),this.type="MeshLambertMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function si(e){Pn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}$r.prototype=Object.create(Ce.prototype),$r.prototype.constructor=$r,$r.prototype.isShadowMaterial=!0,ei.prototype=Object.create(xt.prototype),ei.prototype.constructor=ei,ei.prototype.isRawShaderMaterial=!0,ti.prototype=Object.create(Ce.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshStandardMaterial=!0,ti.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ni.prototype=Object.create(ti.prototype),ni.prototype.constructor=ni,ni.prototype.isMeshPhysicalMaterial=!0,ni.prototype.copy=function(e){return ti.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},ri.prototype=Object.create(Ce.prototype),ri.prototype.constructor=ri,ri.prototype.isMeshPhongMaterial=!0,ri.prototype.copy=function(e){return Ce.prototype.copy.call(this,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.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.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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ii.prototype=Object.create(ri.prototype),ii.prototype.constructor=ii,ii.prototype.isMeshToonMaterial=!0,ii.prototype.copy=function(e){return ri.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},oi.prototype=Object.create(Ce.prototype),oi.prototype.constructor=oi,oi.prototype.isMeshNormalMaterial=!0,oi.prototype.copy=function(e){return Ce.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ai.prototype=Object.create(Ce.prototype),ai.prototype.constructor=ai,ai.prototype.isMeshLambertMaterial=!0,ai.prototype.copy=function(e){return Ce.prototype.copy.call(this,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},si.prototype=Object.create(Pn.prototype),si.prototype.constructor=si,si.prototype.isLineDashedMaterial=!0,si.prototype.copy=function(e){return Pn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ci=Object.freeze({ShadowMaterial:$r,SpriteMaterial:Tn,RawShaderMaterial:ei,ShaderMaterial:xt,PointsMaterial:Ln,MeshPhysicalMaterial:ni,MeshStandardMaterial:ti,MeshPhongMaterial:ri,MeshToonMaterial:ii,MeshNormalMaterial:oi,MeshLambertMaterial:ai,MeshDepthMaterial:ke,MeshDistanceMaterial:Ie,MeshBasicMaterial:At,LineDashedMaterial:si,LineBasicMaterial:Pn,Material:Ce}),li={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ui(e,t,n){var r=this,i=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===i&&void 0!==r.onStart&&r.onStart(e,o,a),i=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var hi=new ui,di={};function pi(e){this.manager=void 0!==e?e:hi}function fi(e){this.manager=void 0!==e?e:hi,this._parser=null}function mi(e){this.manager=void 0!==e?e:hi}function gi(e){this.manager=void 0!==e?e:hi}function yi(e){this.manager=void 0!==e?e:hi}function vi(){this.type="Curve",this.arcLengthDivisions=200}function bi(e,t,n,r,i,o,a,s){vi.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function _i(e,t,n,r,i,o){bi.call(this,e,t,n,n,r,i,o),this.type="ArcCurve"}function wi(){var e=0,t=0,n=0,r=0;function i(i,o,a,s){e=i,t=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,a,s){var c=(t-e)/o-(n-e)/(o+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+s)+(r-n)/s;i(t,n,c*=a,l*=a)},calc:function(i){var o=i*i;return e+t*i+n*o+r*(o*i)}}}Object.assign(pi.prototype,{load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=li.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;if(void 0===di[e]){var a=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],l=a[3];l=window.decodeURIComponent(l),c&&(l=window.atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){window.setTimeout((function(){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),0)}}else{di[e]=[],di[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response;li.add(e,n);var r=di[e];if(delete di[e],200===this.status){for(var o=0,a=r.length;o<a;o++){(s=r[o]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(o=0,a=r.length;o<a;o++){(s=r[o]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(o=0,a=r.length;o<a;o++){var s;(s=r[o]).onError&&s.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=di[e],r=0,i=n.length;r<i;r++){var o=n[r];o.onProgress&&o.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=di[e];delete di[e];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}di[e].push({onLoad:t,onProgress:n,onError:r})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this._parser=null}.prototype,{load:function(e,t,n,r){var i=this,o=[],a=new Bn;a.image=o;var s=new pi(this.manager);function c(c){s.load(e[c],(function(e){var n=i._parser(e,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(a.minFilter=1006),a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,(function(e){var n=i._parser(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=1006),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,r);return a},setPath:function(e){return this.path=e,this}}),Object.assign(fi.prototype,{load:function(e,t,n,r){var i=this,o=new T,a=new pi(this.manager);return a.setResponseType("arraybuffer"),a.load(e,(function(e){var n=i._parser(e);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:1001,o.wrapT=void 0!==n.wrapT?n.wrapT:1001,o.magFilter=void 0!==n.magFilter?n.magFilter:1006,o.minFilter=void 0!==n.minFilter?n.minFilter:1008,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=1006),o.needsUpdate=!0,t&&t(o,n))}),n,r),o}}),Object.assign(mi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=li.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");return a.addEventListener("load",(function(){li.add(e,this),t&&t(this),i.manager.itemEnd(e)}),!1),a.addEventListener("error",(function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(gi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new M,o=new mi(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(e[n],(function(e){i.images[n]=e,6===++a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var c=0;c<e.length;++c)s(c);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(yi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new E,o=new mi(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(n){i.image=n;var r=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(vi.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),o=0;for(r.push(0),n=1;n<=e;n++)o+=(t=this.getPoint(n/e)).distanceTo(i),r.push(o),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,o=new b,a=[],s=[],c=[],l=new b,u=new y;for(n=0;n<=e;n++)r=n/e,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new b,c[0]=new b;var h=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=h&&(h=d,o.set(1,0,0)),p<=h&&(h=p,o.set(0,1,0)),f<=h&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),c[0].crossVectors(a[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(m.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,i))),c[n].crossVectors(a[n],s[n]);if(!0===t)for(i=Math.acos(m.clamp(s[0].dot(s[e]),-1,1)),i/=e,a[0].dot(l.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],i*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),bi.prototype=Object.create(vi.prototype),bi.prototype.constructor=bi,bi.prototype.isEllipseCurve=!0,bi.prototype.getPoint=function(e,t){for(var n=t||new g,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);var a=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=c-this.aY;s=h*l-d*u+this.aX,c=h*u+d*l+this.aY}return n.set(s,c)},bi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},bi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},bi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},_i.prototype=Object.create(bi.prototype),_i.prototype.constructor=_i,_i.prototype.isArcCurve=!0;var Ei=new b,Ai=new wi,xi=new wi,Si=new wi;function Ti(e,t,n,r){vi.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Mi(e,t,n,r,i){var o=.5*(r-t),a=.5*(i-n),s=e*e;return(2*n-2*r+o+a)*(e*s)+(-3*n+3*r-2*o-a)*s+o*e+n}function Ri(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Ci(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function ki(e,t,n,r){vi.call(this),this.type="CubicBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g,this.v3=r||new g}function Ii(e,t,n,r){vi.call(this),this.type="CubicBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function Pi(e,t){vi.call(this),this.type="LineCurve",this.v1=e||new g,this.v2=t||new g}function Oi(e,t){vi.call(this),this.type="LineCurve3",this.v1=e||new b,this.v2=t||new b}function Ni(e,t,n){vi.call(this),this.type="QuadraticBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g}function Di(e,t,n){vi.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function Li(e){vi.call(this),this.type="SplineCurve",this.points=e||[]}Ti.prototype=Object.create(vi.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isCatmullRomCurve3=!0,Ti.prototype.getPoint=function(e,t){var n,r,i,o,a=t||new b,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s.length)+1)*s.length:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(Ei.subVectors(s[0],s[1]).add(s[0]),n=Ei),r=s[u%c],i=s[(u+1)%c],this.closed||u+2<c?o=s[(u+2)%c]:(Ei.subVectors(s[c-1],s[c-2]).add(s[c-1]),o=Ei),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(o),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),Ai.initNonuniformCatmullRom(n.x,r.x,i.x,o.x,p,f,m),xi.initNonuniformCatmullRom(n.y,r.y,i.y,o.y,p,f,m),Si.initNonuniformCatmullRom(n.z,r.z,i.z,o.z,p,f,m)}else"catmullrom"===this.curveType&&(Ai.initCatmullRom(n.x,r.x,i.x,o.x,this.tension),xi.initCatmullRom(n.y,r.y,i.y,o.y,this.tension),Si.initCatmullRom(n.z,r.z,i.z,o.z,this.tension));return a.set(Ai.calc(h),xi.calc(h),Si.calc(h)),a},Ti.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Ti.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Ti.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new b).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ki.prototype=Object.create(vi.prototype),ki.prototype.constructor=ki,ki.prototype.isCubicBezierCurve=!0,ki.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Ci(e,r.x,i.x,o.x,a.x),Ci(e,r.y,i.y,o.y,a.y)),n},ki.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},ki.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},ki.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Ii.prototype=Object.create(vi.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isCubicBezierCurve3=!0,Ii.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Ci(e,r.x,i.x,o.x,a.x),Ci(e,r.y,i.y,o.y,a.y),Ci(e,r.z,i.z,o.z,a.z)),n},Ii.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ii.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ii.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Pi.prototype=Object.create(vi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isLineCurve=!0,Pi.prototype.getPoint=function(e,t){var n=t||new g;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Pi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Pi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Pi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Pi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Pi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Oi.prototype=Object.create(vi.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isLineCurve3=!0,Oi.prototype.getPoint=function(e,t){var n=t||new b;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Oi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Oi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Oi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Oi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ni.prototype=Object.create(vi.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isQuadraticBezierCurve=!0,Ni.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,o=this.v2;return n.set(Ri(e,r.x,i.x,o.x),Ri(e,r.y,i.y,o.y)),n},Ni.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ni.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ni.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Di.prototype=Object.create(vi.prototype),Di.prototype.constructor=Di,Di.prototype.isQuadraticBezierCurve3=!0,Di.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,o=this.v2;return n.set(Ri(e,r.x,i.x,o.x),Ri(e,r.y,i.y,o.y),Ri(e,r.z,i.z,o.z)),n},Di.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Di.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Di.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Li.prototype=Object.create(vi.prototype),Li.prototype.constructor=Li,Li.prototype.isSplineCurve=!0,Li.prototype.getPoint=function(e,t){var n=t||new g,r=this.points,i=(r.length-1)*e,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],c=r[o],l=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(Mi(a,s.x,c.x,l.x,u.x),Mi(a,s.y,c.y,l.y,u.y)),n},Li.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Li.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Li.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new g).fromArray(r))}return this};var Fi=Object.freeze({ArcCurve:_i,CatmullRomCurve3:Ti,CubicBezierCurve:ki,CubicBezierCurve3:Ii,EllipseCurve:bi,LineCurve:Pi,LineCurve3:Oi,QuadraticBezierCurve:Ni,QuadraticBezierCurve3:Di,SplineCurve:Li});function ji(){vi.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ui(e){ji.call(this),this.type="Path",this.currentPoint=new g,e&&this.setFromPoints(e)}function Bi(e){Ui.call(this,e),this.uuid=m.generateUUID(),this.type="Shape",this.holes=[]}function Vi(e,t){Ge.call(this),this.type="Light",this.color=new fe(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Hi(e,t,n){Vi.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.groundColor=new fe(t)}function zi(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new g(512,512),this.map=null,this.matrix=new y}function qi(){zi.call(this,new nn(50,1,.5,500))}function Gi(e,t,n,r,i,o){Vi.call(this,e,t),this.type="SpotLight",this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.target=new Ge,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new qi}function Wi(e,t,n,r){Vi.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new zi(new nn(90,1,.5,500))}function Ji(){zi.call(this,new Je(-5,5,5,-5,.5,500))}function Zi(e,t){Vi.call(this,e,t),this.type="DirectionalLight",this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.target=new Ge,this.shadow=new Ji}function Yi(e,t){Vi.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Xi(e,t,n,r){Vi.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Qi(e,t,n,r){co.call(this,e,t,n,r)}function Ki(e,t,n){co.call(this,e,t,n)}function $i(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function eo(e,t,n,r){$i.call(this,e,t,n,r)}function to(e,t,n,r){co.call(this,e,t,n,r)}function no(e,t,n,r){co.call(this,e,t,n,r)}function ro(e,t,n,r){co.call(this,e,t,n,r)}function io(e,t,n,r){$i.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function oo(e,t,n,r){$i.call(this,e,t,n,r)}function ao(e,t,n,r){$i.call(this,e,t,n,r)}ji.prototype=Object.assign(Object.create(vi.prototype),{constructor:ji,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Pi(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*e:o&&o.isLineCurve?1:o&&o.isSplineCurve?e*o.points.length:e,s=o.getPoints(a),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){vi.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=vi.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){vi.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Fi[r.type]).fromJSON(r))}return this}}),Ui.prototype=Object.assign(Object.create(ji.prototype),{constructor:Ui,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Pi(this.currentPoint.clone(),new g(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,r){var i=new Ni(this.currentPoint.clone(),new g(e,t),new g(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(e,t,n,r,i,o){var a=new ki(this.currentPoint.clone(),new g(e,t),new g(n,r),new g(i,o));this.curves.push(a),this.currentPoint.set(i,o)},splineThru:function(e){var t=new Li([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+a,t+s,n,r,i,o)},absarc:function(e,t,n,r,i,o){this.absellipse(e,t,n,n,r,i,o)},ellipse:function(e,t,n,r,i,o,a,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,n,r,i,o,a,s)},absellipse:function(e,t,n,r,i,o,a,s){var c=new bi(e,t,n,r,i,o,a,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(e){return ji.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=ji.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ji.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Bi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Bi,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Ui.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Ui.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Ui.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Ui).fromJSON(r))}return this}}),Vi.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Vi,isLight:!0,copy:function(e){return Ge.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Ge.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Hi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Hi,isHemisphereLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(zi.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),qi.prototype=Object.assign(Object.create(zi.prototype),{constructor:qi,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*m.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix())}}),Gi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Gi,isSpotLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,isPointLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Ji.prototype=Object.assign(Object.create(zi.prototype),{constructor:Ji}),Zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Zi,isDirectionalLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Yi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Yi,isAmbientLight:!0}),Xi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Xi,isRectAreaLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Vi.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Qi.prototype=Object.assign(Object.create(co.prototype),{constructor:Qi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ki.prototype=Object.assign(Object.create(co.prototype),{constructor:Ki,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign($i.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var o;n:{r:if(!(e<r)){for(var a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===a)break;if(i=r,e<(r=t[++n]))break t}o=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===a)break;if(r=i,e>=(i=t[--n-1]))break t}o=n,n=0}for(;n<o;){var c=n+o>>>1;e<t[c]?o=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,o=0;o!==r;++o)t[o]=n[i+o];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),//!\ DECLARE ALIAS AFTER assign prototype !-Object.assign($i.prototype,{beforeStart_:$i.prototype.copySampleValue_,afterEnd_:$i.prototype.copySampleValue_}),eo.prototype=Object.assign(Object.create($i.prototype),{constructor:eo,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=(n-t)/(r-t),l=s+a;s!==l;s+=4)v.slerpFlat(i,0,o,s-a,o,s,c);return i}}),to.prototype=Object.assign(Object.create(co.prototype),{constructor:to,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new eo(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),no.prototype=Object.assign(Object.create(co.prototype),{constructor:no,ValueTypeName:"color"}),ro.prototype=Object.assign(Object.create(co.prototype),{constructor:ro,ValueTypeName:"number"}),io.prototype=Object.assign(Object.create($i.prototype),{constructor:io,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,o=e+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:i=e,a=2*t-n;break;case 2402:a=t+r[i=r.length-2]-r[i+1];break;default:i=e,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=e,s=2*n-t;break;case 2402:o=1,s=n+r[1]-r[0];break;default:o=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=o*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,y=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f,_=0;_!==a;++_)i[_]=g*o[l+_]+y*o[c+_]+v*o[s+_]+b*o[u+_];return i}}),oo.prototype=Object.assign(Object.create($i.prototype),{constructor:oo,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,l=(n-t)/(r-t),u=1-l,h=0;h!==a;++h)i[h]=o[c+h]*u+o[s+h]*l;return i}}),ao.prototype=Object.assign(Object.create($i.prototype),{constructor:ao,interpolate_:function(e){return this.copySampleValue_(e-1)}});var so={arraySlice:function(e,t,n){return so.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*t,c=0;c!==t;++c)i[a++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(t.push(o.time),n.push.apply(n,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(t.push(o.time),a.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(t.push(o.time),n.push(a)),o=e[i++]}while(void 0!==o)}}};function co(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=so.convertArray(t,this.TimeBufferType),this.values=so.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function lo(e,t,n,r){co.call(this,e,t,n,r)}function uo(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=m.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function ho(e){this.manager=void 0!==e?e:hi,this.textures={}}function po(e){this.manager=void 0!==e?e:hi}Object.assign(co,{parse:function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=co._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var n=[],r=[];so.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:so.convertArray(e.times,Array),values:so.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ro;case"vector":case"vector2":case"vector3":case"vector4":return lo;case"color":return no;case"quaternion":return to;case"bool":case"boolean":return Ki;case"string":return Qi}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}}),Object.assign(co.prototype,{constructor:co,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new ao(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new oo(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new io(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)this.createInterpolant=t;else{var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",n)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<e;)++i;for(;-1!==o&&n[o]>t;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=so.arraySlice(n,i,o),this.values=so.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&so.isTypedArray(r)){a=0;for(var c=r.length;a!==c;++a){var l=r[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,o=e.length-1,a=1;a<o;++a){var s=!1,c=e[a];if(c!==e[a+1]&&(1!==a||c!==c[0]))if(r)s=!0;else for(var l=a*n,u=l-n,h=l+n,d=0;d!==n;++d){var p=t[l+d];if(p!==t[u+d]||p!==t[h+d]){s=!0;break}}if(s){if(a!==i){e[i]=e[a];var f=a*n,m=i*n;for(d=0;d!==n;++d)t[m+d]=t[f+d]}++i}}if(o>0){e[i]=e[o];for(f=o*n,m=i*n,d=0;d!==n;++d)t[m+d]=t[f+d];++i}return i!==e.length&&(this.times=so.arraySlice(e,0,i),this.values=so.arraySlice(t,0,i*n)),this}}),lo.prototype=Object.assign(Object.create(co.prototype),{constructor:lo,ValueTypeName:"vector"}),Object.assign(uo,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,o=n.length;i!==o;++i)t.push(co.parse(n[i]).scale(r));return new uo(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t},i=0,o=n.length;i!==o;++i)t.push(co.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,o=[],a=0;a<i;a++){var s=[],c=[];s.push((a+i-1)%i,a,(a+1)%i),c.push(0,1,0);var l=so.getKeyframeOrder(s);s=so.sortedArray(s,1,l),c=so.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),o.push(new ro(".morphTargetInfluences["+t[a].name+"]",s,c).scale(1/n))}return new uo(e,-1,o)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=e.length;o<a;o++){var s=e[o],c=s.name.match(i);if(c&&c.length>1){var l=r[h=c[1]];l||(r[h]=l=[]),l.push(s)}}var u=[];for(var h in r)u.push(uo.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];so.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.length||-1,a=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var d=0;d<l[h].morphTargets.length;d++)u[l[h].morphTargets[d]]=-1;for(var p in u){var f=[],m=[];for(d=0;d!==l[h].morphTargets.length;++d){var g=l[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new ro(".morphTargetInfluence["+p+"]",f,m))}o=u.length*(a||1)}else{var y=".bones["+t[c].name+"]";n(lo,y+".position",l,"pos",r),n(to,y+".quaternion",l,"rot",r),n(lo,y+".scale",l,"scl",r)}}return 0===r.length?null:new uo(i,o,r)}}),Object.assign(uo.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}this.duration=e},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),Object.assign(ho.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},setTextures:function(e){this.textures=e},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new ci[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearCoat&&(r.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(r.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(r.uniforms=e.uniforms),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalScale){var i=e.normalScale;!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new g).fromArray(i)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),r}}),Object.assign(po.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=new vt,n=e.data.index;if(void 0!==n){var r=new vo[n.type](n.array);t.setIndex(new Ke(r,1))}var i=e.data.attributes;for(var o in i){var a=i[o];r=new vo[a.type](a.array);t.addAttribute(o,new Ke(r,a.itemSize,a.normalized))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==s)for(var c=0,l=s.length;c!==l;++c){var u=s[c];t.addGroup(u.start,u.count,u.materialIndex)}var h=e.data.boundingSphere;if(void 0!==h){var d=new b;void 0!==h.center&&d.fromArray(h.center),t.boundingSphere=new Oe(d,h.radius)}return t}});var fo,mo,go,yo,vo={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function bo(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}bo.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,r=t.length;n<r;n+=2){var i=t[n],o=t[n+1];if(i.test(e))return o}return null}},Object.assign(bo.prototype,{crossOrigin:void 0,initMaterials:function(e,t,n){for(var r=[],i=0;i<e.length;++i)r[i]=this.createMaterial(e[i],t,n);return r},createMaterial:(fo={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},mo=new fe,go=new yi,yo=new ho,function(e,t,n){var r={};function i(e,i,o,a,s){var c,l=t+e,u=bo.Handlers.get(l);null!==u?c=u.load(l):(go.setCrossOrigin(n),c=go.load(l)),void 0!==i&&(c.repeat.fromArray(i),1!==i[0]&&(c.wrapS=1e3),1!==i[1]&&(c.wrapT=1e3)),void 0!==o&&c.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(c.wrapS=1e3),"mirror"===a[0]&&(c.wrapS=1002),"repeat"===a[1]&&(c.wrapT=1e3),"mirror"===a[1]&&(c.wrapT=1002)),void 0!==s&&(c.anisotropy=s);var h=m.generateUUID();return r[h]=c,h}var o={uuid:m.generateUUID(),type:"MeshLambertMaterial"};for(var a in e){var s=e[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=fo[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",a,"is no longer supported.");break;case"colorDiffuse":o.color=mo.fromArray(s).getHex();break;case"colorSpecular":o.specular=mo.fromArray(s).getHex();break;case"colorEmissive":o.emissive=mo.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=i(s,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=i(s,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=i(s,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=i(s,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=i(s,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=i(s,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=i(s,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=i(s,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=i(s,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=i(s,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=1;break;case"doubleSided":o.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=2),"face"===s&&(o.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",a,s)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),yo.setTextures(r),yo.parse(o)})});var _o=function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")};function wo(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:hi,this.withCredentials=!1}Object.assign(wo.prototype,{load:function(e,t,n,r){var i=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:_o(e),a=new pi(this.manager);a.setWithCredentials(this.withCredentials),a.load(e,(function(n){var r=JSON.parse(n),a=r.metadata;if(void 0!==a){var s=a.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=i.parse(r,o);t(c.geometry,c.materials)}),n,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var n=new Qe;return function(e,t){function n(e,t){return e&1<<t}var r,i,o,a,s,c,l,u,h,d,p,f,m,y,v,_,w,E,A,x,S,T,M,R,C,k=e.faces,I=e.vertices,P=e.normals,O=e.colors,N=e.scale,D=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&D++;for(r=0;r<D;r++)t.faceVertexUvs[r]=[]}for(a=0,s=I.length;a<s;)(E=new b).x=I[a++]*N,E.y=I[a++]*N,E.z=I[a++]*N,t.vertices.push(E);for(a=0,s=k.length;a<s;)if(p=n(d=k[a++],0),f=n(d,1),m=n(d,3),y=n(d,4),v=n(d,5),_=n(d,6),w=n(d,7),p){if((x=new Ze).a=k[a],x.b=k[a+1],x.c=k[a+3],(S=new Ze).a=k[a+1],S.b=k[a+2],S.c=k[a+3],a+=4,f&&(h=k[a++],x.materialIndex=h,S.materialIndex=h),o=t.faces.length,m)for(r=0;r<D;r++)for(R=e.uvs[r],t.faceVertexUvs[r][o]=[],t.faceVertexUvs[r][o+1]=[],i=0;i<4;i++)C=new g(R[2*(u=k[a++])],R[2*u+1]),2!==i&&t.faceVertexUvs[r][o].push(C),0!==i&&t.faceVertexUvs[r][o+1].push(C);if(y&&(l=3*k[a++],x.normal.set(P[l++],P[l++],P[l]),S.normal.copy(x.normal)),v)for(r=0;r<4;r++)l=3*k[a++],M=new b(P[l++],P[l++],P[l]),2!==r&&x.vertexNormals.push(M),0!==r&&S.vertexNormals.push(M);if(_&&(T=O[c=k[a++]],x.color.setHex(T),S.color.setHex(T)),w)for(r=0;r<4;r++)T=O[c=k[a++]],2!==r&&x.vertexColors.push(new fe(T)),0!==r&&S.vertexColors.push(new fe(T));t.faces.push(x),t.faces.push(S)}else{if((A=new Ze).a=k[a++],A.b=k[a++],A.c=k[a++],f&&(h=k[a++],A.materialIndex=h),o=t.faces.length,m)for(r=0;r<D;r++)for(R=e.uvs[r],t.faceVertexUvs[r][o]=[],i=0;i<3;i++)C=new g(R[2*(u=k[a++])],R[2*u+1]),t.faceVertexUvs[r][o].push(C);if(y&&(l=3*k[a++],A.normal.set(P[l++],P[l++],P[l])),v)for(r=0;r<3;r++)l=3*k[a++],M=new b(P[l++],P[l++],P[l]),A.vertexNormals.push(M);if(_&&(c=k[a++],A.color.setHex(O[c])),w)for(r=0;r<3;r++)c=k[a++],A.vertexColors.push(new fe(O[c]));t.faces.push(A)}}(e,n),function(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,i=e.skinWeights.length;r<i;r+=n){var o=e.skinWeights[r],a=n>1?e.skinWeights[r+1]:0,s=n>2?e.skinWeights[r+2]:0,c=n>3?e.skinWeights[r+3]:0;t.skinWeights.push(new A(o,a,s,c))}if(e.skinIndices)for(r=0,i=e.skinIndices.length;r<i;r+=n){var l=e.skinIndices[r],u=n>1?e.skinIndices[r+1]:0,h=n>2?e.skinIndices[r+2]:0,d=n>3?e.skinIndices[r+3]:0;t.skinIndices.push(new A(l,u,h,d))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}(e,n),function(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var r=0,i=e.morphTargets.length;r<i;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var o=t.morphTargets[r].vertices,a=e.morphTargets[r].vertices,s=0,c=a.length;s<c;s+=3){var l=new b;l.x=a[s]*n,l.y=a[s+1]*n,l.z=a[s+2]*n,o.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var u=t.faces,h=e.morphColors[0].colors;for(r=0,i=u.length;r<i;r++)u[r].color.fromArray(h,3*r)}}(e,n),function(e,t){var n=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var i=0;i<r.length;i++){var o=uo.parseAnimation(r[i],t.bones);o&&n.push(o)}if(t.morphTargets){var a=uo.CreateClipsFromMorphTargetSequences(t.morphTargets,10);n=n.concat(a)}n.length>0&&(t.animations=n)}(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:n}:{geometry:n,materials:bo.prototype.initMaterials(e.materials,t,this.crossOrigin)}}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this.texturePath=""}.prototype,{load:function(e,t,n,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this;new pi(i.manager).load(e,(function(n){var o=null;try{o=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,t):console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead.")}),n,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),o=this.parseTextures(e.textures,i),a=this.parseMaterials(e.materials,o),s=this.parseObject(e.object,r,a);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Bi).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new wo,i=new po,o=0,a=e.length;o<a;o++){var s,c=e[o];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Kr[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Kr[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Kr[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Kr[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Kr[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Kr[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Kr[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Kr[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Kr[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Kr[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Kr[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Kr[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":var l=[];for(o=0,a=c.shapes.length;o<a;o++){var u=t[c.shapes[o]];l.push(u)}s=new Kr[c.type](l,c.curveSegments);break;case"BufferGeometry":s=i.parse(c);break;case"Geometry":s=r.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),n[c.uuid]=s}return n},parseMaterials:function(e,t){var n={};if(void 0!==e){var r=new ho;r.setTextures(t);for(var i=0,o=e.length;i<o;i++){var a=e[i];if("MultiMaterial"===a.type){for(var s=[],c=0;c<a.materials.length;c++)s.push(r.parse(a.materials[c]));n[a.uuid]=s}else n[a.uuid]=r.parse(a)}}return n},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=uo.parse(e[n]);t.push(r)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),o.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemEnd(e),n.manager.itemError(e)}))}if(void 0!==e&&e.length>0){var o=new mi(new ui(t));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=e.length;a<s;a++){var c=e[a],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;r[c.uuid]=i(l)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,o=e.length;i<o;i++){var a=e[i];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===t[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new E(t[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=n(a.mapping,Ao)),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.center&&s.center.fromArray(a.center),void 0!==a.rotation&&(s.rotation=a.rotation),void 0!==a.wrap&&(s.wrapS=n(a.wrap[0],xo),s.wrapT=n(a.wrap[1],xo)),void 0!==a.minFilter&&(s.minFilter=n(a.minFilter,So)),void 0!==a.magFilter&&(s.magFilter=n(a.magFilter,So)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),r[a.uuid]=s}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function o(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var o=e[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),t.push(n[o])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new Sn,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new fe(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new xn(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new An(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new nn(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Je(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":r=new Xi(e.color,e.intensity);break;case"DirectionalLight":r=new Zi(e.color,e.intensity);break;case"PointLight":r=new Wi(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Yi(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new Gi(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Hi(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=i(e.geometry),s=o(e.material);r=a.bones&&a.bones.length>0?new In(a,s):new Rt(a,s);break;case"LOD":r=new Rn;break;case"Line":r=new On(i(e.geometry),o(e.material),e.mode);break;case"LineLoop":r=new Dn(i(e.geometry),o(e.material));break;case"LineSegments":r=new Nn(i(e.geometry),o(e.material));break;case"PointCloud":case"Points":r=new Fn(i(e.geometry),o(e.material));break;case"Sprite":r=new Mn(o(e.material));break;case"Group":r=new jn;break;default:r=new Ge}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.children)for(var c=e.children,l=0;l<c.length;l++)r.add(this.parseObject(c[l],t,n));if("LOD"===e.type)for(var u=e.levels,h=0;h<u.length;h++){var d=u[h],p=r.getObjectByProperty("uuid",d.object);void 0!==p&&r.addLevel(p,d.distance)}return r}});var Eo,Ao={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},xo={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},So={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};function To(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:hi,this.options=void 0}function Mo(){this.type="ShapePath",this.subPaths=[],this.currentPath=null}function Ro(e){this.type="Font",this.data=e}function Co(e,t,n,r,i,o){var a=o.glyphs[e]||o.glyphs["?"];if(a){var s,c,l,u,h,d,p,f,m=new Mo;if(a.o)for(var g=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),y=0,v=g.length;y<v;){switch(g[y++]){case"m":s=g[y++]*n+r,c=g[y++]*n+i,m.moveTo(s,c);break;case"l":s=g[y++]*n+r,c=g[y++]*n+i,m.lineTo(s,c);break;case"q":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,m.quadraticCurveTo(h,d,l,u);break;case"b":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,p=g[y++]*n+r,f=g[y++]*n+i,m.bezierCurveTo(h,d,p,f,l,u)}}return{offsetX:a.ha*n,path:m}}}To.prototype={constructor:To,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var i=this,o=li.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;fetch(e).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,i.options)})).then((function(n){li.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}))},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},Object.assign(Mo.prototype,{moveTo:function(e,t){this.currentPath=new Ui,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,r){this.currentPath.quadraticCurveTo(e,t,n,r)},bezierCurveTo:function(e,t,n,r,i,o){this.currentPath.bezierCurveTo(e,t,n,r,i,o)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],o=new Bi;o.curves=i.curves,t.push(o)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=t[i],s=t[o],c=s.x-a.x,l=s.y-a.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(a=t[o],c=-c,s=t[i],l=-l),e.y<a.y||e.y>s.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var u=l*(e.x-a.x)-c*(e.y-a.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i=Cr.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);var a,s,c,l=[];if(1===o.length)return s=o[0],(c=new Bi).curves=s.curves,l.push(c),l;var u=!i(o[0].getPoints());u=e?!u:u;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var y=0,v=o.length;y<v;y++)a=i(h=(s=o[y]).getPoints()),(a=e?!a:a)?(!u&&f[g]&&g++,f[g]={s:new Bi,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(o);if(f.length>1){for(var b=!1,_=[],w=0,E=f.length;w<E;w++)p[w]=[];for(w=0,E=f.length;w<E;w++)for(var A=m[w],x=0;x<A.length;x++){for(var S=A[x],T=!0,M=0;M<f.length;M++)r(S.p,f[M].p)&&(w!==M&&_.push({froms:w,tos:M,hole:x}),T?(T=!1,p[M].push(S)):b=!0);T&&p[w].push(S)}_.length>0&&(b||(m=p))}y=0;for(var R=f.length;y<R;y++){c=f[y].s,l.push(c);for(var C=0,k=(d=m[y]).length;C<k;C++)c.holes.push(d[C].h)}return l}}),Object.assign(Ro.prototype,{isFont:!0,generateShapes:function(e,t,n){void 0===t&&(t=100),void 0===n&&(n=4);for(var r=[],i=function(e,t,n,r){for(var i=String(e).split(""),o=t/r.resolution,a=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*o,s=[],c=0,l=0,u=0;u<i.length;u++){var h=i[u];if("\n"===h)c=0,l-=a;else{var d=Co(h,n,o,c,l,r);c+=d.offsetX,s.push(d.path)}}return s}(e,t,n,this.data),o=0,a=i.length;o<a;o++)Array.prototype.push.apply(r,i[o].toShapes());return r}}),Object.assign(function(e){this.manager=void 0!==e?e:hi}.prototype,{load:function(e,t,n,r){var i=this,o=new pi(this.manager);o.setPath(this.path),o.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new Ro(e)},setPath:function(e){return this.path=e,this}});var ko,Io,Po,Oo,No,Do,Lo,Fo,jo,Uo,Bo=function(){return void 0===Eo&&(Eo=new(window.AudioContext||window.webkitAudioContext)),Eo};function Vo(e){this.manager=void 0!==e?e:hi}function Ho(e,t,n){Ge.call(this),this.type="CubeCamera";var r=new nn(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new b(1,0,0)),this.add(r);var i=new nn(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new b(-1,0,0)),this.add(i);var o=new nn(90,1,e,t);o.up.set(0,0,1),o.lookAt(new b(0,1,0)),this.add(o);var a=new nn(90,1,e,t);a.up.set(0,0,-1),a.lookAt(new b(0,-1,0)),this.add(a);var s=new nn(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new b(0,0,1)),this.add(s);var c=new nn(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new b(0,0,-1)),this.add(c);var l={format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new S(n,n,l),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,l=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,r,n),n.activeCubeFace=1,e.render(t,i,n),n.activeCubeFace=2,e.render(t,o,n),n.activeCubeFace=3,e.render(t,a,n),n.activeCubeFace=4,e.render(t,s,n),n.texture.generateMipmaps=l,n.activeCubeFace=5,e.render(t,c,n),e.setRenderTarget(null)},this.clear=function(e,t,n,r){for(var i=this.renderTarget,o=0;o<6;o++)i.activeCubeFace=o,e.setRenderTarget(i),e.clear(t,n,r);e.setRenderTarget(null)}}function zo(){Ge.call(this),this.type="AudioListener",this.context=Bo(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function qo(e){Ge.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Go(e){qo.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Wo(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Jo(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Vo.prototype,{load:function(e,t,n,r){var i=new pi(this.manager);i.setResponseType("arraybuffer"),i.load(e,(function(e){Bo().decodeAudioData(e,(function(e){t(e)}))}),n,r)}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(jo=new y,Uo=new y,function(e){if(ko!==this||Io!==e.focus||Po!==e.fov||Oo!==e.aspect*this.aspect||No!==e.near||Do!==e.far||Lo!==e.zoom||Fo!==this.eyeSep){ko=this,Io=e.focus,Po=e.fov,Oo=e.aspect*this.aspect,No=e.near,Do=e.far,Lo=e.zoom;var t,n,r=e.projectionMatrix.clone(),i=(Fo=this.eyeSep/2)*No/Io,o=No*Math.tan(m.DEG2RAD*Po*.5)/Lo;Uo.elements[12]=-Fo,jo.elements[12]=Fo,t=-o*Oo+i,n=o*Oo+i,r.elements[0]=2*No/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraL.projectionMatrix.copy(r),t=-o*Oo-i,n=o*Oo-i,r.elements[0]=2*No/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Uo),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(jo)})}),Ho.prototype=Object.create(Ge.prototype),Ho.prototype.constructor=Ho,zo.prototype=Object.assign(Object.create(Ge.prototype),{constructor:zo,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(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)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new b,t=new v,n=new b,r=new b;return function(i){Ge.prototype.updateMatrixWorld.call(this,i);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(e,t,n),r.set(0,0,-1).applyQuaternion(t),o.positionX?(o.positionX.setValueAtTime(e.x,this.context.currentTime),o.positionY.setValueAtTime(e.y,this.context.currentTime),o.positionZ.setValueAtTime(e.z,this.context.currentTime),o.forwardX.setValueAtTime(r.x,this.context.currentTime),o.forwardY.setValueAtTime(r.y,this.context.currentTime),o.forwardZ.setValueAtTime(r.z,this.context.currentTime),o.upX.setValueAtTime(a.x,this.context.currentTime),o.upY.setValueAtTime(a.y,this.context.currentTime),o.upZ.setValueAtTime(a.z,this.context.currentTime)):(o.setPosition(e.x,e.y,e.z),o.setOrientation(r.x,r.y,r.z,a.x,a.y,a.z))}}()}),qo.prototype=Object.assign(Object.create(Ge.prototype),{constructor:qo,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),Go.prototype=Object.assign(Object.create(qo.prototype),{constructor:Go,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new b;return function(t){Ge.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(Wo.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Jo.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=t}else{var s=t/(o+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,i<1){var a=3*t;this._mixBufferRegion(n,r,a,1-i,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){v.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}}});var Zo,Xo,Yo,Qo,Ko,$o,ea,ta,na,ra,ia,oa;function aa(e,t,n){var r=n||sa.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function sa(e,t,n){this.path=t,this.parsedPath=n||sa.parseTrackName(t),this.node=sa.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function ca(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,o=new Array(i),a={endingStart:2400,endingEnd:2400},s=0;s!==i;++s){var c=r[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}function la(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ua(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function ha(){vt.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function da(e,t,n,r){this.uuid=m.generateUUID(),this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function pa(e,t){this.uuid=m.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function fa(e,t,n){pa.call(this,e,t),this.meshPerAttribute=n||1}function ma(e,t,n){Ke.call(this,e,t),this.meshPerAttribute=n||1}function ga(e,t){return e.distance-t.distance}function ya(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,o=0,a=i.length;o<a;o++)ya(i[o],t,n,!0)}function va(e,t){this.min=void 0!==e?e:new g(1/0,1/0),this.max=void 0!==t?t:new g(-1/0,-1/0)}function ba(e){Ge.call(this),this.material=e,this.render=function(){}}function _a(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16711680,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new vt,l=new at(2*a*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function wa(e,t){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new vt,r=[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],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;r.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new at(r,3));var c=new Pn({fog:!1});this.cone=new Nn(n,c),this.add(this.cone),this.update()}function Ea(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new vt,r=[],i=[],o=new fe(0,0,1),a=new fe(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.addAttribute("position",new at(r,3)),n.addAttribute("color",new at(i,3));var l=new Pn({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Nn.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Aa(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Fr(t,4,2),i=new At({wireframe:!0,fog:!1});Rt.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function xa(e,t){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var n=new Pn({fog:!1}),r=new vt;r.addAttribute("position",new Ke(new Float32Array(15),3)),this.line=new On(r,n),this.add(this.line),this.update()}function Sa(e,t,n){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Yn(t);r.rotateY(.5*Math.PI),this.material=new At({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.addAttribute("color",new Ke(o,3)),this.add(new Rt(r,this.material)),this.update()}function Ta(e,t,n,r){e=e||10,t=t||10,n=new fe(void 0!==n?n:4473924),r=new fe(void 0!==r?r:8947848);for(var i=t/2,o=e/t,a=e/2,s=[],c=[],l=0,u=0,h=-a;l<=t;l++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var d=l===i?n:r;d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3}var p=new vt;p.addAttribute("position",new at(s,3)),p.addAttribute("color",new at(c,3));var f=new Pn({vertexColors:2});Nn.call(this,p,f)}function Ma(e,t,n,r,i,o){e=e||10,t=t||16,n=n||8,r=r||64,i=new fe(void 0!==i?i:4473924),o=new fe(void 0!==o?o:8947848);var a,s,c,l,u,h,d,p=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),a=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(a,0,s),d=1&l?i:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(l=0;l<=n;l++)for(d=1&l?i:o,h=e-e/n*l,u=0;u<r;u++)c=u/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,p.push(a,0,s),f.push(d.r,d.g,d.b),c=(u+1)/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,p.push(a,0,s),f.push(d.r,d.g,d.b);var m=new vt;m.addAttribute("position",new at(p,3)),m.addAttribute("color",new at(f,3));var g=new Pn({vertexColors:2});Nn.call(this,m,g)}function Ra(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16776960,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new vt,l=new at(2*a*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Ca(e,t,n){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new vt;r.addAttribute("position",new at([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Pn({fog:!1});this.lightPlane=new On(r,i),this.add(this.lightPlane),(r=new vt).addAttribute("position",new at([0,0,0,0,0,1],3)),this.targetLine=new On(r,i),this.add(this.targetLine),this.update()}function ka(e){var t=new vt,n=new Pn({color:16777215,vertexColors:1}),r=[],i=[],o={},a=new fe(16755200),s=new fe(16711680),c=new fe(43775),l=new fe(16777215),u=new fe(3355443);function h(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(r.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.addAttribute("position",new at(r,3)),t.addAttribute("color",new at(i,3)),Nn.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Ia(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new vt;i.setIndex(new Ke(n,1)),i.addAttribute("position",new Ke(r,3)),Nn.call(this,i,new Pn({color:t})),this.matrixAutoUpdate=!1,this.update()}function Pa(e,t){this.type="Box3Helper",this.box=e;var n=void 0!==t?t:16776960,r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new vt;i.setIndex(new Ke(r,1)),i.addAttribute("position",new at([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Nn.call(this,i,new Pn({color:n})),this.geometry.computeBoundingSphere()}function Oa(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new vt;i.addAttribute("position",new at([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),On.call(this,i,new Pn({color:r}));var o=new vt;o.addAttribute("position",new at([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Rt(o,new At({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function Na(e,t,n,r,i,o){Ge.call(this),void 0===r&&(r=16776960),void 0===n&&(n=1),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===na&&((na=new vt).addAttribute("position",new at([0,0,0,0,1,0],3)),(ra=new Jr(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new On(na,new Pn({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Rt(ra,new At({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,o)}function Da(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new vt;n.addAttribute("position",new at(t,3)),n.addAttribute("color",new at([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Pn({vertexColors:2});Nn.call(this,n,r)}Object.assign(aa.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(sa,{Composite:aa,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new sa.Composite(e,t,n):new sa(e,t,n)},sanitizeNodeName:(ta=new RegExp("[\\[\\]\\.:\\/]","g"),function(e){return e.replace(/\s/g,"_").replace(ta,"")}),parseTrackName:(Zo="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Xo=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Yo=/(WCOD+)?/.source.replace("WCOD",Zo),Qo=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ko=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),$o=new RegExp("^"+Xo+Yo+Qo+Ko+"$"),ea=["material","materials","bones"],function(e){var t=$o.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==ea.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var o=r(i.children);if(o)return o}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(sa.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=sa.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var o=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var a=0;a<e.length;a++)if(e[a].name===o){o=a;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==o){if(void 0===e[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[o]}}var s=e[r];if(void 0!==s){var c=this.Versioning.None;void 0!==e.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(e.geometry.morphAttributes.position[a].name===i){i=a;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(e.geometry.morphTargets[a].name===i){i=a;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),+Object.assign($i.prototype,{beforeStart_:$i.prototype.copySampleValue_,afterEnd_:$i.prototype.copySampleValue_}),eo.prototype=Object.assign(Object.create($i.prototype),{constructor:eo,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=(n-t)/(r-t),l=s+a;s!==l;s+=4)v.slerpFlat(i,0,o,s-a,o,s,c);return i}}),to.prototype=Object.assign(Object.create(co.prototype),{constructor:to,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new eo(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),no.prototype=Object.assign(Object.create(co.prototype),{constructor:no,ValueTypeName:"color"}),ro.prototype=Object.assign(Object.create(co.prototype),{constructor:ro,ValueTypeName:"number"}),io.prototype=Object.assign(Object.create($i.prototype),{constructor:io,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,o=e+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:i=e,a=2*t-n;break;case 2402:a=t+r[i=r.length-2]-r[i+1];break;default:i=e,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=e,s=2*n-t;break;case 2402:o=1,s=n+r[1]-r[0];break;default:o=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=o*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,y=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f,_=0;_!==a;++_)i[_]=g*o[l+_]+y*o[c+_]+v*o[s+_]+b*o[u+_];return i}}),oo.prototype=Object.assign(Object.create($i.prototype),{constructor:oo,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,l=(n-t)/(r-t),u=1-l,h=0;h!==a;++h)i[h]=o[c+h]*u+o[s+h]*l;return i}}),ao.prototype=Object.assign(Object.create($i.prototype),{constructor:ao,interpolate_:function(e){return this.copySampleValue_(e-1)}});var so={arraySlice:function(e,t,n){return so.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*t,c=0;c!==t;++c)i[a++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(t.push(o.time),n.push.apply(n,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(t.push(o.time),a.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(t.push(o.time),n.push(a)),o=e[i++]}while(void 0!==o)}}};function co(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=so.convertArray(t,this.TimeBufferType),this.values=so.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function lo(e,t,n,r){co.call(this,e,t,n,r)}function uo(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=m.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function ho(e){this.manager=void 0!==e?e:hi,this.textures={}}function po(e){this.manager=void 0!==e?e:hi}Object.assign(co,{parse:function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=co._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var n=[],r=[];so.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:so.convertArray(e.times,Array),values:so.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ro;case"vector":case"vector2":case"vector3":case"vector4":return lo;case"color":return no;case"quaternion":return to;case"bool":case"boolean":return Ki;case"string":return Qi}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}}),Object.assign(co.prototype,{constructor:co,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new ao(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new oo(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new io(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)this.createInterpolant=t;else{var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",n)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<e;)++i;for(;-1!==o&&n[o]>t;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=so.arraySlice(n,i,o),this.values=so.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&so.isTypedArray(r)){a=0;for(var c=r.length;a!==c;++a){var l=r[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,o=e.length-1,a=1;a<o;++a){var s=!1,c=e[a];if(c!==e[a+1]&&(1!==a||c!==c[0]))if(r)s=!0;else for(var l=a*n,u=l-n,h=l+n,d=0;d!==n;++d){var p=t[l+d];if(p!==t[u+d]||p!==t[h+d]){s=!0;break}}if(s){if(a!==i){e[i]=e[a];var f=a*n,m=i*n;for(d=0;d!==n;++d)t[m+d]=t[f+d]}++i}}if(o>0){e[i]=e[o];for(f=o*n,m=i*n,d=0;d!==n;++d)t[m+d]=t[f+d];++i}return i!==e.length&&(this.times=so.arraySlice(e,0,i),this.values=so.arraySlice(t,0,i*n)),this}}),lo.prototype=Object.assign(Object.create(co.prototype),{constructor:lo,ValueTypeName:"vector"}),Object.assign(uo,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,o=n.length;i!==o;++i)t.push(co.parse(n[i]).scale(r));return new uo(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t},i=0,o=n.length;i!==o;++i)t.push(co.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,o=[],a=0;a<i;a++){var s=[],c=[];s.push((a+i-1)%i,a,(a+1)%i),c.push(0,1,0);var l=so.getKeyframeOrder(s);s=so.sortedArray(s,1,l),c=so.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),o.push(new ro(".morphTargetInfluences["+t[a].name+"]",s,c).scale(1/n))}return new uo(e,-1,o)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=e.length;o<a;o++){var s=e[o],c=s.name.match(i);if(c&&c.length>1){var l=r[h=c[1]];l||(r[h]=l=[]),l.push(s)}}var u=[];for(var h in r)u.push(uo.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];so.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.length||-1,a=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var d=0;d<l[h].morphTargets.length;d++)u[l[h].morphTargets[d]]=-1;for(var p in u){var f=[],m=[];for(d=0;d!==l[h].morphTargets.length;++d){var g=l[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new ro(".morphTargetInfluence["+p+"]",f,m))}o=u.length*(a||1)}else{var y=".bones["+t[c].name+"]";n(lo,y+".position",l,"pos",r),n(to,y+".quaternion",l,"rot",r),n(lo,y+".scale",l,"scl",r)}}return 0===r.length?null:new uo(i,o,r)}}),Object.assign(uo.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}this.duration=e},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),Object.assign(ho.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},setTextures:function(e){this.textures=e},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new ci[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearCoat&&(r.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(r.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(r.uniforms=e.uniforms),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalScale){var i=e.normalScale;!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new g).fromArray(i)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),r}}),Object.assign(po.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=new vt,n=e.data.index;if(void 0!==n){var r=new vo[n.type](n.array);t.setIndex(new Ke(r,1))}var i=e.data.attributes;for(var o in i){var a=i[o];r=new vo[a.type](a.array);t.addAttribute(o,new Ke(r,a.itemSize,a.normalized))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==s)for(var c=0,l=s.length;c!==l;++c){var u=s[c];t.addGroup(u.start,u.count,u.materialIndex)}var h=e.data.boundingSphere;if(void 0!==h){var d=new b;void 0!==h.center&&d.fromArray(h.center),t.boundingSphere=new Oe(d,h.radius)}return t}});var fo,mo,go,yo,vo={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function bo(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}bo.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,r=t.length;n<r;n+=2){var i=t[n],o=t[n+1];if(i.test(e))return o}return null}},Object.assign(bo.prototype,{crossOrigin:void 0,initMaterials:function(e,t,n){for(var r=[],i=0;i<e.length;++i)r[i]=this.createMaterial(e[i],t,n);return r},createMaterial:(fo={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},mo=new fe,go=new yi,yo=new ho,function(e,t,n){var r={};function i(e,i,o,a,s){var c,l=t+e,u=bo.Handlers.get(l);null!==u?c=u.load(l):(go.setCrossOrigin(n),c=go.load(l)),void 0!==i&&(c.repeat.fromArray(i),1!==i[0]&&(c.wrapS=1e3),1!==i[1]&&(c.wrapT=1e3)),void 0!==o&&c.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(c.wrapS=1e3),"mirror"===a[0]&&(c.wrapS=1002),"repeat"===a[1]&&(c.wrapT=1e3),"mirror"===a[1]&&(c.wrapT=1002)),void 0!==s&&(c.anisotropy=s);var h=m.generateUUID();return r[h]=c,h}var o={uuid:m.generateUUID(),type:"MeshLambertMaterial"};for(var a in e){var s=e[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=fo[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",a,"is no longer supported.");break;case"colorDiffuse":o.color=mo.fromArray(s).getHex();break;case"colorSpecular":o.specular=mo.fromArray(s).getHex();break;case"colorEmissive":o.emissive=mo.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=i(s,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=i(s,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=i(s,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=i(s,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=i(s,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=i(s,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=i(s,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=i(s,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=i(s,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=i(s,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=1;break;case"doubleSided":o.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=2),"face"===s&&(o.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",a,s)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),yo.setTextures(r),yo.parse(o)})});var _o=function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")};function wo(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:hi,this.withCredentials=!1}Object.assign(wo.prototype,{load:function(e,t,n,r){var i=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:_o(e),a=new pi(this.manager);a.setWithCredentials(this.withCredentials),a.load(e,(function(n){var r=JSON.parse(n),a=r.metadata;if(void 0!==a){var s=a.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=i.parse(r,o);t(c.geometry,c.materials)}),n,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var n=new Qe;return function(e,t){function n(e,t){return e&1<<t}var r,i,o,a,s,c,l,u,h,d,p,f,m,y,v,_,w,E,A,x,S,T,M,R,C,k=e.faces,I=e.vertices,P=e.normals,O=e.colors,N=e.scale,D=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&D++;for(r=0;r<D;r++)t.faceVertexUvs[r]=[]}for(a=0,s=I.length;a<s;)(E=new b).x=I[a++]*N,E.y=I[a++]*N,E.z=I[a++]*N,t.vertices.push(E);for(a=0,s=k.length;a<s;)if(p=n(d=k[a++],0),f=n(d,1),m=n(d,3),y=n(d,4),v=n(d,5),_=n(d,6),w=n(d,7),p){if((x=new Ze).a=k[a],x.b=k[a+1],x.c=k[a+3],(S=new Ze).a=k[a+1],S.b=k[a+2],S.c=k[a+3],a+=4,f&&(h=k[a++],x.materialIndex=h,S.materialIndex=h),o=t.faces.length,m)for(r=0;r<D;r++)for(R=e.uvs[r],t.faceVertexUvs[r][o]=[],t.faceVertexUvs[r][o+1]=[],i=0;i<4;i++)C=new g(R[2*(u=k[a++])],R[2*u+1]),2!==i&&t.faceVertexUvs[r][o].push(C),0!==i&&t.faceVertexUvs[r][o+1].push(C);if(y&&(l=3*k[a++],x.normal.set(P[l++],P[l++],P[l]),S.normal.copy(x.normal)),v)for(r=0;r<4;r++)l=3*k[a++],M=new b(P[l++],P[l++],P[l]),2!==r&&x.vertexNormals.push(M),0!==r&&S.vertexNormals.push(M);if(_&&(T=O[c=k[a++]],x.color.setHex(T),S.color.setHex(T)),w)for(r=0;r<4;r++)T=O[c=k[a++]],2!==r&&x.vertexColors.push(new fe(T)),0!==r&&S.vertexColors.push(new fe(T));t.faces.push(x),t.faces.push(S)}else{if((A=new Ze).a=k[a++],A.b=k[a++],A.c=k[a++],f&&(h=k[a++],A.materialIndex=h),o=t.faces.length,m)for(r=0;r<D;r++)for(R=e.uvs[r],t.faceVertexUvs[r][o]=[],i=0;i<3;i++)C=new g(R[2*(u=k[a++])],R[2*u+1]),t.faceVertexUvs[r][o].push(C);if(y&&(l=3*k[a++],A.normal.set(P[l++],P[l++],P[l])),v)for(r=0;r<3;r++)l=3*k[a++],M=new b(P[l++],P[l++],P[l]),A.vertexNormals.push(M);if(_&&(c=k[a++],A.color.setHex(O[c])),w)for(r=0;r<3;r++)c=k[a++],A.vertexColors.push(new fe(O[c]));t.faces.push(A)}}(e,n),function(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,i=e.skinWeights.length;r<i;r+=n){var o=e.skinWeights[r],a=n>1?e.skinWeights[r+1]:0,s=n>2?e.skinWeights[r+2]:0,c=n>3?e.skinWeights[r+3]:0;t.skinWeights.push(new A(o,a,s,c))}if(e.skinIndices)for(r=0,i=e.skinIndices.length;r<i;r+=n){var l=e.skinIndices[r],u=n>1?e.skinIndices[r+1]:0,h=n>2?e.skinIndices[r+2]:0,d=n>3?e.skinIndices[r+3]:0;t.skinIndices.push(new A(l,u,h,d))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}(e,n),function(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var r=0,i=e.morphTargets.length;r<i;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var o=t.morphTargets[r].vertices,a=e.morphTargets[r].vertices,s=0,c=a.length;s<c;s+=3){var l=new b;l.x=a[s]*n,l.y=a[s+1]*n,l.z=a[s+2]*n,o.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var u=t.faces,h=e.morphColors[0].colors;for(r=0,i=u.length;r<i;r++)u[r].color.fromArray(h,3*r)}}(e,n),function(e,t){var n=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var i=0;i<r.length;i++){var o=uo.parseAnimation(r[i],t.bones);o&&n.push(o)}if(t.morphTargets){var a=uo.CreateClipsFromMorphTargetSequences(t.morphTargets,10);n=n.concat(a)}n.length>0&&(t.animations=n)}(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:n}:{geometry:n,materials:bo.prototype.initMaterials(e.materials,t,this.crossOrigin)}}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this.texturePath=""}.prototype,{load:function(e,t,n,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this;new pi(i.manager).load(e,(function(n){var o=null;try{o=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,t):console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead.")}),n,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),o=this.parseTextures(e.textures,i),a=this.parseMaterials(e.materials,o),s=this.parseObject(e.object,r,a);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Bi).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new wo,i=new po,o=0,a=e.length;o<a;o++){var s,c=e[o];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Kr[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Kr[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Kr[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Kr[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Kr[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Kr[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Kr[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Kr[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Kr[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Kr[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Kr[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Kr[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":var l=[];for(o=0,a=c.shapes.length;o<a;o++){var u=t[c.shapes[o]];l.push(u)}s=new Kr[c.type](l,c.curveSegments);break;case"BufferGeometry":s=i.parse(c);break;case"Geometry":s=r.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),n[c.uuid]=s}return n},parseMaterials:function(e,t){var n={};if(void 0!==e){var r=new ho;r.setTextures(t);for(var i=0,o=e.length;i<o;i++){var a=e[i];if("MultiMaterial"===a.type){for(var s=[],c=0;c<a.materials.length;c++)s.push(r.parse(a.materials[c]));n[a.uuid]=s}else n[a.uuid]=r.parse(a)}}return n},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=uo.parse(e[n]);t.push(r)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),o.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemEnd(e),n.manager.itemError(e)}))}if(void 0!==e&&e.length>0){var o=new mi(new ui(t));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=e.length;a<s;a++){var c=e[a],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;r[c.uuid]=i(l)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,o=e.length;i<o;i++){var a=e[i];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===t[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new E(t[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=n(a.mapping,Ao)),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.center&&s.center.fromArray(a.center),void 0!==a.rotation&&(s.rotation=a.rotation),void 0!==a.wrap&&(s.wrapS=n(a.wrap[0],xo),s.wrapT=n(a.wrap[1],xo)),void 0!==a.minFilter&&(s.minFilter=n(a.minFilter,So)),void 0!==a.magFilter&&(s.magFilter=n(a.magFilter,So)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),r[a.uuid]=s}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function o(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var o=e[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),t.push(n[o])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new Sn,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new fe(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new xn(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new An(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new nn(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Je(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":r=new Yi(e.color,e.intensity);break;case"DirectionalLight":r=new Zi(e.color,e.intensity);break;case"PointLight":r=new Wi(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Xi(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new Gi(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Hi(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=i(e.geometry),s=o(e.material);r=a.bones&&a.bones.length>0?new In(a,s):new Rt(a,s);break;case"LOD":r=new Rn;break;case"Line":r=new On(i(e.geometry),o(e.material),e.mode);break;case"LineLoop":r=new Dn(i(e.geometry),o(e.material));break;case"LineSegments":r=new Nn(i(e.geometry),o(e.material));break;case"PointCloud":case"Points":r=new Fn(i(e.geometry),o(e.material));break;case"Sprite":r=new Mn(o(e.material));break;case"Group":r=new jn;break;default:r=new Ge}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.children)for(var c=e.children,l=0;l<c.length;l++)r.add(this.parseObject(c[l],t,n));if("LOD"===e.type)for(var u=e.levels,h=0;h<u.length;h++){var d=u[h],p=r.getObjectByProperty("uuid",d.object);void 0!==p&&r.addLevel(p,d.distance)}return r}});var Eo,Ao={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},xo={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},So={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};function To(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:hi,this.options=void 0}function Mo(){this.type="ShapePath",this.subPaths=[],this.currentPath=null}function Ro(e){this.type="Font",this.data=e}function Co(e,t,n,r,i,o){var a=o.glyphs[e]||o.glyphs["?"];if(a){var s,c,l,u,h,d,p,f,m=new Mo;if(a.o)for(var g=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),y=0,v=g.length;y<v;){switch(g[y++]){case"m":s=g[y++]*n+r,c=g[y++]*n+i,m.moveTo(s,c);break;case"l":s=g[y++]*n+r,c=g[y++]*n+i,m.lineTo(s,c);break;case"q":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,m.quadraticCurveTo(h,d,l,u);break;case"b":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,p=g[y++]*n+r,f=g[y++]*n+i,m.bezierCurveTo(h,d,p,f,l,u)}}return{offsetX:a.ha*n,path:m}}}To.prototype={constructor:To,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var i=this,o=li.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;fetch(e).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,i.options)})).then((function(n){li.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}))},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},Object.assign(Mo.prototype,{moveTo:function(e,t){this.currentPath=new Ui,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,r){this.currentPath.quadraticCurveTo(e,t,n,r)},bezierCurveTo:function(e,t,n,r,i,o){this.currentPath.bezierCurveTo(e,t,n,r,i,o)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],o=new Bi;o.curves=i.curves,t.push(o)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=t[i],s=t[o],c=s.x-a.x,l=s.y-a.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(a=t[o],c=-c,s=t[i],l=-l),e.y<a.y||e.y>s.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var u=l*(e.x-a.x)-c*(e.y-a.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i=Cr.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);var a,s,c,l=[];if(1===o.length)return s=o[0],(c=new Bi).curves=s.curves,l.push(c),l;var u=!i(o[0].getPoints());u=e?!u:u;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var y=0,v=o.length;y<v;y++)a=i(h=(s=o[y]).getPoints()),(a=e?!a:a)?(!u&&f[g]&&g++,f[g]={s:new Bi,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(o);if(f.length>1){for(var b=!1,_=[],w=0,E=f.length;w<E;w++)p[w]=[];for(w=0,E=f.length;w<E;w++)for(var A=m[w],x=0;x<A.length;x++){for(var S=A[x],T=!0,M=0;M<f.length;M++)r(S.p,f[M].p)&&(w!==M&&_.push({froms:w,tos:M,hole:x}),T?(T=!1,p[M].push(S)):b=!0);T&&p[w].push(S)}_.length>0&&(b||(m=p))}y=0;for(var R=f.length;y<R;y++){c=f[y].s,l.push(c);for(var C=0,k=(d=m[y]).length;C<k;C++)c.holes.push(d[C].h)}return l}}),Object.assign(Ro.prototype,{isFont:!0,generateShapes:function(e,t,n){void 0===t&&(t=100),void 0===n&&(n=4);for(var r=[],i=function(e,t,n,r){for(var i=String(e).split(""),o=t/r.resolution,a=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*o,s=[],c=0,l=0,u=0;u<i.length;u++){var h=i[u];if("\n"===h)c=0,l-=a;else{var d=Co(h,n,o,c,l,r);c+=d.offsetX,s.push(d.path)}}return s}(e,t,n,this.data),o=0,a=i.length;o<a;o++)Array.prototype.push.apply(r,i[o].toShapes());return r}}),Object.assign(function(e){this.manager=void 0!==e?e:hi}.prototype,{load:function(e,t,n,r){var i=this,o=new pi(this.manager);o.setPath(this.path),o.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new Ro(e)},setPath:function(e){return this.path=e,this}});var ko,Io,Po,Oo,No,Do,Lo,Fo,jo,Uo,Bo=function(){return void 0===Eo&&(Eo=new(window.AudioContext||window.webkitAudioContext)),Eo};function Vo(e){this.manager=void 0!==e?e:hi}function Ho(e,t,n){Ge.call(this),this.type="CubeCamera";var r=new nn(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new b(1,0,0)),this.add(r);var i=new nn(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new b(-1,0,0)),this.add(i);var o=new nn(90,1,e,t);o.up.set(0,0,1),o.lookAt(new b(0,1,0)),this.add(o);var a=new nn(90,1,e,t);a.up.set(0,0,-1),a.lookAt(new b(0,-1,0)),this.add(a);var s=new nn(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new b(0,0,1)),this.add(s);var c=new nn(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new b(0,0,-1)),this.add(c);var l={format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new S(n,n,l),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,l=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,r,n),n.activeCubeFace=1,e.render(t,i,n),n.activeCubeFace=2,e.render(t,o,n),n.activeCubeFace=3,e.render(t,a,n),n.activeCubeFace=4,e.render(t,s,n),n.texture.generateMipmaps=l,n.activeCubeFace=5,e.render(t,c,n),e.setRenderTarget(null)},this.clear=function(e,t,n,r){for(var i=this.renderTarget,o=0;o<6;o++)i.activeCubeFace=o,e.setRenderTarget(i),e.clear(t,n,r);e.setRenderTarget(null)}}function zo(){Ge.call(this),this.type="AudioListener",this.context=Bo(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function qo(e){Ge.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Go(e){qo.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Wo(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Jo(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Vo.prototype,{load:function(e,t,n,r){var i=new pi(this.manager);i.setResponseType("arraybuffer"),i.load(e,(function(e){Bo().decodeAudioData(e,(function(e){t(e)}))}),n,r)}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(jo=new y,Uo=new y,function(e){if(ko!==this||Io!==e.focus||Po!==e.fov||Oo!==e.aspect*this.aspect||No!==e.near||Do!==e.far||Lo!==e.zoom||Fo!==this.eyeSep){ko=this,Io=e.focus,Po=e.fov,Oo=e.aspect*this.aspect,No=e.near,Do=e.far,Lo=e.zoom;var t,n,r=e.projectionMatrix.clone(),i=(Fo=this.eyeSep/2)*No/Io,o=No*Math.tan(m.DEG2RAD*Po*.5)/Lo;Uo.elements[12]=-Fo,jo.elements[12]=Fo,t=-o*Oo+i,n=o*Oo+i,r.elements[0]=2*No/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraL.projectionMatrix.copy(r),t=-o*Oo-i,n=o*Oo-i,r.elements[0]=2*No/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Uo),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(jo)})}),Ho.prototype=Object.create(Ge.prototype),Ho.prototype.constructor=Ho,zo.prototype=Object.assign(Object.create(Ge.prototype),{constructor:zo,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(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)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new b,t=new v,n=new b,r=new b;return function(i){Ge.prototype.updateMatrixWorld.call(this,i);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(e,t,n),r.set(0,0,-1).applyQuaternion(t),o.positionX?(o.positionX.setValueAtTime(e.x,this.context.currentTime),o.positionY.setValueAtTime(e.y,this.context.currentTime),o.positionZ.setValueAtTime(e.z,this.context.currentTime),o.forwardX.setValueAtTime(r.x,this.context.currentTime),o.forwardY.setValueAtTime(r.y,this.context.currentTime),o.forwardZ.setValueAtTime(r.z,this.context.currentTime),o.upX.setValueAtTime(a.x,this.context.currentTime),o.upY.setValueAtTime(a.y,this.context.currentTime),o.upZ.setValueAtTime(a.z,this.context.currentTime)):(o.setPosition(e.x,e.y,e.z),o.setOrientation(r.x,r.y,r.z,a.x,a.y,a.z))}}()}),qo.prototype=Object.assign(Object.create(Ge.prototype),{constructor:qo,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),Go.prototype=Object.assign(Object.create(qo.prototype),{constructor:Go,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new b;return function(t){Ge.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(Wo.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Jo.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=t}else{var s=t/(o+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,i<1){var a=3*t;this._mixBufferRegion(n,r,a,1-i,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){v.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}}});var Zo,Yo,Xo,Qo,Ko,$o,ea,ta,na,ra,ia,oa;function aa(e,t,n){var r=n||sa.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function sa(e,t,n){this.path=t,this.parsedPath=n||sa.parseTrackName(t),this.node=sa.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function ca(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,o=new Array(i),a={endingStart:2400,endingEnd:2400},s=0;s!==i;++s){var c=r[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}function la(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ua(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function ha(){vt.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function da(e,t,n,r){this.uuid=m.generateUUID(),this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function pa(e,t){this.uuid=m.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function fa(e,t,n){pa.call(this,e,t),this.meshPerAttribute=n||1}function ma(e,t,n){Ke.call(this,e,t),this.meshPerAttribute=n||1}function ga(e,t){return e.distance-t.distance}function ya(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,o=0,a=i.length;o<a;o++)ya(i[o],t,n,!0)}function va(e,t){this.min=void 0!==e?e:new g(1/0,1/0),this.max=void 0!==t?t:new g(-1/0,-1/0)}function ba(e){Ge.call(this),this.material=e,this.render=function(){}}function _a(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16711680,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new vt,l=new at(2*a*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function wa(e,t){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new vt,r=[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],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;r.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new at(r,3));var c=new Pn({fog:!1});this.cone=new Nn(n,c),this.add(this.cone),this.update()}function Ea(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new vt,r=[],i=[],o=new fe(0,0,1),a=new fe(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.addAttribute("position",new at(r,3)),n.addAttribute("color",new at(i,3));var l=new Pn({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Nn.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Aa(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Fr(t,4,2),i=new At({wireframe:!0,fog:!1});Rt.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function xa(e,t){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var n=new Pn({fog:!1}),r=new vt;r.addAttribute("position",new Ke(new Float32Array(15),3)),this.line=new On(r,n),this.add(this.line),this.update()}function Sa(e,t,n){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Xn(t);r.rotateY(.5*Math.PI),this.material=new At({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.addAttribute("color",new Ke(o,3)),this.add(new Rt(r,this.material)),this.update()}function Ta(e,t,n,r){e=e||10,t=t||10,n=new fe(void 0!==n?n:4473924),r=new fe(void 0!==r?r:8947848);for(var i=t/2,o=e/t,a=e/2,s=[],c=[],l=0,u=0,h=-a;l<=t;l++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var d=l===i?n:r;d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3}var p=new vt;p.addAttribute("position",new at(s,3)),p.addAttribute("color",new at(c,3));var f=new Pn({vertexColors:2});Nn.call(this,p,f)}function Ma(e,t,n,r,i,o){e=e||10,t=t||16,n=n||8,r=r||64,i=new fe(void 0!==i?i:4473924),o=new fe(void 0!==o?o:8947848);var a,s,c,l,u,h,d,p=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),a=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(a,0,s),d=1&l?i:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(l=0;l<=n;l++)for(d=1&l?i:o,h=e-e/n*l,u=0;u<r;u++)c=u/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,p.push(a,0,s),f.push(d.r,d.g,d.b),c=(u+1)/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,p.push(a,0,s),f.push(d.r,d.g,d.b);var m=new vt;m.addAttribute("position",new at(p,3)),m.addAttribute("color",new at(f,3));var g=new Pn({vertexColors:2});Nn.call(this,m,g)}function Ra(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16776960,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new vt,l=new at(2*a*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Ca(e,t,n){Ge.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new vt;r.addAttribute("position",new at([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Pn({fog:!1});this.lightPlane=new On(r,i),this.add(this.lightPlane),(r=new vt).addAttribute("position",new at([0,0,0,0,0,1],3)),this.targetLine=new On(r,i),this.add(this.targetLine),this.update()}function ka(e){var t=new vt,n=new Pn({color:16777215,vertexColors:1}),r=[],i=[],o={},a=new fe(16755200),s=new fe(16711680),c=new fe(43775),l=new fe(16777215),u=new fe(3355443);function h(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(r.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.addAttribute("position",new at(r,3)),t.addAttribute("color",new at(i,3)),Nn.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Ia(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new vt;i.setIndex(new Ke(n,1)),i.addAttribute("position",new Ke(r,3)),Nn.call(this,i,new Pn({color:t})),this.matrixAutoUpdate=!1,this.update()}function Pa(e,t){this.type="Box3Helper",this.box=e;var n=void 0!==t?t:16776960,r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new vt;i.setIndex(new Ke(r,1)),i.addAttribute("position",new at([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Nn.call(this,i,new Pn({color:n})),this.geometry.computeBoundingSphere()}function Oa(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new vt;i.addAttribute("position",new at([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),On.call(this,i,new Pn({color:r}));var o=new vt;o.addAttribute("position",new at([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Rt(o,new At({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function Na(e,t,n,r,i,o){Ge.call(this),void 0===r&&(r=16776960),void 0===n&&(n=1),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===na&&((na=new vt).addAttribute("position",new at([0,0,0,0,1,0],3)),(ra=new Jr(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new On(na,new Pn({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Rt(ra,new At({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,o)}function Da(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new vt;n.addAttribute("position",new at(t,3)),n.addAttribute("color",new at([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Pn({vertexColors:2});Nn.call(this,n,r)}Object.assign(aa.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(sa,{Composite:aa,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new sa.Composite(e,t,n):new sa(e,t,n)},sanitizeNodeName:(ta=new RegExp("[\\[\\]\\.:\\/]","g"),function(e){return e.replace(/\s/g,"_").replace(ta,"")}),parseTrackName:(Zo="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Yo=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Xo=/(WCOD+)?/.source.replace("WCOD",Zo),Qo=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ko=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),$o=new RegExp("^"+Yo+Xo+Qo+Ko+"$"),ea=["material","materials","bones"],function(e){var t=$o.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==ea.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var o=r(i.children);if(o)return o}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(sa.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=sa.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var o=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var a=0;a<e.length;a++)if(e[a].name===o){o=a;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==o){if(void 0===e[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[o]}}var s=e[r];if(void 0!==s){var c=this.Versioning.None;void 0!==e.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(e.geometry.morphAttributes.position[a].name===i){i=a;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(e.geometry.morphTargets[a].name===i){i=a;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),//!\ DECLARE ALIAS AFTER assign prototype !Object.assign(sa.prototype,{_getValue_unbound:sa.prototype.getValue,_setValue_unbound:sa.prototype.setValue}),Object.assign(function(){this.uuid=m.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],d=h.uuid,p=r[d];if(void 0===p){p=t++,r[d]=p,e.push(h);for(var f=0,m=s;f!==m;++f)a[f].push(new sa(h,i[f],o[f]))}else if(p<n){c=e[p];var g=--n,y=e[g];r[y.uuid]=p,e[p]=y,r[d]=g,e[g]=h;for(f=0,m=s;f!==m;++f){var v=a[f],b=v[g],_=v[p];v[p]=b,void 0===_&&(_=new sa(h,i[f],o[f])),v[g]=_}}else e[p]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,l=n[c];if(void 0!==l&&l>=t){var u=t++,h=e[u];n[h.uuid]=l,e[l]=h,n[c]=u,e[u]=s;for(var d=0,p=i;d!==p;++d){var f=r[d],m=f[u],g=f[l];f[l]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],l=c.uuid,u=r[l];if(void 0!==u)if(delete r[l],u<n){var h=--n,d=e[h],p=e[v=--t];r[d.uuid]=u,e[u]=d,r[p.uuid]=h,e[h]=p,e.pop();for(var f=0,m=o;f!==m;++f){var g=(b=i[f])[h],y=b[v];b[u]=g,b[h]=y,b.pop()}}else{var v;r[(p=e[v=--t]).uuid]=u,e[u]=p,e.pop();for(f=0,m=o;f!==m;++f){var b;(b=i[f])[u]=b[v],b.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(u);for(var h=l,d=s.length;h!==d;++h){var p=s[h];u[h]=new sa(p,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}),Object.assign(ca.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,o=i/r,a=r/i;e.warp(1,o,t),this.warp(a,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*n;if(o<0||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,u=0,h=c.length;u!==h;++u)c[u].evaluate(a),l[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var n=this._clip.duration,r=this.loop,i=this._loopCount;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{var o=2202===r;if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=n||t<0){var a=Math.floor(t/n);t-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(0===s){var c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&i))return this.time=t,n-t}return this.time=t,t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}),la.prototype=Object.assign(Object.create(o.prototype),{constructor:la,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==i;++u){var h=r[u],d=h.name,p=l[d];if(void 0!==p)o[u]=p;else{if(void 0!==(p=o[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(p=new Jo(sa.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[u]=p}a[u].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var 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:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,o=i[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=o;else{var a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null,delete a.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],o=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=o.length,o.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete a[i];e:{for(var l in a)break e;delete o[r]}},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new oo(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?uo.findByName(n,e):e,o=null!==i?i.uuid:e,a=this._actionsByClip[o],s=null;if(void 0!==a){var c=a.actionByRoot[r];if(void 0!==c)return c;s=a.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var l=new ca(this,i,t);return this._bindAction(l,s),this._addInactiveAction(l,o,r),l},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?uo.findByName(n,e):e,o=i?i.uuid:e,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==n;++a){t[a]._update(r,e,i,o)}var s=this._bindings,c=this._nActiveBindings;for(a=0;a!==c;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var o=i.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var l=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var o=this._bindingsByRootAndName[t];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),ua.prototype.clone=function(){return new ua(void 0===this.value.clone?this.value:this.value.clone())},ha.prototype=Object.assign(Object.create(vt.prototype),{constructor:ha,isInstancedBufferGeometry:!0,copy:function(e){return vt.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Object.defineProperties(da.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(da.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),Object.defineProperty(pa.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(pa.prototype,{isInterleavedBuffer:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.stride:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),fa.prototype=Object.assign(Object.create(pa.prototype),{constructor:fa,isInstancedInterleavedBuffer:!0,copy:function(e){return pa.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),ma.prototype=Object.assign(Object.create(Ke.prototype),{constructor:ma,isInstancedBufferAttribute:!0,copy:function(e){return Ke.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(function(e,t,n,r){this.ray=new St(e,t),this.near=n||0,this.far=r||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return ya(e,this,r,t),r.sort(ga),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,o=e.length;i<o;i++)ya(e[i],this,r,t);return r.sort(ga),r}}),Object.assign(function(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(m.clamp(e.y/this.radius,-1,1))),this}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.radius=Math.sqrt(e.x*e.x+e.z*e.z),this.theta=Math.atan2(e.x,e.z),this.y=e.y,this}}),Object.assign(va.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new g;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){var t=e||new g;return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new g;return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(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:function(e,t){return(t||new g).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(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:function(e,t){return(t||new g).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new g;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),ba.prototype=Object.create(Ge.prototype),ba.prototype.constructor=ba,ba.prototype.isImmediateRenderObject=!0,_a.prototype=Object.create(Nn.prototype),_a.prototype.constructor=_a,_a.prototype.update=function(){var e=new b,t=new b,n=new _;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,l=0,u=0,h=c.length;u<h;u++)for(var d=c[u],p=0,f=d.vertexNormals.length;p<f;p++){var m=s[d[r[p]]],g=d.vertexNormals[p];e.copy(m).applyMatrix4(i),t.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),o.setXYZ(l,e.x,e.y,e.z),l+=1,o.setXYZ(l,t.x,t.y,t.z),l+=1}else if(a&&a.isBufferGeometry){var y=a.attributes.position,v=a.attributes.normal;for(l=0,p=0,f=y.count;p<f;p++)e.set(y.getX(p),y.getY(p),y.getZ(p)).applyMatrix4(i),t.set(v.getX(p),v.getY(p),v.getZ(p)),t.applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),o.setXYZ(l,e.x,e.y,e.z),l+=1,o.setXYZ(l,t.x,t.y,t.z),l+=1}o.needsUpdate=!0}}(),wa.prototype=Object.create(Ge.prototype),wa.prototype.constructor=wa,wa.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},wa.prototype.update=function(){var e=new b,t=new b;return function(){this.light.updateMatrixWorld();var n=this.light.distance?this.light.distance:1e3,r=n*Math.tan(this.light.angle);this.cone.scale.set(r,r,n),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),Ea.prototype=Object.create(Nn.prototype),Ea.prototype.constructor=Ea,Ea.prototype.updateMatrixWorld=function(){var e=new b,t=new y,n=new y;return function(r){var i=this.bones,o=this.geometry,a=o.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<i.length;s++){var l=i[s];l.parent&&l.parent.isBone&&(t.multiplyMatrices(n,l.matrixWorld),e.setFromMatrixPosition(t),a.setXYZ(c,e.x,e.y,e.z),t.multiplyMatrices(n,l.parent.matrixWorld),e.setFromMatrixPosition(t),a.setXYZ(c+1,e.x,e.y,e.z),c+=2)}o.getAttribute("position").needsUpdate=!0,Ge.prototype.updateMatrixWorld.call(this,r)}}(),Aa.prototype=Object.create(Rt.prototype),Aa.prototype.constructor=Aa,Aa.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Aa.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},xa.prototype=Object.create(Ge.prototype),xa.prototype.constructor=xa,xa.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},xa.prototype.update=function(){var e=.5*this.light.width,t=.5*this.light.height,n=this.line.geometry.attributes.position,r=n.array;r[0]=e,r[1]=-t,r[2]=0,r[3]=e,r[4]=t,r[5]=0,r[6]=-e,r[7]=t,r[8]=0,r[9]=-e,r[10]=-t,r[11]=0,r[12]=e,r[13]=-t,r[14]=0,n.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},Sa.prototype=Object.create(Ge.prototype),Sa.prototype.constructor=Sa,Sa.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Sa.prototype.update=function(){var e=new b,t=new fe,n=new fe;return function(){var r=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var i=r.geometry.getAttribute("color");t.copy(this.light.color),n.copy(this.light.groundColor);for(var o=0,a=i.count;o<a;o++){var s=o<a/2?t:n;i.setXYZ(o,s.r,s.g,s.b)}i.needsUpdate=!0}r.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),Ta.prototype=Object.create(Nn.prototype),Ta.prototype.constructor=Ta,Ma.prototype=Object.create(Nn.prototype),Ma.prototype.constructor=Ma,Ra.prototype=Object.create(Nn.prototype),Ra.prototype.constructor=Ra,Ra.prototype.update=function(){var e=new b,t=new b,n=new _;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,i=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,l=0,u=s.length;l<u;l++){var h=s[l],d=h.normal;e.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(r),t.copy(d).applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),i.setXYZ(c,e.x,e.y,e.z),c+=1,i.setXYZ(c,t.x,t.y,t.z),c+=1}i.needsUpdate=!0}}(),Ca.prototype=Object.create(Ge.prototype),Ca.prototype.constructor=Ca,Ca.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Ca.prototype.update=function(){var e=new b,t=new b,n=new b;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(t,e),this.lightPlane.lookAt(n),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(n),this.targetLine.scale.z=n.length()}}(),ka.prototype=Object.create(Nn.prototype),ka.prototype.constructor=ka,ka.prototype.update=function(){var e,t,n=new b,r=new We;function i(i,o,a,s){n.set(o,a,s).unproject(r);var c=t[i];if(void 0!==c)for(var l=e.getAttribute("position"),u=0,h=c.length;u<h;u++)l.setXYZ(c[u],n.x,n.y,n.z)}return function(){e=this.geometry,t=this.pointMap;r.projectionMatrix.copy(this.camera.projectionMatrix),i("c",0,0,-1),i("t",0,0,1),i("n1",-1,-1,-1),i("n2",1,-1,-1),i("n3",-1,1,-1),i("n4",1,1,-1),i("f1",-1,-1,1),i("f2",1,-1,1),i("f3",-1,1,1),i("f4",1,1,1),i("u1",.7,1.1,-1),i("u2",-.7,1.1,-1),i("u3",0,2,-1),i("cf1",-1,0,1),i("cf2",1,0,1),i("cf3",0,-1,1),i("cf4",0,1,1),i("cn1",-1,0,-1),i("cn2",1,0,-1),i("cn3",0,-1,-1),i("cn4",0,1,-1),e.getAttribute("position").needsUpdate=!0}}(),Ia.prototype=Object.create(Nn.prototype),Ia.prototype.constructor=Ia,Ia.prototype.update=function(){var e=new Pe;return function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&e.setFromObject(this.object),!e.isEmpty()){var n=e.min,r=e.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Ia.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Pa.prototype=Object.create(Nn.prototype),Pa.prototype.constructor=Pa,Pa.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Ge.prototype.updateMatrixWorld.call(this,e))},Oa.prototype=Object.create(On.prototype),Oa.prototype.constructor=Oa,Oa.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.lookAt(this.plane.normal),Ge.prototype.updateMatrixWorld.call(this,e)},Na.prototype=Object.create(Ge.prototype),Na.prototype.constructor=Na,Na.prototype.setDirection=(oa=new b,function(e){e.y>.99999?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(oa.set(e.z,0,-e.x).normalize(),ia=Math.acos(e.y),this.quaternion.setFromAxisAngle(oa,ia))}),Na.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Na.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},Da.prototype=Object.create(Nn.prototype),Da.prototype.constructor=Da;function La(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ti.call(this,e),this.type="catmullrom"}vi.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(vi.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(ji.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Qe,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new b(i.x,i.y,i.z||0))}return t}}),Object.assign(Ui.prototype,{fromPoints:function(e){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(Ti.prototype),Object.create(Ti.prototype),La.prototype=Object.create(Ti.prototype),Object.assign(La.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Ta.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ea.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(bo.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),_o(e)}}),Object.assign(va.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Pe.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Tt.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(m,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),m.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),m.ceilPowerOfTwo(e)}}),Object.assign(_.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(y.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new b),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,o)}}),Ne.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},v.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(St.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Bi.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Pr(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Hr(this,e)}}),Object.assign(g.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(b.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(A.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Qe.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(Ge.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}}),Object.defineProperties(Ge.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Rn.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Cn.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(vi.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),nn.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Vi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Ke.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(vt.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(vt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ua.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Ce.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new fe}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}}}),Object.defineProperties(ri.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(xt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(En.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(En.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Le.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(x.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(on.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}}}),qo.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Vo).load(e,(function(e){t.setBuffer(e)})),this},Wo.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ho.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};class Fa{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(e,t,n){const r=Array.from(e),i=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[];let s=0,c=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)s=0,c-=o;else{const e=ja(t,i,s,c,n);s+=e.offsetX,a.push(e.path)}}return a}(e,t,this.data);for(let e=0,t=r.length;e<t;e++)Array.prototype.push.apply(n,r[e].toShapes());return n}}function ja(e,t,n,r,i){const o=i.glyphs[e]||i.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");const a=new Mo;let s,c,l,u,h,d,p,f;if(o.o){const e=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let i=0,o=e.length;i<o;){switch(e[i++]){case"m":s=e[i++]*t+n,c=e[i++]*t+r,a.moveTo(s,c);break;case"l":s=e[i++]*t+n,c=e[i++]*t+r,a.lineTo(s,c);break;case"q":l=e[i++]*t+n,u=e[i++]*t+r,h=e[i++]*t+n,d=e[i++]*t+r,a.quadraticCurveTo(h,d,l,u);break;case"b":l=e[i++]*t+n,u=e[i++]*t+r,h=e[i++]*t+n,d=e[i++]*t+r,p=e[i++]*t+n,f=e[i++]*t+r,a.bezierCurveTo(h,d,p,f,l,u)}}}return{offsetX:o.ha*t,path:a}}Fa.prototype.isFont=!0;var Ua=(0,AFRAME.utils.debug)("aframe-text-component:error"),Ba=new class extends bo{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new pi(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){let n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}const r=i.parse(n);t&&t(r)}),n,r)}parse(e){return new Fa(e)}};if(AFRAME.registerComponent("text-geometry",{schema:{bevelEnabled:{default:!1},bevelSize:{default:8,min:0},bevelThickness:{default:12,min:0},curveSegments:{default:12,min:0},font:{type:"asset",default:"https://rawgit.com/ngokevin/kframe/master/components/text-geometry/lib/helvetiker_regular.typeface.json"},height:{default:.05,min:0},size:{default:.5,min:0},style:{default:"normal",oneOf:["normal","italics"]},weight:{default:"normal",oneOf:["normal","bold"]},value:{default:""}},update:function(e){const t=this.data,n=this.el;if(!t.value)return;let r=n.getObject3D("mesh");r||(r=new THREE.Mesh,n.setObject3D("mesh",r)),t.font.constructor===String?Ba.load(t.font,(function(e){const n=AFRAME.utils.clone(t);n.font=e,r.geometry=new i(t.value,n),r.geometry.translate(-.18,0,-.07)})):t.font.constructor===Object?(r.geometry=new i(t.value,t),r.geometry.translate(-.18,0,-.07)):Ua("Must provide `font` (typeface.json) or `fontPath` (string) to text component.")}}),window.AFRAME){const t=["text-geometry"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}}]);\ No newline at end of filediff --git a/rider/build/zip.js b/rider/build/zip.jsindex 5c1bb2c27..1983de569 100644--- a/rider/build/zip.js+++ b/rider/build/zip.js@@ -1,4 +1,4 @@-!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!v[e])return;for(var n in v[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(p[n]=t[n]);0==--b&&0===y&&x()}(e,n),t&&t(e,n)};var n,r=!0,i="de1d5348b83d960dd5aa",o={},a=[],s=[];function l(e){var t=R[e];if(!t)return O;var r=function(r){return t.hot.active?(R[r]?-1===R[r].parents.indexOf(e)&&R[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),O(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return O[e]},set:function(t){O[e]=t}}};for(var o in O)Object.prototype.hasOwnProperty.call(O,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&c("prepare"),y++,O.e(e).then(t,(function(e){throw t(),e}));function t(){y--,"prepare"===h&&(m[e]||S(e),0===y&&0===b&&x())}},r.t=function(e,t){return 1&t&&(e=r(e)),O.t(e,-2&t)},r}function u(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(p={})[t]=e[t],c("ready");break;case"ready":A(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:k,apply:T,status:function(e){if(!e)return h;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],h="idle";function c(e){h=e;for(var t=0;t<f.length;t++)f[t].call(null,e)}var d,p,_,g,b=0,y=0,m={},v={},w={};function E(e){return+e+""===e?+e:e}function k(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,c("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=O.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return c(L()?"ready":"idle"),null;v={},m={},w=e.c,_=e.h,c("prepare");var t=new Promise((function(e,t){d={resolve:e,reject:t}}));p={};return S(1),"prepare"===h&&0===y&&0===b&&x(),t}));var t}function S(e){w[e]?(v[e]=!0,b++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=O.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):m[e]=!0}function x(){c("ready");var e=d;if(d=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,l,u,f,h;function d(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((f=R[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<f.parents.length;s++){var l=f.parents[s],u=R[l];if(u){if(u.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([l]),moduleId:o,parentId:l};-1===t.indexOf(l)&&(u.hot._acceptedDependencies[o]?(n[l]||(n[l]=[]),b(n[l],[o])):(delete n[l],t.push(l),r.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}L();var y={},m=[],v={},k=function(){console.warn("[HMR] unexpected require("+x.moduleId+") to disposed module")};for(var S in p)if(Object.prototype.hasOwnProperty.call(p,S)){var x;h=E(S),x=p[S]?d(h):{type:"disposed",moduleId:S};var T=!1,A=!1,I=!1,U="";switch(x.chain&&(U="\nUpdate propagation: "+x.chain.join(" -> ")),x.type){case"self-declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+x.moduleId+U));break;case"declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+x.moduleId+" in "+x.parentId+U));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(x),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+U));break;case"accepted":r.onAccepted&&r.onAccepted(x),A=!0;break;case"disposed":r.onDisposed&&r.onDisposed(x),I=!0;break;default:throw new Error("Unexception type "+x.type)}if(T)return c("abort"),Promise.reject(T);if(A)for(h in v[h]=p[h],b(m,x.outdatedModules),x.outdatedDependencies)Object.prototype.hasOwnProperty.call(x.outdatedDependencies,h)&&(y[h]||(y[h]=[]),b(y[h],x.outdatedDependencies[h]));I&&(b(m,[x.moduleId]),v[h]=k)}var z,D=[];for(l=0;l<m.length;l++)h=m[l],R[h]&&R[h].hot._selfAccepted&&v[h]!==k&&!R[h].hot._selfInvalidated&&D.push({module:h,parents:R[h].parents.slice(),errorHandler:R[h].hot._selfAccepted});c("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var M,N,B=m.slice();for(;B.length>0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u<F.length;u++)(s=F[u])(P);for(o[h]=P,f.hot.active=!1,delete R[h],delete y[h],u=0;u<f.children.length;u++){var C=R[f.children[u]];C&&((z=C.parents.indexOf(h))>=0&&C.parents.splice(z,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h]))for(N=y[h],u=0;u<N.length;u++)M=N[u],(z=f.children.indexOf(M))>=0&&f.children.splice(z,1);c("apply"),void 0!==_&&(i=_,_=void 0);for(h in p=void 0,v)Object.prototype.hasOwnProperty.call(v,h)&&(e[h]=v[h]);var Z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h])){N=y[h];var j=[];for(l=0;l<N.length;l++)if(M=N[l],s=f.hot._acceptedDependencies[M]){if(-1!==j.indexOf(s))continue;j.push(s)}for(l=0;l<j.length;l++){s=j[l];try{s(N)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:N[l],error:e}),r.ignoreErrored||Z||(Z=e)}}}for(l=0;l<D.length;l++){var H=D[l];h=H.module,a=H.parents,n=h;try{O(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||Z||(Z=t),Z||(Z=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||Z||(Z=e)}}if(Z)return c("fail"),Promise.reject(Z);if(g)return t(r).then((function(e){return m.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return c("idle"),new Promise((function(e){e(m)}))}(t=t||{})}function L(){if(g)return p||(p={}),g.forEach(A),g=void 0,!0}function A(t){Object.prototype.hasOwnProperty.call(p,t)||(p[t]=e[t])}var R={};function O(t){if(R[t])return R[t].exports;var n=R[t]={i:t,l:!1,exports:{},hot:u(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,l(t)),n.l=!0,n.exports}O.m=e,O.c=R,O.d=function(e,t,n){O.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},O.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},O.t=function(e,t){if(1&t&&(e=O(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(O.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)O.d(n,r,function(t){return e[t]}.bind(null,r));return n},O.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return O.d(t,"a",t),t},O.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},O.p="",O.h=function(){return i},l(209)(O.s=209)}([,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],f=!1,h=-1;function c(){f&&l&&(f=!1,l.length?u=l.concat(u):h=-1,u.length&&d())}function d(){if(!f){var e=s(c);f=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function _(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||f||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){+!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!v[e])return;for(var n in v[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(p[n]=t[n]);0==--b&&0===y&&x()}(e,n),t&&t(e,n)};var n,r=!0,i="b6816b72f4b52c110a25",o={},a=[],s=[];function l(e){var t=R[e];if(!t)return O;var r=function(r){return t.hot.active?(R[r]?-1===R[r].parents.indexOf(e)&&R[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),O(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return O[e]},set:function(t){O[e]=t}}};for(var o in O)Object.prototype.hasOwnProperty.call(O,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&c("prepare"),y++,O.e(e).then(t,(function(e){throw t(),e}));function t(){y--,"prepare"===h&&(m[e]||S(e),0===y&&0===b&&x())}},r.t=function(e,t){return 1&t&&(e=r(e)),O.t(e,-2&t)},r}function u(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(p={})[t]=e[t],c("ready");break;case"ready":A(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:k,apply:T,status:function(e){if(!e)return h;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],h="idle";function c(e){h=e;for(var t=0;t<f.length;t++)f[t].call(null,e)}var d,p,_,g,b=0,y=0,m={},v={},w={};function E(e){return+e+""===e?+e:e}function k(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,c("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=O.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return c(L()?"ready":"idle"),null;v={},m={},w=e.c,_=e.h,c("prepare");var t=new Promise((function(e,t){d={resolve:e,reject:t}}));p={};return S(1),"prepare"===h&&0===y&&0===b&&x(),t}));var t}function S(e){w[e]?(v[e]=!0,b++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=O.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):m[e]=!0}function x(){c("ready");var e=d;if(d=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,l,u,f,h;function d(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((f=R[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<f.parents.length;s++){var l=f.parents[s],u=R[l];if(u){if(u.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([l]),moduleId:o,parentId:l};-1===t.indexOf(l)&&(u.hot._acceptedDependencies[o]?(n[l]||(n[l]=[]),b(n[l],[o])):(delete n[l],t.push(l),r.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}L();var y={},m=[],v={},k=function(){console.warn("[HMR] unexpected require("+x.moduleId+") to disposed module")};for(var S in p)if(Object.prototype.hasOwnProperty.call(p,S)){var x;h=E(S),x=p[S]?d(h):{type:"disposed",moduleId:S};var T=!1,A=!1,I=!1,U="";switch(x.chain&&(U="\nUpdate propagation: "+x.chain.join(" -> ")),x.type){case"self-declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+x.moduleId+U));break;case"declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+x.moduleId+" in "+x.parentId+U));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(x),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+U));break;case"accepted":r.onAccepted&&r.onAccepted(x),A=!0;break;case"disposed":r.onDisposed&&r.onDisposed(x),I=!0;break;default:throw new Error("Unexception type "+x.type)}if(T)return c("abort"),Promise.reject(T);if(A)for(h in v[h]=p[h],b(m,x.outdatedModules),x.outdatedDependencies)Object.prototype.hasOwnProperty.call(x.outdatedDependencies,h)&&(y[h]||(y[h]=[]),b(y[h],x.outdatedDependencies[h]));I&&(b(m,[x.moduleId]),v[h]=k)}var z,D=[];for(l=0;l<m.length;l++)h=m[l],R[h]&&R[h].hot._selfAccepted&&v[h]!==k&&!R[h].hot._selfInvalidated&&D.push({module:h,parents:R[h].parents.slice(),errorHandler:R[h].hot._selfAccepted});c("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var M,N,B=m.slice();for(;B.length>0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u<F.length;u++)(s=F[u])(P);for(o[h]=P,f.hot.active=!1,delete R[h],delete y[h],u=0;u<f.children.length;u++){var C=R[f.children[u]];C&&((z=C.parents.indexOf(h))>=0&&C.parents.splice(z,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h]))for(N=y[h],u=0;u<N.length;u++)M=N[u],(z=f.children.indexOf(M))>=0&&f.children.splice(z,1);c("apply"),void 0!==_&&(i=_,_=void 0);for(h in p=void 0,v)Object.prototype.hasOwnProperty.call(v,h)&&(e[h]=v[h]);var Z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h])){N=y[h];var j=[];for(l=0;l<N.length;l++)if(M=N[l],s=f.hot._acceptedDependencies[M]){if(-1!==j.indexOf(s))continue;j.push(s)}for(l=0;l<j.length;l++){s=j[l];try{s(N)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:N[l],error:e}),r.ignoreErrored||Z||(Z=e)}}}for(l=0;l<D.length;l++){var H=D[l];h=H.module,a=H.parents,n=h;try{O(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||Z||(Z=t),Z||(Z=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||Z||(Z=e)}}if(Z)return c("fail"),Promise.reject(Z);if(g)return t(r).then((function(e){return m.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return c("idle"),new Promise((function(e){e(m)}))}(t=t||{})}function L(){if(g)return p||(p={}),g.forEach(A),g=void 0,!0}function A(t){Object.prototype.hasOwnProperty.call(p,t)||(p[t]=e[t])}var R={};function O(t){if(R[t])return R[t].exports;var n=R[t]={i:t,l:!1,exports:{},hot:u(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,l(t)),n.l=!0,n.exports}O.m=e,O.c=R,O.d=function(e,t,n){O.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},O.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},O.t=function(e,t){if(1&t&&(e=O(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(O.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)O.d(n,r,function(t){return e[t]}.bind(null,r));return n},O.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return O.d(t,"a",t),t},O.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},O.p="",O.h=function(){return i},l(209)(O.s=209)}([,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],f=!1,h=-1;function c(){f&&l&&(f=!1,l.length?u=l.concat(u):h=-1,u.length&&d())}function d(){if(!f){var e=s(c);f=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function _(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||f||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){/*!* The buffer module from node.js, for the browser.*diff --git a/rider/src/scene.html b/rider/src/scene.htmlindex 7e086afcf..698894e53 100644--- a/rider/src/scene.html+++ b/rider/src/scene.html@@ -144,7 +144,7 @@<a-entityid="agentCompanion"gltf-model="#agentGlb"- agent-dance="initial: sitclap"+ agent-dance="initial: idle"position="0.7 0.45 0.5"rotation="0 165 0"scale="0.9 0.9 0.9"></a-entity>diff --git a/src/character.css b/src/character.cssnew file mode 100644index 000000000..8528ce559--- /dev/null+++ b/src/character.css@@ -0,0 +1,459 @@+/* Character page — charms-style consumer profile */++* { box-sizing: border-box; margin: 0; padding: 0; }++body {+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;+ min-height: 100vh;+ background: linear-gradient(160deg, #c8dff7 0%, #e8f4ff 40%, #f0f8ff 100%);+ color: #1a1a2e;+}++/* ── Nav ──────────────────────────────────────────────── */+.ch-nav {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 16px 20px;+ position: sticky;+ top: 0;+ z-index: 10;+ background: rgba(200, 223, 247, 0.6);+ backdrop-filter: blur(12px);+}++.ch-nav-brand {+ font-size: 22px;+ font-weight: 700;+ color: #1a1a2e;+ text-decoration: none;+ letter-spacing: -0.5px;+}++.ch-nav-actions {+ display: flex;+ gap: 8px;+}++.ch-btn-ghost {+ background: transparent;+ border: 1.5px solid rgba(26, 26, 46, 0.3);+ border-radius: 24px;+ padding: 8px 18px;+ font-size: 14px;+ font-weight: 500;+ color: #1a1a2e;+ cursor: pointer;+ text-decoration: none;+}++.ch-btn-primary {+ background: linear-gradient(135deg, #2563eb, #1d4ed8);+ border: none;+ border-radius: 24px;+ padding: 8px 18px;+ font-size: 14px;+ font-weight: 600;+ color: #fff;+ cursor: pointer;+ text-decoration: none;+}++/* ── Hero ─────────────────────────────────────────────── */+.ch-hero {+ padding: 32px 20px 0;+ display: flex;+ flex-direction: column;+ align-items: flex-start;+ gap: 16px;+}++.ch-hero-top {+ display: flex;+ align-items: flex-start;+ gap: 20px;+ width: 100%;+}++.ch-avatar {+ width: 96px;+ height: 96px;+ border-radius: 50%;+ object-fit: cover;+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);+ background: #cbd5e1;+ flex-shrink: 0;+}++.ch-avatar-placeholder {+ width: 96px;+ height: 96px;+ border-radius: 50%;+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 36px;+ font-weight: 700;+ color: #fff;+ flex-shrink: 0;+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);+}++.ch-hero-info {+ flex: 1;+ min-width: 0;+}++.ch-name {+ font-size: 26px;+ font-weight: 700;+ letter-spacing: -0.5px;+ line-height: 1.1;+ margin-bottom: 6px;+}++.ch-creator {+ display: flex;+ align-items: center;+ gap: 6px;+ font-size: 13px;+ color: #4b5563;+}++.ch-creator-avatar {+ width: 20px;+ height: 20px;+ border-radius: 50%;+ object-fit: cover;+}++.ch-creator a {+ color: #2563eb;+ text-decoration: none;+ font-weight: 500;+}++.ch-stats {+ display: flex;+ gap: 12px;+ margin-left: auto;+ flex-shrink: 0;+}++.ch-stat-bubble {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ width: 72px;+ height: 72px;+ border-radius: 50%;+ background: rgba(255, 255, 255, 0.7);+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);+ gap: 2px;+}++.ch-stat-num {+ font-size: 18px;+ font-weight: 700;+ line-height: 1;+ color: #1a1a2e;+}++.ch-stat-label {+ font-size: 11px;+ color: #6b7280;+ font-weight: 500;+}++.ch-desc {+ font-size: 14px;+ line-height: 1.6;+ color: #374151;+ max-width: 480px;+}++.ch-cta {+ display: flex;+ align-items: center;+ gap: 10px;+}++.ch-chat-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ background: linear-gradient(135deg, #2563eb, #1d4ed8);+ color: #fff;+ border: none;+ border-radius: 32px;+ padding: 13px 40px;+ font-size: 16px;+ font-weight: 600;+ cursor: pointer;+ text-decoration: none;+ box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);+ transition: transform 0.15s, box-shadow 0.15s;+}++.ch-chat-btn:hover {+ transform: translateY(-1px);+ box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);+}++/* ── Token card ──────────────────────────────────────── */+.ch-section {+ padding: 20px 16px 0;+}++.ch-token-card {+ background: rgba(255, 255, 255, 0.5);+ backdrop-filter: blur(10px);+ border-radius: 20px;+ padding: 18px 20px;+ box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);+}++.ch-token-header {+ display: flex;+ align-items: center;+ gap: 8px;+ margin-bottom: 4px;+}++.ch-token-name {+ font-size: 16px;+ font-weight: 700;+ color: #1a1a2e;+}++.ch-token-dot {+ width: 14px;+ height: 14px;+ border-radius: 3px;+ background: #2563eb;+ flex-shrink: 0;+}++.ch-token-price {+ display: flex;+ align-items: baseline;+ gap: 10px;+ margin-bottom: 14px;+}++.ch-price-main {+ font-size: 28px;+ font-weight: 700;+ color: #1a1a2e;+}++.ch-price-change {+ font-size: 13px;+ font-weight: 600;+ display: flex;+ align-items: center;+ gap: 3px;+}++.ch-price-change.up { color: #16a34a; }+.ch-price-change.down { color: #dc2626; }++.ch-token-actions {+ display: flex;+ gap: 10px;+ align-items: center;+}++.ch-trade-btn {+ flex: 1;+ background: #0f172a;+ color: #fff;+ border: none;+ border-radius: 32px;+ padding: 13px 20px;+ font-size: 15px;+ font-weight: 600;+ cursor: pointer;+ text-align: center;+ text-decoration: none;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ transition: background 0.15s;+}++.ch-trade-btn:hover { background: #1e293b; }++.ch-chart-btn {+ width: 44px;+ height: 44px;+ border-radius: 50%;+ border: 1.5px solid rgba(0, 0, 0, 0.12);+ background: rgba(255, 255, 255, 0.6);+ display: flex;+ align-items: center;+ justify-content: center;+ cursor: pointer;+ flex-shrink: 0;+ text-decoration: none;+ color: #374151;+}++.ch-token-meta {+ display: flex;+ gap: 16px;+ margin-top: 12px;+ padding-top: 12px;+ border-top: 1px solid rgba(0, 0, 0, 0.06);+}++.ch-token-meta-item {+ display: flex;+ flex-direction: column;+ gap: 2px;+}++.ch-token-meta-label {+ font-size: 11px;+ color: #9ca3af;+ font-weight: 500;+ text-transform: uppercase;+ letter-spacing: 0.5px;+}++.ch-token-meta-val {+ font-size: 13px;+ font-weight: 600;+ color: #1a1a2e;+}++/* no token state */+.ch-no-token {+ font-size: 13px;+ color: #9ca3af;+ text-align: center;+ padding: 12px 0;+}++/* ── Memes gallery ───────────────────────────────────── */+.ch-gallery-title {+ font-size: 20px;+ font-weight: 700;+ margin-bottom: 14px;+ color: #1a1a2e;+}++.ch-gallery-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 10px;+}++.ch-gallery-grid .ch-meme-create {+ grid-column: span 1;+ background: rgba(255, 255, 255, 0.7);+ border-radius: 16px;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 8px;+ padding: 28px 12px;+ cursor: pointer;+ border: 2px dashed rgba(37, 99, 235, 0.3);+ text-decoration: none;+ transition: border-color 0.15s, background 0.15s;+ min-height: 140px;+}++.ch-gallery-grid .ch-meme-create:hover {+ border-color: #2563eb;+ background: rgba(219, 234, 254, 0.5);+}++.ch-meme-create-icon {+ width: 36px;+ height: 36px;+ border-radius: 8px;+ overflow: hidden;+}++.ch-meme-create-icon img {+ width: 100%;+ height: 100%;+ object-fit: cover;+}++.ch-meme-create-label {+ font-size: 14px;+ font-weight: 600;+ color: #2563eb;+}++.ch-meme-item {+ position: relative;+ border-radius: 16px;+ overflow: hidden;+ aspect-ratio: 1;+ background: #e2e8f0;+}++.ch-meme-item img {+ width: 100%;+ height: 100%;+ object-fit: cover;+}++.ch-meme-author {+ position: absolute;+ bottom: 0;+ left: 0;+ right: 0;+ padding: 6px 8px;+ background: linear-gradient(transparent, rgba(0,0,0,0.5));+ font-size: 11px;+ color: #fff;+ font-weight: 500;+}++.ch-memes-empty {+ grid-column: span 2;+ text-align: center;+ color: #9ca3af;+ font-size: 13px;+ padding: 20px 0;+}++/* ── Bottom padding ──────────────────────────────────── */+.ch-bottom-pad { height: 48px; }++/* ── Error / loading ─────────────────────────────────── */+.ch-error {+ text-align: center;+ padding: 60px 20px;+ color: #6b7280;+}++.ch-error h2 { font-size: 20px; margin-bottom: 8px; }++.ch-skeleton {+ background: linear-gradient(90deg, rgba(255,255,255,0.4) 25%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.4) 75%);+ background-size: 200% 100%;+ animation: ch-shimmer 1.4s infinite;+ border-radius: 8px;+}++@keyframes ch-shimmer {+ 0% { background-position: 200% 0; }+ 100% { background-position: -200% 0; }+}++.ch-loading .ch-avatar { opacity: 0.4; }++/* ── Desktop ─────────────────────────────────────────── */+@media (min-width: 600px) {+ .ch-hero { padding: 40px 32px 0; max-width: 560px; margin: 0 auto; }+ .ch-section { padding: 20px 32px 0; max-width: 560px; margin: 0 auto; }+ .ch-nav { padding: 16px 32px; }+}diff --git a/src/character.js b/src/character.jsnew file mode 100644index 000000000..d66a4dc09--- /dev/null+++ b/src/character.js@@ -0,0 +1,336 @@+/**+ * /character/:id — consumer-facing character profile page+ *+ * Fetches /api/agents/:id (public GET) and renders a charms-style page:+ * hero avatar, name, creator, stats (chats + holders), description,+ * chat CTA, token card with price/trade, and memes gallery.+ */++const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;++function $(id) { return document.getElementById(id); }++function formatNum(n) {+ if (n == null) return '0';+ if (n >= 1_000_000) return (n / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'M';+ if (n >= 1_000) return (n / 1_000).toFixed(1).replace(/\.0$/, '') + 'K';+ return String(n);+}++function formatUsd(n) {+ if (n == null) return '$0';+ if (n >= 1_000_000) return '$' + (n / 1_000_000).toFixed(2) + 'M';+ if (n >= 1_000) return '$' + (n / 1_000).toFixed(1).replace(/\.0$/, '') + 'K';+ return '$' + Number(n).toFixed(2);+}++function avatarPlaceholder(name) {+ const letter = (name || '?')[0].toUpperCase();+ const hue = [...(name || 'X')].reduce((acc, c) => acc + c.charCodeAt(0), 0) % 360;+ return { letter, color: `hsl(${hue}, 55%, 45%)` };+}++function agentId() {+ const parts = location.pathname.split('/').filter(Boolean);+ return parts[1] || null;+}++async function fetchAgent(id) {+ const res = await fetch(`/api/agents/${encodeURIComponent(id)}`);+ if (!res.ok) throw Object.assign(new Error('not found'), { status: res.status });+ const json = await res.json();+ return json.agent;+}++function renderHero(agent) {+ // Avatar+ const avatarImg = $('ch-avatar-img');+ const avatarPH = $('ch-avatar-ph');+ const imageUrl =+ agent.meta?.profile_image_url ||+ agent.avatar_thumbnail_url ||+ agent.meta?.thumbnail_url ||+ agent.meta?.avatar_url ||+ null;++ if (imageUrl) {+ avatarImg.src = imageUrl;+ avatarImg.alt = agent.name;+ avatarImg.style.display = 'block';+ avatarPH.style.display = 'none';+ avatarImg.onerror = () => {+ avatarImg.style.display = 'none';+ showPlaceholder(agent, avatarPH);+ };+ } else {+ avatarImg.style.display = 'none';+ showPlaceholder(agent, avatarPH);+ }++ // Name+ $('ch-name').textContent = agent.name || 'Unnamed';+ document.title = `${agent.name || 'Character'} — three.ws`;++ // Creator+ const authorName = agent.author_name || 'Unknown';+ const authorAvatar = agent.author_avatar || null;+ const creatorEl = $('ch-creator');++ if (authorAvatar) {+ const img = document.createElement('img');+ img.src = authorAvatar;+ img.className = 'ch-creator-avatar';+ img.alt = authorName;+ img.onerror = () => img.remove();+ creatorEl.appendChild(img);+ }++ const byText = document.createElement('span');+ byText.textContent = 'by ';+ creatorEl.appendChild(byText);++ const handle = document.createElement('span');+ handle.textContent = '@' + (authorName.toLowerCase().replace(/\s+/g, ''));+ creatorEl.appendChild(handle);++ // Stats+ $('ch-stat-chats').textContent = formatNum(agent.chat_count ?? 0);+ const holders = agent.token?.holders ?? agent.meta?.token?.holders ?? 0;+ $('ch-stat-holders').textContent = formatNum(holders);++ // Description+ $('ch-desc').textContent = agent.description || '';++ // Chat button+ const chatBtn = $('ch-chat-btn');+ chatBtn.href = `/agent/${agent.id}`;+}++function showPlaceholder(agent, el) {+ const { letter, color } = avatarPlaceholder(agent.name);+ el.textContent = letter;+ el.style.background = color;+ el.style.display = 'flex';+}++async function fetchDexScreener(mint) {+ try {+ const res = await fetch(`https://api.dexscreener.com/latest/dex/tokens/${mint}`);+ if (!res.ok) return null;+ const data = await res.json();+ const pairs = (data.pairs || []).filter(p => p.chainId === 'solana');+ if (!pairs.length) return null;+ // Pick highest-liquidity pair+ pairs.sort((a, b) => (b.liquidity?.usd ?? 0) - (a.liquidity?.usd ?? 0));+ const p = pairs[0];+ return {+ priceUsd: parseFloat(p.priceUsd) || null,+ marketCapUsd: p.marketCap ?? null,+ change24h: p.priceChange?.h24 ?? null,+ volume24h: p.volume?.h24 ?? null,+ liquidity: p.liquidity?.usd ?? null,+ dexUrl: p.url ?? `https://dexscreener.com/solana/${mint}`,+ };+ } catch {+ return null;+ }+}++function buildTokenHtml(symbol, mint, marketCapUsd, priceUsd, change24h, holders, volume24h) {+ const displayPrice = marketCapUsd != null+ ? formatUsd(marketCapUsd)+ : priceUsd != null+ ? formatUsd(priceUsd)+ : '—';++ const priceLabel = marketCapUsd != null ? 'MCAP' : 'PRICE';++ let changeHtml = '';+ if (change24h != null) {+ const sign = change24h >= 0 ? '+' : '';+ const cls = change24h >= 0 ? 'up' : 'down';+ const arrow = change24h >= 0 ? '▲' : '▼';+ changeHtml = `<span class="ch-price-change ${cls}">${arrow} ${sign}${Number(change24h).toFixed(2)}%</span>`;+ }++ const tradeUrl = mint ? `https://dexscreener.com/solana/${mint}` : '#';+ const chartUrl = mint ? `https://birdeye.so/token/${mint}?chain=solana` : '#';++ const metaItems = [];+ if (holders) metaItems.push({ label: 'Holders', val: formatNum(holders) });+ if (volume24h) metaItems.push({ label: '24h Vol', val: formatUsd(volume24h) });+ if (symbol) metaItems.push({ label: 'Symbol', val: '$' + symbol });++ const metaHtml = metaItems.map(m =>+ `<div class="ch-token-meta-item">+ <span class="ch-token-meta-label">${m.label}</span>+ <span class="ch-token-meta-val">${m.val}</span>+ </div>`+ ).join('');++ return `+ <div class="ch-token-header">+ <span class="ch-token-name">${symbol}</span>+ <span class="ch-token-dot"></span>+ </div>+ <div class="ch-token-price">+ <span class="ch-price-main">${displayPrice}</span>+ ${changeHtml}+ <span style="font-size:11px;color:#9ca3af;font-weight:500;margin-left:2px">${priceLabel}</span>+ </div>+ <div class="ch-token-actions">+ <a class="ch-trade-btn" href="${tradeUrl}" target="_blank" rel="noopener">Trade</a>+ <a class="ch-chart-btn" href="${chartUrl}" target="_blank" rel="noopener" title="View chart">+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">+ <path d="M3 3v18h18"/>+ <path d="M18.5 8L13 13.5 8.5 10 3 15"/>+ </svg>+ </a>+ </div>+ ${metaItems.length ? `<div class="ch-token-meta">${metaHtml}</div>` : ''}+ `;+}++async function renderToken(agent) {+ const tokenSection = $('ch-token-section');+ const token = agent.token || agent.meta?.token || null;++ if (!token) {+ tokenSection.innerHTML = '<p class="ch-no-token">No token linked yet.</p>';+ return;+ }++ const symbol = token.symbol || token.name || 'TOKEN';+ const mint = token.mint || token.contract_address || token.contractAddress || null;++ // Render immediately from stored data+ let priceUsd = token.price_usd ?? token.priceUsd ?? null;+ let marketCapUsd = token.market_cap_usd ?? token.marketCapUsd ?? token.usd_market_cap ?? null;+ let change24h = token.change_24h_percent ?? token.change24hPercent ?? null;+ let holders = token.holders ?? 0;+ let volume24h = token.volume_24h_usd ?? token.volume24hUsd ?? null;++ const displayPrice = marketCapUsd != null+ ? formatUsd(marketCapUsd)+ : priceUsd != null+ ? formatUsd(priceUsd)+ : '—';++ const priceLabel = marketCapUsd != null ? 'MCAP' : 'PRICE';++ let changeHtml = '';+ if (change24h != null) {+ const sign = change24h >= 0 ? '+' : '';+ const cls = change24h >= 0 ? 'up' : 'down';+ const arrow = change24h >= 0 ? '▲' : '▼';+ changeHtml = `<span class="ch-price-change ${cls}">${arrow} ${sign}${Number(change24h).toFixed(2)}%</span>`;+ }++ const tradeUrl = mint+ ? `https://dexscreener.com/solana/${mint}`+ : '#';+ const chartUrl = mint+ ? `https://birdeye.so/token/${mint}?chain=solana`+ : '#';++ const metaItems = [];+ if (holders) metaItems.push({ label: 'Holders', val: formatNum(holders) });+ if (volume24h) metaItems.push({ label: '24h Vol', val: formatUsd(volume24h) });+ if (symbol) metaItems.push({ label: 'Symbol', val: '$' + symbol });++ const metaHtml = metaItems.map(m =>+ `<div class="ch-token-meta-item">+ <span class="ch-token-meta-label">${m.label}</span>+ <span class="ch-token-meta-val">${m.val}</span>+ </div>`+ ).join('');++ tokenSection.innerHTML = buildTokenHtml(symbol, mint, marketCapUsd, priceUsd, change24h, holders, volume24h);++ // Fetch live market data from DexScreener and update card+ if (mint) {+ fetchDexScreener(mint).then(live => {+ if (!live) return;+ tokenSection.innerHTML = buildTokenHtml(+ symbol, mint,+ live.marketCapUsd ?? marketCapUsd,+ live.priceUsd ?? priceUsd,+ live.change24h ?? change24h,+ holders,+ live.volume24h ?? volume24h,+ );+ // Update holders stat bubble too+ if (live.marketCapUsd) {+ // holders isn't in dexscreener; leave from stored token+ }+ });+ }+}++function renderMemes(agent) {+ const grid = $('ch-memes-grid');+ const memes = agent.meta?.memes || [];++ const createCard = `+ <a class="ch-meme-create" href="/agent/${agent.id}?meme=1" title="Create meme">+ <div class="ch-meme-create-icon">+ <img src="${agent.meta?.profile_image_url || agent.avatar_thumbnail_url || ''}"+ onerror="this.style.display='none'"+ alt="${agent.name}" />+ </div>+ <span class="ch-meme-create-label">Create Meme</span>+ </a>+ `;++ if (!memes.length) {+ grid.innerHTML = createCard + '<div class="ch-memes-empty">No memes yet. Be first!</div>';+ return;+ }++ const memeCards = memes.slice(0, 5).map(m => `+ <div class="ch-meme-item">+ <img src="${m.image_url}" alt="meme" loading="lazy" />+ ${m.creator ? `<div class="ch-meme-author">${m.creator}</div>` : ''}+ </div>+ `).join('');++ grid.innerHTML = createCard + memeCards;+}++function showError(msg) {+ const shell = document.querySelector('.ch-shell');+ if (shell) {+ shell.innerHTML = `+ <div class="ch-error">+ <h2>Character not found</h2>+ <p>${msg || 'This character does not exist or has been removed.'}</p>+ <br>+ <a href="/" class="ch-btn-primary" style="display:inline-block;margin-top:8px">Go home</a>+ </div>+ `;+ }+}++async function init() {+ const id = agentId();+ if (!id || !UUID_RE.test(id)) {+ showError('Invalid character ID.');+ return;+ }++ let agent;+ try {+ agent = await fetchAgent(id);+ } catch (e) {+ showError(e.status === 404 ? 'Character not found.' : 'Failed to load. Please try again.');+ return;+ }++ document.querySelector('.ch-shell')?.classList.remove('ch-loading');++ renderHero(agent);+ renderToken(agent); // async — DexScreener fetch updates card in background+ renderMemes(agent);+}++init();diff --git a/src/characters.css b/src/characters.cssnew file mode 100644index 000000000..a54442cfb--- /dev/null+++ b/src/characters.css@@ -0,0 +1,322 @@+/* /characters — character discovery feed */++* { box-sizing: border-box; margin: 0; padding: 0; }++body {+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;+ min-height: 100vh;+ background: linear-gradient(160deg, #c8dff7 0%, #e8f4ff 40%, #f0f8ff 100%);+ color: #1a1a2e;+}++/* ── Nav ──────────────────────────────────────────────── */+.chs-nav {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 16px 20px;+ position: sticky;+ top: 0;+ z-index: 10;+ background: rgba(200, 223, 247, 0.65);+ backdrop-filter: blur(12px);+}++.chs-nav-brand {+ font-size: 22px;+ font-weight: 700;+ color: #1a1a2e;+ text-decoration: none;+ letter-spacing: -0.5px;+}++.chs-nav-right {+ display: flex;+ gap: 8px;+ align-items: center;+}++.chs-btn-ghost {+ background: transparent;+ border: 1.5px solid rgba(26, 26, 46, 0.3);+ border-radius: 24px;+ padding: 8px 18px;+ font-size: 14px;+ font-weight: 500;+ color: #1a1a2e;+ cursor: pointer;+ text-decoration: none;+}++.chs-btn-primary {+ background: linear-gradient(135deg, #2563eb, #1d4ed8);+ border: none;+ border-radius: 24px;+ padding: 8px 18px;+ font-size: 14px;+ font-weight: 600;+ color: #fff;+ cursor: pointer;+ text-decoration: none;+}++/* ── Header ───────────────────────────────────────────── */+.chs-header {+ padding: 32px 20px 20px;+ max-width: 640px;+ margin: 0 auto;+}++.chs-title {+ font-size: 28px;+ font-weight: 700;+ letter-spacing: -0.5px;+ margin-bottom: 16px;+}++/* ── Search + sort bar ────────────────────────────────── */+.chs-controls {+ display: flex;+ gap: 8px;+ align-items: center;+ margin-bottom: 4px;+}++.chs-search {+ flex: 1;+ background: rgba(255, 255, 255, 0.7);+ border: 1.5px solid rgba(0,0,0,0.1);+ border-radius: 32px;+ padding: 10px 18px;+ font-size: 14px;+ color: #1a1a2e;+ outline: none;+}++.chs-search:focus {+ border-color: #2563eb;+ background: rgba(255,255,255,0.9);+}++.chs-sort {+ display: flex;+ background: rgba(255,255,255,0.6);+ border-radius: 32px;+ padding: 4px;+ gap: 2px;+}++.chs-sort-btn {+ border: none;+ background: transparent;+ border-radius: 24px;+ padding: 6px 14px;+ font-size: 13px;+ font-weight: 500;+ color: #6b7280;+ cursor: pointer;+ transition: background 0.12s, color 0.12s;+}++.chs-sort-btn.active {+ background: #fff;+ color: #1a1a2e;+ font-weight: 600;+ box-shadow: 0 1px 4px rgba(0,0,0,0.08);+}++/* ── Grid ─────────────────────────────────────────────── */+.chs-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 12px;+ padding: 16px 20px;+ max-width: 640px;+ margin: 0 auto;+}++@media (min-width: 480px) {+ .chs-grid { grid-template-columns: 1fr 1fr; }+}++/* ── Character card ───────────────────────────────────── */+.chs-card {+ background: rgba(255,255,255,0.55);+ backdrop-filter: blur(10px);+ border-radius: 20px;+ padding: 16px;+ text-decoration: none;+ color: inherit;+ display: flex;+ flex-direction: column;+ gap: 10px;+ box-shadow: 0 2px 12px rgba(0,0,0,0.06);+ transition: transform 0.15s, box-shadow 0.15s;+ cursor: pointer;+}++.chs-card:hover {+ transform: translateY(-2px);+ box-shadow: 0 6px 20px rgba(0,0,0,0.1);+}++.chs-card-top {+ display: flex;+ align-items: center;+ gap: 10px;+}++.chs-card-avatar {+ width: 44px;+ height: 44px;+ border-radius: 50%;+ object-fit: cover;+ flex-shrink: 0;+ background: #cbd5e1;+}++.chs-card-avatar-ph {+ width: 44px;+ height: 44px;+ border-radius: 50%;+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 18px;+ font-weight: 700;+ color: #fff;+ flex-shrink: 0;+}++.chs-card-info {+ flex: 1;+ min-width: 0;+}++.chs-card-name {+ font-size: 14px;+ font-weight: 700;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ color: #1a1a2e;+}++.chs-card-creator {+ font-size: 11px;+ color: #6b7280;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}++.chs-card-desc {+ font-size: 12px;+ line-height: 1.5;+ color: #4b5563;+ display: -webkit-box;+ -webkit-line-clamp: 2;+ -webkit-box-orient: vertical;+ overflow: hidden;+}++/* Token pill */+.chs-card-token {+ display: flex;+ align-items: center;+ justify-content: space-between;+ background: rgba(255,255,255,0.6);+ border-radius: 12px;+ padding: 8px 10px;+ margin-top: auto;+}++.chs-card-token-left {+ display: flex;+ flex-direction: column;+ gap: 1px;+}++.chs-card-token-symbol {+ font-size: 11px;+ font-weight: 700;+ color: #1a1a2e;+}++.chs-card-token-price {+ font-size: 13px;+ font-weight: 700;+ color: #1a1a2e;+}++.chs-card-token-change {+ font-size: 11px;+ font-weight: 600;+}++.chs-card-token-change.up { color: #16a34a; }+.chs-card-token-change.down { color: #dc2626; }++/* Stats row */+.chs-card-stats {+ display: flex;+ gap: 8px;+}++.chs-card-stat {+ display: flex;+ align-items: center;+ gap: 4px;+ font-size: 11px;+ color: #6b7280;+}++.chs-card-stat-num {+ font-weight: 600;+ color: #374151;+}++/* ── Load more ────────────────────────────────────────── */+.chs-load-more {+ display: flex;+ justify-content: center;+ padding: 20px;+}++.chs-load-btn {+ background: rgba(255,255,255,0.7);+ border: 1.5px solid rgba(0,0,0,0.1);+ border-radius: 32px;+ padding: 12px 32px;+ font-size: 14px;+ font-weight: 600;+ color: #1a1a2e;+ cursor: pointer;+}++.chs-load-btn:hover { background: rgba(255,255,255,0.9); }+.chs-load-btn:disabled { opacity: 0.5; cursor: not-allowed; }++/* ── Empty / loading ──────────────────────────────────── */+.chs-empty {+ grid-column: span 2;+ text-align: center;+ padding: 40px 20px;+ color: #9ca3af;+ font-size: 14px;+}++.chs-skeleton-card {+ background: rgba(255,255,255,0.4);+ border-radius: 20px;+ height: 160px;+ animation: chs-shimmer 1.4s infinite;+}++@keyframes chs-shimmer {+ 0% { opacity: 0.6; }+ 50% { opacity: 1; }+ 100% { opacity: 0.6; }+}++.chs-bottom-pad { height: 48px; }diff --git a/src/characters.js b/src/characters.jsnew file mode 100644index 000000000..defd0934e--- /dev/null+++ b/src/characters.js@@ -0,0 +1,162 @@+/**+ * /characters — character discovery feed.+ *+ * Fetches /api/characters and renders a charms-style grid of character cards.+ * Each card links to /character/:id. Supports search, sort, and load-more.+ */++let state = { cursor: null, loading: false, sort: 'new', q: '' };++function formatNum(n) {+ if (!n) return '0';+ if (n >= 1_000_000) return (n / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'M';+ if (n >= 1_000) return (n / 1_000).toFixed(1).replace(/\.0$/, '') + 'K';+ return String(n);+}++function formatUsd(n) {+ if (n == null) return null;+ if (n >= 1_000_000) return '$' + (n / 1_000_000).toFixed(2) + 'M';+ if (n >= 1_000) return '$' + (n / 1_000).toFixed(1).replace(/\.0$/, '') + 'K';+ return '$' + Number(n).toFixed(2);+}++function avatarPlaceholder(name) {+ const letter = (name || '?')[0].toUpperCase();+ const hue = [...(name || 'X')].reduce((acc, c) => acc + c.charCodeAt(0), 0) % 360;+ return { letter, color: `hsl(${hue}, 55%, 45%)` };+}++function cardHtml(ch) {+ const { letter, color } = avatarPlaceholder(ch.name);+ const avatarEl = ch.image_url+ ? `<img class="chs-card-avatar" src="${ch.image_url}" alt="${ch.name}"+ onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" />+ <div class="chs-card-avatar-ph" style="display:none;background:${color}">${letter}</div>`+ : `<div class="chs-card-avatar-ph" style="background:${color}">${letter}</div>`;++ const creator = ch.author_name+ ? `<div class="chs-card-creator">by @${ch.author_name.toLowerCase().replace(/\s+/g, '')}</div>`+ : '';++ let tokenHtml = '';+ if (ch.token?.symbol) {+ const price = formatUsd(ch.token.market_cap_usd ?? ch.token.price_usd);+ const change = ch.token.change_24h_percent;+ const changeEl = change != null+ ? `<span class="chs-card-token-change ${change >= 0 ? 'up' : 'down'}">${change >= 0 ? '▲' : '▼'} ${Math.abs(change).toFixed(2)}%</span>`+ : '';+ tokenHtml = `+ <div class="chs-card-token">+ <div class="chs-card-token-left">+ <span class="chs-card-token-symbol">$${ch.token.symbol}</span>+ ${price ? `<span class="chs-card-token-price">${price}</span>` : ''}+ </div>+ ${changeEl}+ </div>`;+ }++ const statsHtml = `+ <div class="chs-card-stats">+ <span class="chs-card-stat">+ <span class="chs-card-stat-num">${formatNum(ch.chat_count)}</span> chats+ </span>+ ${ch.token?.holders ? `<span class="chs-card-stat">+ <span class="chs-card-stat-num">${formatNum(ch.token.holders)}</span> holders+ </span>` : ''}+ </div>`;++ return `+ <a class="chs-card" href="/character/${ch.id}">+ <div class="chs-card-top">+ ${avatarEl}+ <div class="chs-card-info">+ <div class="chs-card-name">${ch.name}</div>+ ${creator}+ </div>+ </div>+ ${ch.description ? `<p class="chs-card-desc">${ch.description}</p>` : ''}+ ${statsHtml}+ ${tokenHtml}+ </a>`;+}++async function fetchCharacters(reset = false) {+ if (state.loading) return;+ state.loading = true;++ const grid = document.getElementById('chs-grid');+ const loadBtn = document.getElementById('chs-load-btn');+ const loadMore = document.getElementById('chs-load-more');++ if (reset) {+ state.cursor = null;+ grid.innerHTML = Array(6).fill('<div class="chs-skeleton-card"></div>').join('');+ }++ if (loadBtn) loadBtn.disabled = true;++ const params = new URLSearchParams({ limit: '24', sort: state.sort });+ if (state.cursor) params.set('cursor', state.cursor);+ if (state.q) params.set('q', state.q);++ let data;+ try {+ const res = await fetch('/api/characters?' + params.toString());+ if (!res.ok) throw new Error('fetch failed');+ data = await res.json();+ } catch {+ grid.innerHTML = '<div class="chs-empty">Failed to load characters. Please try again.</div>';+ state.loading = false;+ return;+ }++ const chars = data.characters || [];++ if (reset) {+ if (!chars.length) {+ grid.innerHTML = '<div class="chs-empty">No characters found.</div>';+ if (loadMore) loadMore.style.display = 'none';+ state.loading = false;+ return;+ }+ grid.innerHTML = chars.map(cardHtml).join('');+ } else {+ grid.insertAdjacentHTML('beforeend', chars.map(cardHtml).join(''));+ }++ state.cursor = data.next_cursor || null;+ if (loadMore) loadMore.style.display = state.cursor ? 'flex' : 'none';+ if (loadBtn) loadBtn.disabled = false;+ state.loading = false;+}++function init() {+ const searchInput = document.getElementById('chs-search');+ const sortBtns = document.querySelectorAll('.chs-sort-btn');+ const loadBtn = document.getElementById('chs-load-btn');++ let searchTimer;+ searchInput?.addEventListener('input', () => {+ clearTimeout(searchTimer);+ searchTimer = setTimeout(() => {+ state.q = searchInput.value.trim();+ fetchCharacters(true);+ }, 300);+ });++ sortBtns.forEach(btn => {+ btn.addEventListener('click', () => {+ sortBtns.forEach(b => b.classList.remove('active'));+ btn.classList.add('active');+ state.sort = btn.dataset.sort;+ fetchCharacters(true);+ });+ });++ loadBtn?.addEventListener('click', () => fetchCharacters(false));++ fetchCharacters(true);+}++init();diff --git a/src/gemini-jump.js b/src/gemini-jump.jsnew file mode 100644index 000000000..dd658266c--- /dev/null+++ b/src/gemini-jump.js@@ -0,0 +1,220 @@+/**+ * Gemini-jump demo+ *+ * A faithful port of the viral tactile UI concept (Gemini sketch):+ * the avatar leaps onto a HEAVY 3D button mesh sitting next to it in the+ * Three.js scene. Volume-preserving squish, elastic recoil, shockwave ring,+ * cinematic spotlight. Real `cz.glb` + real `jump` / `idle` / `celebrate`+ * clips via Act2Viewer + the project's animation manifest.+ *+ * Loaded from /public/demos/gemini-jump.html as an ES module so Vite resolves+ * the `three` and `gsap` imports.+ */+import {+ CylinderGeometry,+ TorusGeometry,+ MeshStandardMaterial,+ MeshBasicMaterial,+ Mesh,+ SpotLight,+ Vector3,+} from 'three';+import { gsap } from 'https://esm.sh/[email protected]';+import { Act2Viewer } from './home-act2-viewer.js';++const JUMP_CLIP_MS = 1867;+const CELEBRATE_MS = 1867;+const ARC_PEAK_UNITS = 1.8;+const BUTTON_OFFSET_X = -1.6;++const canvas = document.getElementById('stage-canvas');+const veil = document.getElementById('loading-veil');+const statusEl = document.getElementById('status');+const triggerBtn = document.getElementById('trigger-btn');++let viewer = null;+let buttonMesh = null;+let shockwave = null;+let jumping = false;++const avatarHome = new Vector3();+const cameraHome = new Vector3();++function setStatus(t) {+ if (statusEl) statusEl.textContent = t;+}++function smoothstep(t) {+ return t * t * (3 - 2 * t);+}++function buildSceneFurniture() {+ const scene = viewer.scene;++ const buttonGeo = new CylinderGeometry(0.45, 0.45, 0.18, 64);+ const buttonMat = new MeshStandardMaterial({+ color: 0xd6ff3d,+ metalness: 0.3,+ roughness: 0.18,+ emissive: 0x1a2900,+ emissiveIntensity: 0.6,+ });+ buttonMesh = new Mesh(buttonGeo, buttonMat);+ buttonMesh.position.set(BUTTON_OFFSET_X, 0.09, 0);+ scene.add(buttonMesh);++ const ringGeo = new TorusGeometry(0.5, 0.025, 16, 96);+ const ringMat = new MeshBasicMaterial({+ color: 0xffffff,+ transparent: true,+ opacity: 0,+ });+ shockwave = new Mesh(ringGeo, ringMat);+ shockwave.rotation.x = Math.PI / 2;+ shockwave.position.set(BUTTON_OFFSET_X, 0.02, 0);+ scene.add(shockwave);++ const spot = new SpotLight(0xffffff, 6, 12, 0.55, 0.85, 1.4);+ spot.position.set(BUTTON_OFFSET_X, 4, 1.2);+ spot.target = buttonMesh;+ scene.add(spot);+ scene.add(spot.target);+}++function animateModelX(targetX, durationMs) {+ const startX = viewer.model.position.x;+ const startCamX = viewer.camera.position.x;+ const t0 = performance.now();+ return new Promise((resolve) => {+ (function step(now) {+ const p = Math.min((now - t0) / durationMs, 1);+ const ease = smoothstep(p);+ if (viewer.model) {+ viewer.model.position.x = startX + (targetX - startX) * ease;+ viewer.camera.position.x = startCamX + (targetX - startX) * ease;+ viewer.camera.lookAt(+ viewer.model.position.x,+ viewer._modelFocusY,+ 0,+ );+ }+ if (p < 1) requestAnimationFrame(step);+ else resolve();+ })(performance.now());+ });+}++function animateArc(durationMs, onImpact) {+ const t0 = performance.now();+ const baseY = avatarHome.y;+ let impactFired = false;+ return new Promise((resolve) => {+ (function step(now) {+ const p = Math.min((now - t0) / durationMs, 1);+ if (viewer.model) {+ viewer.model.position.y =+ baseY + ARC_PEAK_UNITS * 4 * p * (1 - p);+ }+ if (!impactFired && p >= 0.9) {+ impactFired = true;+ onImpact();+ }+ if (p < 1) requestAnimationFrame(step);+ else {+ if (viewer.model) viewer.model.position.y = baseY;+ resolve();+ }+ })(performance.now());+ });+}++function fireImpact() {+ gsap.to(buttonMesh.scale, {+ y: 0.3,+ x: 1.8,+ z: 1.8,+ duration: 0.08,+ ease: 'power4.out',+ onComplete: () => {+ gsap.to(buttonMesh.scale, {+ y: 1,+ x: 1,+ z: 1,+ duration: 1.5,+ ease: 'elastic.out(1.2, 0.15)',+ });+ },+ });++ shockwave.scale.set(1, 1, 1);+ gsap.to(shockwave.scale, {+ x: 3.5,+ y: 3.5,+ z: 3.5,+ duration: 0.6,+ ease: 'power2.out',+ });+ gsap.fromTo(+ shockwave.material,+ { opacity: 0.85 },+ { opacity: 0, duration: 0.6, ease: 'power2.out' },+ );+}++async function doJump() {+ if (jumping || !viewer || !viewer.model) return;+ jumping = true;+ setStatus('jump');++ viewer._externalOrbit = true;+ viewer.playClip('jump').catch(() => {});++ await Promise.all([+ animateModelX(BUTTON_OFFSET_X, JUMP_CLIP_MS * 0.92),+ animateArc(JUMP_CLIP_MS, fireImpact),+ ]);++ setStatus('celebrate');+ viewer.playClip('celebrate').catch(() => {});++ setTimeout(async () => {+ setStatus('returning');+ await animateModelX(avatarHome.x, 700);+ viewer.camera.position.copy(cameraHome);+ viewer.camera.lookAt(avatarHome.x, viewer._modelFocusY, 0);+ viewer.playClip('idle').catch(() => {});+ setStatus('idle');+ jumping = false;+ }, CELEBRATE_MS);+}++triggerBtn.addEventListener('click', (e) => {+ e.preventDefault();+ doJump();+});++viewer = new Act2Viewer(canvas, { fov: 22 });+viewer+ .loadModel('/avatars/cz.glb', { autoPlay: false })+ .then(async () => {+ viewer._externalOrbit = true;+ avatarHome.copy(viewer.model.position);+ cameraHome.copy(viewer.camera.position);++ buildSceneFurniture();++ try {+ await viewer.playClip('falling');+ } catch (_) {}++ veil.classList.add('hidden');+ setStatus('idle');++ setTimeout(() => {+ viewer.playClip('idle').catch(() => {});+ }, 2200);+ })+ .catch((err) => {+ setStatus('error: ' + err.message);+ console.error('[gemini-jump]', err);+ });diff --git a/src/home-act2-viewer.js b/src/home-act2-viewer.jsindex a781d83cc..169037c14 100644--- a/src/home-act2-viewer.js+++ b/src/home-act2-viewer.js@@ -125,11 +125,13 @@ export class Act2Viewer {*/listAvailableClips() {const IDLE_RE = /idle/i;- const glbGoodNames = [...this.clips.keys()].filter((n) => !IDLE_RE.test(n));+ const glbNames = [...this.clips.keys()];+ const glbGoodNames = glbNames.filter((n) => !IDLE_RE.test(n));+ const glbIdleName = glbNames.find((n) => IDLE_RE.test(n));/* Model has its own animations — skip manifest entirely */if (glbGoodNames.length >= 3) {- return [...this.clips.keys()].map((name) => ({+ return glbNames.map((name) => ({name,label: name,icon: '✨',@@ -140,15 +142,23 @@ export class Act2Viewer {const out = [];const seen = new Set();- /* manifest first (humanoid / Mixamo models like CZ) */+ /* manifest first (humanoid / Mixamo models like CZ). When the GLB+ * ships its own idle clip, swap it in for the manifest idle — the+ * baked clip is authored for this exact rig and plays cleaner than+ * the retargeted Mixamo one. */for (const def of this._manifest) {- if (!seen.has(def.name)) {+ if (seen.has(def.name)) continue;+ if (def.name === 'idle' && glbIdleName) {+ out.push({ ...def, name: glbIdleName, source: 'glb' });+ seen.add(def.name);+ seen.add(glbIdleName);+ } else {out.push({ ...def, source: 'manifest' });seen.add(def.name);}}/* then any extra GLB clips not already in manifest */- for (const name of this.clips.keys()) {+ for (const name of glbNames) {if (seen.has(name)) continue;seen.add(name);out.push({ name, label: name, icon: '✨', loop: true, source: 'glb' });diff --git a/vercel.json b/vercel.jsonindex 933b8eff0..1b446c7cc 100644--- a/vercel.json+++ b/vercel.json@@ -902,6 +902,22 @@"src": "/avatars/([^/]+)","dest": "/avatar-page.html"},+ {+ "src": "/api/characters",+ "dest": "/api/characters.js"+ },+ {+ "src": "/characters",+ "dest": "/characters.html"+ },+ {+ "src": "/characters/",+ "dest": "/characters.html"+ },+ {+ "src": "/character/([^/]+)",+ "dest": "/character.html"+ },{"src": "/api/users/me/earnings","dest": "/api/users/earnings.js"diff --git a/vite.config.js b/vite.config.jsindex 67c811d3c..9dd0f1117 100644--- a/vite.config.js+++ b/vite.config.js@@ -137,7 +137,6 @@ const appConfig = {'pump-dashboard': resolve(__dirname, 'pump-dashboard.html'),'pump-visualizer': resolve(__dirname, 'pump-visualizer.html'),'avatar-artifact': resolve(__dirname, 'avatar-artifact.html'),- 'pretext-demo': resolve(__dirname, 'pretext-demo.html'),'launch-week': resolve(__dirname, 'three-ws-launch-week.html'),community: resolve(__dirname, 'community.html'),profile: resolve(__dirname, 'profile.html'),@@ -173,6 +172,9 @@ const appConfig = {'demos-lipsync-tts': resolve(__dirname, 'public/demos/lipsync-tts.html'),'demos-walkaround': resolve(__dirname, 'public/demos/walkaround.html'),'demos-erc8004': resolve(__dirname, 'public/demos/erc8004.html'),+ 'demos-button-jump': resolve(__dirname, 'public/demos/button-jump.html'),+ 'demos-button': resolve(__dirname, 'public/demos/button.html'),+ 'demos-3d-home': resolve(__dirname, 'public/demos/3d-home.html'),},},},@@ -318,9 +320,9 @@ const appConfig = {const slug = path.replace(/^\/blog\//, '').replace(/\/$/, '');filePath = resolve(root, `blog/${slug}.html`);}- // /demos/<slug> → resolves to public/demos/<slug>.html on disk- else if (!filePath && /^\/demos\/[a-z0-9-]+\/?$/.test(path)) {- const slug = path.replace(/^\/demos\//, '').replace(/\/$/, '');+ // /demos/<slug> or /demos/<slug>.html → resolves to public/demos/<slug>.html on disk+ else if (!filePath && /^\/demos\/[a-z0-9-]+(\.html)?\/?$/.test(path)) {+ const slug = path.replace(/^\/demos\//, '').replace(/\.html$/, '').replace(/\/$/, '');filePath = resolve(root, `public/demos/${slug}.html`);}// /tutorials/<slug> → dedicated tutorial viewer template@@ -346,6 +348,10 @@ const appConfig = {filePath = resolve(root, 'agent-embed.html');else if (!filePath && /^\/agent\/[^/]+$/.test(path))filePath = resolve(root, 'agent-home.html');+ else if (!filePath && /^\/character\/[^/]+\/?$/.test(path))+ filePath = resolve(root, 'public/character.html');+ else if (!filePath && (path === '/characters' || path === '/characters/'))+ filePath = resolve(root, 'public/characters.html');// /a/<chainId>/<agentId>/edit → chain-edit pageelse if (!filePath && /^\/a\/[^/]+(?:\/[^/]+){1,2}\/edit\/?$/.test(path))filePath = resolve(root, 'a-edit.html');@@ -521,6 +527,9 @@ const appConfig = {['dist/public/demos/lipsync-tts.html', 'dist/demos/lipsync-tts.html'],['dist/public/demos/walkaround.html', 'dist/demos/walkaround.html'],['dist/public/demos/erc8004.html', 'dist/demos/erc8004.html'],+ ['dist/public/demos/button-jump.html', 'dist/demos/button-jump.html'],+ ['dist/public/demos/button.html', 'dist/demos/button.html'],+ ['dist/public/demos/3d-home.html', 'dist/demos/3d-home.html'],];for (const [from, to] of pairs) {const src = resolve(__dirname, from);