From 3a9f9e12dd40f77c82723d7bf674ac65a52a28d6 Mon Sep 17 00:00:00 2001 From: Kunal jaiswal Date: Fri, 12 Jun 2026 14:24:47 +0530 Subject: [PATCH 1/3] feat: add MCP latency benchmark script and Windows investigation (#11) --- evidence/phase0-latency-windows-notes.md | 53 + evidence/phase0-latency-windows.json | 24 + mcp/background.js | 574 ++ mcp/content.js | 218 + mcp/devtools.html | 9 + mcp/devtools.js | 5 + mcp/icons/icon.svg | 65 + mcp/icons/icon128.png | Bin 0 -> 12506 bytes mcp/icons/icon16.png | Bin 0 -> 743 bytes mcp/icons/icon48.png | Bin 0 -> 3406 bytes mcp/inject.js | 2447 +++++ mcp/manifest.json | 57 + mcp/panel.html | 13 + mcp/panel.js | 10323 +++++++++++++++++++++ mcp/popup.html | 250 + mcp/popup.js | 96 + mcp/styles/panel.css | 3834 ++++++++ scripts/bench-mcp-latency.mjs | 234 + 18 files changed, 18202 insertions(+) create mode 100644 evidence/phase0-latency-windows-notes.md create mode 100644 evidence/phase0-latency-windows.json create mode 100644 mcp/background.js create mode 100644 mcp/content.js create mode 100644 mcp/devtools.html create mode 100644 mcp/devtools.js create mode 100644 mcp/icons/icon.svg create mode 100644 mcp/icons/icon128.png create mode 100644 mcp/icons/icon16.png create mode 100644 mcp/icons/icon48.png create mode 100644 mcp/inject.js create mode 100644 mcp/manifest.json create mode 100644 mcp/panel.html create mode 100644 mcp/panel.js create mode 100644 mcp/popup.html create mode 100644 mcp/popup.js create mode 100644 mcp/styles/panel.css create mode 100644 scripts/bench-mcp-latency.mjs diff --git a/evidence/phase0-latency-windows-notes.md b/evidence/phase0-latency-windows-notes.md new file mode 100644 index 0000000..86f92c4 --- /dev/null +++ b/evidence/phase0-latency-windows-notes.md @@ -0,0 +1,53 @@ +# MCP Latency Benchmark — Windows Investigation Notes + +## Environment + +| Key | Value | +|-----|-------| +| OS | Windows 11 Home Single Language | +| OS Release | 10.0.26200 | +| Node | v24.1.0 | +| Chrome | 149.0.7827.103 | +| Package | @nhonh/react-debugger@2.1.2 | + +## Investigation Summary + +Benchmark could not be completed. The `react-debugger mcp` subcommand +in v2.1.2 is an **interactive installer** that creates a local `/mcp` +directory — it is not a stdio JSON-RPC server. + +When invoked, it prompts: +> "Directory .../mcp is not empty. Overwrite?" + +This means Phase A (the MCP stdio server) has not been published to +npm yet. There is no stdio transport to benchmark in the current +published package. + +## Windows-Specific Issues Found + +Two Windows-specific bugs were discovered while attempting the benchmark: + +**Bug 1 — `spawn EINVAL` with `npx.cmd` + piped stdio** +Spawning `.cmd` files on Windows with `stdio: ["pipe","pipe","pipe"]` +throws `EINVAL` unless `shell: true` is set. Linux/macOS are not +affected. + +**Bug 2 — `ENOENT` when spawning npm global binary without `.cmd`** +`where react-debugger` returns both a plain path and a `.cmd` path. +Spawning the plain path without `shell: true` throws `ENOENT` because +Windows npm globals are `.cmd` wrappers. The `.cmd` variant must be +used explicitly, or `shell: true` must be set. + +## Recommendation + +Once Phase A ships a stdio-capable `react-debugger mcp --stdio` command, +re-run `node scripts/bench-mcp-latency.mjs --runs 50` on Windows. +The benchmark script is ready and documents both Windows-specific +spawn quirks above with fixes applied. + +## Files Contributed + +- `scripts/bench-mcp-latency.mjs` — reusable cross-platform benchmark runner +- `evidence/phase0-latency-windows.json` — run metadata (all failed, + root cause documented above) +- `evidence/phase0-latency-windows-notes.md` — this file diff --git a/evidence/phase0-latency-windows.json b/evidence/phase0-latency-windows.json new file mode 100644 index 0000000..cb22c43 --- /dev/null +++ b/evidence/phase0-latency-windows.json @@ -0,0 +1,24 @@ +{ + "meta": { + "generated_at": "2026-06-12T08:52:28.344Z", + "node_version": "v24.14.0", + "chrome_version": "149.0.7827.103", + "os": "win32", + "os_release": "10.0.26200", + "os_version": "Windows 11 Home Single Language", + "runs_attempted": 50, + "runs_cold_succeeded": 0, + "runs_warm_succeeded": 0, + "network_conditions": "loopback/localhost", + "binary_used": "C:\\Users\\jaisw\\AppData\\Roaming\\npm\\react-debugger.cmd mcp" + }, + "cold": { + "error": "all runs failed", + "passed": false + }, + "warm": { + "error": "all runs failed", + "passed": false + }, + "issues": [] +} \ No newline at end of file diff --git a/mcp/background.js b/mcp/background.js new file mode 100644 index 0000000..e010407 --- /dev/null +++ b/mcp/background.js @@ -0,0 +1,574 @@ +(function() { + "use strict"; + var _a; + const tabStates = /* @__PURE__ */ new Map(); + const debuggerEnabledStates = /* @__PURE__ */ new Map(); + const lastFiberCommitTime = /* @__PURE__ */ new Map(); + const FIBER_COMMIT_THROTTLE_MS = 50; + const VALID_MESSAGE_TYPES = /* @__PURE__ */ new Set([ + "REACT_DETECTED", + "REDUX_DETECTED", + "FIBER_COMMIT", + "ISSUE_DETECTED", + "STALE_CLOSURE_DETECTED", + "CLS_ENTRY", + "REDUX_STATE_CHANGE", + "REDUX_ACTION", + "GET_STATE", + "DISPATCH_REDUX_ACTION", + "SET_REDUX_STATE", + "DELETE_ARRAY_ITEM", + "MOVE_ARRAY_ITEM", + "REFRESH_REDUX_STATE", + "CLEAR_REDUX_OVERRIDES", + "CLEAR_ISSUES", + "ENABLE_DEBUGGER", + "DISABLE_DEBUGGER", + "GET_DEBUGGER_STATE", + "MEMORY_SNAPSHOT", + "START_MEMORY_MONITORING", + "STOP_MEMORY_MONITORING", + "PAGE_LOAD_METRICS", + "CRASH_DETECTED", + "TIMELINE_EVENTS", + "GET_CORRELATION", + "DEBUGGER_STATE_CHANGED", + "REDUX_OVERRIDES_CLEARED" + ]); + function isValidMessage(message) { + if (!message || typeof message !== "object") return false; + const msg = message; + return typeof msg.type === "string" && VALID_MESSAGE_TYPES.has(msg.type); + } + function resetTabState(tabId) { + const state = tabStates.get(tabId); + if (state) { + tabStates.set(tabId, createInitialState()); + } + lastFiberCommitTime.delete(tabId); + } + async function getDebuggerState(tabId) { + if (debuggerEnabledStates.has(tabId)) { + return debuggerEnabledStates.get(tabId); + } + try { + const result = await chrome.storage.session.get(`debugger_enabled_${tabId}`); + const enabled = result[`debugger_enabled_${tabId}`] ?? false; + debuggerEnabledStates.set(tabId, enabled); + return enabled; + } catch { + return false; + } + } + async function setDebuggerState(tabId, enabled) { + debuggerEnabledStates.set(tabId, enabled); + try { + await chrome.storage.session.set({ [`debugger_enabled_${tabId}`]: enabled }); + } catch (e) { + console.error("[React Debugger] Failed to save debugger state:", e); + } + } + async function clearDebuggerState(tabId) { + debuggerEnabledStates.delete(tabId); + try { + await chrome.storage.session.remove(`debugger_enabled_${tabId}`); + } catch { + } + } + function createInitialState() { + return { + reactDetected: false, + reactVersion: null, + reactMode: null, + reduxDetected: false, + issues: [], + components: [], + renders: /* @__PURE__ */ new Map(), + clsReport: null, + reduxState: null, + reduxActions: [], + memoryReport: null, + pageLoadMetrics: null, + timelineEvents: [] + }; + } + function getOrCreateState(tabId) { + if (!tabStates.has(tabId)) { + tabStates.set(tabId, createInitialState()); + } + return tabStates.get(tabId); + } + function serializeState(state) { + return { + ...state, + renders: Object.fromEntries(state.renders) + }; + } + chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { + var _a2; + if (!isValidMessage(message)) { + return; + } + const tabId = ((_a2 = sender.tab) == null ? void 0 : _a2.id) ?? message.tabId; + if (!tabId) { + return; + } + if (message.type === "FIBER_COMMIT") { + const now = Date.now(); + const lastTime = lastFiberCommitTime.get(tabId) || 0; + if (now - lastTime < FIBER_COMMIT_THROTTLE_MS) { + return; + } + lastFiberCommitTime.set(tabId, now); + } + const state = getOrCreateState(tabId); + switch (message.type) { + case "REACT_DETECTED": { + const payload = message.payload; + state.reactDetected = true; + state.reactVersion = payload.version; + state.reactMode = payload.mode; + state.reduxDetected = false; + state.reduxState = null; + state.reduxActions = []; + broadcastToPanel(tabId, "REACT_DETECTED", payload); + getDebuggerState(tabId).then((wasEnabled) => { + if (wasEnabled) { + chrome.tabs.sendMessage(tabId, { type: "ENABLE_DEBUGGER" }).catch(() => { + }); + broadcastToPanel(tabId, "DEBUGGER_STATE_CHANGED", { enabled: true }); + } + }); + break; + } + case "REDUX_DETECTED": { + state.reduxDetected = true; + state.reduxState = message.payload; + broadcastToPanel(tabId, "REDUX_DETECTED", message.payload); + break; + } + case "FIBER_COMMIT": { + const payload = message.payload; + state.components = payload.components; + for (const issue of payload.issues) { + const existingIndex = state.issues.findIndex( + (i) => i.type === issue.type && i.component === issue.component + ); + if (existingIndex >= 0) { + state.issues[existingIndex] = issue; + } else { + state.issues.push(issue); + } + } + for (const render of payload.renders) { + const existing = state.renders.get(render.componentId); + if (existing) { + existing.renderCount++; + existing.lastRenderTime = payload.timestamp; + existing.renderDurations.push(render.duration); + if (existing.renderDurations.length > 20) { + existing.renderDurations.shift(); + } + existing.selfDurations.push(render.selfDuration ?? 0); + if (existing.selfDurations.length > 20) { + existing.selfDurations.shift(); + } + existing.triggerReasons.push(render.reason); + if (existing.triggerReasons.length > 10) { + existing.triggerReasons.shift(); + } + } else { + state.renders.set(render.componentId, { + componentId: render.componentId, + componentName: render.componentName, + renderCount: 1, + lastRenderTime: payload.timestamp, + renderDurations: [render.duration], + selfDurations: [render.selfDuration ?? 0], + triggerReasons: [render.reason] + }); + } + } + broadcastToPanel(tabId, "FIBER_COMMIT", { + components: payload.components, + issues: state.issues, + renders: Object.fromEntries(state.renders) + }); + break; + } + case "ISSUE_DETECTED": { + const issue = message.payload; + const existing = state.issues.find( + (i) => i.type === issue.type && i.component === issue.component + ); + if (!existing) { + state.issues.push(issue); + broadcastToPanel(tabId, "ISSUE_DETECTED", issue); + } + break; + } + case "STALE_CLOSURE_DETECTED": { + const issue = message.payload; + const existing = state.issues.find( + (i) => { + var _a3, _b, _c, _d; + return i.type === issue.type && i.component === issue.component && ((_b = (_a3 = i.location) == null ? void 0 : _a3.closureInfo) == null ? void 0 : _b.functionName) === ((_d = (_c = issue.location) == null ? void 0 : _c.closureInfo) == null ? void 0 : _d.functionName); + } + ); + if (!existing) { + state.issues.push(issue); + broadcastToPanel(tabId, "STALE_CLOSURE_DETECTED", issue); + } + break; + } + case "CLS_ENTRY": { + const entry = message.payload; + if (!state.clsReport) { + state.clsReport = { + totalScore: 0, + rating: "good", + entries: [], + topContributors: [] + }; + } + state.clsReport.entries.push(entry); + state.clsReport.totalScore = entry.cumulativeScore; + if (state.clsReport.totalScore < 0.1) { + state.clsReport.rating = "good"; + } else if (state.clsReport.totalScore < 0.25) { + state.clsReport.rating = "needs-improvement"; + } else { + state.clsReport.rating = "poor"; + } + for (const source of entry.sources) { + const existing = state.clsReport.topContributors.find( + (c) => c.element === source.node + ); + if (existing) { + existing.totalShift += entry.value; + existing.occurrences++; + } else { + state.clsReport.topContributors.push({ + element: source.node, + totalShift: entry.value, + occurrences: 1 + }); + } + } + state.clsReport.topContributors.sort((a, b) => b.totalShift - a.totalShift); + broadcastToPanel(tabId, "CLS_ENTRY", state.clsReport); + break; + } + case "REDUX_STATE_CHANGE": { + state.reduxState = message.payload; + broadcastToPanel(tabId, "REDUX_STATE_CHANGE", message.payload); + break; + } + case "REDUX_ACTION": { + const action = message.payload; + state.reduxActions.push(action); + if (state.reduxActions.length > 100) { + state.reduxActions.shift(); + } + broadcastToPanel(tabId, "REDUX_ACTION", action); + break; + } + case "GET_STATE": { + sendResponse({ + success: true, + state: serializeState(state) + }); + return true; + } + case "DISPATCH_REDUX_ACTION": { + safeSendToTab(tabId, { + type: "DISPATCH_REDUX_ACTION", + payload: message.payload + }); + break; + } + case "SET_REDUX_STATE": { + safeSendToTab(tabId, { + type: "SET_REDUX_STATE", + payload: message.payload + }); + break; + } + case "DELETE_ARRAY_ITEM": { + safeSendToTab(tabId, { + type: "DELETE_ARRAY_ITEM", + payload: message.payload + }); + break; + } + case "MOVE_ARRAY_ITEM": { + safeSendToTab(tabId, { + type: "MOVE_ARRAY_ITEM", + payload: message.payload + }); + break; + } + case "REFRESH_REDUX_STATE": { + safeSendToTab(tabId, { + type: "REFRESH_REDUX_STATE" + }); + break; + } + case "CLEAR_REDUX_OVERRIDES": { + safeSendToTab(tabId, { + type: "CLEAR_REDUX_OVERRIDES" + }); + break; + } + case "CLEAR_ISSUES": { + state.issues = []; + broadcastToPanel(tabId, "CLEAR_ISSUES", null); + break; + } + case "ENABLE_DEBUGGER": { + setDebuggerState(tabId, true); + safeSendToTab(tabId, { type: "ENABLE_DEBUGGER" }); + broadcastToPanel(tabId, "DEBUGGER_STATE_CHANGED", { enabled: true }); + break; + } + case "DISABLE_DEBUGGER": { + setDebuggerState(tabId, false); + safeSendToTab(tabId, { type: "DISABLE_DEBUGGER" }); + broadcastToPanel(tabId, "DEBUGGER_STATE_CHANGED", { enabled: false }); + break; + } + case "GET_DEBUGGER_STATE": { + getDebuggerState(tabId).then((enabled) => { + sendResponse({ success: true, enabled }); + }); + return true; + } + case "MEMORY_SNAPSHOT": { + const snapshot = message.payload; + if (!state.memoryReport) { + state.memoryReport = { + current: null, + history: [], + growthRate: 0, + peakUsage: 0, + warnings: [], + crashes: [] + }; + } + const report = state.memoryReport; + report.current = snapshot; + report.history.push(snapshot); + if (report.history.length > 60) { + report.history.shift(); + } + if (snapshot.usedJSHeapSize > report.peakUsage) { + report.peakUsage = snapshot.usedJSHeapSize; + } + if (report.history.length >= 2) { + const history = report.history; + const oldSnapshot = history[0]; + const newSnapshot = history[history.length - 1]; + const timeDiff = (newSnapshot.timestamp - oldSnapshot.timestamp) / 1e3; + if (timeDiff > 0) { + const memoryDiff = newSnapshot.usedJSHeapSize - oldSnapshot.usedJSHeapSize; + report.growthRate = memoryDiff / timeDiff; + } + } + report.warnings = []; + const usagePercent = snapshot.usedJSHeapSize / snapshot.jsHeapSizeLimit; + if (usagePercent > 0.9) { + report.warnings.push("Critical: Memory usage above 90%"); + } else if (usagePercent > 0.7) { + report.warnings.push("Warning: Memory usage above 70%"); + } + if (report.growthRate > 1024 * 1024) { + report.warnings.push("Warning: Rapid memory growth detected (>1MB/s)"); + } + broadcastToPanel(tabId, "MEMORY_SNAPSHOT", report); + break; + } + case "START_MEMORY_MONITORING": { + safeSendToTab(tabId, { type: "START_MEMORY_MONITORING" }); + break; + } + case "STOP_MEMORY_MONITORING": { + safeSendToTab(tabId, { type: "STOP_MEMORY_MONITORING" }); + break; + } + case "PAGE_LOAD_METRICS": { + const metrics = message.payload; + state.pageLoadMetrics = metrics; + broadcastToPanel(tabId, "PAGE_LOAD_METRICS", metrics); + break; + } + case "CRASH_DETECTED": { + const crash = message.payload; + if (!state.memoryReport) { + state.memoryReport = { + current: null, + history: [], + growthRate: 0, + peakUsage: 0, + warnings: [], + crashes: [] + }; + } + state.memoryReport.crashes.push(crash); + if (state.memoryReport.crashes.length > 50) { + state.memoryReport.crashes.shift(); + } + broadcastToPanel(tabId, "CRASH_DETECTED", crash); + break; + } + case "TIMELINE_EVENTS": { + const events = message.payload; + state.timelineEvents.push(...events); + if (state.timelineEvents.length > 2e3) { + state.timelineEvents = state.timelineEvents.slice(-2e3); + } + broadcastToPanel(tabId, "TIMELINE_EVENTS", events); + break; + } + case "GET_CORRELATION": { + const { eventId } = message.payload; + const result = correlateEvent(eventId, state.timelineEvents); + sendResponse({ success: true, result }); + return true; + } + } + }); + function correlateEvent(eventId, events) { + const selectedEvent = events.find((e) => e.id === eventId); + if (!selectedEvent) { + return { correlatedIds: [], explanation: [] }; + } + const correlatedIds = []; + const explanation = []; + switch (selectedEvent.type) { + case "render": { + const stateChanges = findEventsBefore(events, selectedEvent.timestamp, 500, "state-change"); + if (stateChanges.length > 0) { + correlatedIds.push(...stateChanges.map((e) => e.id)); + explanation.push(`Possibly triggered by ${stateChanges.length} state change(s)`); + } + const parentRenders = findEventsBefore(events, selectedEvent.timestamp, 100, "render").filter((e) => e.id !== eventId); + if (parentRenders.length > 0) { + correlatedIds.push(...parentRenders.map((e) => e.id)); + explanation.push(`${parentRenders.length} sibling/parent render(s) in same batch`); + } + break; + } + case "state-change": { + const subsequentRenders = findEventsAfter(events, selectedEvent.timestamp, 500, "render"); + if (subsequentRenders.length > 0) { + correlatedIds.push(...subsequentRenders.map((e) => e.id)); + explanation.push(`Triggered ${subsequentRenders.length} render(s)`); + } + break; + } + case "error": { + const precedingEvents = findEventsBefore(events, selectedEvent.timestamp, 1e3); + correlatedIds.push(...precedingEvents.map((e) => e.id)); + if (precedingEvents.length > 0) { + explanation.push(`${precedingEvents.length} events within 1s before error`); + } + const memorySpike = precedingEvents.find( + (e) => e.type === "memory" && e.payload.isSpike + ); + if (memorySpike) { + explanation.push("⚠️ Memory spike detected before error"); + } + const recentRenders = precedingEvents.filter((e) => e.type === "render"); + if (recentRenders.length > 10) { + explanation.push(`⚠️ ${recentRenders.length} renders before error (possible infinite loop)`); + } + break; + } + case "memory": { + const payload = selectedEvent.payload; + if (payload.isSpike) { + const precedingRenders = findEventsBefore(events, selectedEvent.timestamp, 2e3, "render"); + if (precedingRenders.length > 0) { + correlatedIds.push(...precedingRenders.map((e) => e.id)); + explanation.push(`${precedingRenders.length} render(s) before memory spike`); + } + const stateChanges = findEventsBefore(events, selectedEvent.timestamp, 2e3, "state-change"); + if (stateChanges.length > 0) { + correlatedIds.push(...stateChanges.map((e) => e.id)); + explanation.push(`${stateChanges.length} state change(s) before spike`); + } + } + break; + } + case "effect": { + const triggeringRender = findEventsBefore(events, selectedEvent.timestamp, 100, "render").slice(-1)[0]; + if (triggeringRender) { + correlatedIds.push(triggeringRender.id); + explanation.push("Triggered by preceding render"); + } + break; + } + } + return { correlatedIds, explanation }; + } + function findEventsBefore(events, timestamp, windowMs, type) { + const startTime = timestamp - windowMs; + return events.filter( + (e) => e.timestamp >= startTime && e.timestamp < timestamp && (!type || e.type === type) + ); + } + function findEventsAfter(events, timestamp, windowMs, type) { + const endTime = timestamp + windowMs; + return events.filter( + (e) => e.timestamp > timestamp && e.timestamp <= endTime && e.type === type + ); + } + function broadcastToPanel(tabId, type, payload) { + chrome.runtime.sendMessage({ + type, + tabId, + payload + }).catch(() => { + }); + } + function safeSendToTab(tabId, message) { + chrome.tabs.sendMessage(tabId, message).catch(() => { + }); + } + chrome.tabs.onRemoved.addListener((tabId) => { + tabStates.delete(tabId); + lastFiberCommitTime.delete(tabId); + debuggerEnabledStates.delete(tabId); + clearDebuggerState(tabId); + }); + if ((_a = chrome.webNavigation) == null ? void 0 : _a.onCommitted) { + chrome.webNavigation.onCommitted.addListener((details) => { + if (details.frameId === 0) { + resetTabState(details.tabId); + getDebuggerState(details.tabId).then((wasEnabled) => { + if (wasEnabled) { + setTimeout(() => { + chrome.tabs.sendMessage(details.tabId, { type: "ENABLE_DEBUGGER" }).catch(() => { + }); + }, 100); + } + }); + } + }); + } else { + chrome.tabs.onUpdated.addListener((tabId, changeInfo) => { + if (changeInfo.status === "loading") { + resetTabState(tabId); + getDebuggerState(tabId).then((wasEnabled) => { + if (wasEnabled) { + setTimeout(() => { + chrome.tabs.sendMessage(tabId, { type: "ENABLE_DEBUGGER" }).catch(() => { + }); + }, 100); + } + }); + } + }); + } + console.log("[React Debugger] Background service worker started"); +})(); diff --git a/mcp/content.js b/mcp/content.js new file mode 100644 index 0000000..e83b572 --- /dev/null +++ b/mcp/content.js @@ -0,0 +1,218 @@ +(function() { + "use strict"; + const PAGE_SOURCE = "REACT_DEBUGGER_PAGE"; + const CONTENT_SOURCE = "REACT_DEBUGGER_CONTENT"; + const STORAGE_KEY = "react_debugger_disabled_sites"; + let isEnabled = true; + let isInitialized = false; + let extensionContextValid = true; + let debuggerEnabled = false; + let clsObserver = null; + function sendToPage(type, payload) { + if (!extensionContextValid) return; + try { + window.postMessage({ source: CONTENT_SOURCE, type, payload }, "*"); + } catch { + extensionContextValid = false; + } + } + function safeSendMessage(message) { + if (!extensionContextValid) return; + try { + chrome.runtime.sendMessage(message).catch(() => { + extensionContextValid = false; + }); + } catch { + extensionContextValid = false; + } + } + function generateId() { + return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; + } + function getSelector(element) { + if (!element) return "unknown"; + if (element.id) return `#${element.id}`; + const tag = element.tagName.toLowerCase(); + if (element.className && typeof element.className === "string") { + const classes = element.className.trim().split(/\s+/).filter(Boolean); + if (classes.length > 0) return `${tag}.${classes.slice(0, 2).join(".")}`; + } + return tag; + } + function injectPageScript() { + if (isInitialized) return Promise.resolve(); + isInitialized = true; + return new Promise((resolve) => { + const script = document.createElement("script"); + script.src = chrome.runtime.getURL("inject.js"); + script.onload = () => { + script.remove(); + resolve(); + }; + script.onerror = (e) => { + console.error("[React Debugger] Failed to inject script:", e); + resolve(); + }; + (document.head || document.documentElement).appendChild(script); + }); + } + async function checkIfSiteEnabled() { + try { + const hostname = window.location.hostname; + const result = await chrome.storage.local.get(STORAGE_KEY); + const disabledSites = result[STORAGE_KEY] || []; + return !disabledSites.includes(hostname); + } catch { + return true; + } + } + let pageMessageHandler = null; + function setupPageMessageListener() { + if (pageMessageHandler) return; + pageMessageHandler = (event) => { + if (!extensionContextValid) return; + if (event.source !== window) return; + if (!event.data || event.data.source !== PAGE_SOURCE) return; + safeSendMessage({ + type: event.data.type, + payload: event.data.payload + }); + }; + window.addEventListener("message", pageMessageHandler); + } + function removePageMessageListener() { + if (pageMessageHandler) { + window.removeEventListener("message", pageMessageHandler); + pageMessageHandler = null; + } + } + async function handleEnableDebugger(message) { + isEnabled = await checkIfSiteEnabled(); + if (!isEnabled) return; + debuggerEnabled = true; + setupPageMessageListener(); + await injectPageScript(); + sendToPage(message.type, message.payload); + initCLSObserver(); + capturePageLoadMetrics(); + } + function handleDisableDebugger(message) { + debuggerEnabled = false; + sendToPage(message.type, message.payload); + stopCLSObserver(); + removePageMessageListener(); + } + function init() { + try { + chrome.runtime.onMessage.addListener((message) => { + if (!extensionContextValid) return; + try { + if (message.type === "ENABLE_DEBUGGER") { + handleEnableDebugger(message); + return; + } + if (message.type === "DISABLE_DEBUGGER") { + handleDisableDebugger(message); + return; + } + if (debuggerEnabled && isInitialized) { + sendToPage(message.type, message.payload); + } + } catch { + } + }); + } catch { + extensionContextValid = false; + } + } + let clsValue = 0; + let pageMetricsSent = false; + function capturePageLoadMetrics() { + if (pageMetricsSent) return; + const collectAndSend = () => { + if (pageMetricsSent) return; + pageMetricsSent = true; + const metrics = { + fcp: null, + lcp: null, + ttfb: null, + domContentLoaded: null, + loadComplete: null, + timestamp: Date.now() + }; + const navEntries = performance.getEntriesByType("navigation"); + if (navEntries.length > 0) { + const nav = navEntries[0]; + metrics.ttfb = Math.round(nav.responseStart - nav.requestStart); + metrics.domContentLoaded = Math.round(nav.domContentLoadedEventEnd - nav.startTime); + metrics.loadComplete = Math.round(nav.loadEventEnd - nav.startTime); + } + const paintEntries = performance.getEntriesByType("paint"); + const fcpEntry = paintEntries.find((e) => e.name === "first-contentful-paint"); + if (fcpEntry) { + metrics.fcp = Math.round(fcpEntry.startTime); + } + safeSendMessage({ type: "PAGE_LOAD_METRICS", payload: metrics }); + if ("PerformanceObserver" in window) { + try { + const lcpObserver = new PerformanceObserver((list) => { + const entries = list.getEntries(); + if (entries.length > 0) { + const lastEntry = entries[entries.length - 1]; + metrics.lcp = Math.round(lastEntry.startTime); + safeSendMessage({ type: "PAGE_LOAD_METRICS", payload: metrics }); + lcpObserver.disconnect(); + } + }); + lcpObserver.observe({ type: "largest-contentful-paint", buffered: true }); + setTimeout(() => lcpObserver.disconnect(), 1e4); + } catch { + } + } + }; + if (document.readyState === "complete") { + setTimeout(collectAndSend, 100); + } else { + window.addEventListener("load", () => setTimeout(collectAndSend, 100), { once: true }); + } + } + function initCLSObserver() { + if (!debuggerEnabled) return; + if (!("PerformanceObserver" in window)) return; + if (clsObserver) return; + const supportedTypes = PerformanceObserver.supportedEntryTypes || []; + if (!supportedTypes.includes("layout-shift")) return; + clsObserver = new PerformanceObserver((list) => { + if (!debuggerEnabled) return; + for (const entry of list.getEntries()) { + const layoutShift = entry; + if (layoutShift.hadRecentInput) continue; + clsValue += layoutShift.value; + const sources = (layoutShift.sources || []).map((source) => ({ + node: getSelector(source.node), + previousRect: source.previousRect, + currentRect: source.currentRect + })); + safeSendMessage({ + type: "CLS_ENTRY", + payload: { + id: generateId(), + timestamp: Date.now(), + value: layoutShift.value, + hadRecentInput: layoutShift.hadRecentInput, + sources, + cumulativeScore: clsValue + } + }); + } + }); + clsObserver.observe({ type: "layout-shift", buffered: true }); + } + function stopCLSObserver() { + if (clsObserver) { + clsObserver.disconnect(); + clsObserver = null; + } + } + init(); +})(); diff --git a/mcp/devtools.html b/mcp/devtools.html new file mode 100644 index 0000000..5cd9e44 --- /dev/null +++ b/mcp/devtools.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/mcp/devtools.js b/mcp/devtools.js new file mode 100644 index 0000000..3612e49 --- /dev/null +++ b/mcp/devtools.js @@ -0,0 +1,5 @@ +chrome.devtools.panels.create( + "React Debugger", + "icons/icon16.png", + "panel.html" +); diff --git a/mcp/icons/icon.svg b/mcp/icons/icon.svg new file mode 100644 index 0000000..5f8346c --- /dev/null +++ b/mcp/icons/icon.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NhoNH + + diff --git a/mcp/icons/icon128.png b/mcp/icons/icon128.png new file mode 100644 index 0000000000000000000000000000000000000000..33960cfdbfd5779f6dfd8ac1049071216dd377da GIT binary patch literal 12506 zcmV<0FeT54P)*2tJ{=N6eb}+0^k30?vx}XlRAMA zz0Y$V(g?$RzW3g9&OP`1e0;9q(fslG+NKY?c9S){e<8_doR7ML7uVJwy12XU_09*c z_G`K3$Bg&k+xSt}HYR{SUVP98xXx#skJ>|B&GoNe++F|r#hp!u@qe%O>$#>!8=o~92wHxvBk4=>*DbB&C~Ly)-y&~UIb z>uSHAYj)Is*jeJ5{q-Lqwx1vQ@nnHqKZ!3c@a2dX_;Mvr`tqdveR-1KP3B4d=*yLU z?#q*$^5sj;JMEM&Px?9g9$)f1`dL4|}>lP9~?SYHW zj_o@&0mme%k!Rif?qTcmZ=cM#ZwvSu6C^<~P{w3In_l9CT*{!z!&4v$jA65%C-;Y+ zKn`D?6ux}V=I1n;^?ZdtTLq*+F_1^3LLHau6h}F9X{AubW)F0@ot~)?m0CxQl2@G-ga-~_mT*+Q#Oh#AUy4O*#{tZOWzS}voOQDL- zg)B54LTxacowWQj*q7T7;QI|=9H9~dO&|lWjLw2CtqgivArcDM>Ok9#pFq~>E0FH> z6-qPv`@hs4xRAmGaDW^^C`U38zAxjtNjzyGId1gki}ayLTJ{tQH@^$(3rC^`ENVhoBw; z2*0{-@%S9qP3B0e$RnqHT@(<;_F#jh0hZ_AX0t!?`n&pper4hNxlG_Nu2c(2U@SC= z1#FwpBw8UdgfoG1_|lKKP9anuf`|!VA31`^zS?j0xEhmqQo|&k_@J*q2C*>$+7t_0 z=2dao2yK{;+$Z-llZPdZEBJnw8Er-CxI88VZBij5#z=5Q3UCCnHwFG-X4?Om01lw~ zYQN{>Vn`&C|Cz*-+%=geKF`+%GA~`1S;m%Dfi{qVNL#g$!B1ZH%(#Z{*HZ{;Ba~5@ z4nKib1Z@a70(oct!@v7$&F*vi>i1!m&-Z;y;)|@4c;bI@Bx)$4(;0YmVjlP^gBvb6 zd9K+XkY9IAz~}TZp~eJFf(82Y3MeBpkht(U*7C?Zn|!{<<0ov^^Q9L>fl(}s z)20H$6dIFA_yNbcjet0L_Yp*5v9A0x}S z7V&c*hvl*Nka_nW@FW^=gtGU1g-Wf@_hI~uCn=f46MxH78K6nAvY9UmFnjds{qw3E z%l{Mm*%omv!{<0Htok<_lxFk#?xgmP#TO56gFn%Lg& zHjyqA`m{1=;w|7yHQ);5>wK=oF^MByNz1-6E{DMexK+#Atg@0NF)X}-%iB$Bpn|!X7IG;j2S$HyY_=JP( z`8|#D0m|4+76DA8J)d*A0AdTe1rUQjHO%>Qoc2vj_#6^I zbUuTh_t+7HwJe6QxDlqpMwqOPFj*R5ENFx_v6zWK#-aloWPx$y6rS=GsnkB>bo>{k zcX?_fOY%^h@0!`hq6UQ2&+P+0AiEy&Foys{`VhDGKhgGl&Sj>G%IOwB^R0d0hgQym zDYx0Z5-7vd;Gbq=z5z#|c-JRz9G)Fa=7}Go+&-mu$?NZ#?~UiQeVuU4n103@iXms+9>qos>VJ;d5vUh{|;e;2@Odj6MP&_{QvR0gwq42Iy1E zp^nJ~SFF6m5z7jE#!)fHm+VNF_I>}p2Rj7ckUx+Bq%7@AHTqP+JCWgYm=kDW@X6#M zDSZWy-3()9Zvjw6k;D+;^ao<;YyS`k1V6jl{Cy^KCHGS?2gUkyq}v~0f^W$4B!G$Q z?Q=YsE}_&d0GTPSuK+TeVa(_u08zK8A~T^+DF z&v`x*KwcvZx%~;?`v;#ZR6v(fAhNFjGMZsXZ|(!1Od!)ipHjwzz!l2RbHyst z)#88MB(CHzUCy8~E~@15w8T@W=koUZgRf4^hktG*xC;LX51%VkARwd8Eda6B+(!V) z&@5(`!*>~lgtQe zAP-G~GAaYgXs1PW8+~7_4`nxo`h(AAcviDR0QVe(P#xGu0R7GUp2icaSX7`*C!vw(9r@W}`Y3lj?)SoxPX;Zvmz0cY37(o5ZShg!NHm{P<9 zpiL=)v8V;+hJ}cpbq|tm`vo#qZ$<87uc6?n!>~U8JCtnu6Uujf>aZO>Z2M*QN)LPa zQa>NO$b{Bq^219{KG4{ z3jB;GDW)Zp>h{TVA1Qpc{3qoz`1)L%*WlAFB28jG6DOTT5PbSGuxuK;R6?cY*^lf( z;fueAZO<2|-1n8+Y_EL<+uk0w=Sx)V{yWNF{me6LCvdm@@+h;i{%qS(*k1V>RohRa zeACy6nYjwOloH3u-w@%`>O`iA$%8hj7<{oBe6i}vg@wL6@ew-Lr;H!n$Q>zsf~-j? zU;>a+z27L|Q~p5}n+1JlIsEf$5I$`QQkFl5{AUlNV%Mjr-1iTsT?YKM9^m)%u-#v} zt!(>eDB1ES6g>47@*X>g><9OD+XGH}@HIB$tdKkm-|B=k^pVI6@k`ih?=?_DYrd` z(hWx)0(j*+lx;rBth9&aK5`f)>om64dxB5Kqg5cb06Ovo#40*9OuqsGknE);mS#WQ z+8GV}(Kvi`Q&%0Ii>Mn`py27ly>g)6w3x@hEccKgenVJi#ZE=)&NiS_z4N1pV&aV+#MLLZQf)C+Vd7_!PR07Czme z?dkXp2A=-ow7e(W@)(LXzK8NxKZR}Y-@AeD>$Zx$U%~R+5v1JpJi@0fWrtAA|lGXePW#0$A%HJkln=TYxyX1>b-q&h&4;3?Eh%t!o! z2T-*6eFoiS6??wuhQ8-Z6g=}5Qtn!h@Ts>$pHtP#+wTv)A+L_vNZ`xEQlKy=L&SO# z3>`jM^1_YCy89p^8&~$(lZ$mJSd*60s@(SYzs#w zbHyJ?f})uKNC=~WPql(nA3y?7geUg_Pj9Tb;b!Eo`!$1IMz*ut%3u8)#oPYO_U(vi zOW~he?J?B596qfgsms@+`q0;?IrI(t9aMrfT=D zFZK_0gQvtw^3ruEefclFfS2uXnB|$b5PjoHgw)Q3KC7Zvs5cmVZE^u(X0JrWp3hM8 zMk{K5-HMuDwW9h^E6R6&fw;L3KpmYkEco(}M96~T!IwD0xIv77Wi8*&1Q1+u(}3PS zPpU!k&CjD`{b$T9kG>C)DzIM>s3{~&C0ps8$U$s+_kJv57imCLcQU@H`m>SqOI?v<~OZw_yz0UK>oVJ zs6N<=>epLQeV`SE>wk~nvROlhFAq+HJSc&cZw*BN6uJ?7GDBw5prIaL=8wGl-$Kc= zpD_!z&gxeHQezbS(<&iSns>X7}&4%EDP3^i{$;Fs_CE23|>+r8(9H7;gZyXyU| z%&PXaBIm&a@K3KC5`5Z&DL>Db2MjC#kplA26t@7haYX~dckTH>g>z8y%xBD!7jEb) z0I?DRnU)EFUJFmGIO0|K91h2qTCtJ$-+$~s{7{d2^JP8wYBz8v^wO6;LBhgEAvY)W zo8`Ma!{-S;eJx?}!>Bs+Pt?5C%HUTX{1=j!J_T)pwU5K6ip@proV6(5`4y^OYem)G zR#fcx7vdK@4rNrlc~b9Q1bL=D0%8LWGvg=2foWR zaTZ53AXavAx%v_HG3<9x6GmEk>CL9x{b=A*5+!cl11Nj>Zw$E0D9aW#^KRCfZJ^x# zP~b<*ScE@W~XR$c!@=+`Gxr1Yu%6g-<5Ynb|fV)`n0Av$ft609X70b>O5XjNQeaLx<0mXb`{PA(XxRDYJ^5 ze@E56e?sYQQcwnoBwjdx9$HNvGeYOHo@YCPYs(W?kB&Z8-62< z`3-D!ptLXjoNLclhNU8M$_kWi`V5uZTT%H+E6O+jn|a&)!Iv7M9R(f)(!;?{Wc>;z zfRsgBhXh|B)gk}B-=b{8KTxst7?N&T4`q02zXG5GC4H(5ir^#?fY-voANz8}=cwSb zd;cFgd@AwIzJCup2`hD4@y3r3GiN0N3hIVj%t7b*11a#)V3;U3)%l5vg~)1l!B4 zux&ez!2Id`!#6}R0q~_dkKtY1%*U7j;%|InQ21n~oarce`tPXNatx*GKSxCU?NElL z^(z2YClF_4p)6OVJm-~*rPOtspi|)oHB=rBe3>~3mS^5^gD>576bXx-WJw!}0JNz^ zL$2f@-(w(e-`u#sJ^Rgd^WE@usiiPkn;3YLwFOmWrC42)j)k^7w3HR1xzvh_JgNUrZ zXHfWL!KDjOvGEuxHnk#k$z~Yyo57Q)`h`!XipX>y4*80dno$d25?^E?0MsX!mg^zM z`N0XWKJy-fPFAw%F93bJwGiN2Wp6@&il&!G&`Mh0m9$5n3@1$%{51`IZd`shA6aGQcBzG7>ALg=stB zh*f!`76A3zr*n340IBivP~ZzS!LU624oY7-%B*nxhtR|oxR-lPQa%ipx&b}@%j@-6 z8P@>mU30^Hx5sa;ozG^k3%=1g^9g=Xfn(24FRZ{V71>x+o`ckaN(AK8Auy{Ji>&#m z$SY>>1JbJzkXFSUKAQCe-?p_Cro3q$;fwvlA=ZZWU(08VW$?*#$yEcwcL~63TY#{d z#Rw_C31V&VfbhvE6!lN7f>34h&bfduSF(=4v;4nIKPY@U;Y(Y-1*Kb$GAmmD5sRZQ z&-K%B?r;h?X$u14wzk5y#VG(!@bzIVS=FBawDHAm0mwts288cE z?)496y#hp!9fL;q%q(VVp9k%Ij(8L#b zrFxfv_W+;vdnN!%@g8o4x%wuS;9&x=G$XIb#`b*I%Rcw;b**P8Lq%1ESUSFo8s zKhKJ+%rXX_mQ!;0XxS(D6`NaO%AM*FKC^xWpoA%JI)k6N;vhsSQyZr(d@^c7M*<+x@7Hmz((89ov~$>yWX%=NeRJ=2${Sw}4Dk2jps zZ3lSI=lQhk6MV|?hgQvX2*Bb9^{Prr(Og={_WZ>a*?r)*Rz;w-A_fa{t!&wE$|*uc zRw;u|?Oe#=qghYz$r&@|P8k5c*%^oT&G3a)-p&M&zGP=F@U*lWbDChTUhK46S?{3X z!gm=ZgD4c_iBxZoS^$%I(m&B-R>)%?QYDW-219-mGY0RnnNL+b25Y0UlzixQ`&7C; zP%#HB`>xYHCV;3ccbs2UT;dQwUOn6M`-6Y1Bn}I63lWfBg{JIclxLQ}KZOKfV-6n^ zz@}D|lK`??27n(5ktVp`3}4)gN0|WPZ(QewuS+aOSmiAYy32w~X0w?*68KC2N##(Q zS+3w?ZwTN^N{Y}PJk&BSDi}2uHbI?`*Js(MgB*td@`rV4gX;DNs^p<%-*vPbS~-^; z>AI3UIfWHiSeD1U{j>rb+w(7n|5afUQZp;qvOh1|icESsNQw=*WD-COTlNWl`9_BT zJi^z8u-V&Rk|%ZXHe@Y7h=}?X?)|+dcoKp>sgzy&8Yz4}2_Ufqs<3qW{EJZwz?UaE zNhw%*uFgbvDE@JSb(rmap+X6#s1%t0ks$dQuE&Bw&{6!K#vq$(e z`&og=W$=Yc6S7wxM%Ic$2+Y6UUC0qqHV@{iTiK0Z@*PIH?7QHT>Eeo@j>x7h;P~hT zz?Ym?L}#*QPeU!>49Kf>3xM+L?y_yEmcb{ZqvhdT*P`0XWa~Ln>yogB@2h z3Yz(prId1Z!q+91Gl!36J;5)3p%n%a zfCu;@br7otcAw`Dxsa~1?&ns&yfur z8vzVdyh+f*8Wu4ND!&mNk;;+JrxV50V)*A&x}L8y7J%Y{U1P--sUv5rz3xMKrZ`{(A1;=@;-lb*VA%Iq-ulyy{36@@` zdYZ%{cY2qSJlR?0EYu@!pB%oPd%ij}az zN7S^t8GP5No-!f>y5w^AvhSZ-=??V>J}udb;AD4_hpt?itCynqiKFh>U;5O)5s+4k zkkWbVl4nHSU2K03ue%E&WedQQXx)HC>OgizPX(hHckV;hT?b( z80gEF{FYAQ=rCxw*R?KR_Eiaah?%p7m0r;uIC{9!aPQ~SZ1hyRZOCgt-ebRJlGp5R0_YxOA=-SCqtpo++5;hqb=F|!f*_rHsZ7f+!4`Qr?J*0R^3 zjV*$?axsJ66MlHzGWe&}_FuPejAP*+3BW(4W=!GpB`Q`Tt_Vq@pMBdasbEQ96nl)S z`7GjZeiY`qMa%-rZiJeZGpmNwoPi$QI#}I)Nc92~KmR9G?P_&Y z^z3Lw_L_arCzZG>dE`M!&Kf!kWPu4R)RP7!Ah>uIa#p{A$}Oi+x#bLOo6n&1*?+@a zeye-WH|0-vz^_||;NrO~TPP1o1i#1Z?`i%i)eJrv{kvlcpNc~r2UwJC^+GDxk1t(E zr*a_bof z{Ea7B<}Rx79>@dZyB$7F2;?D25b460(?=(70(pSP1D!D2?F@d#9edd^?O4GlqeCMS z0416D615i&gZR<~1fB%oIKCbE!H$9Y02Vevn^p>ax(&g$c`(;3Vn$1}3%(*e9p)NJ zkM_2}!s}U`Jc)sB>9Q1X)gpw~FGU!$+Y!;Y3?b$7+4t#pYT^r#xoR(}cb!HR*{f$z zzU4p2Sh@pI&8t|L7g#t8mY;tN+tyQV_yv!AjF>5F5nMEfm2da;_JiE;g-RoX;7I_9 zbDm=Yh@0{AF@;Yi4TwNMY8CT8_!9N#kApdUnT2(>N-t**QXb8z9z6%pKgY&8iqPkj zE_J0;doKIR$gDo_%~iJ`wCWb-(9!Fmyg*RV^@yH%zth$tdd6BrPrnb*)9;0UdX>9+ zH?UwDl5c(ir5nCL)y^~QUVhapXHfXWC&*cI*pcFOrg<$7eZUGgX-W4S>h*+ga^&qj zz^80q)}8yA078o9k12dIM?pvx+X@8UCQ0Q0@2P+9n8P$>QP#r!Bqm&Vutisip z+l;`%8`!Ki6-)z9rt9vv7n9!ud^h~4rn{kz%yw7rQYJ3AXf{Gh=ObzUb4s;~9{>Ol zfJsC_R49M(pRm1j5*1sHyWtnFJIXwMDySGJ$#Xe;%H$1np0AF~b?*O%*h(^%@X6E> zSKn)nkp`)rJYOk&cNgl9tn*lY|{ z;Xf#U;cFz#Uk|xCZNT(yzwl)P!zai=1vk0{&^zVpefR`j8&~Ma0*cigUVGYzA5ZcD zo#9g`NFBFE0-wPOjfXhE?DbY`tQpi0E^S<1#-)zTfhsb4z=NHU&U_c>n3lB+e#(N) zV-BALNx2QG1>j56-n%92$CErj7eeS^$U;rfh-N-@6rWyvja z0Qq87zSji6@nxO#NHYq(MzZHCB2pXzur!QW2TqsKaV$A=-hwYs7(FI=20GO< z=1g@9fL_N~!guWdR%oK~>3f|#o?()YH-{fz`VKwYj{E>R?HaDbr;JKx0tm>h8B_SZ zgdo$iyLt@#u;B-?ZKY>!e>m{j{@;8*gP*$SC(K?H}R2%=f9Nhp9SCi{wpdZU6r zjP|SCA>7p)3Vbr9Io-Yd>r<-76h4_IrU1J5BK9#yqz(2Ni{ZzUeaIehno$m}O#1_T zv1b7US!Ou|u*hKHkYt(A@Oe~|mr(9r{x#9oVZ+zNW5f74jk0mHx)M_cJ68>020kahR>I1kbdhU zqt*IL^3biE$f+w3JNp4v!0Cb?kltGW*D`z__2E{9Lx zjhR!Ri!1e*^`q-+>WCbw`MatQj%34+FT0Pxv)+0U86J~7)Z>qZfr*w0x9szJnA{YP zVC!rcvzi#J(I$ENIDU~i@K3fuqzHgOtX}Ce9v&Xe;miI`cj;&=pySs5;(T3Ni8B#o zov`rvVil`5bnW3HXSuky;8T||O8O`Q<7xJPB@&5#>N6gOqjX$xi7t2OQ_K21HIs#m zsl_l_`U+qo!RL!r3=j!GpH$&h_*CZ~kZgk{G7kcY=8{)RzP&m81hV_7@e|$o(G!Vj8HeL1enR;X$_&z0 zKv%OSYN*HaklPo^^f08?F{6*Y0iW&r;aLbsse(isLcil3pUBAn@)?hVBb6#R0{ICl zA$Np^ao-#GeD`wi0_Pq0RN_tBiZUpHoW4_Hv0CLbo`;`MQN$6-FVaO#eOd*?h6o3A z@{q%mAr1(exbVf^+w;lfPNz>Do&|wK-Nlz(!RG^yW^jbk>p3C?yTZ*P1HBp2pjhWa z8X6gZi3VS0h+?^Uk;>>5_^if1r3#wJTnMBZ62KgvYiV!Cr6uv@&*RL;@hA zixm?IzCfyjA+wP=fU5A!(Zko85s+L7ZL|eKnT{R-bEnU>I5{K@{P8RjW1T7 z{dz-HyM29CyZyPUcKb8c?e?du+wJRW+U-x)wA&xAX|w;Lw$1)%ZJYg(+BW+`b#3;w zH77e)*Br;{x|3Ml@GVw0oWhE_<5*tTie+`JxTCHWOY2*)r2ZIgt3QUt^~Z2a{W09! za109@j$wYoG0bZ`hMO9{!Q94gFuUm+%xd}uH#C2Pna$r|M)NmlZulIQf-O*LldsC2 zuTQoy_=dDv#{-*2yyr)=WnUL#W#OJcqT1@U3!bBazsc6|j~6S?+Fz(VYagxv9;|D# z-&=d?!m66%SXF-tD;vJWin-o7*-g288Z@#b+oJqh66y0*5}4X4kos6BpZdHr!FfIAybVrjz(uL+=e z%GXy6zEG}n_5mC|e5xIw+&-muS%y!nJ~1xid=kK=i(un#2Rbjf1aRzcU0w9G9ZNde zNdSk}ojXULf3)}f1y2IFuc57dO=DZfss?+v<2MRZ~}KUp2U)d<2ZfF@elp+ z_vhRK`1tqi*J9lR-!cKLx#I-;{KWAtw*cnNIp%nQfI|RRXy*H;RIt6DE@liBJRK2J zV+zN9pX+k=elPOI6TZe;02jM}SLU8=ABq5;oz>pt0Ka;{@%{G?obO!S*w((Psm*@wEH2Snv1)p|{mv%4 z{q!lv>ahHV6FB}&7ykK0C;s^Ud4~WV>@9$fj!Ss+@L6WRJ#uyc0eIir7f@AhLJ2GS z5X$}g&UpWDXk!Z*czt3iK8`hao*Kp$aOFZh zq0#_Fa3Z^?Ne&(fgl_DRSOjAAAFfvEw$}ylV*OdW{do62K2!m$ztyn?w0(E+(kl;l zbR5}ro=xp9|LWKRdJ1604feL%TI}|Jf7Ru5KOHN;P0g)Xv+Ub$0kj;$jOJq=1TZ%6 z1(c|fXxwdC2r@Nip!@lBMVoHvvWuFmC$RbmPpT=rYGvDFApi;k-+s~odpH6hCveXb z=Q`SZID!B8TUXbk3)|cK6Tq#_cKiB=9lwLE01uw-a%=%7-2%9N%5lt`avbw->h=qo zr+hPJ@Wr}N1Qp!CI)u|xIS4qL?eRq{5};LpHE5EkcJoB4bf1YZhMEW(N+$3=N(nc% zwLLbk{oMUGw0GRy)Yi75vCZxhz#UC?`|VA3`;sQRodmGB*=}FdY`5RsVz)1BIb)yS za=LA9^Qm*Qn_IhBB8XOimR3xkdJNO1wqnZERhPy${G7jQ_k3DPx-F>`Y9*R&unS!a%2L(LCchH(9rY+ zYZps~i)004x%2_X6n!(zb0%&6_>|^>GJ!ymfj_aAhu4Ucvy$YBsZb683 zw!0YvTjC|E8J!8LN>KXgYY2UR?pL*(S z%ar363JPC2!4)abv6(K>um+FR7LFQ6(o;0(iJJ6KMVi%`=v-#>F+F3493-obzc!^_?%v17b?9nJ{j&S}Uu0%DDD^fne6Djxc#Hu4avGOCHSoJwy zq&mqLDbF(#t4{JHs?VL@dz&Xw?xTk-P``aj)=-+(w(Yc`b~~(%+oALMz747gc+uAJ z!V9*u|M7|dXccH`Yagx;Fu)4%pBdA?d)^6u%*L{1_|aJY{vXCT9LtvBM*yzfFz$yj z@?qVD|EYcz*|j^7HRFAZ-vgU#anKvu_(o@X(_2UzuWxS6_6sqz@7HecwA!}e|6T3Z zGogmdseYIcDgdFup5KIE7`%R}M?=}1%pK&xAw?jvJKdl5;`?XBiQTGle*Zl^T zhBr`P`|S^V?Duj^c^i{#hcPa)YPN0o@2Y)JkGIw6hj9hQGT=wGJCRcRDy+3TE=2zD zreEPv`xdl~zq)#9*1BDYVDPuYTC*GeSL=0rF9&S{wTC;cWOawz?P);a2|ffu1U}dWGO~J!-mL$i*M#b=QZ@^|F(a&NZXNhN z{0@A+=X=iY{L0EoM0$QXuC@-G=JZI8Ga@-gkMPbLX;znqmEa2LOr7h^>7ca5+K$#qyGFYbf!{hZ%HH4n**(wj(}ZVZ8!qD zGWe+=K!|~#Y#cr4APUji=fEUq-y;hJ0Zt2N2wnkSlW<@!EyBxe9Kv2AR)X4?0mW5<)1#n7-EJwh z^(pZT|L;<#Kvx*6d z_uKHYOZsaQKfYc6^=>Yoe?FVfFFsuT{bq3$*T!FM!fK5@{WUHSyDQ7`&TVUKJD5K9 zW9oMH`^?zjx2e&SpYI<`KA7|w^*PauU-dWjWf_LqRq_)R$I*H0=zM~T;#~GI+;;w7 Z&>xh58$brSowxu1002ovPDHLkV1m3?Ns|Bo literal 0 HcmV?d00001 diff --git a/mcp/icons/icon48.png b/mcp/icons/icon48.png new file mode 100644 index 0000000000000000000000000000000000000000..7f7de15f8c8c1a0539de4ab6919c4ea43ce325bb GIT binary patch literal 3406 zcmV-U4YBfxP)T~2@O-=`@=Rj!Ukv=pRGm-BTb}W6*ml+$>Vn2#N2-=XvQjq|srWUO~zf#NOM)!?)BhMth^M!+7p`Cv1PQM&mjNKvy$R?@S=r>K~* zP>)5bmIrOk0_*le@Rq+A-t)oEFBCpS$wVnz&LC~ik)W-iZa5=1UlP15Ld`&-6~HxwLb@GyI?UzeA}L!DSRf#ii{b-+j68Ur{o~U5wX1 zq0VUuOf0B^SWq)>@TnRW#q0W@(23GPCp)3#%)Nx+lIc?@egnxo?Z}4cuYs6f1BK2g z!KX;OF@Nx>M8Nt!m?~Oe2-Jgd_`rLLp`wgyFA4seDO91(!Hwcpv)dnX75``CezpFjGv+rZecwIa?O*n8HeX{%c0U+XM|Vr7SOgV zFr*VZa-p;5N?xz`1z{*`L|S;Pbi-aKG@KM_&LRmQ!Fh_I z)EQRI37)3uZ&23EkCd!Q7BJE04JD0I{Z9q2HrQZoT!NgQ%_zR(#|S?B0-E}cApG>7 z(el)BH1xiPn(eEa_*(lCsoOAk7dH1i7v-}>^KKx&(-25zr>`ExKJd|2q zI?zf=ST?Hwjmh;YnQNwk*IL}*vP-0zHWW3YaKjFS`i`Lbhc6+p;fL@uan_fZxJ|m0BX@H!;{eJo$!C_Q7PjpogSXZEvVZz0M1n;37}10 z&}r^NGr}h)Yeh0Sl5&`8JYbx8a79-j_|S`}-+c&~OE*e>Z7gkqv7|{7Mc}iR-HN6s zj-d3;$5C>7FG9VC;pzO23{S=e*5-qX*2@A|X8?KEeP1pclKHH~wbv%qu)m3V*~K7eT3BEd8^d0&==OrnGZkrCuCi_5r%?# z*n$yMH@2XgR=s9%Kk zrVtt$n^9NajMnN9tYz&GyrpQ`eO!X4Em_3hB{(9$6J8BdQM(MU)C$P%{w^sS37#a5 zHhMstGY(8EfJ)CgkxCn6crK$9_1pWw*nMM;F`oT%%}FI#WO%)=8sT3YmwcXNp1^<5 zWx@L$Zq!ybBUsuD!CQvV&SNq>ZSqJ5mI%o1x(9-%92(97V?iUdq75pYD8rM`@abS| zzW1gTK-+Q$Qz>3_BTx2(^_9P+PhHEu|rt z{VkHygtomc!)x_6Y4)*{Eky91gJW6dEa$){!%G5m25=64VtN7g+(893xy!QdfCNSA zogCT=XB*a;FToR^U+~16@I==@$SQ-Ss2RbsW>gk8BhA+U#!&!A=w>wh;0=gbRY)(3 zLT4v-nh$5gP4Hd6Rd$=H;8jH2tUF-MI-$@RrX0*%ksdf(Zw8lHItH)dBmpYUEH^20 zWdxP?K98#Ve+f%P6#Be6@ZK`mYOX`|mV>C?{9BmvTi~d_5$4hew4z;tPOs>OqoHR; zcu9be4%VLc?u;&^(c7k+Dn&AMIsFiGgA%wsv>eXxw;<+JgK-DoS-2M7h3jD`Xh80@ z-$QfnI|$zUYXny8Lj6OpBd6k?c z9bQR`C|tP*l)*6>UMGUFWy|m+1a}EJZ`aT5MrOu$MXO+$`JSBj&2avyP z+vhS*%Eg%9D8rM6$Jl%y5VoYbEG5l}~Am%&kY(|Mm~ zO<--gl8YJh&I=&+tI-)(B+Y%5GGQkH_&-$Jg8L;$(G&nLW8GMoi!oqkGqHEV?EEr*sjuTHv*^%WIs z{t=&10!y%CUg32{kJOl^glCKpJ!Q}u(jU91XQRF0GfN+B8|vTLHZ<@^`_RA-t{xnC zAaeTf`UOW%t%zR|g+lFF0+lOM?B15rV%ZCOZ=opM`SvVNGv*VM| zTNi$Wb|I;dP+eF>GxmK z?*niDDn9zVCr3w)9gN5S<@({l|M`79vFEno;Vsd@*dwckhj-r*8(kOu=JxY$#T{8T*fT!0E563?}3nJjpuf^jp?-?1{bJv;S zV~693qy3|a?VE;&|8yjt*s*2s(+}TIoZYNrv{gI zeLQk)*9VE#$SY?#cQK@J6@s4_?qbRJouQsl#_s#IT4!8&*%`lZJ=SvOnhRa%!N}mi zmX5)JyQ8NE?pP9g;g@km^a)s#zRcD6 z0+`7D5znQ(H}W)`(Y^TcvQJjgetb1@07BA5u7-cZmEnKI-zNPvtnhw(v;Fy@IUm08 kJ|uTM880K^zX+iJ2lv=>5Iqm?d;kCd07*qoM6N<$g2scb@Bjb+ literal 0 HcmV?d00001 diff --git a/mcp/inject.js b/mcp/inject.js new file mode 100644 index 0000000..3d7ab7b --- /dev/null +++ b/mcp/inject.js @@ -0,0 +1,2447 @@ +(function() { + "use strict"; + (function() { + const PAGE_SOURCE = "REACT_DEBUGGER_PAGE"; + const CONTENT_SOURCE = "REACT_DEBUGGER_CONTENT"; + let debuggerEnabled = false; + let extensionAlive = true; + let messageQueue = []; + let flushTimeout = null; + let messageCount = 0; + let lastCountReset = Date.now(); + let currentThrottle = 100; + const MAX_BATCH_SIZE = 100; + function getAdaptiveThrottle() { + const now = Date.now(); + if (now - lastCountReset > 1e3) { + const rate = messageCount; + messageCount = 0; + lastCountReset = now; + if (rate < 5) currentThrottle = 200; + else if (rate < 20) currentThrottle = 100; + else currentThrottle = 50; + } + messageCount++; + return currentThrottle; + } + function log(...args) { + } + function flushMessages() { + if (!extensionAlive || messageQueue.length === 0) { + messageQueue = []; + return; + } + let messages = messageQueue; + messageQueue = []; + flushTimeout = null; + if (messages.length > MAX_BATCH_SIZE) { + messages = messages.slice(-MAX_BATCH_SIZE); + } + for (const msg of messages) { + try { + window.postMessage({ source: PAGE_SOURCE, type: msg.type, payload: msg.payload }, "*"); + } catch { + extensionAlive = false; + break; + } + } + } + function sendFromPage(type, payload) { + if (!extensionAlive) return; + const alwaysAllowedMessages = [ + "DEBUGGER_STATE_CHANGED", + "REACT_DETECTED", + "REDUX_DETECTED", + "REDUX_STATE_CHANGE", + "REDUX_OVERRIDES_CLEARED" + ]; + if (!debuggerEnabled && !alwaysAllowedMessages.includes(type)) { + return; + } + const criticalMessages = [ + "REACT_DETECTED", + "REDUX_DETECTED", + "REDUX_STATE_CHANGE", + "DEBUGGER_STATE_CHANGED", + "REDUX_OVERRIDES_CLEARED" + ]; + if (criticalMessages.includes(type)) { + try { + window.postMessage({ source: PAGE_SOURCE, type, payload }, "*"); + } catch { + extensionAlive = false; + } + return; + } + messageQueue.push({ type, payload }); + if (!flushTimeout) { + flushTimeout = window.setTimeout(flushMessages, getAdaptiveThrottle()); + } + } + function listenFromContent(callback) { + window.addEventListener("message", (event) => { + if (event.source !== window) return; + if (!event.data || event.data.source !== CONTENT_SOURCE) return; + callback({ type: event.data.type, payload: event.data.payload }); + }); + } + function generateId() { + return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; + } + let lastTimestamp = 0; + let timestampCounter = 0; + function getUniqueTimestamp() { + const now = Date.now(); + if (now === lastTimestamp) { + timestampCounter++; + } else { + timestampCounter = 0; + lastTimestamp = now; + } + return now + timestampCounter * 1e-3; + } + function scheduleIdleWork(callback, timeoutMs = 500) { + if ("requestIdleCallback" in window) { + window.requestIdleCallback(callback, { timeout: timeoutMs }); + } else { + setTimeout(callback, 0); + } + } + function sanitizeValue(value, depth = 0) { + if (depth > 5) return "[Object depth exceeded]"; + if (value === null) return null; + if (value === void 0) return void 0; + const type = typeof value; + if (type === "string") return value.slice(0, 500); + if (type === "number" || type === "boolean") return value; + if (type === "function") return `[Function: ${value.name || "anonymous"}]`; + if (type === "symbol") return `[Symbol]`; + if (Array.isArray(value)) { + if (value.length > 50) return `[Array(${value.length})]`; + return value.slice(0, 50).map((v) => sanitizeValue(v, depth + 1)); + } + if (type === "object") { + const obj = value; + if (obj.$$typeof) return "[React Element]"; + if (obj instanceof HTMLElement) return `[${obj.tagName}]`; + if (obj instanceof Event) return "[Event]"; + if (obj instanceof Error) return `[Error: ${obj.message}]`; + if (obj instanceof Date) return obj.toISOString(); + if (obj instanceof RegExp) return obj.toString(); + if (obj instanceof Map) return `[Map(${obj.size})]`; + if (obj instanceof Set) return `[Set(${obj.size})]`; + if (obj instanceof Promise) return "[Promise]"; + const result = {}; + const keys = Object.keys(obj).slice(0, 30); + for (const key of keys) { + try { + result[key] = sanitizeValue(obj[key], depth + 1); + } catch { + result[key] = "[Error]"; + } + } + return result; + } + return String(value); + } + const FIBER_TAGS = { + FunctionComponent: 0, + ClassComponent: 1, + HostRoot: 3, + HostComponent: 5, + HostText: 6, + Fragment: 7, + ForwardRef: 11, + MemoComponent: 14, + SimpleMemoComponent: 15 + }; + const FIBER_FLAGS = { + PerformedWork: 1, + Placement: 2, + Update: 4, + Passive: 512 + }; + const lastEffectStates = /* @__PURE__ */ new Map(); + function didFiberRender(fiber) { + var _a, _b; + const alternate = fiber.alternate; + if (!alternate) return true; + const flags = fiber.flags ?? fiber.effectTag ?? 0; + if (flags & (FIBER_FLAGS.PerformedWork | FIBER_FLAGS.Update | FIBER_FLAGS.Placement | FIBER_FLAGS.Passive)) { + return true; + } + if (fiber.actualDuration > 0) { + return true; + } + const lanes = fiber.lanes ?? 0; + if (lanes !== 0) { + return true; + } + if (fiber.memoizedProps !== alternate.memoizedProps) return true; + if (fiber.memoizedState !== alternate.memoizedState) return true; + const currentContext = (_a = fiber.dependencies) == null ? void 0 : _a.firstContext; + const alternateContext = (_b = alternate.dependencies) == null ? void 0 : _b.firstContext; + if (currentContext !== alternateContext) return true; + if (fiber.type !== alternate.type) return true; + return false; + } + const renderCounts = /* @__PURE__ */ new Map(); + const lastRenderTimes = /* @__PURE__ */ new Map(); + const recentRenderTimestamps = /* @__PURE__ */ new Map(); + const reportedEffectIssues = /* @__PURE__ */ new Set(); + const reportedExcessiveRerenders = /* @__PURE__ */ new Set(); + const reportedSlowRenders = /* @__PURE__ */ new Set(); + const EXCESSIVE_RENDER_THRESHOLD = 10; + const EXCESSIVE_RENDER_WINDOW_MS = 1e3; + const componentRenderIds = /* @__PURE__ */ new Map(); + const trackedClosures = /* @__PURE__ */ new Map(); + const staleClosureIssues = /* @__PURE__ */ new Map(); + let closureIdCounter = 0; + const originalSetTimeout = window.setTimeout; + const originalSetInterval = window.setInterval; + const originalAddEventListener = EventTarget.prototype.addEventListener; + function getCurrentComponentContext() { + const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + if (!hook || !hook.renderers) return null; + try { + for (const [, renderer] of hook.renderers) { + if (renderer.getCurrentFiber) { + const fiber = renderer.getCurrentFiber(); + if (fiber) { + const name = getComponentName(fiber); + const path = getComponentPath(fiber); + const fiberId = `${name}_${path.join("/")}`; + const renderId = componentRenderIds.get(fiberId) || 0; + return { name, path, renderId }; + } + } + } + } catch { + return null; + } + return null; + } + function extractFunctionName(fn) { + if (fn.name) return fn.name; + const fnStr = fn.toString(); + const match = fnStr.match(/function\s+([^\s(]+)/); + return match ? match[1] : "anonymous"; + } + function trackClosure(fn, asyncType, context) { + const closureId = ++closureIdCounter; + const capturedState = /* @__PURE__ */ new Map(); + const fnStr = fn.toString(); + const statePatterns = [ + /\b(count|value|data|user|items|state|props|isLoading|isOpen|error|result)\b/gi + ]; + for (const pattern of statePatterns) { + const matches = fnStr.match(pattern); + if (matches) { + matches.forEach((match) => { + capturedState.set(match.toLowerCase(), `[captured at render #${context.renderId}]`); + }); + } + } + trackedClosures.set(closureId, { + componentName: context.name, + componentPath: context.path, + renderId: context.renderId, + createdAt: Date.now(), + functionName: extractFunctionName(fn), + capturedState, + asyncType + }); + return closureId; + } + function checkStaleClosureOnExecution(closureId) { + const tracker = trackedClosures.get(closureId); + if (!tracker) return; + const fiberId = `${tracker.componentName}_${tracker.componentPath.join("/")}`; + const currentRenderId = componentRenderIds.get(fiberId) || 0; + if (currentRenderId > tracker.renderId + 1) { + const issueKey = `${fiberId}_${tracker.functionName}_${tracker.asyncType}`; + if (!staleClosureIssues.has(issueKey)) { + const issue = { + id: generateId(), + type: "STALE_CLOSURE", + severity: "warning", + component: tracker.componentName, + message: `${tracker.asyncType} callback "${tracker.functionName}" may be using stale values from render #${tracker.renderId} (current: #${currentRenderId})`, + suggestion: "Use useCallback with proper dependencies, or useRef for mutable values that should persist across renders", + timestamp: Date.now(), + location: { + componentName: tracker.componentName, + componentPath: tracker.componentPath, + closureInfo: { + functionName: tracker.functionName, + createdAtRender: tracker.renderId, + executedAtRender: currentRenderId, + capturedValues: Array.from(tracker.capturedState.entries()).map(([name, value]) => ({ + name, + capturedValue: value, + currentValue: "[current value]" + })), + asyncType: tracker.asyncType + } + } + }; + staleClosureIssues.set(issueKey, issue); + sendFromPage("STALE_CLOSURE_DETECTED", issue); + } + } + if (Date.now() - tracker.createdAt > 6e4) { + trackedClosures.delete(closureId); + } + } + function _installClosureTracking() { + window.setTimeout = function(callback, delay, ...args) { + if (typeof callback !== "function") { + return originalSetTimeout.call(window, callback, delay, ...args); + } + const context = getCurrentComponentContext(); + if (!context) { + return originalSetTimeout.call(window, callback, delay, ...args); + } + const closureId = trackClosure(callback, "setTimeout", context); + const wrappedCallback = function() { + checkStaleClosureOnExecution(closureId); + return callback.apply(this, args); + }; + return originalSetTimeout.call(window, wrappedCallback, delay); + }; + window.setInterval = function(callback, delay, ...args) { + if (typeof callback !== "function") { + return originalSetInterval.call(window, callback, delay, ...args); + } + const context = getCurrentComponentContext(); + if (!context) { + return originalSetInterval.call(window, callback, delay, ...args); + } + const closureId = trackClosure(callback, "setInterval", context); + const wrappedCallback = function() { + checkStaleClosureOnExecution(closureId); + return callback.apply(this, args); + }; + return originalSetInterval.call(window, wrappedCallback, delay); + }; + EventTarget.prototype.addEventListener = function(type, listener, options) { + if (!listener || typeof listener !== "function") { + return originalAddEventListener.call(this, type, listener, options); + } + const context = getCurrentComponentContext(); + if (!context) { + return originalAddEventListener.call(this, type, listener, options); + } + const closureId = trackClosure(listener, "eventListener", context); + const wrappedListener = function(event) { + checkStaleClosureOnExecution(closureId); + return listener.call(this, event); + }; + wrappedListener.__reactDebuggerOriginal = listener; + wrappedListener.__reactDebuggerClosureId = closureId; + return originalAddEventListener.call(this, type, wrappedListener, options); + }; + } + function getComponentName(fiber) { + var _a, _b, _c, _d; + if (!fiber) return "Unknown"; + const { type, tag } = fiber; + if (tag === FIBER_TAGS.HostComponent) return typeof type === "string" ? type : "HostComponent"; + if (tag === FIBER_TAGS.HostText) return "#text"; + if (tag === FIBER_TAGS.HostRoot) return "Root"; + if (tag === FIBER_TAGS.Fragment) return "Fragment"; + if (typeof type === "function") { + return type.displayName || type.name || "Anonymous"; + } + if (typeof type === "object" && type !== null) { + if (type.$$typeof === Symbol.for("react.forward_ref")) { + return ((_a = type.render) == null ? void 0 : _a.displayName) || ((_b = type.render) == null ? void 0 : _b.name) || "ForwardRef"; + } + if (type.$$typeof === Symbol.for("react.memo")) { + return ((_c = type.type) == null ? void 0 : _c.displayName) || ((_d = type.type) == null ? void 0 : _d.name) || "Memo"; + } + } + return "Unknown"; + } + function isUserComponent(fiber) { + const { tag } = fiber; + return tag === FIBER_TAGS.FunctionComponent || tag === FIBER_TAGS.ClassComponent || tag === FIBER_TAGS.ForwardRef || tag === FIBER_TAGS.MemoComponent || tag === FIBER_TAGS.SimpleMemoComponent; + } + const pathCache = /* @__PURE__ */ new Map(); + const PATH_CACHE_LIMIT = 500; + function clearPathCache() { + pathCache.clear(); + } + function getComponentPath(fiber) { + if (!fiber) return []; + if (pathCache.has(fiber)) { + return pathCache.get(fiber); + } + const path = []; + let current = fiber; + let depth = 0; + while (current && depth < 10) { + if (isUserComponent(current)) { + path.unshift(getComponentName(current)); + } + current = current.return; + depth++; + } + if (pathCache.size >= PATH_CACHE_LIMIT) { + const firstKey = pathCache.keys().next().value; + if (firstKey) pathCache.delete(firstKey); + } + pathCache.set(fiber, path); + return path; + } + function getElementType(fiber) { + if (fiber.tag === FIBER_TAGS.HostComponent) { + return typeof fiber.type === "string" ? `<${fiber.type}>` : ""; + } + if (fiber.tag === FIBER_TAGS.Fragment) { + return ""; + } + return getComponentName(fiber); + } + const EFFECT_HAS_EFFECT = 1; + const EFFECT_PASSIVE = 4; + function getEffectsFromFiber(fiber) { + const effects = []; + if (!fiber.memoizedState) return effects; + let hook = fiber.memoizedState; + let hookIndex = 0; + const maxHooks = 50; + while (hook && hookIndex < maxHooks) { + const memoizedState = hook.memoizedState; + if (memoizedState && typeof memoizedState === "object") { + if ("create" in memoizedState || "destroy" in memoizedState || "tag" in memoizedState) { + effects.push({ + tag: memoizedState.tag || 0, + create: memoizedState.create || null, + destroy: memoizedState.destroy, + deps: memoizedState.deps || null, + next: memoizedState.next || null + }); + } + } + hook = hook.next; + hookIndex++; + } + return effects; + } + function analyzeEffectForIssues(effect, componentName, componentPath, effectIndex, issues) { + const isPassiveEffect = (effect.tag & EFFECT_PASSIVE) !== 0; + const hasEffect = (effect.tag & EFFECT_HAS_EFFECT) !== 0; + if (!isPassiveEffect && !hasEffect) return; + const createFn = effect.create; + const destroyFn = effect.destroy; + const deps = effect.deps; + if (createFn) { + const fnStr = createFn.toString(); + const hasTimerPattern = /\b(setInterval|setTimeout)\s*\(/.test(fnStr); + const hasEventListenerPattern = /\b(addEventListener)\s*\(/.test(fnStr); + const hasSubscriptionPattern = /\b(subscribe|on\(|addListener)\s*\(/.test(fnStr); + const hasWebSocketPattern = /\b(WebSocket|EventSource)\b/.test(fnStr); + const needsCleanup = hasTimerPattern || hasEventListenerPattern || hasSubscriptionPattern || hasWebSocketPattern; + if (needsCleanup && destroyFn === void 0) { + const issueKey = `${componentName}_MISSING_CLEANUP_${effectIndex}`; + if (!reportedEffectIssues.has(issueKey)) { + reportedEffectIssues.add(issueKey); + let resourceType = "resource"; + if (hasTimerPattern) resourceType = "timer (setInterval/setTimeout)"; + else if (hasEventListenerPattern) resourceType = "event listener"; + else if (hasSubscriptionPattern) resourceType = "subscription"; + else if (hasWebSocketPattern) resourceType = "WebSocket/EventSource"; + issues.push({ + id: generateId(), + type: "MISSING_CLEANUP", + severity: "warning", + component: componentName, + message: `useEffect with ${resourceType} has no cleanup function`, + suggestion: `Return a cleanup function to remove the ${resourceType} when component unmounts`, + timestamp: Date.now(), + location: { + componentName, + componentPath, + effectIndex + } + }); + } + } + const hasStateSetterPattern = /\b(set[A-Z]\w*)\s*\(/.test(fnStr); + const hasDispatchPattern = /\bdispatch\s*\(/.test(fnStr); + if ((hasStateSetterPattern || hasDispatchPattern) && deps !== null && deps.length === 0) { + if (!hasTimerPattern && !hasEventListenerPattern) { + const issueKey = `${componentName}_INFINITE_LOOP_RISK_${effectIndex}`; + if (!reportedEffectIssues.has(issueKey)) { + reportedEffectIssues.add(issueKey); + issues.push({ + id: generateId(), + type: "INFINITE_LOOP_RISK", + severity: "error", + component: componentName, + message: `useEffect updates state but has empty dependency array`, + suggestion: "Add conditions to prevent updates on every render, or include proper dependencies", + timestamp: Date.now(), + location: { + componentName, + componentPath, + effectIndex + } + }); + } + } + } + if (deps === null) { + const usesPropsOrState = /\b(props\.|state\.|use[A-Z])/i.test(fnStr); + if (usesPropsOrState) { + const issueKey = `${componentName}_MISSING_DEP_${effectIndex}`; + if (!reportedEffectIssues.has(issueKey)) { + reportedEffectIssues.add(issueKey); + issues.push({ + id: generateId(), + type: "MISSING_DEP", + severity: "info", + component: componentName, + message: `useEffect without dependency array runs on every render`, + suggestion: "Consider adding a dependency array to control when the effect runs", + timestamp: Date.now(), + location: { + componentName, + componentPath, + effectIndex + } + }); + } + } + } + } + } + function checkEffectHooks(fiber, issues) { + if (!isUserComponent(fiber)) return; + const componentName = getComponentName(fiber); + const componentPath = getComponentPath(fiber); + const effects = getEffectsFromFiber(fiber); + effects.forEach((effect, index) => { + analyzeEffectForIssues(effect, componentName, componentPath, index, issues); + }); + } + function getEffectTagName(tag) { + const tags = []; + if (tag & EFFECT_HAS_EFFECT) tags.push("HasEffect"); + if (tag & EFFECT_PASSIVE) tags.push("Passive"); + if (tags.length === 0) return "None"; + return tags.join("+"); + } + function extractEffectPreview(effect) { + const result = {}; + if (effect.deps) { + const depNames = effect.deps.map((dep, i) => { + if (dep === null) return "null"; + if (dep === void 0) return "undefined"; + if (typeof dep === "function") return `fn${i}`; + if (typeof dep === "object") return `obj${i}`; + if (typeof dep === "string") return `"${dep.slice(0, 10)}${dep.length > 10 ? "..." : ""}"`; + return String(dep); + }); + result.depsPreview = `[${depNames.join(", ")}]`; + } else if (effect.deps === null) { + result.depsPreview = "[]"; + } + if (effect.create) { + const fnStr = effect.create.toString(); + const hints = []; + if (/fetch\s*\(/i.test(fnStr)) hints.push("fetch"); + if (/setInterval\s*\(/i.test(fnStr)) hints.push("setInterval"); + if (/setTimeout\s*\(/i.test(fnStr)) hints.push("setTimeout"); + if (/addEventListener\s*\(/i.test(fnStr)) hints.push("addEventListener"); + if (/subscribe\s*\(/i.test(fnStr)) hints.push("subscribe"); + if (/\.on\s*\(/i.test(fnStr)) hints.push("event listener"); + if (hints.length > 0) { + result.createFnPreview = hints.join(", "); + } else { + const firstLine = fnStr.split("\n")[0].slice(0, 50); + result.createFnPreview = firstLine.length < fnStr.length ? firstLine + "..." : firstLine; + } + } + return result; + } + function detectEffectChanges(fiber) { + if (!isUserComponent(fiber)) return []; + const componentName = getComponentName(fiber); + const fiberId = `${componentName}_${getComponentPath(fiber).join("/")}`; + const effects = getEffectsFromFiber(fiber); + const changes = []; + if (!lastEffectStates.has(fiberId)) { + lastEffectStates.set(fiberId, /* @__PURE__ */ new Map()); + } + const prevStates = lastEffectStates.get(fiberId); + effects.forEach((effect, index) => { + var _a; + const hasEffect = (effect.tag & EFFECT_HAS_EFFECT) !== 0; + const hasDestroy = effect.destroy !== void 0 && effect.destroy !== null; + const depCount = (_a = effect.deps) == null ? void 0 : _a.length; + const effectTag = getEffectTagName(effect.tag); + const prevState = prevStates.get(index); + const { depsPreview, createFnPreview } = extractEffectPreview(effect); + if (!prevState) { + if (hasEffect) { + changes.push({ + type: "run", + effectIndex: index, + depCount, + hasCleanup: hasDestroy, + effectTag, + depsPreview, + createFnPreview + }); + } + } else { + if (hasEffect && !prevState.hasEffect) { + changes.push({ + type: "run", + effectIndex: index, + depCount, + hasCleanup: hasDestroy, + effectTag, + depsPreview, + createFnPreview + }); + } + if (hasDestroy && !prevState.hasDestroy && prevState.hasEffect) { + changes.push({ + type: "cleanup", + effectIndex: index, + depCount, + hasCleanup: true, + effectTag, + depsPreview, + createFnPreview + }); + } + } + prevStates.set(index, { hasEffect, hasDestroy }); + }); + return changes; + } + function tryInferStateName(fiber, hookIndex) { + try { + const componentType = fiber.type; + if (!componentType) return void 0; + let sourceCode; + if (typeof componentType === "function") { + sourceCode = componentType.toString(); + } + if (!sourceCode) return void 0; + const useStatePattern = /(?:const|let|var)\s*\[\s*(\w+)\s*,\s*set\w*\s*\]\s*=\s*(?:React\.)?useState/g; + const matches = []; + let match; + while ((match = useStatePattern.exec(sourceCode)) !== null) { + matches.push(match[1]); + } + if (matches[hookIndex]) { + return matches[hookIndex]; + } + return void 0; + } catch { + return void 0; + } + } + function serializeValueForDisplay(value, maxLength = 200) { + if (value === null) return "null"; + if (value === void 0) return "undefined"; + const type = typeof value; + if (type === "string") { + const str = value; + if (str.length > maxLength) return `"${str.slice(0, maxLength)}..."`; + return `"${str}"`; + } + if (type === "number" || type === "boolean") { + return String(value); + } + if (type === "function") { + return `[Function: ${value.name || "anonymous"}]`; + } + if (Array.isArray(value)) { + if (value.length === 0) return "[]"; + try { + const preview = JSON.stringify(value); + if (preview.length <= maxLength) return preview; + const items = value.slice(0, 5).map((item) => serializeValueForDisplay(item, 30)); + const suffix = value.length > 5 ? `, ... (${value.length} items)` : ""; + return `[${items.join(", ")}${suffix}]`; + } catch { + return `Array(${value.length})`; + } + } + if (type === "object") { + const obj = value; + if (obj.$$typeof) return "[React Element]"; + if (obj instanceof HTMLElement) return `[HTMLElement: ${obj.tagName}]`; + if (obj instanceof Date) return obj.toISOString(); + if (obj instanceof RegExp) return obj.toString(); + if (obj instanceof Map) return `Map(${obj.size})`; + if (obj instanceof Set) return `Set(${obj.size})`; + if (obj instanceof Error) return `Error: ${obj.message}`; + try { + const preview = JSON.stringify(obj); + if (preview.length <= maxLength) return preview; + const keys = Object.keys(obj).slice(0, 5); + const items = keys.map((k) => { + const v = serializeValueForDisplay(obj[k], 30); + return `${k}: ${v}`; + }); + const suffix = Object.keys(obj).length > 5 ? ", ..." : ""; + return `{${items.join(", ")}${suffix}}`; + } catch { + return "[Object]"; + } + } + return String(value); + } + function extractScalarValue(value) { + if (value === null) return { str: "null", isExtractable: true }; + if (value === void 0) return { str: "undefined", isExtractable: true }; + const type = typeof value; + if (type === "string" || type === "number" || type === "boolean") { + return { str: serializeValueForDisplay(value), isExtractable: true }; + } + if (type === "function") { + return { str: serializeValueForDisplay(value), isExtractable: false }; + } + return { str: serializeValueForDisplay(value), isExtractable: true }; + } + function detectLocalStateChanges(fiber) { + if (!isUserComponent(fiber)) return []; + const alternate = fiber.alternate; + if (!alternate) return []; + const componentName = getComponentName(fiber); + const changes = []; + let currentHook = fiber.memoizedState; + let alternateHook = alternate.memoizedState; + let hookIndex = 0; + let useStateIndex = 0; + const maxHooks = 50; + while (currentHook && alternateHook && hookIndex < maxHooks) { + const isEffectHook = currentHook.memoizedState && typeof currentHook.memoizedState === "object" && ("create" in currentHook.memoizedState || "destroy" in currentHook.memoizedState); + if (!isEffectHook) { + const prevValue = alternateHook.memoizedState; + const currValue = currentHook.memoizedState; + if (prevValue !== currValue) { + const oldExtracted = extractScalarValue(prevValue); + const newExtracted = extractScalarValue(currValue); + const inferredName = tryInferStateName(fiber, useStateIndex); + changes.push({ + componentName, + hookIndex, + oldValue: oldExtracted.str, + newValue: newExtracted.str, + valueType: typeof currValue, + isExtractable: oldExtracted.isExtractable && newExtracted.isExtractable, + stateName: inferredName + }); + } + useStateIndex++; + } + currentHook = currentHook.next; + alternateHook = alternateHook.next; + hookIndex++; + } + return changes; + } + const previousContextValues = /* @__PURE__ */ new WeakMap(); + function getContextDisplayName(context) { + var _a, _b; + if (!context) return void 0; + if (context.displayName) return context.displayName; + if ((_b = (_a = context.Provider) == null ? void 0 : _a._context) == null ? void 0 : _b.displayName) return context.Provider._context.displayName; + if (context._currentValue !== void 0 && typeof context._currentValue === "object" && context._currentValue !== null) { + const keys = Object.keys(context._currentValue); + if (keys.length > 0 && keys.length <= 3) { + return `Context(${keys.join(", ")})`; + } + } + return "Context"; + } + function detectContextChanges(fiber) { + if (!isUserComponent(fiber)) return []; + const alternate = fiber.alternate; + if (!alternate) return []; + const componentName = getComponentName(fiber); + const changes = []; + const deps = fiber.dependencies; + const altDeps = alternate.dependencies; + if (!(deps == null ? void 0 : deps.firstContext) && !(altDeps == null ? void 0 : altDeps.firstContext)) return []; + let contextDep = deps == null ? void 0 : deps.firstContext; + let altContextDep = altDeps == null ? void 0 : altDeps.firstContext; + while (contextDep || altContextDep) { + const context = (contextDep == null ? void 0 : contextDep.context) || (altContextDep == null ? void 0 : altContextDep.context); + if (context) { + const currentValue = context._currentValue ?? context._currentValue2; + const prevValue = previousContextValues.get(context); + if (prevValue !== void 0 && currentValue !== prevValue) { + const contextType = getContextDisplayName(context); + const changedKeys = []; + if (typeof prevValue === "object" && prevValue !== null && typeof currentValue === "object" && currentValue !== null) { + const allKeys = /* @__PURE__ */ new Set([...Object.keys(prevValue), ...Object.keys(currentValue)]); + for (const key of allKeys) { + if (prevValue[key] !== currentValue[key]) { + changedKeys.push(key); + } + } + } + changes.push({ + componentName, + contextType, + changedKeys: changedKeys.length > 0 ? changedKeys : void 0 + }); + } + previousContextValues.set(context, currentValue); + } + contextDep = (contextDep == null ? void 0 : contextDep.next) || null; + altContextDep = (altContextDep == null ? void 0 : altContextDep.next) || null; + } + return changes; + } + function checkListKeys(fiber, issues) { + if (fiber.tag !== FIBER_TAGS.Fragment && fiber.tag !== FIBER_TAGS.HostComponent) return; + const children = []; + let child = fiber.child; + while (child) { + if (isUserComponent(child) || child.tag === FIBER_TAGS.HostComponent) { + children.push(child); + } + child = child.sibling; + } + if (children.length < 2) return; + const parentComponent = fiber.return; + const parentName = getComponentName(parentComponent); + const containerType = getElementType(fiber); + const componentPath = getComponentPath(parentComponent); + const childElements = children.map((c, index) => ({ + type: getElementType(c), + key: c.key, + index + })); + const keys = children.map((c) => c.key); + const hasNullKeys = keys.some((k) => k === null); + const nullKeyCount = keys.filter((k) => k === null).length; + const allIndexKeys = keys.every((k, i) => k === String(i)); + const location = { + componentName: parentName, + componentPath, + elementType: containerType, + listLength: children.length, + childElements + }; + if (hasNullKeys) { + const childTypes = [...new Set(childElements.map((c) => c.type))]; + const childTypesStr = childTypes.slice(0, 3).join(", ") + (childTypes.length > 3 ? "..." : ""); + issues.push({ + id: generateId(), + type: "MISSING_KEY", + severity: "error", + component: parentName, + message: `${nullKeyCount} of ${children.length} items missing keys in ${containerType} containing [${childTypesStr}]`, + suggestion: 'Add unique "key" prop to each child element', + timestamp: Date.now(), + location + }); + } else if (allIndexKeys) { + issues.push({ + id: generateId(), + type: "INDEX_AS_KEY", + severity: "warning", + component: parentName, + message: `List of ${children.length} items uses array index as key in ${containerType}`, + suggestion: "Use stable unique identifier instead of array index as key", + timestamp: Date.now(), + location + }); + } + } + function traverseFiber(fiber, callback, path = "", maxNodes = 500) { + if (!fiber) return; + const stack = [{ fiber, path }]; + let nodeCount = 0; + while (stack.length > 0 && nodeCount < maxNodes) { + const item = stack.pop(); + nodeCount++; + callback(item.fiber, item.path); + if (item.fiber.sibling) { + const parts = item.path.split("/"); + const index = parseInt(parts.pop() || "0", 10) + 1; + stack.push({ fiber: item.fiber.sibling, path: `${parts.join("/")}/${index}` }); + } + if (item.fiber.child) { + stack.push({ fiber: item.fiber.child, path: `${item.path}/0` }); + } + } + } + function detectRenderChanges(node) { + const alternate = node.alternate; + if (!alternate) { + return { type: "mount", renderReasonSummary: "Initial mount" }; + } + const prevProps = alternate.memoizedProps; + const nextProps = node.memoizedProps; + const prevState = alternate.memoizedState; + const nextState = node.memoizedState; + const changedProps = []; + const propsChanges = []; + const changedState = []; + const stateChanges = []; + if (prevProps && nextProps) { + const allKeys = /* @__PURE__ */ new Set([...Object.keys(prevProps || {}), ...Object.keys(nextProps || {})]); + for (const key of allKeys) { + if (key === "children") continue; + if (prevProps[key] !== nextProps[key]) { + changedProps.push(key); + if (propsChanges.length < 5) { + const oldExtracted = extractScalarValue(prevProps[key]); + const newExtracted = extractScalarValue(nextProps[key]); + propsChanges.push({ + key, + oldValue: oldExtracted.str, + newValue: newExtracted.str + }); + } + } + } + } + if (prevState !== nextState) { + if (typeof prevState === "object" && typeof nextState === "object" && prevState !== null && nextState !== null) { + const allStateKeys = /* @__PURE__ */ new Set([...Object.keys(prevState || {}), ...Object.keys(nextState || {})]); + for (const key of allStateKeys) { + if ((prevState == null ? void 0 : prevState[key]) !== (nextState == null ? void 0 : nextState[key])) { + changedState.push(key); + if (stateChanges.length < 5) { + const oldExtracted = extractScalarValue(prevState == null ? void 0 : prevState[key]); + const newExtracted = extractScalarValue(nextState == null ? void 0 : nextState[key]); + stateChanges.push({ + key, + oldValue: oldExtracted.str, + newValue: newExtracted.str + }); + } + } + } + } else { + changedState.push("state"); + if (stateChanges.length < 5) { + const oldExtracted = extractScalarValue(prevState); + const newExtracted = extractScalarValue(nextState); + stateChanges.push({ + key: "state", + oldValue: oldExtracted.str, + newValue: newExtracted.str + }); + } + } + } + const buildSummary = () => { + const parts = []; + if (changedProps.length > 0) { + const propsList = changedProps.slice(0, 3).join(", "); + const suffix = changedProps.length > 3 ? ` (+${changedProps.length - 3} more)` : ""; + parts.push(`Props: ${propsList}${suffix}`); + } + if (changedState.length > 0) { + const stateList = changedState.slice(0, 3).join(", "); + const suffix = changedState.length > 3 ? ` (+${changedState.length - 3} more)` : ""; + parts.push(`State: ${stateList}${suffix}`); + } + if (parts.length === 0) { + return "Parent re-rendered"; + } + return parts.join(" | "); + }; + if (changedProps.length > 0 && changedState.length > 0) { + return { + type: "props+state", + changedKeys: [...changedProps, ...changedState], + propsChanges, + stateChanges, + renderReasonSummary: buildSummary() + }; + } + if (changedProps.length > 0) { + return { + type: "props", + changedKeys: changedProps, + propsChanges, + renderReasonSummary: buildSummary() + }; + } + if (changedState.length > 0) { + return { + type: "state", + changedKeys: changedState, + stateChanges, + renderReasonSummary: buildSummary() + }; + } + return { type: "parent", renderReasonSummary: "Parent re-rendered" }; + } + function getFiberDepth(fiber) { + let depth = 0; + let current = fiber == null ? void 0 : fiber.return; + while (current) { + if (isUserComponent(current)) { + depth++; + } + current = current.return; + } + return depth; + } + let batchCounter = 0; + function getParentComponentName(fiber) { + let parent = fiber == null ? void 0 : fiber.return; + while (parent) { + if (isUserComponent(parent)) { + return getComponentName(parent); + } + parent = parent.return; + } + return void 0; + } + function analyzeFiberTree(root) { + const fiber = root.current; + const components = []; + const renders = []; + const effectEvents = []; + const localStateChanges = []; + const contextChanges = []; + const renderData = []; + const batchId = `batch_${++batchCounter}_${Date.now()}`; + let renderOrder = 0; + traverseFiber(fiber, (node, path) => { + const componentName = getComponentName(node); + const fiberId = `${componentName}_${path}`; + if (isUserComponent(node)) { + const componentPath = getComponentPath(node); + const componentPathKey = `${componentName}_${componentPath.join("/")}`; + const currentRenderId = (componentRenderIds.get(componentPathKey) || 0) + 1; + componentRenderIds.set(componentPathKey, currentRenderId); + const effectChanges = detectEffectChanges(node); + for (const change of effectChanges) { + effectEvents.push({ componentName, ...change }); + } + const stateChanges = detectLocalStateChanges(node); + localStateChanges.push(...stateChanges); + const ctxChanges = detectContextChanges(node); + contextChanges.push(...ctxChanges); + const actuallyRendered = didFiberRender(node); + if (actuallyRendered) { + const now = Date.now(); + renderOrder++; + const count = (renderCounts.get(fiberId) || 0) + 1; + renderCounts.set(fiberId, count); + lastRenderTimes.set(fiberId, now); + let timestamps = recentRenderTimestamps.get(fiberId) || []; + timestamps.push(now); + timestamps = timestamps.filter((t) => now - t < EXCESSIVE_RENDER_WINDOW_MS); + recentRenderTimestamps.set(fiberId, timestamps); + const renderChange = detectRenderChanges(node); + const actualDuration = node.actualDuration ?? 0; + const selfBaseDuration = node.selfBaseDuration ?? 0; + const parentComponent = getParentComponentName(node); + components.push({ + id: fiberId, + name: componentName, + path, + props: sanitizeValue(node.memoizedProps), + state: sanitizeValue(node.memoizedState), + renderCount: count, + lastRenderTime: now, + children: [] + }); + renders.push({ + componentId: fiberId, + componentName, + duration: actualDuration, + selfDuration: selfBaseDuration, + reason: renderChange, + renderOrder, + parentComponent, + componentPath, + batchId, + fiberDepth: getFiberDepth(node) + }); + renderData.push({ + fiberId, + componentName, + node, + rendersInLastSecond: timestamps.length, + actualDuration + }); + } + } + }); + const renderTimelineEvents = renders.map((r) => ({ + id: generateId(), + timestamp: getUniqueTimestamp(), + type: "render", + payload: { + componentName: r.componentName, + componentId: r.componentId, + trigger: r.reason.type, + changedKeys: r.reason.changedKeys, + duration: r.duration, + renderOrder: r.renderOrder, + parentComponent: r.parentComponent, + componentPath: r.componentPath, + batchId: r.batchId, + fiberDepth: r.fiberDepth, + propsChanges: r.reason.propsChanges, + stateChanges: r.reason.stateChanges, + renderReasonSummary: r.reason.renderReasonSummary + } + })); + const effectTimelineEvents = effectEvents.map((e) => ({ + id: generateId(), + timestamp: getUniqueTimestamp(), + type: "effect", + payload: { + componentName: e.componentName, + effectType: e.type, + effectIndex: e.effectIndex, + depCount: e.depCount, + hasCleanup: e.hasCleanup, + effectTag: e.effectTag, + depsPreview: e.depsPreview, + createFnPreview: e.createFnPreview + } + })); + const localStateTimelineEvents = localStateChanges.map((s) => ({ + id: generateId(), + timestamp: getUniqueTimestamp(), + type: "state-change", + payload: { + source: "local", + componentName: s.componentName, + hookIndex: s.hookIndex, + oldValue: s.oldValue, + newValue: s.newValue, + valueType: s.valueType, + isExtractable: s.isExtractable, + stateName: s.stateName + } + })); + const contextTimelineEvents = contextChanges.map((c) => ({ + id: generateId(), + timestamp: getUniqueTimestamp(), + type: "context-change", + payload: { + componentName: c.componentName, + contextType: c.contextType, + changedKeys: c.changedKeys + } + })); + const timelineEvents = [...renderTimelineEvents, ...effectTimelineEvents, ...localStateTimelineEvents, ...contextTimelineEvents]; + if (timelineEvents.length > 0) { + sendFromPage("TIMELINE_EVENTS", timelineEvents); + } + scheduleIdleWork(() => { + if (!debuggerEnabled) return; + analyzeIssuesDeferred(fiber, renderData, components, renders); + }, 500); + } + function analyzeIssuesDeferred(fiber, renderData, components, renders) { + const issues = []; + for (const data of renderData) { + const { fiberId, componentName, node, rendersInLastSecond, actualDuration } = data; + const now = Date.now(); + if (rendersInLastSecond >= EXCESSIVE_RENDER_THRESHOLD) { + const issueKey = `excessive_${fiberId}`; + if (!reportedExcessiveRerenders.has(issueKey)) { + reportedExcessiveRerenders.add(issueKey); + } + issues.push({ + id: issueKey, + type: "EXCESSIVE_RERENDERS", + severity: "warning", + component: componentName, + message: `Rendered ${rendersInLastSecond} times in less than 1 second`, + suggestion: "Consider using React.memo() to prevent unnecessary re-renders when props haven't changed", + timestamp: now, + renderCount: rendersInLastSecond + }); + } + if (actualDuration > 16) { + if (!reportedSlowRenders.has(fiberId)) { + reportedSlowRenders.add(fiberId); + issues.push({ + id: generateId(), + type: "SLOW_RENDER", + severity: actualDuration > 50 ? "error" : "warning", + component: componentName, + message: `Render took ${actualDuration.toFixed(2)}ms (budget: 16ms for 60fps)`, + suggestion: "Consider memoization, code splitting, or optimizing expensive computations", + timestamp: now, + location: { + componentName, + componentPath: getComponentPath(node) + } + }); + } + } + } + traverseFiber(fiber, (node) => { + checkListKeys(node, issues); + checkEffectHooks(node, issues); + }); + if (issues.length > 0 || components.length > 0) { + sendFromPage("FIBER_COMMIT", { components, issues, renders, timestamp: getUniqueTimestamp() }); + } + } + function detectReactVersion() { + var _a; + return ((_a = window.React) == null ? void 0 : _a.version) || "unknown"; + } + function detectReactMode() { + var _a; + const React = window.React; + if ((_a = React == null ? void 0 : React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) == null ? void 0 : _a.ReactDebugCurrentFrame) { + return "development"; + } + return "production"; + } + function installReactHook() { + let hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + if (!hook) { + const renderers = /* @__PURE__ */ new Map(); + let nextID = 1; + hook = { + renderers, + supportsFiber: true, + inject: (renderer) => { + const id = nextID++; + renderers.set(id, renderer); + sendFromPage("REACT_DETECTED", { + version: detectReactVersion(), + mode: detectReactMode() + }); + return id; + }, + onCommitFiberRoot: () => { + }, + onCommitFiberUnmount: () => { + } + }; + window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook; + } + const originalOnCommitFiberRoot = hook.onCommitFiberRoot; + const originalInject = hook.inject; + hook.inject = function(renderer) { + const id = originalInject ? originalInject.call(this, renderer) : hook.renderers.size + 1; + sendFromPage("REACT_DETECTED", { + version: detectReactVersion(), + mode: detectReactMode() + }); + return id; + }; + let lastAnalyzeTime = 0; + let pendingRoot = null; + let analyzeTimeout = null; + const ANALYZE_THROTTLE_MS = 250; + const scheduleAnalyze = (root) => { + pendingRoot = root; + const now = Date.now(); + if (now - lastAnalyzeTime >= ANALYZE_THROTTLE_MS) { + lastAnalyzeTime = now; + try { + analyzeFiberTree(root); + } catch (e) { + } + pendingRoot = null; + } else if (!analyzeTimeout) { + analyzeTimeout = window.setTimeout(() => { + analyzeTimeout = null; + if (pendingRoot) { + lastAnalyzeTime = Date.now(); + try { + analyzeFiberTree(pendingRoot); + } catch (e) { + } + pendingRoot = null; + } + }, ANALYZE_THROTTLE_MS - (now - lastAnalyzeTime)); + } + }; + hook.onCommitFiberRoot = function(rendererID, root, priorityLevel, didError) { + if (typeof originalOnCommitFiberRoot === "function") { + originalOnCommitFiberRoot.call(this, rendererID, root, priorityLevel, didError); + } + if (!debuggerEnabled) return; + scheduleAnalyze(root); + if (scanEnabled) { + try { + traverseFiber(root.current, (node, path) => { + if (isUserComponent(node) && didFiberRender(node)) { + const componentName = getComponentName(node); + const fiberId = `${componentName}_${path}`; + const count = renderCounts.get(fiberId) || 1; + flashRenderOverlay(node, componentName, count); + } + }, "", 200); + } catch (e) { + } + } + }; + if (hook.renderers && hook.renderers.size > 0) { + sendFromPage("REACT_DETECTED", { + version: detectReactVersion(), + mode: detectReactMode() + }); + } + } + function findReactRoots() { + const roots = []; + const extractRoot = (element) => { + try { + const keys = Object.keys(element); + const fiberKey = keys.find( + (key) => key.startsWith("__reactContainer$") || key.startsWith("__reactFiber$") + ); + if (fiberKey) { + let fiber = element[fiberKey]; + let maxDepth = 100; + while (fiber && maxDepth > 0) { + if (fiber.stateNode && fiber.stateNode.current) { + return fiber.stateNode; + } + if (fiber.tag === FIBER_TAGS.HostRoot && fiber.stateNode) { + return fiber.stateNode; + } + fiber = fiber.return; + maxDepth--; + } + } + } catch (e) { + } + return null; + }; + const knownSelectors = "#root, #app, #__next, [data-reactroot], #___gatsby"; + const knownElements = document.querySelectorAll(knownSelectors); + for (const element of knownElements) { + const root = extractRoot(element); + if (root && !roots.includes(root)) { + roots.push(root); + } + } + if (roots.length > 0) return roots; + const allElements = document.querySelectorAll("*"); + const limit = Math.min(allElements.length, 200); + for (let i = 0; i < limit; i++) { + const root = extractRoot(allElements[i]); + if (root && !roots.includes(root)) { + roots.push(root); + break; + } + } + return roots; + } + function forceReanalyze() { + if (!debuggerEnabled) return; + const doAnalyze = () => { + if (!debuggerEnabled) return; + const roots = findReactRoots(); + let analyzed = false; + if (roots.length > 0) { + for (const root of roots) { + try { + if (root == null ? void 0 : root.current) { + analyzeFiberTree(root); + analyzed = true; + } + } catch (e) { + } + } + } + if (!analyzed) { + const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook == null ? void 0 : hook.renderers) { + hook.renderers.forEach((renderer) => { + try { + if (renderer == null ? void 0 : renderer.getFiberRoots) { + const fiberRoots = renderer.getFiberRoots(renderer); + fiberRoots == null ? void 0 : fiberRoots.forEach((root) => { + if (root == null ? void 0 : root.current) { + analyzeFiberTree(root); + analyzed = true; + } + }); + } + } catch (e) { + } + }); + } + } + if (reduxStore) { + try { + sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(reduxStore.getState())); + } catch (e) { + } + } + }; + scheduleIdleWork(doAnalyze, 100); + setTimeout(doAnalyze, 200); + } + function isReduxStore(obj) { + if (!obj) return false; + const hasGetState = typeof obj.getState === "function"; + const hasDispatch = typeof obj.dispatch === "function"; + const hasSubscribe = typeof obj.subscribe === "function"; + if (hasGetState && hasDispatch && hasSubscribe) { + try { + const state = obj.getState(); + if (state !== void 0) { + log("Found valid Redux store with state:", typeof state); + return true; + } + } catch (e) { + } + } + return false; + } + function extractStoreFromFiber(fiber) { + var _a, _b, _c, _d, _e, _f; + if (!fiber) return null; + const memoizedState = fiber.memoizedState; + if ((memoizedState == null ? void 0 : memoizedState.store) && isReduxStore(memoizedState.store)) { + return memoizedState.store; + } + if (((_a = memoizedState == null ? void 0 : memoizedState.memoizedState) == null ? void 0 : _a.store) && isReduxStore(memoizedState.memoizedState.store)) { + return memoizedState.memoizedState.store; + } + const memoizedProps = fiber.memoizedProps; + if ((memoizedProps == null ? void 0 : memoizedProps.store) && isReduxStore(memoizedProps.store)) { + return memoizedProps.store; + } + if (((_b = memoizedProps == null ? void 0 : memoizedProps.value) == null ? void 0 : _b.store) && isReduxStore(memoizedProps.value.store)) { + return memoizedProps.value.store; + } + if ((memoizedProps == null ? void 0 : memoizedProps.value) && isReduxStore(memoizedProps.value)) { + return memoizedProps.value; + } + if (((_c = fiber.type) == null ? void 0 : _c.displayName) === "Provider" || ((_d = fiber.type) == null ? void 0 : _d.name) === "Provider") { + if ((memoizedProps == null ? void 0 : memoizedProps.store) && isReduxStore(memoizedProps.store)) { + return memoizedProps.store; + } + } + if (((_f = (_e = memoizedProps == null ? void 0 : memoizedProps.children) == null ? void 0 : _e.props) == null ? void 0 : _f.store) && isReduxStore(memoizedProps.children.props.store)) { + return memoizedProps.children.props.store; + } + const pendingProps = fiber.pendingProps; + if ((pendingProps == null ? void 0 : pendingProps.store) && isReduxStore(pendingProps.store)) { + return pendingProps.store; + } + return null; + } + function traverseFiberForStore(fiber, visited, maxDepth) { + if (!fiber || maxDepth <= 0 || visited.has(fiber)) return null; + visited.add(fiber); + const store = extractStoreFromFiber(fiber); + if (store) return store; + if (fiber.child) { + const childStore = traverseFiberForStore(fiber.child, visited, maxDepth - 1); + if (childStore) return childStore; + } + if (fiber.sibling) { + const siblingStore = traverseFiberForStore(fiber.sibling, visited, maxDepth - 1); + if (siblingStore) return siblingStore; + } + return null; + } + function findStoreInReactFiber() { + var _a; + try { + const rootSelectors = ["#root", "#app", "#__next", "[data-reactroot]", "#react-root", ".react-root", "#___gatsby", "main", "body"]; + let fiber = null; + for (const selector of rootSelectors) { + const el = document.querySelector(selector); + if (!el) continue; + const keys = Object.keys(el); + const fiberKey = keys.find( + (key) => key.startsWith("__reactContainer$") || key.startsWith("__reactFiber$") || key.startsWith("__reactInternalInstance$") + ); + if (fiberKey) { + fiber = el[fiberKey]; + if ((_a = fiber == null ? void 0 : fiber.stateNode) == null ? void 0 : _a.current) { + fiber = fiber.stateNode.current; + } else if (fiber == null ? void 0 : fiber.current) { + fiber = fiber.current; + } + break; + } + } + if (!fiber) { + const allElements = document.querySelectorAll("*"); + for (const el of allElements) { + const keys = Object.keys(el); + const fiberKey = keys.find( + (key) => key.startsWith("__reactContainer$") || key.startsWith("__reactFiber$") + ); + if (fiberKey) { + fiber = el[fiberKey]; + break; + } + } + } + if (!fiber) return null; + let rootFiber = fiber; + let maxUp = 100; + while (rootFiber.return && maxUp > 0) { + rootFiber = rootFiber.return; + maxUp--; + } + const visited = /* @__PURE__ */ new Set(); + const store = traverseFiberForStore(rootFiber, visited, 200); + if (store) { + log("Found Redux store in React Fiber tree"); + return store; + } + let currentFiber = fiber; + let depth = 100; + while (currentFiber && depth > 0) { + if (visited.has(currentFiber)) break; + const store2 = extractStoreFromFiber(currentFiber); + if (store2) return store2; + currentFiber = currentFiber.return; + depth--; + } + } catch (e) { + console.debug("[React Debugger] Error finding store in fiber:", e); + return null; + } + return null; + } + function findStoreInWindowProperties(win) { + const storePatterns = ["store", "redux", "state", "Store", "Redux"]; + for (const key of Object.keys(win)) { + const lowerKey = key.toLowerCase(); + if (storePatterns.some((p) => lowerKey.includes(p.toLowerCase()))) { + try { + const candidate = win[key]; + if (isReduxStore(candidate)) { + return candidate; + } + if (candidate && typeof candidate === "object") { + if (isReduxStore(candidate.store)) { + return candidate.store; + } + if (isReduxStore(candidate.default)) { + return candidate.default; + } + } + } catch { + continue; + } + } + } + return null; + } + let reduxDevToolsState = null; + let reduxDevToolsMessageListenerInstalled = false; + function setupReduxDevToolsMessageListener() { + if (reduxDevToolsMessageListenerInstalled) return; + reduxDevToolsMessageListenerInstalled = true; + window.addEventListener("message", (event) => { + if (!event.data || typeof event.data !== "object") return; + const validSources = ["@devtools-page", "@devtools-extension", "@redux-devtools-extension"]; + if (!validSources.includes(event.data.source)) return; + const { type, state, payload } = event.data; + const stateUpdateTypes = ["STATE", "ACTION", "INIT_INSTANCE", "DISPATCH", "START", "INIT"]; + if (stateUpdateTypes.includes(type)) { + const stateData = state || (payload == null ? void 0 : payload.state) || payload; + if (stateData && !reduxStore) { + try { + const parsedState = typeof stateData === "string" ? JSON.parse(stateData) : stateData; + if (parsedState && typeof parsedState === "object") { + reduxDevToolsState = parsedState; + log("Received Redux state from DevTools message:", type); + const proxyStore = createReduxDevToolsProxyStore(parsedState); + if (proxyStore) { + setupReduxStore(proxyStore); + } + } + } catch (e) { + } + } + } + }); + } + function createReduxDevToolsProxyStore(initialState) { + var _a; + const win = window; + if (!((_a = win.__REDUX_DEVTOOLS_EXTENSION__) == null ? void 0 : _a.connect)) { + return null; + } + try { + const connection = win.__REDUX_DEVTOOLS_EXTENSION__.connect({ + name: "React Debugger Proxy", + features: { jump: false, skip: false, dispatch: true } + }); + let currentState = initialState; + const subscribers = []; + connection.subscribe((message) => { + if (message.type === "DISPATCH" && message.state) { + try { + currentState = typeof message.state === "string" ? JSON.parse(message.state) : message.state; + subscribers.forEach((fn) => fn()); + } catch (e) { + log("Failed to update state from DevTools:", e); + } + } + }); + connection.init(initialState); + const proxyStore = { + getState: () => currentState, + dispatch: (action) => { + if (connection.send) { + connection.send(action, currentState); + } + return action; + }, + subscribe: (listener) => { + subscribers.push(listener); + return () => { + const index = subscribers.indexOf(listener); + if (index > -1) subscribers.splice(index, 1); + }; + }, + replaceReducer: () => { + }, + ["@@observable"]: () => ({ + subscribe: (observer) => { + const unsubscribe = proxyStore.subscribe(() => { + if (observer.next) observer.next(currentState); + }); + return { unsubscribe }; + } + }), + __isProxyStore: true, + __devToolsConnection: connection + }; + log("Created Redux DevTools proxy store"); + return proxyStore; + } catch (e) { + return null; + } + } + function findStoreInReduxDevTools() { + const win = window; + if (win.__REDUX_DEVTOOLS_EXTENSION__) { + const ext = win.__REDUX_DEVTOOLS_EXTENSION__; + if (ext._stores && ext._stores.length > 0) { + for (const store of ext._stores) { + if (isReduxStore(store)) return store; + } + } + if (ext._connections) { + for (const conn of Object.values(ext._connections)) { + if ((conn == null ? void 0 : conn.store) && isReduxStore(conn.store)) { + return conn.store; + } + if ((conn == null ? void 0 : conn.init) && (conn == null ? void 0 : conn.subscribe)) { + const connAny = conn; + if (connAny._store && isReduxStore(connAny._store)) { + return connAny._store; + } + } + } + } + if (ext.stores) { + for (const store of Object.values(ext.stores)) { + if (isReduxStore(store)) return store; + } + } + if (ext.instances) { + for (const instance of Object.values(ext.instances)) { + const inst = instance; + if ((inst == null ? void 0 : inst.store) && isReduxStore(inst.store)) { + return inst.store; + } + } + } + if (reduxDevToolsState && !reduxStore) { + const proxyStore = createReduxDevToolsProxyStore(reduxDevToolsState); + if (proxyStore) return proxyStore; + } + } + if (win.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) { + const compose = win.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__; + if (compose._store && isReduxStore(compose._store)) { + return compose._store; + } + if (compose.store && isReduxStore(compose.store)) { + return compose.store; + } + } + if (win.__REDUX_DEVTOOLS_STORE__) { + if (isReduxStore(win.__REDUX_DEVTOOLS_STORE__)) { + return win.__REDUX_DEVTOOLS_STORE__; + } + } + return null; + } + function findReduxStore() { + const win = window; + const directCandidates = [ + { name: "store", value: win.store }, + { name: "__REDUX_STORE__", value: win.__REDUX_STORE__ }, + { name: "__store__", value: win.__store__ }, + { name: "reduxStore", value: win.reduxStore }, + { name: "__STORE__", value: win.__STORE__ }, + { name: "appStore", value: win.appStore }, + { name: "rootStore", value: win.rootStore }, + { name: "__store", value: win.__store }, + { name: "_store", value: win._store }, + { name: "Store", value: win.Store }, + { name: "myStore", value: win.myStore }, + { name: "globalStore", value: win.globalStore } + ]; + for (const { name, value } of directCandidates) { + if (value) { + if (isReduxStore(value)) { + return value; + } + } + } + const devToolsStore = findStoreInReduxDevTools(); + if (devToolsStore) { + return devToolsStore; + } + const storeFromFiber = findStoreInReactFiber(); + if (storeFromFiber) { + return storeFromFiber; + } + const storeFromWindow = findStoreInWindowProperties(win); + if (storeFromWindow) { + return storeFromWindow; + } + const altStore = findAlternativeStateManagers(win); + if (altStore) { + return altStore; + } + return null; + } + function findAlternativeStateManagers(win) { + if (win.__ZUSTAND_DEVTOOLS_EXTENSION__) { + const stores = Object.values(win.__ZUSTAND_DEVTOOLS_EXTENSION__); + for (const store of stores) { + if (isReduxStore(store)) return store; + } + } + const reactContext = win.__REACT_CONTEXT_DEVTOOL_GLOBAL_HOOK__; + if (reactContext == null ? void 0 : reactContext.stores) { + for (const store of Object.values(reactContext.stores)) { + if (isReduxStore(store)) return store; + } + } + return null; + } + function deepSanitizeState(value, depth = 0, maxDepth = 5) { + if (depth > maxDepth) return "[Object depth exceeded]"; + if (value === null) return null; + if (value === void 0) return void 0; + const type = typeof value; + if (type === "string") return value; + if (type === "number" || type === "boolean") return value; + if (type === "function") return `[Function: ${value.name || "anonymous"}]`; + if (type === "symbol") return `[Symbol: ${value.toString()}]`; + if (Array.isArray(value)) { + return value.map((v) => deepSanitizeState(v, depth + 1, maxDepth)); + } + if (type === "object") { + const obj = value; + if (obj.$$typeof) return "[React Element]"; + if (obj instanceof HTMLElement) return `[HTMLElement: ${obj.tagName}]`; + if (obj instanceof Event) return "[Event]"; + if (obj instanceof Error) return { __type: "Error", message: obj.message, stack: obj.stack }; + if (obj instanceof Date) return { __type: "Date", value: obj.toISOString() }; + if (obj instanceof RegExp) return { __type: "RegExp", value: obj.toString() }; + if (obj instanceof Map) { + const mapObj = { __type: "Map", size: obj.size, entries: {} }; + obj.forEach((v, k) => { + mapObj.entries[String(k)] = deepSanitizeState(v, depth + 1, maxDepth); + }); + return mapObj; + } + if (obj instanceof Set) { + return { __type: "Set", size: obj.size, values: Array.from(obj).map((v) => deepSanitizeState(v, depth + 1, maxDepth)) }; + } + if (obj instanceof Promise) return "[Promise]"; + const result = {}; + for (const key of Object.keys(obj)) { + try { + result[key] = deepSanitizeState(obj[key], depth + 1, maxDepth); + } catch { + result[key] = "[Error reading property]"; + } + } + return result; + } + return String(value); + } + function setNestedValue(obj, path, value) { + if (path.length === 0) return value; + const result = Array.isArray(obj) ? [...obj] : { ...obj }; + const [first, ...rest] = path; + if (rest.length === 0) { + result[first] = value; + } else { + result[first] = setNestedValue(result[first], rest, value); + } + return result; + } + let reduxStore = null; + let originalDispatch = null; + let stateOverrides = /* @__PURE__ */ new Map(); + let reduxSearchStopped = false; + let stateChangeTimeout = null; + const STATE_CHANGE_DEBOUNCE = 100; + let reduxHookInstalled = false; + function restartReduxSearch() { + reduxSearchStopped = false; + if (reduxStore) return; + const store = findReduxStore(); + if (store) { + setupReduxStore(store); + return; + } + startReduxPolling(); + } + function setupReduxStore(store) { + if (!store || reduxStore === store) return; + reduxStore = store; + reduxSearchStopped = true; + try { + const initialState = deepSanitizeState(store.getState()); + console.log("[React Debugger] Redux store connected"); + sendFromPage("REDUX_DETECTED", initialState); + originalDispatch = store.dispatch; + store.dispatch = function(action) { + var _a; + if ((_a = action.type) == null ? void 0 : _a.startsWith("@@REACT_DEBUGGER/")) { + return originalDispatch.call(store, action); + } + const result = originalDispatch.call(store, action); + if (debuggerEnabled) { + sendFromPage("REDUX_ACTION", { + id: generateId(), + type: action.type || "UNKNOWN", + payload: sanitizeValue(action, 0), + timestamp: getUniqueTimestamp() + }); + sendFromPage("TIMELINE_EVENTS", [{ + id: generateId(), + timestamp: getUniqueTimestamp(), + type: "state-change", + payload: { + source: "redux", + actionType: action.type || "UNKNOWN" + } + }]); + } + return result; + }; + store.subscribe(() => { + if (stateChangeTimeout) { + clearTimeout(stateChangeTimeout); + } + stateChangeTimeout = window.setTimeout(() => { + try { + sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); + } catch (e) { + console.debug("[React Debugger] Error sending state change:", e); + } + stateChangeTimeout = null; + }, STATE_CHANGE_DEBOUNCE); + }); + window.__REACT_DEBUGGER_DISPATCH__ = (action) => { + return originalDispatch.call(store, action); + }; + window.__REACT_DEBUGGER_STORE__ = store; + window.__REACT_DEBUGGER_GET_STATE__ = () => store.getState(); + let injectedState = null; + if (typeof store.replaceReducer === "function") { + try { + const createInjectorReducer = (baseReducer) => { + return (state, action) => { + if (injectedState !== null) { + const newState = injectedState; + injectedState = null; + return newState; + } + if (baseReducer) { + return baseReducer(state, action); + } + return state; + }; + }; + const originalReplaceReducer = store.replaceReducer.bind(store); + store.replaceReducer = (nextReducer) => { + return originalReplaceReducer(createInjectorReducer(nextReducer)); + }; + originalReplaceReducer(createInjectorReducer(null)); + log("Redux state injection ready"); + } catch (e) { + log("replaceReducer setup failed:", e); + } + } + window.__REACT_DEBUGGER_SET_STATE__ = (path, value) => { + try { + const currentState = store.getState(); + const newState = setNestedValue(currentState, path, value); + stateOverrides.set(path.join("."), { path, value }); + injectedState = newState; + originalDispatch.call(store, { type: "@@REACT_DEBUGGER/SET_STATE" }); + sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); + } catch (e) { + console.error("[React Debugger] Set state error:", e); + } + }; + window.__REACT_DEBUGGER_CLEAR_OVERRIDES__ = () => { + try { + if (stateOverrides.size === 0) return; + stateOverrides.clear(); + sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); + sendFromPage("REDUX_OVERRIDES_CLEARED", null); + } catch (e) { + console.error("[React Debugger] Clear overrides error:", e); + } + }; + window.__REACT_DEBUGGER_RESET_STATE__ = () => { + try { + stateOverrides.clear(); + sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); + sendFromPage("REDUX_OVERRIDES_CLEARED", null); + } catch (e) { + console.error("[React Debugger] Reset state error:", e); + } + }; + } catch (e) { + console.error("[React Debugger] Error setting up Redux hook:", e); + reduxStore = null; + } + } + function startReduxPolling() { + if (reduxStore || reduxSearchStopped) return; + const store = findReduxStore(); + if (store) { + setupReduxStore(store); + return; + } + setTimeout(() => { + if (reduxStore || reduxSearchStopped) return; + const store2 = findReduxStore(); + if (store2) { + setupReduxStore(store2); + } + }, 2e3); + } + function installReduxHook() { + if (reduxHookInstalled) return; + reduxHookInstalled = true; + setupReduxDevToolsMessageListener(); + const win = window; + if (typeof win.__REDUX_DEVTOOLS_EXTENSION__ !== "undefined") { + const originalConnect = win.__REDUX_DEVTOOLS_EXTENSION__.connect; + if (originalConnect) { + win.__REDUX_DEVTOOLS_EXTENSION__.connect = function(...args) { + const devTools = originalConnect.apply(this, args); + setTimeout(() => { + if (!reduxStore && !reduxSearchStopped) { + const store = findReduxStore(); + if (store) setupReduxStore(store); + } + }, 500); + return devTools; + }; + } + } + if (typeof win.Redux !== "undefined" && win.Redux.createStore) { + const originalCreateStore = win.Redux.createStore; + win.Redux.createStore = function(...args) { + const store = originalCreateStore.apply(this, args); + setTimeout(() => setupReduxStore(store), 100); + return store; + }; + } + const onReady = () => { + if (reduxStore || reduxSearchStopped) return; + setTimeout(() => { + if (!reduxStore && !reduxSearchStopped) { + const store = findReduxStore(); + if (store) { + setupReduxStore(store); + } else { + startReduxPolling(); + } + } + }, 1e3); + }; + if (document.readyState === "complete") { + onReady(); + } else { + window.addEventListener("load", onReady, { once: true }); + } + } + let scanEnabled = false; + const overlayElements = /* @__PURE__ */ new Map(); + const renderFlashTimers = /* @__PURE__ */ new Map(); + function createOverlayContainer() { + let container = document.getElementById("react-debugger-overlay-container"); + if (!container) { + container = document.createElement("div"); + container.id = "react-debugger-overlay-container"; + container.style.cssText = ` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: none; + z-index: 999999; + `; + document.body.appendChild(container); + } + return container; + } + function getBorderColorForRenderCount(count) { + if (count <= 1) return "#40c463"; + if (count <= 3) return "#ffc107"; + if (count <= 5) return "#ff9800"; + if (count <= 10) return "#ff5722"; + return "#f44336"; + } + function flashRenderOverlay(fiber, componentName, renderCount) { + if (!scanEnabled) return; + const stateNode = fiber.stateNode; + let domNode = null; + if (stateNode instanceof HTMLElement) { + domNode = stateNode; + } else if (fiber.child) { + let childFiber = fiber.child; + while (childFiber) { + if (childFiber.stateNode instanceof HTMLElement) { + domNode = childFiber.stateNode; + break; + } + childFiber = childFiber.child; + } + } + if (!domNode) return; + const rect = domNode.getBoundingClientRect(); + if (rect.width === 0 || rect.height === 0) return; + if (rect.bottom < 0 || rect.right < 0 || rect.top > window.innerHeight || rect.left > window.innerWidth) return; + const container = createOverlayContainer(); + const fiberId = `${componentName}_${fiber.key || "nokey"}_${Math.round(rect.top)}_${Math.round(rect.left)}`; + const renderChange = detectRenderChanges(fiber); + let overlay = overlayElements.get(fiberId); + if (!overlay) { + overlay = document.createElement("div"); + overlay.className = "react-debugger-overlay"; + container.appendChild(overlay); + overlayElements.set(fiberId, overlay); + } + const borderColor = getBorderColorForRenderCount(renderCount); + overlay.style.cssText = ` + position: fixed; + top: ${rect.top}px; + left: ${rect.left}px; + width: ${rect.width}px; + height: ${rect.height}px; + background: transparent; + border: 2px solid ${borderColor}; + border-radius: 4px; + pointer-events: none; + z-index: 999999; + transition: opacity 0.3s ease-out, transform 0.1s ease-out; + box-sizing: border-box; + transform: scale(1.02); + `; + setTimeout(() => { + if (overlay) overlay.style.transform = "scale(1)"; + }, 50); + const label = overlay.querySelector(".scan-label") || document.createElement("div"); + label.className = "scan-label"; + const reasonText = renderChange.changedKeys ? ` [${renderChange.type}: ${renderChange.changedKeys.slice(0, 3).join(", ")}${renderChange.changedKeys.length > 3 ? "..." : ""}]` : renderChange.type !== "parent" ? ` [${renderChange.type}]` : ""; + label.style.cssText = ` + position: absolute; + top: -22px; + left: 0; + background: ${borderColor}; + color: white; + font-size: 10px; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace; + padding: 2px 8px; + border-radius: 4px; + white-space: nowrap; + pointer-events: none; + font-weight: 500; + box-shadow: 0 2px 4px rgba(0,0,0,0.2); + `; + label.textContent = `${componentName} ×${renderCount}${reasonText}`; + if (!label.parentElement) { + overlay.appendChild(label); + } + overlay.style.opacity = "1"; + const existingTimer = renderFlashTimers.get(fiberId); + if (existingTimer) { + clearTimeout(existingTimer); + } + const timer = window.setTimeout(() => { + if (overlay) { + overlay.style.opacity = "0"; + } + renderFlashTimers.delete(fiberId); + }, 800); + renderFlashTimers.set(fiberId, timer); + } + function clearAllOverlays() { + overlayElements.forEach((overlay) => { + overlay.remove(); + }); + overlayElements.clear(); + renderFlashTimers.forEach((timer) => clearTimeout(timer)); + renderFlashTimers.clear(); + } + function toggleScan(enabled) { + scanEnabled = enabled; + if (!enabled) { + clearAllOverlays(); + } + sendFromPage("SCAN_STATUS", { enabled: scanEnabled }); + } + window.__REACT_DEBUGGER_SCAN__ = { + enable: () => toggleScan(true), + disable: () => toggleScan(false), + toggle: () => toggleScan(!scanEnabled), + isEnabled: () => scanEnabled + }; + let memoryMonitoringEnabled = false; + let memoryMonitorInterval = null; + const MEMORY_SAMPLE_INTERVAL = 2e3; + function getMemorySnapshot() { + const perf = performance; + if (!perf.memory) return null; + return { + usedJSHeapSize: perf.memory.usedJSHeapSize, + totalJSHeapSize: perf.memory.totalJSHeapSize, + jsHeapSizeLimit: perf.memory.jsHeapSizeLimit + }; + } + let lastMemoryUsage = 0; + const MEMORY_SPIKE_THRESHOLD = 0.15; + function startMemoryMonitoring() { + if (!debuggerEnabled || memoryMonitoringEnabled) return; + const snapshot = getMemorySnapshot(); + if (!snapshot) { + return; + } + memoryMonitoringEnabled = true; + lastMemoryUsage = snapshot.usedJSHeapSize; + sendFromPage("MEMORY_SNAPSHOT", { + ...snapshot, + timestamp: Date.now() + }); + memoryMonitorInterval = window.setInterval(() => { + const snap = getMemorySnapshot(); + if (snap) { + const timestamp = getUniqueTimestamp(); + const growthRate = lastMemoryUsage > 0 ? (snap.usedJSHeapSize - lastMemoryUsage) / lastMemoryUsage : 0; + const isSpike = growthRate > MEMORY_SPIKE_THRESHOLD; + sendFromPage("MEMORY_SNAPSHOT", { + ...snap, + timestamp + }); + if (isSpike || snap.usedJSHeapSize / snap.jsHeapSizeLimit > 0.8) { + sendFromPage("TIMELINE_EVENTS", [{ + id: generateId(), + timestamp, + type: "memory", + payload: { + heapUsed: snap.usedJSHeapSize, + heapTotal: snap.totalJSHeapSize, + heapLimit: snap.jsHeapSizeLimit, + isSpike, + growthRate + } + }]); + } + lastMemoryUsage = snap.usedJSHeapSize; + } + }, MEMORY_SAMPLE_INTERVAL); + } + function stopMemoryMonitoring() { + if (!memoryMonitoringEnabled) return; + memoryMonitoringEnabled = false; + if (memoryMonitorInterval) { + clearInterval(memoryMonitorInterval); + memoryMonitorInterval = null; + } + } + function stopAllMonitoring() { + stopMemoryMonitoring(); + toggleScan(false); + reduxSearchStopped = true; + messageQueue = []; + if (flushTimeout) { + clearTimeout(flushTimeout); + flushTimeout = null; + } + clearPathCache(); + renderCounts.clear(); + lastRenderTimes.clear(); + recentRenderTimestamps.clear(); + reportedEffectIssues.clear(); + reportedExcessiveRerenders.clear(); + reportedSlowRenders.clear(); + componentRenderIds.clear(); + lastEffectStates.clear(); + trackedClosures.clear(); + staleClosureIssues.clear(); + stateOverrides.clear(); + overlayElements.clear(); + renderFlashTimers.forEach((timer) => clearTimeout(timer)); + renderFlashTimers.clear(); + } + window.__REACT_DEBUGGER_MEMORY__ = { + start: startMemoryMonitoring, + stop: stopMemoryMonitoring, + getSnapshot: getMemorySnapshot, + isMonitoring: () => memoryMonitoringEnabled + }; + function installErrorHandlers() { + const originalOnError = window.onerror; + window.onerror = function(message, source, lineno, colno, error) { + var _a, _b; + if ((source == null ? void 0 : source.includes("react-debugger")) || (source == null ? void 0 : source.includes("chrome-extension"))) { + return originalOnError == null ? void 0 : originalOnError.apply(window, arguments); + } + const memorySnapshot = getMemorySnapshot(); + const analysisHints = []; + if (memorySnapshot) { + const usagePercent = memorySnapshot.usedJSHeapSize / memorySnapshot.jsHeapSizeLimit; + if (usagePercent > 0.8) { + analysisHints.push("High memory usage detected at crash time"); + } + } + const crashId = generateId(); + const crashTimestamp = getUniqueTimestamp(); + sendFromPage("CRASH_DETECTED", { + id: crashId, + timestamp: crashTimestamp, + type: "js-error", + message: String(message), + stack: (_a = error == null ? void 0 : error.stack) == null ? void 0 : _a.slice(0, 5e3), + source, + lineno, + colno, + memorySnapshot: memorySnapshot ? { + timestamp: crashTimestamp, + usedJSHeapSize: memorySnapshot.usedJSHeapSize, + totalJSHeapSize: memorySnapshot.totalJSHeapSize, + jsHeapSizeLimit: memorySnapshot.jsHeapSizeLimit + } : void 0, + analysisHints + }); + sendFromPage("TIMELINE_EVENTS", [{ + id: crashId, + timestamp: crashTimestamp, + type: "error", + payload: { + errorType: "js-error", + message: String(message), + stack: (_b = error == null ? void 0 : error.stack) == null ? void 0 : _b.slice(0, 2e3), + source, + lineno + } + }]); + return originalOnError == null ? void 0 : originalOnError.apply(window, arguments); + }; + window.addEventListener("unhandledrejection", (event) => { + var _a, _b; + const reason = event.reason; + const memorySnapshot = getMemorySnapshot(); + const analysisHints = []; + if (memorySnapshot) { + const usagePercent = memorySnapshot.usedJSHeapSize / memorySnapshot.jsHeapSizeLimit; + if (usagePercent > 0.8) { + analysisHints.push("High memory usage detected at crash time"); + } + } + const rejectId = generateId(); + const rejectTimestamp = getUniqueTimestamp(); + sendFromPage("CRASH_DETECTED", { + id: rejectId, + timestamp: rejectTimestamp, + type: "unhandled-rejection", + message: (reason == null ? void 0 : reason.message) || String(reason), + stack: (_a = reason == null ? void 0 : reason.stack) == null ? void 0 : _a.slice(0, 5e3), + memorySnapshot: memorySnapshot ? { + timestamp: rejectTimestamp, + usedJSHeapSize: memorySnapshot.usedJSHeapSize, + totalJSHeapSize: memorySnapshot.totalJSHeapSize, + jsHeapSizeLimit: memorySnapshot.jsHeapSizeLimit + } : void 0, + analysisHints + }); + sendFromPage("TIMELINE_EVENTS", [{ + id: rejectId, + timestamp: rejectTimestamp, + type: "error", + payload: { + errorType: "unhandled-rejection", + message: (reason == null ? void 0 : reason.message) || String(reason), + stack: (_b = reason == null ? void 0 : reason.stack) == null ? void 0 : _b.slice(0, 2e3) + } + }]); + }); + } + listenFromContent((message) => { + var _a; + if (message.type === "DISPATCH_REDUX_ACTION") { + const dispatch = window.__REACT_DEBUGGER_DISPATCH__; + if (dispatch && message.payload) { + try { + dispatch(message.payload); + } catch (e) { + console.error("[React Debugger] Dispatch error:", e); + } + } + } + if (message.type === "SET_REDUX_STATE") { + const payload = message.payload; + if (payload && reduxStore) { + try { + const setStateFn = window.__REACT_DEBUGGER_SET_STATE__; + if (setStateFn) { + setStateFn(payload.path, payload.value); + } + } catch (e) { + console.error("[React Debugger] Set state error:", e); + } + } + } + if (message.type === "CLEAR_REDUX_OVERRIDES") { + if (reduxStore && originalDispatch) { + try { + const clearFn = window.__REACT_DEBUGGER_CLEAR_OVERRIDES__; + if (clearFn) clearFn(); + } catch (e) { + console.error("[React Debugger] Clear overrides error:", e); + } + } + } + if (message.type === "DELETE_ARRAY_ITEM") { + const payload = message.payload; + if (payload && reduxStore) { + try { + const currentState = reduxStore.getState(); + let target = currentState; + for (const key of payload.path) { + target = target[key]; + } + if (Array.isArray(target)) { + const newArray = [...target]; + newArray.splice(payload.index, 1); + const setStateFn = window.__REACT_DEBUGGER_SET_STATE__; + if (setStateFn) { + setStateFn(payload.path, newArray); + } + } + } catch (e) { + console.error("[React Debugger] Delete array item error:", e); + } + } + } + if (message.type === "MOVE_ARRAY_ITEM") { + const payload = message.payload; + if (payload && reduxStore) { + try { + const currentState = reduxStore.getState(); + let target = currentState; + for (const key of payload.path) { + target = target[key]; + } + if (Array.isArray(target) && payload.toIndex >= 0 && payload.toIndex < target.length) { + const newArray = [...target]; + const [item] = newArray.splice(payload.fromIndex, 1); + newArray.splice(payload.toIndex, 0, item); + const setStateFn = window.__REACT_DEBUGGER_SET_STATE__; + if (setStateFn) { + setStateFn(payload.path, newArray); + } + } + } catch (e) { + console.error("[React Debugger] Move array item error:", e); + } + } + } + if (message.type === "REFRESH_REDUX_STATE") { + if (reduxStore) { + try { + sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(reduxStore.getState())); + } catch (e) { + console.error("[React Debugger] Refresh state error:", e); + } + } + } + if (message.type === "TOGGLE_SCAN") { + const payload = message.payload; + if (payload && typeof payload.enabled === "boolean") { + toggleScan(payload.enabled); + } else { + toggleScan(!scanEnabled); + } + } + if (message.type === "START_MEMORY_MONITORING") { + startMemoryMonitoring(); + } + if (message.type === "STOP_MEMORY_MONITORING") { + stopMemoryMonitoring(); + } + if (message.type === "ENABLE_DEBUGGER") { + debuggerEnabled = true; + const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + if (((_a = hook == null ? void 0 : hook.renderers) == null ? void 0 : _a.size) > 0) { + sendFromPage("REACT_DETECTED", { + version: detectReactVersion(), + mode: detectReactMode() + }); + } + installReduxHook(); + restartReduxSearch(); + forceReanalyze(); + sendFromPage("DEBUGGER_STATE_CHANGED", { enabled: true }); + } + if (message.type === "DISABLE_DEBUGGER") { + debuggerEnabled = false; + stopAllMonitoring(); + sendFromPage("DEBUGGER_STATE_CHANGED", { enabled: false }); + } + if (message.type === "GET_DEBUGGER_STATE") { + sendFromPage("DEBUGGER_STATE_CHANGED", { enabled: debuggerEnabled }); + } + }); + installReactHook(); + installReduxHook(); + installErrorHandlers(); + window.__REACT_DEBUGGER_ENABLE_CLOSURE_TRACKING__ = _installClosureTracking; + setTimeout(() => { + var _a; + const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + if (((_a = hook == null ? void 0 : hook.renderers) == null ? void 0 : _a.size) > 0) { + sendFromPage("REACT_DETECTED", { + version: detectReactVersion(), + mode: detectReactMode() + }); + } + }, 500); + console.log("[React Debugger] Inject script loaded"); + })(); +})(); diff --git a/mcp/manifest.json b/mcp/manifest.json new file mode 100644 index 0000000..4f2464c --- /dev/null +++ b/mcp/manifest.json @@ -0,0 +1,57 @@ +{ + "manifest_version": 3, + "name": "React Debugger", + "version": "2.0.2", + "description": "Advanced debugging & performance optimization tool for ReactJS applications", + "author": "NhoNH", + + "devtools_page": "devtools.html", + + "action": { + "default_popup": "popup.html", + "default_icon": { + "16": "icons/icon16.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" + }, + "default_title": "React Debugger" + }, + + "permissions": [ + "scripting", + "storage", + "activeTab", + "tabs", + "webNavigation" + ], + + "host_permissions": [ + "" + ], + + "background": { + "service_worker": "background.js" + }, + + "content_scripts": [ + { + "matches": [""], + "js": ["content.js"], + "run_at": "document_start", + "all_frames": true + } + ], + + "web_accessible_resources": [ + { + "resources": ["inject.js", "icons/*", "popup.html", "popup.js"], + "matches": [""] + } + ], + + "icons": { + "16": "icons/icon16.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" + } +} diff --git a/mcp/panel.html b/mcp/panel.html new file mode 100644 index 0000000..04c1ccd --- /dev/null +++ b/mcp/panel.html @@ -0,0 +1,13 @@ + + + + + + React Debugger + + + + +
+ + diff --git a/mcp/panel.js b/mcp/panel.js new file mode 100644 index 0000000..f27abdc --- /dev/null +++ b/mcp/panel.js @@ -0,0 +1,10323 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +function getDefaultExportFromCjs(x2) { + return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; +} +var jsxRuntime = { exports: {} }; +var reactJsxRuntime_production_min = {}; +var react = { exports: {} }; +var react_production_min = {}; +/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var l$1 = Symbol.for("react.element"), n$1 = Symbol.for("react.portal"), p$2 = Symbol.for("react.fragment"), q$1 = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), u = Symbol.for("react.context"), v$1 = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z$1 = Symbol.iterator; +function A$1(a) { + if (null === a || "object" !== typeof a) return null; + a = z$1 && a[z$1] || a["@@iterator"]; + return "function" === typeof a ? a : null; +} +var B$1 = { isMounted: function() { + return false; +}, enqueueForceUpdate: function() { +}, enqueueReplaceState: function() { +}, enqueueSetState: function() { +} }, C$1 = Object.assign, D$1 = {}; +function E$1(a, b, e) { + this.props = a; + this.context = b; + this.refs = D$1; + this.updater = e || B$1; +} +E$1.prototype.isReactComponent = {}; +E$1.prototype.setState = function(a, b) { + if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, a, b, "setState"); +}; +E$1.prototype.forceUpdate = function(a) { + this.updater.enqueueForceUpdate(this, a, "forceUpdate"); +}; +function F() { +} +F.prototype = E$1.prototype; +function G$1(a, b, e) { + this.props = a; + this.context = b; + this.refs = D$1; + this.updater = e || B$1; +} +var H$1 = G$1.prototype = new F(); +H$1.constructor = G$1; +C$1(H$1, E$1.prototype); +H$1.isPureReactComponent = true; +var I$1 = Array.isArray, J = Object.prototype.hasOwnProperty, K$1 = { current: null }, L$1 = { key: true, ref: true, __self: true, __source: true }; +function M$1(a, b, e) { + var d, c = {}, k2 = null, h = null; + if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k2 = "" + b.key), b) J.call(b, d) && !L$1.hasOwnProperty(d) && (c[d] = b[d]); + var g = arguments.length - 2; + if (1 === g) c.children = e; + else if (1 < g) { + for (var f2 = Array(g), m2 = 0; m2 < g; m2++) f2[m2] = arguments[m2 + 2]; + c.children = f2; + } + if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]); + return { $$typeof: l$1, type: a, key: k2, ref: h, props: c, _owner: K$1.current }; +} +function N$1(a, b) { + return { $$typeof: l$1, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner }; +} +function O$1(a) { + return "object" === typeof a && null !== a && a.$$typeof === l$1; +} +function escape(a) { + var b = { "=": "=0", ":": "=2" }; + return "$" + a.replace(/[=:]/g, function(a2) { + return b[a2]; + }); +} +var P$1 = /\/+/g; +function Q$1(a, b) { + return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); +} +function R$1(a, b, e, d, c) { + var k2 = typeof a; + if ("undefined" === k2 || "boolean" === k2) a = null; + var h = false; + if (null === a) h = true; + else switch (k2) { + case "string": + case "number": + h = true; + break; + case "object": + switch (a.$$typeof) { + case l$1: + case n$1: + h = true; + } + } + if (h) return h = a, c = c(h), a = "" === d ? "." + Q$1(h, 0) : d, I$1(c) ? (e = "", null != a && (e = a.replace(P$1, "$&/") + "/"), R$1(c, b, e, "", function(a2) { + return a2; + })) : null != c && (O$1(c) && (c = N$1(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P$1, "$&/") + "/") + a)), b.push(c)), 1; + h = 0; + d = "" === d ? "." : d + ":"; + if (I$1(a)) for (var g = 0; g < a.length; g++) { + k2 = a[g]; + var f2 = d + Q$1(k2, g); + h += R$1(k2, b, e, f2, c); + } + else if (f2 = A$1(a), "function" === typeof f2) for (a = f2.call(a), g = 0; !(k2 = a.next()).done; ) k2 = k2.value, f2 = d + Q$1(k2, g++), h += R$1(k2, b, e, f2, c); + else if ("object" === k2) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); + return h; +} +function S$1(a, b, e) { + if (null == a) return a; + var d = [], c = 0; + R$1(a, d, "", "", function(a2) { + return b.call(e, a2, c++); + }); + return d; +} +function T$1(a) { + if (-1 === a._status) { + var b = a._result; + b = b(); + b.then(function(b2) { + if (0 === a._status || -1 === a._status) a._status = 1, a._result = b2; + }, function(b2) { + if (0 === a._status || -1 === a._status) a._status = 2, a._result = b2; + }); + -1 === a._status && (a._status = 0, a._result = b); + } + if (1 === a._status) return a._result.default; + throw a._result; +} +var U$1 = { current: null }, V$1 = { transition: null }, W$1 = { ReactCurrentDispatcher: U$1, ReactCurrentBatchConfig: V$1, ReactCurrentOwner: K$1 }; +function X$1() { + throw Error("act(...) is not supported in production builds of React."); +} +react_production_min.Children = { map: S$1, forEach: function(a, b, e) { + S$1(a, function() { + b.apply(this, arguments); + }, e); +}, count: function(a) { + var b = 0; + S$1(a, function() { + b++; + }); + return b; +}, toArray: function(a) { + return S$1(a, function(a2) { + return a2; + }) || []; +}, only: function(a) { + if (!O$1(a)) throw Error("React.Children.only expected to receive a single React element child."); + return a; +} }; +react_production_min.Component = E$1; +react_production_min.Fragment = p$2; +react_production_min.Profiler = r; +react_production_min.PureComponent = G$1; +react_production_min.StrictMode = q$1; +react_production_min.Suspense = w; +react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W$1; +react_production_min.act = X$1; +react_production_min.cloneElement = function(a, b, e) { + if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); + var d = C$1({}, a.props), c = a.key, k2 = a.ref, h = a._owner; + if (null != b) { + void 0 !== b.ref && (k2 = b.ref, h = K$1.current); + void 0 !== b.key && (c = "" + b.key); + if (a.type && a.type.defaultProps) var g = a.type.defaultProps; + for (f2 in b) J.call(b, f2) && !L$1.hasOwnProperty(f2) && (d[f2] = void 0 === b[f2] && void 0 !== g ? g[f2] : b[f2]); + } + var f2 = arguments.length - 2; + if (1 === f2) d.children = e; + else if (1 < f2) { + g = Array(f2); + for (var m2 = 0; m2 < f2; m2++) g[m2] = arguments[m2 + 2]; + d.children = g; + } + return { $$typeof: l$1, type: a.type, key: c, ref: k2, props: d, _owner: h }; +}; +react_production_min.createContext = function(a) { + a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }; + a.Provider = { $$typeof: t, _context: a }; + return a.Consumer = a; +}; +react_production_min.createElement = M$1; +react_production_min.createFactory = function(a) { + var b = M$1.bind(null, a); + b.type = a; + return b; +}; +react_production_min.createRef = function() { + return { current: null }; +}; +react_production_min.forwardRef = function(a) { + return { $$typeof: v$1, render: a }; +}; +react_production_min.isValidElement = O$1; +react_production_min.lazy = function(a) { + return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T$1 }; +}; +react_production_min.memo = function(a, b) { + return { $$typeof: x, type: a, compare: void 0 === b ? null : b }; +}; +react_production_min.startTransition = function(a) { + var b = V$1.transition; + V$1.transition = {}; + try { + a(); + } finally { + V$1.transition = b; + } +}; +react_production_min.unstable_act = X$1; +react_production_min.useCallback = function(a, b) { + return U$1.current.useCallback(a, b); +}; +react_production_min.useContext = function(a) { + return U$1.current.useContext(a); +}; +react_production_min.useDebugValue = function() { +}; +react_production_min.useDeferredValue = function(a) { + return U$1.current.useDeferredValue(a); +}; +react_production_min.useEffect = function(a, b) { + return U$1.current.useEffect(a, b); +}; +react_production_min.useId = function() { + return U$1.current.useId(); +}; +react_production_min.useImperativeHandle = function(a, b, e) { + return U$1.current.useImperativeHandle(a, b, e); +}; +react_production_min.useInsertionEffect = function(a, b) { + return U$1.current.useInsertionEffect(a, b); +}; +react_production_min.useLayoutEffect = function(a, b) { + return U$1.current.useLayoutEffect(a, b); +}; +react_production_min.useMemo = function(a, b) { + return U$1.current.useMemo(a, b); +}; +react_production_min.useReducer = function(a, b, e) { + return U$1.current.useReducer(a, b, e); +}; +react_production_min.useRef = function(a) { + return U$1.current.useRef(a); +}; +react_production_min.useState = function(a) { + return U$1.current.useState(a); +}; +react_production_min.useSyncExternalStore = function(a, b, e) { + return U$1.current.useSyncExternalStore(a, b, e); +}; +react_production_min.useTransition = function() { + return U$1.current.useTransition(); +}; +react_production_min.version = "18.3.1"; +{ + react.exports = react_production_min; +} +var reactExports = react.exports; +const React = /* @__PURE__ */ getDefaultExportFromCjs(reactExports); +/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var f = reactExports, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$1 = { key: true, ref: true, __self: true, __source: true }; +function q(c, a, g) { + var b, d = {}, e = null, h = null; + void 0 !== g && (e = "" + g); + void 0 !== a.key && (e = "" + a.key); + void 0 !== a.ref && (h = a.ref); + for (b in a) m$1.call(a, b) && !p$1.hasOwnProperty(b) && (d[b] = a[b]); + if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]); + return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current }; +} +reactJsxRuntime_production_min.Fragment = l; +reactJsxRuntime_production_min.jsx = q; +reactJsxRuntime_production_min.jsxs = q; +{ + jsxRuntime.exports = reactJsxRuntime_production_min; +} +var jsxRuntimeExports = jsxRuntime.exports; +var client = {}; +var reactDom = { exports: {} }; +var reactDom_production_min = {}; +var scheduler = { exports: {} }; +var scheduler_production_min = {}; +/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +(function(exports$1) { + function f2(a, b) { + var c = a.length; + a.push(b); + a: for (; 0 < c; ) { + var d = c - 1 >>> 1, e = a[d]; + if (0 < g(e, b)) a[d] = b, a[c] = e, c = d; + else break a; + } + } + function h(a) { + return 0 === a.length ? null : a[0]; + } + function k2(a) { + if (0 === a.length) return null; + var b = a[0], c = a.pop(); + if (c !== b) { + a[0] = c; + a: for (var d = 0, e = a.length, w2 = e >>> 1; d < w2; ) { + var m2 = 2 * (d + 1) - 1, C2 = a[m2], n2 = m2 + 1, x2 = a[n2]; + if (0 > g(C2, c)) n2 < e && 0 > g(x2, C2) ? (a[d] = x2, a[n2] = c, d = n2) : (a[d] = C2, a[m2] = c, d = m2); + else if (n2 < e && 0 > g(x2, c)) a[d] = x2, a[n2] = c, d = n2; + else break a; + } + } + return b; + } + function g(a, b) { + var c = a.sortIndex - b.sortIndex; + return 0 !== c ? c : a.id - b.id; + } + if ("object" === typeof performance && "function" === typeof performance.now) { + var l2 = performance; + exports$1.unstable_now = function() { + return l2.now(); + }; + } else { + var p2 = Date, q2 = p2.now(); + exports$1.unstable_now = function() { + return p2.now() - q2; + }; + } + var r2 = [], t2 = [], u2 = 1, v2 = null, y2 = 3, z2 = false, A2 = false, B2 = false, D2 = "function" === typeof setTimeout ? setTimeout : null, E2 = "function" === typeof clearTimeout ? clearTimeout : null, F2 = "undefined" !== typeof setImmediate ? setImmediate : null; + "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); + function G2(a) { + for (var b = h(t2); null !== b; ) { + if (null === b.callback) k2(t2); + else if (b.startTime <= a) k2(t2), b.sortIndex = b.expirationTime, f2(r2, b); + else break; + b = h(t2); + } + } + function H2(a) { + B2 = false; + G2(a); + if (!A2) if (null !== h(r2)) A2 = true, I2(J2); + else { + var b = h(t2); + null !== b && K2(H2, b.startTime - a); + } + } + function J2(a, b) { + A2 = false; + B2 && (B2 = false, E2(L2), L2 = -1); + z2 = true; + var c = y2; + try { + G2(b); + for (v2 = h(r2); null !== v2 && (!(v2.expirationTime > b) || a && !M2()); ) { + var d = v2.callback; + if ("function" === typeof d) { + v2.callback = null; + y2 = v2.priorityLevel; + var e = d(v2.expirationTime <= b); + b = exports$1.unstable_now(); + "function" === typeof e ? v2.callback = e : v2 === h(r2) && k2(r2); + G2(b); + } else k2(r2); + v2 = h(r2); + } + if (null !== v2) var w2 = true; + else { + var m2 = h(t2); + null !== m2 && K2(H2, m2.startTime - b); + w2 = false; + } + return w2; + } finally { + v2 = null, y2 = c, z2 = false; + } + } + var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1; + function M2() { + return exports$1.unstable_now() - Q2 < P2 ? false : true; + } + function R2() { + if (null !== O2) { + var a = exports$1.unstable_now(); + Q2 = a; + var b = true; + try { + b = O2(true, a); + } finally { + b ? S2() : (N2 = false, O2 = null); + } + } else N2 = false; + } + var S2; + if ("function" === typeof F2) S2 = function() { + F2(R2); + }; + else if ("undefined" !== typeof MessageChannel) { + var T2 = new MessageChannel(), U2 = T2.port2; + T2.port1.onmessage = R2; + S2 = function() { + U2.postMessage(null); + }; + } else S2 = function() { + D2(R2, 0); + }; + function I2(a) { + O2 = a; + N2 || (N2 = true, S2()); + } + function K2(a, b) { + L2 = D2(function() { + a(exports$1.unstable_now()); + }, b); + } + exports$1.unstable_IdlePriority = 5; + exports$1.unstable_ImmediatePriority = 1; + exports$1.unstable_LowPriority = 4; + exports$1.unstable_NormalPriority = 3; + exports$1.unstable_Profiling = null; + exports$1.unstable_UserBlockingPriority = 2; + exports$1.unstable_cancelCallback = function(a) { + a.callback = null; + }; + exports$1.unstable_continueExecution = function() { + A2 || z2 || (A2 = true, I2(J2)); + }; + exports$1.unstable_forceFrameRate = function(a) { + 0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a ? Math.floor(1e3 / a) : 5; + }; + exports$1.unstable_getCurrentPriorityLevel = function() { + return y2; + }; + exports$1.unstable_getFirstCallbackNode = function() { + return h(r2); + }; + exports$1.unstable_next = function(a) { + switch (y2) { + case 1: + case 2: + case 3: + var b = 3; + break; + default: + b = y2; + } + var c = y2; + y2 = b; + try { + return a(); + } finally { + y2 = c; + } + }; + exports$1.unstable_pauseExecution = function() { + }; + exports$1.unstable_requestPaint = function() { + }; + exports$1.unstable_runWithPriority = function(a, b) { + switch (a) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + a = 3; + } + var c = y2; + y2 = a; + try { + return b(); + } finally { + y2 = c; + } + }; + exports$1.unstable_scheduleCallback = function(a, b, c) { + var d = exports$1.unstable_now(); + "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d; + switch (a) { + case 1: + var e = -1; + break; + case 2: + e = 250; + break; + case 5: + e = 1073741823; + break; + case 4: + e = 1e4; + break; + default: + e = 5e3; + } + e = c + e; + a = { id: u2++, callback: b, priorityLevel: a, startTime: c, expirationTime: e, sortIndex: -1 }; + c > d ? (a.sortIndex = c, f2(t2, a), null === h(r2) && a === h(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c - d))) : (a.sortIndex = e, f2(r2, a), A2 || z2 || (A2 = true, I2(J2))); + return a; + }; + exports$1.unstable_shouldYield = M2; + exports$1.unstable_wrapCallback = function(a) { + var b = y2; + return function() { + var c = y2; + y2 = b; + try { + return a.apply(this, arguments); + } finally { + y2 = c; + } + }; + }; +})(scheduler_production_min); +{ + scheduler.exports = scheduler_production_min; +} +var schedulerExports = scheduler.exports; +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var aa = reactExports, ca = schedulerExports; +function p(a) { + for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) b += "&args[]=" + encodeURIComponent(arguments[c]); + return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; +} +var da = /* @__PURE__ */ new Set(), ea = {}; +function fa(a, b) { + ha(a, b); + ha(a + "Capture", b); +} +function ha(a, b) { + ea[a] = b; + for (a = 0; a < b.length; a++) da.add(b[a]); +} +var ia = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), ja = Object.prototype.hasOwnProperty, ka = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, la = {}, ma = {}; +function oa(a) { + if (ja.call(ma, a)) return true; + if (ja.call(la, a)) return false; + if (ka.test(a)) return ma[a] = true; + la[a] = true; + return false; +} +function pa(a, b, c, d) { + if (null !== c && 0 === c.type) return false; + switch (typeof b) { + case "function": + case "symbol": + return true; + case "boolean": + if (d) return false; + if (null !== c) return !c.acceptsBooleans; + a = a.toLowerCase().slice(0, 5); + return "data-" !== a && "aria-" !== a; + default: + return false; + } +} +function qa(a, b, c, d) { + if (null === b || "undefined" === typeof b || pa(a, b, c, d)) return true; + if (d) return false; + if (null !== c) switch (c.type) { + case 3: + return !b; + case 4: + return false === b; + case 5: + return isNaN(b); + case 6: + return isNaN(b) || 1 > b; + } + return false; +} +function v(a, b, c, d, e, f2, g) { + this.acceptsBooleans = 2 === b || 3 === b || 4 === b; + this.attributeName = d; + this.attributeNamespace = e; + this.mustUseProperty = c; + this.propertyName = a; + this.type = b; + this.sanitizeURL = f2; + this.removeEmptyString = g; +} +var z = {}; +"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { + z[a] = new v(a, 0, false, a, null, false, false); +}); +[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a) { + var b = a[0]; + z[b] = new v(b, 1, false, a[1], null, false, false); +}); +["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a) { + z[a] = new v(a, 2, false, a.toLowerCase(), null, false, false); +}); +["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a) { + z[a] = new v(a, 2, false, a, null, false, false); +}); +"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a) { + z[a] = new v(a, 3, false, a.toLowerCase(), null, false, false); +}); +["checked", "multiple", "muted", "selected"].forEach(function(a) { + z[a] = new v(a, 3, true, a, null, false, false); +}); +["capture", "download"].forEach(function(a) { + z[a] = new v(a, 4, false, a, null, false, false); +}); +["cols", "rows", "size", "span"].forEach(function(a) { + z[a] = new v(a, 6, false, a, null, false, false); +}); +["rowSpan", "start"].forEach(function(a) { + z[a] = new v(a, 5, false, a.toLowerCase(), null, false, false); +}); +var ra = /[\-:]([a-z])/g; +function sa(a) { + return a[1].toUpperCase(); +} +"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a) { + var b = a.replace( + ra, + sa + ); + z[b] = new v(b, 1, false, a, null, false, false); +}); +"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) { + var b = a.replace(ra, sa); + z[b] = new v(b, 1, false, a, "http://www.w3.org/1999/xlink", false, false); +}); +["xml:base", "xml:lang", "xml:space"].forEach(function(a) { + var b = a.replace(ra, sa); + z[b] = new v(b, 1, false, a, "http://www.w3.org/XML/1998/namespace", false, false); +}); +["tabIndex", "crossOrigin"].forEach(function(a) { + z[a] = new v(a, 1, false, a.toLowerCase(), null, false, false); +}); +z.xlinkHref = new v("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); +["src", "href", "action", "formAction"].forEach(function(a) { + z[a] = new v(a, 1, false, a.toLowerCase(), null, true, true); +}); +function ta(a, b, c, d) { + var e = z.hasOwnProperty(b) ? z[b] : null; + if (null !== e ? 0 !== e.type : d || !(2 < b.length) || "o" !== b[0] && "O" !== b[0] || "n" !== b[1] && "N" !== b[1]) qa(b, c, e, d) && (c = null), d || null === e ? oa(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? false : "" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && true === c ? "" : "" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))); +} +var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va = Symbol.for("react.element"), wa = Symbol.for("react.portal"), ya = Symbol.for("react.fragment"), za = Symbol.for("react.strict_mode"), Aa = Symbol.for("react.profiler"), Ba = Symbol.for("react.provider"), Ca = Symbol.for("react.context"), Da = Symbol.for("react.forward_ref"), Ea = Symbol.for("react.suspense"), Fa = Symbol.for("react.suspense_list"), Ga = Symbol.for("react.memo"), Ha = Symbol.for("react.lazy"); +var Ia = Symbol.for("react.offscreen"); +var Ja = Symbol.iterator; +function Ka(a) { + if (null === a || "object" !== typeof a) return null; + a = Ja && a[Ja] || a["@@iterator"]; + return "function" === typeof a ? a : null; +} +var A = Object.assign, La; +function Ma(a) { + if (void 0 === La) try { + throw Error(); + } catch (c) { + var b = c.stack.trim().match(/\n( *(at )?)/); + La = b && b[1] || ""; + } + return "\n" + La + a; +} +var Na = false; +function Oa(a, b) { + if (!a || Na) return ""; + Na = true; + var c = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + if (b) if (b = function() { + throw Error(); + }, Object.defineProperty(b.prototype, "props", { set: function() { + throw Error(); + } }), "object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(b, []); + } catch (l2) { + var d = l2; + } + Reflect.construct(a, [], b); + } else { + try { + b.call(); + } catch (l2) { + d = l2; + } + a.call(b.prototype); + } + else { + try { + throw Error(); + } catch (l2) { + d = l2; + } + a(); + } + } catch (l2) { + if (l2 && d && "string" === typeof l2.stack) { + for (var e = l2.stack.split("\n"), f2 = d.stack.split("\n"), g = e.length - 1, h = f2.length - 1; 1 <= g && 0 <= h && e[g] !== f2[h]; ) h--; + for (; 1 <= g && 0 <= h; g--, h--) if (e[g] !== f2[h]) { + if (1 !== g || 1 !== h) { + do + if (g--, h--, 0 > h || e[g] !== f2[h]) { + var k2 = "\n" + e[g].replace(" at new ", " at "); + a.displayName && k2.includes("") && (k2 = k2.replace("", a.displayName)); + return k2; + } + while (1 <= g && 0 <= h); + } + break; + } + } + } finally { + Na = false, Error.prepareStackTrace = c; + } + return (a = a ? a.displayName || a.name : "") ? Ma(a) : ""; +} +function Pa(a) { + switch (a.tag) { + case 5: + return Ma(a.type); + case 16: + return Ma("Lazy"); + case 13: + return Ma("Suspense"); + case 19: + return Ma("SuspenseList"); + case 0: + case 2: + case 15: + return a = Oa(a.type, false), a; + case 11: + return a = Oa(a.type.render, false), a; + case 1: + return a = Oa(a.type, true), a; + default: + return ""; + } +} +function Qa(a) { + if (null == a) return null; + if ("function" === typeof a) return a.displayName || a.name || null; + if ("string" === typeof a) return a; + switch (a) { + case ya: + return "Fragment"; + case wa: + return "Portal"; + case Aa: + return "Profiler"; + case za: + return "StrictMode"; + case Ea: + return "Suspense"; + case Fa: + return "SuspenseList"; + } + if ("object" === typeof a) switch (a.$$typeof) { + case Ca: + return (a.displayName || "Context") + ".Consumer"; + case Ba: + return (a._context.displayName || "Context") + ".Provider"; + case Da: + var b = a.render; + a = a.displayName; + a || (a = b.displayName || b.name || "", a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"); + return a; + case Ga: + return b = a.displayName || null, null !== b ? b : Qa(a.type) || "Memo"; + case Ha: + b = a._payload; + a = a._init; + try { + return Qa(a(b)); + } catch (c) { + } + } + return null; +} +function Ra(a) { + var b = a.type; + switch (a.tag) { + case 24: + return "Cache"; + case 9: + return (b.displayName || "Context") + ".Consumer"; + case 10: + return (b._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return a = b.render, a = a.displayName || a.name || "", b.displayName || ("" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return b; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return Qa(b); + case 8: + return b === za ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if ("function" === typeof b) return b.displayName || b.name || null; + if ("string" === typeof b) return b; + } + return null; +} +function Sa(a) { + switch (typeof a) { + case "boolean": + case "number": + case "string": + case "undefined": + return a; + case "object": + return a; + default: + return ""; + } +} +function Ta(a) { + var b = a.type; + return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b); +} +function Ua(a) { + var b = Ta(a) ? "checked" : "value", c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b), d = "" + a[b]; + if (!a.hasOwnProperty(b) && "undefined" !== typeof c && "function" === typeof c.get && "function" === typeof c.set) { + var e = c.get, f2 = c.set; + Object.defineProperty(a, b, { configurable: true, get: function() { + return e.call(this); + }, set: function(a2) { + d = "" + a2; + f2.call(this, a2); + } }); + Object.defineProperty(a, b, { enumerable: c.enumerable }); + return { getValue: function() { + return d; + }, setValue: function(a2) { + d = "" + a2; + }, stopTracking: function() { + a._valueTracker = null; + delete a[b]; + } }; + } +} +function Va(a) { + a._valueTracker || (a._valueTracker = Ua(a)); +} +function Wa(a) { + if (!a) return false; + var b = a._valueTracker; + if (!b) return true; + var c = b.getValue(); + var d = ""; + a && (d = Ta(a) ? a.checked ? "true" : "false" : a.value); + a = d; + return a !== c ? (b.setValue(a), true) : false; +} +function Xa(a) { + a = a || ("undefined" !== typeof document ? document : void 0); + if ("undefined" === typeof a) return null; + try { + return a.activeElement || a.body; + } catch (b) { + return a.body; + } +} +function Ya(a, b) { + var c = b.checked; + return A({}, b, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c ? c : a._wrapperState.initialChecked }); +} +function Za(a, b) { + var c = null == b.defaultValue ? "" : b.defaultValue, d = null != b.checked ? b.checked : b.defaultChecked; + c = Sa(null != b.value ? b.value : c); + a._wrapperState = { initialChecked: d, initialValue: c, controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value }; +} +function ab(a, b) { + b = b.checked; + null != b && ta(a, "checked", b, false); +} +function bb(a, b) { + ab(a, b); + var c = Sa(b.value), d = b.type; + if (null != c) if ("number" === d) { + if (0 === c && "" === a.value || a.value != c) a.value = "" + c; + } else a.value !== "" + c && (a.value = "" + c); + else if ("submit" === d || "reset" === d) { + a.removeAttribute("value"); + return; + } + b.hasOwnProperty("value") ? cb(a, b.type, c) : b.hasOwnProperty("defaultValue") && cb(a, b.type, Sa(b.defaultValue)); + null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked); +} +function db(a, b, c) { + if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) { + var d = b.type; + if (!("submit" !== d && "reset" !== d || void 0 !== b.value && null !== b.value)) return; + b = "" + a._wrapperState.initialValue; + c || b === a.value || (a.value = b); + a.defaultValue = b; + } + c = a.name; + "" !== c && (a.name = ""); + a.defaultChecked = !!a._wrapperState.initialChecked; + "" !== c && (a.name = c); +} +function cb(a, b, c) { + if ("number" !== b || Xa(a.ownerDocument) !== a) null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c); +} +var eb = Array.isArray; +function fb(a, b, c, d) { + a = a.options; + if (b) { + b = {}; + for (var e = 0; e < c.length; e++) b["$" + c[e]] = true; + for (c = 0; c < a.length; c++) e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = true); + } else { + c = "" + Sa(c); + b = null; + for (e = 0; e < a.length; e++) { + if (a[e].value === c) { + a[e].selected = true; + d && (a[e].defaultSelected = true); + return; + } + null !== b || a[e].disabled || (b = a[e]); + } + null !== b && (b.selected = true); + } +} +function gb(a, b) { + if (null != b.dangerouslySetInnerHTML) throw Error(p(91)); + return A({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue }); +} +function hb(a, b) { + var c = b.value; + if (null == c) { + c = b.children; + b = b.defaultValue; + if (null != c) { + if (null != b) throw Error(p(92)); + if (eb(c)) { + if (1 < c.length) throw Error(p(93)); + c = c[0]; + } + b = c; + } + null == b && (b = ""); + c = b; + } + a._wrapperState = { initialValue: Sa(c) }; +} +function ib(a, b) { + var c = Sa(b.value), d = Sa(b.defaultValue); + null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c)); + null != d && (a.defaultValue = "" + d); +} +function jb(a) { + var b = a.textContent; + b === a._wrapperState.initialValue && "" !== b && null !== b && (a.value = b); +} +function kb(a) { + switch (a) { + case "svg": + return "http://www.w3.org/2000/svg"; + case "math": + return "http://www.w3.org/1998/Math/MathML"; + default: + return "http://www.w3.org/1999/xhtml"; + } +} +function lb(a, b) { + return null == a || "http://www.w3.org/1999/xhtml" === a ? kb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a; +} +var mb, nb = function(a) { + return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) { + MSApp.execUnsafeLocalFunction(function() { + return a(b, c, d, e); + }); + } : a; +}(function(a, b) { + if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML" in a) a.innerHTML = b; + else { + mb = mb || document.createElement("div"); + mb.innerHTML = "" + b.valueOf().toString() + ""; + for (b = mb.firstChild; a.firstChild; ) a.removeChild(a.firstChild); + for (; b.firstChild; ) a.appendChild(b.firstChild); + } +}); +function ob(a, b) { + if (b) { + var c = a.firstChild; + if (c && c === a.lastChild && 3 === c.nodeType) { + c.nodeValue = b; + return; + } + } + a.textContent = b; +} +var pb = { + animationIterationCount: true, + aspectRatio: true, + borderImageOutset: true, + borderImageSlice: true, + borderImageWidth: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + columns: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + gridArea: true, + gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, + gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + fillOpacity: true, + floodOpacity: true, + stopOpacity: true, + strokeDasharray: true, + strokeDashoffset: true, + strokeMiterlimit: true, + strokeOpacity: true, + strokeWidth: true +}, qb = ["Webkit", "ms", "Moz", "O"]; +Object.keys(pb).forEach(function(a) { + qb.forEach(function(b) { + b = b + a.charAt(0).toUpperCase() + a.substring(1); + pb[b] = pb[a]; + }); +}); +function rb(a, b, c) { + return null == b || "boolean" === typeof b || "" === b ? "" : c || "number" !== typeof b || 0 === b || pb.hasOwnProperty(a) && pb[a] ? ("" + b).trim() : b + "px"; +} +function sb(a, b) { + a = a.style; + for (var c in b) if (b.hasOwnProperty(c)) { + var d = 0 === c.indexOf("--"), e = rb(c, b[c], d); + "float" === c && (c = "cssFloat"); + d ? a.setProperty(c, e) : a[c] = e; + } +} +var tb = A({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); +function ub(a, b) { + if (b) { + if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a)); + if (null != b.dangerouslySetInnerHTML) { + if (null != b.children) throw Error(p(60)); + if ("object" !== typeof b.dangerouslySetInnerHTML || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61)); + } + if (null != b.style && "object" !== typeof b.style) throw Error(p(62)); + } +} +function vb(a, b) { + if (-1 === a.indexOf("-")) return "string" === typeof b.is; + switch (a) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return false; + default: + return true; + } +} +var wb = null; +function xb(a) { + a = a.target || a.srcElement || window; + a.correspondingUseElement && (a = a.correspondingUseElement); + return 3 === a.nodeType ? a.parentNode : a; +} +var yb = null, zb = null, Ab = null; +function Bb(a) { + if (a = Cb(a)) { + if ("function" !== typeof yb) throw Error(p(280)); + var b = a.stateNode; + b && (b = Db(b), yb(a.stateNode, a.type, b)); + } +} +function Eb(a) { + zb ? Ab ? Ab.push(a) : Ab = [a] : zb = a; +} +function Fb() { + if (zb) { + var a = zb, b = Ab; + Ab = zb = null; + Bb(a); + if (b) for (a = 0; a < b.length; a++) Bb(b[a]); + } +} +function Gb(a, b) { + return a(b); +} +function Hb() { +} +var Ib = false; +function Jb(a, b, c) { + if (Ib) return a(b, c); + Ib = true; + try { + return Gb(a, b, c); + } finally { + if (Ib = false, null !== zb || null !== Ab) Hb(), Fb(); + } +} +function Kb(a, b) { + var c = a.stateNode; + if (null === c) return null; + var d = Db(c); + if (null === d) return null; + c = d[b]; + a: switch (b) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + case "onMouseEnter": + (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a)); + a = !d; + break a; + default: + a = false; + } + if (a) return null; + if (c && "function" !== typeof c) throw Error(p(231, b, typeof c)); + return c; +} +var Lb = false; +if (ia) try { + var Mb = {}; + Object.defineProperty(Mb, "passive", { get: function() { + Lb = true; + } }); + window.addEventListener("test", Mb, Mb); + window.removeEventListener("test", Mb, Mb); +} catch (a) { + Lb = false; +} +function Nb(a, b, c, d, e, f2, g, h, k2) { + var l2 = Array.prototype.slice.call(arguments, 3); + try { + b.apply(c, l2); + } catch (m2) { + this.onError(m2); + } +} +var Ob = false, Pb = null, Qb = false, Rb = null, Sb = { onError: function(a) { + Ob = true; + Pb = a; +} }; +function Tb(a, b, c, d, e, f2, g, h, k2) { + Ob = false; + Pb = null; + Nb.apply(Sb, arguments); +} +function Ub(a, b, c, d, e, f2, g, h, k2) { + Tb.apply(this, arguments); + if (Ob) { + if (Ob) { + var l2 = Pb; + Ob = false; + Pb = null; + } else throw Error(p(198)); + Qb || (Qb = true, Rb = l2); + } +} +function Vb(a) { + var b = a, c = a; + if (a.alternate) for (; b.return; ) b = b.return; + else { + a = b; + do + b = a, 0 !== (b.flags & 4098) && (c = b.return), a = b.return; + while (a); + } + return 3 === b.tag ? c : null; +} +function Wb(a) { + if (13 === a.tag) { + var b = a.memoizedState; + null === b && (a = a.alternate, null !== a && (b = a.memoizedState)); + if (null !== b) return b.dehydrated; + } + return null; +} +function Xb(a) { + if (Vb(a) !== a) throw Error(p(188)); +} +function Yb(a) { + var b = a.alternate; + if (!b) { + b = Vb(a); + if (null === b) throw Error(p(188)); + return b !== a ? null : a; + } + for (var c = a, d = b; ; ) { + var e = c.return; + if (null === e) break; + var f2 = e.alternate; + if (null === f2) { + d = e.return; + if (null !== d) { + c = d; + continue; + } + break; + } + if (e.child === f2.child) { + for (f2 = e.child; f2; ) { + if (f2 === c) return Xb(e), a; + if (f2 === d) return Xb(e), b; + f2 = f2.sibling; + } + throw Error(p(188)); + } + if (c.return !== d.return) c = e, d = f2; + else { + for (var g = false, h = e.child; h; ) { + if (h === c) { + g = true; + c = e; + d = f2; + break; + } + if (h === d) { + g = true; + d = e; + c = f2; + break; + } + h = h.sibling; + } + if (!g) { + for (h = f2.child; h; ) { + if (h === c) { + g = true; + c = f2; + d = e; + break; + } + if (h === d) { + g = true; + d = f2; + c = e; + break; + } + h = h.sibling; + } + if (!g) throw Error(p(189)); + } + } + if (c.alternate !== d) throw Error(p(190)); + } + if (3 !== c.tag) throw Error(p(188)); + return c.stateNode.current === c ? a : b; +} +function Zb(a) { + a = Yb(a); + return null !== a ? $b(a) : null; +} +function $b(a) { + if (5 === a.tag || 6 === a.tag) return a; + for (a = a.child; null !== a; ) { + var b = $b(a); + if (null !== b) return b; + a = a.sibling; + } + return null; +} +var ac = ca.unstable_scheduleCallback, bc = ca.unstable_cancelCallback, cc = ca.unstable_shouldYield, dc = ca.unstable_requestPaint, B = ca.unstable_now, ec = ca.unstable_getCurrentPriorityLevel, fc = ca.unstable_ImmediatePriority, gc = ca.unstable_UserBlockingPriority, hc = ca.unstable_NormalPriority, ic = ca.unstable_LowPriority, jc = ca.unstable_IdlePriority, kc = null, lc = null; +function mc(a) { + if (lc && "function" === typeof lc.onCommitFiberRoot) try { + lc.onCommitFiberRoot(kc, a, void 0, 128 === (a.current.flags & 128)); + } catch (b) { + } +} +var oc = Math.clz32 ? Math.clz32 : nc, pc = Math.log, qc = Math.LN2; +function nc(a) { + a >>>= 0; + return 0 === a ? 32 : 31 - (pc(a) / qc | 0) | 0; +} +var rc = 64, sc = 4194304; +function tc(a) { + switch (a & -a) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return a & 4194240; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return a & 130023424; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return a; + } +} +function uc(a, b) { + var c = a.pendingLanes; + if (0 === c) return 0; + var d = 0, e = a.suspendedLanes, f2 = a.pingedLanes, g = c & 268435455; + if (0 !== g) { + var h = g & ~e; + 0 !== h ? d = tc(h) : (f2 &= g, 0 !== f2 && (d = tc(f2))); + } else g = c & ~e, 0 !== g ? d = tc(g) : 0 !== f2 && (d = tc(f2)); + if (0 === d) return 0; + if (0 !== b && b !== d && 0 === (b & e) && (e = d & -d, f2 = b & -b, e >= f2 || 16 === e && 0 !== (f2 & 4194240))) return b; + 0 !== (d & 4) && (d |= c & 16); + b = a.entangledLanes; + if (0 !== b) for (a = a.entanglements, b &= d; 0 < b; ) c = 31 - oc(b), e = 1 << c, d |= a[c], b &= ~e; + return d; +} +function vc(a, b) { + switch (a) { + case 1: + case 2: + case 4: + return b + 250; + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return b + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return -1; + } +} +function wc(a, b) { + for (var c = a.suspendedLanes, d = a.pingedLanes, e = a.expirationTimes, f2 = a.pendingLanes; 0 < f2; ) { + var g = 31 - oc(f2), h = 1 << g, k2 = e[g]; + if (-1 === k2) { + if (0 === (h & c) || 0 !== (h & d)) e[g] = vc(h, b); + } else k2 <= b && (a.expiredLanes |= h); + f2 &= ~h; + } +} +function xc(a) { + a = a.pendingLanes & -1073741825; + return 0 !== a ? a : a & 1073741824 ? 1073741824 : 0; +} +function yc() { + var a = rc; + rc <<= 1; + 0 === (rc & 4194240) && (rc = 64); + return a; +} +function zc(a) { + for (var b = [], c = 0; 31 > c; c++) b.push(a); + return b; +} +function Ac(a, b, c) { + a.pendingLanes |= b; + 536870912 !== b && (a.suspendedLanes = 0, a.pingedLanes = 0); + a = a.eventTimes; + b = 31 - oc(b); + a[b] = c; +} +function Bc(a, b) { + var c = a.pendingLanes & ~b; + a.pendingLanes = b; + a.suspendedLanes = 0; + a.pingedLanes = 0; + a.expiredLanes &= b; + a.mutableReadLanes &= b; + a.entangledLanes &= b; + b = a.entanglements; + var d = a.eventTimes; + for (a = a.expirationTimes; 0 < c; ) { + var e = 31 - oc(c), f2 = 1 << e; + b[e] = 0; + d[e] = -1; + a[e] = -1; + c &= ~f2; + } +} +function Cc(a, b) { + var c = a.entangledLanes |= b; + for (a = a.entanglements; c; ) { + var d = 31 - oc(c), e = 1 << d; + e & b | a[d] & b && (a[d] |= b); + c &= ~e; + } +} +var C = 0; +function Dc(a) { + a &= -a; + return 1 < a ? 4 < a ? 0 !== (a & 268435455) ? 16 : 536870912 : 4 : 1; +} +var Ec, Fc, Gc, Hc, Ic, Jc = false, Kc = [], Lc = null, Mc = null, Nc = null, Oc = /* @__PURE__ */ new Map(), Pc = /* @__PURE__ */ new Map(), Qc = [], Rc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); +function Sc(a, b) { + switch (a) { + case "focusin": + case "focusout": + Lc = null; + break; + case "dragenter": + case "dragleave": + Mc = null; + break; + case "mouseover": + case "mouseout": + Nc = null; + break; + case "pointerover": + case "pointerout": + Oc.delete(b.pointerId); + break; + case "gotpointercapture": + case "lostpointercapture": + Pc.delete(b.pointerId); + } +} +function Tc(a, b, c, d, e, f2) { + if (null === a || a.nativeEvent !== f2) return a = { blockedOn: b, domEventName: c, eventSystemFlags: d, nativeEvent: f2, targetContainers: [e] }, null !== b && (b = Cb(b), null !== b && Fc(b)), a; + a.eventSystemFlags |= d; + b = a.targetContainers; + null !== e && -1 === b.indexOf(e) && b.push(e); + return a; +} +function Uc(a, b, c, d, e) { + switch (b) { + case "focusin": + return Lc = Tc(Lc, a, b, c, d, e), true; + case "dragenter": + return Mc = Tc(Mc, a, b, c, d, e), true; + case "mouseover": + return Nc = Tc(Nc, a, b, c, d, e), true; + case "pointerover": + var f2 = e.pointerId; + Oc.set(f2, Tc(Oc.get(f2) || null, a, b, c, d, e)); + return true; + case "gotpointercapture": + return f2 = e.pointerId, Pc.set(f2, Tc(Pc.get(f2) || null, a, b, c, d, e)), true; + } + return false; +} +function Vc(a) { + var b = Wc(a.target); + if (null !== b) { + var c = Vb(b); + if (null !== c) { + if (b = c.tag, 13 === b) { + if (b = Wb(c), null !== b) { + a.blockedOn = b; + Ic(a.priority, function() { + Gc(c); + }); + return; + } + } else if (3 === b && c.stateNode.current.memoizedState.isDehydrated) { + a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null; + return; + } + } + } + a.blockedOn = null; +} +function Xc(a) { + if (null !== a.blockedOn) return false; + for (var b = a.targetContainers; 0 < b.length; ) { + var c = Yc(a.domEventName, a.eventSystemFlags, b[0], a.nativeEvent); + if (null === c) { + c = a.nativeEvent; + var d = new c.constructor(c.type, c); + wb = d; + c.target.dispatchEvent(d); + wb = null; + } else return b = Cb(c), null !== b && Fc(b), a.blockedOn = c, false; + b.shift(); + } + return true; +} +function Zc(a, b, c) { + Xc(a) && c.delete(b); +} +function $c() { + Jc = false; + null !== Lc && Xc(Lc) && (Lc = null); + null !== Mc && Xc(Mc) && (Mc = null); + null !== Nc && Xc(Nc) && (Nc = null); + Oc.forEach(Zc); + Pc.forEach(Zc); +} +function ad(a, b) { + a.blockedOn === b && (a.blockedOn = null, Jc || (Jc = true, ca.unstable_scheduleCallback(ca.unstable_NormalPriority, $c))); +} +function bd(a) { + function b(b2) { + return ad(b2, a); + } + if (0 < Kc.length) { + ad(Kc[0], a); + for (var c = 1; c < Kc.length; c++) { + var d = Kc[c]; + d.blockedOn === a && (d.blockedOn = null); + } + } + null !== Lc && ad(Lc, a); + null !== Mc && ad(Mc, a); + null !== Nc && ad(Nc, a); + Oc.forEach(b); + Pc.forEach(b); + for (c = 0; c < Qc.length; c++) d = Qc[c], d.blockedOn === a && (d.blockedOn = null); + for (; 0 < Qc.length && (c = Qc[0], null === c.blockedOn); ) Vc(c), null === c.blockedOn && Qc.shift(); +} +var cd = ua.ReactCurrentBatchConfig, dd = true; +function ed(a, b, c, d) { + var e = C, f2 = cd.transition; + cd.transition = null; + try { + C = 1, fd(a, b, c, d); + } finally { + C = e, cd.transition = f2; + } +} +function gd(a, b, c, d) { + var e = C, f2 = cd.transition; + cd.transition = null; + try { + C = 4, fd(a, b, c, d); + } finally { + C = e, cd.transition = f2; + } +} +function fd(a, b, c, d) { + if (dd) { + var e = Yc(a, b, c, d); + if (null === e) hd(a, b, d, id, c), Sc(a, d); + else if (Uc(e, a, b, c, d)) d.stopPropagation(); + else if (Sc(a, d), b & 4 && -1 < Rc.indexOf(a)) { + for (; null !== e; ) { + var f2 = Cb(e); + null !== f2 && Ec(f2); + f2 = Yc(a, b, c, d); + null === f2 && hd(a, b, d, id, c); + if (f2 === e) break; + e = f2; + } + null !== e && d.stopPropagation(); + } else hd(a, b, d, null, c); + } +} +var id = null; +function Yc(a, b, c, d) { + id = null; + a = xb(d); + a = Wc(a); + if (null !== a) if (b = Vb(a), null === b) a = null; + else if (c = b.tag, 13 === c) { + a = Wb(b); + if (null !== a) return a; + a = null; + } else if (3 === c) { + if (b.stateNode.current.memoizedState.isDehydrated) return 3 === b.tag ? b.stateNode.containerInfo : null; + a = null; + } else b !== a && (a = null); + id = a; + return null; +} +function jd(a) { + switch (a) { + case "cancel": + case "click": + case "close": + case "contextmenu": + case "copy": + case "cut": + case "auxclick": + case "dblclick": + case "dragend": + case "dragstart": + case "drop": + case "focusin": + case "focusout": + case "input": + case "invalid": + case "keydown": + case "keypress": + case "keyup": + case "mousedown": + case "mouseup": + case "paste": + case "pause": + case "play": + case "pointercancel": + case "pointerdown": + case "pointerup": + case "ratechange": + case "reset": + case "resize": + case "seeked": + case "submit": + case "touchcancel": + case "touchend": + case "touchstart": + case "volumechange": + case "change": + case "selectionchange": + case "textInput": + case "compositionstart": + case "compositionend": + case "compositionupdate": + case "beforeblur": + case "afterblur": + case "beforeinput": + case "blur": + case "fullscreenchange": + case "focus": + case "hashchange": + case "popstate": + case "select": + case "selectstart": + return 1; + case "drag": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "mousemove": + case "mouseout": + case "mouseover": + case "pointermove": + case "pointerout": + case "pointerover": + case "scroll": + case "toggle": + case "touchmove": + case "wheel": + case "mouseenter": + case "mouseleave": + case "pointerenter": + case "pointerleave": + return 4; + case "message": + switch (ec()) { + case fc: + return 1; + case gc: + return 4; + case hc: + case ic: + return 16; + case jc: + return 536870912; + default: + return 16; + } + default: + return 16; + } +} +var kd = null, ld = null, md = null; +function nd() { + if (md) return md; + var a, b = ld, c = b.length, d, e = "value" in kd ? kd.value : kd.textContent, f2 = e.length; + for (a = 0; a < c && b[a] === e[a]; a++) ; + var g = c - a; + for (d = 1; d <= g && b[c - d] === e[f2 - d]; d++) ; + return md = e.slice(a, 1 < d ? 1 - d : void 0); +} +function od(a) { + var b = a.keyCode; + "charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b; + 10 === a && (a = 13); + return 32 <= a || 13 === a ? a : 0; +} +function pd() { + return true; +} +function qd() { + return false; +} +function rd(a) { + function b(b2, d, e, f2, g) { + this._reactName = b2; + this._targetInst = e; + this.type = d; + this.nativeEvent = f2; + this.target = g; + this.currentTarget = null; + for (var c in a) a.hasOwnProperty(c) && (b2 = a[c], this[c] = b2 ? b2(f2) : f2[c]); + this.isDefaultPrevented = (null != f2.defaultPrevented ? f2.defaultPrevented : false === f2.returnValue) ? pd : qd; + this.isPropagationStopped = qd; + return this; + } + A(b.prototype, { preventDefault: function() { + this.defaultPrevented = true; + var a2 = this.nativeEvent; + a2 && (a2.preventDefault ? a2.preventDefault() : "unknown" !== typeof a2.returnValue && (a2.returnValue = false), this.isDefaultPrevented = pd); + }, stopPropagation: function() { + var a2 = this.nativeEvent; + a2 && (a2.stopPropagation ? a2.stopPropagation() : "unknown" !== typeof a2.cancelBubble && (a2.cancelBubble = true), this.isPropagationStopped = pd); + }, persist: function() { + }, isPersistent: pd }); + return b; +} +var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a) { + return a.timeStamp || Date.now(); +}, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = A({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = A({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a) { + return void 0 === a.relatedTarget ? a.fromElement === a.srcElement ? a.toElement : a.fromElement : a.relatedTarget; +}, movementX: function(a) { + if ("movementX" in a) return a.movementX; + a !== yd && (yd && "mousemove" === a.type ? (wd = a.screenX - yd.screenX, xd = a.screenY - yd.screenY) : xd = wd = 0, yd = a); + return wd; +}, movementY: function(a) { + return "movementY" in a ? a.movementY : xd; +} }), Bd = rd(Ad), Cd = A({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = A({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = A({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = A({}, sd, { clipboardData: function(a) { + return "clipboardData" in a ? a.clipboardData : window.clipboardData; +} }), Jd = rd(Id), Kd = A({}, sd, { data: 0 }), Ld = rd(Kd), Md = { + Esc: "Escape", + Spacebar: " ", + Left: "ArrowLeft", + Up: "ArrowUp", + Right: "ArrowRight", + Down: "ArrowDown", + Del: "Delete", + Win: "OS", + Menu: "ContextMenu", + Apps: "ContextMenu", + Scroll: "ScrollLock", + MozPrintableKey: "Unidentified" +}, Nd = { + 8: "Backspace", + 9: "Tab", + 12: "Clear", + 13: "Enter", + 16: "Shift", + 17: "Control", + 18: "Alt", + 19: "Pause", + 20: "CapsLock", + 27: "Escape", + 32: " ", + 33: "PageUp", + 34: "PageDown", + 35: "End", + 36: "Home", + 37: "ArrowLeft", + 38: "ArrowUp", + 39: "ArrowRight", + 40: "ArrowDown", + 45: "Insert", + 46: "Delete", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "NumLock", + 145: "ScrollLock", + 224: "Meta" +}, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; +function Pd(a) { + var b = this.nativeEvent; + return b.getModifierState ? b.getModifierState(a) : (a = Od[a]) ? !!b[a] : false; +} +function zd() { + return Pd; +} +var Qd = A({}, ud, { key: function(a) { + if (a.key) { + var b = Md[a.key] || a.key; + if ("Unidentified" !== b) return b; + } + return "keypress" === a.type ? (a = od(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? Nd[a.keyCode] || "Unidentified" : ""; +}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a) { + return "keypress" === a.type ? od(a) : 0; +}, keyCode: function(a) { + return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; +}, which: function(a) { + return "keypress" === a.type ? od(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; +} }), Rd = rd(Qd), Sd = A({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = A({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = A({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = A({}, Ad, { + deltaX: function(a) { + return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0; + }, + deltaY: function(a) { + return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0; + }, + deltaZ: 0, + deltaMode: 0 +}), Zd = rd(Yd), $d = [9, 13, 27, 32], ae = ia && "CompositionEvent" in window, be = null; +ia && "documentMode" in document && (be = document.documentMode); +var ce = ia && "TextEvent" in window && !be, de = ia && (!ae || be && 8 < be && 11 >= be), ee = String.fromCharCode(32), fe = false; +function ge(a, b) { + switch (a) { + case "keyup": + return -1 !== $d.indexOf(b.keyCode); + case "keydown": + return 229 !== b.keyCode; + case "keypress": + case "mousedown": + case "focusout": + return true; + default: + return false; + } +} +function he(a) { + a = a.detail; + return "object" === typeof a && "data" in a ? a.data : null; +} +var ie = false; +function je(a, b) { + switch (a) { + case "compositionend": + return he(b); + case "keypress": + if (32 !== b.which) return null; + fe = true; + return ee; + case "textInput": + return a = b.data, a === ee && fe ? null : a; + default: + return null; + } +} +function ke(a, b) { + if (ie) return "compositionend" === a || !ae && ge(a, b) ? (a = nd(), md = ld = kd = null, ie = false, a) : null; + switch (a) { + case "paste": + return null; + case "keypress": + if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) { + if (b.char && 1 < b.char.length) return b.char; + if (b.which) return String.fromCharCode(b.which); + } + return null; + case "compositionend": + return de && "ko" !== b.locale ? null : b.data; + default: + return null; + } +} +var le = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; +function me(a) { + var b = a && a.nodeName && a.nodeName.toLowerCase(); + return "input" === b ? !!le[a.type] : "textarea" === b ? true : false; +} +function ne(a, b, c, d) { + Eb(d); + b = oe(b, "onChange"); + 0 < b.length && (c = new td("onChange", "change", null, c, d), a.push({ event: c, listeners: b })); +} +var pe = null, qe = null; +function re(a) { + se(a, 0); +} +function te(a) { + var b = ue(a); + if (Wa(b)) return a; +} +function ve(a, b) { + if ("change" === a) return b; +} +var we = false; +if (ia) { + var xe; + if (ia) { + var ye = "oninput" in document; + if (!ye) { + var ze = document.createElement("div"); + ze.setAttribute("oninput", "return;"); + ye = "function" === typeof ze.oninput; + } + xe = ye; + } else xe = false; + we = xe && (!document.documentMode || 9 < document.documentMode); +} +function Ae() { + pe && (pe.detachEvent("onpropertychange", Be), qe = pe = null); +} +function Be(a) { + if ("value" === a.propertyName && te(qe)) { + var b = []; + ne(b, qe, a, xb(a)); + Jb(re, b); + } +} +function Ce(a, b, c) { + "focusin" === a ? (Ae(), pe = b, qe = c, pe.attachEvent("onpropertychange", Be)) : "focusout" === a && Ae(); +} +function De(a) { + if ("selectionchange" === a || "keyup" === a || "keydown" === a) return te(qe); +} +function Ee(a, b) { + if ("click" === a) return te(b); +} +function Fe(a, b) { + if ("input" === a || "change" === a) return te(b); +} +function Ge(a, b) { + return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b; +} +var He = "function" === typeof Object.is ? Object.is : Ge; +function Ie(a, b) { + if (He(a, b)) return true; + if ("object" !== typeof a || null === a || "object" !== typeof b || null === b) return false; + var c = Object.keys(a), d = Object.keys(b); + if (c.length !== d.length) return false; + for (d = 0; d < c.length; d++) { + var e = c[d]; + if (!ja.call(b, e) || !He(a[e], b[e])) return false; + } + return true; +} +function Je(a) { + for (; a && a.firstChild; ) a = a.firstChild; + return a; +} +function Ke(a, b) { + var c = Je(a); + a = 0; + for (var d; c; ) { + if (3 === c.nodeType) { + d = a + c.textContent.length; + if (a <= b && d >= b) return { node: c, offset: b - a }; + a = d; + } + a: { + for (; c; ) { + if (c.nextSibling) { + c = c.nextSibling; + break a; + } + c = c.parentNode; + } + c = void 0; + } + c = Je(c); + } +} +function Le(a, b) { + return a && b ? a === b ? true : a && 3 === a.nodeType ? false : b && 3 === b.nodeType ? Le(a, b.parentNode) : "contains" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : false : false; +} +function Me() { + for (var a = window, b = Xa(); b instanceof a.HTMLIFrameElement; ) { + try { + var c = "string" === typeof b.contentWindow.location.href; + } catch (d) { + c = false; + } + if (c) a = b.contentWindow; + else break; + b = Xa(a.document); + } + return b; +} +function Ne(a) { + var b = a && a.nodeName && a.nodeName.toLowerCase(); + return b && ("input" === b && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b || "true" === a.contentEditable); +} +function Oe(a) { + var b = Me(), c = a.focusedElem, d = a.selectionRange; + if (b !== c && c && c.ownerDocument && Le(c.ownerDocument.documentElement, c)) { + if (null !== d && Ne(c)) { + if (b = d.start, a = d.end, void 0 === a && (a = b), "selectionStart" in c) c.selectionStart = b, c.selectionEnd = Math.min(a, c.value.length); + else if (a = (b = c.ownerDocument || document) && b.defaultView || window, a.getSelection) { + a = a.getSelection(); + var e = c.textContent.length, f2 = Math.min(d.start, e); + d = void 0 === d.end ? f2 : Math.min(d.end, e); + !a.extend && f2 > d && (e = d, d = f2, f2 = e); + e = Ke(c, f2); + var g = Ke( + c, + d + ); + e && g && (1 !== a.rangeCount || a.anchorNode !== e.node || a.anchorOffset !== e.offset || a.focusNode !== g.node || a.focusOffset !== g.offset) && (b = b.createRange(), b.setStart(e.node, e.offset), a.removeAllRanges(), f2 > d ? (a.addRange(b), a.extend(g.node, g.offset)) : (b.setEnd(g.node, g.offset), a.addRange(b))); + } + } + b = []; + for (a = c; a = a.parentNode; ) 1 === a.nodeType && b.push({ element: a, left: a.scrollLeft, top: a.scrollTop }); + "function" === typeof c.focus && c.focus(); + for (c = 0; c < b.length; c++) a = b[c], a.element.scrollLeft = a.left, a.element.scrollTop = a.top; + } +} +var Pe = ia && "documentMode" in document && 11 >= document.documentMode, Qe = null, Re = null, Se = null, Te = false; +function Ue(a, b, c) { + var d = c.window === c ? c.document : 9 === c.nodeType ? c : c.ownerDocument; + Te || null == Qe || Qe !== Xa(d) || (d = Qe, "selectionStart" in d && Ne(d) ? d = { start: d.selectionStart, end: d.selectionEnd } : (d = (d.ownerDocument && d.ownerDocument.defaultView || window).getSelection(), d = { anchorNode: d.anchorNode, anchorOffset: d.anchorOffset, focusNode: d.focusNode, focusOffset: d.focusOffset }), Se && Ie(Se, d) || (Se = d, d = oe(Re, "onSelect"), 0 < d.length && (b = new td("onSelect", "select", null, b, c), a.push({ event: b, listeners: d }), b.target = Qe))); +} +function Ve(a, b) { + var c = {}; + c[a.toLowerCase()] = b.toLowerCase(); + c["Webkit" + a] = "webkit" + b; + c["Moz" + a] = "moz" + b; + return c; +} +var We = { animationend: Ve("Animation", "AnimationEnd"), animationiteration: Ve("Animation", "AnimationIteration"), animationstart: Ve("Animation", "AnimationStart"), transitionend: Ve("Transition", "TransitionEnd") }, Xe = {}, Ye = {}; +ia && (Ye = document.createElement("div").style, "AnimationEvent" in window || (delete We.animationend.animation, delete We.animationiteration.animation, delete We.animationstart.animation), "TransitionEvent" in window || delete We.transitionend.transition); +function Ze(a) { + if (Xe[a]) return Xe[a]; + if (!We[a]) return a; + var b = We[a], c; + for (c in b) if (b.hasOwnProperty(c) && c in Ye) return Xe[a] = b[c]; + return a; +} +var $e = Ze("animationend"), af = Ze("animationiteration"), bf = Ze("animationstart"), cf = Ze("transitionend"), df = /* @__PURE__ */ new Map(), ef = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); +function ff(a, b) { + df.set(a, b); + fa(b, [a]); +} +for (var gf = 0; gf < ef.length; gf++) { + var hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1); + ff(jf, "on" + kf); +} +ff($e, "onAnimationEnd"); +ff(af, "onAnimationIteration"); +ff(bf, "onAnimationStart"); +ff("dblclick", "onDoubleClick"); +ff("focusin", "onFocus"); +ff("focusout", "onBlur"); +ff(cf, "onTransitionEnd"); +ha("onMouseEnter", ["mouseout", "mouseover"]); +ha("onMouseLeave", ["mouseout", "mouseover"]); +ha("onPointerEnter", ["pointerout", "pointerover"]); +ha("onPointerLeave", ["pointerout", "pointerover"]); +fa("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); +fa("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); +fa("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); +fa("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); +fa("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); +fa("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); +var lf = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); +function nf(a, b, c) { + var d = a.type || "unknown-event"; + a.currentTarget = c; + Ub(d, b, void 0, a); + a.currentTarget = null; +} +function se(a, b) { + b = 0 !== (b & 4); + for (var c = 0; c < a.length; c++) { + var d = a[c], e = d.event; + d = d.listeners; + a: { + var f2 = void 0; + if (b) for (var g = d.length - 1; 0 <= g; g--) { + var h = d[g], k2 = h.instance, l2 = h.currentTarget; + h = h.listener; + if (k2 !== f2 && e.isPropagationStopped()) break a; + nf(e, h, l2); + f2 = k2; + } + else for (g = 0; g < d.length; g++) { + h = d[g]; + k2 = h.instance; + l2 = h.currentTarget; + h = h.listener; + if (k2 !== f2 && e.isPropagationStopped()) break a; + nf(e, h, l2); + f2 = k2; + } + } + } + if (Qb) throw a = Rb, Qb = false, Rb = null, a; +} +function D(a, b) { + var c = b[of]; + void 0 === c && (c = b[of] = /* @__PURE__ */ new Set()); + var d = a + "__bubble"; + c.has(d) || (pf(b, a, 2, false), c.add(d)); +} +function qf(a, b, c) { + var d = 0; + b && (d |= 4); + pf(c, a, d, b); +} +var rf = "_reactListening" + Math.random().toString(36).slice(2); +function sf(a) { + if (!a[rf]) { + a[rf] = true; + da.forEach(function(b2) { + "selectionchange" !== b2 && (mf.has(b2) || qf(b2, false, a), qf(b2, true, a)); + }); + var b = 9 === a.nodeType ? a : a.ownerDocument; + null === b || b[rf] || (b[rf] = true, qf("selectionchange", false, b)); + } +} +function pf(a, b, c, d) { + switch (jd(b)) { + case 1: + var e = ed; + break; + case 4: + e = gd; + break; + default: + e = fd; + } + c = e.bind(null, b, c, a); + e = void 0; + !Lb || "touchstart" !== b && "touchmove" !== b && "wheel" !== b || (e = true); + d ? void 0 !== e ? a.addEventListener(b, c, { capture: true, passive: e }) : a.addEventListener(b, c, true) : void 0 !== e ? a.addEventListener(b, c, { passive: e }) : a.addEventListener(b, c, false); +} +function hd(a, b, c, d, e) { + var f2 = d; + if (0 === (b & 1) && 0 === (b & 2) && null !== d) a: for (; ; ) { + if (null === d) return; + var g = d.tag; + if (3 === g || 4 === g) { + var h = d.stateNode.containerInfo; + if (h === e || 8 === h.nodeType && h.parentNode === e) break; + if (4 === g) for (g = d.return; null !== g; ) { + var k2 = g.tag; + if (3 === k2 || 4 === k2) { + if (k2 = g.stateNode.containerInfo, k2 === e || 8 === k2.nodeType && k2.parentNode === e) return; + } + g = g.return; + } + for (; null !== h; ) { + g = Wc(h); + if (null === g) return; + k2 = g.tag; + if (5 === k2 || 6 === k2) { + d = f2 = g; + continue a; + } + h = h.parentNode; + } + } + d = d.return; + } + Jb(function() { + var d2 = f2, e2 = xb(c), g2 = []; + a: { + var h2 = df.get(a); + if (void 0 !== h2) { + var k3 = td, n2 = a; + switch (a) { + case "keypress": + if (0 === od(c)) break a; + case "keydown": + case "keyup": + k3 = Rd; + break; + case "focusin": + n2 = "focus"; + k3 = Fd; + break; + case "focusout": + n2 = "blur"; + k3 = Fd; + break; + case "beforeblur": + case "afterblur": + k3 = Fd; + break; + case "click": + if (2 === c.button) break a; + case "auxclick": + case "dblclick": + case "mousedown": + case "mousemove": + case "mouseup": + case "mouseout": + case "mouseover": + case "contextmenu": + k3 = Bd; + break; + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + k3 = Dd; + break; + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": + k3 = Vd; + break; + case $e: + case af: + case bf: + k3 = Hd; + break; + case cf: + k3 = Xd; + break; + case "scroll": + k3 = vd; + break; + case "wheel": + k3 = Zd; + break; + case "copy": + case "cut": + case "paste": + k3 = Jd; + break; + case "gotpointercapture": + case "lostpointercapture": + case "pointercancel": + case "pointerdown": + case "pointermove": + case "pointerout": + case "pointerover": + case "pointerup": + k3 = Td; + } + var t2 = 0 !== (b & 4), J2 = !t2 && "scroll" === a, x2 = t2 ? null !== h2 ? h2 + "Capture" : null : h2; + t2 = []; + for (var w2 = d2, u2; null !== w2; ) { + u2 = w2; + var F2 = u2.stateNode; + 5 === u2.tag && null !== F2 && (u2 = F2, null !== x2 && (F2 = Kb(w2, x2), null != F2 && t2.push(tf(w2, F2, u2)))); + if (J2) break; + w2 = w2.return; + } + 0 < t2.length && (h2 = new k3(h2, n2, null, c, e2), g2.push({ event: h2, listeners: t2 })); + } + } + if (0 === (b & 7)) { + a: { + h2 = "mouseover" === a || "pointerover" === a; + k3 = "mouseout" === a || "pointerout" === a; + if (h2 && c !== wb && (n2 = c.relatedTarget || c.fromElement) && (Wc(n2) || n2[uf])) break a; + if (k3 || h2) { + h2 = e2.window === e2 ? e2 : (h2 = e2.ownerDocument) ? h2.defaultView || h2.parentWindow : window; + if (k3) { + if (n2 = c.relatedTarget || c.toElement, k3 = d2, n2 = n2 ? Wc(n2) : null, null !== n2 && (J2 = Vb(n2), n2 !== J2 || 5 !== n2.tag && 6 !== n2.tag)) n2 = null; + } else k3 = null, n2 = d2; + if (k3 !== n2) { + t2 = Bd; + F2 = "onMouseLeave"; + x2 = "onMouseEnter"; + w2 = "mouse"; + if ("pointerout" === a || "pointerover" === a) t2 = Td, F2 = "onPointerLeave", x2 = "onPointerEnter", w2 = "pointer"; + J2 = null == k3 ? h2 : ue(k3); + u2 = null == n2 ? h2 : ue(n2); + h2 = new t2(F2, w2 + "leave", k3, c, e2); + h2.target = J2; + h2.relatedTarget = u2; + F2 = null; + Wc(e2) === d2 && (t2 = new t2(x2, w2 + "enter", n2, c, e2), t2.target = u2, t2.relatedTarget = J2, F2 = t2); + J2 = F2; + if (k3 && n2) b: { + t2 = k3; + x2 = n2; + w2 = 0; + for (u2 = t2; u2; u2 = vf(u2)) w2++; + u2 = 0; + for (F2 = x2; F2; F2 = vf(F2)) u2++; + for (; 0 < w2 - u2; ) t2 = vf(t2), w2--; + for (; 0 < u2 - w2; ) x2 = vf(x2), u2--; + for (; w2--; ) { + if (t2 === x2 || null !== x2 && t2 === x2.alternate) break b; + t2 = vf(t2); + x2 = vf(x2); + } + t2 = null; + } + else t2 = null; + null !== k3 && wf(g2, h2, k3, t2, false); + null !== n2 && null !== J2 && wf(g2, J2, n2, t2, true); + } + } + } + a: { + h2 = d2 ? ue(d2) : window; + k3 = h2.nodeName && h2.nodeName.toLowerCase(); + if ("select" === k3 || "input" === k3 && "file" === h2.type) var na = ve; + else if (me(h2)) if (we) na = Fe; + else { + na = De; + var xa = Ce; + } + else (k3 = h2.nodeName) && "input" === k3.toLowerCase() && ("checkbox" === h2.type || "radio" === h2.type) && (na = Ee); + if (na && (na = na(a, d2))) { + ne(g2, na, c, e2); + break a; + } + xa && xa(a, h2, d2); + "focusout" === a && (xa = h2._wrapperState) && xa.controlled && "number" === h2.type && cb(h2, "number", h2.value); + } + xa = d2 ? ue(d2) : window; + switch (a) { + case "focusin": + if (me(xa) || "true" === xa.contentEditable) Qe = xa, Re = d2, Se = null; + break; + case "focusout": + Se = Re = Qe = null; + break; + case "mousedown": + Te = true; + break; + case "contextmenu": + case "mouseup": + case "dragend": + Te = false; + Ue(g2, c, e2); + break; + case "selectionchange": + if (Pe) break; + case "keydown": + case "keyup": + Ue(g2, c, e2); + } + var $a; + if (ae) b: { + switch (a) { + case "compositionstart": + var ba = "onCompositionStart"; + break b; + case "compositionend": + ba = "onCompositionEnd"; + break b; + case "compositionupdate": + ba = "onCompositionUpdate"; + break b; + } + ba = void 0; + } + else ie ? ge(a, c) && (ba = "onCompositionEnd") : "keydown" === a && 229 === c.keyCode && (ba = "onCompositionStart"); + ba && (de && "ko" !== c.locale && (ie || "onCompositionStart" !== ba ? "onCompositionEnd" === ba && ie && ($a = nd()) : (kd = e2, ld = "value" in kd ? kd.value : kd.textContent, ie = true)), xa = oe(d2, ba), 0 < xa.length && (ba = new Ld(ba, a, null, c, e2), g2.push({ event: ba, listeners: xa }), $a ? ba.data = $a : ($a = he(c), null !== $a && (ba.data = $a)))); + if ($a = ce ? je(a, c) : ke(a, c)) d2 = oe(d2, "onBeforeInput"), 0 < d2.length && (e2 = new Ld("onBeforeInput", "beforeinput", null, c, e2), g2.push({ event: e2, listeners: d2 }), e2.data = $a); + } + se(g2, b); + }); +} +function tf(a, b, c) { + return { instance: a, listener: b, currentTarget: c }; +} +function oe(a, b) { + for (var c = b + "Capture", d = []; null !== a; ) { + var e = a, f2 = e.stateNode; + 5 === e.tag && null !== f2 && (e = f2, f2 = Kb(a, c), null != f2 && d.unshift(tf(a, f2, e)), f2 = Kb(a, b), null != f2 && d.push(tf(a, f2, e))); + a = a.return; + } + return d; +} +function vf(a) { + if (null === a) return null; + do + a = a.return; + while (a && 5 !== a.tag); + return a ? a : null; +} +function wf(a, b, c, d, e) { + for (var f2 = b._reactName, g = []; null !== c && c !== d; ) { + var h = c, k2 = h.alternate, l2 = h.stateNode; + if (null !== k2 && k2 === d) break; + 5 === h.tag && null !== l2 && (h = l2, e ? (k2 = Kb(c, f2), null != k2 && g.unshift(tf(c, k2, h))) : e || (k2 = Kb(c, f2), null != k2 && g.push(tf(c, k2, h)))); + c = c.return; + } + 0 !== g.length && a.push({ event: b, listeners: g }); +} +var xf = /\r\n?/g, yf = /\u0000|\uFFFD/g; +function zf(a) { + return ("string" === typeof a ? a : "" + a).replace(xf, "\n").replace(yf, ""); +} +function Af(a, b, c) { + b = zf(b); + if (zf(a) !== b && c) throw Error(p(425)); +} +function Bf() { +} +var Cf = null, Df = null; +function Ef(a, b) { + return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html; +} +var Ff = "function" === typeof setTimeout ? setTimeout : void 0, Gf = "function" === typeof clearTimeout ? clearTimeout : void 0, Hf = "function" === typeof Promise ? Promise : void 0, Jf = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof Hf ? function(a) { + return Hf.resolve(null).then(a).catch(If); +} : Ff; +function If(a) { + setTimeout(function() { + throw a; + }); +} +function Kf(a, b) { + var c = b, d = 0; + do { + var e = c.nextSibling; + a.removeChild(c); + if (e && 8 === e.nodeType) if (c = e.data, "/$" === c) { + if (0 === d) { + a.removeChild(e); + bd(b); + return; + } + d--; + } else "$" !== c && "$?" !== c && "$!" !== c || d++; + c = e; + } while (c); + bd(b); +} +function Lf(a) { + for (; null != a; a = a.nextSibling) { + var b = a.nodeType; + if (1 === b || 3 === b) break; + if (8 === b) { + b = a.data; + if ("$" === b || "$!" === b || "$?" === b) break; + if ("/$" === b) return null; + } + } + return a; +} +function Mf(a) { + a = a.previousSibling; + for (var b = 0; a; ) { + if (8 === a.nodeType) { + var c = a.data; + if ("$" === c || "$!" === c || "$?" === c) { + if (0 === b) return a; + b--; + } else "/$" === c && b++; + } + a = a.previousSibling; + } + return null; +} +var Nf = Math.random().toString(36).slice(2), Of = "__reactFiber$" + Nf, Pf = "__reactProps$" + Nf, uf = "__reactContainer$" + Nf, of = "__reactEvents$" + Nf, Qf = "__reactListeners$" + Nf, Rf = "__reactHandles$" + Nf; +function Wc(a) { + var b = a[Of]; + if (b) return b; + for (var c = a.parentNode; c; ) { + if (b = c[uf] || c[Of]) { + c = b.alternate; + if (null !== b.child || null !== c && null !== c.child) for (a = Mf(a); null !== a; ) { + if (c = a[Of]) return c; + a = Mf(a); + } + return b; + } + a = c; + c = a.parentNode; + } + return null; +} +function Cb(a) { + a = a[Of] || a[uf]; + return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a; +} +function ue(a) { + if (5 === a.tag || 6 === a.tag) return a.stateNode; + throw Error(p(33)); +} +function Db(a) { + return a[Pf] || null; +} +var Sf = [], Tf = -1; +function Uf(a) { + return { current: a }; +} +function E(a) { + 0 > Tf || (a.current = Sf[Tf], Sf[Tf] = null, Tf--); +} +function G(a, b) { + Tf++; + Sf[Tf] = a.current; + a.current = b; +} +var Vf = {}, H = Uf(Vf), Wf = Uf(false), Xf = Vf; +function Yf(a, b) { + var c = a.type.contextTypes; + if (!c) return Vf; + var d = a.stateNode; + if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext; + var e = {}, f2; + for (f2 in c) e[f2] = b[f2]; + d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e); + return e; +} +function Zf(a) { + a = a.childContextTypes; + return null !== a && void 0 !== a; +} +function $f() { + E(Wf); + E(H); +} +function ag(a, b, c) { + if (H.current !== Vf) throw Error(p(168)); + G(H, b); + G(Wf, c); +} +function bg(a, b, c) { + var d = a.stateNode; + b = b.childContextTypes; + if ("function" !== typeof d.getChildContext) return c; + d = d.getChildContext(); + for (var e in d) if (!(e in b)) throw Error(p(108, Ra(a) || "Unknown", e)); + return A({}, c, d); +} +function cg(a) { + a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Vf; + Xf = H.current; + G(H, a); + G(Wf, Wf.current); + return true; +} +function dg(a, b, c) { + var d = a.stateNode; + if (!d) throw Error(p(169)); + c ? (a = bg(a, b, Xf), d.__reactInternalMemoizedMergedChildContext = a, E(Wf), E(H), G(H, a)) : E(Wf); + G(Wf, c); +} +var eg = null, fg = false, gg = false; +function hg(a) { + null === eg ? eg = [a] : eg.push(a); +} +function ig(a) { + fg = true; + hg(a); +} +function jg() { + if (!gg && null !== eg) { + gg = true; + var a = 0, b = C; + try { + var c = eg; + for (C = 1; a < c.length; a++) { + var d = c[a]; + do + d = d(true); + while (null !== d); + } + eg = null; + fg = false; + } catch (e) { + throw null !== eg && (eg = eg.slice(a + 1)), ac(fc, jg), e; + } finally { + C = b, gg = false; + } + } + return null; +} +var kg = [], lg = 0, mg = null, ng = 0, og = [], pg = 0, qg = null, rg = 1, sg = ""; +function tg(a, b) { + kg[lg++] = ng; + kg[lg++] = mg; + mg = a; + ng = b; +} +function ug(a, b, c) { + og[pg++] = rg; + og[pg++] = sg; + og[pg++] = qg; + qg = a; + var d = rg; + a = sg; + var e = 32 - oc(d) - 1; + d &= ~(1 << e); + c += 1; + var f2 = 32 - oc(b) + e; + if (30 < f2) { + var g = e - e % 5; + f2 = (d & (1 << g) - 1).toString(32); + d >>= g; + e -= g; + rg = 1 << 32 - oc(b) + e | c << e | d; + sg = f2 + a; + } else rg = 1 << f2 | c << e | d, sg = a; +} +function vg(a) { + null !== a.return && (tg(a, 1), ug(a, 1, 0)); +} +function wg(a) { + for (; a === mg; ) mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null; + for (; a === qg; ) qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null; +} +var xg = null, yg = null, I = false, zg = null; +function Ag(a, b) { + var c = Bg(5, null, null, 0); + c.elementType = "DELETED"; + c.stateNode = b; + c.return = a; + b = a.deletions; + null === b ? (a.deletions = [c], a.flags |= 16) : b.push(c); +} +function Cg(a, b) { + switch (a.tag) { + case 5: + var c = a.type; + b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b; + return null !== b ? (a.stateNode = b, xg = a, yg = Lf(b.firstChild), true) : false; + case 6: + return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, xg = a, yg = null, true) : false; + case 13: + return b = 8 !== b.nodeType ? null : b, null !== b ? (c = null !== qg ? { id: rg, overflow: sg } : null, a.memoizedState = { dehydrated: b, treeContext: c, retryLane: 1073741824 }, c = Bg(18, null, null, 0), c.stateNode = b, c.return = a, a.child = c, xg = a, yg = null, true) : false; + default: + return false; + } +} +function Dg(a) { + return 0 !== (a.mode & 1) && 0 === (a.flags & 128); +} +function Eg(a) { + if (I) { + var b = yg; + if (b) { + var c = b; + if (!Cg(a, b)) { + if (Dg(a)) throw Error(p(418)); + b = Lf(c.nextSibling); + var d = xg; + b && Cg(a, b) ? Ag(d, c) : (a.flags = a.flags & -4097 | 2, I = false, xg = a); + } + } else { + if (Dg(a)) throw Error(p(418)); + a.flags = a.flags & -4097 | 2; + I = false; + xg = a; + } + } +} +function Fg(a) { + for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return; + xg = a; +} +function Gg(a) { + if (a !== xg) return false; + if (!I) return Fg(a), I = true, false; + var b; + (b = 3 !== a.tag) && !(b = 5 !== a.tag) && (b = a.type, b = "head" !== b && "body" !== b && !Ef(a.type, a.memoizedProps)); + if (b && (b = yg)) { + if (Dg(a)) throw Hg(), Error(p(418)); + for (; b; ) Ag(a, b), b = Lf(b.nextSibling); + } + Fg(a); + if (13 === a.tag) { + a = a.memoizedState; + a = null !== a ? a.dehydrated : null; + if (!a) throw Error(p(317)); + a: { + a = a.nextSibling; + for (b = 0; a; ) { + if (8 === a.nodeType) { + var c = a.data; + if ("/$" === c) { + if (0 === b) { + yg = Lf(a.nextSibling); + break a; + } + b--; + } else "$" !== c && "$!" !== c && "$?" !== c || b++; + } + a = a.nextSibling; + } + yg = null; + } + } else yg = xg ? Lf(a.stateNode.nextSibling) : null; + return true; +} +function Hg() { + for (var a = yg; a; ) a = Lf(a.nextSibling); +} +function Ig() { + yg = xg = null; + I = false; +} +function Jg(a) { + null === zg ? zg = [a] : zg.push(a); +} +var Kg = ua.ReactCurrentBatchConfig; +function Lg(a, b, c) { + a = c.ref; + if (null !== a && "function" !== typeof a && "object" !== typeof a) { + if (c._owner) { + c = c._owner; + if (c) { + if (1 !== c.tag) throw Error(p(309)); + var d = c.stateNode; + } + if (!d) throw Error(p(147, a)); + var e = d, f2 = "" + a; + if (null !== b && null !== b.ref && "function" === typeof b.ref && b.ref._stringRef === f2) return b.ref; + b = function(a2) { + var b2 = e.refs; + null === a2 ? delete b2[f2] : b2[f2] = a2; + }; + b._stringRef = f2; + return b; + } + if ("string" !== typeof a) throw Error(p(284)); + if (!c._owner) throw Error(p(290, a)); + } + return a; +} +function Mg(a, b) { + a = Object.prototype.toString.call(b); + throw Error(p(31, "[object Object]" === a ? "object with keys {" + Object.keys(b).join(", ") + "}" : a)); +} +function Ng(a) { + var b = a._init; + return b(a._payload); +} +function Og(a) { + function b(b2, c2) { + if (a) { + var d2 = b2.deletions; + null === d2 ? (b2.deletions = [c2], b2.flags |= 16) : d2.push(c2); + } + } + function c(c2, d2) { + if (!a) return null; + for (; null !== d2; ) b(c2, d2), d2 = d2.sibling; + return null; + } + function d(a2, b2) { + for (a2 = /* @__PURE__ */ new Map(); null !== b2; ) null !== b2.key ? a2.set(b2.key, b2) : a2.set(b2.index, b2), b2 = b2.sibling; + return a2; + } + function e(a2, b2) { + a2 = Pg(a2, b2); + a2.index = 0; + a2.sibling = null; + return a2; + } + function f2(b2, c2, d2) { + b2.index = d2; + if (!a) return b2.flags |= 1048576, c2; + d2 = b2.alternate; + if (null !== d2) return d2 = d2.index, d2 < c2 ? (b2.flags |= 2, c2) : d2; + b2.flags |= 2; + return c2; + } + function g(b2) { + a && null === b2.alternate && (b2.flags |= 2); + return b2; + } + function h(a2, b2, c2, d2) { + if (null === b2 || 6 !== b2.tag) return b2 = Qg(c2, a2.mode, d2), b2.return = a2, b2; + b2 = e(b2, c2); + b2.return = a2; + return b2; + } + function k2(a2, b2, c2, d2) { + var f3 = c2.type; + if (f3 === ya) return m2(a2, b2, c2.props.children, d2, c2.key); + if (null !== b2 && (b2.elementType === f3 || "object" === typeof f3 && null !== f3 && f3.$$typeof === Ha && Ng(f3) === b2.type)) return d2 = e(b2, c2.props), d2.ref = Lg(a2, b2, c2), d2.return = a2, d2; + d2 = Rg(c2.type, c2.key, c2.props, null, a2.mode, d2); + d2.ref = Lg(a2, b2, c2); + d2.return = a2; + return d2; + } + function l2(a2, b2, c2, d2) { + if (null === b2 || 4 !== b2.tag || b2.stateNode.containerInfo !== c2.containerInfo || b2.stateNode.implementation !== c2.implementation) return b2 = Sg(c2, a2.mode, d2), b2.return = a2, b2; + b2 = e(b2, c2.children || []); + b2.return = a2; + return b2; + } + function m2(a2, b2, c2, d2, f3) { + if (null === b2 || 7 !== b2.tag) return b2 = Tg(c2, a2.mode, d2, f3), b2.return = a2, b2; + b2 = e(b2, c2); + b2.return = a2; + return b2; + } + function q2(a2, b2, c2) { + if ("string" === typeof b2 && "" !== b2 || "number" === typeof b2) return b2 = Qg("" + b2, a2.mode, c2), b2.return = a2, b2; + if ("object" === typeof b2 && null !== b2) { + switch (b2.$$typeof) { + case va: + return c2 = Rg(b2.type, b2.key, b2.props, null, a2.mode, c2), c2.ref = Lg(a2, null, b2), c2.return = a2, c2; + case wa: + return b2 = Sg(b2, a2.mode, c2), b2.return = a2, b2; + case Ha: + var d2 = b2._init; + return q2(a2, d2(b2._payload), c2); + } + if (eb(b2) || Ka(b2)) return b2 = Tg(b2, a2.mode, c2, null), b2.return = a2, b2; + Mg(a2, b2); + } + return null; + } + function r2(a2, b2, c2, d2) { + var e2 = null !== b2 ? b2.key : null; + if ("string" === typeof c2 && "" !== c2 || "number" === typeof c2) return null !== e2 ? null : h(a2, b2, "" + c2, d2); + if ("object" === typeof c2 && null !== c2) { + switch (c2.$$typeof) { + case va: + return c2.key === e2 ? k2(a2, b2, c2, d2) : null; + case wa: + return c2.key === e2 ? l2(a2, b2, c2, d2) : null; + case Ha: + return e2 = c2._init, r2( + a2, + b2, + e2(c2._payload), + d2 + ); + } + if (eb(c2) || Ka(c2)) return null !== e2 ? null : m2(a2, b2, c2, d2, null); + Mg(a2, c2); + } + return null; + } + function y2(a2, b2, c2, d2, e2) { + if ("string" === typeof d2 && "" !== d2 || "number" === typeof d2) return a2 = a2.get(c2) || null, h(b2, a2, "" + d2, e2); + if ("object" === typeof d2 && null !== d2) { + switch (d2.$$typeof) { + case va: + return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, k2(b2, a2, d2, e2); + case wa: + return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, l2(b2, a2, d2, e2); + case Ha: + var f3 = d2._init; + return y2(a2, b2, c2, f3(d2._payload), e2); + } + if (eb(d2) || Ka(d2)) return a2 = a2.get(c2) || null, m2(b2, a2, d2, e2, null); + Mg(b2, d2); + } + return null; + } + function n2(e2, g2, h2, k3) { + for (var l3 = null, m3 = null, u2 = g2, w2 = g2 = 0, x2 = null; null !== u2 && w2 < h2.length; w2++) { + u2.index > w2 ? (x2 = u2, u2 = null) : x2 = u2.sibling; + var n3 = r2(e2, u2, h2[w2], k3); + if (null === n3) { + null === u2 && (u2 = x2); + break; + } + a && u2 && null === n3.alternate && b(e2, u2); + g2 = f2(n3, g2, w2); + null === m3 ? l3 = n3 : m3.sibling = n3; + m3 = n3; + u2 = x2; + } + if (w2 === h2.length) return c(e2, u2), I && tg(e2, w2), l3; + if (null === u2) { + for (; w2 < h2.length; w2++) u2 = q2(e2, h2[w2], k3), null !== u2 && (g2 = f2(u2, g2, w2), null === m3 ? l3 = u2 : m3.sibling = u2, m3 = u2); + I && tg(e2, w2); + return l3; + } + for (u2 = d(e2, u2); w2 < h2.length; w2++) x2 = y2(u2, e2, w2, h2[w2], k3), null !== x2 && (a && null !== x2.alternate && u2.delete(null === x2.key ? w2 : x2.key), g2 = f2(x2, g2, w2), null === m3 ? l3 = x2 : m3.sibling = x2, m3 = x2); + a && u2.forEach(function(a2) { + return b(e2, a2); + }); + I && tg(e2, w2); + return l3; + } + function t2(e2, g2, h2, k3) { + var l3 = Ka(h2); + if ("function" !== typeof l3) throw Error(p(150)); + h2 = l3.call(h2); + if (null == h2) throw Error(p(151)); + for (var u2 = l3 = null, m3 = g2, w2 = g2 = 0, x2 = null, n3 = h2.next(); null !== m3 && !n3.done; w2++, n3 = h2.next()) { + m3.index > w2 ? (x2 = m3, m3 = null) : x2 = m3.sibling; + var t3 = r2(e2, m3, n3.value, k3); + if (null === t3) { + null === m3 && (m3 = x2); + break; + } + a && m3 && null === t3.alternate && b(e2, m3); + g2 = f2(t3, g2, w2); + null === u2 ? l3 = t3 : u2.sibling = t3; + u2 = t3; + m3 = x2; + } + if (n3.done) return c( + e2, + m3 + ), I && tg(e2, w2), l3; + if (null === m3) { + for (; !n3.done; w2++, n3 = h2.next()) n3 = q2(e2, n3.value, k3), null !== n3 && (g2 = f2(n3, g2, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); + I && tg(e2, w2); + return l3; + } + for (m3 = d(e2, m3); !n3.done; w2++, n3 = h2.next()) n3 = y2(m3, e2, w2, n3.value, k3), null !== n3 && (a && null !== n3.alternate && m3.delete(null === n3.key ? w2 : n3.key), g2 = f2(n3, g2, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); + a && m3.forEach(function(a2) { + return b(e2, a2); + }); + I && tg(e2, w2); + return l3; + } + function J2(a2, d2, f3, h2) { + "object" === typeof f3 && null !== f3 && f3.type === ya && null === f3.key && (f3 = f3.props.children); + if ("object" === typeof f3 && null !== f3) { + switch (f3.$$typeof) { + case va: + a: { + for (var k3 = f3.key, l3 = d2; null !== l3; ) { + if (l3.key === k3) { + k3 = f3.type; + if (k3 === ya) { + if (7 === l3.tag) { + c(a2, l3.sibling); + d2 = e(l3, f3.props.children); + d2.return = a2; + a2 = d2; + break a; + } + } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === Ha && Ng(k3) === l3.type) { + c(a2, l3.sibling); + d2 = e(l3, f3.props); + d2.ref = Lg(a2, l3, f3); + d2.return = a2; + a2 = d2; + break a; + } + c(a2, l3); + break; + } else b(a2, l3); + l3 = l3.sibling; + } + f3.type === ya ? (d2 = Tg(f3.props.children, a2.mode, h2, f3.key), d2.return = a2, a2 = d2) : (h2 = Rg(f3.type, f3.key, f3.props, null, a2.mode, h2), h2.ref = Lg(a2, d2, f3), h2.return = a2, a2 = h2); + } + return g(a2); + case wa: + a: { + for (l3 = f3.key; null !== d2; ) { + if (d2.key === l3) if (4 === d2.tag && d2.stateNode.containerInfo === f3.containerInfo && d2.stateNode.implementation === f3.implementation) { + c(a2, d2.sibling); + d2 = e(d2, f3.children || []); + d2.return = a2; + a2 = d2; + break a; + } else { + c(a2, d2); + break; + } + else b(a2, d2); + d2 = d2.sibling; + } + d2 = Sg(f3, a2.mode, h2); + d2.return = a2; + a2 = d2; + } + return g(a2); + case Ha: + return l3 = f3._init, J2(a2, d2, l3(f3._payload), h2); + } + if (eb(f3)) return n2(a2, d2, f3, h2); + if (Ka(f3)) return t2(a2, d2, f3, h2); + Mg(a2, f3); + } + return "string" === typeof f3 && "" !== f3 || "number" === typeof f3 ? (f3 = "" + f3, null !== d2 && 6 === d2.tag ? (c(a2, d2.sibling), d2 = e(d2, f3), d2.return = a2, a2 = d2) : (c(a2, d2), d2 = Qg(f3, a2.mode, h2), d2.return = a2, a2 = d2), g(a2)) : c(a2, d2); + } + return J2; +} +var Ug = Og(true), Vg = Og(false), Wg = Uf(null), Xg = null, Yg = null, Zg = null; +function $g() { + Zg = Yg = Xg = null; +} +function ah(a) { + var b = Wg.current; + E(Wg); + a._currentValue = b; +} +function bh(a, b, c) { + for (; null !== a; ) { + var d = a.alternate; + (a.childLanes & b) !== b ? (a.childLanes |= b, null !== d && (d.childLanes |= b)) : null !== d && (d.childLanes & b) !== b && (d.childLanes |= b); + if (a === c) break; + a = a.return; + } +} +function ch(a, b) { + Xg = a; + Zg = Yg = null; + a = a.dependencies; + null !== a && null !== a.firstContext && (0 !== (a.lanes & b) && (dh = true), a.firstContext = null); +} +function eh(a) { + var b = a._currentValue; + if (Zg !== a) if (a = { context: a, memoizedValue: b, next: null }, null === Yg) { + if (null === Xg) throw Error(p(308)); + Yg = a; + Xg.dependencies = { lanes: 0, firstContext: a }; + } else Yg = Yg.next = a; + return b; +} +var fh = null; +function gh(a) { + null === fh ? fh = [a] : fh.push(a); +} +function hh(a, b, c, d) { + var e = b.interleaved; + null === e ? (c.next = c, gh(b)) : (c.next = e.next, e.next = c); + b.interleaved = c; + return ih(a, d); +} +function ih(a, b) { + a.lanes |= b; + var c = a.alternate; + null !== c && (c.lanes |= b); + c = a; + for (a = a.return; null !== a; ) a.childLanes |= b, c = a.alternate, null !== c && (c.childLanes |= b), c = a, a = a.return; + return 3 === c.tag ? c.stateNode : null; +} +var jh = false; +function kh(a) { + a.updateQueue = { baseState: a.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; +} +function lh(a, b) { + a = a.updateQueue; + b.updateQueue === a && (b.updateQueue = { baseState: a.baseState, firstBaseUpdate: a.firstBaseUpdate, lastBaseUpdate: a.lastBaseUpdate, shared: a.shared, effects: a.effects }); +} +function mh(a, b) { + return { eventTime: a, lane: b, tag: 0, payload: null, callback: null, next: null }; +} +function nh(a, b, c) { + var d = a.updateQueue; + if (null === d) return null; + d = d.shared; + if (0 !== (K & 2)) { + var e = d.pending; + null === e ? b.next = b : (b.next = e.next, e.next = b); + d.pending = b; + return ih(a, c); + } + e = d.interleaved; + null === e ? (b.next = b, gh(d)) : (b.next = e.next, e.next = b); + d.interleaved = b; + return ih(a, c); +} +function oh(a, b, c) { + b = b.updateQueue; + if (null !== b && (b = b.shared, 0 !== (c & 4194240))) { + var d = b.lanes; + d &= a.pendingLanes; + c |= d; + b.lanes = c; + Cc(a, c); + } +} +function ph(a, b) { + var c = a.updateQueue, d = a.alternate; + if (null !== d && (d = d.updateQueue, c === d)) { + var e = null, f2 = null; + c = c.firstBaseUpdate; + if (null !== c) { + do { + var g = { eventTime: c.eventTime, lane: c.lane, tag: c.tag, payload: c.payload, callback: c.callback, next: null }; + null === f2 ? e = f2 = g : f2 = f2.next = g; + c = c.next; + } while (null !== c); + null === f2 ? e = f2 = b : f2 = f2.next = b; + } else e = f2 = b; + c = { baseState: d.baseState, firstBaseUpdate: e, lastBaseUpdate: f2, shared: d.shared, effects: d.effects }; + a.updateQueue = c; + return; + } + a = c.lastBaseUpdate; + null === a ? c.firstBaseUpdate = b : a.next = b; + c.lastBaseUpdate = b; +} +function qh(a, b, c, d) { + var e = a.updateQueue; + jh = false; + var f2 = e.firstBaseUpdate, g = e.lastBaseUpdate, h = e.shared.pending; + if (null !== h) { + e.shared.pending = null; + var k2 = h, l2 = k2.next; + k2.next = null; + null === g ? f2 = l2 : g.next = l2; + g = k2; + var m2 = a.alternate; + null !== m2 && (m2 = m2.updateQueue, h = m2.lastBaseUpdate, h !== g && (null === h ? m2.firstBaseUpdate = l2 : h.next = l2, m2.lastBaseUpdate = k2)); + } + if (null !== f2) { + var q2 = e.baseState; + g = 0; + m2 = l2 = k2 = null; + h = f2; + do { + var r2 = h.lane, y2 = h.eventTime; + if ((d & r2) === r2) { + null !== m2 && (m2 = m2.next = { + eventTime: y2, + lane: 0, + tag: h.tag, + payload: h.payload, + callback: h.callback, + next: null + }); + a: { + var n2 = a, t2 = h; + r2 = b; + y2 = c; + switch (t2.tag) { + case 1: + n2 = t2.payload; + if ("function" === typeof n2) { + q2 = n2.call(y2, q2, r2); + break a; + } + q2 = n2; + break a; + case 3: + n2.flags = n2.flags & -65537 | 128; + case 0: + n2 = t2.payload; + r2 = "function" === typeof n2 ? n2.call(y2, q2, r2) : n2; + if (null === r2 || void 0 === r2) break a; + q2 = A({}, q2, r2); + break a; + case 2: + jh = true; + } + } + null !== h.callback && 0 !== h.lane && (a.flags |= 64, r2 = e.effects, null === r2 ? e.effects = [h] : r2.push(h)); + } else y2 = { eventTime: y2, lane: r2, tag: h.tag, payload: h.payload, callback: h.callback, next: null }, null === m2 ? (l2 = m2 = y2, k2 = q2) : m2 = m2.next = y2, g |= r2; + h = h.next; + if (null === h) if (h = e.shared.pending, null === h) break; + else r2 = h, h = r2.next, r2.next = null, e.lastBaseUpdate = r2, e.shared.pending = null; + } while (1); + null === m2 && (k2 = q2); + e.baseState = k2; + e.firstBaseUpdate = l2; + e.lastBaseUpdate = m2; + b = e.shared.interleaved; + if (null !== b) { + e = b; + do + g |= e.lane, e = e.next; + while (e !== b); + } else null === f2 && (e.shared.lanes = 0); + rh |= g; + a.lanes = g; + a.memoizedState = q2; + } +} +function sh(a, b, c) { + a = b.effects; + b.effects = null; + if (null !== a) for (b = 0; b < a.length; b++) { + var d = a[b], e = d.callback; + if (null !== e) { + d.callback = null; + d = c; + if ("function" !== typeof e) throw Error(p(191, e)); + e.call(d); + } + } +} +var th = {}, uh = Uf(th), vh = Uf(th), wh = Uf(th); +function xh(a) { + if (a === th) throw Error(p(174)); + return a; +} +function yh(a, b) { + G(wh, b); + G(vh, a); + G(uh, th); + a = b.nodeType; + switch (a) { + case 9: + case 11: + b = (b = b.documentElement) ? b.namespaceURI : lb(null, ""); + break; + default: + a = 8 === a ? b.parentNode : b, b = a.namespaceURI || null, a = a.tagName, b = lb(b, a); + } + E(uh); + G(uh, b); +} +function zh() { + E(uh); + E(vh); + E(wh); +} +function Ah(a) { + xh(wh.current); + var b = xh(uh.current); + var c = lb(b, a.type); + b !== c && (G(vh, a), G(uh, c)); +} +function Bh(a) { + vh.current === a && (E(uh), E(vh)); +} +var L = Uf(0); +function Ch(a) { + for (var b = a; null !== b; ) { + if (13 === b.tag) { + var c = b.memoizedState; + if (null !== c && (c = c.dehydrated, null === c || "$?" === c.data || "$!" === c.data)) return b; + } else if (19 === b.tag && void 0 !== b.memoizedProps.revealOrder) { + if (0 !== (b.flags & 128)) return b; + } else if (null !== b.child) { + b.child.return = b; + b = b.child; + continue; + } + if (b === a) break; + for (; null === b.sibling; ) { + if (null === b.return || b.return === a) return null; + b = b.return; + } + b.sibling.return = b.return; + b = b.sibling; + } + return null; +} +var Dh = []; +function Eh() { + for (var a = 0; a < Dh.length; a++) Dh[a]._workInProgressVersionPrimary = null; + Dh.length = 0; +} +var Fh = ua.ReactCurrentDispatcher, Gh = ua.ReactCurrentBatchConfig, Hh = 0, M = null, N = null, O = null, Ih = false, Jh = false, Kh = 0, Lh = 0; +function P() { + throw Error(p(321)); +} +function Mh(a, b) { + if (null === b) return false; + for (var c = 0; c < b.length && c < a.length; c++) if (!He(a[c], b[c])) return false; + return true; +} +function Nh(a, b, c, d, e, f2) { + Hh = f2; + M = b; + b.memoizedState = null; + b.updateQueue = null; + b.lanes = 0; + Fh.current = null === a || null === a.memoizedState ? Oh : Ph; + a = c(d, e); + if (Jh) { + f2 = 0; + do { + Jh = false; + Kh = 0; + if (25 <= f2) throw Error(p(301)); + f2 += 1; + O = N = null; + b.updateQueue = null; + Fh.current = Qh; + a = c(d, e); + } while (Jh); + } + Fh.current = Rh; + b = null !== N && null !== N.next; + Hh = 0; + O = N = M = null; + Ih = false; + if (b) throw Error(p(300)); + return a; +} +function Sh() { + var a = 0 !== Kh; + Kh = 0; + return a; +} +function Th() { + var a = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; + null === O ? M.memoizedState = O = a : O = O.next = a; + return O; +} +function Uh() { + if (null === N) { + var a = M.alternate; + a = null !== a ? a.memoizedState : null; + } else a = N.next; + var b = null === O ? M.memoizedState : O.next; + if (null !== b) O = b, N = a; + else { + if (null === a) throw Error(p(310)); + N = a; + a = { memoizedState: N.memoizedState, baseState: N.baseState, baseQueue: N.baseQueue, queue: N.queue, next: null }; + null === O ? M.memoizedState = O = a : O = O.next = a; + } + return O; +} +function Vh(a, b) { + return "function" === typeof b ? b(a) : b; +} +function Wh(a) { + var b = Uh(), c = b.queue; + if (null === c) throw Error(p(311)); + c.lastRenderedReducer = a; + var d = N, e = d.baseQueue, f2 = c.pending; + if (null !== f2) { + if (null !== e) { + var g = e.next; + e.next = f2.next; + f2.next = g; + } + d.baseQueue = e = f2; + c.pending = null; + } + if (null !== e) { + f2 = e.next; + d = d.baseState; + var h = g = null, k2 = null, l2 = f2; + do { + var m2 = l2.lane; + if ((Hh & m2) === m2) null !== k2 && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d = l2.hasEagerState ? l2.eagerState : a(d, l2.action); + else { + var q2 = { + lane: m2, + action: l2.action, + hasEagerState: l2.hasEagerState, + eagerState: l2.eagerState, + next: null + }; + null === k2 ? (h = k2 = q2, g = d) : k2 = k2.next = q2; + M.lanes |= m2; + rh |= m2; + } + l2 = l2.next; + } while (null !== l2 && l2 !== f2); + null === k2 ? g = d : k2.next = h; + He(d, b.memoizedState) || (dh = true); + b.memoizedState = d; + b.baseState = g; + b.baseQueue = k2; + c.lastRenderedState = d; + } + a = c.interleaved; + if (null !== a) { + e = a; + do + f2 = e.lane, M.lanes |= f2, rh |= f2, e = e.next; + while (e !== a); + } else null === e && (c.lanes = 0); + return [b.memoizedState, c.dispatch]; +} +function Xh(a) { + var b = Uh(), c = b.queue; + if (null === c) throw Error(p(311)); + c.lastRenderedReducer = a; + var d = c.dispatch, e = c.pending, f2 = b.memoizedState; + if (null !== e) { + c.pending = null; + var g = e = e.next; + do + f2 = a(f2, g.action), g = g.next; + while (g !== e); + He(f2, b.memoizedState) || (dh = true); + b.memoizedState = f2; + null === b.baseQueue && (b.baseState = f2); + c.lastRenderedState = f2; + } + return [f2, d]; +} +function Yh() { +} +function Zh(a, b) { + var c = M, d = Uh(), e = b(), f2 = !He(d.memoizedState, e); + f2 && (d.memoizedState = e, dh = true); + d = d.queue; + $h(ai.bind(null, c, d, a), [a]); + if (d.getSnapshot !== b || f2 || null !== O && O.memoizedState.tag & 1) { + c.flags |= 2048; + bi(9, ci.bind(null, c, d, e, b), void 0, null); + if (null === Q) throw Error(p(349)); + 0 !== (Hh & 30) || di(c, b, e); + } + return e; +} +function di(a, b, c) { + a.flags |= 16384; + a = { getSnapshot: b, value: c }; + b = M.updateQueue; + null === b ? (b = { lastEffect: null, stores: null }, M.updateQueue = b, b.stores = [a]) : (c = b.stores, null === c ? b.stores = [a] : c.push(a)); +} +function ci(a, b, c, d) { + b.value = c; + b.getSnapshot = d; + ei(b) && fi(a); +} +function ai(a, b, c) { + return c(function() { + ei(b) && fi(a); + }); +} +function ei(a) { + var b = a.getSnapshot; + a = a.value; + try { + var c = b(); + return !He(a, c); + } catch (d) { + return true; + } +} +function fi(a) { + var b = ih(a, 1); + null !== b && gi(b, a, 1, -1); +} +function hi(a) { + var b = Th(); + "function" === typeof a && (a = a()); + b.memoizedState = b.baseState = a; + a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Vh, lastRenderedState: a }; + b.queue = a; + a = a.dispatch = ii.bind(null, M, a); + return [b.memoizedState, a]; +} +function bi(a, b, c, d) { + a = { tag: a, create: b, destroy: c, deps: d, next: null }; + b = M.updateQueue; + null === b ? (b = { lastEffect: null, stores: null }, M.updateQueue = b, b.lastEffect = a.next = a) : (c = b.lastEffect, null === c ? b.lastEffect = a.next = a : (d = c.next, c.next = a, a.next = d, b.lastEffect = a)); + return a; +} +function ji() { + return Uh().memoizedState; +} +function ki(a, b, c, d) { + var e = Th(); + M.flags |= a; + e.memoizedState = bi(1 | b, c, void 0, void 0 === d ? null : d); +} +function li(a, b, c, d) { + var e = Uh(); + d = void 0 === d ? null : d; + var f2 = void 0; + if (null !== N) { + var g = N.memoizedState; + f2 = g.destroy; + if (null !== d && Mh(d, g.deps)) { + e.memoizedState = bi(b, c, f2, d); + return; + } + } + M.flags |= a; + e.memoizedState = bi(1 | b, c, f2, d); +} +function mi(a, b) { + return ki(8390656, 8, a, b); +} +function $h(a, b) { + return li(2048, 8, a, b); +} +function ni(a, b) { + return li(4, 2, a, b); +} +function oi(a, b) { + return li(4, 4, a, b); +} +function pi(a, b) { + if ("function" === typeof b) return a = a(), b(a), function() { + b(null); + }; + if (null !== b && void 0 !== b) return a = a(), b.current = a, function() { + b.current = null; + }; +} +function qi(a, b, c) { + c = null !== c && void 0 !== c ? c.concat([a]) : null; + return li(4, 4, pi.bind(null, b, a), c); +} +function ri() { +} +function si(a, b) { + var c = Uh(); + b = void 0 === b ? null : b; + var d = c.memoizedState; + if (null !== d && null !== b && Mh(b, d[1])) return d[0]; + c.memoizedState = [a, b]; + return a; +} +function ti(a, b) { + var c = Uh(); + b = void 0 === b ? null : b; + var d = c.memoizedState; + if (null !== d && null !== b && Mh(b, d[1])) return d[0]; + a = a(); + c.memoizedState = [a, b]; + return a; +} +function ui(a, b, c) { + if (0 === (Hh & 21)) return a.baseState && (a.baseState = false, dh = true), a.memoizedState = c; + He(c, b) || (c = yc(), M.lanes |= c, rh |= c, a.baseState = true); + return b; +} +function vi(a, b) { + var c = C; + C = 0 !== c && 4 > c ? c : 4; + a(true); + var d = Gh.transition; + Gh.transition = {}; + try { + a(false), b(); + } finally { + C = c, Gh.transition = d; + } +} +function wi() { + return Uh().memoizedState; +} +function xi(a, b, c) { + var d = yi(a); + c = { lane: d, action: c, hasEagerState: false, eagerState: null, next: null }; + if (zi(a)) Ai(b, c); + else if (c = hh(a, b, c, d), null !== c) { + var e = R(); + gi(c, a, d, e); + Bi(c, b, d); + } +} +function ii(a, b, c) { + var d = yi(a), e = { lane: d, action: c, hasEagerState: false, eagerState: null, next: null }; + if (zi(a)) Ai(b, e); + else { + var f2 = a.alternate; + if (0 === a.lanes && (null === f2 || 0 === f2.lanes) && (f2 = b.lastRenderedReducer, null !== f2)) try { + var g = b.lastRenderedState, h = f2(g, c); + e.hasEagerState = true; + e.eagerState = h; + if (He(h, g)) { + var k2 = b.interleaved; + null === k2 ? (e.next = e, gh(b)) : (e.next = k2.next, k2.next = e); + b.interleaved = e; + return; + } + } catch (l2) { + } finally { + } + c = hh(a, b, e, d); + null !== c && (e = R(), gi(c, a, d, e), Bi(c, b, d)); + } +} +function zi(a) { + var b = a.alternate; + return a === M || null !== b && b === M; +} +function Ai(a, b) { + Jh = Ih = true; + var c = a.pending; + null === c ? b.next = b : (b.next = c.next, c.next = b); + a.pending = b; +} +function Bi(a, b, c) { + if (0 !== (c & 4194240)) { + var d = b.lanes; + d &= a.pendingLanes; + c |= d; + b.lanes = c; + Cc(a, c); + } +} +var Rh = { readContext: eh, useCallback: P, useContext: P, useEffect: P, useImperativeHandle: P, useInsertionEffect: P, useLayoutEffect: P, useMemo: P, useReducer: P, useRef: P, useState: P, useDebugValue: P, useDeferredValue: P, useTransition: P, useMutableSource: P, useSyncExternalStore: P, useId: P, unstable_isNewReconciler: false }, Oh = { readContext: eh, useCallback: function(a, b) { + Th().memoizedState = [a, void 0 === b ? null : b]; + return a; +}, useContext: eh, useEffect: mi, useImperativeHandle: function(a, b, c) { + c = null !== c && void 0 !== c ? c.concat([a]) : null; + return ki( + 4194308, + 4, + pi.bind(null, b, a), + c + ); +}, useLayoutEffect: function(a, b) { + return ki(4194308, 4, a, b); +}, useInsertionEffect: function(a, b) { + return ki(4, 2, a, b); +}, useMemo: function(a, b) { + var c = Th(); + b = void 0 === b ? null : b; + a = a(); + c.memoizedState = [a, b]; + return a; +}, useReducer: function(a, b, c) { + var d = Th(); + b = void 0 !== c ? c(b) : b; + d.memoizedState = d.baseState = b; + a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a, lastRenderedState: b }; + d.queue = a; + a = a.dispatch = xi.bind(null, M, a); + return [d.memoizedState, a]; +}, useRef: function(a) { + var b = Th(); + a = { current: a }; + return b.memoizedState = a; +}, useState: hi, useDebugValue: ri, useDeferredValue: function(a) { + return Th().memoizedState = a; +}, useTransition: function() { + var a = hi(false), b = a[0]; + a = vi.bind(null, a[1]); + Th().memoizedState = a; + return [b, a]; +}, useMutableSource: function() { +}, useSyncExternalStore: function(a, b, c) { + var d = M, e = Th(); + if (I) { + if (void 0 === c) throw Error(p(407)); + c = c(); + } else { + c = b(); + if (null === Q) throw Error(p(349)); + 0 !== (Hh & 30) || di(d, b, c); + } + e.memoizedState = c; + var f2 = { value: c, getSnapshot: b }; + e.queue = f2; + mi(ai.bind( + null, + d, + f2, + a + ), [a]); + d.flags |= 2048; + bi(9, ci.bind(null, d, f2, c, b), void 0, null); + return c; +}, useId: function() { + var a = Th(), b = Q.identifierPrefix; + if (I) { + var c = sg; + var d = rg; + c = (d & ~(1 << 32 - oc(d) - 1)).toString(32) + c; + b = ":" + b + "R" + c; + c = Kh++; + 0 < c && (b += "H" + c.toString(32)); + b += ":"; + } else c = Lh++, b = ":" + b + "r" + c.toString(32) + ":"; + return a.memoizedState = b; +}, unstable_isNewReconciler: false }, Ph = { + readContext: eh, + useCallback: si, + useContext: eh, + useEffect: $h, + useImperativeHandle: qi, + useInsertionEffect: ni, + useLayoutEffect: oi, + useMemo: ti, + useReducer: Wh, + useRef: ji, + useState: function() { + return Wh(Vh); + }, + useDebugValue: ri, + useDeferredValue: function(a) { + var b = Uh(); + return ui(b, N.memoizedState, a); + }, + useTransition: function() { + var a = Wh(Vh)[0], b = Uh().memoizedState; + return [a, b]; + }, + useMutableSource: Yh, + useSyncExternalStore: Zh, + useId: wi, + unstable_isNewReconciler: false +}, Qh = { readContext: eh, useCallback: si, useContext: eh, useEffect: $h, useImperativeHandle: qi, useInsertionEffect: ni, useLayoutEffect: oi, useMemo: ti, useReducer: Xh, useRef: ji, useState: function() { + return Xh(Vh); +}, useDebugValue: ri, useDeferredValue: function(a) { + var b = Uh(); + return null === N ? b.memoizedState = a : ui(b, N.memoizedState, a); +}, useTransition: function() { + var a = Xh(Vh)[0], b = Uh().memoizedState; + return [a, b]; +}, useMutableSource: Yh, useSyncExternalStore: Zh, useId: wi, unstable_isNewReconciler: false }; +function Ci(a, b) { + if (a && a.defaultProps) { + b = A({}, b); + a = a.defaultProps; + for (var c in a) void 0 === b[c] && (b[c] = a[c]); + return b; + } + return b; +} +function Di(a, b, c, d) { + b = a.memoizedState; + c = c(d, b); + c = null === c || void 0 === c ? b : A({}, b, c); + a.memoizedState = c; + 0 === a.lanes && (a.updateQueue.baseState = c); +} +var Ei = { isMounted: function(a) { + return (a = a._reactInternals) ? Vb(a) === a : false; +}, enqueueSetState: function(a, b, c) { + a = a._reactInternals; + var d = R(), e = yi(a), f2 = mh(d, e); + f2.payload = b; + void 0 !== c && null !== c && (f2.callback = c); + b = nh(a, f2, e); + null !== b && (gi(b, a, e, d), oh(b, a, e)); +}, enqueueReplaceState: function(a, b, c) { + a = a._reactInternals; + var d = R(), e = yi(a), f2 = mh(d, e); + f2.tag = 1; + f2.payload = b; + void 0 !== c && null !== c && (f2.callback = c); + b = nh(a, f2, e); + null !== b && (gi(b, a, e, d), oh(b, a, e)); +}, enqueueForceUpdate: function(a, b) { + a = a._reactInternals; + var c = R(), d = yi(a), e = mh(c, d); + e.tag = 2; + void 0 !== b && null !== b && (e.callback = b); + b = nh(a, e, d); + null !== b && (gi(b, a, d, c), oh(b, a, d)); +} }; +function Fi(a, b, c, d, e, f2, g) { + a = a.stateNode; + return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f2, g) : b.prototype && b.prototype.isPureReactComponent ? !Ie(c, d) || !Ie(e, f2) : true; +} +function Gi(a, b, c) { + var d = false, e = Vf; + var f2 = b.contextType; + "object" === typeof f2 && null !== f2 ? f2 = eh(f2) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f2 = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf); + b = new b(c, f2); + a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null; + b.updater = Ei; + a.stateNode = b; + b._reactInternals = a; + d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f2); + return b; +} +function Hi(a, b, c, d) { + a = b.state; + "function" === typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d); + "function" === typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d); + b.state !== a && Ei.enqueueReplaceState(b, b.state, null); +} +function Ii(a, b, c, d) { + var e = a.stateNode; + e.props = c; + e.state = a.memoizedState; + e.refs = {}; + kh(a); + var f2 = b.contextType; + "object" === typeof f2 && null !== f2 ? e.context = eh(f2) : (f2 = Zf(b) ? Xf : H.current, e.context = Yf(a, f2)); + e.state = a.memoizedState; + f2 = b.getDerivedStateFromProps; + "function" === typeof f2 && (Di(a, b, f2, c), e.state = a.memoizedState); + "function" === typeof b.getDerivedStateFromProps || "function" === typeof e.getSnapshotBeforeUpdate || "function" !== typeof e.UNSAFE_componentWillMount && "function" !== typeof e.componentWillMount || (b = e.state, "function" === typeof e.componentWillMount && e.componentWillMount(), "function" === typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), b !== e.state && Ei.enqueueReplaceState(e, e.state, null), qh(a, c, e, d), e.state = a.memoizedState); + "function" === typeof e.componentDidMount && (a.flags |= 4194308); +} +function Ji(a, b) { + try { + var c = "", d = b; + do + c += Pa(d), d = d.return; + while (d); + var e = c; + } catch (f2) { + e = "\nError generating stack: " + f2.message + "\n" + f2.stack; + } + return { value: a, source: b, stack: e, digest: null }; +} +function Ki(a, b, c) { + return { value: a, source: null, stack: null != c ? c : null, digest: null != b ? b : null }; +} +function Li(a, b) { + try { + console.error(b.value); + } catch (c) { + setTimeout(function() { + throw c; + }); + } +} +var Mi = "function" === typeof WeakMap ? WeakMap : Map; +function Ni(a, b, c) { + c = mh(-1, c); + c.tag = 3; + c.payload = { element: null }; + var d = b.value; + c.callback = function() { + Oi || (Oi = true, Pi = d); + Li(a, b); + }; + return c; +} +function Qi(a, b, c) { + c = mh(-1, c); + c.tag = 3; + var d = a.type.getDerivedStateFromError; + if ("function" === typeof d) { + var e = b.value; + c.payload = function() { + return d(e); + }; + c.callback = function() { + Li(a, b); + }; + } + var f2 = a.stateNode; + null !== f2 && "function" === typeof f2.componentDidCatch && (c.callback = function() { + Li(a, b); + "function" !== typeof d && (null === Ri ? Ri = /* @__PURE__ */ new Set([this]) : Ri.add(this)); + var c2 = b.stack; + this.componentDidCatch(b.value, { componentStack: null !== c2 ? c2 : "" }); + }); + return c; +} +function Si(a, b, c) { + var d = a.pingCache; + if (null === d) { + d = a.pingCache = new Mi(); + var e = /* @__PURE__ */ new Set(); + d.set(b, e); + } else e = d.get(b), void 0 === e && (e = /* @__PURE__ */ new Set(), d.set(b, e)); + e.has(c) || (e.add(c), a = Ti.bind(null, a, b, c), b.then(a, a)); +} +function Ui(a) { + do { + var b; + if (b = 13 === a.tag) b = a.memoizedState, b = null !== b ? null !== b.dehydrated ? true : false : true; + if (b) return a; + a = a.return; + } while (null !== a); + return null; +} +function Vi(a, b, c, d, e) { + if (0 === (a.mode & 1)) return a === b ? a.flags |= 65536 : (a.flags |= 128, c.flags |= 131072, c.flags &= -52805, 1 === c.tag && (null === c.alternate ? c.tag = 17 : (b = mh(-1, 1), b.tag = 2, nh(c, b, 1))), c.lanes |= 1), a; + a.flags |= 65536; + a.lanes = e; + return a; +} +var Wi = ua.ReactCurrentOwner, dh = false; +function Xi(a, b, c, d) { + b.child = null === a ? Vg(b, null, c, d) : Ug(b, a.child, c, d); +} +function Yi(a, b, c, d, e) { + c = c.render; + var f2 = b.ref; + ch(b, e); + d = Nh(a, b, c, d, f2, e); + c = Sh(); + if (null !== a && !dh) return b.updateQueue = a.updateQueue, b.flags &= -2053, a.lanes &= ~e, Zi(a, b, e); + I && c && vg(b); + b.flags |= 1; + Xi(a, b, d, e); + return b.child; +} +function $i(a, b, c, d, e) { + if (null === a) { + var f2 = c.type; + if ("function" === typeof f2 && !aj(f2) && void 0 === f2.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, b.type = f2, bj(a, b, f2, d, e); + a = Rg(c.type, null, d, b, b.mode, e); + a.ref = b.ref; + a.return = b; + return b.child = a; + } + f2 = a.child; + if (0 === (a.lanes & e)) { + var g = f2.memoizedProps; + c = c.compare; + c = null !== c ? c : Ie; + if (c(g, d) && a.ref === b.ref) return Zi(a, b, e); + } + b.flags |= 1; + a = Pg(f2, d); + a.ref = b.ref; + a.return = b; + return b.child = a; +} +function bj(a, b, c, d, e) { + if (null !== a) { + var f2 = a.memoizedProps; + if (Ie(f2, d) && a.ref === b.ref) if (dh = false, b.pendingProps = d = f2, 0 !== (a.lanes & e)) 0 !== (a.flags & 131072) && (dh = true); + else return b.lanes = a.lanes, Zi(a, b, e); + } + return cj(a, b, c, d, e); +} +function dj(a, b, c) { + var d = b.pendingProps, e = d.children, f2 = null !== a ? a.memoizedState : null; + if ("hidden" === d.mode) if (0 === (b.mode & 1)) b.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G(ej, fj), fj |= c; + else { + if (0 === (c & 1073741824)) return a = null !== f2 ? f2.baseLanes | c : c, b.lanes = b.childLanes = 1073741824, b.memoizedState = { baseLanes: a, cachePool: null, transitions: null }, b.updateQueue = null, G(ej, fj), fj |= a, null; + b.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }; + d = null !== f2 ? f2.baseLanes : c; + G(ej, fj); + fj |= d; + } + else null !== f2 ? (d = f2.baseLanes | c, b.memoizedState = null) : d = c, G(ej, fj), fj |= d; + Xi(a, b, e, c); + return b.child; +} +function gj(a, b) { + var c = b.ref; + if (null === a && null !== c || null !== a && a.ref !== c) b.flags |= 512, b.flags |= 2097152; +} +function cj(a, b, c, d, e) { + var f2 = Zf(c) ? Xf : H.current; + f2 = Yf(b, f2); + ch(b, e); + c = Nh(a, b, c, d, f2, e); + d = Sh(); + if (null !== a && !dh) return b.updateQueue = a.updateQueue, b.flags &= -2053, a.lanes &= ~e, Zi(a, b, e); + I && d && vg(b); + b.flags |= 1; + Xi(a, b, c, e); + return b.child; +} +function hj(a, b, c, d, e) { + if (Zf(c)) { + var f2 = true; + cg(b); + } else f2 = false; + ch(b, e); + if (null === b.stateNode) ij(a, b), Gi(b, c, d), Ii(b, c, d, e), d = true; + else if (null === a) { + var g = b.stateNode, h = b.memoizedProps; + g.props = h; + var k2 = g.context, l2 = c.contextType; + "object" === typeof l2 && null !== l2 ? l2 = eh(l2) : (l2 = Zf(c) ? Xf : H.current, l2 = Yf(b, l2)); + var m2 = c.getDerivedStateFromProps, q2 = "function" === typeof m2 || "function" === typeof g.getSnapshotBeforeUpdate; + q2 || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k2 !== l2) && Hi(b, g, d, l2); + jh = false; + var r2 = b.memoizedState; + g.state = r2; + qh(b, d, g, e); + k2 = b.memoizedState; + h !== d || r2 !== k2 || Wf.current || jh ? ("function" === typeof m2 && (Di(b, c, m2, d), k2 = b.memoizedState), (h = jh || Fi(b, c, h, d, r2, k2, l2)) ? (q2 || "function" !== typeof g.UNSAFE_componentWillMount && "function" !== typeof g.componentWillMount || ("function" === typeof g.componentWillMount && g.componentWillMount(), "function" === typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), "function" === typeof g.componentDidMount && (b.flags |= 4194308)) : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), b.memoizedProps = d, b.memoizedState = k2), g.props = d, g.state = k2, g.context = l2, d = h) : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), d = false); + } else { + g = b.stateNode; + lh(a, b); + h = b.memoizedProps; + l2 = b.type === b.elementType ? h : Ci(b.type, h); + g.props = l2; + q2 = b.pendingProps; + r2 = g.context; + k2 = c.contextType; + "object" === typeof k2 && null !== k2 ? k2 = eh(k2) : (k2 = Zf(c) ? Xf : H.current, k2 = Yf(b, k2)); + var y2 = c.getDerivedStateFromProps; + (m2 = "function" === typeof y2 || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q2 || r2 !== k2) && Hi(b, g, d, k2); + jh = false; + r2 = b.memoizedState; + g.state = r2; + qh(b, d, g, e); + var n2 = b.memoizedState; + h !== q2 || r2 !== n2 || Wf.current || jh ? ("function" === typeof y2 && (Di(b, c, y2, d), n2 = b.memoizedState), (l2 = jh || Fi(b, c, l2, d, r2, n2, k2) || false) ? (m2 || "function" !== typeof g.UNSAFE_componentWillUpdate && "function" !== typeof g.componentWillUpdate || ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(d, n2, k2), "function" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, n2, k2)), "function" === typeof g.componentDidUpdate && (b.flags |= 4), "function" === typeof g.getSnapshotBeforeUpdate && (b.flags |= 1024)) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 1024), b.memoizedProps = d, b.memoizedState = n2), g.props = d, g.state = n2, g.context = k2, d = l2) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 1024), d = false); + } + return jj(a, b, c, d, f2, e); +} +function jj(a, b, c, d, e, f2) { + gj(a, b); + var g = 0 !== (b.flags & 128); + if (!d && !g) return e && dg(b, c, false), Zi(a, b, f2); + d = b.stateNode; + Wi.current = b; + var h = g && "function" !== typeof c.getDerivedStateFromError ? null : d.render(); + b.flags |= 1; + null !== a && g ? (b.child = Ug(b, a.child, null, f2), b.child = Ug(b, null, h, f2)) : Xi(a, b, h, f2); + b.memoizedState = d.state; + e && dg(b, c, true); + return b.child; +} +function kj(a) { + var b = a.stateNode; + b.pendingContext ? ag(a, b.pendingContext, b.pendingContext !== b.context) : b.context && ag(a, b.context, false); + yh(a, b.containerInfo); +} +function lj(a, b, c, d, e) { + Ig(); + Jg(e); + b.flags |= 256; + Xi(a, b, c, d); + return b.child; +} +var mj = { dehydrated: null, treeContext: null, retryLane: 0 }; +function nj(a) { + return { baseLanes: a, cachePool: null, transitions: null }; +} +function oj(a, b, c) { + var d = b.pendingProps, e = L.current, f2 = false, g = 0 !== (b.flags & 128), h; + (h = g) || (h = null !== a && null === a.memoizedState ? false : 0 !== (e & 2)); + if (h) f2 = true, b.flags &= -129; + else if (null === a || null !== a.memoizedState) e |= 1; + G(L, e & 1); + if (null === a) { + Eg(b); + a = b.memoizedState; + if (null !== a && (a = a.dehydrated, null !== a)) return 0 === (b.mode & 1) ? b.lanes = 1 : "$!" === a.data ? b.lanes = 8 : b.lanes = 1073741824, null; + g = d.children; + a = d.fallback; + return f2 ? (d = b.mode, f2 = b.child, g = { mode: "hidden", children: g }, 0 === (d & 1) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = g) : f2 = pj(g, d, 0, null), a = Tg(a, d, c, null), f2.return = b, a.return = b, f2.sibling = a, b.child = f2, b.child.memoizedState = nj(c), b.memoizedState = mj, a) : qj(b, g); + } + e = a.memoizedState; + if (null !== e && (h = e.dehydrated, null !== h)) return rj(a, b, g, d, h, e, c); + if (f2) { + f2 = d.fallback; + g = b.mode; + e = a.child; + h = e.sibling; + var k2 = { mode: "hidden", children: d.children }; + 0 === (g & 1) && b.child !== e ? (d = b.child, d.childLanes = 0, d.pendingProps = k2, b.deletions = null) : (d = Pg(e, k2), d.subtreeFlags = e.subtreeFlags & 14680064); + null !== h ? f2 = Pg(h, f2) : (f2 = Tg(f2, g, c, null), f2.flags |= 2); + f2.return = b; + d.return = b; + d.sibling = f2; + b.child = d; + d = f2; + f2 = b.child; + g = a.child.memoizedState; + g = null === g ? nj(c) : { baseLanes: g.baseLanes | c, cachePool: null, transitions: g.transitions }; + f2.memoizedState = g; + f2.childLanes = a.childLanes & ~c; + b.memoizedState = mj; + return d; + } + f2 = a.child; + a = f2.sibling; + d = Pg(f2, { mode: "visible", children: d.children }); + 0 === (b.mode & 1) && (d.lanes = c); + d.return = b; + d.sibling = null; + null !== a && (c = b.deletions, null === c ? (b.deletions = [a], b.flags |= 16) : c.push(a)); + b.child = d; + b.memoizedState = null; + return d; +} +function qj(a, b) { + b = pj({ mode: "visible", children: b }, a.mode, 0, null); + b.return = a; + return a.child = b; +} +function sj(a, b, c, d) { + null !== d && Jg(d); + Ug(b, a.child, null, c); + a = qj(b, b.pendingProps.children); + a.flags |= 2; + b.memoizedState = null; + return a; +} +function rj(a, b, c, d, e, f2, g) { + if (c) { + if (b.flags & 256) return b.flags &= -257, d = Ki(Error(p(422))), sj(a, b, g, d); + if (null !== b.memoizedState) return b.child = a.child, b.flags |= 128, null; + f2 = d.fallback; + e = b.mode; + d = pj({ mode: "visible", children: d.children }, e, 0, null); + f2 = Tg(f2, e, g, null); + f2.flags |= 2; + d.return = b; + f2.return = b; + d.sibling = f2; + b.child = d; + 0 !== (b.mode & 1) && Ug(b, a.child, null, g); + b.child.memoizedState = nj(g); + b.memoizedState = mj; + return f2; + } + if (0 === (b.mode & 1)) return sj(a, b, g, null); + if ("$!" === e.data) { + d = e.nextSibling && e.nextSibling.dataset; + if (d) var h = d.dgst; + d = h; + f2 = Error(p(419)); + d = Ki(f2, d, void 0); + return sj(a, b, g, d); + } + h = 0 !== (g & a.childLanes); + if (dh || h) { + d = Q; + if (null !== d) { + switch (g & -g) { + case 4: + e = 2; + break; + case 16: + e = 8; + break; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + e = 32; + break; + case 536870912: + e = 268435456; + break; + default: + e = 0; + } + e = 0 !== (e & (d.suspendedLanes | g)) ? 0 : e; + 0 !== e && e !== f2.retryLane && (f2.retryLane = e, ih(a, e), gi(d, a, e, -1)); + } + tj(); + d = Ki(Error(p(421))); + return sj(a, b, g, d); + } + if ("$?" === e.data) return b.flags |= 128, b.child = a.child, b = uj.bind(null, a), e._reactRetry = b, null; + a = f2.treeContext; + yg = Lf(e.nextSibling); + xg = b; + I = true; + zg = null; + null !== a && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a.id, sg = a.overflow, qg = b); + b = qj(b, d.children); + b.flags |= 4096; + return b; +} +function vj(a, b, c) { + a.lanes |= b; + var d = a.alternate; + null !== d && (d.lanes |= b); + bh(a.return, b, c); +} +function wj(a, b, c, d, e) { + var f2 = a.memoizedState; + null === f2 ? a.memoizedState = { isBackwards: b, rendering: null, renderingStartTime: 0, last: d, tail: c, tailMode: e } : (f2.isBackwards = b, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d, f2.tail = c, f2.tailMode = e); +} +function xj(a, b, c) { + var d = b.pendingProps, e = d.revealOrder, f2 = d.tail; + Xi(a, b, d.children, c); + d = L.current; + if (0 !== (d & 2)) d = d & 1 | 2, b.flags |= 128; + else { + if (null !== a && 0 !== (a.flags & 128)) a: for (a = b.child; null !== a; ) { + if (13 === a.tag) null !== a.memoizedState && vj(a, c, b); + else if (19 === a.tag) vj(a, c, b); + else if (null !== a.child) { + a.child.return = a; + a = a.child; + continue; + } + if (a === b) break a; + for (; null === a.sibling; ) { + if (null === a.return || a.return === b) break a; + a = a.return; + } + a.sibling.return = a.return; + a = a.sibling; + } + d &= 1; + } + G(L, d); + if (0 === (b.mode & 1)) b.memoizedState = null; + else switch (e) { + case "forwards": + c = b.child; + for (e = null; null !== c; ) a = c.alternate, null !== a && null === Ch(a) && (e = c), c = c.sibling; + c = e; + null === c ? (e = b.child, b.child = null) : (e = c.sibling, c.sibling = null); + wj(b, false, e, c, f2); + break; + case "backwards": + c = null; + e = b.child; + for (b.child = null; null !== e; ) { + a = e.alternate; + if (null !== a && null === Ch(a)) { + b.child = e; + break; + } + a = e.sibling; + e.sibling = c; + c = e; + e = a; + } + wj(b, true, c, null, f2); + break; + case "together": + wj(b, false, null, null, void 0); + break; + default: + b.memoizedState = null; + } + return b.child; +} +function ij(a, b) { + 0 === (b.mode & 1) && null !== a && (a.alternate = null, b.alternate = null, b.flags |= 2); +} +function Zi(a, b, c) { + null !== a && (b.dependencies = a.dependencies); + rh |= b.lanes; + if (0 === (c & b.childLanes)) return null; + if (null !== a && b.child !== a.child) throw Error(p(153)); + if (null !== b.child) { + a = b.child; + c = Pg(a, a.pendingProps); + b.child = c; + for (c.return = b; null !== a.sibling; ) a = a.sibling, c = c.sibling = Pg(a, a.pendingProps), c.return = b; + c.sibling = null; + } + return b.child; +} +function yj(a, b, c) { + switch (b.tag) { + case 3: + kj(b); + Ig(); + break; + case 5: + Ah(b); + break; + case 1: + Zf(b.type) && cg(b); + break; + case 4: + yh(b, b.stateNode.containerInfo); + break; + case 10: + var d = b.type._context, e = b.memoizedProps.value; + G(Wg, d._currentValue); + d._currentValue = e; + break; + case 13: + d = b.memoizedState; + if (null !== d) { + if (null !== d.dehydrated) return G(L, L.current & 1), b.flags |= 128, null; + if (0 !== (c & b.child.childLanes)) return oj(a, b, c); + G(L, L.current & 1); + a = Zi(a, b, c); + return null !== a ? a.sibling : null; + } + G(L, L.current & 1); + break; + case 19: + d = 0 !== (c & b.childLanes); + if (0 !== (a.flags & 128)) { + if (d) return xj(a, b, c); + b.flags |= 128; + } + e = b.memoizedState; + null !== e && (e.rendering = null, e.tail = null, e.lastEffect = null); + G(L, L.current); + if (d) break; + else return null; + case 22: + case 23: + return b.lanes = 0, dj(a, b, c); + } + return Zi(a, b, c); +} +var zj, Aj, Bj, Cj; +zj = function(a, b) { + for (var c = b.child; null !== c; ) { + if (5 === c.tag || 6 === c.tag) a.appendChild(c.stateNode); + else if (4 !== c.tag && null !== c.child) { + c.child.return = c; + c = c.child; + continue; + } + if (c === b) break; + for (; null === c.sibling; ) { + if (null === c.return || c.return === b) return; + c = c.return; + } + c.sibling.return = c.return; + c = c.sibling; + } +}; +Aj = function() { +}; +Bj = function(a, b, c, d) { + var e = a.memoizedProps; + if (e !== d) { + a = b.stateNode; + xh(uh.current); + var f2 = null; + switch (c) { + case "input": + e = Ya(a, e); + d = Ya(a, d); + f2 = []; + break; + case "select": + e = A({}, e, { value: void 0 }); + d = A({}, d, { value: void 0 }); + f2 = []; + break; + case "textarea": + e = gb(a, e); + d = gb(a, d); + f2 = []; + break; + default: + "function" !== typeof e.onClick && "function" === typeof d.onClick && (a.onclick = Bf); + } + ub(c, d); + var g; + c = null; + for (l2 in e) if (!d.hasOwnProperty(l2) && e.hasOwnProperty(l2) && null != e[l2]) if ("style" === l2) { + var h = e[l2]; + for (g in h) h.hasOwnProperty(g) && (c || (c = {}), c[g] = ""); + } else "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null)); + for (l2 in d) { + var k2 = d[l2]; + h = null != e ? e[l2] : void 0; + if (d.hasOwnProperty(l2) && k2 !== h && (null != k2 || null != h)) if ("style" === l2) if (h) { + for (g in h) !h.hasOwnProperty(g) || k2 && k2.hasOwnProperty(g) || (c || (c = {}), c[g] = ""); + for (g in k2) k2.hasOwnProperty(g) && h[g] !== k2[g] && (c || (c = {}), c[g] = k2[g]); + } else c || (f2 || (f2 = []), f2.push( + l2, + c + )), c = k2; + else "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h = h ? h.__html : void 0, null != k2 && h !== k2 && (f2 = f2 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f2 = f2 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D("scroll", a), f2 || h === k2 || (f2 = [])) : (f2 = f2 || []).push(l2, k2)); + } + c && (f2 = f2 || []).push("style", c); + var l2 = f2; + if (b.updateQueue = l2) b.flags |= 4; + } +}; +Cj = function(a, b, c, d) { + c !== d && (b.flags |= 4); +}; +function Dj(a, b) { + if (!I) switch (a.tailMode) { + case "hidden": + b = a.tail; + for (var c = null; null !== b; ) null !== b.alternate && (c = b), b = b.sibling; + null === c ? a.tail = null : c.sibling = null; + break; + case "collapsed": + c = a.tail; + for (var d = null; null !== c; ) null !== c.alternate && (d = c), c = c.sibling; + null === d ? b || null === a.tail ? a.tail = null : a.tail.sibling = null : d.sibling = null; + } +} +function S(a) { + var b = null !== a.alternate && a.alternate.child === a.child, c = 0, d = 0; + if (b) for (var e = a.child; null !== e; ) c |= e.lanes | e.childLanes, d |= e.subtreeFlags & 14680064, d |= e.flags & 14680064, e.return = a, e = e.sibling; + else for (e = a.child; null !== e; ) c |= e.lanes | e.childLanes, d |= e.subtreeFlags, d |= e.flags, e.return = a, e = e.sibling; + a.subtreeFlags |= d; + a.childLanes = c; + return b; +} +function Ej(a, b, c) { + var d = b.pendingProps; + wg(b); + switch (b.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return S(b), null; + case 1: + return Zf(b.type) && $f(), S(b), null; + case 3: + d = b.stateNode; + zh(); + E(Wf); + E(H); + Eh(); + d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null); + if (null === a || null === a.child) Gg(b) ? b.flags |= 4 : null === a || a.memoizedState.isDehydrated && 0 === (b.flags & 256) || (b.flags |= 1024, null !== zg && (Fj(zg), zg = null)); + Aj(a, b); + S(b); + return null; + case 5: + Bh(b); + var e = xh(wh.current); + c = b.type; + if (null !== a && null != b.stateNode) Bj(a, b, c, d, e), a.ref !== b.ref && (b.flags |= 512, b.flags |= 2097152); + else { + if (!d) { + if (null === b.stateNode) throw Error(p(166)); + S(b); + return null; + } + a = xh(uh.current); + if (Gg(b)) { + d = b.stateNode; + c = b.type; + var f2 = b.memoizedProps; + d[Of] = b; + d[Pf] = f2; + a = 0 !== (b.mode & 1); + switch (c) { + case "dialog": + D("cancel", d); + D("close", d); + break; + case "iframe": + case "object": + case "embed": + D("load", d); + break; + case "video": + case "audio": + for (e = 0; e < lf.length; e++) D(lf[e], d); + break; + case "source": + D("error", d); + break; + case "img": + case "image": + case "link": + D( + "error", + d + ); + D("load", d); + break; + case "details": + D("toggle", d); + break; + case "input": + Za(d, f2); + D("invalid", d); + break; + case "select": + d._wrapperState = { wasMultiple: !!f2.multiple }; + D("invalid", d); + break; + case "textarea": + hb(d, f2), D("invalid", d); + } + ub(c, f2); + e = null; + for (var g in f2) if (f2.hasOwnProperty(g)) { + var h = f2[g]; + "children" === g ? "string" === typeof h ? d.textContent !== h && (true !== f2.suppressHydrationWarning && Af(d.textContent, h, a), e = ["children", h]) : "number" === typeof h && d.textContent !== "" + h && (true !== f2.suppressHydrationWarning && Af( + d.textContent, + h, + a + ), e = ["children", "" + h]) : ea.hasOwnProperty(g) && null != h && "onScroll" === g && D("scroll", d); + } + switch (c) { + case "input": + Va(d); + db(d, f2, true); + break; + case "textarea": + Va(d); + jb(d); + break; + case "select": + case "option": + break; + default: + "function" === typeof f2.onClick && (d.onclick = Bf); + } + d = e; + b.updateQueue = d; + null !== d && (b.flags |= 4); + } else { + g = 9 === e.nodeType ? e : e.ownerDocument; + "http://www.w3.org/1999/xhtml" === a && (a = kb(c)); + "http://www.w3.org/1999/xhtml" === a ? "script" === c ? (a = g.createElement("div"), a.innerHTML = " + + diff --git a/mcp/popup.js b/mcp/popup.js new file mode 100644 index 0000000..1bf6bcd --- /dev/null +++ b/mcp/popup.js @@ -0,0 +1,96 @@ +const STORAGE_KEY = 'react_debugger_disabled_sites'; + +function getHostname(url) { + try { + return new URL(url).hostname; + } catch { + return null; + } +} + +async function getDisabledSites() { + const result = await chrome.storage.local.get(STORAGE_KEY); + return result[STORAGE_KEY] || []; +} + +async function setDisabledSites(sites) { + await chrome.storage.local.set({ [STORAGE_KEY]: sites }); +} + +async function isSiteEnabled(hostname) { + const disabledSites = await getDisabledSites(); + return !disabledSites.includes(hostname); +} + +async function toggleSite(hostname, enabled) { + const disabledSites = await getDisabledSites(); + + if (enabled) { + const index = disabledSites.indexOf(hostname); + if (index > -1) { + disabledSites.splice(index, 1); + } + } else { + if (!disabledSites.includes(hostname)) { + disabledSites.push(hostname); + } + } + + await setDisabledSites(disabledSites); +} + +function updateUI(hostname, enabled) { + const statusEl = document.getElementById('status'); + const statusText = document.getElementById('statusText'); + const toggle = document.getElementById('siteToggle'); + + toggle.checked = enabled; + + if (enabled) { + statusEl.className = 'status enabled'; + statusText.textContent = 'Enabled for this site'; + } else { + statusEl.className = 'status disabled'; + statusText.textContent = 'Disabled for this site'; + } +} + +async function init() { + const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); + const hostname = getHostname(tab?.url); + + const siteNameEl = document.getElementById('siteName'); + const toggle = document.getElementById('siteToggle'); + const reloadBtn = document.getElementById('reloadBtn'); + const clearBtn = document.getElementById('clearBtn'); + + if (!hostname) { + siteNameEl.textContent = 'Cannot detect site'; + toggle.disabled = true; + return; + } + + siteNameEl.textContent = hostname; + + const enabled = await isSiteEnabled(hostname); + updateUI(hostname, enabled); + + toggle.addEventListener('change', async () => { + const newEnabled = toggle.checked; + await toggleSite(hostname, newEnabled); + updateUI(hostname, newEnabled); + }); + + reloadBtn.addEventListener('click', () => { + chrome.tabs.reload(tab.id); + window.close(); + }); + + clearBtn.addEventListener('click', async () => { + await setDisabledSites([]); + updateUI(hostname, true); + toggle.checked = true; + }); +} + +document.addEventListener('DOMContentLoaded', init); diff --git a/mcp/styles/panel.css b/mcp/styles/panel.css new file mode 100644 index 0000000..324b776 --- /dev/null +++ b/mcp/styles/panel.css @@ -0,0 +1,3834 @@ +:root { + /* Base palette — blue-tinted dark */ + --bg-primary: #0d1117; + --bg-secondary: #161b22; + --bg-tertiary: #1c2128; + --bg-hover: #2d333b; + --bg-card: #161b22; + --bg-inset: #0d1117; + + /* Text hierarchy */ + --text-primary: #e6edf3; + --text-secondary: #8b949e; + --text-muted: #484f58; + + /* Borders & dividers */ + --border-color: #30363d; + --border-subtle: #21262d; + + /* Accent colors — vibrant */ + --accent-blue: #58a6ff; + --accent-green: #3fb950; + --accent-yellow: #d29922; + --accent-red: #f85149; + --accent-purple: #bc8cff; + --accent-cyan: #39d2c0; + + /* Shadows */ + --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); + --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3); + --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5); + --shadow-glow-blue: 0 0 12px rgba(88, 166, 255, 0.15); + + /* Radii */ + --radius-sm: 4px; + --radius-md: 8px; + --radius-lg: 12px; + + /* Transitions */ + --transition-fast: 0.12s ease; + --transition-normal: 0.2s ease; + + /* Typography */ + --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif; + font-size: 12px; + color: var(--text-primary); + background: var(--bg-primary); + line-height: 1.5; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.panel { + display: flex; + flex-direction: column; + height: 100vh; + overflow: hidden; +} + +.panel-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 16px; + background: var(--bg-secondary); + border-bottom: 1px solid var(--border-color); + box-shadow: var(--shadow-sm); +} + +.logo { + display: flex; + align-items: center; + gap: 8px; +} + +.logo-icon { + width: 20px; + height: 20px; + object-fit: contain; +} + +.logo-text { + font-weight: 600; + font-size: 14px; +} + +.version { + font-size: 10px; + color: var(--text-muted); + padding: 2px 6px; + background: var(--bg-tertiary); + border-radius: 4px; +} + +.header-badges { + display: flex; + gap: 8px; +} + +.mode-badge { + font-size: 10px; + font-weight: 600; + padding: 2px 8px; + border-radius: 4px; +} + +.mode-dev { + background: rgba(255, 164, 0, 0.2); + color: var(--accent-yellow); +} + +.mode-prod { + background: rgba(12, 206, 107, 0.2); + color: var(--accent-green); +} + +.mode-active { + background: rgba(12, 206, 107, 0.2); + color: var(--accent-green); +} + +.mode-paused { + background: rgba(140, 140, 140, 0.2); + color: var(--text-secondary); +} + +.mode-redux { + background: rgba(157, 121, 215, 0.2); + color: var(--accent-purple); +} + +.header-right { + display: flex; + align-items: center; + gap: 12px; +} + +.debugger-toggle { + display: flex; + align-items: center; + gap: 8px; + padding: 4px 8px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 16px; + cursor: pointer; + transition: all 0.2s; +} + +.debugger-toggle:hover { + background: var(--bg-hover); +} + +.toggle-track { + position: relative; + width: 32px; + height: 18px; + background: var(--text-muted); + border-radius: 9px; + transition: background 0.2s; +} + +.debugger-toggle.enabled .toggle-track { + background: var(--accent-green); +} + +.toggle-thumb { + position: absolute; + top: 2px; + left: 2px; + width: 14px; + height: 14px; + background: white; + border-radius: 50%; + transition: transform 0.2s; +} + +.debugger-toggle.enabled .toggle-thumb { + transform: translateX(14px); +} + +.toggle-label { + font-size: 10px; + font-weight: 600; + color: var(--text-secondary); + min-width: 24px; +} + +.debugger-toggle.enabled .toggle-label { + color: var(--accent-green); +} + +.debugger-disabled-placeholder { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + padding: 40px; + text-align: center; + color: var(--text-secondary); +} + +.placeholder-icon { + color: var(--text-muted); + margin-bottom: 16px; +} + +.debugger-disabled-placeholder h2 { + font-size: 18px; + font-weight: 500; + margin-bottom: 8px; + color: var(--text-primary); +} + +.debugger-disabled-placeholder p { + max-width: 320px; + margin-bottom: 20px; + line-height: 1.6; +} + +.enable-btn { + padding: 10px 24px; + background: var(--accent-green); + color: white; + border: none; + border-radius: 6px; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.enable-btn:hover { + background: #0ab35c; + transform: translateY(-1px); +} + +.tab-nav { + display: flex; + background: var(--bg-secondary); + border-bottom: 1px solid var(--border-color); + overflow-x: auto; +} + +.tab-button { + display: flex; + align-items: center; + gap: 6px; + padding: 10px 16px; + background: none; + border: none; + border-bottom: 3px solid transparent; + color: var(--text-secondary); + cursor: pointer; + transition: all var(--transition-fast); + white-space: nowrap; + font-size: 12px; + font-weight: 500; +} + +.tab-button:hover { + background: rgba(88, 166, 255, 0.04); + color: var(--text-primary); +} + +.tab-button.active { + color: var(--text-primary); + border-bottom-color: var(--accent-blue); + background: rgba(88, 166, 255, 0.06); + box-shadow: inset 0 -1px 8px rgba(88, 166, 255, 0.08); +} + +.tab-label { + font-size: 12px; +} + +.tab-badge { + font-size: 10px; + font-weight: 600; + padding: 1px 6px; + background: var(--accent-red); + color: white; + border-radius: 10px; +} + +.tab-content { + flex: 1; + overflow: auto; + padding: 16px; +} + +.tab-panel { + max-width: 1200px; +} + +.tab-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16px; +} + +.tab-header h2 { + font-size: 16px; + font-weight: 600; +} + +.tab-actions { + display: flex; + align-items: center; + gap: 12px; +} + +.issue-count { + font-size: 12px; + color: var(--text-secondary); +} + +.clear-btn, +.refresh-btn, +.dispatch-btn { + padding: 6px 12px; + font-size: 12px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-primary); + cursor: pointer; + transition: all 0.2s; +} + +.clear-btn:hover, +.refresh-btn:hover, +.dispatch-btn:hover { + background: var(--bg-hover); +} + +.dispatch-btn { + background: var(--accent-blue); + border-color: var(--accent-blue); +} + +.dispatch-btn:hover { + opacity: 0.9; +} + +.section { + margin-bottom: 24px; +} + +.section h3 { + font-size: 13px; + font-weight: 600; + margin-bottom: 8px; + color: var(--text-secondary); + min-height: 20px; +} + +.section-desc { + font-size: 11px; + color: var(--text-muted); + margin-bottom: 12px; + min-height: 17px; +} + +.issues-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.issue-card { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-left-width: 3px; + border-radius: var(--radius-md); + overflow: hidden; + box-shadow: var(--shadow-sm); + transition: box-shadow var(--transition-fast), border-color var(--transition-fast); +} + +.issue-card:hover { + border-color: var(--bg-hover); + box-shadow: var(--shadow-md); +} + +.issue-header { + display: flex; + align-items: center; + gap: 12px; + padding: 10px 12px; + cursor: pointer; + transition: background 0.2s; +} + +.issue-header:hover { + background: var(--bg-hover); +} + +.issue-icon { + font-size: 16px; +} + +.issue-info { + flex: 1; + min-width: 0; +} + +.issue-title-row { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 4px; +} + +.issue-title { + font-size: 13px; + font-weight: 500; + margin: 0; +} + +.severity-badge { + font-size: 9px; + font-weight: 600; + padding: 2px 6px; + border-radius: 3px; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.issue-location { + display: flex; + align-items: center; + gap: 6px; + flex-wrap: wrap; +} + +.element-type { + font-family: var(--font-mono); + font-size: 11px; + color: var(--accent-purple); + background: rgba(138, 43, 226, 0.15); + padding: 1px 5px; + border-radius: 3px; +} + +.issue-component { + font-size: 11px; + color: var(--text-muted); +} + +.issue-component strong { + color: var(--accent-blue); +} + +.component-path { + font-size: 10px; + color: var(--text-muted); + opacity: 0.8; +} + +.render-count-badge { + font-size: 11px; + font-weight: 600; + font-family: var(--font-mono); + padding: 2px 6px; + background: rgba(255, 164, 0, 0.2); + color: var(--accent-yellow); + border-radius: 4px; + margin-left: 4px; +} + +.expand-button { + padding: 4px 8px; + background: none; + border: none; + color: var(--text-secondary); + cursor: pointer; + font-size: 10px; +} + +.issue-details { + padding: 12px 16px; + border-top: 1px solid var(--border-color); + background: var(--bg-tertiary); +} + +.issue-message { + margin-bottom: 12px; + color: var(--text-primary); +} + +.issue-why { + margin-bottom: 12px; + padding: 8px; + background: rgba(0, 122, 204, 0.1); + border-radius: 4px; +} + +.issue-why strong { + color: var(--accent-blue); + font-size: 11px; +} + +.issue-why p { + margin-top: 4px; + font-size: 12px; +} + +.issue-suggestion { + margin-bottom: 12px; +} + +.issue-suggestion strong { + color: var(--accent-green); + font-size: 11px; +} + +.issue-suggestion p { + margin-top: 4px; +} + +.issue-code { + margin-bottom: 12px; +} + +.issue-code strong { + font-size: 11px; + color: var(--text-secondary); +} + +.issue-code pre { + margin-top: 4px; + padding: 8px; + background: var(--bg-primary); + border-radius: 4px; + overflow-x: auto; +} + +.issue-code code { + font-family: var(--font-mono); + font-size: 11px; + white-space: pre-wrap; +} + +.issue-actions { + display: flex; + gap: 12px; +} + +.learn-link { + font-size: 11px; + color: var(--accent-blue); + text-decoration: none; +} + +.issue-elements { + margin-bottom: 12px; + padding: 8px; + background: var(--bg-primary); + border-radius: 4px; +} + +.issue-elements strong { + font-size: 11px; + color: var(--text-secondary); + display: block; + margin-bottom: 8px; +} + +.elements-list { + display: flex; + flex-direction: column; + gap: 4px; + max-height: 200px; + overflow-y: auto; +} + +.element-item { + display: flex; + align-items: center; + gap: 8px; + font-family: var(--font-mono); + font-size: 11px; + padding: 4px 8px; + background: var(--bg-secondary); + border-radius: 3px; + border-left: 2px solid transparent; +} + +.element-item.missing-key { + border-left-color: var(--accent-red); + background: rgba(255, 68, 68, 0.08); +} + +.element-item .el-index { + color: var(--text-muted); + min-width: 30px; +} + +.element-item .el-type { + color: var(--accent-purple); + flex: 1; +} + +.element-item .el-key { + color: var(--accent-green); +} + +.element-item .el-key.null { + color: var(--accent-red); + font-style: italic; +} + +.element-item.more { + color: var(--text-muted); + font-style: italic; + justify-content: center; +} + +.learn-link:hover { + text-decoration: underline; +} + +.closure-info { + margin-bottom: 12px; + padding: 12px; + background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 87, 34, 0.1) 100%); + border: 1px solid rgba(255, 152, 0, 0.3); + border-radius: 6px; +} + +.closure-info > strong { + display: block; + font-size: 11px; + color: var(--accent-yellow); + margin-bottom: 10px; +} + +.closure-timeline { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 12px; + padding: 8px; + background: var(--bg-primary); + border-radius: 4px; +} + +.timeline-item { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; +} + +.timeline-badge { + padding: 3px 8px; + font-size: 10px; + font-weight: 600; + border-radius: 3px; + background: var(--accent-green); + color: white; +} + +.timeline-badge.warning { + background: var(--accent-red); +} + +.timeline-detail { + font-size: 11px; + color: var(--text-secondary); + font-family: var(--font-mono); +} + +.timeline-arrow { + font-size: 18px; + color: var(--text-muted); + flex-shrink: 0; +} + +.closure-details { + display: flex; + flex-direction: column; + gap: 6px; + margin-bottom: 10px; +} + +.closure-row { + display: flex; + align-items: center; + gap: 8px; + font-size: 11px; +} + +.closure-label { + color: var(--text-muted); + min-width: 100px; +} + +.closure-value { + font-family: var(--font-mono); + color: var(--accent-purple); + background: var(--bg-primary); + padding: 2px 6px; + border-radius: 3px; +} + +.closure-type { + padding: 2px 8px; + border-radius: 3px; + font-size: 10px; + font-weight: 600; + text-transform: uppercase; +} + +.closure-type.type-setTimeout, +.closure-type.type-setInterval { + background: rgba(33, 150, 243, 0.2); + color: #2196f3; +} + +.closure-type.type-eventListener { + background: rgba(156, 39, 176, 0.2); + color: #9c27b0; +} + +.closure-type.type-promise { + background: rgba(0, 150, 136, 0.2); + color: #009688; +} + +.closure-type.type-callback { + background: rgba(255, 152, 0, 0.2); + color: #ff9800; +} + +.closure-stale-count { + font-weight: 600; + color: var(--accent-red); +} + +.captured-values { + margin-top: 10px; + padding-top: 10px; + border-top: 1px solid var(--border-color); +} + +.captured-values strong { + display: block; + font-size: 10px; + color: var(--text-secondary); + margin-bottom: 6px; +} + +.values-list { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.value-item code { + padding: 3px 8px; + font-size: 11px; + background: rgba(244, 67, 54, 0.15); + color: var(--accent-red); + border-radius: 3px; + font-family: var(--font-mono); +} + +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 48px 24px; + text-align: center; + min-height: 200px; +} + +.empty-icon { + font-size: 48px; + margin-bottom: 16px; + width: 48px; + height: 48px; + line-height: 1; +} + +.empty-state h2 { + font-size: 18px; + margin-bottom: 8px; +} + +.empty-state p { + color: var(--text-secondary); + margin-bottom: 4px; +} + +.empty-state .hint { + font-size: 11px; + color: var(--text-muted); +} + +.panel-loading { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; +} + +.spinner { + width: 32px; + height: 32px; + border: 3px solid var(--border-color); + border-top-color: var(--accent-blue); + border-radius: 50%; + animation: spin 1s linear infinite; +} + +@keyframes spin { + to { transform: rotate(360deg); } +} + +.panel-empty { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; + text-align: center; + padding: 24px; +} + +.scan-toggle { + padding: 6px 12px; + font-size: 11px; + font-weight: 600; + border: 1px solid var(--border-color); + border-radius: 4px; + background: var(--bg-secondary); + color: var(--text-secondary); + cursor: pointer; + transition: all 0.2s; +} + +.scan-toggle:hover { + background: var(--bg-hover); +} + +.scan-toggle.active { + background: rgba(64, 196, 99, 0.2); + border-color: #40c463; + color: #40c463; +} + +.scan-info-container { + margin-bottom: 16px; +} + +.scan-info-container:empty { + margin-bottom: 0; +} + +.scan-info { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 12px; + background: rgba(64, 196, 99, 0.1); + border: 1px solid rgba(64, 196, 99, 0.3); + border-radius: 6px; + font-size: 11px; + min-height: 42px; +} + +.scan-indicator { + color: #40c463; + animation: pulse 1.5s ease-in-out infinite; +} + +@keyframes pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.4; } +} + +.scan-legend { + display: flex; + gap: 4px; + margin-left: auto; +} + +.legend-item { + padding: 2px 6px; + border-radius: 3px; + font-size: 9px; + font-weight: 600; + color: white; +} + +.stats-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 12px; + margin-bottom: 24px; +} + +@media (max-width: 600px) { + .stats-grid { + grid-template-columns: repeat(2, 1fr); + } +} + +.stat-card { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 16px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + min-height: 80px; + min-width: 120px; + box-shadow: var(--shadow-sm); + transition: box-shadow var(--transition-fast), transform var(--transition-fast); +} + +.stat-card:hover { + box-shadow: var(--shadow-md); + transform: translateY(-1px); +} + +.stat-value { + font-size: 24px; + font-weight: 600; + color: var(--text-primary); + min-width: 110px; + text-align: center; + font-variant-numeric: tabular-nums; + font-family: var(--font-mono); + line-height: 1.2; + transition: color 0.2s ease; +} + +.stat-label { + font-size: 11px; + color: var(--text-muted); + margin-top: 4px; + text-align: center; + white-space: nowrap; +} + +.render-table { + overflow-x: auto; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 6px; +} + +.render-table table { + width: 100%; + border-collapse: collapse; + table-layout: fixed; + min-width: 500px; +} + +.render-table th, +.render-table td { + padding: 10px 14px; + text-align: left; + border-bottom: 1px solid var(--border-color); + vertical-align: middle; +} + +.render-table th { + font-size: 11px; + font-weight: 600; + color: var(--text-secondary); + background: var(--bg-tertiary); + text-transform: uppercase; + letter-spacing: 0.5px; + white-space: nowrap; +} + +.render-table td { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.render-table tbody tr:last-child td { + border-bottom: none; +} + + +.render-table tbody tr:hover { + background: rgba(88, 166, 255, 0.04); +} + +.render-table tbody tr:nth-child(even) { + background: rgba(255, 255, 255, 0.01); +} + +.render-table tbody tr:nth-child(even):hover { + background: rgba(88, 166, 255, 0.04); +} + +/* Slowest Components Table - 4 columns */ +.render-table.slow-table table { + min-width: 450px; +} + +.render-table.slow-table th:nth-child(1), +.render-table.slow-table td:nth-child(1) { + width: 40%; + min-width: 150px; +} +.render-table.slow-table th:nth-child(2), +.render-table.slow-table td:nth-child(2) { + width: 20%; + min-width: 90px; + text-align: right; +} +.render-table.slow-table th:nth-child(3), +.render-table.slow-table td:nth-child(3) { + width: 20%; + min-width: 90px; + text-align: right; +} +.render-table.slow-table th:nth-child(4), +.render-table.slow-table td:nth-child(4) { + width: 20%; + min-width: 80px; + text-align: right; +} + +/* Top Re-rendering Components Table - 5 columns */ +.render-table.rerender-table table { + min-width: 650px; + table-layout: fixed; +} + +.render-table.rerender-table th:nth-child(1), +.render-table.rerender-table td:nth-child(1) { + width: 25%; + min-width: 150px; + max-width: 200px; +} +.render-table.rerender-table th:nth-child(2), +.render-table.rerender-table td:nth-child(2) { + width: 10%; + min-width: 70px; + text-align: right; +} +.render-table.rerender-table th:nth-child(3), +.render-table.rerender-table td:nth-child(3) { + width: 12%; + min-width: 85px; + text-align: right; +} +.render-table.rerender-table th:nth-child(4), +.render-table.rerender-table td:nth-child(4) { + width: 12%; + min-width: 85px; + text-align: right; +} +.render-table.rerender-table th:nth-child(5), +.render-table.rerender-table td:nth-child(5) { + width: 41%; + min-width: 160px; +} + +.render-table tr.warning { + background: rgba(255, 164, 0, 0.1); +} + +.component-name { + font-family: var(--font-mono); + font-size: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--text-primary); +} + +.render-count { + font-weight: 600; + font-variant-numeric: tabular-nums; + font-family: var(--font-mono); + font-size: 12px; + color: var(--text-primary); +} + +.render-time { + font-variant-numeric: tabular-nums; + font-family: var(--font-mono); + font-size: 12px; +} + +.trigger-reason { + display: flex; + align-items: center; + gap: 6px; + flex-wrap: nowrap; + overflow: hidden; +} + +.trigger-badge { + display: inline-block; + padding: 3px 8px; + font-size: 10px; + font-weight: 600; + border-radius: 4px; + background: var(--bg-tertiary); + text-align: center; + text-transform: lowercase; + white-space: nowrap; +} + +.trigger-props { background: rgba(0, 122, 204, 0.2); color: var(--accent-blue); } +.trigger-state { background: rgba(157, 121, 215, 0.2); color: var(--accent-purple); } +.trigger-context { background: rgba(255, 164, 0, 0.2); color: var(--accent-yellow); } +.trigger-parent { background: rgba(140, 140, 140, 0.2); color: var(--text-secondary); } +.trigger-force { background: rgba(255, 78, 66, 0.2); color: var(--accent-red); } +.trigger-mount { background: rgba(12, 206, 107, 0.2); color: var(--accent-green); } +.trigger-unknown { background: var(--bg-tertiary); color: var(--text-muted); } + +.changed-keys { + font-size: 10px; + color: var(--text-muted); + max-width: 120px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-family: var(--font-mono); +} + +.info-section { + padding: 16px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.tips-list { + list-style: disc; + padding-left: 20px; +} + +.tips-list li { + margin-bottom: 6px; + color: var(--text-secondary); +} + +.tips-list code { + font-family: var(--font-mono); + font-size: 11px; + padding: 1px 4px; + background: var(--bg-tertiary); + border-radius: 2px; + color: var(--accent-blue); +} + +.cls-score-section { + margin-bottom: 24px; +} + +.cls-score-card { + padding: 20px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.cls-score-header { + display: flex; + justify-content: space-between; + align-items: baseline; + margin-bottom: 16px; +} + +.cls-label { + font-size: 14px; + color: var(--text-secondary); +} + +.cls-value { + font-size: 32px; + font-weight: 600; +} + +.cls-bar-container { + margin-bottom: 16px; +} + +.cls-bar-bg { + position: relative; + height: 8px; + background: var(--bg-tertiary); + border-radius: 4px; + overflow: visible; +} + +.cls-bar-fill { + height: 100%; + border-radius: 4px; + transition: width 0.3s; +} + +.cls-threshold { + position: absolute; + top: 12px; + font-size: 10px; + color: var(--text-muted); +} + +.cls-threshold::before { + content: ''; + position: absolute; + top: -8px; + left: 50%; + width: 1px; + height: 8px; + background: var(--border-color); +} + +.cls-rating { + display: flex; + align-items: center; + gap: 8px; +} + +.rating-emoji { + font-size: 18px; +} + +.rating-text { + font-size: 12px; + color: var(--text-secondary); +} + +.contributors-table table { + width: 100%; + border-collapse: collapse; +} + +.contributors-table th, +.contributors-table td { + padding: 8px 12px; + text-align: left; + border-bottom: 1px solid var(--border-color); +} + +.contributors-table th { + font-size: 11px; + font-weight: 600; + color: var(--text-secondary); + background: var(--bg-tertiary); +} + +.element-selector code { + font-family: var(--font-mono); + font-size: 11px; + padding: 2px 6px; + background: var(--bg-primary); + border-radius: 2px; +} + +.shift-value { + font-family: var(--font-mono); + font-weight: 600; +} + +.timeline-list { + display: flex; + flex-direction: column; + gap: 4px; + overflow-y: auto; +} + +.timeline-entry { + display: flex; + align-items: center; + gap: 12px; + padding: 6px 12px; + background: var(--bg-secondary); + border-radius: 4px; +} + +.timeline-time { + font-size: 11px; + color: var(--text-muted); + font-family: var(--font-mono); +} + +.timeline-source { + flex: 1; + font-size: 12px; + font-family: var(--font-mono); +} + +.timeline-value { + font-size: 12px; + font-weight: 600; + font-family: var(--font-mono); +} + +.redux-panel .redux-layout { + display: grid; + grid-template-columns: 300px 1fr; + gap: 16px; + margin-bottom: 24px; +} + +.redux-actions-panel, +.redux-state-panel { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; + overflow: hidden; +} + +.redux-actions-panel h3, +.redux-state-panel h3 { + padding: 12px; + background: var(--bg-tertiary); + border-bottom: 1px solid var(--border-color); + margin: 0; +} + +.actions-list { + max-height: 400px; + overflow-y: auto; +} + +.action-item { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + border-bottom: 1px solid var(--border-color); + cursor: pointer; + transition: background 0.2s; +} + +.action-item:hover { + background: var(--bg-hover); +} + +.action-item.selected { + background: rgba(0, 122, 204, 0.2); +} + +.action-time { + font-size: 10px; + color: var(--text-muted); + font-family: var(--font-mono); +} + +.action-type { + font-size: 12px; + font-family: var(--font-mono); + color: var(--accent-blue); +} + +.no-actions, +.no-state { + padding: 24px; + text-align: center; + color: var(--text-muted); +} + +.state-tree { + padding: 12px; + font-family: var(--font-mono); + font-size: 11px; + max-height: 400px; + overflow: auto; + position: relative; +} + +.state-tree-saving { + pointer-events: none; + opacity: 0.6; +} + +.state-saving-overlay { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(var(--bg-primary-rgb, 26, 26, 26), 0.85); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 8px; + z-index: 10; + font-size: 12px; + color: var(--text-secondary); + border-radius: 6px; +} + +.mini-spinner { + width: 20px; + height: 20px; + border: 2px solid var(--border-color); + border-top-color: var(--accent-blue); + border-radius: 50%; + animation: mini-spin 0.8s linear infinite; +} + +@keyframes mini-spin { + to { + transform: rotate(360deg); + } +} + +.saving-indicator { + font-size: 11px; + color: var(--accent-blue); + font-weight: normal; + margin-left: 8px; + animation: pulse-opacity 1s ease-in-out infinite; +} + +@keyframes pulse-opacity { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.5; } +} + +.json-children { + padding-left: 16px; +} + +.json-item { + line-height: 1.8; +} + +.json-key { + color: var(--accent-purple); +} + +.json-string { + color: var(--accent-green); +} + +.json-number { + color: var(--accent-yellow); +} + +.json-boolean { + color: var(--accent-blue); +} + +.json-null, +.json-undefined { + color: var(--text-muted); + font-style: italic; +} + +.bracket { + color: var(--text-secondary); +} + +.collapsed-hint { + color: var(--text-muted); + font-style: italic; + margin: 0 4px; +} + +.expand-btn { + padding: 0 4px; + background: none; + border: none; + color: var(--text-muted); + cursor: pointer; + font-size: 10px; +} + +.dispatch-section { + padding: 16px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.dispatch-form { + display: flex; + flex-direction: column; + gap: 12px; +} + +.form-row { + display: flex; + flex-direction: column; + gap: 4px; +} + +.form-row label { + font-size: 11px; + color: var(--text-secondary); +} + +.form-row input, +.form-row textarea { + padding: 8px 12px; + font-family: var(--font-mono); + font-size: 12px; + background: var(--bg-primary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-primary); +} + +.form-row input:focus, +.form-row textarea:focus { + outline: none; + border-color: var(--accent-blue); +} + +@media (max-width: 768px) { + .redux-panel .redux-layout { + grid-template-columns: 1fr; + } +} + +/* Redux State Editing */ +.state-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 12px; + background: var(--bg-tertiary); + border-bottom: 1px solid var(--border-color); +} + +.state-header h3 { + margin: 0; + padding: 0; + background: none; + border: none; +} + +.state-controls { + display: flex; + gap: 6px; + align-items: center; +} + +.search-input { + padding: 4px 8px; + font-size: 11px; + font-family: var(--font-mono); + background: var(--bg-primary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-primary); + width: 150px; +} + +.search-input:focus { + outline: none; + border-color: var(--accent-blue); +} + +.small-btn { + padding: 4px 8px; + font-size: 12px; + font-weight: 600; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-secondary); + cursor: pointer; + transition: all 0.2s; +} + +.small-btn:hover { + background: var(--bg-hover); + color: var(--text-primary); +} + +.small-btn.danger { + color: var(--accent-red); + border-color: var(--accent-red); +} + +.small-btn.danger:hover { + background: rgba(255, 78, 66, 0.2); +} + +.icon-btn { + padding: 4px 8px; + font-size: 14px; + background: transparent; + border: none; + cursor: pointer; + border-radius: 4px; + transition: background 0.2s; +} + +.icon-btn:hover { + background: var(--bg-hover); +} + +.header-actions { + display: flex; + gap: 8px; +} + +.type-hint { + color: var(--text-muted); + font-size: 10px; + margin-left: 4px; +} + +.editable { + cursor: pointer; + padding: 1px 3px; + border-radius: 2px; + transition: background 0.2s; +} + +.editable:hover { + background: var(--bg-hover); + outline: 1px dashed var(--accent-blue); +} + +.editing-container { + display: inline-flex; + align-items: flex-start; + gap: 6px; + flex-wrap: wrap; +} + +.edit-input { + padding: 4px 8px; + font-size: 11px; + font-family: var(--font-mono); + background: var(--bg-primary); + border: 1px solid var(--accent-blue); + border-radius: 4px; + color: var(--text-primary); + min-width: 100px; +} + +.edit-input.json-edit { + min-width: 250px; + min-height: 80px; + resize: both; +} + +.edit-input:focus { + outline: none; + border-color: var(--accent-blue); + box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2); +} + +.edit-actions { + display: flex; + gap: 4px; +} + +.edit-btn { + padding: 4px 8px; + font-size: 12px; + border: none; + border-radius: 4px; + cursor: pointer; + transition: all 0.2s; +} + +.edit-btn.save { + background: var(--accent-green); + color: white; +} + +.edit-btn.save:hover { + background: #3aa856; +} + +.edit-btn.cancel { + background: var(--bg-tertiary); + color: var(--text-secondary); +} + +.edit-btn.cancel:hover { + background: var(--accent-red); + color: white; +} + +.edit-hint { + font-size: 10px; + color: var(--text-muted); + text-align: center; + padding: 8px; + margin: 0; + border-top: 1px solid var(--border-color); +} + +.array-item-row { + display: flex; + align-items: flex-start; + gap: 4px; +} + +.array-item-row:hover .array-item-actions { + opacity: 1; +} + +.array-item-actions { + display: inline-flex; + gap: 2px; + opacity: 0; + transition: opacity 0.2s; + margin-left: 8px; + flex-shrink: 0; +} + +.array-action-btn { + padding: 0 4px; + font-size: 10px; + line-height: 16px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 3px; + color: var(--text-secondary); + cursor: pointer; + transition: all 0.15s; +} + +.array-action-btn:hover:not(:disabled) { + background: var(--bg-hover); + color: var(--text-primary); + border-color: var(--accent-blue); +} + +.array-action-btn:disabled { + opacity: 0.3; + cursor: not-allowed; +} + +.array-action-btn.delete { + color: var(--accent-red); +} + +.array-action-btn.delete:hover:not(:disabled) { + background: rgba(255, 78, 66, 0.2); + border-color: var(--accent-red); +} + +.action-detail { + padding: 12px; + border-top: 1px solid var(--border-color); + background: var(--bg-tertiary); +} + +.action-detail h4 { + margin: 0 0 8px 0; + font-size: 12px; + color: var(--accent-blue); +} + +.action-payload { + font-size: 11px; +} + +.action-payload strong { + display: block; + color: var(--text-secondary); + margin-bottom: 4px; +} + +.action-payload pre { + margin: 0; + padding: 8px; + background: var(--bg-primary); + border-radius: 4px; + overflow-x: auto; + font-family: var(--font-mono); + font-size: 10px; + max-height: 150px; + overflow-y: auto; +} + +.json-date { + color: var(--accent-yellow); +} + +.json-special { + color: var(--accent-purple); + font-style: italic; +} + +.json-index { + color: var(--text-muted); +} + +.detection-tips { + margin-top: 16px; + padding: 12px; + background: var(--bg-secondary); + border-radius: 8px; + text-align: left; +} + +.detection-tips h4 { + margin: 0 0 8px 0; + font-size: 12px; + color: var(--text-secondary); +} + +.detection-tips ul { + margin: 0; + padding-left: 20px; +} + +.detection-tips li { + font-size: 11px; + color: var(--text-muted); + margin-bottom: 4px; +} + +.dispatch-btn { + padding: 8px 16px; + font-size: 12px; + font-weight: 600; + background: var(--accent-blue); + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + transition: background 0.2s; +} + +.dispatch-btn:hover { + background: #0066b8; +} + +.code-block { + margin: 8px 0 0 0; + padding: 12px; + background: var(--bg-primary); + border: 1px solid var(--border-color); + border-radius: 4px; + font-family: var(--font-mono); + font-size: 11px; + overflow-x: auto; + white-space: pre-wrap; + color: var(--text-secondary); +} + +.section-desc { + font-size: 12px; + color: var(--text-secondary); + margin: 0 0 8px 0; +} + +/* Memory Tab Styles */ +.memory-warnings-container { + min-height: 52px; + margin-bottom: 16px; +} + +.memory-warnings-placeholder { + height: 52px; +} + +.memory-panel .memory-warnings { + display: flex; + flex-direction: column; + gap: 8px; +} + +.memory-warning { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 12px; + background: rgba(255, 78, 66, 0.1); + border: 1px solid rgba(255, 78, 66, 0.3); + border-radius: 6px; + font-size: 12px; + color: var(--accent-red); +} + +.memory-warning .warning-icon { + font-size: 16px; +} + +.memory-bar-container { + margin-bottom: 16px; +} + +.memory-bar-bg { + height: 12px; + background: var(--bg-tertiary); + border-radius: 6px; + overflow: hidden; +} + +.memory-bar-fill { + height: 100%; + border-radius: 6px; + transition: width 0.3s, background 0.3s; +} + +.memory-bar-labels { + display: flex; + justify-content: space-between; + margin-top: 4px; + font-size: 10px; + color: var(--text-muted); +} + +.memory-bar-labels .threshold-70 { + position: absolute; + left: 70%; + color: var(--accent-yellow); +} + +.memory-bar-labels .threshold-90 { + position: absolute; + left: 90%; + color: var(--accent-red); +} + +.growth-rate-display { + display: flex; + flex-direction: column; + gap: 4px; + padding: 12px; + background: var(--bg-secondary); + border-radius: 8px; +} + +.growth-rate-value { + font-size: 24px; + font-weight: 600; + font-family: var(--font-mono); + font-variant-numeric: tabular-nums; + min-width: 140px; + transition: color 0.2s ease; +} + +.growth-rate-hint { + font-size: 12px; + color: var(--text-secondary); +} + +.memory-chart { + display: flex; + gap: 8px; + height: 150px; + padding: 12px; + background: var(--bg-secondary); + border-radius: 8px; +} + +.chart-y-axis { + display: flex; + flex-direction: column; + justify-content: space-between; + font-size: 10px; + color: var(--text-muted); + min-width: 50px; + text-align: right; + padding-right: 8px; +} + +.chart-area { + flex: 1; + background: var(--bg-tertiary); + border-radius: 4px; + overflow: hidden; +} + +.chart-area svg { + width: 100%; + height: 100%; +} + +.chart-legend { + display: flex; + gap: 16px; + margin-top: 8px; + font-size: 11px; + color: var(--text-secondary); +} + +.legend-item { + display: flex; + align-items: center; + gap: 6px; +} + +.legend-color { + width: 12px; + height: 3px; + border-radius: 2px; +} + +.info-banner { + display: flex; + align-items: flex-start; + gap: 8px; + padding: 12px; + margin-bottom: 16px; + background: rgba(0, 122, 204, 0.1); + border: 1px solid rgba(0, 122, 204, 0.3); + border-radius: 6px; + font-size: 12px; + color: var(--text-secondary); + min-height: 48px; +} + +.info-banner strong { + color: var(--accent-blue); +} + +/* Custom Scrollbar */ +::-webkit-scrollbar { + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track { + background: transparent; +} +::-webkit-scrollbar-thumb { + background: rgba(139, 148, 158, 0.25); + border-radius: 3px; +} +::-webkit-scrollbar-thumb:hover { + background: rgba(139, 148, 158, 0.4); +} +::-webkit-scrollbar-corner { + background: transparent; +} + +/* Timeline Tab Styles */ +.timeline-panel { + height: calc(100vh - 105px); + display: flex; + flex-direction: column; +} + +.timeline-filters { + display: flex; + flex-wrap: wrap; + gap: 12px; + margin-bottom: 16px; + align-items: center; +} + +.filter-toggles { + display: flex; + gap: 6px; + flex-wrap: wrap; +} + +.filter-toggle { + display: flex; + align-items: center; + gap: 4px; + padding: 4px 8px; + background: var(--bg-secondary); + border: 2px solid transparent; + border-radius: 4px; + cursor: pointer; + font-size: 11px; + color: var(--text-secondary); + transition: all 0.2s; +} + +.filter-toggle:hover { + background: var(--bg-hover); +} + +.filter-toggle.active { + color: var(--text-primary); + background: var(--bg-tertiary); +} + +.filter-icon { + font-size: 12px; +} + +.filter-label { + font-weight: 500; +} + +.filter-count { + font-size: 10px; + padding: 1px 5px; + background: var(--bg-primary); + border-radius: 10px; + color: var(--text-muted); +} + +.filter-search { + display: flex; + gap: 8px; + align-items: center; + margin-left: auto; +} + +.clear-filters-btn { + padding: 4px 8px; + font-size: 11px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-secondary); + cursor: pointer; +} + +.clear-filters-btn:hover { + background: var(--bg-hover); +} + +.timeline-list { + flex: 1; + min-height: 0; + overflow-y: auto; + display: flex; + flex-direction: column; + gap: 4px; +} + +.timeline-event { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-left-width: 3px; + border-radius: 4px; + transition: all 0.2s; +} + +.timeline-event:hover { + background: var(--bg-tertiary); +} + +.timeline-event.selected { + border-color: var(--accent-blue); + box-shadow: 0 0 0 1px var(--accent-blue); +} + +.timeline-event.correlated { + background: rgba(168, 85, 247, 0.15); + border-color: #a855f7; +} + +.timeline-event.correlated .event-header { + background: rgba(168, 85, 247, 0.1); +} + +.event-header { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + cursor: pointer; +} + +.event-icon { + font-size: 14px; + width: 20px; + text-align: center; +} + +.event-time { + font-family: var(--font-mono); + font-size: 10px; + color: var(--text-muted); + min-width: 80px; +} + +.event-type { + font-family: var(--font-mono); + font-size: 10px; + font-weight: 600; + text-transform: uppercase; + min-width: 55px; +} + +.render-order { + font-family: var(--font-mono); + font-size: 10px; + font-weight: 600; + color: var(--text-muted); + background: var(--bg-tertiary); + padding: 1px 4px; + border-radius: 3px; + margin-right: 4px; +} + +.parent-component { + font-size: 10px; + color: var(--text-muted); + margin-left: 4px; + font-style: italic; +} + +.component-path { + font-family: var(--font-mono); + font-size: 10px; + color: var(--text-muted); + padding: 4px 8px; + background: var(--bg-primary); + border-radius: 4px; + margin-top: 4px; + display: flex; + flex-wrap: wrap; + gap: 2px; + align-items: center; +} + +.component-path .path-separator { + color: var(--text-muted); + margin: 0 2px; +} + +.component-path .path-item { + color: var(--accent-purple); +} + +.component-path .path-item.current { + color: var(--accent-blue); + font-weight: 600; +} + +.event-summary { + display: flex; + align-items: center; + gap: 8px; + flex: 1; + font-size: 12px; + overflow: hidden; +} + +.event-summary strong { + font-family: var(--font-mono); + color: var(--text-primary); +} + +.event-trigger { + font-size: 10px; + padding: 1px 6px; + background: var(--bg-tertiary); + border-radius: 3px; +} + +.event-duration { + font-size: 10px; + color: var(--text-muted); + font-family: var(--font-mono); +} + +.event-source { + font-size: 10px; + padding: 1px 6px; + background: rgba(168, 85, 247, 0.2); + color: #a855f7; + border-radius: 3px; +} + +.event-effect-type { + font-size: 10px; + padding: 1px 6px; + background: rgba(255, 164, 0, 0.2); + color: var(--accent-yellow); + border-radius: 3px; +} + +.event-effect-type.run { + background: rgba(12, 206, 107, 0.2); + color: var(--accent-green); +} + +.event-effect-type.cleanup { + background: rgba(255, 78, 66, 0.2); + color: var(--accent-red); +} + +.effect-index { + font-family: var(--font-mono); + font-size: 10px; + color: var(--text-muted); + background: var(--bg-tertiary); + padding: 1px 4px; + border-radius: 3px; +} + +.effect-deps { + font-size: 10px; + color: var(--text-muted); + font-family: var(--font-mono); + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.effect-hint { + font-size: 10px; + color: var(--accent-purple); + background: rgba(157, 121, 215, 0.15); + padding: 1px 6px; + border-radius: 3px; + font-family: var(--font-mono); + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.effect-cleanup-badge { + font-size: 9px; + padding: 1px 4px; + background: rgba(0, 122, 204, 0.2); + color: var(--accent-blue); + border-radius: 3px; +} + +.hook-index { + font-family: var(--font-mono); + font-size: 10px; + color: var(--text-muted); + background: var(--bg-tertiary); + padding: 1px 4px; + border-radius: 3px; +} + +.state-change-value { + font-family: var(--font-mono); + font-size: 10px; + color: var(--accent-purple); + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.action-type { + font-size: 10px; + padding: 1px 6px; + background: rgba(157, 121, 215, 0.2); + color: var(--accent-purple); + border-radius: 3px; +} + +.event-error { + color: var(--accent-red); +} + +.error-type { + font-size: 10px; + padding: 1px 6px; + background: rgba(255, 78, 66, 0.2); + border-radius: 3px; +} + +.error-message { + opacity: 0.8; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.memory-spike { + font-size: 9px; + padding: 1px 6px; + background: var(--accent-red); + color: white; + border-radius: 3px; + font-weight: 600; +} + +.event-expand { + font-size: 10px; + color: var(--text-muted); + transition: transform 0.2s; +} + +.timeline-event.expanded .event-expand { + transform: rotate(0deg); +} + +.event-details { + padding: 12px; + border-top: 1px solid var(--border-color); + background: var(--bg-tertiary); + font-size: 12px; +} + +.detail-row { + margin-bottom: 6px; +} + +.detail-row strong { + color: var(--text-secondary); + margin-right: 8px; +} + +.detail-row.warning { + color: var(--accent-yellow); + font-weight: 600; +} + +.fiber-depth { + font-family: var(--font-mono); + font-size: 8px; + color: var(--text-muted); + letter-spacing: 1px; + margin-right: 2px; +} + +.render-reason-summary { + font-size: 10px; + color: var(--accent-purple); + background: rgba(157, 121, 215, 0.1); + padding: 1px 6px; + border-radius: 3px; + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.render-reason-box { + background: rgba(0, 122, 204, 0.1); + padding: 8px; + border-radius: 4px; + border-left: 3px solid var(--accent-blue); + margin: 8px 0; +} + +.changes-list { + margin-top: 6px; + padding: 8px; + background: var(--bg-primary); + border-radius: 4px; +} + +.change-item { + display: flex; + align-items: center; + gap: 6px; + font-family: var(--font-mono); + font-size: 11px; + padding: 3px 0; + border-bottom: 1px solid var(--border-color); +} + +.change-item:last-child { + border-bottom: none; +} + +.change-key { + color: var(--accent-purple); + font-weight: 500; + min-width: 80px; +} + +.change-old { + color: var(--accent-red); + background: rgba(255, 78, 66, 0.1); + padding: 1px 4px; + border-radius: 2px; + max-width: 120px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.change-arrow { + color: var(--text-muted); +} + +.change-new { + color: var(--accent-green); + background: rgba(12, 206, 107, 0.1); + padding: 1px 4px; + border-radius: 2px; + max-width: 120px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.state-name { + font-family: var(--font-mono); + font-size: 10px; + color: var(--accent-blue); + background: rgba(0, 122, 204, 0.15); + padding: 1px 6px; + border-radius: 3px; + font-weight: 500; +} + +.context-type { + font-size: 10px; + padding: 1px 6px; + background: rgba(249, 115, 22, 0.2); + color: #f97316; + border-radius: 3px; +} + +.context-changed-keys { + font-family: var(--font-mono); + font-size: 10px; + color: var(--text-muted); + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.error-stack { + margin-top: 8px; + padding: 8px; + background: var(--bg-primary); + border-radius: 4px; + font-family: var(--font-mono); + font-size: 10px; + overflow-x: auto; + white-space: pre-wrap; + max-height: 200px; + overflow-y: auto; +} + +.event-count { + font-size: 12px; + color: var(--text-muted); +} + +.tab-header-actions { + display: flex; + align-items: center; + gap: 12px; +} + +.clear-all-btn { + padding: 4px 10px; + font-size: 11px; + background: var(--accent-red); + border: none; + border-radius: 4px; + color: white; + cursor: pointer; + font-weight: 500; + transition: all 0.2s; +} + +.clear-all-btn:hover { + background: #e63939; + transform: translateY(-1px); +} + +/* Correlation Panel */ +.correlation-panel { + margin-top: 12px; + padding: 10px; + background: rgba(168, 85, 247, 0.1); + border: 1px solid rgba(168, 85, 247, 0.3); + border-radius: 6px; +} + +.correlation-panel strong { + display: block; + font-size: 11px; + color: #a855f7; + margin-bottom: 8px; +} + +.correlation-list { + margin: 0; + padding-left: 20px; + font-size: 11px; + color: var(--text-secondary); +} + +.correlation-list li { + margin-bottom: 4px; +} + +.correlation-hint { + margin: 8px 0 0 0; + font-size: 10px; + color: var(--text-muted); + font-style: italic; +} + +/* Redux Setup Guide */ +.redux-setup-guide { + padding: 16px; + margin-top: 16px; +} + +.redux-setup-guide h3 { + font-size: 14px; + margin-bottom: 12px; + color: var(--text-primary); +} + +.setup-intro { + font-size: 12px; + color: var(--text-secondary); + margin-bottom: 16px; +} + +.setup-method { + margin-bottom: 16px; + padding: 12px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 6px; +} + +.setup-method h4 { + font-size: 12px; + color: var(--accent-blue); + margin-bottom: 8px; +} + +.method-desc { + font-size: 11px; + color: var(--text-secondary); +} + +.code-snippet { + margin: 0; + padding: 12px; + background: var(--bg-primary); + border-radius: 4px; + font-family: var(--font-mono); + font-size: 11px; + line-height: 1.5; + overflow-x: auto; + white-space: pre; + color: var(--text-secondary); +} + +.detection-status { + margin-top: 16px; + padding: 12px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 6px; +} + +.detection-status h4 { + font-size: 12px; + color: var(--text-secondary); + margin-bottom: 8px; +} + +.detection-checklist { + list-style: none; + padding: 0; + margin: 0; +} + +.detection-checklist li { + display: flex; + align-items: center; + gap: 8px; + font-size: 11px; + color: var(--text-muted); + padding: 4px 0; +} + +.check-icon { + font-size: 12px; + color: var(--accent-red); +} + +/* Snapshot Panel Styles */ +.snapshot-panel { + margin-bottom: 16px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 6px; + overflow: hidden; +} + +.snapshot-header { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 12px; + background: var(--bg-tertiary); + cursor: pointer; + user-select: none; +} + +.snapshot-header:hover { + background: var(--bg-hover); +} + +.snapshot-toggle { + font-size: 10px; + color: var(--text-muted); + width: 12px; +} + +.snapshot-title { + font-size: 12px; + font-weight: 600; + color: var(--text-primary); + flex: 1; +} + +.snapshot-create-btn { + padding: 4px 10px; + font-size: 11px; + font-weight: 500; + background: var(--accent-blue); + border: none; + border-radius: 4px; + color: white; + cursor: pointer; + transition: opacity 0.2s; +} + +.snapshot-create-btn:hover:not(:disabled) { + opacity: 0.9; +} + +.snapshot-create-btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.snapshot-content { + padding: 12px; +} + +.snapshot-empty { + font-size: 12px; + color: var(--text-muted); + text-align: center; + padding: 12px; +} + +.snapshot-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.snapshot-item { + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 4px; + overflow: hidden; +} + +.snapshot-item:hover { + border-color: var(--accent-blue); +} + +.snapshot-item.expanded { + border-color: var(--accent-blue); +} + +.snapshot-item-header { + display: flex; + align-items: center; + gap: 12px; + padding: 8px 12px; + cursor: pointer; +} + +.snapshot-time { + font-family: var(--font-mono); + font-size: 11px; + color: var(--text-secondary); +} + +.snapshot-count { + font-size: 11px; + color: var(--text-muted); + flex: 1; +} + +.snapshot-actions { + display: flex; + gap: 6px; +} + +.snapshot-action-btn { + padding: 3px 8px; + font-size: 10px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 3px; + color: var(--text-secondary); + cursor: pointer; + transition: all 0.2s; +} + +.snapshot-action-btn:hover { + background: var(--bg-hover); + color: var(--text-primary); +} + +.snapshot-action-btn.delete { + color: var(--accent-red); +} + +.snapshot-action-btn.delete:hover { + background: rgba(255, 78, 66, 0.2); + border-color: var(--accent-red); +} + +.snapshot-details { + padding: 12px; + border-top: 1px solid var(--border-color); + background: var(--bg-primary); + max-height: 300px; + overflow-y: auto; +} + +.snapshot-table { + width: 100%; + border-collapse: collapse; + font-size: 11px; +} + +.snapshot-table th, +.snapshot-table td { + padding: 6px 10px; + text-align: left; + border-bottom: 1px solid var(--border-color); +} + +.snapshot-table th { + font-weight: 600; + color: var(--text-secondary); + background: var(--bg-secondary); + position: sticky; + top: 0; +} + +.snapshot-table td { + color: var(--text-primary); +} + +.snapshot-table .component-name { + font-family: var(--font-mono); +} + +.snapshot-table .trigger-badge { + display: inline-block; + padding: 2px 6px; + font-size: 10px; + background: var(--bg-tertiary); + border-radius: 3px; + color: var(--text-secondary); +} + +/* ============================================ + AI Analysis Tab Styles + ============================================ */ + +.ai-panel { + display: flex; + flex-direction: column; + gap: 12px; +} + +/* Status Bar */ +.ai-status-bar { + display: flex; + gap: 16px; + padding: 8px 12px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 6px; + font-size: 11px; + color: var(--text-secondary); + flex-wrap: wrap; +} + +.ai-status-item { + display: flex; + align-items: center; + gap: 4px; + white-space: nowrap; +} + +/* Action Bar */ +.ai-action-bar { + display: flex; + align-items: center; + gap: 12px; +} + +.ai-rate-warning { + font-size: 11px; + color: var(--accent-yellow); +} + +/* Buttons */ +.ai-btn { + padding: 8px 16px; + font-size: 12px; + font-weight: 600; + border: 1px solid var(--border-color); + border-radius: 6px; + cursor: pointer; + transition: all 0.2s; + white-space: nowrap; +} + +.ai-btn:disabled { + opacity: 0.4; + cursor: not-allowed; +} + +.ai-btn-primary { + background: var(--accent-blue); + border-color: var(--accent-blue); + color: white; +} + +.ai-btn-primary:hover:not(:disabled) { + background: #0066b8; +} + +.ai-btn-secondary { + background: var(--bg-tertiary); + color: var(--text-primary); +} + +.ai-btn-secondary:hover:not(:disabled) { + background: var(--bg-hover); +} + +.ai-btn-cancel { + background: var(--accent-red); + border-color: var(--accent-red); + color: white; +} + +.ai-btn-cancel:hover { + background: #e63939; +} + +.ai-analyze-btn { + font-size: 13px; + padding: 10px 20px; +} + +/* Settings Button */ +.ai-settings-btn { + padding: 4px 8px; + background: none; + border: none; + cursor: pointer; + font-size: 16px; + border-radius: 4px; + transition: background 0.2s; +} + +.ai-settings-btn:hover { + background: var(--bg-hover); +} + +/* Settings Panel */ +.ai-settings-panel { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; + overflow: hidden; +} + +.ai-settings-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 12px; + background: var(--bg-tertiary); + border-bottom: 1px solid var(--border-color); +} + +.ai-settings-header h3 { + font-size: 13px; + font-weight: 600; + margin: 0; +} + +.ai-settings-close { + padding: 2px 6px; + background: none; + border: none; + color: var(--text-secondary); + cursor: pointer; + font-size: 14px; + border-radius: 4px; + transition: background 0.2s; +} + +.ai-settings-close:hover { + background: var(--bg-hover); + color: var(--text-primary); +} + +.ai-settings-body { + padding: 12px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.ai-settings-field { + display: flex; + flex-direction: column; + gap: 4px; +} + +.ai-settings-field span { + font-size: 11px; + font-weight: 600; + color: var(--text-secondary); +} + +.ai-settings-field input, +.ai-settings-field select { + padding: 8px 10px; + font-size: 12px; + font-family: var(--font-mono); + background: var(--bg-primary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-primary); + transition: border-color 0.2s; +} + +.ai-settings-field input:focus, +.ai-settings-field select:focus { + outline: none; + border-color: var(--accent-blue); +} + +.ai-settings-field select { + cursor: pointer; +} + +.ai-settings-actions { + display: flex; + justify-content: flex-end; + gap: 8px; + padding-top: 4px; +} + +.ai-settings-contact { + padding: 10px 0 4px; + border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06)); + margin-top: 4px; + text-align: center; +} + +.ai-settings-contact p { + font-size: 11px; + color: var(--text-secondary); + margin: 0 0 6px; +} + +.ai-settings-contact-link { + display: inline-block; + font-size: 12px; + font-weight: 500; + color: var(--accent-blue, #58a6ff); + text-decoration: none; + padding: 4px 10px; + border-radius: var(--radius-sm, 4px); + background: rgba(88, 166, 255, 0.08); + transition: background 0.15s ease, color 0.15s ease; +} + +.ai-settings-contact-link:hover { + background: rgba(88, 166, 255, 0.16); + color: #79bbff; +} + +.ai-key-input-row { + display: flex; + gap: 6px; +} + +.ai-key-input-row input { + flex: 1; +} + +.ai-key-hint { + font-size: 10px; + color: var(--text-muted); + margin-top: 2px; +} + +.ai-key-status { + font-size: 9px; + font-weight: 600; + padding: 1px 6px; + border-radius: 3px; + margin-left: 6px; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.ai-key-status--valid { + background: rgba(63, 185, 80, 0.15); + color: var(--accent-green); +} + +.ai-key-status--invalid { + background: rgba(248, 81, 73, 0.15); + color: var(--accent-red); +} + +.ai-btn-small { + padding: 4px 10px; + font-size: 11px; + font-weight: 500; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-primary); + cursor: pointer; + transition: background 0.15s; + white-space: nowrap; +} + +.ai-btn-small:hover { + background: var(--bg-hover); +} + +.ai-btn-small:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.ai-pro-badge { + font-size: 9px; + font-weight: 700; + padding: 2px 8px; + border-radius: 4px; + background: linear-gradient(135deg, rgba(88, 166, 255, 0.2), rgba(188, 140, 255, 0.2)); + color: var(--accent-blue); + border: 1px solid rgba(88, 166, 255, 0.3); + letter-spacing: 1px; +} + +.ai-paywall { + display: flex; + flex-direction: column; + align-items: center; + padding: 32px 20px; + text-align: center; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: var(--radius-md, 8px); +} + +.ai-paywall h3 { + font-size: 15px; + font-weight: 600; + margin: 0 0 8px; + color: var(--text-primary); +} + +.ai-paywall p { + font-size: 12px; + color: var(--text-secondary); + margin: 0 0 4px; + max-width: 320px; +} + +.ai-paywall-unlock { + color: var(--text-muted) !important; + font-size: 11px !important; + margin-bottom: 16px !important; +} + +.ai-paywall-actions { + display: flex; + gap: 10px; + margin-top: 4px; +} + +.ai-btn-link { + text-decoration: none; + display: inline-flex; + align-items: center; +} + +.empty-state-icon--lock { + background: rgba(255, 164, 0, 0.12); + border: 2px solid rgba(255, 164, 0, 0.4); +} + +.empty-state-icon--lock::before { + width: 10px; + height: 10px; + border: 2.5px solid var(--accent-yellow); + border-radius: 3px; + background: none; +} + +/* Loading */ +.ai-loading { + display: flex; + flex-direction: column; + align-items: center; + padding: 32px 16px; + gap: 12px; + text-align: center; +} + +.ai-loading p { + font-size: 13px; + color: var(--text-primary); + margin: 0; +} + +.ai-loading-hint { + font-size: 11px !important; + color: var(--text-muted) !important; +} + +.ai-loading-spinner { + width: 32px; + height: 32px; + border: 3px solid var(--border-color); + border-top-color: var(--accent-blue); + border-radius: 50%; + animation: spin 1s linear infinite; +} + +/* Error */ +.ai-error { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 12px; + background: rgba(255, 78, 66, 0.1); + border: 1px solid rgba(255, 78, 66, 0.3); + border-radius: 6px; + font-size: 12px; +} + +.ai-error-icon { + font-size: 14px; + flex-shrink: 0; +} + +.ai-error-msg { + color: var(--accent-red); +} + +/* Results */ +.ai-results { + display: flex; + flex-direction: column; + gap: 16px; +} + +/* Summary */ +.ai-summary { + padding: 14px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.ai-summary-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 8px; +} + +.ai-summary-header h3 { + font-size: 14px; + font-weight: 600; + margin: 0; +} + +.ai-summary-meta { + display: flex; + gap: 10px; + font-size: 10px; + color: var(--text-muted); + font-family: var(--font-mono); +} + +.ai-summary-text { + font-size: 12px; + color: var(--text-secondary); + line-height: 1.6; + margin: 0; +} + +/* Sections */ +.ai-section { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; + overflow: hidden; +} + +.ai-section-title { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 14px; + font-size: 13px; + font-weight: 600; + margin: 0; + background: var(--bg-tertiary); + border-bottom: 1px solid var(--border-color); +} + +.ai-section-badges { + display: flex; + gap: 6px; +} + +.ai-badge { + font-size: 10px; + font-weight: 600; + padding: 2px 8px; + border-radius: 10px; + background: var(--bg-primary); + color: var(--text-muted); +} + +.ai-badge-critical { + background: rgba(255, 68, 68, 0.2); + color: #ff4444; +} + +.ai-badge-warning { + background: rgba(255, 170, 0, 0.2); + color: #ffaa00; +} + +/* Item Cards */ +.ai-items-list { + display: flex; + flex-direction: column; +} + +.ai-item-card { + padding: 10px 14px; + border-left: 3px solid transparent; + border-bottom: 1px solid var(--border-color); + cursor: pointer; + transition: background 0.15s; +} + +.ai-item-card:last-child { + border-bottom: none; +} + +.ai-item-card:hover { + background: var(--bg-hover) !important; +} + +.ai-item-header { + display: flex; + align-items: center; + gap: 8px; +} + +.ai-item-icon { + font-size: 12px; + flex-shrink: 0; +} + +.ai-item-title { + flex: 1; + font-size: 12px; + font-weight: 500; + color: var(--text-primary); +} + +.ai-item-severity { + font-size: 9px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.ai-item-expand { + font-size: 9px; + color: var(--text-muted); + margin-left: 4px; +} + +.ai-item-body { + margin-top: 8px; + padding-top: 8px; + border-top: 1px solid var(--border-color); + font-size: 12px; + line-height: 1.6; +} + +.ai-item-desc { + color: var(--text-secondary); + margin: 0 0 6px 0; +} + +.ai-item-suggestion { + padding: 6px 8px; + background: rgba(12, 206, 107, 0.08); + border-radius: 4px; + font-size: 11px; + color: var(--text-secondary); + margin-bottom: 6px; +} + +.ai-item-suggestion strong { + color: var(--accent-green); + margin-right: 4px; +} + +.ai-item-components { + font-size: 11px; + color: var(--text-muted); +} + +.ai-item-components strong { + color: var(--text-secondary); + margin-right: 4px; +} + +/* Disclaimer */ +.ai-disclaimer { + padding: 10px 12px; + font-size: 11px; + color: var(--text-muted); + background: rgba(255, 164, 0, 0.06); + border: 1px solid rgba(255, 164, 0, 0.15); + border-radius: 6px; + text-align: center; +} + +/* ============================================ + Badge & Indicator System (Emoji Replacement) + ============================================ */ + +/* --- Indicator Dots (severity markers) --- */ +.indicator-dot { + display: inline-block; + width: 8px; + height: 8px; + border-radius: 50%; + flex-shrink: 0; + vertical-align: middle; +} +.indicator-dot--error { + background: var(--accent-red); +} +.indicator-dot--warning { + background: var(--accent-yellow); +} +.indicator-dot--info { + background: var(--accent-blue); +} +.indicator-dot--success { + background: var(--accent-green); +} +.indicator-dot--critical { + background: var(--accent-red); + box-shadow: 0 0 6px rgba(255, 78, 66, 0.5); +} + +/* --- Section Header Badges (tab/section labels) --- */ +.section-badge { + display: inline-block; + width: 4px; + height: 16px; + border-radius: 2px; + margin-right: 8px; + vertical-align: middle; +} +.section-badge--timeline { + background: var(--accent-blue); +} +.section-badge--ui-state { + background: var(--accent-purple); +} +.section-badge--performance { + background: var(--accent-yellow); +} +.section-badge--memory { + background: var(--accent-green); +} +.section-badge--side-effects { + background: var(--accent-blue); +} +.section-badge--cls { + background: var(--accent-yellow); +} +.section-badge--redux { + background: var(--accent-purple); +} +.section-badge--ai { + background: var(--accent-blue); +} +.section-badge--security { + background: var(--accent-green); +} + +/* --- Event Type Indicators (timeline events) --- */ +.event-type-indicator { + display: inline-block; + width: 8px; + height: 8px; + border-radius: 50%; + flex-shrink: 0; + vertical-align: middle; +} +.event-type-indicator--render { + background: var(--accent-blue); +} +.event-type-indicator--state { + background: #a855f7; +} +.event-type-indicator--effect { + background: var(--accent-yellow); +} +.event-type-indicator--error { + background: var(--accent-red); +} +.event-type-indicator--memory { + background: var(--accent-green); +} +.event-type-indicator--context { + background: #f97316; +} + +/* --- Status Badges (rating indicators) --- */ +.status-badge { + display: inline-block; + width: 10px; + height: 10px; + border-radius: 50%; + vertical-align: middle; + flex-shrink: 0; +} +.status-badge--good { + background: var(--accent-green); +} +.status-badge--warning { + background: var(--accent-yellow); +} +.status-badge--poor { + background: var(--accent-red); +} +.status-badge--neutral { + background: var(--text-muted); +} + +/* --- Action Badges (inline icon-like elements) --- */ +.action-badge { + display: inline-flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + border-radius: 4px; + margin-right: 4px; + vertical-align: middle; + flex-shrink: 0; +} +.action-badge::before { + content: ''; + display: block; +} +.action-badge--suggestion { + background: rgba(12, 206, 107, 0.15); +} +.action-badge--suggestion::before { + width: 8px; + height: 8px; + background: var(--accent-green); + border-radius: 50%; +} +.action-badge--learn { + background: rgba(0, 122, 204, 0.15); +} +.action-badge--learn::before { + width: 8px; + height: 6px; + background: var(--accent-blue); + border-radius: 1px; +} +.action-badge--search { + background: rgba(0, 122, 204, 0.15); +} +.action-badge--search::before { + width: 6px; + height: 6px; + border: 2px solid var(--accent-blue); + border-radius: 50%; + background: transparent; +} +.action-badge--settings { + background: rgba(140, 140, 140, 0.15); +} +.action-badge--settings::before { + width: 8px; + height: 8px; + border: 2px solid var(--text-secondary); + border-radius: 50%; + background: transparent; +} +.action-badge--scan { + background: rgba(0, 122, 204, 0.15); +} +.action-badge--scan::before { + width: 6px; + height: 6px; + border: 2px solid var(--accent-blue); + border-radius: 50%; + background: transparent; +} +.action-badge--analyze { + background: rgba(0, 122, 204, 0.15); +} +.action-badge--analyze::before { + width: 6px; + height: 6px; + border: 2px solid var(--accent-blue); + border-radius: 50%; + background: transparent; +} +.action-badge--cancel { + background: rgba(255, 78, 66, 0.15); +} +.action-badge--cancel::before { + width: 6px; + height: 6px; + background: var(--accent-red); + border-radius: 1px; +} +.action-badge--play { + background: rgba(12, 206, 107, 0.15); +} +.action-badge--play::before { + width: 0; + height: 0; + border-left: 6px solid var(--accent-green); + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + background: none; +} +.action-badge--stop { + background: rgba(255, 78, 66, 0.15); +} +.action-badge--stop::before { + width: 6px; + height: 6px; + background: var(--accent-red); + border-radius: 1px; +} +.action-badge--refresh { + background: rgba(0, 122, 204, 0.15); +} +.action-badge--refresh::before { + width: 6px; + height: 6px; + border: 2px solid var(--accent-blue); + border-radius: 50%; + border-bottom-color: transparent; + background: none; +} + +/* --- AI Status Icons --- */ +.ai-status-icon { + display: inline-block; + width: 12px; + height: 12px; + margin-right: 4px; + vertical-align: middle; + border-radius: 3px; +} +.ai-status-icon--chart { + background: rgba(0, 122, 204, 0.25); + border: 1px solid var(--accent-blue); +} +.ai-status-icon--cache { + background: rgba(12, 206, 107, 0.25); + border: 1px solid var(--accent-green); +} +.ai-status-icon--tokens { + background: rgba(255, 164, 0, 0.25); + border: 1px solid var(--accent-yellow); +} +.ai-status-icon--model { + background: rgba(157, 121, 215, 0.25); + border: 1px solid var(--accent-purple); +} + +/* --- Empty State Icons (large centered) --- */ +.empty-state-icon { + display: flex; + align-items: center; + justify-content: center; + width: 48px; + height: 48px; + border-radius: 50%; + margin: 0 auto 16px; +} +.empty-state-icon::before { + content: ''; + display: block; +} +.empty-state-icon--check { + background: rgba(12, 206, 107, 0.12); + border: 2px solid rgba(12, 206, 107, 0.4); +} +.empty-state-icon--check::before { + width: 14px; + height: 8px; + border-left: 2.5px solid var(--accent-green); + border-bottom: 2.5px solid var(--accent-green); + transform: rotate(-45deg) translateY(-2px); + background: none; +} +.empty-state-icon--chart { + background: rgba(0, 122, 204, 0.12); + border: 2px solid rgba(0, 122, 204, 0.4); +} +.empty-state-icon--chart::before { + width: 16px; + height: 16px; + border-left: 2.5px solid var(--accent-blue); + border-bottom: 2.5px solid var(--accent-blue); + background: none; +} +.empty-state-icon--timer { + background: rgba(0, 122, 204, 0.12); + border: 2px solid rgba(0, 122, 204, 0.4); +} +.empty-state-icon--timer::before { + width: 14px; + height: 14px; + border: 2.5px solid var(--accent-blue); + border-radius: 50%; + background: none; +} +.empty-state-icon--robot { + background: rgba(0, 122, 204, 0.12); + border: 2px solid rgba(0, 122, 204, 0.4); +} +.empty-state-icon--robot::before { + width: 16px; + height: 12px; + border: 2.5px solid var(--accent-blue); + border-radius: 4px; + background: none; +} +.empty-state-icon--redux { + background: rgba(157, 121, 215, 0.12); + border: 2px solid rgba(157, 121, 215, 0.4); +} +.empty-state-icon--redux::before { + width: 14px; + height: 12px; + border: 2.5px solid var(--accent-purple); + border-radius: 3px; + background: none; +} +.empty-state-icon--memory { + background: rgba(12, 206, 107, 0.12); + border: 2px solid rgba(12, 206, 107, 0.4); +} +.empty-state-icon--memory::before { + width: 14px; + height: 14px; + border: 2.5px solid var(--accent-green); + border-radius: 50%; + background: none; +} +.empty-state-icon--react { + background: rgba(0, 122, 204, 0.12); + border: 2px solid rgba(0, 122, 204, 0.4); +} +.empty-state-icon--react::before { + width: 10px; + height: 10px; + background: var(--accent-blue); + border-radius: 50%; +} + +/* --- Disclaimer Badge --- */ +.disclaimer-badge { + display: inline-flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + border-radius: 50%; + background: rgba(255, 164, 0, 0.15); + border: 1.5px solid var(--accent-yellow); + margin-right: 6px; + vertical-align: middle; + flex-shrink: 0; +} +.disclaimer-badge::before { + content: ''; + display: block; + width: 2px; + height: 8px; + background: var(--accent-yellow); + border-radius: 1px; +} diff --git a/scripts/bench-mcp-latency.mjs b/scripts/bench-mcp-latency.mjs new file mode 100644 index 0000000..9bdeec0 --- /dev/null +++ b/scripts/bench-mcp-latency.mjs @@ -0,0 +1,234 @@ +// scripts/bench-mcp-latency.mjs +// Cross-platform MCP tool latency benchmark +// Usage: node scripts/bench-mcp-latency.mjs [--runs 50] + +import { spawn } from "node:child_process"; +import { writeFileSync, mkdirSync } from "node:fs"; +import { platform, release, version } from "node:os"; +import { execSync } from "node:child_process"; + +const RUNS = parseInt(process.argv[process.argv.indexOf("--runs") + 1] || "50"); + +function getNodeVersion() { + return process.version; +} + +function getChromeVersion() { + try { + if (platform() === "win32") { + const out = execSync( + `reg query "HKEY_CURRENT_USER\\Software\\Google\\Chrome\\BLBeacon" /v version`, + { encoding: "utf8" } + ); + return out.match(/version\s+REG_SZ\s+([\d.]+)/)?.[1] ?? "unknown"; + } else if (platform() === "linux") { + return execSync( + "google-chrome --version 2>/dev/null || chromium-browser --version 2>/dev/null", + { encoding: "utf8" } + ).trim(); + } + return "unknown"; + } catch { + return "unknown"; + } +} + +function percentile(sorted, p) { + if (!sorted.length) return null; + const idx = Math.ceil((p / 100) * sorted.length) - 1; + return sorted[Math.max(0, idx)]; +} + +// Resolve the CLI binary path once — avoids repeated npx resolution overhead +function resolveBin() { + try { + const lines = execSync("where react-debugger", { encoding: "utf8" }) + .trim() + .split("\n") + .map(l => l.trim()); + + // On Windows, prefer the .cmd file — the plain binary won't spawn without shell + const cmdBin = lines.find(l => l.endsWith(".cmd")); + const bin = cmdBin || lines[0]; + + if (bin) return { cmd: bin, args: ["mcp"], useShell: false }; + } catch { /* not globally installed */ } + + return { cmd: "npx", args: ["@nhonh/react-debugger", "mcp"], useShell: true }; +} + +const BIN = resolveBin(); +console.log(`\n🔧 Using binary: ${BIN.cmd} ${BIN.args.join(" ")}\n`); + +async function measureRound() { + return new Promise((resolve, reject) => { + const start = performance.now(); + + const child = spawn(BIN.cmd, BIN.args, { + stdio: ["pipe", "pipe", "pipe"], + shell: BIN.useShell, + }); + + let stdout = ""; + let responded = false; + + // Collect stdout — resolve as soon as ANY data comes back + child.stdout.on("data", (chunk) => { + stdout += chunk.toString(); + if (!responded) { + responded = true; + const elapsed = performance.now() - start; + child.kill("SIGTERM"); + resolve(elapsed); + } + }); + + child.stderr.on("data", () => {}); // suppress stderr noise + + // Send initialize handshake — standard MCP protocol first message + const initMsg = JSON.stringify({ + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: "2024-11-05", + capabilities: {}, + clientInfo: { name: "bench", version: "0.0.1" }, + }, + }) + "\n"; + + child.stdin.write(initMsg); + + child.on("error", (err) => { + if (!responded) reject(err); + }); + + child.on("close", (code) => { + if (!responded) { + reject(new Error(`Process exited with code ${code} without responding`)); + } + }); + + // 15s timeout — generous for cold npx starts + setTimeout(() => { + if (!responded) { + child.kill("SIGTERM"); + reject(new Error("Timeout after 15000ms")); + } + }, 15000); + }); +} + +async function runBenchmark() { + console.log(`Running ${RUNS} cold measurements on ${platform()}...\n`); + + const coldSamples = []; + const warmSamples = []; + + // ---- cold runs ---- + for (let i = 0; i < RUNS; i++) { + process.stdout.write(`\r cold [${i + 1}/${RUNS}]`); + try { + const ms = await measureRound(); + coldSamples.push(parseFloat(ms.toFixed(2))); + } catch (e) { + console.warn(`\n ⚠ cold run ${i + 1} failed: ${e.message}`); + } + } + + console.log("\n"); + console.log(`Running ${RUNS} warm measurements...\n`); + + // ---- warm runs ---- + for (let i = 0; i < RUNS; i++) { + process.stdout.write(`\r warm [${i + 1}/${RUNS}]`); + try { + const ms = await measureRound(); + warmSamples.push(parseFloat(ms.toFixed(2))); + } catch (e) { + console.warn(`\n ⚠ warm run ${i + 1} failed: ${e.message}`); + } + } + + console.log("\n"); + + const coldSorted = [...coldSamples].sort((a, b) => a - b); + const warmSorted = [...warmSamples].sort((a, b) => a - b); + + const result = { + meta: { + generated_at: new Date().toISOString(), + node_version: getNodeVersion(), + chrome_version: getChromeVersion(), + os: platform(), + os_release: release(), + os_version: version(), + runs_attempted: RUNS, + runs_cold_succeeded: coldSamples.length, + runs_warm_succeeded: warmSamples.length, + network_conditions: "loopback/localhost", + binary_used: `${BIN.cmd} ${BIN.args.join(" ")}`, + }, + cold: coldSamples.length ? { + samples_ms: coldSamples, + p50_ms: percentile(coldSorted, 50), + p95_ms: percentile(coldSorted, 95), + p99_ms: percentile(coldSorted, 99), + min_ms: coldSorted[0], + max_ms: coldSorted[coldSorted.length - 1], + mean_ms: parseFloat( + (coldSamples.reduce((a, b) => a + b, 0) / coldSamples.length).toFixed(2) + ), + target_ms: 1000, + passed: percentile(coldSorted, 95) < 1000, + } : { error: "all runs failed", passed: false }, + + warm: warmSamples.length ? { + samples_ms: warmSamples, + p50_ms: percentile(warmSorted, 50), + p95_ms: percentile(warmSorted, 95), + p99_ms: percentile(warmSorted, 99), + min_ms: warmSorted[0], + max_ms: warmSorted[warmSorted.length - 1], + mean_ms: parseFloat( + (warmSamples.reduce((a, b) => a + b, 0) / warmSamples.length).toFixed(2) + ), + target_ms: 500, + passed: percentile(warmSorted, 95) < 500, + } : { error: "all runs failed", passed: false }, + + issues: [], + }; + + // flag p95 failures + if (result.cold.p95_ms && !result.cold.passed) { + result.issues.push(`cold p95 (${result.cold.p95_ms.toFixed(1)}ms) exceeds 1000ms target`); + } + if (result.warm.p95_ms && !result.warm.passed) { + result.issues.push(`warm p95 (${result.warm.p95_ms.toFixed(1)}ms) exceeds 500ms target`); + } + + mkdirSync("evidence", { recursive: true }); + + const osTag = platform() === "win32" ? "windows" : platform(); + const outPath = `evidence/phase0-latency-${osTag}.json`; + writeFileSync(outPath, JSON.stringify(result, null, 2)); + + console.log(`✅ Results written to ${outPath}`); + if (result.cold.p95_ms != null) { + console.log(` cold p95: ${result.cold.p95_ms.toFixed(1)}ms (target <1000ms) ${result.cold.passed ? "✅" : "❌"}`); + } + if (result.warm.p95_ms != null) { + console.log(` warm p95: ${result.warm.p95_ms.toFixed(1)}ms (target <500ms) ${result.warm.passed ? "✅" : "❌"}`); + } + + if (result.issues.length) { + console.log("\n⚠ Issues found:"); + result.issues.forEach((i) => console.log(" -", i)); + } +} + +runBenchmark().catch((err) => { + console.error("Benchmark failed:", err); + process.exit(1); +}); From b7e24ee9baafba53c7af26950c46b6ace9cda2a0 Mon Sep 17 00:00:00 2001 From: Kunal Jaiswal <140198382+Kunall7890@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:27:13 +0530 Subject: [PATCH 2/3] chore: remove unrelated mcp/ Chrome extension from benchmark PR --- mcp/background.js | 574 --- mcp/content.js | 218 - mcp/devtools.html | 9 - mcp/devtools.js | 5 - mcp/icons/icon.svg | 65 - mcp/icons/icon128.png | Bin 12506 -> 0 bytes mcp/icons/icon16.png | Bin 743 -> 0 bytes mcp/icons/icon48.png | Bin 3406 -> 0 bytes mcp/inject.js | 2447 ---------- mcp/manifest.json | 57 - mcp/panel.html | 13 - mcp/panel.js | 10323 ---------------------------------------- mcp/popup.html | 250 - mcp/popup.js | 96 - mcp/styles/panel.css | 3834 --------------- 15 files changed, 17891 deletions(-) delete mode 100644 mcp/background.js delete mode 100644 mcp/content.js delete mode 100644 mcp/devtools.html delete mode 100644 mcp/devtools.js delete mode 100644 mcp/icons/icon.svg delete mode 100644 mcp/icons/icon128.png delete mode 100644 mcp/icons/icon16.png delete mode 100644 mcp/icons/icon48.png delete mode 100644 mcp/inject.js delete mode 100644 mcp/manifest.json delete mode 100644 mcp/panel.html delete mode 100644 mcp/panel.js delete mode 100644 mcp/popup.html delete mode 100644 mcp/popup.js delete mode 100644 mcp/styles/panel.css diff --git a/mcp/background.js b/mcp/background.js deleted file mode 100644 index e010407..0000000 --- a/mcp/background.js +++ /dev/null @@ -1,574 +0,0 @@ -(function() { - "use strict"; - var _a; - const tabStates = /* @__PURE__ */ new Map(); - const debuggerEnabledStates = /* @__PURE__ */ new Map(); - const lastFiberCommitTime = /* @__PURE__ */ new Map(); - const FIBER_COMMIT_THROTTLE_MS = 50; - const VALID_MESSAGE_TYPES = /* @__PURE__ */ new Set([ - "REACT_DETECTED", - "REDUX_DETECTED", - "FIBER_COMMIT", - "ISSUE_DETECTED", - "STALE_CLOSURE_DETECTED", - "CLS_ENTRY", - "REDUX_STATE_CHANGE", - "REDUX_ACTION", - "GET_STATE", - "DISPATCH_REDUX_ACTION", - "SET_REDUX_STATE", - "DELETE_ARRAY_ITEM", - "MOVE_ARRAY_ITEM", - "REFRESH_REDUX_STATE", - "CLEAR_REDUX_OVERRIDES", - "CLEAR_ISSUES", - "ENABLE_DEBUGGER", - "DISABLE_DEBUGGER", - "GET_DEBUGGER_STATE", - "MEMORY_SNAPSHOT", - "START_MEMORY_MONITORING", - "STOP_MEMORY_MONITORING", - "PAGE_LOAD_METRICS", - "CRASH_DETECTED", - "TIMELINE_EVENTS", - "GET_CORRELATION", - "DEBUGGER_STATE_CHANGED", - "REDUX_OVERRIDES_CLEARED" - ]); - function isValidMessage(message) { - if (!message || typeof message !== "object") return false; - const msg = message; - return typeof msg.type === "string" && VALID_MESSAGE_TYPES.has(msg.type); - } - function resetTabState(tabId) { - const state = tabStates.get(tabId); - if (state) { - tabStates.set(tabId, createInitialState()); - } - lastFiberCommitTime.delete(tabId); - } - async function getDebuggerState(tabId) { - if (debuggerEnabledStates.has(tabId)) { - return debuggerEnabledStates.get(tabId); - } - try { - const result = await chrome.storage.session.get(`debugger_enabled_${tabId}`); - const enabled = result[`debugger_enabled_${tabId}`] ?? false; - debuggerEnabledStates.set(tabId, enabled); - return enabled; - } catch { - return false; - } - } - async function setDebuggerState(tabId, enabled) { - debuggerEnabledStates.set(tabId, enabled); - try { - await chrome.storage.session.set({ [`debugger_enabled_${tabId}`]: enabled }); - } catch (e) { - console.error("[React Debugger] Failed to save debugger state:", e); - } - } - async function clearDebuggerState(tabId) { - debuggerEnabledStates.delete(tabId); - try { - await chrome.storage.session.remove(`debugger_enabled_${tabId}`); - } catch { - } - } - function createInitialState() { - return { - reactDetected: false, - reactVersion: null, - reactMode: null, - reduxDetected: false, - issues: [], - components: [], - renders: /* @__PURE__ */ new Map(), - clsReport: null, - reduxState: null, - reduxActions: [], - memoryReport: null, - pageLoadMetrics: null, - timelineEvents: [] - }; - } - function getOrCreateState(tabId) { - if (!tabStates.has(tabId)) { - tabStates.set(tabId, createInitialState()); - } - return tabStates.get(tabId); - } - function serializeState(state) { - return { - ...state, - renders: Object.fromEntries(state.renders) - }; - } - chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { - var _a2; - if (!isValidMessage(message)) { - return; - } - const tabId = ((_a2 = sender.tab) == null ? void 0 : _a2.id) ?? message.tabId; - if (!tabId) { - return; - } - if (message.type === "FIBER_COMMIT") { - const now = Date.now(); - const lastTime = lastFiberCommitTime.get(tabId) || 0; - if (now - lastTime < FIBER_COMMIT_THROTTLE_MS) { - return; - } - lastFiberCommitTime.set(tabId, now); - } - const state = getOrCreateState(tabId); - switch (message.type) { - case "REACT_DETECTED": { - const payload = message.payload; - state.reactDetected = true; - state.reactVersion = payload.version; - state.reactMode = payload.mode; - state.reduxDetected = false; - state.reduxState = null; - state.reduxActions = []; - broadcastToPanel(tabId, "REACT_DETECTED", payload); - getDebuggerState(tabId).then((wasEnabled) => { - if (wasEnabled) { - chrome.tabs.sendMessage(tabId, { type: "ENABLE_DEBUGGER" }).catch(() => { - }); - broadcastToPanel(tabId, "DEBUGGER_STATE_CHANGED", { enabled: true }); - } - }); - break; - } - case "REDUX_DETECTED": { - state.reduxDetected = true; - state.reduxState = message.payload; - broadcastToPanel(tabId, "REDUX_DETECTED", message.payload); - break; - } - case "FIBER_COMMIT": { - const payload = message.payload; - state.components = payload.components; - for (const issue of payload.issues) { - const existingIndex = state.issues.findIndex( - (i) => i.type === issue.type && i.component === issue.component - ); - if (existingIndex >= 0) { - state.issues[existingIndex] = issue; - } else { - state.issues.push(issue); - } - } - for (const render of payload.renders) { - const existing = state.renders.get(render.componentId); - if (existing) { - existing.renderCount++; - existing.lastRenderTime = payload.timestamp; - existing.renderDurations.push(render.duration); - if (existing.renderDurations.length > 20) { - existing.renderDurations.shift(); - } - existing.selfDurations.push(render.selfDuration ?? 0); - if (existing.selfDurations.length > 20) { - existing.selfDurations.shift(); - } - existing.triggerReasons.push(render.reason); - if (existing.triggerReasons.length > 10) { - existing.triggerReasons.shift(); - } - } else { - state.renders.set(render.componentId, { - componentId: render.componentId, - componentName: render.componentName, - renderCount: 1, - lastRenderTime: payload.timestamp, - renderDurations: [render.duration], - selfDurations: [render.selfDuration ?? 0], - triggerReasons: [render.reason] - }); - } - } - broadcastToPanel(tabId, "FIBER_COMMIT", { - components: payload.components, - issues: state.issues, - renders: Object.fromEntries(state.renders) - }); - break; - } - case "ISSUE_DETECTED": { - const issue = message.payload; - const existing = state.issues.find( - (i) => i.type === issue.type && i.component === issue.component - ); - if (!existing) { - state.issues.push(issue); - broadcastToPanel(tabId, "ISSUE_DETECTED", issue); - } - break; - } - case "STALE_CLOSURE_DETECTED": { - const issue = message.payload; - const existing = state.issues.find( - (i) => { - var _a3, _b, _c, _d; - return i.type === issue.type && i.component === issue.component && ((_b = (_a3 = i.location) == null ? void 0 : _a3.closureInfo) == null ? void 0 : _b.functionName) === ((_d = (_c = issue.location) == null ? void 0 : _c.closureInfo) == null ? void 0 : _d.functionName); - } - ); - if (!existing) { - state.issues.push(issue); - broadcastToPanel(tabId, "STALE_CLOSURE_DETECTED", issue); - } - break; - } - case "CLS_ENTRY": { - const entry = message.payload; - if (!state.clsReport) { - state.clsReport = { - totalScore: 0, - rating: "good", - entries: [], - topContributors: [] - }; - } - state.clsReport.entries.push(entry); - state.clsReport.totalScore = entry.cumulativeScore; - if (state.clsReport.totalScore < 0.1) { - state.clsReport.rating = "good"; - } else if (state.clsReport.totalScore < 0.25) { - state.clsReport.rating = "needs-improvement"; - } else { - state.clsReport.rating = "poor"; - } - for (const source of entry.sources) { - const existing = state.clsReport.topContributors.find( - (c) => c.element === source.node - ); - if (existing) { - existing.totalShift += entry.value; - existing.occurrences++; - } else { - state.clsReport.topContributors.push({ - element: source.node, - totalShift: entry.value, - occurrences: 1 - }); - } - } - state.clsReport.topContributors.sort((a, b) => b.totalShift - a.totalShift); - broadcastToPanel(tabId, "CLS_ENTRY", state.clsReport); - break; - } - case "REDUX_STATE_CHANGE": { - state.reduxState = message.payload; - broadcastToPanel(tabId, "REDUX_STATE_CHANGE", message.payload); - break; - } - case "REDUX_ACTION": { - const action = message.payload; - state.reduxActions.push(action); - if (state.reduxActions.length > 100) { - state.reduxActions.shift(); - } - broadcastToPanel(tabId, "REDUX_ACTION", action); - break; - } - case "GET_STATE": { - sendResponse({ - success: true, - state: serializeState(state) - }); - return true; - } - case "DISPATCH_REDUX_ACTION": { - safeSendToTab(tabId, { - type: "DISPATCH_REDUX_ACTION", - payload: message.payload - }); - break; - } - case "SET_REDUX_STATE": { - safeSendToTab(tabId, { - type: "SET_REDUX_STATE", - payload: message.payload - }); - break; - } - case "DELETE_ARRAY_ITEM": { - safeSendToTab(tabId, { - type: "DELETE_ARRAY_ITEM", - payload: message.payload - }); - break; - } - case "MOVE_ARRAY_ITEM": { - safeSendToTab(tabId, { - type: "MOVE_ARRAY_ITEM", - payload: message.payload - }); - break; - } - case "REFRESH_REDUX_STATE": { - safeSendToTab(tabId, { - type: "REFRESH_REDUX_STATE" - }); - break; - } - case "CLEAR_REDUX_OVERRIDES": { - safeSendToTab(tabId, { - type: "CLEAR_REDUX_OVERRIDES" - }); - break; - } - case "CLEAR_ISSUES": { - state.issues = []; - broadcastToPanel(tabId, "CLEAR_ISSUES", null); - break; - } - case "ENABLE_DEBUGGER": { - setDebuggerState(tabId, true); - safeSendToTab(tabId, { type: "ENABLE_DEBUGGER" }); - broadcastToPanel(tabId, "DEBUGGER_STATE_CHANGED", { enabled: true }); - break; - } - case "DISABLE_DEBUGGER": { - setDebuggerState(tabId, false); - safeSendToTab(tabId, { type: "DISABLE_DEBUGGER" }); - broadcastToPanel(tabId, "DEBUGGER_STATE_CHANGED", { enabled: false }); - break; - } - case "GET_DEBUGGER_STATE": { - getDebuggerState(tabId).then((enabled) => { - sendResponse({ success: true, enabled }); - }); - return true; - } - case "MEMORY_SNAPSHOT": { - const snapshot = message.payload; - if (!state.memoryReport) { - state.memoryReport = { - current: null, - history: [], - growthRate: 0, - peakUsage: 0, - warnings: [], - crashes: [] - }; - } - const report = state.memoryReport; - report.current = snapshot; - report.history.push(snapshot); - if (report.history.length > 60) { - report.history.shift(); - } - if (snapshot.usedJSHeapSize > report.peakUsage) { - report.peakUsage = snapshot.usedJSHeapSize; - } - if (report.history.length >= 2) { - const history = report.history; - const oldSnapshot = history[0]; - const newSnapshot = history[history.length - 1]; - const timeDiff = (newSnapshot.timestamp - oldSnapshot.timestamp) / 1e3; - if (timeDiff > 0) { - const memoryDiff = newSnapshot.usedJSHeapSize - oldSnapshot.usedJSHeapSize; - report.growthRate = memoryDiff / timeDiff; - } - } - report.warnings = []; - const usagePercent = snapshot.usedJSHeapSize / snapshot.jsHeapSizeLimit; - if (usagePercent > 0.9) { - report.warnings.push("Critical: Memory usage above 90%"); - } else if (usagePercent > 0.7) { - report.warnings.push("Warning: Memory usage above 70%"); - } - if (report.growthRate > 1024 * 1024) { - report.warnings.push("Warning: Rapid memory growth detected (>1MB/s)"); - } - broadcastToPanel(tabId, "MEMORY_SNAPSHOT", report); - break; - } - case "START_MEMORY_MONITORING": { - safeSendToTab(tabId, { type: "START_MEMORY_MONITORING" }); - break; - } - case "STOP_MEMORY_MONITORING": { - safeSendToTab(tabId, { type: "STOP_MEMORY_MONITORING" }); - break; - } - case "PAGE_LOAD_METRICS": { - const metrics = message.payload; - state.pageLoadMetrics = metrics; - broadcastToPanel(tabId, "PAGE_LOAD_METRICS", metrics); - break; - } - case "CRASH_DETECTED": { - const crash = message.payload; - if (!state.memoryReport) { - state.memoryReport = { - current: null, - history: [], - growthRate: 0, - peakUsage: 0, - warnings: [], - crashes: [] - }; - } - state.memoryReport.crashes.push(crash); - if (state.memoryReport.crashes.length > 50) { - state.memoryReport.crashes.shift(); - } - broadcastToPanel(tabId, "CRASH_DETECTED", crash); - break; - } - case "TIMELINE_EVENTS": { - const events = message.payload; - state.timelineEvents.push(...events); - if (state.timelineEvents.length > 2e3) { - state.timelineEvents = state.timelineEvents.slice(-2e3); - } - broadcastToPanel(tabId, "TIMELINE_EVENTS", events); - break; - } - case "GET_CORRELATION": { - const { eventId } = message.payload; - const result = correlateEvent(eventId, state.timelineEvents); - sendResponse({ success: true, result }); - return true; - } - } - }); - function correlateEvent(eventId, events) { - const selectedEvent = events.find((e) => e.id === eventId); - if (!selectedEvent) { - return { correlatedIds: [], explanation: [] }; - } - const correlatedIds = []; - const explanation = []; - switch (selectedEvent.type) { - case "render": { - const stateChanges = findEventsBefore(events, selectedEvent.timestamp, 500, "state-change"); - if (stateChanges.length > 0) { - correlatedIds.push(...stateChanges.map((e) => e.id)); - explanation.push(`Possibly triggered by ${stateChanges.length} state change(s)`); - } - const parentRenders = findEventsBefore(events, selectedEvent.timestamp, 100, "render").filter((e) => e.id !== eventId); - if (parentRenders.length > 0) { - correlatedIds.push(...parentRenders.map((e) => e.id)); - explanation.push(`${parentRenders.length} sibling/parent render(s) in same batch`); - } - break; - } - case "state-change": { - const subsequentRenders = findEventsAfter(events, selectedEvent.timestamp, 500, "render"); - if (subsequentRenders.length > 0) { - correlatedIds.push(...subsequentRenders.map((e) => e.id)); - explanation.push(`Triggered ${subsequentRenders.length} render(s)`); - } - break; - } - case "error": { - const precedingEvents = findEventsBefore(events, selectedEvent.timestamp, 1e3); - correlatedIds.push(...precedingEvents.map((e) => e.id)); - if (precedingEvents.length > 0) { - explanation.push(`${precedingEvents.length} events within 1s before error`); - } - const memorySpike = precedingEvents.find( - (e) => e.type === "memory" && e.payload.isSpike - ); - if (memorySpike) { - explanation.push("⚠️ Memory spike detected before error"); - } - const recentRenders = precedingEvents.filter((e) => e.type === "render"); - if (recentRenders.length > 10) { - explanation.push(`⚠️ ${recentRenders.length} renders before error (possible infinite loop)`); - } - break; - } - case "memory": { - const payload = selectedEvent.payload; - if (payload.isSpike) { - const precedingRenders = findEventsBefore(events, selectedEvent.timestamp, 2e3, "render"); - if (precedingRenders.length > 0) { - correlatedIds.push(...precedingRenders.map((e) => e.id)); - explanation.push(`${precedingRenders.length} render(s) before memory spike`); - } - const stateChanges = findEventsBefore(events, selectedEvent.timestamp, 2e3, "state-change"); - if (stateChanges.length > 0) { - correlatedIds.push(...stateChanges.map((e) => e.id)); - explanation.push(`${stateChanges.length} state change(s) before spike`); - } - } - break; - } - case "effect": { - const triggeringRender = findEventsBefore(events, selectedEvent.timestamp, 100, "render").slice(-1)[0]; - if (triggeringRender) { - correlatedIds.push(triggeringRender.id); - explanation.push("Triggered by preceding render"); - } - break; - } - } - return { correlatedIds, explanation }; - } - function findEventsBefore(events, timestamp, windowMs, type) { - const startTime = timestamp - windowMs; - return events.filter( - (e) => e.timestamp >= startTime && e.timestamp < timestamp && (!type || e.type === type) - ); - } - function findEventsAfter(events, timestamp, windowMs, type) { - const endTime = timestamp + windowMs; - return events.filter( - (e) => e.timestamp > timestamp && e.timestamp <= endTime && e.type === type - ); - } - function broadcastToPanel(tabId, type, payload) { - chrome.runtime.sendMessage({ - type, - tabId, - payload - }).catch(() => { - }); - } - function safeSendToTab(tabId, message) { - chrome.tabs.sendMessage(tabId, message).catch(() => { - }); - } - chrome.tabs.onRemoved.addListener((tabId) => { - tabStates.delete(tabId); - lastFiberCommitTime.delete(tabId); - debuggerEnabledStates.delete(tabId); - clearDebuggerState(tabId); - }); - if ((_a = chrome.webNavigation) == null ? void 0 : _a.onCommitted) { - chrome.webNavigation.onCommitted.addListener((details) => { - if (details.frameId === 0) { - resetTabState(details.tabId); - getDebuggerState(details.tabId).then((wasEnabled) => { - if (wasEnabled) { - setTimeout(() => { - chrome.tabs.sendMessage(details.tabId, { type: "ENABLE_DEBUGGER" }).catch(() => { - }); - }, 100); - } - }); - } - }); - } else { - chrome.tabs.onUpdated.addListener((tabId, changeInfo) => { - if (changeInfo.status === "loading") { - resetTabState(tabId); - getDebuggerState(tabId).then((wasEnabled) => { - if (wasEnabled) { - setTimeout(() => { - chrome.tabs.sendMessage(tabId, { type: "ENABLE_DEBUGGER" }).catch(() => { - }); - }, 100); - } - }); - } - }); - } - console.log("[React Debugger] Background service worker started"); -})(); diff --git a/mcp/content.js b/mcp/content.js deleted file mode 100644 index e83b572..0000000 --- a/mcp/content.js +++ /dev/null @@ -1,218 +0,0 @@ -(function() { - "use strict"; - const PAGE_SOURCE = "REACT_DEBUGGER_PAGE"; - const CONTENT_SOURCE = "REACT_DEBUGGER_CONTENT"; - const STORAGE_KEY = "react_debugger_disabled_sites"; - let isEnabled = true; - let isInitialized = false; - let extensionContextValid = true; - let debuggerEnabled = false; - let clsObserver = null; - function sendToPage(type, payload) { - if (!extensionContextValid) return; - try { - window.postMessage({ source: CONTENT_SOURCE, type, payload }, "*"); - } catch { - extensionContextValid = false; - } - } - function safeSendMessage(message) { - if (!extensionContextValid) return; - try { - chrome.runtime.sendMessage(message).catch(() => { - extensionContextValid = false; - }); - } catch { - extensionContextValid = false; - } - } - function generateId() { - return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; - } - function getSelector(element) { - if (!element) return "unknown"; - if (element.id) return `#${element.id}`; - const tag = element.tagName.toLowerCase(); - if (element.className && typeof element.className === "string") { - const classes = element.className.trim().split(/\s+/).filter(Boolean); - if (classes.length > 0) return `${tag}.${classes.slice(0, 2).join(".")}`; - } - return tag; - } - function injectPageScript() { - if (isInitialized) return Promise.resolve(); - isInitialized = true; - return new Promise((resolve) => { - const script = document.createElement("script"); - script.src = chrome.runtime.getURL("inject.js"); - script.onload = () => { - script.remove(); - resolve(); - }; - script.onerror = (e) => { - console.error("[React Debugger] Failed to inject script:", e); - resolve(); - }; - (document.head || document.documentElement).appendChild(script); - }); - } - async function checkIfSiteEnabled() { - try { - const hostname = window.location.hostname; - const result = await chrome.storage.local.get(STORAGE_KEY); - const disabledSites = result[STORAGE_KEY] || []; - return !disabledSites.includes(hostname); - } catch { - return true; - } - } - let pageMessageHandler = null; - function setupPageMessageListener() { - if (pageMessageHandler) return; - pageMessageHandler = (event) => { - if (!extensionContextValid) return; - if (event.source !== window) return; - if (!event.data || event.data.source !== PAGE_SOURCE) return; - safeSendMessage({ - type: event.data.type, - payload: event.data.payload - }); - }; - window.addEventListener("message", pageMessageHandler); - } - function removePageMessageListener() { - if (pageMessageHandler) { - window.removeEventListener("message", pageMessageHandler); - pageMessageHandler = null; - } - } - async function handleEnableDebugger(message) { - isEnabled = await checkIfSiteEnabled(); - if (!isEnabled) return; - debuggerEnabled = true; - setupPageMessageListener(); - await injectPageScript(); - sendToPage(message.type, message.payload); - initCLSObserver(); - capturePageLoadMetrics(); - } - function handleDisableDebugger(message) { - debuggerEnabled = false; - sendToPage(message.type, message.payload); - stopCLSObserver(); - removePageMessageListener(); - } - function init() { - try { - chrome.runtime.onMessage.addListener((message) => { - if (!extensionContextValid) return; - try { - if (message.type === "ENABLE_DEBUGGER") { - handleEnableDebugger(message); - return; - } - if (message.type === "DISABLE_DEBUGGER") { - handleDisableDebugger(message); - return; - } - if (debuggerEnabled && isInitialized) { - sendToPage(message.type, message.payload); - } - } catch { - } - }); - } catch { - extensionContextValid = false; - } - } - let clsValue = 0; - let pageMetricsSent = false; - function capturePageLoadMetrics() { - if (pageMetricsSent) return; - const collectAndSend = () => { - if (pageMetricsSent) return; - pageMetricsSent = true; - const metrics = { - fcp: null, - lcp: null, - ttfb: null, - domContentLoaded: null, - loadComplete: null, - timestamp: Date.now() - }; - const navEntries = performance.getEntriesByType("navigation"); - if (navEntries.length > 0) { - const nav = navEntries[0]; - metrics.ttfb = Math.round(nav.responseStart - nav.requestStart); - metrics.domContentLoaded = Math.round(nav.domContentLoadedEventEnd - nav.startTime); - metrics.loadComplete = Math.round(nav.loadEventEnd - nav.startTime); - } - const paintEntries = performance.getEntriesByType("paint"); - const fcpEntry = paintEntries.find((e) => e.name === "first-contentful-paint"); - if (fcpEntry) { - metrics.fcp = Math.round(fcpEntry.startTime); - } - safeSendMessage({ type: "PAGE_LOAD_METRICS", payload: metrics }); - if ("PerformanceObserver" in window) { - try { - const lcpObserver = new PerformanceObserver((list) => { - const entries = list.getEntries(); - if (entries.length > 0) { - const lastEntry = entries[entries.length - 1]; - metrics.lcp = Math.round(lastEntry.startTime); - safeSendMessage({ type: "PAGE_LOAD_METRICS", payload: metrics }); - lcpObserver.disconnect(); - } - }); - lcpObserver.observe({ type: "largest-contentful-paint", buffered: true }); - setTimeout(() => lcpObserver.disconnect(), 1e4); - } catch { - } - } - }; - if (document.readyState === "complete") { - setTimeout(collectAndSend, 100); - } else { - window.addEventListener("load", () => setTimeout(collectAndSend, 100), { once: true }); - } - } - function initCLSObserver() { - if (!debuggerEnabled) return; - if (!("PerformanceObserver" in window)) return; - if (clsObserver) return; - const supportedTypes = PerformanceObserver.supportedEntryTypes || []; - if (!supportedTypes.includes("layout-shift")) return; - clsObserver = new PerformanceObserver((list) => { - if (!debuggerEnabled) return; - for (const entry of list.getEntries()) { - const layoutShift = entry; - if (layoutShift.hadRecentInput) continue; - clsValue += layoutShift.value; - const sources = (layoutShift.sources || []).map((source) => ({ - node: getSelector(source.node), - previousRect: source.previousRect, - currentRect: source.currentRect - })); - safeSendMessage({ - type: "CLS_ENTRY", - payload: { - id: generateId(), - timestamp: Date.now(), - value: layoutShift.value, - hadRecentInput: layoutShift.hadRecentInput, - sources, - cumulativeScore: clsValue - } - }); - } - }); - clsObserver.observe({ type: "layout-shift", buffered: true }); - } - function stopCLSObserver() { - if (clsObserver) { - clsObserver.disconnect(); - clsObserver = null; - } - } - init(); -})(); diff --git a/mcp/devtools.html b/mcp/devtools.html deleted file mode 100644 index 5cd9e44..0000000 --- a/mcp/devtools.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/mcp/devtools.js b/mcp/devtools.js deleted file mode 100644 index 3612e49..0000000 --- a/mcp/devtools.js +++ /dev/null @@ -1,5 +0,0 @@ -chrome.devtools.panels.create( - "React Debugger", - "icons/icon16.png", - "panel.html" -); diff --git a/mcp/icons/icon.svg b/mcp/icons/icon.svg deleted file mode 100644 index 5f8346c..0000000 --- a/mcp/icons/icon.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NhoNH - - diff --git a/mcp/icons/icon128.png b/mcp/icons/icon128.png deleted file mode 100644 index 33960cfdbfd5779f6dfd8ac1049071216dd377da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12506 zcmV<0FeT54P)*2tJ{=N6eb}+0^k30?vx}XlRAMA zz0Y$V(g?$RzW3g9&OP`1e0;9q(fslG+NKY?c9S){e<8_doR7ML7uVJwy12XU_09*c z_G`K3$Bg&k+xSt}HYR{SUVP98xXx#skJ>|B&GoNe++F|r#hp!u@qe%O>$#>!8=o~92wHxvBk4=>*DbB&C~Ly)-y&~UIb z>uSHAYj)Is*jeJ5{q-Lqwx1vQ@nnHqKZ!3c@a2dX_;Mvr`tqdveR-1KP3B4d=*yLU z?#q*$^5sj;JMEM&Px?9g9$)f1`dL4|}>lP9~?SYHW zj_o@&0mme%k!Rif?qTcmZ=cM#ZwvSu6C^<~P{w3In_l9CT*{!z!&4v$jA65%C-;Y+ zKn`D?6ux}V=I1n;^?ZdtTLq*+F_1^3LLHau6h}F9X{AubW)F0@ot~)?m0CxQl2@G-ga-~_mT*+Q#Oh#AUy4O*#{tZOWzS}voOQDL- zg)B54LTxacowWQj*q7T7;QI|=9H9~dO&|lWjLw2CtqgivArcDM>Ok9#pFq~>E0FH> z6-qPv`@hs4xRAmGaDW^^C`U38zAxjtNjzyGId1gki}ayLTJ{tQH@^$(3rC^`ENVhoBw; z2*0{-@%S9qP3B0e$RnqHT@(<;_F#jh0hZ_AX0t!?`n&pper4hNxlG_Nu2c(2U@SC= z1#FwpBw8UdgfoG1_|lKKP9anuf`|!VA31`^zS?j0xEhmqQo|&k_@J*q2C*>$+7t_0 z=2dao2yK{;+$Z-llZPdZEBJnw8Er-CxI88VZBij5#z=5Q3UCCnHwFG-X4?Om01lw~ zYQN{>Vn`&C|Cz*-+%=geKF`+%GA~`1S;m%Dfi{qVNL#g$!B1ZH%(#Z{*HZ{;Ba~5@ z4nKib1Z@a70(oct!@v7$&F*vi>i1!m&-Z;y;)|@4c;bI@Bx)$4(;0YmVjlP^gBvb6 zd9K+XkY9IAz~}TZp~eJFf(82Y3MeBpkht(U*7C?Zn|!{<<0ov^^Q9L>fl(}s z)20H$6dIFA_yNbcjet0L_Yp*5v9A0x}S z7V&c*hvl*Nka_nW@FW^=gtGU1g-Wf@_hI~uCn=f46MxH78K6nAvY9UmFnjds{qw3E z%l{Mm*%omv!{<0Htok<_lxFk#?xgmP#TO56gFn%Lg& zHjyqA`m{1=;w|7yHQ);5>wK=oF^MByNz1-6E{DMexK+#Atg@0NF)X}-%iB$Bpn|!X7IG;j2S$HyY_=JP( z`8|#D0m|4+76DA8J)d*A0AdTe1rUQjHO%>Qoc2vj_#6^I zbUuTh_t+7HwJe6QxDlqpMwqOPFj*R5ENFx_v6zWK#-aloWPx$y6rS=GsnkB>bo>{k zcX?_fOY%^h@0!`hq6UQ2&+P+0AiEy&Foys{`VhDGKhgGl&Sj>G%IOwB^R0d0hgQym zDYx0Z5-7vd;Gbq=z5z#|c-JRz9G)Fa=7}Go+&-mu$?NZ#?~UiQeVuU4n103@iXms+9>qos>VJ;d5vUh{|;e;2@Odj6MP&_{QvR0gwq42Iy1E zp^nJ~SFF6m5z7jE#!)fHm+VNF_I>}p2Rj7ckUx+Bq%7@AHTqP+JCWgYm=kDW@X6#M zDSZWy-3()9Zvjw6k;D+;^ao<;YyS`k1V6jl{Cy^KCHGS?2gUkyq}v~0f^W$4B!G$Q z?Q=YsE}_&d0GTPSuK+TeVa(_u08zK8A~T^+DF z&v`x*KwcvZx%~;?`v;#ZR6v(fAhNFjGMZsXZ|(!1Od!)ipHjwzz!l2RbHyst z)#88MB(CHzUCy8~E~@15w8T@W=koUZgRf4^hktG*xC;LX51%VkARwd8Eda6B+(!V) z&@5(`!*>~lgtQe zAP-G~GAaYgXs1PW8+~7_4`nxo`h(AAcviDR0QVe(P#xGu0R7GUp2icaSX7`*C!vw(9r@W}`Y3lj?)SoxPX;Zvmz0cY37(o5ZShg!NHm{P<9 zpiL=)v8V;+hJ}cpbq|tm`vo#qZ$<87uc6?n!>~U8JCtnu6Uujf>aZO>Z2M*QN)LPa zQa>NO$b{Bq^219{KG4{ z3jB;GDW)Zp>h{TVA1Qpc{3qoz`1)L%*WlAFB28jG6DOTT5PbSGuxuK;R6?cY*^lf( z;fueAZO<2|-1n8+Y_EL<+uk0w=Sx)V{yWNF{me6LCvdm@@+h;i{%qS(*k1V>RohRa zeACy6nYjwOloH3u-w@%`>O`iA$%8hj7<{oBe6i}vg@wL6@ew-Lr;H!n$Q>zsf~-j? zU;>a+z27L|Q~p5}n+1JlIsEf$5I$`QQkFl5{AUlNV%Mjr-1iTsT?YKM9^m)%u-#v} zt!(>eDB1ES6g>47@*X>g><9OD+XGH}@HIB$tdKkm-|B=k^pVI6@k`ih?=?_DYrd` z(hWx)0(j*+lx;rBth9&aK5`f)>om64dxB5Kqg5cb06Ovo#40*9OuqsGknE);mS#WQ z+8GV}(Kvi`Q&%0Ii>Mn`py27ly>g)6w3x@hEccKgenVJi#ZE=)&NiS_z4N1pV&aV+#MLLZQf)C+Vd7_!PR07Czme z?dkXp2A=-ow7e(W@)(LXzK8NxKZR}Y-@AeD>$Zx$U%~R+5v1JpJi@0fWrtAA|lGXePW#0$A%HJkln=TYxyX1>b-q&h&4;3?Eh%t!o! z2T-*6eFoiS6??wuhQ8-Z6g=}5Qtn!h@Ts>$pHtP#+wTv)A+L_vNZ`xEQlKy=L&SO# z3>`jM^1_YCy89p^8&~$(lZ$mJSd*60s@(SYzs#w zbHyJ?f})uKNC=~WPql(nA3y?7geUg_Pj9Tb;b!Eo`!$1IMz*ut%3u8)#oPYO_U(vi zOW~he?J?B596qfgsms@+`q0;?IrI(t9aMrfT=D zFZK_0gQvtw^3ruEefclFfS2uXnB|$b5PjoHgw)Q3KC7Zvs5cmVZE^u(X0JrWp3hM8 zMk{K5-HMuDwW9h^E6R6&fw;L3KpmYkEco(}M96~T!IwD0xIv77Wi8*&1Q1+u(}3PS zPpU!k&CjD`{b$T9kG>C)DzIM>s3{~&C0ps8$U$s+_kJv57imCLcQU@H`m>SqOI?v<~OZw_yz0UK>oVJ zs6N<=>epLQeV`SE>wk~nvROlhFAq+HJSc&cZw*BN6uJ?7GDBw5prIaL=8wGl-$Kc= zpD_!z&gxeHQezbS(<&iSns>X7}&4%EDP3^i{$;Fs_CE23|>+r8(9H7;gZyXyU| z%&PXaBIm&a@K3KC5`5Z&DL>Db2MjC#kplA26t@7haYX~dckTH>g>z8y%xBD!7jEb) z0I?DRnU)EFUJFmGIO0|K91h2qTCtJ$-+$~s{7{d2^JP8wYBz8v^wO6;LBhgEAvY)W zo8`Ma!{-S;eJx?}!>Bs+Pt?5C%HUTX{1=j!J_T)pwU5K6ip@proV6(5`4y^OYem)G zR#fcx7vdK@4rNrlc~b9Q1bL=D0%8LWGvg=2foWR zaTZ53AXavAx%v_HG3<9x6GmEk>CL9x{b=A*5+!cl11Nj>Zw$E0D9aW#^KRCfZJ^x# zP~b<*ScE@W~XR$c!@=+`Gxr1Yu%6g-<5Ynb|fV)`n0Av$ft609X70b>O5XjNQeaLx<0mXb`{PA(XxRDYJ^5 ze@E56e?sYQQcwnoBwjdx9$HNvGeYOHo@YCPYs(W?kB&Z8-62< z`3-D!ptLXjoNLclhNU8M$_kWi`V5uZTT%H+E6O+jn|a&)!Iv7M9R(f)(!;?{Wc>;z zfRsgBhXh|B)gk}B-=b{8KTxst7?N&T4`q02zXG5GC4H(5ir^#?fY-voANz8}=cwSb zd;cFgd@AwIzJCup2`hD4@y3r3GiN0N3hIVj%t7b*11a#)V3;U3)%l5vg~)1l!B4 zux&ez!2Id`!#6}R0q~_dkKtY1%*U7j;%|InQ21n~oarce`tPXNatx*GKSxCU?NElL z^(z2YClF_4p)6OVJm-~*rPOtspi|)oHB=rBe3>~3mS^5^gD>576bXx-WJw!}0JNz^ zL$2f@-(w(e-`u#sJ^Rgd^WE@usiiPkn;3YLwFOmWrC42)j)k^7w3HR1xzvh_JgNUrZ zXHfWL!KDjOvGEuxHnk#k$z~Yyo57Q)`h`!XipX>y4*80dno$d25?^E?0MsX!mg^zM z`N0XWKJy-fPFAw%F93bJwGiN2Wp6@&il&!G&`Mh0m9$5n3@1$%{51`IZd`shA6aGQcBzG7>ALg=stB zh*f!`76A3zr*n340IBivP~ZzS!LU624oY7-%B*nxhtR|oxR-lPQa%ipx&b}@%j@-6 z8P@>mU30^Hx5sa;ozG^k3%=1g^9g=Xfn(24FRZ{V71>x+o`ckaN(AK8Auy{Ji>&#m z$SY>>1JbJzkXFSUKAQCe-?p_Cro3q$;fwvlA=ZZWU(08VW$?*#$yEcwcL~63TY#{d z#Rw_C31V&VfbhvE6!lN7f>34h&bfduSF(=4v;4nIKPY@U;Y(Y-1*Kb$GAmmD5sRZQ z&-K%B?r;h?X$u14wzk5y#VG(!@bzIVS=FBawDHAm0mwts288cE z?)496y#hp!9fL;q%q(VVp9k%Ij(8L#b zrFxfv_W+;vdnN!%@g8o4x%wuS;9&x=G$XIb#`b*I%Rcw;b**P8Lq%1ESUSFo8s zKhKJ+%rXX_mQ!;0XxS(D6`NaO%AM*FKC^xWpoA%JI)k6N;vhsSQyZr(d@^c7M*<+x@7Hmz((89ov~$>yWX%=NeRJ=2${Sw}4Dk2jps zZ3lSI=lQhk6MV|?hgQvX2*Bb9^{Prr(Og={_WZ>a*?r)*Rz;w-A_fa{t!&wE$|*uc zRw;u|?Oe#=qghYz$r&@|P8k5c*%^oT&G3a)-p&M&zGP=F@U*lWbDChTUhK46S?{3X z!gm=ZgD4c_iBxZoS^$%I(m&B-R>)%?QYDW-219-mGY0RnnNL+b25Y0UlzixQ`&7C; zP%#HB`>xYHCV;3ccbs2UT;dQwUOn6M`-6Y1Bn}I63lWfBg{JIclxLQ}KZOKfV-6n^ zz@}D|lK`??27n(5ktVp`3}4)gN0|WPZ(QewuS+aOSmiAYy32w~X0w?*68KC2N##(Q zS+3w?ZwTN^N{Y}PJk&BSDi}2uHbI?`*Js(MgB*td@`rV4gX;DNs^p<%-*vPbS~-^; z>AI3UIfWHiSeD1U{j>rb+w(7n|5afUQZp;qvOh1|icESsNQw=*WD-COTlNWl`9_BT zJi^z8u-V&Rk|%ZXHe@Y7h=}?X?)|+dcoKp>sgzy&8Yz4}2_Ufqs<3qW{EJZwz?UaE zNhw%*uFgbvDE@JSb(rmap+X6#s1%t0ks$dQuE&Bw&{6!K#vq$(e z`&og=W$=Yc6S7wxM%Ic$2+Y6UUC0qqHV@{iTiK0Z@*PIH?7QHT>Eeo@j>x7h;P~hT zz?Ym?L}#*QPeU!>49Kf>3xM+L?y_yEmcb{ZqvhdT*P`0XWa~Ln>yogB@2h z3Yz(prId1Z!q+91Gl!36J;5)3p%n%a zfCu;@br7otcAw`Dxsa~1?&ns&yfur z8vzVdyh+f*8Wu4ND!&mNk;;+JrxV50V)*A&x}L8y7J%Y{U1P--sUv5rz3xMKrZ`{(A1;=@;-lb*VA%Iq-ulyy{36@@` zdYZ%{cY2qSJlR?0EYu@!pB%oPd%ij}az zN7S^t8GP5No-!f>y5w^AvhSZ-=??V>J}udb;AD4_hpt?itCynqiKFh>U;5O)5s+4k zkkWbVl4nHSU2K03ue%E&WedQQXx)HC>OgizPX(hHckV;hT?b( z80gEF{FYAQ=rCxw*R?KR_Eiaah?%p7m0r;uIC{9!aPQ~SZ1hyRZOCgt-ebRJlGp5R0_YxOA=-SCqtpo++5;hqb=F|!f*_rHsZ7f+!4`Qr?J*0R^3 zjV*$?axsJ66MlHzGWe&}_FuPejAP*+3BW(4W=!GpB`Q`Tt_Vq@pMBdasbEQ96nl)S z`7GjZeiY`qMa%-rZiJeZGpmNwoPi$QI#}I)Nc92~KmR9G?P_&Y z^z3Lw_L_arCzZG>dE`M!&Kf!kWPu4R)RP7!Ah>uIa#p{A$}Oi+x#bLOo6n&1*?+@a zeye-WH|0-vz^_||;NrO~TPP1o1i#1Z?`i%i)eJrv{kvlcpNc~r2UwJC^+GDxk1t(E zr*a_bof z{Ea7B<}Rx79>@dZyB$7F2;?D25b460(?=(70(pSP1D!D2?F@d#9edd^?O4GlqeCMS z0416D615i&gZR<~1fB%oIKCbE!H$9Y02Vevn^p>ax(&g$c`(;3Vn$1}3%(*e9p)NJ zkM_2}!s}U`Jc)sB>9Q1X)gpw~FGU!$+Y!;Y3?b$7+4t#pYT^r#xoR(}cb!HR*{f$z zzU4p2Sh@pI&8t|L7g#t8mY;tN+tyQV_yv!AjF>5F5nMEfm2da;_JiE;g-RoX;7I_9 zbDm=Yh@0{AF@;Yi4TwNMY8CT8_!9N#kApdUnT2(>N-t**QXb8z9z6%pKgY&8iqPkj zE_J0;doKIR$gDo_%~iJ`wCWb-(9!Fmyg*RV^@yH%zth$tdd6BrPrnb*)9;0UdX>9+ zH?UwDl5c(ir5nCL)y^~QUVhapXHfXWC&*cI*pcFOrg<$7eZUGgX-W4S>h*+ga^&qj zz^80q)}8yA078o9k12dIM?pvx+X@8UCQ0Q0@2P+9n8P$>QP#r!Bqm&Vutisip z+l;`%8`!Ki6-)z9rt9vv7n9!ud^h~4rn{kz%yw7rQYJ3AXf{Gh=ObzUb4s;~9{>Ol zfJsC_R49M(pRm1j5*1sHyWtnFJIXwMDySGJ$#Xe;%H$1np0AF~b?*O%*h(^%@X6E> zSKn)nkp`)rJYOk&cNgl9tn*lY|{ z;Xf#U;cFz#Uk|xCZNT(yzwl)P!zai=1vk0{&^zVpefR`j8&~Ma0*cigUVGYzA5ZcD zo#9g`NFBFE0-wPOjfXhE?DbY`tQpi0E^S<1#-)zTfhsb4z=NHU&U_c>n3lB+e#(N) zV-BALNx2QG1>j56-n%92$CErj7eeS^$U;rfh-N-@6rWyvja z0Qq87zSji6@nxO#NHYq(MzZHCB2pXzur!QW2TqsKaV$A=-hwYs7(FI=20GO< z=1g@9fL_N~!guWdR%oK~>3f|#o?()YH-{fz`VKwYj{E>R?HaDbr;JKx0tm>h8B_SZ zgdo$iyLt@#u;B-?ZKY>!e>m{j{@;8*gP*$SC(K?H}R2%=f9Nhp9SCi{wpdZU6r zjP|SCA>7p)3Vbr9Io-Yd>r<-76h4_IrU1J5BK9#yqz(2Ni{ZzUeaIehno$m}O#1_T zv1b7US!Ou|u*hKHkYt(A@Oe~|mr(9r{x#9oVZ+zNW5f74jk0mHx)M_cJ68>020kahR>I1kbdhU zqt*IL^3biE$f+w3JNp4v!0Cb?kltGW*D`z__2E{9Lx zjhR!Ri!1e*^`q-+>WCbw`MatQj%34+FT0Pxv)+0U86J~7)Z>qZfr*w0x9szJnA{YP zVC!rcvzi#J(I$ENIDU~i@K3fuqzHgOtX}Ce9v&Xe;miI`cj;&=pySs5;(T3Ni8B#o zov`rvVil`5bnW3HXSuky;8T||O8O`Q<7xJPB@&5#>N6gOqjX$xi7t2OQ_K21HIs#m zsl_l_`U+qo!RL!r3=j!GpH$&h_*CZ~kZgk{G7kcY=8{)RzP&m81hV_7@e|$o(G!Vj8HeL1enR;X$_&z0 zKv%OSYN*HaklPo^^f08?F{6*Y0iW&r;aLbsse(isLcil3pUBAn@)?hVBb6#R0{ICl zA$Np^ao-#GeD`wi0_Pq0RN_tBiZUpHoW4_Hv0CLbo`;`MQN$6-FVaO#eOd*?h6o3A z@{q%mAr1(exbVf^+w;lfPNz>Do&|wK-Nlz(!RG^yW^jbk>p3C?yTZ*P1HBp2pjhWa z8X6gZi3VS0h+?^Uk;>>5_^if1r3#wJTnMBZ62KgvYiV!Cr6uv@&*RL;@hA zixm?IzCfyjA+wP=fU5A!(Zko85s+L7ZL|eKnT{R-bEnU>I5{K@{P8RjW1T7 z{dz-HyM29CyZyPUcKb8c?e?du+wJRW+U-x)wA&xAX|w;Lw$1)%ZJYg(+BW+`b#3;w zH77e)*Br;{x|3Ml@GVw0oWhE_<5*tTie+`JxTCHWOY2*)r2ZIgt3QUt^~Z2a{W09! za109@j$wYoG0bZ`hMO9{!Q94gFuUm+%xd}uH#C2Pna$r|M)NmlZulIQf-O*LldsC2 zuTQoy_=dDv#{-*2yyr)=WnUL#W#OJcqT1@U3!bBazsc6|j~6S?+Fz(VYagxv9;|D# z-&=d?!m66%SXF-tD;vJWin-o7*-g288Z@#b+oJqh66y0*5}4X4kos6BpZdHr!FfIAybVrjz(uL+=e z%GXy6zEG}n_5mC|e5xIw+&-muS%y!nJ~1xid=kK=i(un#2Rbjf1aRzcU0w9G9ZNde zNdSk}ojXULf3)}f1y2IFuc57dO=DZfss?+v<2MRZ~}KUp2U)d<2ZfF@elp+ z_vhRK`1tqi*J9lR-!cKLx#I-;{KWAtw*cnNIp%nQfI|RRXy*H;RIt6DE@liBJRK2J zV+zN9pX+k=elPOI6TZe;02jM}SLU8=ABq5;oz>pt0Ka;{@%{G?obO!S*w((Psm*@wEH2Snv1)p|{mv%4 z{q!lv>ahHV6FB}&7ykK0C;s^Ud4~WV>@9$fj!Ss+@L6WRJ#uyc0eIir7f@AhLJ2GS z5X$}g&UpWDXk!Z*czt3iK8`hao*Kp$aOFZh zq0#_Fa3Z^?Ne&(fgl_DRSOjAAAFfvEw$}ylV*OdW{do62K2!m$ztyn?w0(E+(kl;l zbR5}ro=xp9|LWKRdJ1604feL%TI}|Jf7Ru5KOHN;P0g)Xv+Ub$0kj;$jOJq=1TZ%6 z1(c|fXxwdC2r@Nip!@lBMVoHvvWuFmC$RbmPpT=rYGvDFApi;k-+s~odpH6hCveXb z=Q`SZID!B8TUXbk3)|cK6Tq#_cKiB=9lwLE01uw-a%=%7-2%9N%5lt`avbw->h=qo zr+hPJ@Wr}N1Qp!CI)u|xIS4qL?eRq{5};LpHE5EkcJoB4bf1YZhMEW(N+$3=N(nc% zwLLbk{oMUGw0GRy)Yi75vCZxhz#UC?`|VA3`;sQRodmGB*=}FdY`5RsVz)1BIb)yS za=LA9^Qm*Qn_IhBB8XOimR3xkdJNO1wqnZERhPy${G7jQ_k3DPx-F>`Y9*R&unS!a%2L(LCchH(9rY+ zYZps~i)004x%2_X6n!(zb0%&6_>|^>GJ!ymfj_aAhu4Ucvy$YBsZb683 zw!0YvTjC|E8J!8LN>KXgYY2UR?pL*(S z%ar363JPC2!4)abv6(K>um+FR7LFQ6(o;0(iJJ6KMVi%`=v-#>F+F3493-obzc!^_?%v17b?9nJ{j&S}Uu0%DDD^fne6Djxc#Hu4avGOCHSoJwy zq&mqLDbF(#t4{JHs?VL@dz&Xw?xTk-P``aj)=-+(w(Yc`b~~(%+oALMz747gc+uAJ z!V9*u|M7|dXccH`Yagx;Fu)4%pBdA?d)^6u%*L{1_|aJY{vXCT9LtvBM*yzfFz$yj z@?qVD|EYcz*|j^7HRFAZ-vgU#anKvu_(o@X(_2UzuWxS6_6sqz@7HecwA!}e|6T3Z zGogmdseYIcDgdFup5KIE7`%R}M?=}1%pK&xAw?jvJKdl5;`?XBiQTGle*Zl^T zhBr`P`|S^V?Duj^c^i{#hcPa)YPN0o@2Y)JkGIw6hj9hQGT=wGJCRcRDy+3TE=2zD zreEPv`xdl~zq)#9*1BDYVDPuYTC*GeSL=0rF9&S{wTC;cWOawz?P);a2|ffu1U}dWGO~J!-mL$i*M#b=QZ@^|F(a&NZXNhN z{0@A+=X=iY{L0EoM0$QXuC@-G=JZI8Ga@-gkMPbLX;znqmEa2LOr7h^>7ca5+K$#qyGFYbf!{hZ%HH4n**(wj(}ZVZ8!qD zGWe+=K!|~#Y#cr4APUji=fEUq-y;hJ0Zt2N2wnkSlW<@!EyBxe9Kv2AR)X4?0mW5<)1#n7-EJwh z^(pZT|L;<#Kvx*6d z_uKHYOZsaQKfYc6^=>Yoe?FVfFFsuT{bq3$*T!FM!fK5@{WUHSyDQ7`&TVUKJD5K9 zW9oMH`^?zjx2e&SpYI<`KA7|w^*PauU-dWjWf_LqRq_)R$I*H0=zM~T;#~GI+;;w7 Z&>xh58$brSowxu1002ovPDHLkV1m3?Ns|Bo diff --git a/mcp/icons/icon48.png b/mcp/icons/icon48.png deleted file mode 100644 index 7f7de15f8c8c1a0539de4ab6919c4ea43ce325bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3406 zcmV-U4YBfxP)T~2@O-=`@=Rj!Ukv=pRGm-BTb}W6*ml+$>Vn2#N2-=XvQjq|srWUO~zf#NOM)!?)BhMth^M!+7p`Cv1PQM&mjNKvy$R?@S=r>K~* zP>)5bmIrOk0_*le@Rq+A-t)oEFBCpS$wVnz&LC~ik)W-iZa5=1UlP15Ld`&-6~HxwLb@GyI?UzeA}L!DSRf#ii{b-+j68Ur{o~U5wX1 zq0VUuOf0B^SWq)>@TnRW#q0W@(23GPCp)3#%)Nx+lIc?@egnxo?Z}4cuYs6f1BK2g z!KX;OF@Nx>M8Nt!m?~Oe2-Jgd_`rLLp`wgyFA4seDO91(!Hwcpv)dnX75``CezpFjGv+rZecwIa?O*n8HeX{%c0U+XM|Vr7SOgV zFr*VZa-p;5N?xz`1z{*`L|S;Pbi-aKG@KM_&LRmQ!Fh_I z)EQRI37)3uZ&23EkCd!Q7BJE04JD0I{Z9q2HrQZoT!NgQ%_zR(#|S?B0-E}cApG>7 z(el)BH1xiPn(eEa_*(lCsoOAk7dH1i7v-}>^KKx&(-25zr>`ExKJd|2q zI?zf=ST?Hwjmh;YnQNwk*IL}*vP-0zHWW3YaKjFS`i`Lbhc6+p;fL@uan_fZxJ|m0BX@H!;{eJo$!C_Q7PjpogSXZEvVZz0M1n;37}10 z&}r^NGr}h)Yeh0Sl5&`8JYbx8a79-j_|S`}-+c&~OE*e>Z7gkqv7|{7Mc}iR-HN6s zj-d3;$5C>7FG9VC;pzO23{S=e*5-qX*2@A|X8?KEeP1pclKHH~wbv%qu)m3V*~K7eT3BEd8^d0&==OrnGZkrCuCi_5r%?# z*n$yMH@2XgR=s9%Kk zrVtt$n^9NajMnN9tYz&GyrpQ`eO!X4Em_3hB{(9$6J8BdQM(MU)C$P%{w^sS37#a5 zHhMstGY(8EfJ)CgkxCn6crK$9_1pWw*nMM;F`oT%%}FI#WO%)=8sT3YmwcXNp1^<5 zWx@L$Zq!ybBUsuD!CQvV&SNq>ZSqJ5mI%o1x(9-%92(97V?iUdq75pYD8rM`@abS| zzW1gTK-+Q$Qz>3_BTx2(^_9P+PhHEu|rt z{VkHygtomc!)x_6Y4)*{Eky91gJW6dEa$){!%G5m25=64VtN7g+(893xy!QdfCNSA zogCT=XB*a;FToR^U+~16@I==@$SQ-Ss2RbsW>gk8BhA+U#!&!A=w>wh;0=gbRY)(3 zLT4v-nh$5gP4Hd6Rd$=H;8jH2tUF-MI-$@RrX0*%ksdf(Zw8lHItH)dBmpYUEH^20 zWdxP?K98#Ve+f%P6#Be6@ZK`mYOX`|mV>C?{9BmvTi~d_5$4hew4z;tPOs>OqoHR; zcu9be4%VLc?u;&^(c7k+Dn&AMIsFiGgA%wsv>eXxw;<+JgK-DoS-2M7h3jD`Xh80@ z-$QfnI|$zUYXny8Lj6OpBd6k?c z9bQR`C|tP*l)*6>UMGUFWy|m+1a}EJZ`aT5MrOu$MXO+$`JSBj&2avyP z+vhS*%Eg%9D8rM6$Jl%y5VoYbEG5l}~Am%&kY(|Mm~ zO<--gl8YJh&I=&+tI-)(B+Y%5GGQkH_&-$Jg8L;$(G&nLW8GMoi!oqkGqHEV?EEr*sjuTHv*^%WIs z{t=&10!y%CUg32{kJOl^glCKpJ!Q}u(jU91XQRF0GfN+B8|vTLHZ<@^`_RA-t{xnC zAaeTf`UOW%t%zR|g+lFF0+lOM?B15rV%ZCOZ=opM`SvVNGv*VM| zTNi$Wb|I;dP+eF>GxmK z?*niDDn9zVCr3w)9gN5S<@({l|M`79vFEno;Vsd@*dwckhj-r*8(kOu=JxY$#T{8T*fT!0E563?}3nJjpuf^jp?-?1{bJv;S zV~693qy3|a?VE;&|8yjt*s*2s(+}TIoZYNrv{gI zeLQk)*9VE#$SY?#cQK@J6@s4_?qbRJouQsl#_s#IT4!8&*%`lZJ=SvOnhRa%!N}mi zmX5)JyQ8NE?pP9g;g@km^a)s#zRcD6 z0+`7D5znQ(H}W)`(Y^TcvQJjgetb1@07BA5u7-cZmEnKI-zNPvtnhw(v;Fy@IUm08 kJ|uTM880K^zX+iJ2lv=>5Iqm?d;kCd07*qoM6N<$g2scb@Bjb+ diff --git a/mcp/inject.js b/mcp/inject.js deleted file mode 100644 index 3d7ab7b..0000000 --- a/mcp/inject.js +++ /dev/null @@ -1,2447 +0,0 @@ -(function() { - "use strict"; - (function() { - const PAGE_SOURCE = "REACT_DEBUGGER_PAGE"; - const CONTENT_SOURCE = "REACT_DEBUGGER_CONTENT"; - let debuggerEnabled = false; - let extensionAlive = true; - let messageQueue = []; - let flushTimeout = null; - let messageCount = 0; - let lastCountReset = Date.now(); - let currentThrottle = 100; - const MAX_BATCH_SIZE = 100; - function getAdaptiveThrottle() { - const now = Date.now(); - if (now - lastCountReset > 1e3) { - const rate = messageCount; - messageCount = 0; - lastCountReset = now; - if (rate < 5) currentThrottle = 200; - else if (rate < 20) currentThrottle = 100; - else currentThrottle = 50; - } - messageCount++; - return currentThrottle; - } - function log(...args) { - } - function flushMessages() { - if (!extensionAlive || messageQueue.length === 0) { - messageQueue = []; - return; - } - let messages = messageQueue; - messageQueue = []; - flushTimeout = null; - if (messages.length > MAX_BATCH_SIZE) { - messages = messages.slice(-MAX_BATCH_SIZE); - } - for (const msg of messages) { - try { - window.postMessage({ source: PAGE_SOURCE, type: msg.type, payload: msg.payload }, "*"); - } catch { - extensionAlive = false; - break; - } - } - } - function sendFromPage(type, payload) { - if (!extensionAlive) return; - const alwaysAllowedMessages = [ - "DEBUGGER_STATE_CHANGED", - "REACT_DETECTED", - "REDUX_DETECTED", - "REDUX_STATE_CHANGE", - "REDUX_OVERRIDES_CLEARED" - ]; - if (!debuggerEnabled && !alwaysAllowedMessages.includes(type)) { - return; - } - const criticalMessages = [ - "REACT_DETECTED", - "REDUX_DETECTED", - "REDUX_STATE_CHANGE", - "DEBUGGER_STATE_CHANGED", - "REDUX_OVERRIDES_CLEARED" - ]; - if (criticalMessages.includes(type)) { - try { - window.postMessage({ source: PAGE_SOURCE, type, payload }, "*"); - } catch { - extensionAlive = false; - } - return; - } - messageQueue.push({ type, payload }); - if (!flushTimeout) { - flushTimeout = window.setTimeout(flushMessages, getAdaptiveThrottle()); - } - } - function listenFromContent(callback) { - window.addEventListener("message", (event) => { - if (event.source !== window) return; - if (!event.data || event.data.source !== CONTENT_SOURCE) return; - callback({ type: event.data.type, payload: event.data.payload }); - }); - } - function generateId() { - return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; - } - let lastTimestamp = 0; - let timestampCounter = 0; - function getUniqueTimestamp() { - const now = Date.now(); - if (now === lastTimestamp) { - timestampCounter++; - } else { - timestampCounter = 0; - lastTimestamp = now; - } - return now + timestampCounter * 1e-3; - } - function scheduleIdleWork(callback, timeoutMs = 500) { - if ("requestIdleCallback" in window) { - window.requestIdleCallback(callback, { timeout: timeoutMs }); - } else { - setTimeout(callback, 0); - } - } - function sanitizeValue(value, depth = 0) { - if (depth > 5) return "[Object depth exceeded]"; - if (value === null) return null; - if (value === void 0) return void 0; - const type = typeof value; - if (type === "string") return value.slice(0, 500); - if (type === "number" || type === "boolean") return value; - if (type === "function") return `[Function: ${value.name || "anonymous"}]`; - if (type === "symbol") return `[Symbol]`; - if (Array.isArray(value)) { - if (value.length > 50) return `[Array(${value.length})]`; - return value.slice(0, 50).map((v) => sanitizeValue(v, depth + 1)); - } - if (type === "object") { - const obj = value; - if (obj.$$typeof) return "[React Element]"; - if (obj instanceof HTMLElement) return `[${obj.tagName}]`; - if (obj instanceof Event) return "[Event]"; - if (obj instanceof Error) return `[Error: ${obj.message}]`; - if (obj instanceof Date) return obj.toISOString(); - if (obj instanceof RegExp) return obj.toString(); - if (obj instanceof Map) return `[Map(${obj.size})]`; - if (obj instanceof Set) return `[Set(${obj.size})]`; - if (obj instanceof Promise) return "[Promise]"; - const result = {}; - const keys = Object.keys(obj).slice(0, 30); - for (const key of keys) { - try { - result[key] = sanitizeValue(obj[key], depth + 1); - } catch { - result[key] = "[Error]"; - } - } - return result; - } - return String(value); - } - const FIBER_TAGS = { - FunctionComponent: 0, - ClassComponent: 1, - HostRoot: 3, - HostComponent: 5, - HostText: 6, - Fragment: 7, - ForwardRef: 11, - MemoComponent: 14, - SimpleMemoComponent: 15 - }; - const FIBER_FLAGS = { - PerformedWork: 1, - Placement: 2, - Update: 4, - Passive: 512 - }; - const lastEffectStates = /* @__PURE__ */ new Map(); - function didFiberRender(fiber) { - var _a, _b; - const alternate = fiber.alternate; - if (!alternate) return true; - const flags = fiber.flags ?? fiber.effectTag ?? 0; - if (flags & (FIBER_FLAGS.PerformedWork | FIBER_FLAGS.Update | FIBER_FLAGS.Placement | FIBER_FLAGS.Passive)) { - return true; - } - if (fiber.actualDuration > 0) { - return true; - } - const lanes = fiber.lanes ?? 0; - if (lanes !== 0) { - return true; - } - if (fiber.memoizedProps !== alternate.memoizedProps) return true; - if (fiber.memoizedState !== alternate.memoizedState) return true; - const currentContext = (_a = fiber.dependencies) == null ? void 0 : _a.firstContext; - const alternateContext = (_b = alternate.dependencies) == null ? void 0 : _b.firstContext; - if (currentContext !== alternateContext) return true; - if (fiber.type !== alternate.type) return true; - return false; - } - const renderCounts = /* @__PURE__ */ new Map(); - const lastRenderTimes = /* @__PURE__ */ new Map(); - const recentRenderTimestamps = /* @__PURE__ */ new Map(); - const reportedEffectIssues = /* @__PURE__ */ new Set(); - const reportedExcessiveRerenders = /* @__PURE__ */ new Set(); - const reportedSlowRenders = /* @__PURE__ */ new Set(); - const EXCESSIVE_RENDER_THRESHOLD = 10; - const EXCESSIVE_RENDER_WINDOW_MS = 1e3; - const componentRenderIds = /* @__PURE__ */ new Map(); - const trackedClosures = /* @__PURE__ */ new Map(); - const staleClosureIssues = /* @__PURE__ */ new Map(); - let closureIdCounter = 0; - const originalSetTimeout = window.setTimeout; - const originalSetInterval = window.setInterval; - const originalAddEventListener = EventTarget.prototype.addEventListener; - function getCurrentComponentContext() { - const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; - if (!hook || !hook.renderers) return null; - try { - for (const [, renderer] of hook.renderers) { - if (renderer.getCurrentFiber) { - const fiber = renderer.getCurrentFiber(); - if (fiber) { - const name = getComponentName(fiber); - const path = getComponentPath(fiber); - const fiberId = `${name}_${path.join("/")}`; - const renderId = componentRenderIds.get(fiberId) || 0; - return { name, path, renderId }; - } - } - } - } catch { - return null; - } - return null; - } - function extractFunctionName(fn) { - if (fn.name) return fn.name; - const fnStr = fn.toString(); - const match = fnStr.match(/function\s+([^\s(]+)/); - return match ? match[1] : "anonymous"; - } - function trackClosure(fn, asyncType, context) { - const closureId = ++closureIdCounter; - const capturedState = /* @__PURE__ */ new Map(); - const fnStr = fn.toString(); - const statePatterns = [ - /\b(count|value|data|user|items|state|props|isLoading|isOpen|error|result)\b/gi - ]; - for (const pattern of statePatterns) { - const matches = fnStr.match(pattern); - if (matches) { - matches.forEach((match) => { - capturedState.set(match.toLowerCase(), `[captured at render #${context.renderId}]`); - }); - } - } - trackedClosures.set(closureId, { - componentName: context.name, - componentPath: context.path, - renderId: context.renderId, - createdAt: Date.now(), - functionName: extractFunctionName(fn), - capturedState, - asyncType - }); - return closureId; - } - function checkStaleClosureOnExecution(closureId) { - const tracker = trackedClosures.get(closureId); - if (!tracker) return; - const fiberId = `${tracker.componentName}_${tracker.componentPath.join("/")}`; - const currentRenderId = componentRenderIds.get(fiberId) || 0; - if (currentRenderId > tracker.renderId + 1) { - const issueKey = `${fiberId}_${tracker.functionName}_${tracker.asyncType}`; - if (!staleClosureIssues.has(issueKey)) { - const issue = { - id: generateId(), - type: "STALE_CLOSURE", - severity: "warning", - component: tracker.componentName, - message: `${tracker.asyncType} callback "${tracker.functionName}" may be using stale values from render #${tracker.renderId} (current: #${currentRenderId})`, - suggestion: "Use useCallback with proper dependencies, or useRef for mutable values that should persist across renders", - timestamp: Date.now(), - location: { - componentName: tracker.componentName, - componentPath: tracker.componentPath, - closureInfo: { - functionName: tracker.functionName, - createdAtRender: tracker.renderId, - executedAtRender: currentRenderId, - capturedValues: Array.from(tracker.capturedState.entries()).map(([name, value]) => ({ - name, - capturedValue: value, - currentValue: "[current value]" - })), - asyncType: tracker.asyncType - } - } - }; - staleClosureIssues.set(issueKey, issue); - sendFromPage("STALE_CLOSURE_DETECTED", issue); - } - } - if (Date.now() - tracker.createdAt > 6e4) { - trackedClosures.delete(closureId); - } - } - function _installClosureTracking() { - window.setTimeout = function(callback, delay, ...args) { - if (typeof callback !== "function") { - return originalSetTimeout.call(window, callback, delay, ...args); - } - const context = getCurrentComponentContext(); - if (!context) { - return originalSetTimeout.call(window, callback, delay, ...args); - } - const closureId = trackClosure(callback, "setTimeout", context); - const wrappedCallback = function() { - checkStaleClosureOnExecution(closureId); - return callback.apply(this, args); - }; - return originalSetTimeout.call(window, wrappedCallback, delay); - }; - window.setInterval = function(callback, delay, ...args) { - if (typeof callback !== "function") { - return originalSetInterval.call(window, callback, delay, ...args); - } - const context = getCurrentComponentContext(); - if (!context) { - return originalSetInterval.call(window, callback, delay, ...args); - } - const closureId = trackClosure(callback, "setInterval", context); - const wrappedCallback = function() { - checkStaleClosureOnExecution(closureId); - return callback.apply(this, args); - }; - return originalSetInterval.call(window, wrappedCallback, delay); - }; - EventTarget.prototype.addEventListener = function(type, listener, options) { - if (!listener || typeof listener !== "function") { - return originalAddEventListener.call(this, type, listener, options); - } - const context = getCurrentComponentContext(); - if (!context) { - return originalAddEventListener.call(this, type, listener, options); - } - const closureId = trackClosure(listener, "eventListener", context); - const wrappedListener = function(event) { - checkStaleClosureOnExecution(closureId); - return listener.call(this, event); - }; - wrappedListener.__reactDebuggerOriginal = listener; - wrappedListener.__reactDebuggerClosureId = closureId; - return originalAddEventListener.call(this, type, wrappedListener, options); - }; - } - function getComponentName(fiber) { - var _a, _b, _c, _d; - if (!fiber) return "Unknown"; - const { type, tag } = fiber; - if (tag === FIBER_TAGS.HostComponent) return typeof type === "string" ? type : "HostComponent"; - if (tag === FIBER_TAGS.HostText) return "#text"; - if (tag === FIBER_TAGS.HostRoot) return "Root"; - if (tag === FIBER_TAGS.Fragment) return "Fragment"; - if (typeof type === "function") { - return type.displayName || type.name || "Anonymous"; - } - if (typeof type === "object" && type !== null) { - if (type.$$typeof === Symbol.for("react.forward_ref")) { - return ((_a = type.render) == null ? void 0 : _a.displayName) || ((_b = type.render) == null ? void 0 : _b.name) || "ForwardRef"; - } - if (type.$$typeof === Symbol.for("react.memo")) { - return ((_c = type.type) == null ? void 0 : _c.displayName) || ((_d = type.type) == null ? void 0 : _d.name) || "Memo"; - } - } - return "Unknown"; - } - function isUserComponent(fiber) { - const { tag } = fiber; - return tag === FIBER_TAGS.FunctionComponent || tag === FIBER_TAGS.ClassComponent || tag === FIBER_TAGS.ForwardRef || tag === FIBER_TAGS.MemoComponent || tag === FIBER_TAGS.SimpleMemoComponent; - } - const pathCache = /* @__PURE__ */ new Map(); - const PATH_CACHE_LIMIT = 500; - function clearPathCache() { - pathCache.clear(); - } - function getComponentPath(fiber) { - if (!fiber) return []; - if (pathCache.has(fiber)) { - return pathCache.get(fiber); - } - const path = []; - let current = fiber; - let depth = 0; - while (current && depth < 10) { - if (isUserComponent(current)) { - path.unshift(getComponentName(current)); - } - current = current.return; - depth++; - } - if (pathCache.size >= PATH_CACHE_LIMIT) { - const firstKey = pathCache.keys().next().value; - if (firstKey) pathCache.delete(firstKey); - } - pathCache.set(fiber, path); - return path; - } - function getElementType(fiber) { - if (fiber.tag === FIBER_TAGS.HostComponent) { - return typeof fiber.type === "string" ? `<${fiber.type}>` : ""; - } - if (fiber.tag === FIBER_TAGS.Fragment) { - return ""; - } - return getComponentName(fiber); - } - const EFFECT_HAS_EFFECT = 1; - const EFFECT_PASSIVE = 4; - function getEffectsFromFiber(fiber) { - const effects = []; - if (!fiber.memoizedState) return effects; - let hook = fiber.memoizedState; - let hookIndex = 0; - const maxHooks = 50; - while (hook && hookIndex < maxHooks) { - const memoizedState = hook.memoizedState; - if (memoizedState && typeof memoizedState === "object") { - if ("create" in memoizedState || "destroy" in memoizedState || "tag" in memoizedState) { - effects.push({ - tag: memoizedState.tag || 0, - create: memoizedState.create || null, - destroy: memoizedState.destroy, - deps: memoizedState.deps || null, - next: memoizedState.next || null - }); - } - } - hook = hook.next; - hookIndex++; - } - return effects; - } - function analyzeEffectForIssues(effect, componentName, componentPath, effectIndex, issues) { - const isPassiveEffect = (effect.tag & EFFECT_PASSIVE) !== 0; - const hasEffect = (effect.tag & EFFECT_HAS_EFFECT) !== 0; - if (!isPassiveEffect && !hasEffect) return; - const createFn = effect.create; - const destroyFn = effect.destroy; - const deps = effect.deps; - if (createFn) { - const fnStr = createFn.toString(); - const hasTimerPattern = /\b(setInterval|setTimeout)\s*\(/.test(fnStr); - const hasEventListenerPattern = /\b(addEventListener)\s*\(/.test(fnStr); - const hasSubscriptionPattern = /\b(subscribe|on\(|addListener)\s*\(/.test(fnStr); - const hasWebSocketPattern = /\b(WebSocket|EventSource)\b/.test(fnStr); - const needsCleanup = hasTimerPattern || hasEventListenerPattern || hasSubscriptionPattern || hasWebSocketPattern; - if (needsCleanup && destroyFn === void 0) { - const issueKey = `${componentName}_MISSING_CLEANUP_${effectIndex}`; - if (!reportedEffectIssues.has(issueKey)) { - reportedEffectIssues.add(issueKey); - let resourceType = "resource"; - if (hasTimerPattern) resourceType = "timer (setInterval/setTimeout)"; - else if (hasEventListenerPattern) resourceType = "event listener"; - else if (hasSubscriptionPattern) resourceType = "subscription"; - else if (hasWebSocketPattern) resourceType = "WebSocket/EventSource"; - issues.push({ - id: generateId(), - type: "MISSING_CLEANUP", - severity: "warning", - component: componentName, - message: `useEffect with ${resourceType} has no cleanup function`, - suggestion: `Return a cleanup function to remove the ${resourceType} when component unmounts`, - timestamp: Date.now(), - location: { - componentName, - componentPath, - effectIndex - } - }); - } - } - const hasStateSetterPattern = /\b(set[A-Z]\w*)\s*\(/.test(fnStr); - const hasDispatchPattern = /\bdispatch\s*\(/.test(fnStr); - if ((hasStateSetterPattern || hasDispatchPattern) && deps !== null && deps.length === 0) { - if (!hasTimerPattern && !hasEventListenerPattern) { - const issueKey = `${componentName}_INFINITE_LOOP_RISK_${effectIndex}`; - if (!reportedEffectIssues.has(issueKey)) { - reportedEffectIssues.add(issueKey); - issues.push({ - id: generateId(), - type: "INFINITE_LOOP_RISK", - severity: "error", - component: componentName, - message: `useEffect updates state but has empty dependency array`, - suggestion: "Add conditions to prevent updates on every render, or include proper dependencies", - timestamp: Date.now(), - location: { - componentName, - componentPath, - effectIndex - } - }); - } - } - } - if (deps === null) { - const usesPropsOrState = /\b(props\.|state\.|use[A-Z])/i.test(fnStr); - if (usesPropsOrState) { - const issueKey = `${componentName}_MISSING_DEP_${effectIndex}`; - if (!reportedEffectIssues.has(issueKey)) { - reportedEffectIssues.add(issueKey); - issues.push({ - id: generateId(), - type: "MISSING_DEP", - severity: "info", - component: componentName, - message: `useEffect without dependency array runs on every render`, - suggestion: "Consider adding a dependency array to control when the effect runs", - timestamp: Date.now(), - location: { - componentName, - componentPath, - effectIndex - } - }); - } - } - } - } - } - function checkEffectHooks(fiber, issues) { - if (!isUserComponent(fiber)) return; - const componentName = getComponentName(fiber); - const componentPath = getComponentPath(fiber); - const effects = getEffectsFromFiber(fiber); - effects.forEach((effect, index) => { - analyzeEffectForIssues(effect, componentName, componentPath, index, issues); - }); - } - function getEffectTagName(tag) { - const tags = []; - if (tag & EFFECT_HAS_EFFECT) tags.push("HasEffect"); - if (tag & EFFECT_PASSIVE) tags.push("Passive"); - if (tags.length === 0) return "None"; - return tags.join("+"); - } - function extractEffectPreview(effect) { - const result = {}; - if (effect.deps) { - const depNames = effect.deps.map((dep, i) => { - if (dep === null) return "null"; - if (dep === void 0) return "undefined"; - if (typeof dep === "function") return `fn${i}`; - if (typeof dep === "object") return `obj${i}`; - if (typeof dep === "string") return `"${dep.slice(0, 10)}${dep.length > 10 ? "..." : ""}"`; - return String(dep); - }); - result.depsPreview = `[${depNames.join(", ")}]`; - } else if (effect.deps === null) { - result.depsPreview = "[]"; - } - if (effect.create) { - const fnStr = effect.create.toString(); - const hints = []; - if (/fetch\s*\(/i.test(fnStr)) hints.push("fetch"); - if (/setInterval\s*\(/i.test(fnStr)) hints.push("setInterval"); - if (/setTimeout\s*\(/i.test(fnStr)) hints.push("setTimeout"); - if (/addEventListener\s*\(/i.test(fnStr)) hints.push("addEventListener"); - if (/subscribe\s*\(/i.test(fnStr)) hints.push("subscribe"); - if (/\.on\s*\(/i.test(fnStr)) hints.push("event listener"); - if (hints.length > 0) { - result.createFnPreview = hints.join(", "); - } else { - const firstLine = fnStr.split("\n")[0].slice(0, 50); - result.createFnPreview = firstLine.length < fnStr.length ? firstLine + "..." : firstLine; - } - } - return result; - } - function detectEffectChanges(fiber) { - if (!isUserComponent(fiber)) return []; - const componentName = getComponentName(fiber); - const fiberId = `${componentName}_${getComponentPath(fiber).join("/")}`; - const effects = getEffectsFromFiber(fiber); - const changes = []; - if (!lastEffectStates.has(fiberId)) { - lastEffectStates.set(fiberId, /* @__PURE__ */ new Map()); - } - const prevStates = lastEffectStates.get(fiberId); - effects.forEach((effect, index) => { - var _a; - const hasEffect = (effect.tag & EFFECT_HAS_EFFECT) !== 0; - const hasDestroy = effect.destroy !== void 0 && effect.destroy !== null; - const depCount = (_a = effect.deps) == null ? void 0 : _a.length; - const effectTag = getEffectTagName(effect.tag); - const prevState = prevStates.get(index); - const { depsPreview, createFnPreview } = extractEffectPreview(effect); - if (!prevState) { - if (hasEffect) { - changes.push({ - type: "run", - effectIndex: index, - depCount, - hasCleanup: hasDestroy, - effectTag, - depsPreview, - createFnPreview - }); - } - } else { - if (hasEffect && !prevState.hasEffect) { - changes.push({ - type: "run", - effectIndex: index, - depCount, - hasCleanup: hasDestroy, - effectTag, - depsPreview, - createFnPreview - }); - } - if (hasDestroy && !prevState.hasDestroy && prevState.hasEffect) { - changes.push({ - type: "cleanup", - effectIndex: index, - depCount, - hasCleanup: true, - effectTag, - depsPreview, - createFnPreview - }); - } - } - prevStates.set(index, { hasEffect, hasDestroy }); - }); - return changes; - } - function tryInferStateName(fiber, hookIndex) { - try { - const componentType = fiber.type; - if (!componentType) return void 0; - let sourceCode; - if (typeof componentType === "function") { - sourceCode = componentType.toString(); - } - if (!sourceCode) return void 0; - const useStatePattern = /(?:const|let|var)\s*\[\s*(\w+)\s*,\s*set\w*\s*\]\s*=\s*(?:React\.)?useState/g; - const matches = []; - let match; - while ((match = useStatePattern.exec(sourceCode)) !== null) { - matches.push(match[1]); - } - if (matches[hookIndex]) { - return matches[hookIndex]; - } - return void 0; - } catch { - return void 0; - } - } - function serializeValueForDisplay(value, maxLength = 200) { - if (value === null) return "null"; - if (value === void 0) return "undefined"; - const type = typeof value; - if (type === "string") { - const str = value; - if (str.length > maxLength) return `"${str.slice(0, maxLength)}..."`; - return `"${str}"`; - } - if (type === "number" || type === "boolean") { - return String(value); - } - if (type === "function") { - return `[Function: ${value.name || "anonymous"}]`; - } - if (Array.isArray(value)) { - if (value.length === 0) return "[]"; - try { - const preview = JSON.stringify(value); - if (preview.length <= maxLength) return preview; - const items = value.slice(0, 5).map((item) => serializeValueForDisplay(item, 30)); - const suffix = value.length > 5 ? `, ... (${value.length} items)` : ""; - return `[${items.join(", ")}${suffix}]`; - } catch { - return `Array(${value.length})`; - } - } - if (type === "object") { - const obj = value; - if (obj.$$typeof) return "[React Element]"; - if (obj instanceof HTMLElement) return `[HTMLElement: ${obj.tagName}]`; - if (obj instanceof Date) return obj.toISOString(); - if (obj instanceof RegExp) return obj.toString(); - if (obj instanceof Map) return `Map(${obj.size})`; - if (obj instanceof Set) return `Set(${obj.size})`; - if (obj instanceof Error) return `Error: ${obj.message}`; - try { - const preview = JSON.stringify(obj); - if (preview.length <= maxLength) return preview; - const keys = Object.keys(obj).slice(0, 5); - const items = keys.map((k) => { - const v = serializeValueForDisplay(obj[k], 30); - return `${k}: ${v}`; - }); - const suffix = Object.keys(obj).length > 5 ? ", ..." : ""; - return `{${items.join(", ")}${suffix}}`; - } catch { - return "[Object]"; - } - } - return String(value); - } - function extractScalarValue(value) { - if (value === null) return { str: "null", isExtractable: true }; - if (value === void 0) return { str: "undefined", isExtractable: true }; - const type = typeof value; - if (type === "string" || type === "number" || type === "boolean") { - return { str: serializeValueForDisplay(value), isExtractable: true }; - } - if (type === "function") { - return { str: serializeValueForDisplay(value), isExtractable: false }; - } - return { str: serializeValueForDisplay(value), isExtractable: true }; - } - function detectLocalStateChanges(fiber) { - if (!isUserComponent(fiber)) return []; - const alternate = fiber.alternate; - if (!alternate) return []; - const componentName = getComponentName(fiber); - const changes = []; - let currentHook = fiber.memoizedState; - let alternateHook = alternate.memoizedState; - let hookIndex = 0; - let useStateIndex = 0; - const maxHooks = 50; - while (currentHook && alternateHook && hookIndex < maxHooks) { - const isEffectHook = currentHook.memoizedState && typeof currentHook.memoizedState === "object" && ("create" in currentHook.memoizedState || "destroy" in currentHook.memoizedState); - if (!isEffectHook) { - const prevValue = alternateHook.memoizedState; - const currValue = currentHook.memoizedState; - if (prevValue !== currValue) { - const oldExtracted = extractScalarValue(prevValue); - const newExtracted = extractScalarValue(currValue); - const inferredName = tryInferStateName(fiber, useStateIndex); - changes.push({ - componentName, - hookIndex, - oldValue: oldExtracted.str, - newValue: newExtracted.str, - valueType: typeof currValue, - isExtractable: oldExtracted.isExtractable && newExtracted.isExtractable, - stateName: inferredName - }); - } - useStateIndex++; - } - currentHook = currentHook.next; - alternateHook = alternateHook.next; - hookIndex++; - } - return changes; - } - const previousContextValues = /* @__PURE__ */ new WeakMap(); - function getContextDisplayName(context) { - var _a, _b; - if (!context) return void 0; - if (context.displayName) return context.displayName; - if ((_b = (_a = context.Provider) == null ? void 0 : _a._context) == null ? void 0 : _b.displayName) return context.Provider._context.displayName; - if (context._currentValue !== void 0 && typeof context._currentValue === "object" && context._currentValue !== null) { - const keys = Object.keys(context._currentValue); - if (keys.length > 0 && keys.length <= 3) { - return `Context(${keys.join(", ")})`; - } - } - return "Context"; - } - function detectContextChanges(fiber) { - if (!isUserComponent(fiber)) return []; - const alternate = fiber.alternate; - if (!alternate) return []; - const componentName = getComponentName(fiber); - const changes = []; - const deps = fiber.dependencies; - const altDeps = alternate.dependencies; - if (!(deps == null ? void 0 : deps.firstContext) && !(altDeps == null ? void 0 : altDeps.firstContext)) return []; - let contextDep = deps == null ? void 0 : deps.firstContext; - let altContextDep = altDeps == null ? void 0 : altDeps.firstContext; - while (contextDep || altContextDep) { - const context = (contextDep == null ? void 0 : contextDep.context) || (altContextDep == null ? void 0 : altContextDep.context); - if (context) { - const currentValue = context._currentValue ?? context._currentValue2; - const prevValue = previousContextValues.get(context); - if (prevValue !== void 0 && currentValue !== prevValue) { - const contextType = getContextDisplayName(context); - const changedKeys = []; - if (typeof prevValue === "object" && prevValue !== null && typeof currentValue === "object" && currentValue !== null) { - const allKeys = /* @__PURE__ */ new Set([...Object.keys(prevValue), ...Object.keys(currentValue)]); - for (const key of allKeys) { - if (prevValue[key] !== currentValue[key]) { - changedKeys.push(key); - } - } - } - changes.push({ - componentName, - contextType, - changedKeys: changedKeys.length > 0 ? changedKeys : void 0 - }); - } - previousContextValues.set(context, currentValue); - } - contextDep = (contextDep == null ? void 0 : contextDep.next) || null; - altContextDep = (altContextDep == null ? void 0 : altContextDep.next) || null; - } - return changes; - } - function checkListKeys(fiber, issues) { - if (fiber.tag !== FIBER_TAGS.Fragment && fiber.tag !== FIBER_TAGS.HostComponent) return; - const children = []; - let child = fiber.child; - while (child) { - if (isUserComponent(child) || child.tag === FIBER_TAGS.HostComponent) { - children.push(child); - } - child = child.sibling; - } - if (children.length < 2) return; - const parentComponent = fiber.return; - const parentName = getComponentName(parentComponent); - const containerType = getElementType(fiber); - const componentPath = getComponentPath(parentComponent); - const childElements = children.map((c, index) => ({ - type: getElementType(c), - key: c.key, - index - })); - const keys = children.map((c) => c.key); - const hasNullKeys = keys.some((k) => k === null); - const nullKeyCount = keys.filter((k) => k === null).length; - const allIndexKeys = keys.every((k, i) => k === String(i)); - const location = { - componentName: parentName, - componentPath, - elementType: containerType, - listLength: children.length, - childElements - }; - if (hasNullKeys) { - const childTypes = [...new Set(childElements.map((c) => c.type))]; - const childTypesStr = childTypes.slice(0, 3).join(", ") + (childTypes.length > 3 ? "..." : ""); - issues.push({ - id: generateId(), - type: "MISSING_KEY", - severity: "error", - component: parentName, - message: `${nullKeyCount} of ${children.length} items missing keys in ${containerType} containing [${childTypesStr}]`, - suggestion: 'Add unique "key" prop to each child element', - timestamp: Date.now(), - location - }); - } else if (allIndexKeys) { - issues.push({ - id: generateId(), - type: "INDEX_AS_KEY", - severity: "warning", - component: parentName, - message: `List of ${children.length} items uses array index as key in ${containerType}`, - suggestion: "Use stable unique identifier instead of array index as key", - timestamp: Date.now(), - location - }); - } - } - function traverseFiber(fiber, callback, path = "", maxNodes = 500) { - if (!fiber) return; - const stack = [{ fiber, path }]; - let nodeCount = 0; - while (stack.length > 0 && nodeCount < maxNodes) { - const item = stack.pop(); - nodeCount++; - callback(item.fiber, item.path); - if (item.fiber.sibling) { - const parts = item.path.split("/"); - const index = parseInt(parts.pop() || "0", 10) + 1; - stack.push({ fiber: item.fiber.sibling, path: `${parts.join("/")}/${index}` }); - } - if (item.fiber.child) { - stack.push({ fiber: item.fiber.child, path: `${item.path}/0` }); - } - } - } - function detectRenderChanges(node) { - const alternate = node.alternate; - if (!alternate) { - return { type: "mount", renderReasonSummary: "Initial mount" }; - } - const prevProps = alternate.memoizedProps; - const nextProps = node.memoizedProps; - const prevState = alternate.memoizedState; - const nextState = node.memoizedState; - const changedProps = []; - const propsChanges = []; - const changedState = []; - const stateChanges = []; - if (prevProps && nextProps) { - const allKeys = /* @__PURE__ */ new Set([...Object.keys(prevProps || {}), ...Object.keys(nextProps || {})]); - for (const key of allKeys) { - if (key === "children") continue; - if (prevProps[key] !== nextProps[key]) { - changedProps.push(key); - if (propsChanges.length < 5) { - const oldExtracted = extractScalarValue(prevProps[key]); - const newExtracted = extractScalarValue(nextProps[key]); - propsChanges.push({ - key, - oldValue: oldExtracted.str, - newValue: newExtracted.str - }); - } - } - } - } - if (prevState !== nextState) { - if (typeof prevState === "object" && typeof nextState === "object" && prevState !== null && nextState !== null) { - const allStateKeys = /* @__PURE__ */ new Set([...Object.keys(prevState || {}), ...Object.keys(nextState || {})]); - for (const key of allStateKeys) { - if ((prevState == null ? void 0 : prevState[key]) !== (nextState == null ? void 0 : nextState[key])) { - changedState.push(key); - if (stateChanges.length < 5) { - const oldExtracted = extractScalarValue(prevState == null ? void 0 : prevState[key]); - const newExtracted = extractScalarValue(nextState == null ? void 0 : nextState[key]); - stateChanges.push({ - key, - oldValue: oldExtracted.str, - newValue: newExtracted.str - }); - } - } - } - } else { - changedState.push("state"); - if (stateChanges.length < 5) { - const oldExtracted = extractScalarValue(prevState); - const newExtracted = extractScalarValue(nextState); - stateChanges.push({ - key: "state", - oldValue: oldExtracted.str, - newValue: newExtracted.str - }); - } - } - } - const buildSummary = () => { - const parts = []; - if (changedProps.length > 0) { - const propsList = changedProps.slice(0, 3).join(", "); - const suffix = changedProps.length > 3 ? ` (+${changedProps.length - 3} more)` : ""; - parts.push(`Props: ${propsList}${suffix}`); - } - if (changedState.length > 0) { - const stateList = changedState.slice(0, 3).join(", "); - const suffix = changedState.length > 3 ? ` (+${changedState.length - 3} more)` : ""; - parts.push(`State: ${stateList}${suffix}`); - } - if (parts.length === 0) { - return "Parent re-rendered"; - } - return parts.join(" | "); - }; - if (changedProps.length > 0 && changedState.length > 0) { - return { - type: "props+state", - changedKeys: [...changedProps, ...changedState], - propsChanges, - stateChanges, - renderReasonSummary: buildSummary() - }; - } - if (changedProps.length > 0) { - return { - type: "props", - changedKeys: changedProps, - propsChanges, - renderReasonSummary: buildSummary() - }; - } - if (changedState.length > 0) { - return { - type: "state", - changedKeys: changedState, - stateChanges, - renderReasonSummary: buildSummary() - }; - } - return { type: "parent", renderReasonSummary: "Parent re-rendered" }; - } - function getFiberDepth(fiber) { - let depth = 0; - let current = fiber == null ? void 0 : fiber.return; - while (current) { - if (isUserComponent(current)) { - depth++; - } - current = current.return; - } - return depth; - } - let batchCounter = 0; - function getParentComponentName(fiber) { - let parent = fiber == null ? void 0 : fiber.return; - while (parent) { - if (isUserComponent(parent)) { - return getComponentName(parent); - } - parent = parent.return; - } - return void 0; - } - function analyzeFiberTree(root) { - const fiber = root.current; - const components = []; - const renders = []; - const effectEvents = []; - const localStateChanges = []; - const contextChanges = []; - const renderData = []; - const batchId = `batch_${++batchCounter}_${Date.now()}`; - let renderOrder = 0; - traverseFiber(fiber, (node, path) => { - const componentName = getComponentName(node); - const fiberId = `${componentName}_${path}`; - if (isUserComponent(node)) { - const componentPath = getComponentPath(node); - const componentPathKey = `${componentName}_${componentPath.join("/")}`; - const currentRenderId = (componentRenderIds.get(componentPathKey) || 0) + 1; - componentRenderIds.set(componentPathKey, currentRenderId); - const effectChanges = detectEffectChanges(node); - for (const change of effectChanges) { - effectEvents.push({ componentName, ...change }); - } - const stateChanges = detectLocalStateChanges(node); - localStateChanges.push(...stateChanges); - const ctxChanges = detectContextChanges(node); - contextChanges.push(...ctxChanges); - const actuallyRendered = didFiberRender(node); - if (actuallyRendered) { - const now = Date.now(); - renderOrder++; - const count = (renderCounts.get(fiberId) || 0) + 1; - renderCounts.set(fiberId, count); - lastRenderTimes.set(fiberId, now); - let timestamps = recentRenderTimestamps.get(fiberId) || []; - timestamps.push(now); - timestamps = timestamps.filter((t) => now - t < EXCESSIVE_RENDER_WINDOW_MS); - recentRenderTimestamps.set(fiberId, timestamps); - const renderChange = detectRenderChanges(node); - const actualDuration = node.actualDuration ?? 0; - const selfBaseDuration = node.selfBaseDuration ?? 0; - const parentComponent = getParentComponentName(node); - components.push({ - id: fiberId, - name: componentName, - path, - props: sanitizeValue(node.memoizedProps), - state: sanitizeValue(node.memoizedState), - renderCount: count, - lastRenderTime: now, - children: [] - }); - renders.push({ - componentId: fiberId, - componentName, - duration: actualDuration, - selfDuration: selfBaseDuration, - reason: renderChange, - renderOrder, - parentComponent, - componentPath, - batchId, - fiberDepth: getFiberDepth(node) - }); - renderData.push({ - fiberId, - componentName, - node, - rendersInLastSecond: timestamps.length, - actualDuration - }); - } - } - }); - const renderTimelineEvents = renders.map((r) => ({ - id: generateId(), - timestamp: getUniqueTimestamp(), - type: "render", - payload: { - componentName: r.componentName, - componentId: r.componentId, - trigger: r.reason.type, - changedKeys: r.reason.changedKeys, - duration: r.duration, - renderOrder: r.renderOrder, - parentComponent: r.parentComponent, - componentPath: r.componentPath, - batchId: r.batchId, - fiberDepth: r.fiberDepth, - propsChanges: r.reason.propsChanges, - stateChanges: r.reason.stateChanges, - renderReasonSummary: r.reason.renderReasonSummary - } - })); - const effectTimelineEvents = effectEvents.map((e) => ({ - id: generateId(), - timestamp: getUniqueTimestamp(), - type: "effect", - payload: { - componentName: e.componentName, - effectType: e.type, - effectIndex: e.effectIndex, - depCount: e.depCount, - hasCleanup: e.hasCleanup, - effectTag: e.effectTag, - depsPreview: e.depsPreview, - createFnPreview: e.createFnPreview - } - })); - const localStateTimelineEvents = localStateChanges.map((s) => ({ - id: generateId(), - timestamp: getUniqueTimestamp(), - type: "state-change", - payload: { - source: "local", - componentName: s.componentName, - hookIndex: s.hookIndex, - oldValue: s.oldValue, - newValue: s.newValue, - valueType: s.valueType, - isExtractable: s.isExtractable, - stateName: s.stateName - } - })); - const contextTimelineEvents = contextChanges.map((c) => ({ - id: generateId(), - timestamp: getUniqueTimestamp(), - type: "context-change", - payload: { - componentName: c.componentName, - contextType: c.contextType, - changedKeys: c.changedKeys - } - })); - const timelineEvents = [...renderTimelineEvents, ...effectTimelineEvents, ...localStateTimelineEvents, ...contextTimelineEvents]; - if (timelineEvents.length > 0) { - sendFromPage("TIMELINE_EVENTS", timelineEvents); - } - scheduleIdleWork(() => { - if (!debuggerEnabled) return; - analyzeIssuesDeferred(fiber, renderData, components, renders); - }, 500); - } - function analyzeIssuesDeferred(fiber, renderData, components, renders) { - const issues = []; - for (const data of renderData) { - const { fiberId, componentName, node, rendersInLastSecond, actualDuration } = data; - const now = Date.now(); - if (rendersInLastSecond >= EXCESSIVE_RENDER_THRESHOLD) { - const issueKey = `excessive_${fiberId}`; - if (!reportedExcessiveRerenders.has(issueKey)) { - reportedExcessiveRerenders.add(issueKey); - } - issues.push({ - id: issueKey, - type: "EXCESSIVE_RERENDERS", - severity: "warning", - component: componentName, - message: `Rendered ${rendersInLastSecond} times in less than 1 second`, - suggestion: "Consider using React.memo() to prevent unnecessary re-renders when props haven't changed", - timestamp: now, - renderCount: rendersInLastSecond - }); - } - if (actualDuration > 16) { - if (!reportedSlowRenders.has(fiberId)) { - reportedSlowRenders.add(fiberId); - issues.push({ - id: generateId(), - type: "SLOW_RENDER", - severity: actualDuration > 50 ? "error" : "warning", - component: componentName, - message: `Render took ${actualDuration.toFixed(2)}ms (budget: 16ms for 60fps)`, - suggestion: "Consider memoization, code splitting, or optimizing expensive computations", - timestamp: now, - location: { - componentName, - componentPath: getComponentPath(node) - } - }); - } - } - } - traverseFiber(fiber, (node) => { - checkListKeys(node, issues); - checkEffectHooks(node, issues); - }); - if (issues.length > 0 || components.length > 0) { - sendFromPage("FIBER_COMMIT", { components, issues, renders, timestamp: getUniqueTimestamp() }); - } - } - function detectReactVersion() { - var _a; - return ((_a = window.React) == null ? void 0 : _a.version) || "unknown"; - } - function detectReactMode() { - var _a; - const React = window.React; - if ((_a = React == null ? void 0 : React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) == null ? void 0 : _a.ReactDebugCurrentFrame) { - return "development"; - } - return "production"; - } - function installReactHook() { - let hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; - if (!hook) { - const renderers = /* @__PURE__ */ new Map(); - let nextID = 1; - hook = { - renderers, - supportsFiber: true, - inject: (renderer) => { - const id = nextID++; - renderers.set(id, renderer); - sendFromPage("REACT_DETECTED", { - version: detectReactVersion(), - mode: detectReactMode() - }); - return id; - }, - onCommitFiberRoot: () => { - }, - onCommitFiberUnmount: () => { - } - }; - window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook; - } - const originalOnCommitFiberRoot = hook.onCommitFiberRoot; - const originalInject = hook.inject; - hook.inject = function(renderer) { - const id = originalInject ? originalInject.call(this, renderer) : hook.renderers.size + 1; - sendFromPage("REACT_DETECTED", { - version: detectReactVersion(), - mode: detectReactMode() - }); - return id; - }; - let lastAnalyzeTime = 0; - let pendingRoot = null; - let analyzeTimeout = null; - const ANALYZE_THROTTLE_MS = 250; - const scheduleAnalyze = (root) => { - pendingRoot = root; - const now = Date.now(); - if (now - lastAnalyzeTime >= ANALYZE_THROTTLE_MS) { - lastAnalyzeTime = now; - try { - analyzeFiberTree(root); - } catch (e) { - } - pendingRoot = null; - } else if (!analyzeTimeout) { - analyzeTimeout = window.setTimeout(() => { - analyzeTimeout = null; - if (pendingRoot) { - lastAnalyzeTime = Date.now(); - try { - analyzeFiberTree(pendingRoot); - } catch (e) { - } - pendingRoot = null; - } - }, ANALYZE_THROTTLE_MS - (now - lastAnalyzeTime)); - } - }; - hook.onCommitFiberRoot = function(rendererID, root, priorityLevel, didError) { - if (typeof originalOnCommitFiberRoot === "function") { - originalOnCommitFiberRoot.call(this, rendererID, root, priorityLevel, didError); - } - if (!debuggerEnabled) return; - scheduleAnalyze(root); - if (scanEnabled) { - try { - traverseFiber(root.current, (node, path) => { - if (isUserComponent(node) && didFiberRender(node)) { - const componentName = getComponentName(node); - const fiberId = `${componentName}_${path}`; - const count = renderCounts.get(fiberId) || 1; - flashRenderOverlay(node, componentName, count); - } - }, "", 200); - } catch (e) { - } - } - }; - if (hook.renderers && hook.renderers.size > 0) { - sendFromPage("REACT_DETECTED", { - version: detectReactVersion(), - mode: detectReactMode() - }); - } - } - function findReactRoots() { - const roots = []; - const extractRoot = (element) => { - try { - const keys = Object.keys(element); - const fiberKey = keys.find( - (key) => key.startsWith("__reactContainer$") || key.startsWith("__reactFiber$") - ); - if (fiberKey) { - let fiber = element[fiberKey]; - let maxDepth = 100; - while (fiber && maxDepth > 0) { - if (fiber.stateNode && fiber.stateNode.current) { - return fiber.stateNode; - } - if (fiber.tag === FIBER_TAGS.HostRoot && fiber.stateNode) { - return fiber.stateNode; - } - fiber = fiber.return; - maxDepth--; - } - } - } catch (e) { - } - return null; - }; - const knownSelectors = "#root, #app, #__next, [data-reactroot], #___gatsby"; - const knownElements = document.querySelectorAll(knownSelectors); - for (const element of knownElements) { - const root = extractRoot(element); - if (root && !roots.includes(root)) { - roots.push(root); - } - } - if (roots.length > 0) return roots; - const allElements = document.querySelectorAll("*"); - const limit = Math.min(allElements.length, 200); - for (let i = 0; i < limit; i++) { - const root = extractRoot(allElements[i]); - if (root && !roots.includes(root)) { - roots.push(root); - break; - } - } - return roots; - } - function forceReanalyze() { - if (!debuggerEnabled) return; - const doAnalyze = () => { - if (!debuggerEnabled) return; - const roots = findReactRoots(); - let analyzed = false; - if (roots.length > 0) { - for (const root of roots) { - try { - if (root == null ? void 0 : root.current) { - analyzeFiberTree(root); - analyzed = true; - } - } catch (e) { - } - } - } - if (!analyzed) { - const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; - if (hook == null ? void 0 : hook.renderers) { - hook.renderers.forEach((renderer) => { - try { - if (renderer == null ? void 0 : renderer.getFiberRoots) { - const fiberRoots = renderer.getFiberRoots(renderer); - fiberRoots == null ? void 0 : fiberRoots.forEach((root) => { - if (root == null ? void 0 : root.current) { - analyzeFiberTree(root); - analyzed = true; - } - }); - } - } catch (e) { - } - }); - } - } - if (reduxStore) { - try { - sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(reduxStore.getState())); - } catch (e) { - } - } - }; - scheduleIdleWork(doAnalyze, 100); - setTimeout(doAnalyze, 200); - } - function isReduxStore(obj) { - if (!obj) return false; - const hasGetState = typeof obj.getState === "function"; - const hasDispatch = typeof obj.dispatch === "function"; - const hasSubscribe = typeof obj.subscribe === "function"; - if (hasGetState && hasDispatch && hasSubscribe) { - try { - const state = obj.getState(); - if (state !== void 0) { - log("Found valid Redux store with state:", typeof state); - return true; - } - } catch (e) { - } - } - return false; - } - function extractStoreFromFiber(fiber) { - var _a, _b, _c, _d, _e, _f; - if (!fiber) return null; - const memoizedState = fiber.memoizedState; - if ((memoizedState == null ? void 0 : memoizedState.store) && isReduxStore(memoizedState.store)) { - return memoizedState.store; - } - if (((_a = memoizedState == null ? void 0 : memoizedState.memoizedState) == null ? void 0 : _a.store) && isReduxStore(memoizedState.memoizedState.store)) { - return memoizedState.memoizedState.store; - } - const memoizedProps = fiber.memoizedProps; - if ((memoizedProps == null ? void 0 : memoizedProps.store) && isReduxStore(memoizedProps.store)) { - return memoizedProps.store; - } - if (((_b = memoizedProps == null ? void 0 : memoizedProps.value) == null ? void 0 : _b.store) && isReduxStore(memoizedProps.value.store)) { - return memoizedProps.value.store; - } - if ((memoizedProps == null ? void 0 : memoizedProps.value) && isReduxStore(memoizedProps.value)) { - return memoizedProps.value; - } - if (((_c = fiber.type) == null ? void 0 : _c.displayName) === "Provider" || ((_d = fiber.type) == null ? void 0 : _d.name) === "Provider") { - if ((memoizedProps == null ? void 0 : memoizedProps.store) && isReduxStore(memoizedProps.store)) { - return memoizedProps.store; - } - } - if (((_f = (_e = memoizedProps == null ? void 0 : memoizedProps.children) == null ? void 0 : _e.props) == null ? void 0 : _f.store) && isReduxStore(memoizedProps.children.props.store)) { - return memoizedProps.children.props.store; - } - const pendingProps = fiber.pendingProps; - if ((pendingProps == null ? void 0 : pendingProps.store) && isReduxStore(pendingProps.store)) { - return pendingProps.store; - } - return null; - } - function traverseFiberForStore(fiber, visited, maxDepth) { - if (!fiber || maxDepth <= 0 || visited.has(fiber)) return null; - visited.add(fiber); - const store = extractStoreFromFiber(fiber); - if (store) return store; - if (fiber.child) { - const childStore = traverseFiberForStore(fiber.child, visited, maxDepth - 1); - if (childStore) return childStore; - } - if (fiber.sibling) { - const siblingStore = traverseFiberForStore(fiber.sibling, visited, maxDepth - 1); - if (siblingStore) return siblingStore; - } - return null; - } - function findStoreInReactFiber() { - var _a; - try { - const rootSelectors = ["#root", "#app", "#__next", "[data-reactroot]", "#react-root", ".react-root", "#___gatsby", "main", "body"]; - let fiber = null; - for (const selector of rootSelectors) { - const el = document.querySelector(selector); - if (!el) continue; - const keys = Object.keys(el); - const fiberKey = keys.find( - (key) => key.startsWith("__reactContainer$") || key.startsWith("__reactFiber$") || key.startsWith("__reactInternalInstance$") - ); - if (fiberKey) { - fiber = el[fiberKey]; - if ((_a = fiber == null ? void 0 : fiber.stateNode) == null ? void 0 : _a.current) { - fiber = fiber.stateNode.current; - } else if (fiber == null ? void 0 : fiber.current) { - fiber = fiber.current; - } - break; - } - } - if (!fiber) { - const allElements = document.querySelectorAll("*"); - for (const el of allElements) { - const keys = Object.keys(el); - const fiberKey = keys.find( - (key) => key.startsWith("__reactContainer$") || key.startsWith("__reactFiber$") - ); - if (fiberKey) { - fiber = el[fiberKey]; - break; - } - } - } - if (!fiber) return null; - let rootFiber = fiber; - let maxUp = 100; - while (rootFiber.return && maxUp > 0) { - rootFiber = rootFiber.return; - maxUp--; - } - const visited = /* @__PURE__ */ new Set(); - const store = traverseFiberForStore(rootFiber, visited, 200); - if (store) { - log("Found Redux store in React Fiber tree"); - return store; - } - let currentFiber = fiber; - let depth = 100; - while (currentFiber && depth > 0) { - if (visited.has(currentFiber)) break; - const store2 = extractStoreFromFiber(currentFiber); - if (store2) return store2; - currentFiber = currentFiber.return; - depth--; - } - } catch (e) { - console.debug("[React Debugger] Error finding store in fiber:", e); - return null; - } - return null; - } - function findStoreInWindowProperties(win) { - const storePatterns = ["store", "redux", "state", "Store", "Redux"]; - for (const key of Object.keys(win)) { - const lowerKey = key.toLowerCase(); - if (storePatterns.some((p) => lowerKey.includes(p.toLowerCase()))) { - try { - const candidate = win[key]; - if (isReduxStore(candidate)) { - return candidate; - } - if (candidate && typeof candidate === "object") { - if (isReduxStore(candidate.store)) { - return candidate.store; - } - if (isReduxStore(candidate.default)) { - return candidate.default; - } - } - } catch { - continue; - } - } - } - return null; - } - let reduxDevToolsState = null; - let reduxDevToolsMessageListenerInstalled = false; - function setupReduxDevToolsMessageListener() { - if (reduxDevToolsMessageListenerInstalled) return; - reduxDevToolsMessageListenerInstalled = true; - window.addEventListener("message", (event) => { - if (!event.data || typeof event.data !== "object") return; - const validSources = ["@devtools-page", "@devtools-extension", "@redux-devtools-extension"]; - if (!validSources.includes(event.data.source)) return; - const { type, state, payload } = event.data; - const stateUpdateTypes = ["STATE", "ACTION", "INIT_INSTANCE", "DISPATCH", "START", "INIT"]; - if (stateUpdateTypes.includes(type)) { - const stateData = state || (payload == null ? void 0 : payload.state) || payload; - if (stateData && !reduxStore) { - try { - const parsedState = typeof stateData === "string" ? JSON.parse(stateData) : stateData; - if (parsedState && typeof parsedState === "object") { - reduxDevToolsState = parsedState; - log("Received Redux state from DevTools message:", type); - const proxyStore = createReduxDevToolsProxyStore(parsedState); - if (proxyStore) { - setupReduxStore(proxyStore); - } - } - } catch (e) { - } - } - } - }); - } - function createReduxDevToolsProxyStore(initialState) { - var _a; - const win = window; - if (!((_a = win.__REDUX_DEVTOOLS_EXTENSION__) == null ? void 0 : _a.connect)) { - return null; - } - try { - const connection = win.__REDUX_DEVTOOLS_EXTENSION__.connect({ - name: "React Debugger Proxy", - features: { jump: false, skip: false, dispatch: true } - }); - let currentState = initialState; - const subscribers = []; - connection.subscribe((message) => { - if (message.type === "DISPATCH" && message.state) { - try { - currentState = typeof message.state === "string" ? JSON.parse(message.state) : message.state; - subscribers.forEach((fn) => fn()); - } catch (e) { - log("Failed to update state from DevTools:", e); - } - } - }); - connection.init(initialState); - const proxyStore = { - getState: () => currentState, - dispatch: (action) => { - if (connection.send) { - connection.send(action, currentState); - } - return action; - }, - subscribe: (listener) => { - subscribers.push(listener); - return () => { - const index = subscribers.indexOf(listener); - if (index > -1) subscribers.splice(index, 1); - }; - }, - replaceReducer: () => { - }, - ["@@observable"]: () => ({ - subscribe: (observer) => { - const unsubscribe = proxyStore.subscribe(() => { - if (observer.next) observer.next(currentState); - }); - return { unsubscribe }; - } - }), - __isProxyStore: true, - __devToolsConnection: connection - }; - log("Created Redux DevTools proxy store"); - return proxyStore; - } catch (e) { - return null; - } - } - function findStoreInReduxDevTools() { - const win = window; - if (win.__REDUX_DEVTOOLS_EXTENSION__) { - const ext = win.__REDUX_DEVTOOLS_EXTENSION__; - if (ext._stores && ext._stores.length > 0) { - for (const store of ext._stores) { - if (isReduxStore(store)) return store; - } - } - if (ext._connections) { - for (const conn of Object.values(ext._connections)) { - if ((conn == null ? void 0 : conn.store) && isReduxStore(conn.store)) { - return conn.store; - } - if ((conn == null ? void 0 : conn.init) && (conn == null ? void 0 : conn.subscribe)) { - const connAny = conn; - if (connAny._store && isReduxStore(connAny._store)) { - return connAny._store; - } - } - } - } - if (ext.stores) { - for (const store of Object.values(ext.stores)) { - if (isReduxStore(store)) return store; - } - } - if (ext.instances) { - for (const instance of Object.values(ext.instances)) { - const inst = instance; - if ((inst == null ? void 0 : inst.store) && isReduxStore(inst.store)) { - return inst.store; - } - } - } - if (reduxDevToolsState && !reduxStore) { - const proxyStore = createReduxDevToolsProxyStore(reduxDevToolsState); - if (proxyStore) return proxyStore; - } - } - if (win.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) { - const compose = win.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__; - if (compose._store && isReduxStore(compose._store)) { - return compose._store; - } - if (compose.store && isReduxStore(compose.store)) { - return compose.store; - } - } - if (win.__REDUX_DEVTOOLS_STORE__) { - if (isReduxStore(win.__REDUX_DEVTOOLS_STORE__)) { - return win.__REDUX_DEVTOOLS_STORE__; - } - } - return null; - } - function findReduxStore() { - const win = window; - const directCandidates = [ - { name: "store", value: win.store }, - { name: "__REDUX_STORE__", value: win.__REDUX_STORE__ }, - { name: "__store__", value: win.__store__ }, - { name: "reduxStore", value: win.reduxStore }, - { name: "__STORE__", value: win.__STORE__ }, - { name: "appStore", value: win.appStore }, - { name: "rootStore", value: win.rootStore }, - { name: "__store", value: win.__store }, - { name: "_store", value: win._store }, - { name: "Store", value: win.Store }, - { name: "myStore", value: win.myStore }, - { name: "globalStore", value: win.globalStore } - ]; - for (const { name, value } of directCandidates) { - if (value) { - if (isReduxStore(value)) { - return value; - } - } - } - const devToolsStore = findStoreInReduxDevTools(); - if (devToolsStore) { - return devToolsStore; - } - const storeFromFiber = findStoreInReactFiber(); - if (storeFromFiber) { - return storeFromFiber; - } - const storeFromWindow = findStoreInWindowProperties(win); - if (storeFromWindow) { - return storeFromWindow; - } - const altStore = findAlternativeStateManagers(win); - if (altStore) { - return altStore; - } - return null; - } - function findAlternativeStateManagers(win) { - if (win.__ZUSTAND_DEVTOOLS_EXTENSION__) { - const stores = Object.values(win.__ZUSTAND_DEVTOOLS_EXTENSION__); - for (const store of stores) { - if (isReduxStore(store)) return store; - } - } - const reactContext = win.__REACT_CONTEXT_DEVTOOL_GLOBAL_HOOK__; - if (reactContext == null ? void 0 : reactContext.stores) { - for (const store of Object.values(reactContext.stores)) { - if (isReduxStore(store)) return store; - } - } - return null; - } - function deepSanitizeState(value, depth = 0, maxDepth = 5) { - if (depth > maxDepth) return "[Object depth exceeded]"; - if (value === null) return null; - if (value === void 0) return void 0; - const type = typeof value; - if (type === "string") return value; - if (type === "number" || type === "boolean") return value; - if (type === "function") return `[Function: ${value.name || "anonymous"}]`; - if (type === "symbol") return `[Symbol: ${value.toString()}]`; - if (Array.isArray(value)) { - return value.map((v) => deepSanitizeState(v, depth + 1, maxDepth)); - } - if (type === "object") { - const obj = value; - if (obj.$$typeof) return "[React Element]"; - if (obj instanceof HTMLElement) return `[HTMLElement: ${obj.tagName}]`; - if (obj instanceof Event) return "[Event]"; - if (obj instanceof Error) return { __type: "Error", message: obj.message, stack: obj.stack }; - if (obj instanceof Date) return { __type: "Date", value: obj.toISOString() }; - if (obj instanceof RegExp) return { __type: "RegExp", value: obj.toString() }; - if (obj instanceof Map) { - const mapObj = { __type: "Map", size: obj.size, entries: {} }; - obj.forEach((v, k) => { - mapObj.entries[String(k)] = deepSanitizeState(v, depth + 1, maxDepth); - }); - return mapObj; - } - if (obj instanceof Set) { - return { __type: "Set", size: obj.size, values: Array.from(obj).map((v) => deepSanitizeState(v, depth + 1, maxDepth)) }; - } - if (obj instanceof Promise) return "[Promise]"; - const result = {}; - for (const key of Object.keys(obj)) { - try { - result[key] = deepSanitizeState(obj[key], depth + 1, maxDepth); - } catch { - result[key] = "[Error reading property]"; - } - } - return result; - } - return String(value); - } - function setNestedValue(obj, path, value) { - if (path.length === 0) return value; - const result = Array.isArray(obj) ? [...obj] : { ...obj }; - const [first, ...rest] = path; - if (rest.length === 0) { - result[first] = value; - } else { - result[first] = setNestedValue(result[first], rest, value); - } - return result; - } - let reduxStore = null; - let originalDispatch = null; - let stateOverrides = /* @__PURE__ */ new Map(); - let reduxSearchStopped = false; - let stateChangeTimeout = null; - const STATE_CHANGE_DEBOUNCE = 100; - let reduxHookInstalled = false; - function restartReduxSearch() { - reduxSearchStopped = false; - if (reduxStore) return; - const store = findReduxStore(); - if (store) { - setupReduxStore(store); - return; - } - startReduxPolling(); - } - function setupReduxStore(store) { - if (!store || reduxStore === store) return; - reduxStore = store; - reduxSearchStopped = true; - try { - const initialState = deepSanitizeState(store.getState()); - console.log("[React Debugger] Redux store connected"); - sendFromPage("REDUX_DETECTED", initialState); - originalDispatch = store.dispatch; - store.dispatch = function(action) { - var _a; - if ((_a = action.type) == null ? void 0 : _a.startsWith("@@REACT_DEBUGGER/")) { - return originalDispatch.call(store, action); - } - const result = originalDispatch.call(store, action); - if (debuggerEnabled) { - sendFromPage("REDUX_ACTION", { - id: generateId(), - type: action.type || "UNKNOWN", - payload: sanitizeValue(action, 0), - timestamp: getUniqueTimestamp() - }); - sendFromPage("TIMELINE_EVENTS", [{ - id: generateId(), - timestamp: getUniqueTimestamp(), - type: "state-change", - payload: { - source: "redux", - actionType: action.type || "UNKNOWN" - } - }]); - } - return result; - }; - store.subscribe(() => { - if (stateChangeTimeout) { - clearTimeout(stateChangeTimeout); - } - stateChangeTimeout = window.setTimeout(() => { - try { - sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); - } catch (e) { - console.debug("[React Debugger] Error sending state change:", e); - } - stateChangeTimeout = null; - }, STATE_CHANGE_DEBOUNCE); - }); - window.__REACT_DEBUGGER_DISPATCH__ = (action) => { - return originalDispatch.call(store, action); - }; - window.__REACT_DEBUGGER_STORE__ = store; - window.__REACT_DEBUGGER_GET_STATE__ = () => store.getState(); - let injectedState = null; - if (typeof store.replaceReducer === "function") { - try { - const createInjectorReducer = (baseReducer) => { - return (state, action) => { - if (injectedState !== null) { - const newState = injectedState; - injectedState = null; - return newState; - } - if (baseReducer) { - return baseReducer(state, action); - } - return state; - }; - }; - const originalReplaceReducer = store.replaceReducer.bind(store); - store.replaceReducer = (nextReducer) => { - return originalReplaceReducer(createInjectorReducer(nextReducer)); - }; - originalReplaceReducer(createInjectorReducer(null)); - log("Redux state injection ready"); - } catch (e) { - log("replaceReducer setup failed:", e); - } - } - window.__REACT_DEBUGGER_SET_STATE__ = (path, value) => { - try { - const currentState = store.getState(); - const newState = setNestedValue(currentState, path, value); - stateOverrides.set(path.join("."), { path, value }); - injectedState = newState; - originalDispatch.call(store, { type: "@@REACT_DEBUGGER/SET_STATE" }); - sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); - } catch (e) { - console.error("[React Debugger] Set state error:", e); - } - }; - window.__REACT_DEBUGGER_CLEAR_OVERRIDES__ = () => { - try { - if (stateOverrides.size === 0) return; - stateOverrides.clear(); - sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); - sendFromPage("REDUX_OVERRIDES_CLEARED", null); - } catch (e) { - console.error("[React Debugger] Clear overrides error:", e); - } - }; - window.__REACT_DEBUGGER_RESET_STATE__ = () => { - try { - stateOverrides.clear(); - sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(store.getState())); - sendFromPage("REDUX_OVERRIDES_CLEARED", null); - } catch (e) { - console.error("[React Debugger] Reset state error:", e); - } - }; - } catch (e) { - console.error("[React Debugger] Error setting up Redux hook:", e); - reduxStore = null; - } - } - function startReduxPolling() { - if (reduxStore || reduxSearchStopped) return; - const store = findReduxStore(); - if (store) { - setupReduxStore(store); - return; - } - setTimeout(() => { - if (reduxStore || reduxSearchStopped) return; - const store2 = findReduxStore(); - if (store2) { - setupReduxStore(store2); - } - }, 2e3); - } - function installReduxHook() { - if (reduxHookInstalled) return; - reduxHookInstalled = true; - setupReduxDevToolsMessageListener(); - const win = window; - if (typeof win.__REDUX_DEVTOOLS_EXTENSION__ !== "undefined") { - const originalConnect = win.__REDUX_DEVTOOLS_EXTENSION__.connect; - if (originalConnect) { - win.__REDUX_DEVTOOLS_EXTENSION__.connect = function(...args) { - const devTools = originalConnect.apply(this, args); - setTimeout(() => { - if (!reduxStore && !reduxSearchStopped) { - const store = findReduxStore(); - if (store) setupReduxStore(store); - } - }, 500); - return devTools; - }; - } - } - if (typeof win.Redux !== "undefined" && win.Redux.createStore) { - const originalCreateStore = win.Redux.createStore; - win.Redux.createStore = function(...args) { - const store = originalCreateStore.apply(this, args); - setTimeout(() => setupReduxStore(store), 100); - return store; - }; - } - const onReady = () => { - if (reduxStore || reduxSearchStopped) return; - setTimeout(() => { - if (!reduxStore && !reduxSearchStopped) { - const store = findReduxStore(); - if (store) { - setupReduxStore(store); - } else { - startReduxPolling(); - } - } - }, 1e3); - }; - if (document.readyState === "complete") { - onReady(); - } else { - window.addEventListener("load", onReady, { once: true }); - } - } - let scanEnabled = false; - const overlayElements = /* @__PURE__ */ new Map(); - const renderFlashTimers = /* @__PURE__ */ new Map(); - function createOverlayContainer() { - let container = document.getElementById("react-debugger-overlay-container"); - if (!container) { - container = document.createElement("div"); - container.id = "react-debugger-overlay-container"; - container.style.cssText = ` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - pointer-events: none; - z-index: 999999; - `; - document.body.appendChild(container); - } - return container; - } - function getBorderColorForRenderCount(count) { - if (count <= 1) return "#40c463"; - if (count <= 3) return "#ffc107"; - if (count <= 5) return "#ff9800"; - if (count <= 10) return "#ff5722"; - return "#f44336"; - } - function flashRenderOverlay(fiber, componentName, renderCount) { - if (!scanEnabled) return; - const stateNode = fiber.stateNode; - let domNode = null; - if (stateNode instanceof HTMLElement) { - domNode = stateNode; - } else if (fiber.child) { - let childFiber = fiber.child; - while (childFiber) { - if (childFiber.stateNode instanceof HTMLElement) { - domNode = childFiber.stateNode; - break; - } - childFiber = childFiber.child; - } - } - if (!domNode) return; - const rect = domNode.getBoundingClientRect(); - if (rect.width === 0 || rect.height === 0) return; - if (rect.bottom < 0 || rect.right < 0 || rect.top > window.innerHeight || rect.left > window.innerWidth) return; - const container = createOverlayContainer(); - const fiberId = `${componentName}_${fiber.key || "nokey"}_${Math.round(rect.top)}_${Math.round(rect.left)}`; - const renderChange = detectRenderChanges(fiber); - let overlay = overlayElements.get(fiberId); - if (!overlay) { - overlay = document.createElement("div"); - overlay.className = "react-debugger-overlay"; - container.appendChild(overlay); - overlayElements.set(fiberId, overlay); - } - const borderColor = getBorderColorForRenderCount(renderCount); - overlay.style.cssText = ` - position: fixed; - top: ${rect.top}px; - left: ${rect.left}px; - width: ${rect.width}px; - height: ${rect.height}px; - background: transparent; - border: 2px solid ${borderColor}; - border-radius: 4px; - pointer-events: none; - z-index: 999999; - transition: opacity 0.3s ease-out, transform 0.1s ease-out; - box-sizing: border-box; - transform: scale(1.02); - `; - setTimeout(() => { - if (overlay) overlay.style.transform = "scale(1)"; - }, 50); - const label = overlay.querySelector(".scan-label") || document.createElement("div"); - label.className = "scan-label"; - const reasonText = renderChange.changedKeys ? ` [${renderChange.type}: ${renderChange.changedKeys.slice(0, 3).join(", ")}${renderChange.changedKeys.length > 3 ? "..." : ""}]` : renderChange.type !== "parent" ? ` [${renderChange.type}]` : ""; - label.style.cssText = ` - position: absolute; - top: -22px; - left: 0; - background: ${borderColor}; - color: white; - font-size: 10px; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace; - padding: 2px 8px; - border-radius: 4px; - white-space: nowrap; - pointer-events: none; - font-weight: 500; - box-shadow: 0 2px 4px rgba(0,0,0,0.2); - `; - label.textContent = `${componentName} ×${renderCount}${reasonText}`; - if (!label.parentElement) { - overlay.appendChild(label); - } - overlay.style.opacity = "1"; - const existingTimer = renderFlashTimers.get(fiberId); - if (existingTimer) { - clearTimeout(existingTimer); - } - const timer = window.setTimeout(() => { - if (overlay) { - overlay.style.opacity = "0"; - } - renderFlashTimers.delete(fiberId); - }, 800); - renderFlashTimers.set(fiberId, timer); - } - function clearAllOverlays() { - overlayElements.forEach((overlay) => { - overlay.remove(); - }); - overlayElements.clear(); - renderFlashTimers.forEach((timer) => clearTimeout(timer)); - renderFlashTimers.clear(); - } - function toggleScan(enabled) { - scanEnabled = enabled; - if (!enabled) { - clearAllOverlays(); - } - sendFromPage("SCAN_STATUS", { enabled: scanEnabled }); - } - window.__REACT_DEBUGGER_SCAN__ = { - enable: () => toggleScan(true), - disable: () => toggleScan(false), - toggle: () => toggleScan(!scanEnabled), - isEnabled: () => scanEnabled - }; - let memoryMonitoringEnabled = false; - let memoryMonitorInterval = null; - const MEMORY_SAMPLE_INTERVAL = 2e3; - function getMemorySnapshot() { - const perf = performance; - if (!perf.memory) return null; - return { - usedJSHeapSize: perf.memory.usedJSHeapSize, - totalJSHeapSize: perf.memory.totalJSHeapSize, - jsHeapSizeLimit: perf.memory.jsHeapSizeLimit - }; - } - let lastMemoryUsage = 0; - const MEMORY_SPIKE_THRESHOLD = 0.15; - function startMemoryMonitoring() { - if (!debuggerEnabled || memoryMonitoringEnabled) return; - const snapshot = getMemorySnapshot(); - if (!snapshot) { - return; - } - memoryMonitoringEnabled = true; - lastMemoryUsage = snapshot.usedJSHeapSize; - sendFromPage("MEMORY_SNAPSHOT", { - ...snapshot, - timestamp: Date.now() - }); - memoryMonitorInterval = window.setInterval(() => { - const snap = getMemorySnapshot(); - if (snap) { - const timestamp = getUniqueTimestamp(); - const growthRate = lastMemoryUsage > 0 ? (snap.usedJSHeapSize - lastMemoryUsage) / lastMemoryUsage : 0; - const isSpike = growthRate > MEMORY_SPIKE_THRESHOLD; - sendFromPage("MEMORY_SNAPSHOT", { - ...snap, - timestamp - }); - if (isSpike || snap.usedJSHeapSize / snap.jsHeapSizeLimit > 0.8) { - sendFromPage("TIMELINE_EVENTS", [{ - id: generateId(), - timestamp, - type: "memory", - payload: { - heapUsed: snap.usedJSHeapSize, - heapTotal: snap.totalJSHeapSize, - heapLimit: snap.jsHeapSizeLimit, - isSpike, - growthRate - } - }]); - } - lastMemoryUsage = snap.usedJSHeapSize; - } - }, MEMORY_SAMPLE_INTERVAL); - } - function stopMemoryMonitoring() { - if (!memoryMonitoringEnabled) return; - memoryMonitoringEnabled = false; - if (memoryMonitorInterval) { - clearInterval(memoryMonitorInterval); - memoryMonitorInterval = null; - } - } - function stopAllMonitoring() { - stopMemoryMonitoring(); - toggleScan(false); - reduxSearchStopped = true; - messageQueue = []; - if (flushTimeout) { - clearTimeout(flushTimeout); - flushTimeout = null; - } - clearPathCache(); - renderCounts.clear(); - lastRenderTimes.clear(); - recentRenderTimestamps.clear(); - reportedEffectIssues.clear(); - reportedExcessiveRerenders.clear(); - reportedSlowRenders.clear(); - componentRenderIds.clear(); - lastEffectStates.clear(); - trackedClosures.clear(); - staleClosureIssues.clear(); - stateOverrides.clear(); - overlayElements.clear(); - renderFlashTimers.forEach((timer) => clearTimeout(timer)); - renderFlashTimers.clear(); - } - window.__REACT_DEBUGGER_MEMORY__ = { - start: startMemoryMonitoring, - stop: stopMemoryMonitoring, - getSnapshot: getMemorySnapshot, - isMonitoring: () => memoryMonitoringEnabled - }; - function installErrorHandlers() { - const originalOnError = window.onerror; - window.onerror = function(message, source, lineno, colno, error) { - var _a, _b; - if ((source == null ? void 0 : source.includes("react-debugger")) || (source == null ? void 0 : source.includes("chrome-extension"))) { - return originalOnError == null ? void 0 : originalOnError.apply(window, arguments); - } - const memorySnapshot = getMemorySnapshot(); - const analysisHints = []; - if (memorySnapshot) { - const usagePercent = memorySnapshot.usedJSHeapSize / memorySnapshot.jsHeapSizeLimit; - if (usagePercent > 0.8) { - analysisHints.push("High memory usage detected at crash time"); - } - } - const crashId = generateId(); - const crashTimestamp = getUniqueTimestamp(); - sendFromPage("CRASH_DETECTED", { - id: crashId, - timestamp: crashTimestamp, - type: "js-error", - message: String(message), - stack: (_a = error == null ? void 0 : error.stack) == null ? void 0 : _a.slice(0, 5e3), - source, - lineno, - colno, - memorySnapshot: memorySnapshot ? { - timestamp: crashTimestamp, - usedJSHeapSize: memorySnapshot.usedJSHeapSize, - totalJSHeapSize: memorySnapshot.totalJSHeapSize, - jsHeapSizeLimit: memorySnapshot.jsHeapSizeLimit - } : void 0, - analysisHints - }); - sendFromPage("TIMELINE_EVENTS", [{ - id: crashId, - timestamp: crashTimestamp, - type: "error", - payload: { - errorType: "js-error", - message: String(message), - stack: (_b = error == null ? void 0 : error.stack) == null ? void 0 : _b.slice(0, 2e3), - source, - lineno - } - }]); - return originalOnError == null ? void 0 : originalOnError.apply(window, arguments); - }; - window.addEventListener("unhandledrejection", (event) => { - var _a, _b; - const reason = event.reason; - const memorySnapshot = getMemorySnapshot(); - const analysisHints = []; - if (memorySnapshot) { - const usagePercent = memorySnapshot.usedJSHeapSize / memorySnapshot.jsHeapSizeLimit; - if (usagePercent > 0.8) { - analysisHints.push("High memory usage detected at crash time"); - } - } - const rejectId = generateId(); - const rejectTimestamp = getUniqueTimestamp(); - sendFromPage("CRASH_DETECTED", { - id: rejectId, - timestamp: rejectTimestamp, - type: "unhandled-rejection", - message: (reason == null ? void 0 : reason.message) || String(reason), - stack: (_a = reason == null ? void 0 : reason.stack) == null ? void 0 : _a.slice(0, 5e3), - memorySnapshot: memorySnapshot ? { - timestamp: rejectTimestamp, - usedJSHeapSize: memorySnapshot.usedJSHeapSize, - totalJSHeapSize: memorySnapshot.totalJSHeapSize, - jsHeapSizeLimit: memorySnapshot.jsHeapSizeLimit - } : void 0, - analysisHints - }); - sendFromPage("TIMELINE_EVENTS", [{ - id: rejectId, - timestamp: rejectTimestamp, - type: "error", - payload: { - errorType: "unhandled-rejection", - message: (reason == null ? void 0 : reason.message) || String(reason), - stack: (_b = reason == null ? void 0 : reason.stack) == null ? void 0 : _b.slice(0, 2e3) - } - }]); - }); - } - listenFromContent((message) => { - var _a; - if (message.type === "DISPATCH_REDUX_ACTION") { - const dispatch = window.__REACT_DEBUGGER_DISPATCH__; - if (dispatch && message.payload) { - try { - dispatch(message.payload); - } catch (e) { - console.error("[React Debugger] Dispatch error:", e); - } - } - } - if (message.type === "SET_REDUX_STATE") { - const payload = message.payload; - if (payload && reduxStore) { - try { - const setStateFn = window.__REACT_DEBUGGER_SET_STATE__; - if (setStateFn) { - setStateFn(payload.path, payload.value); - } - } catch (e) { - console.error("[React Debugger] Set state error:", e); - } - } - } - if (message.type === "CLEAR_REDUX_OVERRIDES") { - if (reduxStore && originalDispatch) { - try { - const clearFn = window.__REACT_DEBUGGER_CLEAR_OVERRIDES__; - if (clearFn) clearFn(); - } catch (e) { - console.error("[React Debugger] Clear overrides error:", e); - } - } - } - if (message.type === "DELETE_ARRAY_ITEM") { - const payload = message.payload; - if (payload && reduxStore) { - try { - const currentState = reduxStore.getState(); - let target = currentState; - for (const key of payload.path) { - target = target[key]; - } - if (Array.isArray(target)) { - const newArray = [...target]; - newArray.splice(payload.index, 1); - const setStateFn = window.__REACT_DEBUGGER_SET_STATE__; - if (setStateFn) { - setStateFn(payload.path, newArray); - } - } - } catch (e) { - console.error("[React Debugger] Delete array item error:", e); - } - } - } - if (message.type === "MOVE_ARRAY_ITEM") { - const payload = message.payload; - if (payload && reduxStore) { - try { - const currentState = reduxStore.getState(); - let target = currentState; - for (const key of payload.path) { - target = target[key]; - } - if (Array.isArray(target) && payload.toIndex >= 0 && payload.toIndex < target.length) { - const newArray = [...target]; - const [item] = newArray.splice(payload.fromIndex, 1); - newArray.splice(payload.toIndex, 0, item); - const setStateFn = window.__REACT_DEBUGGER_SET_STATE__; - if (setStateFn) { - setStateFn(payload.path, newArray); - } - } - } catch (e) { - console.error("[React Debugger] Move array item error:", e); - } - } - } - if (message.type === "REFRESH_REDUX_STATE") { - if (reduxStore) { - try { - sendFromPage("REDUX_STATE_CHANGE", deepSanitizeState(reduxStore.getState())); - } catch (e) { - console.error("[React Debugger] Refresh state error:", e); - } - } - } - if (message.type === "TOGGLE_SCAN") { - const payload = message.payload; - if (payload && typeof payload.enabled === "boolean") { - toggleScan(payload.enabled); - } else { - toggleScan(!scanEnabled); - } - } - if (message.type === "START_MEMORY_MONITORING") { - startMemoryMonitoring(); - } - if (message.type === "STOP_MEMORY_MONITORING") { - stopMemoryMonitoring(); - } - if (message.type === "ENABLE_DEBUGGER") { - debuggerEnabled = true; - const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; - if (((_a = hook == null ? void 0 : hook.renderers) == null ? void 0 : _a.size) > 0) { - sendFromPage("REACT_DETECTED", { - version: detectReactVersion(), - mode: detectReactMode() - }); - } - installReduxHook(); - restartReduxSearch(); - forceReanalyze(); - sendFromPage("DEBUGGER_STATE_CHANGED", { enabled: true }); - } - if (message.type === "DISABLE_DEBUGGER") { - debuggerEnabled = false; - stopAllMonitoring(); - sendFromPage("DEBUGGER_STATE_CHANGED", { enabled: false }); - } - if (message.type === "GET_DEBUGGER_STATE") { - sendFromPage("DEBUGGER_STATE_CHANGED", { enabled: debuggerEnabled }); - } - }); - installReactHook(); - installReduxHook(); - installErrorHandlers(); - window.__REACT_DEBUGGER_ENABLE_CLOSURE_TRACKING__ = _installClosureTracking; - setTimeout(() => { - var _a; - const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; - if (((_a = hook == null ? void 0 : hook.renderers) == null ? void 0 : _a.size) > 0) { - sendFromPage("REACT_DETECTED", { - version: detectReactVersion(), - mode: detectReactMode() - }); - } - }, 500); - console.log("[React Debugger] Inject script loaded"); - })(); -})(); diff --git a/mcp/manifest.json b/mcp/manifest.json deleted file mode 100644 index 4f2464c..0000000 --- a/mcp/manifest.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "manifest_version": 3, - "name": "React Debugger", - "version": "2.0.2", - "description": "Advanced debugging & performance optimization tool for ReactJS applications", - "author": "NhoNH", - - "devtools_page": "devtools.html", - - "action": { - "default_popup": "popup.html", - "default_icon": { - "16": "icons/icon16.png", - "48": "icons/icon48.png", - "128": "icons/icon128.png" - }, - "default_title": "React Debugger" - }, - - "permissions": [ - "scripting", - "storage", - "activeTab", - "tabs", - "webNavigation" - ], - - "host_permissions": [ - "" - ], - - "background": { - "service_worker": "background.js" - }, - - "content_scripts": [ - { - "matches": [""], - "js": ["content.js"], - "run_at": "document_start", - "all_frames": true - } - ], - - "web_accessible_resources": [ - { - "resources": ["inject.js", "icons/*", "popup.html", "popup.js"], - "matches": [""] - } - ], - - "icons": { - "16": "icons/icon16.png", - "48": "icons/icon48.png", - "128": "icons/icon128.png" - } -} diff --git a/mcp/panel.html b/mcp/panel.html deleted file mode 100644 index 04c1ccd..0000000 --- a/mcp/panel.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - React Debugger - - - - -
- - diff --git a/mcp/panel.js b/mcp/panel.js deleted file mode 100644 index f27abdc..0000000 --- a/mcp/panel.js +++ /dev/null @@ -1,10323 +0,0 @@ -var __defProp = Object.defineProperty; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); -function getDefaultExportFromCjs(x2) { - return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; -} -var jsxRuntime = { exports: {} }; -var reactJsxRuntime_production_min = {}; -var react = { exports: {} }; -var react_production_min = {}; -/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var l$1 = Symbol.for("react.element"), n$1 = Symbol.for("react.portal"), p$2 = Symbol.for("react.fragment"), q$1 = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), u = Symbol.for("react.context"), v$1 = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z$1 = Symbol.iterator; -function A$1(a) { - if (null === a || "object" !== typeof a) return null; - a = z$1 && a[z$1] || a["@@iterator"]; - return "function" === typeof a ? a : null; -} -var B$1 = { isMounted: function() { - return false; -}, enqueueForceUpdate: function() { -}, enqueueReplaceState: function() { -}, enqueueSetState: function() { -} }, C$1 = Object.assign, D$1 = {}; -function E$1(a, b, e) { - this.props = a; - this.context = b; - this.refs = D$1; - this.updater = e || B$1; -} -E$1.prototype.isReactComponent = {}; -E$1.prototype.setState = function(a, b) { - if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - this.updater.enqueueSetState(this, a, b, "setState"); -}; -E$1.prototype.forceUpdate = function(a) { - this.updater.enqueueForceUpdate(this, a, "forceUpdate"); -}; -function F() { -} -F.prototype = E$1.prototype; -function G$1(a, b, e) { - this.props = a; - this.context = b; - this.refs = D$1; - this.updater = e || B$1; -} -var H$1 = G$1.prototype = new F(); -H$1.constructor = G$1; -C$1(H$1, E$1.prototype); -H$1.isPureReactComponent = true; -var I$1 = Array.isArray, J = Object.prototype.hasOwnProperty, K$1 = { current: null }, L$1 = { key: true, ref: true, __self: true, __source: true }; -function M$1(a, b, e) { - var d, c = {}, k2 = null, h = null; - if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k2 = "" + b.key), b) J.call(b, d) && !L$1.hasOwnProperty(d) && (c[d] = b[d]); - var g = arguments.length - 2; - if (1 === g) c.children = e; - else if (1 < g) { - for (var f2 = Array(g), m2 = 0; m2 < g; m2++) f2[m2] = arguments[m2 + 2]; - c.children = f2; - } - if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]); - return { $$typeof: l$1, type: a, key: k2, ref: h, props: c, _owner: K$1.current }; -} -function N$1(a, b) { - return { $$typeof: l$1, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner }; -} -function O$1(a) { - return "object" === typeof a && null !== a && a.$$typeof === l$1; -} -function escape(a) { - var b = { "=": "=0", ":": "=2" }; - return "$" + a.replace(/[=:]/g, function(a2) { - return b[a2]; - }); -} -var P$1 = /\/+/g; -function Q$1(a, b) { - return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); -} -function R$1(a, b, e, d, c) { - var k2 = typeof a; - if ("undefined" === k2 || "boolean" === k2) a = null; - var h = false; - if (null === a) h = true; - else switch (k2) { - case "string": - case "number": - h = true; - break; - case "object": - switch (a.$$typeof) { - case l$1: - case n$1: - h = true; - } - } - if (h) return h = a, c = c(h), a = "" === d ? "." + Q$1(h, 0) : d, I$1(c) ? (e = "", null != a && (e = a.replace(P$1, "$&/") + "/"), R$1(c, b, e, "", function(a2) { - return a2; - })) : null != c && (O$1(c) && (c = N$1(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P$1, "$&/") + "/") + a)), b.push(c)), 1; - h = 0; - d = "" === d ? "." : d + ":"; - if (I$1(a)) for (var g = 0; g < a.length; g++) { - k2 = a[g]; - var f2 = d + Q$1(k2, g); - h += R$1(k2, b, e, f2, c); - } - else if (f2 = A$1(a), "function" === typeof f2) for (a = f2.call(a), g = 0; !(k2 = a.next()).done; ) k2 = k2.value, f2 = d + Q$1(k2, g++), h += R$1(k2, b, e, f2, c); - else if ("object" === k2) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); - return h; -} -function S$1(a, b, e) { - if (null == a) return a; - var d = [], c = 0; - R$1(a, d, "", "", function(a2) { - return b.call(e, a2, c++); - }); - return d; -} -function T$1(a) { - if (-1 === a._status) { - var b = a._result; - b = b(); - b.then(function(b2) { - if (0 === a._status || -1 === a._status) a._status = 1, a._result = b2; - }, function(b2) { - if (0 === a._status || -1 === a._status) a._status = 2, a._result = b2; - }); - -1 === a._status && (a._status = 0, a._result = b); - } - if (1 === a._status) return a._result.default; - throw a._result; -} -var U$1 = { current: null }, V$1 = { transition: null }, W$1 = { ReactCurrentDispatcher: U$1, ReactCurrentBatchConfig: V$1, ReactCurrentOwner: K$1 }; -function X$1() { - throw Error("act(...) is not supported in production builds of React."); -} -react_production_min.Children = { map: S$1, forEach: function(a, b, e) { - S$1(a, function() { - b.apply(this, arguments); - }, e); -}, count: function(a) { - var b = 0; - S$1(a, function() { - b++; - }); - return b; -}, toArray: function(a) { - return S$1(a, function(a2) { - return a2; - }) || []; -}, only: function(a) { - if (!O$1(a)) throw Error("React.Children.only expected to receive a single React element child."); - return a; -} }; -react_production_min.Component = E$1; -react_production_min.Fragment = p$2; -react_production_min.Profiler = r; -react_production_min.PureComponent = G$1; -react_production_min.StrictMode = q$1; -react_production_min.Suspense = w; -react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W$1; -react_production_min.act = X$1; -react_production_min.cloneElement = function(a, b, e) { - if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); - var d = C$1({}, a.props), c = a.key, k2 = a.ref, h = a._owner; - if (null != b) { - void 0 !== b.ref && (k2 = b.ref, h = K$1.current); - void 0 !== b.key && (c = "" + b.key); - if (a.type && a.type.defaultProps) var g = a.type.defaultProps; - for (f2 in b) J.call(b, f2) && !L$1.hasOwnProperty(f2) && (d[f2] = void 0 === b[f2] && void 0 !== g ? g[f2] : b[f2]); - } - var f2 = arguments.length - 2; - if (1 === f2) d.children = e; - else if (1 < f2) { - g = Array(f2); - for (var m2 = 0; m2 < f2; m2++) g[m2] = arguments[m2 + 2]; - d.children = g; - } - return { $$typeof: l$1, type: a.type, key: c, ref: k2, props: d, _owner: h }; -}; -react_production_min.createContext = function(a) { - a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }; - a.Provider = { $$typeof: t, _context: a }; - return a.Consumer = a; -}; -react_production_min.createElement = M$1; -react_production_min.createFactory = function(a) { - var b = M$1.bind(null, a); - b.type = a; - return b; -}; -react_production_min.createRef = function() { - return { current: null }; -}; -react_production_min.forwardRef = function(a) { - return { $$typeof: v$1, render: a }; -}; -react_production_min.isValidElement = O$1; -react_production_min.lazy = function(a) { - return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T$1 }; -}; -react_production_min.memo = function(a, b) { - return { $$typeof: x, type: a, compare: void 0 === b ? null : b }; -}; -react_production_min.startTransition = function(a) { - var b = V$1.transition; - V$1.transition = {}; - try { - a(); - } finally { - V$1.transition = b; - } -}; -react_production_min.unstable_act = X$1; -react_production_min.useCallback = function(a, b) { - return U$1.current.useCallback(a, b); -}; -react_production_min.useContext = function(a) { - return U$1.current.useContext(a); -}; -react_production_min.useDebugValue = function() { -}; -react_production_min.useDeferredValue = function(a) { - return U$1.current.useDeferredValue(a); -}; -react_production_min.useEffect = function(a, b) { - return U$1.current.useEffect(a, b); -}; -react_production_min.useId = function() { - return U$1.current.useId(); -}; -react_production_min.useImperativeHandle = function(a, b, e) { - return U$1.current.useImperativeHandle(a, b, e); -}; -react_production_min.useInsertionEffect = function(a, b) { - return U$1.current.useInsertionEffect(a, b); -}; -react_production_min.useLayoutEffect = function(a, b) { - return U$1.current.useLayoutEffect(a, b); -}; -react_production_min.useMemo = function(a, b) { - return U$1.current.useMemo(a, b); -}; -react_production_min.useReducer = function(a, b, e) { - return U$1.current.useReducer(a, b, e); -}; -react_production_min.useRef = function(a) { - return U$1.current.useRef(a); -}; -react_production_min.useState = function(a) { - return U$1.current.useState(a); -}; -react_production_min.useSyncExternalStore = function(a, b, e) { - return U$1.current.useSyncExternalStore(a, b, e); -}; -react_production_min.useTransition = function() { - return U$1.current.useTransition(); -}; -react_production_min.version = "18.3.1"; -{ - react.exports = react_production_min; -} -var reactExports = react.exports; -const React = /* @__PURE__ */ getDefaultExportFromCjs(reactExports); -/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var f = reactExports, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$1 = { key: true, ref: true, __self: true, __source: true }; -function q(c, a, g) { - var b, d = {}, e = null, h = null; - void 0 !== g && (e = "" + g); - void 0 !== a.key && (e = "" + a.key); - void 0 !== a.ref && (h = a.ref); - for (b in a) m$1.call(a, b) && !p$1.hasOwnProperty(b) && (d[b] = a[b]); - if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]); - return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current }; -} -reactJsxRuntime_production_min.Fragment = l; -reactJsxRuntime_production_min.jsx = q; -reactJsxRuntime_production_min.jsxs = q; -{ - jsxRuntime.exports = reactJsxRuntime_production_min; -} -var jsxRuntimeExports = jsxRuntime.exports; -var client = {}; -var reactDom = { exports: {} }; -var reactDom_production_min = {}; -var scheduler = { exports: {} }; -var scheduler_production_min = {}; -/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -(function(exports$1) { - function f2(a, b) { - var c = a.length; - a.push(b); - a: for (; 0 < c; ) { - var d = c - 1 >>> 1, e = a[d]; - if (0 < g(e, b)) a[d] = b, a[c] = e, c = d; - else break a; - } - } - function h(a) { - return 0 === a.length ? null : a[0]; - } - function k2(a) { - if (0 === a.length) return null; - var b = a[0], c = a.pop(); - if (c !== b) { - a[0] = c; - a: for (var d = 0, e = a.length, w2 = e >>> 1; d < w2; ) { - var m2 = 2 * (d + 1) - 1, C2 = a[m2], n2 = m2 + 1, x2 = a[n2]; - if (0 > g(C2, c)) n2 < e && 0 > g(x2, C2) ? (a[d] = x2, a[n2] = c, d = n2) : (a[d] = C2, a[m2] = c, d = m2); - else if (n2 < e && 0 > g(x2, c)) a[d] = x2, a[n2] = c, d = n2; - else break a; - } - } - return b; - } - function g(a, b) { - var c = a.sortIndex - b.sortIndex; - return 0 !== c ? c : a.id - b.id; - } - if ("object" === typeof performance && "function" === typeof performance.now) { - var l2 = performance; - exports$1.unstable_now = function() { - return l2.now(); - }; - } else { - var p2 = Date, q2 = p2.now(); - exports$1.unstable_now = function() { - return p2.now() - q2; - }; - } - var r2 = [], t2 = [], u2 = 1, v2 = null, y2 = 3, z2 = false, A2 = false, B2 = false, D2 = "function" === typeof setTimeout ? setTimeout : null, E2 = "function" === typeof clearTimeout ? clearTimeout : null, F2 = "undefined" !== typeof setImmediate ? setImmediate : null; - "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); - function G2(a) { - for (var b = h(t2); null !== b; ) { - if (null === b.callback) k2(t2); - else if (b.startTime <= a) k2(t2), b.sortIndex = b.expirationTime, f2(r2, b); - else break; - b = h(t2); - } - } - function H2(a) { - B2 = false; - G2(a); - if (!A2) if (null !== h(r2)) A2 = true, I2(J2); - else { - var b = h(t2); - null !== b && K2(H2, b.startTime - a); - } - } - function J2(a, b) { - A2 = false; - B2 && (B2 = false, E2(L2), L2 = -1); - z2 = true; - var c = y2; - try { - G2(b); - for (v2 = h(r2); null !== v2 && (!(v2.expirationTime > b) || a && !M2()); ) { - var d = v2.callback; - if ("function" === typeof d) { - v2.callback = null; - y2 = v2.priorityLevel; - var e = d(v2.expirationTime <= b); - b = exports$1.unstable_now(); - "function" === typeof e ? v2.callback = e : v2 === h(r2) && k2(r2); - G2(b); - } else k2(r2); - v2 = h(r2); - } - if (null !== v2) var w2 = true; - else { - var m2 = h(t2); - null !== m2 && K2(H2, m2.startTime - b); - w2 = false; - } - return w2; - } finally { - v2 = null, y2 = c, z2 = false; - } - } - var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1; - function M2() { - return exports$1.unstable_now() - Q2 < P2 ? false : true; - } - function R2() { - if (null !== O2) { - var a = exports$1.unstable_now(); - Q2 = a; - var b = true; - try { - b = O2(true, a); - } finally { - b ? S2() : (N2 = false, O2 = null); - } - } else N2 = false; - } - var S2; - if ("function" === typeof F2) S2 = function() { - F2(R2); - }; - else if ("undefined" !== typeof MessageChannel) { - var T2 = new MessageChannel(), U2 = T2.port2; - T2.port1.onmessage = R2; - S2 = function() { - U2.postMessage(null); - }; - } else S2 = function() { - D2(R2, 0); - }; - function I2(a) { - O2 = a; - N2 || (N2 = true, S2()); - } - function K2(a, b) { - L2 = D2(function() { - a(exports$1.unstable_now()); - }, b); - } - exports$1.unstable_IdlePriority = 5; - exports$1.unstable_ImmediatePriority = 1; - exports$1.unstable_LowPriority = 4; - exports$1.unstable_NormalPriority = 3; - exports$1.unstable_Profiling = null; - exports$1.unstable_UserBlockingPriority = 2; - exports$1.unstable_cancelCallback = function(a) { - a.callback = null; - }; - exports$1.unstable_continueExecution = function() { - A2 || z2 || (A2 = true, I2(J2)); - }; - exports$1.unstable_forceFrameRate = function(a) { - 0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a ? Math.floor(1e3 / a) : 5; - }; - exports$1.unstable_getCurrentPriorityLevel = function() { - return y2; - }; - exports$1.unstable_getFirstCallbackNode = function() { - return h(r2); - }; - exports$1.unstable_next = function(a) { - switch (y2) { - case 1: - case 2: - case 3: - var b = 3; - break; - default: - b = y2; - } - var c = y2; - y2 = b; - try { - return a(); - } finally { - y2 = c; - } - }; - exports$1.unstable_pauseExecution = function() { - }; - exports$1.unstable_requestPaint = function() { - }; - exports$1.unstable_runWithPriority = function(a, b) { - switch (a) { - case 1: - case 2: - case 3: - case 4: - case 5: - break; - default: - a = 3; - } - var c = y2; - y2 = a; - try { - return b(); - } finally { - y2 = c; - } - }; - exports$1.unstable_scheduleCallback = function(a, b, c) { - var d = exports$1.unstable_now(); - "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d; - switch (a) { - case 1: - var e = -1; - break; - case 2: - e = 250; - break; - case 5: - e = 1073741823; - break; - case 4: - e = 1e4; - break; - default: - e = 5e3; - } - e = c + e; - a = { id: u2++, callback: b, priorityLevel: a, startTime: c, expirationTime: e, sortIndex: -1 }; - c > d ? (a.sortIndex = c, f2(t2, a), null === h(r2) && a === h(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c - d))) : (a.sortIndex = e, f2(r2, a), A2 || z2 || (A2 = true, I2(J2))); - return a; - }; - exports$1.unstable_shouldYield = M2; - exports$1.unstable_wrapCallback = function(a) { - var b = y2; - return function() { - var c = y2; - y2 = b; - try { - return a.apply(this, arguments); - } finally { - y2 = c; - } - }; - }; -})(scheduler_production_min); -{ - scheduler.exports = scheduler_production_min; -} -var schedulerExports = scheduler.exports; -/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var aa = reactExports, ca = schedulerExports; -function p(a) { - for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) b += "&args[]=" + encodeURIComponent(arguments[c]); - return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; -} -var da = /* @__PURE__ */ new Set(), ea = {}; -function fa(a, b) { - ha(a, b); - ha(a + "Capture", b); -} -function ha(a, b) { - ea[a] = b; - for (a = 0; a < b.length; a++) da.add(b[a]); -} -var ia = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), ja = Object.prototype.hasOwnProperty, ka = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, la = {}, ma = {}; -function oa(a) { - if (ja.call(ma, a)) return true; - if (ja.call(la, a)) return false; - if (ka.test(a)) return ma[a] = true; - la[a] = true; - return false; -} -function pa(a, b, c, d) { - if (null !== c && 0 === c.type) return false; - switch (typeof b) { - case "function": - case "symbol": - return true; - case "boolean": - if (d) return false; - if (null !== c) return !c.acceptsBooleans; - a = a.toLowerCase().slice(0, 5); - return "data-" !== a && "aria-" !== a; - default: - return false; - } -} -function qa(a, b, c, d) { - if (null === b || "undefined" === typeof b || pa(a, b, c, d)) return true; - if (d) return false; - if (null !== c) switch (c.type) { - case 3: - return !b; - case 4: - return false === b; - case 5: - return isNaN(b); - case 6: - return isNaN(b) || 1 > b; - } - return false; -} -function v(a, b, c, d, e, f2, g) { - this.acceptsBooleans = 2 === b || 3 === b || 4 === b; - this.attributeName = d; - this.attributeNamespace = e; - this.mustUseProperty = c; - this.propertyName = a; - this.type = b; - this.sanitizeURL = f2; - this.removeEmptyString = g; -} -var z = {}; -"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { - z[a] = new v(a, 0, false, a, null, false, false); -}); -[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a) { - var b = a[0]; - z[b] = new v(b, 1, false, a[1], null, false, false); -}); -["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a) { - z[a] = new v(a, 2, false, a.toLowerCase(), null, false, false); -}); -["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a) { - z[a] = new v(a, 2, false, a, null, false, false); -}); -"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a) { - z[a] = new v(a, 3, false, a.toLowerCase(), null, false, false); -}); -["checked", "multiple", "muted", "selected"].forEach(function(a) { - z[a] = new v(a, 3, true, a, null, false, false); -}); -["capture", "download"].forEach(function(a) { - z[a] = new v(a, 4, false, a, null, false, false); -}); -["cols", "rows", "size", "span"].forEach(function(a) { - z[a] = new v(a, 6, false, a, null, false, false); -}); -["rowSpan", "start"].forEach(function(a) { - z[a] = new v(a, 5, false, a.toLowerCase(), null, false, false); -}); -var ra = /[\-:]([a-z])/g; -function sa(a) { - return a[1].toUpperCase(); -} -"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a) { - var b = a.replace( - ra, - sa - ); - z[b] = new v(b, 1, false, a, null, false, false); -}); -"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) { - var b = a.replace(ra, sa); - z[b] = new v(b, 1, false, a, "http://www.w3.org/1999/xlink", false, false); -}); -["xml:base", "xml:lang", "xml:space"].forEach(function(a) { - var b = a.replace(ra, sa); - z[b] = new v(b, 1, false, a, "http://www.w3.org/XML/1998/namespace", false, false); -}); -["tabIndex", "crossOrigin"].forEach(function(a) { - z[a] = new v(a, 1, false, a.toLowerCase(), null, false, false); -}); -z.xlinkHref = new v("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); -["src", "href", "action", "formAction"].forEach(function(a) { - z[a] = new v(a, 1, false, a.toLowerCase(), null, true, true); -}); -function ta(a, b, c, d) { - var e = z.hasOwnProperty(b) ? z[b] : null; - if (null !== e ? 0 !== e.type : d || !(2 < b.length) || "o" !== b[0] && "O" !== b[0] || "n" !== b[1] && "N" !== b[1]) qa(b, c, e, d) && (c = null), d || null === e ? oa(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? false : "" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && true === c ? "" : "" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))); -} -var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va = Symbol.for("react.element"), wa = Symbol.for("react.portal"), ya = Symbol.for("react.fragment"), za = Symbol.for("react.strict_mode"), Aa = Symbol.for("react.profiler"), Ba = Symbol.for("react.provider"), Ca = Symbol.for("react.context"), Da = Symbol.for("react.forward_ref"), Ea = Symbol.for("react.suspense"), Fa = Symbol.for("react.suspense_list"), Ga = Symbol.for("react.memo"), Ha = Symbol.for("react.lazy"); -var Ia = Symbol.for("react.offscreen"); -var Ja = Symbol.iterator; -function Ka(a) { - if (null === a || "object" !== typeof a) return null; - a = Ja && a[Ja] || a["@@iterator"]; - return "function" === typeof a ? a : null; -} -var A = Object.assign, La; -function Ma(a) { - if (void 0 === La) try { - throw Error(); - } catch (c) { - var b = c.stack.trim().match(/\n( *(at )?)/); - La = b && b[1] || ""; - } - return "\n" + La + a; -} -var Na = false; -function Oa(a, b) { - if (!a || Na) return ""; - Na = true; - var c = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - try { - if (b) if (b = function() { - throw Error(); - }, Object.defineProperty(b.prototype, "props", { set: function() { - throw Error(); - } }), "object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(b, []); - } catch (l2) { - var d = l2; - } - Reflect.construct(a, [], b); - } else { - try { - b.call(); - } catch (l2) { - d = l2; - } - a.call(b.prototype); - } - else { - try { - throw Error(); - } catch (l2) { - d = l2; - } - a(); - } - } catch (l2) { - if (l2 && d && "string" === typeof l2.stack) { - for (var e = l2.stack.split("\n"), f2 = d.stack.split("\n"), g = e.length - 1, h = f2.length - 1; 1 <= g && 0 <= h && e[g] !== f2[h]; ) h--; - for (; 1 <= g && 0 <= h; g--, h--) if (e[g] !== f2[h]) { - if (1 !== g || 1 !== h) { - do - if (g--, h--, 0 > h || e[g] !== f2[h]) { - var k2 = "\n" + e[g].replace(" at new ", " at "); - a.displayName && k2.includes("") && (k2 = k2.replace("", a.displayName)); - return k2; - } - while (1 <= g && 0 <= h); - } - break; - } - } - } finally { - Na = false, Error.prepareStackTrace = c; - } - return (a = a ? a.displayName || a.name : "") ? Ma(a) : ""; -} -function Pa(a) { - switch (a.tag) { - case 5: - return Ma(a.type); - case 16: - return Ma("Lazy"); - case 13: - return Ma("Suspense"); - case 19: - return Ma("SuspenseList"); - case 0: - case 2: - case 15: - return a = Oa(a.type, false), a; - case 11: - return a = Oa(a.type.render, false), a; - case 1: - return a = Oa(a.type, true), a; - default: - return ""; - } -} -function Qa(a) { - if (null == a) return null; - if ("function" === typeof a) return a.displayName || a.name || null; - if ("string" === typeof a) return a; - switch (a) { - case ya: - return "Fragment"; - case wa: - return "Portal"; - case Aa: - return "Profiler"; - case za: - return "StrictMode"; - case Ea: - return "Suspense"; - case Fa: - return "SuspenseList"; - } - if ("object" === typeof a) switch (a.$$typeof) { - case Ca: - return (a.displayName || "Context") + ".Consumer"; - case Ba: - return (a._context.displayName || "Context") + ".Provider"; - case Da: - var b = a.render; - a = a.displayName; - a || (a = b.displayName || b.name || "", a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"); - return a; - case Ga: - return b = a.displayName || null, null !== b ? b : Qa(a.type) || "Memo"; - case Ha: - b = a._payload; - a = a._init; - try { - return Qa(a(b)); - } catch (c) { - } - } - return null; -} -function Ra(a) { - var b = a.type; - switch (a.tag) { - case 24: - return "Cache"; - case 9: - return (b.displayName || "Context") + ".Consumer"; - case 10: - return (b._context.displayName || "Context") + ".Provider"; - case 18: - return "DehydratedFragment"; - case 11: - return a = b.render, a = a.displayName || a.name || "", b.displayName || ("" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"); - case 7: - return "Fragment"; - case 5: - return b; - case 4: - return "Portal"; - case 3: - return "Root"; - case 6: - return "Text"; - case 16: - return Qa(b); - case 8: - return b === za ? "StrictMode" : "Mode"; - case 22: - return "Offscreen"; - case 12: - return "Profiler"; - case 21: - return "Scope"; - case 13: - return "Suspense"; - case 19: - return "SuspenseList"; - case 25: - return "TracingMarker"; - case 1: - case 0: - case 17: - case 2: - case 14: - case 15: - if ("function" === typeof b) return b.displayName || b.name || null; - if ("string" === typeof b) return b; - } - return null; -} -function Sa(a) { - switch (typeof a) { - case "boolean": - case "number": - case "string": - case "undefined": - return a; - case "object": - return a; - default: - return ""; - } -} -function Ta(a) { - var b = a.type; - return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b); -} -function Ua(a) { - var b = Ta(a) ? "checked" : "value", c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b), d = "" + a[b]; - if (!a.hasOwnProperty(b) && "undefined" !== typeof c && "function" === typeof c.get && "function" === typeof c.set) { - var e = c.get, f2 = c.set; - Object.defineProperty(a, b, { configurable: true, get: function() { - return e.call(this); - }, set: function(a2) { - d = "" + a2; - f2.call(this, a2); - } }); - Object.defineProperty(a, b, { enumerable: c.enumerable }); - return { getValue: function() { - return d; - }, setValue: function(a2) { - d = "" + a2; - }, stopTracking: function() { - a._valueTracker = null; - delete a[b]; - } }; - } -} -function Va(a) { - a._valueTracker || (a._valueTracker = Ua(a)); -} -function Wa(a) { - if (!a) return false; - var b = a._valueTracker; - if (!b) return true; - var c = b.getValue(); - var d = ""; - a && (d = Ta(a) ? a.checked ? "true" : "false" : a.value); - a = d; - return a !== c ? (b.setValue(a), true) : false; -} -function Xa(a) { - a = a || ("undefined" !== typeof document ? document : void 0); - if ("undefined" === typeof a) return null; - try { - return a.activeElement || a.body; - } catch (b) { - return a.body; - } -} -function Ya(a, b) { - var c = b.checked; - return A({}, b, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c ? c : a._wrapperState.initialChecked }); -} -function Za(a, b) { - var c = null == b.defaultValue ? "" : b.defaultValue, d = null != b.checked ? b.checked : b.defaultChecked; - c = Sa(null != b.value ? b.value : c); - a._wrapperState = { initialChecked: d, initialValue: c, controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value }; -} -function ab(a, b) { - b = b.checked; - null != b && ta(a, "checked", b, false); -} -function bb(a, b) { - ab(a, b); - var c = Sa(b.value), d = b.type; - if (null != c) if ("number" === d) { - if (0 === c && "" === a.value || a.value != c) a.value = "" + c; - } else a.value !== "" + c && (a.value = "" + c); - else if ("submit" === d || "reset" === d) { - a.removeAttribute("value"); - return; - } - b.hasOwnProperty("value") ? cb(a, b.type, c) : b.hasOwnProperty("defaultValue") && cb(a, b.type, Sa(b.defaultValue)); - null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked); -} -function db(a, b, c) { - if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) { - var d = b.type; - if (!("submit" !== d && "reset" !== d || void 0 !== b.value && null !== b.value)) return; - b = "" + a._wrapperState.initialValue; - c || b === a.value || (a.value = b); - a.defaultValue = b; - } - c = a.name; - "" !== c && (a.name = ""); - a.defaultChecked = !!a._wrapperState.initialChecked; - "" !== c && (a.name = c); -} -function cb(a, b, c) { - if ("number" !== b || Xa(a.ownerDocument) !== a) null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c); -} -var eb = Array.isArray; -function fb(a, b, c, d) { - a = a.options; - if (b) { - b = {}; - for (var e = 0; e < c.length; e++) b["$" + c[e]] = true; - for (c = 0; c < a.length; c++) e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = true); - } else { - c = "" + Sa(c); - b = null; - for (e = 0; e < a.length; e++) { - if (a[e].value === c) { - a[e].selected = true; - d && (a[e].defaultSelected = true); - return; - } - null !== b || a[e].disabled || (b = a[e]); - } - null !== b && (b.selected = true); - } -} -function gb(a, b) { - if (null != b.dangerouslySetInnerHTML) throw Error(p(91)); - return A({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue }); -} -function hb(a, b) { - var c = b.value; - if (null == c) { - c = b.children; - b = b.defaultValue; - if (null != c) { - if (null != b) throw Error(p(92)); - if (eb(c)) { - if (1 < c.length) throw Error(p(93)); - c = c[0]; - } - b = c; - } - null == b && (b = ""); - c = b; - } - a._wrapperState = { initialValue: Sa(c) }; -} -function ib(a, b) { - var c = Sa(b.value), d = Sa(b.defaultValue); - null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c)); - null != d && (a.defaultValue = "" + d); -} -function jb(a) { - var b = a.textContent; - b === a._wrapperState.initialValue && "" !== b && null !== b && (a.value = b); -} -function kb(a) { - switch (a) { - case "svg": - return "http://www.w3.org/2000/svg"; - case "math": - return "http://www.w3.org/1998/Math/MathML"; - default: - return "http://www.w3.org/1999/xhtml"; - } -} -function lb(a, b) { - return null == a || "http://www.w3.org/1999/xhtml" === a ? kb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a; -} -var mb, nb = function(a) { - return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) { - MSApp.execUnsafeLocalFunction(function() { - return a(b, c, d, e); - }); - } : a; -}(function(a, b) { - if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML" in a) a.innerHTML = b; - else { - mb = mb || document.createElement("div"); - mb.innerHTML = "" + b.valueOf().toString() + ""; - for (b = mb.firstChild; a.firstChild; ) a.removeChild(a.firstChild); - for (; b.firstChild; ) a.appendChild(b.firstChild); - } -}); -function ob(a, b) { - if (b) { - var c = a.firstChild; - if (c && c === a.lastChild && 3 === c.nodeType) { - c.nodeValue = b; - return; - } - } - a.textContent = b; -} -var pb = { - animationIterationCount: true, - aspectRatio: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - columns: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridArea: true, - gridRow: true, - gridRowEnd: true, - gridRowSpan: true, - gridRowStart: true, - gridColumn: true, - gridColumnEnd: true, - gridColumnSpan: true, - gridColumnStart: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true -}, qb = ["Webkit", "ms", "Moz", "O"]; -Object.keys(pb).forEach(function(a) { - qb.forEach(function(b) { - b = b + a.charAt(0).toUpperCase() + a.substring(1); - pb[b] = pb[a]; - }); -}); -function rb(a, b, c) { - return null == b || "boolean" === typeof b || "" === b ? "" : c || "number" !== typeof b || 0 === b || pb.hasOwnProperty(a) && pb[a] ? ("" + b).trim() : b + "px"; -} -function sb(a, b) { - a = a.style; - for (var c in b) if (b.hasOwnProperty(c)) { - var d = 0 === c.indexOf("--"), e = rb(c, b[c], d); - "float" === c && (c = "cssFloat"); - d ? a.setProperty(c, e) : a[c] = e; - } -} -var tb = A({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); -function ub(a, b) { - if (b) { - if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a)); - if (null != b.dangerouslySetInnerHTML) { - if (null != b.children) throw Error(p(60)); - if ("object" !== typeof b.dangerouslySetInnerHTML || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61)); - } - if (null != b.style && "object" !== typeof b.style) throw Error(p(62)); - } -} -function vb(a, b) { - if (-1 === a.indexOf("-")) return "string" === typeof b.is; - switch (a) { - case "annotation-xml": - case "color-profile": - case "font-face": - case "font-face-src": - case "font-face-uri": - case "font-face-format": - case "font-face-name": - case "missing-glyph": - return false; - default: - return true; - } -} -var wb = null; -function xb(a) { - a = a.target || a.srcElement || window; - a.correspondingUseElement && (a = a.correspondingUseElement); - return 3 === a.nodeType ? a.parentNode : a; -} -var yb = null, zb = null, Ab = null; -function Bb(a) { - if (a = Cb(a)) { - if ("function" !== typeof yb) throw Error(p(280)); - var b = a.stateNode; - b && (b = Db(b), yb(a.stateNode, a.type, b)); - } -} -function Eb(a) { - zb ? Ab ? Ab.push(a) : Ab = [a] : zb = a; -} -function Fb() { - if (zb) { - var a = zb, b = Ab; - Ab = zb = null; - Bb(a); - if (b) for (a = 0; a < b.length; a++) Bb(b[a]); - } -} -function Gb(a, b) { - return a(b); -} -function Hb() { -} -var Ib = false; -function Jb(a, b, c) { - if (Ib) return a(b, c); - Ib = true; - try { - return Gb(a, b, c); - } finally { - if (Ib = false, null !== zb || null !== Ab) Hb(), Fb(); - } -} -function Kb(a, b) { - var c = a.stateNode; - if (null === c) return null; - var d = Db(c); - if (null === d) return null; - c = d[b]; - a: switch (b) { - case "onClick": - case "onClickCapture": - case "onDoubleClick": - case "onDoubleClickCapture": - case "onMouseDown": - case "onMouseDownCapture": - case "onMouseMove": - case "onMouseMoveCapture": - case "onMouseUp": - case "onMouseUpCapture": - case "onMouseEnter": - (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a)); - a = !d; - break a; - default: - a = false; - } - if (a) return null; - if (c && "function" !== typeof c) throw Error(p(231, b, typeof c)); - return c; -} -var Lb = false; -if (ia) try { - var Mb = {}; - Object.defineProperty(Mb, "passive", { get: function() { - Lb = true; - } }); - window.addEventListener("test", Mb, Mb); - window.removeEventListener("test", Mb, Mb); -} catch (a) { - Lb = false; -} -function Nb(a, b, c, d, e, f2, g, h, k2) { - var l2 = Array.prototype.slice.call(arguments, 3); - try { - b.apply(c, l2); - } catch (m2) { - this.onError(m2); - } -} -var Ob = false, Pb = null, Qb = false, Rb = null, Sb = { onError: function(a) { - Ob = true; - Pb = a; -} }; -function Tb(a, b, c, d, e, f2, g, h, k2) { - Ob = false; - Pb = null; - Nb.apply(Sb, arguments); -} -function Ub(a, b, c, d, e, f2, g, h, k2) { - Tb.apply(this, arguments); - if (Ob) { - if (Ob) { - var l2 = Pb; - Ob = false; - Pb = null; - } else throw Error(p(198)); - Qb || (Qb = true, Rb = l2); - } -} -function Vb(a) { - var b = a, c = a; - if (a.alternate) for (; b.return; ) b = b.return; - else { - a = b; - do - b = a, 0 !== (b.flags & 4098) && (c = b.return), a = b.return; - while (a); - } - return 3 === b.tag ? c : null; -} -function Wb(a) { - if (13 === a.tag) { - var b = a.memoizedState; - null === b && (a = a.alternate, null !== a && (b = a.memoizedState)); - if (null !== b) return b.dehydrated; - } - return null; -} -function Xb(a) { - if (Vb(a) !== a) throw Error(p(188)); -} -function Yb(a) { - var b = a.alternate; - if (!b) { - b = Vb(a); - if (null === b) throw Error(p(188)); - return b !== a ? null : a; - } - for (var c = a, d = b; ; ) { - var e = c.return; - if (null === e) break; - var f2 = e.alternate; - if (null === f2) { - d = e.return; - if (null !== d) { - c = d; - continue; - } - break; - } - if (e.child === f2.child) { - for (f2 = e.child; f2; ) { - if (f2 === c) return Xb(e), a; - if (f2 === d) return Xb(e), b; - f2 = f2.sibling; - } - throw Error(p(188)); - } - if (c.return !== d.return) c = e, d = f2; - else { - for (var g = false, h = e.child; h; ) { - if (h === c) { - g = true; - c = e; - d = f2; - break; - } - if (h === d) { - g = true; - d = e; - c = f2; - break; - } - h = h.sibling; - } - if (!g) { - for (h = f2.child; h; ) { - if (h === c) { - g = true; - c = f2; - d = e; - break; - } - if (h === d) { - g = true; - d = f2; - c = e; - break; - } - h = h.sibling; - } - if (!g) throw Error(p(189)); - } - } - if (c.alternate !== d) throw Error(p(190)); - } - if (3 !== c.tag) throw Error(p(188)); - return c.stateNode.current === c ? a : b; -} -function Zb(a) { - a = Yb(a); - return null !== a ? $b(a) : null; -} -function $b(a) { - if (5 === a.tag || 6 === a.tag) return a; - for (a = a.child; null !== a; ) { - var b = $b(a); - if (null !== b) return b; - a = a.sibling; - } - return null; -} -var ac = ca.unstable_scheduleCallback, bc = ca.unstable_cancelCallback, cc = ca.unstable_shouldYield, dc = ca.unstable_requestPaint, B = ca.unstable_now, ec = ca.unstable_getCurrentPriorityLevel, fc = ca.unstable_ImmediatePriority, gc = ca.unstable_UserBlockingPriority, hc = ca.unstable_NormalPriority, ic = ca.unstable_LowPriority, jc = ca.unstable_IdlePriority, kc = null, lc = null; -function mc(a) { - if (lc && "function" === typeof lc.onCommitFiberRoot) try { - lc.onCommitFiberRoot(kc, a, void 0, 128 === (a.current.flags & 128)); - } catch (b) { - } -} -var oc = Math.clz32 ? Math.clz32 : nc, pc = Math.log, qc = Math.LN2; -function nc(a) { - a >>>= 0; - return 0 === a ? 32 : 31 - (pc(a) / qc | 0) | 0; -} -var rc = 64, sc = 4194304; -function tc(a) { - switch (a & -a) { - case 1: - return 1; - case 2: - return 2; - case 4: - return 4; - case 8: - return 8; - case 16: - return 16; - case 32: - return 32; - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return a & 4194240; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - return a & 130023424; - case 134217728: - return 134217728; - case 268435456: - return 268435456; - case 536870912: - return 536870912; - case 1073741824: - return 1073741824; - default: - return a; - } -} -function uc(a, b) { - var c = a.pendingLanes; - if (0 === c) return 0; - var d = 0, e = a.suspendedLanes, f2 = a.pingedLanes, g = c & 268435455; - if (0 !== g) { - var h = g & ~e; - 0 !== h ? d = tc(h) : (f2 &= g, 0 !== f2 && (d = tc(f2))); - } else g = c & ~e, 0 !== g ? d = tc(g) : 0 !== f2 && (d = tc(f2)); - if (0 === d) return 0; - if (0 !== b && b !== d && 0 === (b & e) && (e = d & -d, f2 = b & -b, e >= f2 || 16 === e && 0 !== (f2 & 4194240))) return b; - 0 !== (d & 4) && (d |= c & 16); - b = a.entangledLanes; - if (0 !== b) for (a = a.entanglements, b &= d; 0 < b; ) c = 31 - oc(b), e = 1 << c, d |= a[c], b &= ~e; - return d; -} -function vc(a, b) { - switch (a) { - case 1: - case 2: - case 4: - return b + 250; - case 8: - case 16: - case 32: - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return b + 5e3; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - return -1; - case 134217728: - case 268435456: - case 536870912: - case 1073741824: - return -1; - default: - return -1; - } -} -function wc(a, b) { - for (var c = a.suspendedLanes, d = a.pingedLanes, e = a.expirationTimes, f2 = a.pendingLanes; 0 < f2; ) { - var g = 31 - oc(f2), h = 1 << g, k2 = e[g]; - if (-1 === k2) { - if (0 === (h & c) || 0 !== (h & d)) e[g] = vc(h, b); - } else k2 <= b && (a.expiredLanes |= h); - f2 &= ~h; - } -} -function xc(a) { - a = a.pendingLanes & -1073741825; - return 0 !== a ? a : a & 1073741824 ? 1073741824 : 0; -} -function yc() { - var a = rc; - rc <<= 1; - 0 === (rc & 4194240) && (rc = 64); - return a; -} -function zc(a) { - for (var b = [], c = 0; 31 > c; c++) b.push(a); - return b; -} -function Ac(a, b, c) { - a.pendingLanes |= b; - 536870912 !== b && (a.suspendedLanes = 0, a.pingedLanes = 0); - a = a.eventTimes; - b = 31 - oc(b); - a[b] = c; -} -function Bc(a, b) { - var c = a.pendingLanes & ~b; - a.pendingLanes = b; - a.suspendedLanes = 0; - a.pingedLanes = 0; - a.expiredLanes &= b; - a.mutableReadLanes &= b; - a.entangledLanes &= b; - b = a.entanglements; - var d = a.eventTimes; - for (a = a.expirationTimes; 0 < c; ) { - var e = 31 - oc(c), f2 = 1 << e; - b[e] = 0; - d[e] = -1; - a[e] = -1; - c &= ~f2; - } -} -function Cc(a, b) { - var c = a.entangledLanes |= b; - for (a = a.entanglements; c; ) { - var d = 31 - oc(c), e = 1 << d; - e & b | a[d] & b && (a[d] |= b); - c &= ~e; - } -} -var C = 0; -function Dc(a) { - a &= -a; - return 1 < a ? 4 < a ? 0 !== (a & 268435455) ? 16 : 536870912 : 4 : 1; -} -var Ec, Fc, Gc, Hc, Ic, Jc = false, Kc = [], Lc = null, Mc = null, Nc = null, Oc = /* @__PURE__ */ new Map(), Pc = /* @__PURE__ */ new Map(), Qc = [], Rc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); -function Sc(a, b) { - switch (a) { - case "focusin": - case "focusout": - Lc = null; - break; - case "dragenter": - case "dragleave": - Mc = null; - break; - case "mouseover": - case "mouseout": - Nc = null; - break; - case "pointerover": - case "pointerout": - Oc.delete(b.pointerId); - break; - case "gotpointercapture": - case "lostpointercapture": - Pc.delete(b.pointerId); - } -} -function Tc(a, b, c, d, e, f2) { - if (null === a || a.nativeEvent !== f2) return a = { blockedOn: b, domEventName: c, eventSystemFlags: d, nativeEvent: f2, targetContainers: [e] }, null !== b && (b = Cb(b), null !== b && Fc(b)), a; - a.eventSystemFlags |= d; - b = a.targetContainers; - null !== e && -1 === b.indexOf(e) && b.push(e); - return a; -} -function Uc(a, b, c, d, e) { - switch (b) { - case "focusin": - return Lc = Tc(Lc, a, b, c, d, e), true; - case "dragenter": - return Mc = Tc(Mc, a, b, c, d, e), true; - case "mouseover": - return Nc = Tc(Nc, a, b, c, d, e), true; - case "pointerover": - var f2 = e.pointerId; - Oc.set(f2, Tc(Oc.get(f2) || null, a, b, c, d, e)); - return true; - case "gotpointercapture": - return f2 = e.pointerId, Pc.set(f2, Tc(Pc.get(f2) || null, a, b, c, d, e)), true; - } - return false; -} -function Vc(a) { - var b = Wc(a.target); - if (null !== b) { - var c = Vb(b); - if (null !== c) { - if (b = c.tag, 13 === b) { - if (b = Wb(c), null !== b) { - a.blockedOn = b; - Ic(a.priority, function() { - Gc(c); - }); - return; - } - } else if (3 === b && c.stateNode.current.memoizedState.isDehydrated) { - a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null; - return; - } - } - } - a.blockedOn = null; -} -function Xc(a) { - if (null !== a.blockedOn) return false; - for (var b = a.targetContainers; 0 < b.length; ) { - var c = Yc(a.domEventName, a.eventSystemFlags, b[0], a.nativeEvent); - if (null === c) { - c = a.nativeEvent; - var d = new c.constructor(c.type, c); - wb = d; - c.target.dispatchEvent(d); - wb = null; - } else return b = Cb(c), null !== b && Fc(b), a.blockedOn = c, false; - b.shift(); - } - return true; -} -function Zc(a, b, c) { - Xc(a) && c.delete(b); -} -function $c() { - Jc = false; - null !== Lc && Xc(Lc) && (Lc = null); - null !== Mc && Xc(Mc) && (Mc = null); - null !== Nc && Xc(Nc) && (Nc = null); - Oc.forEach(Zc); - Pc.forEach(Zc); -} -function ad(a, b) { - a.blockedOn === b && (a.blockedOn = null, Jc || (Jc = true, ca.unstable_scheduleCallback(ca.unstable_NormalPriority, $c))); -} -function bd(a) { - function b(b2) { - return ad(b2, a); - } - if (0 < Kc.length) { - ad(Kc[0], a); - for (var c = 1; c < Kc.length; c++) { - var d = Kc[c]; - d.blockedOn === a && (d.blockedOn = null); - } - } - null !== Lc && ad(Lc, a); - null !== Mc && ad(Mc, a); - null !== Nc && ad(Nc, a); - Oc.forEach(b); - Pc.forEach(b); - for (c = 0; c < Qc.length; c++) d = Qc[c], d.blockedOn === a && (d.blockedOn = null); - for (; 0 < Qc.length && (c = Qc[0], null === c.blockedOn); ) Vc(c), null === c.blockedOn && Qc.shift(); -} -var cd = ua.ReactCurrentBatchConfig, dd = true; -function ed(a, b, c, d) { - var e = C, f2 = cd.transition; - cd.transition = null; - try { - C = 1, fd(a, b, c, d); - } finally { - C = e, cd.transition = f2; - } -} -function gd(a, b, c, d) { - var e = C, f2 = cd.transition; - cd.transition = null; - try { - C = 4, fd(a, b, c, d); - } finally { - C = e, cd.transition = f2; - } -} -function fd(a, b, c, d) { - if (dd) { - var e = Yc(a, b, c, d); - if (null === e) hd(a, b, d, id, c), Sc(a, d); - else if (Uc(e, a, b, c, d)) d.stopPropagation(); - else if (Sc(a, d), b & 4 && -1 < Rc.indexOf(a)) { - for (; null !== e; ) { - var f2 = Cb(e); - null !== f2 && Ec(f2); - f2 = Yc(a, b, c, d); - null === f2 && hd(a, b, d, id, c); - if (f2 === e) break; - e = f2; - } - null !== e && d.stopPropagation(); - } else hd(a, b, d, null, c); - } -} -var id = null; -function Yc(a, b, c, d) { - id = null; - a = xb(d); - a = Wc(a); - if (null !== a) if (b = Vb(a), null === b) a = null; - else if (c = b.tag, 13 === c) { - a = Wb(b); - if (null !== a) return a; - a = null; - } else if (3 === c) { - if (b.stateNode.current.memoizedState.isDehydrated) return 3 === b.tag ? b.stateNode.containerInfo : null; - a = null; - } else b !== a && (a = null); - id = a; - return null; -} -function jd(a) { - switch (a) { - case "cancel": - case "click": - case "close": - case "contextmenu": - case "copy": - case "cut": - case "auxclick": - case "dblclick": - case "dragend": - case "dragstart": - case "drop": - case "focusin": - case "focusout": - case "input": - case "invalid": - case "keydown": - case "keypress": - case "keyup": - case "mousedown": - case "mouseup": - case "paste": - case "pause": - case "play": - case "pointercancel": - case "pointerdown": - case "pointerup": - case "ratechange": - case "reset": - case "resize": - case "seeked": - case "submit": - case "touchcancel": - case "touchend": - case "touchstart": - case "volumechange": - case "change": - case "selectionchange": - case "textInput": - case "compositionstart": - case "compositionend": - case "compositionupdate": - case "beforeblur": - case "afterblur": - case "beforeinput": - case "blur": - case "fullscreenchange": - case "focus": - case "hashchange": - case "popstate": - case "select": - case "selectstart": - return 1; - case "drag": - case "dragenter": - case "dragexit": - case "dragleave": - case "dragover": - case "mousemove": - case "mouseout": - case "mouseover": - case "pointermove": - case "pointerout": - case "pointerover": - case "scroll": - case "toggle": - case "touchmove": - case "wheel": - case "mouseenter": - case "mouseleave": - case "pointerenter": - case "pointerleave": - return 4; - case "message": - switch (ec()) { - case fc: - return 1; - case gc: - return 4; - case hc: - case ic: - return 16; - case jc: - return 536870912; - default: - return 16; - } - default: - return 16; - } -} -var kd = null, ld = null, md = null; -function nd() { - if (md) return md; - var a, b = ld, c = b.length, d, e = "value" in kd ? kd.value : kd.textContent, f2 = e.length; - for (a = 0; a < c && b[a] === e[a]; a++) ; - var g = c - a; - for (d = 1; d <= g && b[c - d] === e[f2 - d]; d++) ; - return md = e.slice(a, 1 < d ? 1 - d : void 0); -} -function od(a) { - var b = a.keyCode; - "charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b; - 10 === a && (a = 13); - return 32 <= a || 13 === a ? a : 0; -} -function pd() { - return true; -} -function qd() { - return false; -} -function rd(a) { - function b(b2, d, e, f2, g) { - this._reactName = b2; - this._targetInst = e; - this.type = d; - this.nativeEvent = f2; - this.target = g; - this.currentTarget = null; - for (var c in a) a.hasOwnProperty(c) && (b2 = a[c], this[c] = b2 ? b2(f2) : f2[c]); - this.isDefaultPrevented = (null != f2.defaultPrevented ? f2.defaultPrevented : false === f2.returnValue) ? pd : qd; - this.isPropagationStopped = qd; - return this; - } - A(b.prototype, { preventDefault: function() { - this.defaultPrevented = true; - var a2 = this.nativeEvent; - a2 && (a2.preventDefault ? a2.preventDefault() : "unknown" !== typeof a2.returnValue && (a2.returnValue = false), this.isDefaultPrevented = pd); - }, stopPropagation: function() { - var a2 = this.nativeEvent; - a2 && (a2.stopPropagation ? a2.stopPropagation() : "unknown" !== typeof a2.cancelBubble && (a2.cancelBubble = true), this.isPropagationStopped = pd); - }, persist: function() { - }, isPersistent: pd }); - return b; -} -var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a) { - return a.timeStamp || Date.now(); -}, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = A({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = A({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a) { - return void 0 === a.relatedTarget ? a.fromElement === a.srcElement ? a.toElement : a.fromElement : a.relatedTarget; -}, movementX: function(a) { - if ("movementX" in a) return a.movementX; - a !== yd && (yd && "mousemove" === a.type ? (wd = a.screenX - yd.screenX, xd = a.screenY - yd.screenY) : xd = wd = 0, yd = a); - return wd; -}, movementY: function(a) { - return "movementY" in a ? a.movementY : xd; -} }), Bd = rd(Ad), Cd = A({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = A({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = A({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = A({}, sd, { clipboardData: function(a) { - return "clipboardData" in a ? a.clipboardData : window.clipboardData; -} }), Jd = rd(Id), Kd = A({}, sd, { data: 0 }), Ld = rd(Kd), Md = { - Esc: "Escape", - Spacebar: " ", - Left: "ArrowLeft", - Up: "ArrowUp", - Right: "ArrowRight", - Down: "ArrowDown", - Del: "Delete", - Win: "OS", - Menu: "ContextMenu", - Apps: "ContextMenu", - Scroll: "ScrollLock", - MozPrintableKey: "Unidentified" -}, Nd = { - 8: "Backspace", - 9: "Tab", - 12: "Clear", - 13: "Enter", - 16: "Shift", - 17: "Control", - 18: "Alt", - 19: "Pause", - 20: "CapsLock", - 27: "Escape", - 32: " ", - 33: "PageUp", - 34: "PageDown", - 35: "End", - 36: "Home", - 37: "ArrowLeft", - 38: "ArrowUp", - 39: "ArrowRight", - 40: "ArrowDown", - 45: "Insert", - 46: "Delete", - 112: "F1", - 113: "F2", - 114: "F3", - 115: "F4", - 116: "F5", - 117: "F6", - 118: "F7", - 119: "F8", - 120: "F9", - 121: "F10", - 122: "F11", - 123: "F12", - 144: "NumLock", - 145: "ScrollLock", - 224: "Meta" -}, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; -function Pd(a) { - var b = this.nativeEvent; - return b.getModifierState ? b.getModifierState(a) : (a = Od[a]) ? !!b[a] : false; -} -function zd() { - return Pd; -} -var Qd = A({}, ud, { key: function(a) { - if (a.key) { - var b = Md[a.key] || a.key; - if ("Unidentified" !== b) return b; - } - return "keypress" === a.type ? (a = od(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? Nd[a.keyCode] || "Unidentified" : ""; -}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a) { - return "keypress" === a.type ? od(a) : 0; -}, keyCode: function(a) { - return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; -}, which: function(a) { - return "keypress" === a.type ? od(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; -} }), Rd = rd(Qd), Sd = A({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = A({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = A({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = A({}, Ad, { - deltaX: function(a) { - return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0; - }, - deltaY: function(a) { - return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0; - }, - deltaZ: 0, - deltaMode: 0 -}), Zd = rd(Yd), $d = [9, 13, 27, 32], ae = ia && "CompositionEvent" in window, be = null; -ia && "documentMode" in document && (be = document.documentMode); -var ce = ia && "TextEvent" in window && !be, de = ia && (!ae || be && 8 < be && 11 >= be), ee = String.fromCharCode(32), fe = false; -function ge(a, b) { - switch (a) { - case "keyup": - return -1 !== $d.indexOf(b.keyCode); - case "keydown": - return 229 !== b.keyCode; - case "keypress": - case "mousedown": - case "focusout": - return true; - default: - return false; - } -} -function he(a) { - a = a.detail; - return "object" === typeof a && "data" in a ? a.data : null; -} -var ie = false; -function je(a, b) { - switch (a) { - case "compositionend": - return he(b); - case "keypress": - if (32 !== b.which) return null; - fe = true; - return ee; - case "textInput": - return a = b.data, a === ee && fe ? null : a; - default: - return null; - } -} -function ke(a, b) { - if (ie) return "compositionend" === a || !ae && ge(a, b) ? (a = nd(), md = ld = kd = null, ie = false, a) : null; - switch (a) { - case "paste": - return null; - case "keypress": - if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) { - if (b.char && 1 < b.char.length) return b.char; - if (b.which) return String.fromCharCode(b.which); - } - return null; - case "compositionend": - return de && "ko" !== b.locale ? null : b.data; - default: - return null; - } -} -var le = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; -function me(a) { - var b = a && a.nodeName && a.nodeName.toLowerCase(); - return "input" === b ? !!le[a.type] : "textarea" === b ? true : false; -} -function ne(a, b, c, d) { - Eb(d); - b = oe(b, "onChange"); - 0 < b.length && (c = new td("onChange", "change", null, c, d), a.push({ event: c, listeners: b })); -} -var pe = null, qe = null; -function re(a) { - se(a, 0); -} -function te(a) { - var b = ue(a); - if (Wa(b)) return a; -} -function ve(a, b) { - if ("change" === a) return b; -} -var we = false; -if (ia) { - var xe; - if (ia) { - var ye = "oninput" in document; - if (!ye) { - var ze = document.createElement("div"); - ze.setAttribute("oninput", "return;"); - ye = "function" === typeof ze.oninput; - } - xe = ye; - } else xe = false; - we = xe && (!document.documentMode || 9 < document.documentMode); -} -function Ae() { - pe && (pe.detachEvent("onpropertychange", Be), qe = pe = null); -} -function Be(a) { - if ("value" === a.propertyName && te(qe)) { - var b = []; - ne(b, qe, a, xb(a)); - Jb(re, b); - } -} -function Ce(a, b, c) { - "focusin" === a ? (Ae(), pe = b, qe = c, pe.attachEvent("onpropertychange", Be)) : "focusout" === a && Ae(); -} -function De(a) { - if ("selectionchange" === a || "keyup" === a || "keydown" === a) return te(qe); -} -function Ee(a, b) { - if ("click" === a) return te(b); -} -function Fe(a, b) { - if ("input" === a || "change" === a) return te(b); -} -function Ge(a, b) { - return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b; -} -var He = "function" === typeof Object.is ? Object.is : Ge; -function Ie(a, b) { - if (He(a, b)) return true; - if ("object" !== typeof a || null === a || "object" !== typeof b || null === b) return false; - var c = Object.keys(a), d = Object.keys(b); - if (c.length !== d.length) return false; - for (d = 0; d < c.length; d++) { - var e = c[d]; - if (!ja.call(b, e) || !He(a[e], b[e])) return false; - } - return true; -} -function Je(a) { - for (; a && a.firstChild; ) a = a.firstChild; - return a; -} -function Ke(a, b) { - var c = Je(a); - a = 0; - for (var d; c; ) { - if (3 === c.nodeType) { - d = a + c.textContent.length; - if (a <= b && d >= b) return { node: c, offset: b - a }; - a = d; - } - a: { - for (; c; ) { - if (c.nextSibling) { - c = c.nextSibling; - break a; - } - c = c.parentNode; - } - c = void 0; - } - c = Je(c); - } -} -function Le(a, b) { - return a && b ? a === b ? true : a && 3 === a.nodeType ? false : b && 3 === b.nodeType ? Le(a, b.parentNode) : "contains" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : false : false; -} -function Me() { - for (var a = window, b = Xa(); b instanceof a.HTMLIFrameElement; ) { - try { - var c = "string" === typeof b.contentWindow.location.href; - } catch (d) { - c = false; - } - if (c) a = b.contentWindow; - else break; - b = Xa(a.document); - } - return b; -} -function Ne(a) { - var b = a && a.nodeName && a.nodeName.toLowerCase(); - return b && ("input" === b && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b || "true" === a.contentEditable); -} -function Oe(a) { - var b = Me(), c = a.focusedElem, d = a.selectionRange; - if (b !== c && c && c.ownerDocument && Le(c.ownerDocument.documentElement, c)) { - if (null !== d && Ne(c)) { - if (b = d.start, a = d.end, void 0 === a && (a = b), "selectionStart" in c) c.selectionStart = b, c.selectionEnd = Math.min(a, c.value.length); - else if (a = (b = c.ownerDocument || document) && b.defaultView || window, a.getSelection) { - a = a.getSelection(); - var e = c.textContent.length, f2 = Math.min(d.start, e); - d = void 0 === d.end ? f2 : Math.min(d.end, e); - !a.extend && f2 > d && (e = d, d = f2, f2 = e); - e = Ke(c, f2); - var g = Ke( - c, - d - ); - e && g && (1 !== a.rangeCount || a.anchorNode !== e.node || a.anchorOffset !== e.offset || a.focusNode !== g.node || a.focusOffset !== g.offset) && (b = b.createRange(), b.setStart(e.node, e.offset), a.removeAllRanges(), f2 > d ? (a.addRange(b), a.extend(g.node, g.offset)) : (b.setEnd(g.node, g.offset), a.addRange(b))); - } - } - b = []; - for (a = c; a = a.parentNode; ) 1 === a.nodeType && b.push({ element: a, left: a.scrollLeft, top: a.scrollTop }); - "function" === typeof c.focus && c.focus(); - for (c = 0; c < b.length; c++) a = b[c], a.element.scrollLeft = a.left, a.element.scrollTop = a.top; - } -} -var Pe = ia && "documentMode" in document && 11 >= document.documentMode, Qe = null, Re = null, Se = null, Te = false; -function Ue(a, b, c) { - var d = c.window === c ? c.document : 9 === c.nodeType ? c : c.ownerDocument; - Te || null == Qe || Qe !== Xa(d) || (d = Qe, "selectionStart" in d && Ne(d) ? d = { start: d.selectionStart, end: d.selectionEnd } : (d = (d.ownerDocument && d.ownerDocument.defaultView || window).getSelection(), d = { anchorNode: d.anchorNode, anchorOffset: d.anchorOffset, focusNode: d.focusNode, focusOffset: d.focusOffset }), Se && Ie(Se, d) || (Se = d, d = oe(Re, "onSelect"), 0 < d.length && (b = new td("onSelect", "select", null, b, c), a.push({ event: b, listeners: d }), b.target = Qe))); -} -function Ve(a, b) { - var c = {}; - c[a.toLowerCase()] = b.toLowerCase(); - c["Webkit" + a] = "webkit" + b; - c["Moz" + a] = "moz" + b; - return c; -} -var We = { animationend: Ve("Animation", "AnimationEnd"), animationiteration: Ve("Animation", "AnimationIteration"), animationstart: Ve("Animation", "AnimationStart"), transitionend: Ve("Transition", "TransitionEnd") }, Xe = {}, Ye = {}; -ia && (Ye = document.createElement("div").style, "AnimationEvent" in window || (delete We.animationend.animation, delete We.animationiteration.animation, delete We.animationstart.animation), "TransitionEvent" in window || delete We.transitionend.transition); -function Ze(a) { - if (Xe[a]) return Xe[a]; - if (!We[a]) return a; - var b = We[a], c; - for (c in b) if (b.hasOwnProperty(c) && c in Ye) return Xe[a] = b[c]; - return a; -} -var $e = Ze("animationend"), af = Ze("animationiteration"), bf = Ze("animationstart"), cf = Ze("transitionend"), df = /* @__PURE__ */ new Map(), ef = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); -function ff(a, b) { - df.set(a, b); - fa(b, [a]); -} -for (var gf = 0; gf < ef.length; gf++) { - var hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1); - ff(jf, "on" + kf); -} -ff($e, "onAnimationEnd"); -ff(af, "onAnimationIteration"); -ff(bf, "onAnimationStart"); -ff("dblclick", "onDoubleClick"); -ff("focusin", "onFocus"); -ff("focusout", "onBlur"); -ff(cf, "onTransitionEnd"); -ha("onMouseEnter", ["mouseout", "mouseover"]); -ha("onMouseLeave", ["mouseout", "mouseover"]); -ha("onPointerEnter", ["pointerout", "pointerover"]); -ha("onPointerLeave", ["pointerout", "pointerover"]); -fa("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); -fa("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); -fa("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); -fa("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); -fa("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); -fa("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); -var lf = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); -function nf(a, b, c) { - var d = a.type || "unknown-event"; - a.currentTarget = c; - Ub(d, b, void 0, a); - a.currentTarget = null; -} -function se(a, b) { - b = 0 !== (b & 4); - for (var c = 0; c < a.length; c++) { - var d = a[c], e = d.event; - d = d.listeners; - a: { - var f2 = void 0; - if (b) for (var g = d.length - 1; 0 <= g; g--) { - var h = d[g], k2 = h.instance, l2 = h.currentTarget; - h = h.listener; - if (k2 !== f2 && e.isPropagationStopped()) break a; - nf(e, h, l2); - f2 = k2; - } - else for (g = 0; g < d.length; g++) { - h = d[g]; - k2 = h.instance; - l2 = h.currentTarget; - h = h.listener; - if (k2 !== f2 && e.isPropagationStopped()) break a; - nf(e, h, l2); - f2 = k2; - } - } - } - if (Qb) throw a = Rb, Qb = false, Rb = null, a; -} -function D(a, b) { - var c = b[of]; - void 0 === c && (c = b[of] = /* @__PURE__ */ new Set()); - var d = a + "__bubble"; - c.has(d) || (pf(b, a, 2, false), c.add(d)); -} -function qf(a, b, c) { - var d = 0; - b && (d |= 4); - pf(c, a, d, b); -} -var rf = "_reactListening" + Math.random().toString(36).slice(2); -function sf(a) { - if (!a[rf]) { - a[rf] = true; - da.forEach(function(b2) { - "selectionchange" !== b2 && (mf.has(b2) || qf(b2, false, a), qf(b2, true, a)); - }); - var b = 9 === a.nodeType ? a : a.ownerDocument; - null === b || b[rf] || (b[rf] = true, qf("selectionchange", false, b)); - } -} -function pf(a, b, c, d) { - switch (jd(b)) { - case 1: - var e = ed; - break; - case 4: - e = gd; - break; - default: - e = fd; - } - c = e.bind(null, b, c, a); - e = void 0; - !Lb || "touchstart" !== b && "touchmove" !== b && "wheel" !== b || (e = true); - d ? void 0 !== e ? a.addEventListener(b, c, { capture: true, passive: e }) : a.addEventListener(b, c, true) : void 0 !== e ? a.addEventListener(b, c, { passive: e }) : a.addEventListener(b, c, false); -} -function hd(a, b, c, d, e) { - var f2 = d; - if (0 === (b & 1) && 0 === (b & 2) && null !== d) a: for (; ; ) { - if (null === d) return; - var g = d.tag; - if (3 === g || 4 === g) { - var h = d.stateNode.containerInfo; - if (h === e || 8 === h.nodeType && h.parentNode === e) break; - if (4 === g) for (g = d.return; null !== g; ) { - var k2 = g.tag; - if (3 === k2 || 4 === k2) { - if (k2 = g.stateNode.containerInfo, k2 === e || 8 === k2.nodeType && k2.parentNode === e) return; - } - g = g.return; - } - for (; null !== h; ) { - g = Wc(h); - if (null === g) return; - k2 = g.tag; - if (5 === k2 || 6 === k2) { - d = f2 = g; - continue a; - } - h = h.parentNode; - } - } - d = d.return; - } - Jb(function() { - var d2 = f2, e2 = xb(c), g2 = []; - a: { - var h2 = df.get(a); - if (void 0 !== h2) { - var k3 = td, n2 = a; - switch (a) { - case "keypress": - if (0 === od(c)) break a; - case "keydown": - case "keyup": - k3 = Rd; - break; - case "focusin": - n2 = "focus"; - k3 = Fd; - break; - case "focusout": - n2 = "blur"; - k3 = Fd; - break; - case "beforeblur": - case "afterblur": - k3 = Fd; - break; - case "click": - if (2 === c.button) break a; - case "auxclick": - case "dblclick": - case "mousedown": - case "mousemove": - case "mouseup": - case "mouseout": - case "mouseover": - case "contextmenu": - k3 = Bd; - break; - case "drag": - case "dragend": - case "dragenter": - case "dragexit": - case "dragleave": - case "dragover": - case "dragstart": - case "drop": - k3 = Dd; - break; - case "touchcancel": - case "touchend": - case "touchmove": - case "touchstart": - k3 = Vd; - break; - case $e: - case af: - case bf: - k3 = Hd; - break; - case cf: - k3 = Xd; - break; - case "scroll": - k3 = vd; - break; - case "wheel": - k3 = Zd; - break; - case "copy": - case "cut": - case "paste": - k3 = Jd; - break; - case "gotpointercapture": - case "lostpointercapture": - case "pointercancel": - case "pointerdown": - case "pointermove": - case "pointerout": - case "pointerover": - case "pointerup": - k3 = Td; - } - var t2 = 0 !== (b & 4), J2 = !t2 && "scroll" === a, x2 = t2 ? null !== h2 ? h2 + "Capture" : null : h2; - t2 = []; - for (var w2 = d2, u2; null !== w2; ) { - u2 = w2; - var F2 = u2.stateNode; - 5 === u2.tag && null !== F2 && (u2 = F2, null !== x2 && (F2 = Kb(w2, x2), null != F2 && t2.push(tf(w2, F2, u2)))); - if (J2) break; - w2 = w2.return; - } - 0 < t2.length && (h2 = new k3(h2, n2, null, c, e2), g2.push({ event: h2, listeners: t2 })); - } - } - if (0 === (b & 7)) { - a: { - h2 = "mouseover" === a || "pointerover" === a; - k3 = "mouseout" === a || "pointerout" === a; - if (h2 && c !== wb && (n2 = c.relatedTarget || c.fromElement) && (Wc(n2) || n2[uf])) break a; - if (k3 || h2) { - h2 = e2.window === e2 ? e2 : (h2 = e2.ownerDocument) ? h2.defaultView || h2.parentWindow : window; - if (k3) { - if (n2 = c.relatedTarget || c.toElement, k3 = d2, n2 = n2 ? Wc(n2) : null, null !== n2 && (J2 = Vb(n2), n2 !== J2 || 5 !== n2.tag && 6 !== n2.tag)) n2 = null; - } else k3 = null, n2 = d2; - if (k3 !== n2) { - t2 = Bd; - F2 = "onMouseLeave"; - x2 = "onMouseEnter"; - w2 = "mouse"; - if ("pointerout" === a || "pointerover" === a) t2 = Td, F2 = "onPointerLeave", x2 = "onPointerEnter", w2 = "pointer"; - J2 = null == k3 ? h2 : ue(k3); - u2 = null == n2 ? h2 : ue(n2); - h2 = new t2(F2, w2 + "leave", k3, c, e2); - h2.target = J2; - h2.relatedTarget = u2; - F2 = null; - Wc(e2) === d2 && (t2 = new t2(x2, w2 + "enter", n2, c, e2), t2.target = u2, t2.relatedTarget = J2, F2 = t2); - J2 = F2; - if (k3 && n2) b: { - t2 = k3; - x2 = n2; - w2 = 0; - for (u2 = t2; u2; u2 = vf(u2)) w2++; - u2 = 0; - for (F2 = x2; F2; F2 = vf(F2)) u2++; - for (; 0 < w2 - u2; ) t2 = vf(t2), w2--; - for (; 0 < u2 - w2; ) x2 = vf(x2), u2--; - for (; w2--; ) { - if (t2 === x2 || null !== x2 && t2 === x2.alternate) break b; - t2 = vf(t2); - x2 = vf(x2); - } - t2 = null; - } - else t2 = null; - null !== k3 && wf(g2, h2, k3, t2, false); - null !== n2 && null !== J2 && wf(g2, J2, n2, t2, true); - } - } - } - a: { - h2 = d2 ? ue(d2) : window; - k3 = h2.nodeName && h2.nodeName.toLowerCase(); - if ("select" === k3 || "input" === k3 && "file" === h2.type) var na = ve; - else if (me(h2)) if (we) na = Fe; - else { - na = De; - var xa = Ce; - } - else (k3 = h2.nodeName) && "input" === k3.toLowerCase() && ("checkbox" === h2.type || "radio" === h2.type) && (na = Ee); - if (na && (na = na(a, d2))) { - ne(g2, na, c, e2); - break a; - } - xa && xa(a, h2, d2); - "focusout" === a && (xa = h2._wrapperState) && xa.controlled && "number" === h2.type && cb(h2, "number", h2.value); - } - xa = d2 ? ue(d2) : window; - switch (a) { - case "focusin": - if (me(xa) || "true" === xa.contentEditable) Qe = xa, Re = d2, Se = null; - break; - case "focusout": - Se = Re = Qe = null; - break; - case "mousedown": - Te = true; - break; - case "contextmenu": - case "mouseup": - case "dragend": - Te = false; - Ue(g2, c, e2); - break; - case "selectionchange": - if (Pe) break; - case "keydown": - case "keyup": - Ue(g2, c, e2); - } - var $a; - if (ae) b: { - switch (a) { - case "compositionstart": - var ba = "onCompositionStart"; - break b; - case "compositionend": - ba = "onCompositionEnd"; - break b; - case "compositionupdate": - ba = "onCompositionUpdate"; - break b; - } - ba = void 0; - } - else ie ? ge(a, c) && (ba = "onCompositionEnd") : "keydown" === a && 229 === c.keyCode && (ba = "onCompositionStart"); - ba && (de && "ko" !== c.locale && (ie || "onCompositionStart" !== ba ? "onCompositionEnd" === ba && ie && ($a = nd()) : (kd = e2, ld = "value" in kd ? kd.value : kd.textContent, ie = true)), xa = oe(d2, ba), 0 < xa.length && (ba = new Ld(ba, a, null, c, e2), g2.push({ event: ba, listeners: xa }), $a ? ba.data = $a : ($a = he(c), null !== $a && (ba.data = $a)))); - if ($a = ce ? je(a, c) : ke(a, c)) d2 = oe(d2, "onBeforeInput"), 0 < d2.length && (e2 = new Ld("onBeforeInput", "beforeinput", null, c, e2), g2.push({ event: e2, listeners: d2 }), e2.data = $a); - } - se(g2, b); - }); -} -function tf(a, b, c) { - return { instance: a, listener: b, currentTarget: c }; -} -function oe(a, b) { - for (var c = b + "Capture", d = []; null !== a; ) { - var e = a, f2 = e.stateNode; - 5 === e.tag && null !== f2 && (e = f2, f2 = Kb(a, c), null != f2 && d.unshift(tf(a, f2, e)), f2 = Kb(a, b), null != f2 && d.push(tf(a, f2, e))); - a = a.return; - } - return d; -} -function vf(a) { - if (null === a) return null; - do - a = a.return; - while (a && 5 !== a.tag); - return a ? a : null; -} -function wf(a, b, c, d, e) { - for (var f2 = b._reactName, g = []; null !== c && c !== d; ) { - var h = c, k2 = h.alternate, l2 = h.stateNode; - if (null !== k2 && k2 === d) break; - 5 === h.tag && null !== l2 && (h = l2, e ? (k2 = Kb(c, f2), null != k2 && g.unshift(tf(c, k2, h))) : e || (k2 = Kb(c, f2), null != k2 && g.push(tf(c, k2, h)))); - c = c.return; - } - 0 !== g.length && a.push({ event: b, listeners: g }); -} -var xf = /\r\n?/g, yf = /\u0000|\uFFFD/g; -function zf(a) { - return ("string" === typeof a ? a : "" + a).replace(xf, "\n").replace(yf, ""); -} -function Af(a, b, c) { - b = zf(b); - if (zf(a) !== b && c) throw Error(p(425)); -} -function Bf() { -} -var Cf = null, Df = null; -function Ef(a, b) { - return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html; -} -var Ff = "function" === typeof setTimeout ? setTimeout : void 0, Gf = "function" === typeof clearTimeout ? clearTimeout : void 0, Hf = "function" === typeof Promise ? Promise : void 0, Jf = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof Hf ? function(a) { - return Hf.resolve(null).then(a).catch(If); -} : Ff; -function If(a) { - setTimeout(function() { - throw a; - }); -} -function Kf(a, b) { - var c = b, d = 0; - do { - var e = c.nextSibling; - a.removeChild(c); - if (e && 8 === e.nodeType) if (c = e.data, "/$" === c) { - if (0 === d) { - a.removeChild(e); - bd(b); - return; - } - d--; - } else "$" !== c && "$?" !== c && "$!" !== c || d++; - c = e; - } while (c); - bd(b); -} -function Lf(a) { - for (; null != a; a = a.nextSibling) { - var b = a.nodeType; - if (1 === b || 3 === b) break; - if (8 === b) { - b = a.data; - if ("$" === b || "$!" === b || "$?" === b) break; - if ("/$" === b) return null; - } - } - return a; -} -function Mf(a) { - a = a.previousSibling; - for (var b = 0; a; ) { - if (8 === a.nodeType) { - var c = a.data; - if ("$" === c || "$!" === c || "$?" === c) { - if (0 === b) return a; - b--; - } else "/$" === c && b++; - } - a = a.previousSibling; - } - return null; -} -var Nf = Math.random().toString(36).slice(2), Of = "__reactFiber$" + Nf, Pf = "__reactProps$" + Nf, uf = "__reactContainer$" + Nf, of = "__reactEvents$" + Nf, Qf = "__reactListeners$" + Nf, Rf = "__reactHandles$" + Nf; -function Wc(a) { - var b = a[Of]; - if (b) return b; - for (var c = a.parentNode; c; ) { - if (b = c[uf] || c[Of]) { - c = b.alternate; - if (null !== b.child || null !== c && null !== c.child) for (a = Mf(a); null !== a; ) { - if (c = a[Of]) return c; - a = Mf(a); - } - return b; - } - a = c; - c = a.parentNode; - } - return null; -} -function Cb(a) { - a = a[Of] || a[uf]; - return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a; -} -function ue(a) { - if (5 === a.tag || 6 === a.tag) return a.stateNode; - throw Error(p(33)); -} -function Db(a) { - return a[Pf] || null; -} -var Sf = [], Tf = -1; -function Uf(a) { - return { current: a }; -} -function E(a) { - 0 > Tf || (a.current = Sf[Tf], Sf[Tf] = null, Tf--); -} -function G(a, b) { - Tf++; - Sf[Tf] = a.current; - a.current = b; -} -var Vf = {}, H = Uf(Vf), Wf = Uf(false), Xf = Vf; -function Yf(a, b) { - var c = a.type.contextTypes; - if (!c) return Vf; - var d = a.stateNode; - if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext; - var e = {}, f2; - for (f2 in c) e[f2] = b[f2]; - d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e); - return e; -} -function Zf(a) { - a = a.childContextTypes; - return null !== a && void 0 !== a; -} -function $f() { - E(Wf); - E(H); -} -function ag(a, b, c) { - if (H.current !== Vf) throw Error(p(168)); - G(H, b); - G(Wf, c); -} -function bg(a, b, c) { - var d = a.stateNode; - b = b.childContextTypes; - if ("function" !== typeof d.getChildContext) return c; - d = d.getChildContext(); - for (var e in d) if (!(e in b)) throw Error(p(108, Ra(a) || "Unknown", e)); - return A({}, c, d); -} -function cg(a) { - a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Vf; - Xf = H.current; - G(H, a); - G(Wf, Wf.current); - return true; -} -function dg(a, b, c) { - var d = a.stateNode; - if (!d) throw Error(p(169)); - c ? (a = bg(a, b, Xf), d.__reactInternalMemoizedMergedChildContext = a, E(Wf), E(H), G(H, a)) : E(Wf); - G(Wf, c); -} -var eg = null, fg = false, gg = false; -function hg(a) { - null === eg ? eg = [a] : eg.push(a); -} -function ig(a) { - fg = true; - hg(a); -} -function jg() { - if (!gg && null !== eg) { - gg = true; - var a = 0, b = C; - try { - var c = eg; - for (C = 1; a < c.length; a++) { - var d = c[a]; - do - d = d(true); - while (null !== d); - } - eg = null; - fg = false; - } catch (e) { - throw null !== eg && (eg = eg.slice(a + 1)), ac(fc, jg), e; - } finally { - C = b, gg = false; - } - } - return null; -} -var kg = [], lg = 0, mg = null, ng = 0, og = [], pg = 0, qg = null, rg = 1, sg = ""; -function tg(a, b) { - kg[lg++] = ng; - kg[lg++] = mg; - mg = a; - ng = b; -} -function ug(a, b, c) { - og[pg++] = rg; - og[pg++] = sg; - og[pg++] = qg; - qg = a; - var d = rg; - a = sg; - var e = 32 - oc(d) - 1; - d &= ~(1 << e); - c += 1; - var f2 = 32 - oc(b) + e; - if (30 < f2) { - var g = e - e % 5; - f2 = (d & (1 << g) - 1).toString(32); - d >>= g; - e -= g; - rg = 1 << 32 - oc(b) + e | c << e | d; - sg = f2 + a; - } else rg = 1 << f2 | c << e | d, sg = a; -} -function vg(a) { - null !== a.return && (tg(a, 1), ug(a, 1, 0)); -} -function wg(a) { - for (; a === mg; ) mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null; - for (; a === qg; ) qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null; -} -var xg = null, yg = null, I = false, zg = null; -function Ag(a, b) { - var c = Bg(5, null, null, 0); - c.elementType = "DELETED"; - c.stateNode = b; - c.return = a; - b = a.deletions; - null === b ? (a.deletions = [c], a.flags |= 16) : b.push(c); -} -function Cg(a, b) { - switch (a.tag) { - case 5: - var c = a.type; - b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b; - return null !== b ? (a.stateNode = b, xg = a, yg = Lf(b.firstChild), true) : false; - case 6: - return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, xg = a, yg = null, true) : false; - case 13: - return b = 8 !== b.nodeType ? null : b, null !== b ? (c = null !== qg ? { id: rg, overflow: sg } : null, a.memoizedState = { dehydrated: b, treeContext: c, retryLane: 1073741824 }, c = Bg(18, null, null, 0), c.stateNode = b, c.return = a, a.child = c, xg = a, yg = null, true) : false; - default: - return false; - } -} -function Dg(a) { - return 0 !== (a.mode & 1) && 0 === (a.flags & 128); -} -function Eg(a) { - if (I) { - var b = yg; - if (b) { - var c = b; - if (!Cg(a, b)) { - if (Dg(a)) throw Error(p(418)); - b = Lf(c.nextSibling); - var d = xg; - b && Cg(a, b) ? Ag(d, c) : (a.flags = a.flags & -4097 | 2, I = false, xg = a); - } - } else { - if (Dg(a)) throw Error(p(418)); - a.flags = a.flags & -4097 | 2; - I = false; - xg = a; - } - } -} -function Fg(a) { - for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return; - xg = a; -} -function Gg(a) { - if (a !== xg) return false; - if (!I) return Fg(a), I = true, false; - var b; - (b = 3 !== a.tag) && !(b = 5 !== a.tag) && (b = a.type, b = "head" !== b && "body" !== b && !Ef(a.type, a.memoizedProps)); - if (b && (b = yg)) { - if (Dg(a)) throw Hg(), Error(p(418)); - for (; b; ) Ag(a, b), b = Lf(b.nextSibling); - } - Fg(a); - if (13 === a.tag) { - a = a.memoizedState; - a = null !== a ? a.dehydrated : null; - if (!a) throw Error(p(317)); - a: { - a = a.nextSibling; - for (b = 0; a; ) { - if (8 === a.nodeType) { - var c = a.data; - if ("/$" === c) { - if (0 === b) { - yg = Lf(a.nextSibling); - break a; - } - b--; - } else "$" !== c && "$!" !== c && "$?" !== c || b++; - } - a = a.nextSibling; - } - yg = null; - } - } else yg = xg ? Lf(a.stateNode.nextSibling) : null; - return true; -} -function Hg() { - for (var a = yg; a; ) a = Lf(a.nextSibling); -} -function Ig() { - yg = xg = null; - I = false; -} -function Jg(a) { - null === zg ? zg = [a] : zg.push(a); -} -var Kg = ua.ReactCurrentBatchConfig; -function Lg(a, b, c) { - a = c.ref; - if (null !== a && "function" !== typeof a && "object" !== typeof a) { - if (c._owner) { - c = c._owner; - if (c) { - if (1 !== c.tag) throw Error(p(309)); - var d = c.stateNode; - } - if (!d) throw Error(p(147, a)); - var e = d, f2 = "" + a; - if (null !== b && null !== b.ref && "function" === typeof b.ref && b.ref._stringRef === f2) return b.ref; - b = function(a2) { - var b2 = e.refs; - null === a2 ? delete b2[f2] : b2[f2] = a2; - }; - b._stringRef = f2; - return b; - } - if ("string" !== typeof a) throw Error(p(284)); - if (!c._owner) throw Error(p(290, a)); - } - return a; -} -function Mg(a, b) { - a = Object.prototype.toString.call(b); - throw Error(p(31, "[object Object]" === a ? "object with keys {" + Object.keys(b).join(", ") + "}" : a)); -} -function Ng(a) { - var b = a._init; - return b(a._payload); -} -function Og(a) { - function b(b2, c2) { - if (a) { - var d2 = b2.deletions; - null === d2 ? (b2.deletions = [c2], b2.flags |= 16) : d2.push(c2); - } - } - function c(c2, d2) { - if (!a) return null; - for (; null !== d2; ) b(c2, d2), d2 = d2.sibling; - return null; - } - function d(a2, b2) { - for (a2 = /* @__PURE__ */ new Map(); null !== b2; ) null !== b2.key ? a2.set(b2.key, b2) : a2.set(b2.index, b2), b2 = b2.sibling; - return a2; - } - function e(a2, b2) { - a2 = Pg(a2, b2); - a2.index = 0; - a2.sibling = null; - return a2; - } - function f2(b2, c2, d2) { - b2.index = d2; - if (!a) return b2.flags |= 1048576, c2; - d2 = b2.alternate; - if (null !== d2) return d2 = d2.index, d2 < c2 ? (b2.flags |= 2, c2) : d2; - b2.flags |= 2; - return c2; - } - function g(b2) { - a && null === b2.alternate && (b2.flags |= 2); - return b2; - } - function h(a2, b2, c2, d2) { - if (null === b2 || 6 !== b2.tag) return b2 = Qg(c2, a2.mode, d2), b2.return = a2, b2; - b2 = e(b2, c2); - b2.return = a2; - return b2; - } - function k2(a2, b2, c2, d2) { - var f3 = c2.type; - if (f3 === ya) return m2(a2, b2, c2.props.children, d2, c2.key); - if (null !== b2 && (b2.elementType === f3 || "object" === typeof f3 && null !== f3 && f3.$$typeof === Ha && Ng(f3) === b2.type)) return d2 = e(b2, c2.props), d2.ref = Lg(a2, b2, c2), d2.return = a2, d2; - d2 = Rg(c2.type, c2.key, c2.props, null, a2.mode, d2); - d2.ref = Lg(a2, b2, c2); - d2.return = a2; - return d2; - } - function l2(a2, b2, c2, d2) { - if (null === b2 || 4 !== b2.tag || b2.stateNode.containerInfo !== c2.containerInfo || b2.stateNode.implementation !== c2.implementation) return b2 = Sg(c2, a2.mode, d2), b2.return = a2, b2; - b2 = e(b2, c2.children || []); - b2.return = a2; - return b2; - } - function m2(a2, b2, c2, d2, f3) { - if (null === b2 || 7 !== b2.tag) return b2 = Tg(c2, a2.mode, d2, f3), b2.return = a2, b2; - b2 = e(b2, c2); - b2.return = a2; - return b2; - } - function q2(a2, b2, c2) { - if ("string" === typeof b2 && "" !== b2 || "number" === typeof b2) return b2 = Qg("" + b2, a2.mode, c2), b2.return = a2, b2; - if ("object" === typeof b2 && null !== b2) { - switch (b2.$$typeof) { - case va: - return c2 = Rg(b2.type, b2.key, b2.props, null, a2.mode, c2), c2.ref = Lg(a2, null, b2), c2.return = a2, c2; - case wa: - return b2 = Sg(b2, a2.mode, c2), b2.return = a2, b2; - case Ha: - var d2 = b2._init; - return q2(a2, d2(b2._payload), c2); - } - if (eb(b2) || Ka(b2)) return b2 = Tg(b2, a2.mode, c2, null), b2.return = a2, b2; - Mg(a2, b2); - } - return null; - } - function r2(a2, b2, c2, d2) { - var e2 = null !== b2 ? b2.key : null; - if ("string" === typeof c2 && "" !== c2 || "number" === typeof c2) return null !== e2 ? null : h(a2, b2, "" + c2, d2); - if ("object" === typeof c2 && null !== c2) { - switch (c2.$$typeof) { - case va: - return c2.key === e2 ? k2(a2, b2, c2, d2) : null; - case wa: - return c2.key === e2 ? l2(a2, b2, c2, d2) : null; - case Ha: - return e2 = c2._init, r2( - a2, - b2, - e2(c2._payload), - d2 - ); - } - if (eb(c2) || Ka(c2)) return null !== e2 ? null : m2(a2, b2, c2, d2, null); - Mg(a2, c2); - } - return null; - } - function y2(a2, b2, c2, d2, e2) { - if ("string" === typeof d2 && "" !== d2 || "number" === typeof d2) return a2 = a2.get(c2) || null, h(b2, a2, "" + d2, e2); - if ("object" === typeof d2 && null !== d2) { - switch (d2.$$typeof) { - case va: - return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, k2(b2, a2, d2, e2); - case wa: - return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, l2(b2, a2, d2, e2); - case Ha: - var f3 = d2._init; - return y2(a2, b2, c2, f3(d2._payload), e2); - } - if (eb(d2) || Ka(d2)) return a2 = a2.get(c2) || null, m2(b2, a2, d2, e2, null); - Mg(b2, d2); - } - return null; - } - function n2(e2, g2, h2, k3) { - for (var l3 = null, m3 = null, u2 = g2, w2 = g2 = 0, x2 = null; null !== u2 && w2 < h2.length; w2++) { - u2.index > w2 ? (x2 = u2, u2 = null) : x2 = u2.sibling; - var n3 = r2(e2, u2, h2[w2], k3); - if (null === n3) { - null === u2 && (u2 = x2); - break; - } - a && u2 && null === n3.alternate && b(e2, u2); - g2 = f2(n3, g2, w2); - null === m3 ? l3 = n3 : m3.sibling = n3; - m3 = n3; - u2 = x2; - } - if (w2 === h2.length) return c(e2, u2), I && tg(e2, w2), l3; - if (null === u2) { - for (; w2 < h2.length; w2++) u2 = q2(e2, h2[w2], k3), null !== u2 && (g2 = f2(u2, g2, w2), null === m3 ? l3 = u2 : m3.sibling = u2, m3 = u2); - I && tg(e2, w2); - return l3; - } - for (u2 = d(e2, u2); w2 < h2.length; w2++) x2 = y2(u2, e2, w2, h2[w2], k3), null !== x2 && (a && null !== x2.alternate && u2.delete(null === x2.key ? w2 : x2.key), g2 = f2(x2, g2, w2), null === m3 ? l3 = x2 : m3.sibling = x2, m3 = x2); - a && u2.forEach(function(a2) { - return b(e2, a2); - }); - I && tg(e2, w2); - return l3; - } - function t2(e2, g2, h2, k3) { - var l3 = Ka(h2); - if ("function" !== typeof l3) throw Error(p(150)); - h2 = l3.call(h2); - if (null == h2) throw Error(p(151)); - for (var u2 = l3 = null, m3 = g2, w2 = g2 = 0, x2 = null, n3 = h2.next(); null !== m3 && !n3.done; w2++, n3 = h2.next()) { - m3.index > w2 ? (x2 = m3, m3 = null) : x2 = m3.sibling; - var t3 = r2(e2, m3, n3.value, k3); - if (null === t3) { - null === m3 && (m3 = x2); - break; - } - a && m3 && null === t3.alternate && b(e2, m3); - g2 = f2(t3, g2, w2); - null === u2 ? l3 = t3 : u2.sibling = t3; - u2 = t3; - m3 = x2; - } - if (n3.done) return c( - e2, - m3 - ), I && tg(e2, w2), l3; - if (null === m3) { - for (; !n3.done; w2++, n3 = h2.next()) n3 = q2(e2, n3.value, k3), null !== n3 && (g2 = f2(n3, g2, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); - I && tg(e2, w2); - return l3; - } - for (m3 = d(e2, m3); !n3.done; w2++, n3 = h2.next()) n3 = y2(m3, e2, w2, n3.value, k3), null !== n3 && (a && null !== n3.alternate && m3.delete(null === n3.key ? w2 : n3.key), g2 = f2(n3, g2, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); - a && m3.forEach(function(a2) { - return b(e2, a2); - }); - I && tg(e2, w2); - return l3; - } - function J2(a2, d2, f3, h2) { - "object" === typeof f3 && null !== f3 && f3.type === ya && null === f3.key && (f3 = f3.props.children); - if ("object" === typeof f3 && null !== f3) { - switch (f3.$$typeof) { - case va: - a: { - for (var k3 = f3.key, l3 = d2; null !== l3; ) { - if (l3.key === k3) { - k3 = f3.type; - if (k3 === ya) { - if (7 === l3.tag) { - c(a2, l3.sibling); - d2 = e(l3, f3.props.children); - d2.return = a2; - a2 = d2; - break a; - } - } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === Ha && Ng(k3) === l3.type) { - c(a2, l3.sibling); - d2 = e(l3, f3.props); - d2.ref = Lg(a2, l3, f3); - d2.return = a2; - a2 = d2; - break a; - } - c(a2, l3); - break; - } else b(a2, l3); - l3 = l3.sibling; - } - f3.type === ya ? (d2 = Tg(f3.props.children, a2.mode, h2, f3.key), d2.return = a2, a2 = d2) : (h2 = Rg(f3.type, f3.key, f3.props, null, a2.mode, h2), h2.ref = Lg(a2, d2, f3), h2.return = a2, a2 = h2); - } - return g(a2); - case wa: - a: { - for (l3 = f3.key; null !== d2; ) { - if (d2.key === l3) if (4 === d2.tag && d2.stateNode.containerInfo === f3.containerInfo && d2.stateNode.implementation === f3.implementation) { - c(a2, d2.sibling); - d2 = e(d2, f3.children || []); - d2.return = a2; - a2 = d2; - break a; - } else { - c(a2, d2); - break; - } - else b(a2, d2); - d2 = d2.sibling; - } - d2 = Sg(f3, a2.mode, h2); - d2.return = a2; - a2 = d2; - } - return g(a2); - case Ha: - return l3 = f3._init, J2(a2, d2, l3(f3._payload), h2); - } - if (eb(f3)) return n2(a2, d2, f3, h2); - if (Ka(f3)) return t2(a2, d2, f3, h2); - Mg(a2, f3); - } - return "string" === typeof f3 && "" !== f3 || "number" === typeof f3 ? (f3 = "" + f3, null !== d2 && 6 === d2.tag ? (c(a2, d2.sibling), d2 = e(d2, f3), d2.return = a2, a2 = d2) : (c(a2, d2), d2 = Qg(f3, a2.mode, h2), d2.return = a2, a2 = d2), g(a2)) : c(a2, d2); - } - return J2; -} -var Ug = Og(true), Vg = Og(false), Wg = Uf(null), Xg = null, Yg = null, Zg = null; -function $g() { - Zg = Yg = Xg = null; -} -function ah(a) { - var b = Wg.current; - E(Wg); - a._currentValue = b; -} -function bh(a, b, c) { - for (; null !== a; ) { - var d = a.alternate; - (a.childLanes & b) !== b ? (a.childLanes |= b, null !== d && (d.childLanes |= b)) : null !== d && (d.childLanes & b) !== b && (d.childLanes |= b); - if (a === c) break; - a = a.return; - } -} -function ch(a, b) { - Xg = a; - Zg = Yg = null; - a = a.dependencies; - null !== a && null !== a.firstContext && (0 !== (a.lanes & b) && (dh = true), a.firstContext = null); -} -function eh(a) { - var b = a._currentValue; - if (Zg !== a) if (a = { context: a, memoizedValue: b, next: null }, null === Yg) { - if (null === Xg) throw Error(p(308)); - Yg = a; - Xg.dependencies = { lanes: 0, firstContext: a }; - } else Yg = Yg.next = a; - return b; -} -var fh = null; -function gh(a) { - null === fh ? fh = [a] : fh.push(a); -} -function hh(a, b, c, d) { - var e = b.interleaved; - null === e ? (c.next = c, gh(b)) : (c.next = e.next, e.next = c); - b.interleaved = c; - return ih(a, d); -} -function ih(a, b) { - a.lanes |= b; - var c = a.alternate; - null !== c && (c.lanes |= b); - c = a; - for (a = a.return; null !== a; ) a.childLanes |= b, c = a.alternate, null !== c && (c.childLanes |= b), c = a, a = a.return; - return 3 === c.tag ? c.stateNode : null; -} -var jh = false; -function kh(a) { - a.updateQueue = { baseState: a.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; -} -function lh(a, b) { - a = a.updateQueue; - b.updateQueue === a && (b.updateQueue = { baseState: a.baseState, firstBaseUpdate: a.firstBaseUpdate, lastBaseUpdate: a.lastBaseUpdate, shared: a.shared, effects: a.effects }); -} -function mh(a, b) { - return { eventTime: a, lane: b, tag: 0, payload: null, callback: null, next: null }; -} -function nh(a, b, c) { - var d = a.updateQueue; - if (null === d) return null; - d = d.shared; - if (0 !== (K & 2)) { - var e = d.pending; - null === e ? b.next = b : (b.next = e.next, e.next = b); - d.pending = b; - return ih(a, c); - } - e = d.interleaved; - null === e ? (b.next = b, gh(d)) : (b.next = e.next, e.next = b); - d.interleaved = b; - return ih(a, c); -} -function oh(a, b, c) { - b = b.updateQueue; - if (null !== b && (b = b.shared, 0 !== (c & 4194240))) { - var d = b.lanes; - d &= a.pendingLanes; - c |= d; - b.lanes = c; - Cc(a, c); - } -} -function ph(a, b) { - var c = a.updateQueue, d = a.alternate; - if (null !== d && (d = d.updateQueue, c === d)) { - var e = null, f2 = null; - c = c.firstBaseUpdate; - if (null !== c) { - do { - var g = { eventTime: c.eventTime, lane: c.lane, tag: c.tag, payload: c.payload, callback: c.callback, next: null }; - null === f2 ? e = f2 = g : f2 = f2.next = g; - c = c.next; - } while (null !== c); - null === f2 ? e = f2 = b : f2 = f2.next = b; - } else e = f2 = b; - c = { baseState: d.baseState, firstBaseUpdate: e, lastBaseUpdate: f2, shared: d.shared, effects: d.effects }; - a.updateQueue = c; - return; - } - a = c.lastBaseUpdate; - null === a ? c.firstBaseUpdate = b : a.next = b; - c.lastBaseUpdate = b; -} -function qh(a, b, c, d) { - var e = a.updateQueue; - jh = false; - var f2 = e.firstBaseUpdate, g = e.lastBaseUpdate, h = e.shared.pending; - if (null !== h) { - e.shared.pending = null; - var k2 = h, l2 = k2.next; - k2.next = null; - null === g ? f2 = l2 : g.next = l2; - g = k2; - var m2 = a.alternate; - null !== m2 && (m2 = m2.updateQueue, h = m2.lastBaseUpdate, h !== g && (null === h ? m2.firstBaseUpdate = l2 : h.next = l2, m2.lastBaseUpdate = k2)); - } - if (null !== f2) { - var q2 = e.baseState; - g = 0; - m2 = l2 = k2 = null; - h = f2; - do { - var r2 = h.lane, y2 = h.eventTime; - if ((d & r2) === r2) { - null !== m2 && (m2 = m2.next = { - eventTime: y2, - lane: 0, - tag: h.tag, - payload: h.payload, - callback: h.callback, - next: null - }); - a: { - var n2 = a, t2 = h; - r2 = b; - y2 = c; - switch (t2.tag) { - case 1: - n2 = t2.payload; - if ("function" === typeof n2) { - q2 = n2.call(y2, q2, r2); - break a; - } - q2 = n2; - break a; - case 3: - n2.flags = n2.flags & -65537 | 128; - case 0: - n2 = t2.payload; - r2 = "function" === typeof n2 ? n2.call(y2, q2, r2) : n2; - if (null === r2 || void 0 === r2) break a; - q2 = A({}, q2, r2); - break a; - case 2: - jh = true; - } - } - null !== h.callback && 0 !== h.lane && (a.flags |= 64, r2 = e.effects, null === r2 ? e.effects = [h] : r2.push(h)); - } else y2 = { eventTime: y2, lane: r2, tag: h.tag, payload: h.payload, callback: h.callback, next: null }, null === m2 ? (l2 = m2 = y2, k2 = q2) : m2 = m2.next = y2, g |= r2; - h = h.next; - if (null === h) if (h = e.shared.pending, null === h) break; - else r2 = h, h = r2.next, r2.next = null, e.lastBaseUpdate = r2, e.shared.pending = null; - } while (1); - null === m2 && (k2 = q2); - e.baseState = k2; - e.firstBaseUpdate = l2; - e.lastBaseUpdate = m2; - b = e.shared.interleaved; - if (null !== b) { - e = b; - do - g |= e.lane, e = e.next; - while (e !== b); - } else null === f2 && (e.shared.lanes = 0); - rh |= g; - a.lanes = g; - a.memoizedState = q2; - } -} -function sh(a, b, c) { - a = b.effects; - b.effects = null; - if (null !== a) for (b = 0; b < a.length; b++) { - var d = a[b], e = d.callback; - if (null !== e) { - d.callback = null; - d = c; - if ("function" !== typeof e) throw Error(p(191, e)); - e.call(d); - } - } -} -var th = {}, uh = Uf(th), vh = Uf(th), wh = Uf(th); -function xh(a) { - if (a === th) throw Error(p(174)); - return a; -} -function yh(a, b) { - G(wh, b); - G(vh, a); - G(uh, th); - a = b.nodeType; - switch (a) { - case 9: - case 11: - b = (b = b.documentElement) ? b.namespaceURI : lb(null, ""); - break; - default: - a = 8 === a ? b.parentNode : b, b = a.namespaceURI || null, a = a.tagName, b = lb(b, a); - } - E(uh); - G(uh, b); -} -function zh() { - E(uh); - E(vh); - E(wh); -} -function Ah(a) { - xh(wh.current); - var b = xh(uh.current); - var c = lb(b, a.type); - b !== c && (G(vh, a), G(uh, c)); -} -function Bh(a) { - vh.current === a && (E(uh), E(vh)); -} -var L = Uf(0); -function Ch(a) { - for (var b = a; null !== b; ) { - if (13 === b.tag) { - var c = b.memoizedState; - if (null !== c && (c = c.dehydrated, null === c || "$?" === c.data || "$!" === c.data)) return b; - } else if (19 === b.tag && void 0 !== b.memoizedProps.revealOrder) { - if (0 !== (b.flags & 128)) return b; - } else if (null !== b.child) { - b.child.return = b; - b = b.child; - continue; - } - if (b === a) break; - for (; null === b.sibling; ) { - if (null === b.return || b.return === a) return null; - b = b.return; - } - b.sibling.return = b.return; - b = b.sibling; - } - return null; -} -var Dh = []; -function Eh() { - for (var a = 0; a < Dh.length; a++) Dh[a]._workInProgressVersionPrimary = null; - Dh.length = 0; -} -var Fh = ua.ReactCurrentDispatcher, Gh = ua.ReactCurrentBatchConfig, Hh = 0, M = null, N = null, O = null, Ih = false, Jh = false, Kh = 0, Lh = 0; -function P() { - throw Error(p(321)); -} -function Mh(a, b) { - if (null === b) return false; - for (var c = 0; c < b.length && c < a.length; c++) if (!He(a[c], b[c])) return false; - return true; -} -function Nh(a, b, c, d, e, f2) { - Hh = f2; - M = b; - b.memoizedState = null; - b.updateQueue = null; - b.lanes = 0; - Fh.current = null === a || null === a.memoizedState ? Oh : Ph; - a = c(d, e); - if (Jh) { - f2 = 0; - do { - Jh = false; - Kh = 0; - if (25 <= f2) throw Error(p(301)); - f2 += 1; - O = N = null; - b.updateQueue = null; - Fh.current = Qh; - a = c(d, e); - } while (Jh); - } - Fh.current = Rh; - b = null !== N && null !== N.next; - Hh = 0; - O = N = M = null; - Ih = false; - if (b) throw Error(p(300)); - return a; -} -function Sh() { - var a = 0 !== Kh; - Kh = 0; - return a; -} -function Th() { - var a = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; - null === O ? M.memoizedState = O = a : O = O.next = a; - return O; -} -function Uh() { - if (null === N) { - var a = M.alternate; - a = null !== a ? a.memoizedState : null; - } else a = N.next; - var b = null === O ? M.memoizedState : O.next; - if (null !== b) O = b, N = a; - else { - if (null === a) throw Error(p(310)); - N = a; - a = { memoizedState: N.memoizedState, baseState: N.baseState, baseQueue: N.baseQueue, queue: N.queue, next: null }; - null === O ? M.memoizedState = O = a : O = O.next = a; - } - return O; -} -function Vh(a, b) { - return "function" === typeof b ? b(a) : b; -} -function Wh(a) { - var b = Uh(), c = b.queue; - if (null === c) throw Error(p(311)); - c.lastRenderedReducer = a; - var d = N, e = d.baseQueue, f2 = c.pending; - if (null !== f2) { - if (null !== e) { - var g = e.next; - e.next = f2.next; - f2.next = g; - } - d.baseQueue = e = f2; - c.pending = null; - } - if (null !== e) { - f2 = e.next; - d = d.baseState; - var h = g = null, k2 = null, l2 = f2; - do { - var m2 = l2.lane; - if ((Hh & m2) === m2) null !== k2 && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d = l2.hasEagerState ? l2.eagerState : a(d, l2.action); - else { - var q2 = { - lane: m2, - action: l2.action, - hasEagerState: l2.hasEagerState, - eagerState: l2.eagerState, - next: null - }; - null === k2 ? (h = k2 = q2, g = d) : k2 = k2.next = q2; - M.lanes |= m2; - rh |= m2; - } - l2 = l2.next; - } while (null !== l2 && l2 !== f2); - null === k2 ? g = d : k2.next = h; - He(d, b.memoizedState) || (dh = true); - b.memoizedState = d; - b.baseState = g; - b.baseQueue = k2; - c.lastRenderedState = d; - } - a = c.interleaved; - if (null !== a) { - e = a; - do - f2 = e.lane, M.lanes |= f2, rh |= f2, e = e.next; - while (e !== a); - } else null === e && (c.lanes = 0); - return [b.memoizedState, c.dispatch]; -} -function Xh(a) { - var b = Uh(), c = b.queue; - if (null === c) throw Error(p(311)); - c.lastRenderedReducer = a; - var d = c.dispatch, e = c.pending, f2 = b.memoizedState; - if (null !== e) { - c.pending = null; - var g = e = e.next; - do - f2 = a(f2, g.action), g = g.next; - while (g !== e); - He(f2, b.memoizedState) || (dh = true); - b.memoizedState = f2; - null === b.baseQueue && (b.baseState = f2); - c.lastRenderedState = f2; - } - return [f2, d]; -} -function Yh() { -} -function Zh(a, b) { - var c = M, d = Uh(), e = b(), f2 = !He(d.memoizedState, e); - f2 && (d.memoizedState = e, dh = true); - d = d.queue; - $h(ai.bind(null, c, d, a), [a]); - if (d.getSnapshot !== b || f2 || null !== O && O.memoizedState.tag & 1) { - c.flags |= 2048; - bi(9, ci.bind(null, c, d, e, b), void 0, null); - if (null === Q) throw Error(p(349)); - 0 !== (Hh & 30) || di(c, b, e); - } - return e; -} -function di(a, b, c) { - a.flags |= 16384; - a = { getSnapshot: b, value: c }; - b = M.updateQueue; - null === b ? (b = { lastEffect: null, stores: null }, M.updateQueue = b, b.stores = [a]) : (c = b.stores, null === c ? b.stores = [a] : c.push(a)); -} -function ci(a, b, c, d) { - b.value = c; - b.getSnapshot = d; - ei(b) && fi(a); -} -function ai(a, b, c) { - return c(function() { - ei(b) && fi(a); - }); -} -function ei(a) { - var b = a.getSnapshot; - a = a.value; - try { - var c = b(); - return !He(a, c); - } catch (d) { - return true; - } -} -function fi(a) { - var b = ih(a, 1); - null !== b && gi(b, a, 1, -1); -} -function hi(a) { - var b = Th(); - "function" === typeof a && (a = a()); - b.memoizedState = b.baseState = a; - a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Vh, lastRenderedState: a }; - b.queue = a; - a = a.dispatch = ii.bind(null, M, a); - return [b.memoizedState, a]; -} -function bi(a, b, c, d) { - a = { tag: a, create: b, destroy: c, deps: d, next: null }; - b = M.updateQueue; - null === b ? (b = { lastEffect: null, stores: null }, M.updateQueue = b, b.lastEffect = a.next = a) : (c = b.lastEffect, null === c ? b.lastEffect = a.next = a : (d = c.next, c.next = a, a.next = d, b.lastEffect = a)); - return a; -} -function ji() { - return Uh().memoizedState; -} -function ki(a, b, c, d) { - var e = Th(); - M.flags |= a; - e.memoizedState = bi(1 | b, c, void 0, void 0 === d ? null : d); -} -function li(a, b, c, d) { - var e = Uh(); - d = void 0 === d ? null : d; - var f2 = void 0; - if (null !== N) { - var g = N.memoizedState; - f2 = g.destroy; - if (null !== d && Mh(d, g.deps)) { - e.memoizedState = bi(b, c, f2, d); - return; - } - } - M.flags |= a; - e.memoizedState = bi(1 | b, c, f2, d); -} -function mi(a, b) { - return ki(8390656, 8, a, b); -} -function $h(a, b) { - return li(2048, 8, a, b); -} -function ni(a, b) { - return li(4, 2, a, b); -} -function oi(a, b) { - return li(4, 4, a, b); -} -function pi(a, b) { - if ("function" === typeof b) return a = a(), b(a), function() { - b(null); - }; - if (null !== b && void 0 !== b) return a = a(), b.current = a, function() { - b.current = null; - }; -} -function qi(a, b, c) { - c = null !== c && void 0 !== c ? c.concat([a]) : null; - return li(4, 4, pi.bind(null, b, a), c); -} -function ri() { -} -function si(a, b) { - var c = Uh(); - b = void 0 === b ? null : b; - var d = c.memoizedState; - if (null !== d && null !== b && Mh(b, d[1])) return d[0]; - c.memoizedState = [a, b]; - return a; -} -function ti(a, b) { - var c = Uh(); - b = void 0 === b ? null : b; - var d = c.memoizedState; - if (null !== d && null !== b && Mh(b, d[1])) return d[0]; - a = a(); - c.memoizedState = [a, b]; - return a; -} -function ui(a, b, c) { - if (0 === (Hh & 21)) return a.baseState && (a.baseState = false, dh = true), a.memoizedState = c; - He(c, b) || (c = yc(), M.lanes |= c, rh |= c, a.baseState = true); - return b; -} -function vi(a, b) { - var c = C; - C = 0 !== c && 4 > c ? c : 4; - a(true); - var d = Gh.transition; - Gh.transition = {}; - try { - a(false), b(); - } finally { - C = c, Gh.transition = d; - } -} -function wi() { - return Uh().memoizedState; -} -function xi(a, b, c) { - var d = yi(a); - c = { lane: d, action: c, hasEagerState: false, eagerState: null, next: null }; - if (zi(a)) Ai(b, c); - else if (c = hh(a, b, c, d), null !== c) { - var e = R(); - gi(c, a, d, e); - Bi(c, b, d); - } -} -function ii(a, b, c) { - var d = yi(a), e = { lane: d, action: c, hasEagerState: false, eagerState: null, next: null }; - if (zi(a)) Ai(b, e); - else { - var f2 = a.alternate; - if (0 === a.lanes && (null === f2 || 0 === f2.lanes) && (f2 = b.lastRenderedReducer, null !== f2)) try { - var g = b.lastRenderedState, h = f2(g, c); - e.hasEagerState = true; - e.eagerState = h; - if (He(h, g)) { - var k2 = b.interleaved; - null === k2 ? (e.next = e, gh(b)) : (e.next = k2.next, k2.next = e); - b.interleaved = e; - return; - } - } catch (l2) { - } finally { - } - c = hh(a, b, e, d); - null !== c && (e = R(), gi(c, a, d, e), Bi(c, b, d)); - } -} -function zi(a) { - var b = a.alternate; - return a === M || null !== b && b === M; -} -function Ai(a, b) { - Jh = Ih = true; - var c = a.pending; - null === c ? b.next = b : (b.next = c.next, c.next = b); - a.pending = b; -} -function Bi(a, b, c) { - if (0 !== (c & 4194240)) { - var d = b.lanes; - d &= a.pendingLanes; - c |= d; - b.lanes = c; - Cc(a, c); - } -} -var Rh = { readContext: eh, useCallback: P, useContext: P, useEffect: P, useImperativeHandle: P, useInsertionEffect: P, useLayoutEffect: P, useMemo: P, useReducer: P, useRef: P, useState: P, useDebugValue: P, useDeferredValue: P, useTransition: P, useMutableSource: P, useSyncExternalStore: P, useId: P, unstable_isNewReconciler: false }, Oh = { readContext: eh, useCallback: function(a, b) { - Th().memoizedState = [a, void 0 === b ? null : b]; - return a; -}, useContext: eh, useEffect: mi, useImperativeHandle: function(a, b, c) { - c = null !== c && void 0 !== c ? c.concat([a]) : null; - return ki( - 4194308, - 4, - pi.bind(null, b, a), - c - ); -}, useLayoutEffect: function(a, b) { - return ki(4194308, 4, a, b); -}, useInsertionEffect: function(a, b) { - return ki(4, 2, a, b); -}, useMemo: function(a, b) { - var c = Th(); - b = void 0 === b ? null : b; - a = a(); - c.memoizedState = [a, b]; - return a; -}, useReducer: function(a, b, c) { - var d = Th(); - b = void 0 !== c ? c(b) : b; - d.memoizedState = d.baseState = b; - a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a, lastRenderedState: b }; - d.queue = a; - a = a.dispatch = xi.bind(null, M, a); - return [d.memoizedState, a]; -}, useRef: function(a) { - var b = Th(); - a = { current: a }; - return b.memoizedState = a; -}, useState: hi, useDebugValue: ri, useDeferredValue: function(a) { - return Th().memoizedState = a; -}, useTransition: function() { - var a = hi(false), b = a[0]; - a = vi.bind(null, a[1]); - Th().memoizedState = a; - return [b, a]; -}, useMutableSource: function() { -}, useSyncExternalStore: function(a, b, c) { - var d = M, e = Th(); - if (I) { - if (void 0 === c) throw Error(p(407)); - c = c(); - } else { - c = b(); - if (null === Q) throw Error(p(349)); - 0 !== (Hh & 30) || di(d, b, c); - } - e.memoizedState = c; - var f2 = { value: c, getSnapshot: b }; - e.queue = f2; - mi(ai.bind( - null, - d, - f2, - a - ), [a]); - d.flags |= 2048; - bi(9, ci.bind(null, d, f2, c, b), void 0, null); - return c; -}, useId: function() { - var a = Th(), b = Q.identifierPrefix; - if (I) { - var c = sg; - var d = rg; - c = (d & ~(1 << 32 - oc(d) - 1)).toString(32) + c; - b = ":" + b + "R" + c; - c = Kh++; - 0 < c && (b += "H" + c.toString(32)); - b += ":"; - } else c = Lh++, b = ":" + b + "r" + c.toString(32) + ":"; - return a.memoizedState = b; -}, unstable_isNewReconciler: false }, Ph = { - readContext: eh, - useCallback: si, - useContext: eh, - useEffect: $h, - useImperativeHandle: qi, - useInsertionEffect: ni, - useLayoutEffect: oi, - useMemo: ti, - useReducer: Wh, - useRef: ji, - useState: function() { - return Wh(Vh); - }, - useDebugValue: ri, - useDeferredValue: function(a) { - var b = Uh(); - return ui(b, N.memoizedState, a); - }, - useTransition: function() { - var a = Wh(Vh)[0], b = Uh().memoizedState; - return [a, b]; - }, - useMutableSource: Yh, - useSyncExternalStore: Zh, - useId: wi, - unstable_isNewReconciler: false -}, Qh = { readContext: eh, useCallback: si, useContext: eh, useEffect: $h, useImperativeHandle: qi, useInsertionEffect: ni, useLayoutEffect: oi, useMemo: ti, useReducer: Xh, useRef: ji, useState: function() { - return Xh(Vh); -}, useDebugValue: ri, useDeferredValue: function(a) { - var b = Uh(); - return null === N ? b.memoizedState = a : ui(b, N.memoizedState, a); -}, useTransition: function() { - var a = Xh(Vh)[0], b = Uh().memoizedState; - return [a, b]; -}, useMutableSource: Yh, useSyncExternalStore: Zh, useId: wi, unstable_isNewReconciler: false }; -function Ci(a, b) { - if (a && a.defaultProps) { - b = A({}, b); - a = a.defaultProps; - for (var c in a) void 0 === b[c] && (b[c] = a[c]); - return b; - } - return b; -} -function Di(a, b, c, d) { - b = a.memoizedState; - c = c(d, b); - c = null === c || void 0 === c ? b : A({}, b, c); - a.memoizedState = c; - 0 === a.lanes && (a.updateQueue.baseState = c); -} -var Ei = { isMounted: function(a) { - return (a = a._reactInternals) ? Vb(a) === a : false; -}, enqueueSetState: function(a, b, c) { - a = a._reactInternals; - var d = R(), e = yi(a), f2 = mh(d, e); - f2.payload = b; - void 0 !== c && null !== c && (f2.callback = c); - b = nh(a, f2, e); - null !== b && (gi(b, a, e, d), oh(b, a, e)); -}, enqueueReplaceState: function(a, b, c) { - a = a._reactInternals; - var d = R(), e = yi(a), f2 = mh(d, e); - f2.tag = 1; - f2.payload = b; - void 0 !== c && null !== c && (f2.callback = c); - b = nh(a, f2, e); - null !== b && (gi(b, a, e, d), oh(b, a, e)); -}, enqueueForceUpdate: function(a, b) { - a = a._reactInternals; - var c = R(), d = yi(a), e = mh(c, d); - e.tag = 2; - void 0 !== b && null !== b && (e.callback = b); - b = nh(a, e, d); - null !== b && (gi(b, a, d, c), oh(b, a, d)); -} }; -function Fi(a, b, c, d, e, f2, g) { - a = a.stateNode; - return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f2, g) : b.prototype && b.prototype.isPureReactComponent ? !Ie(c, d) || !Ie(e, f2) : true; -} -function Gi(a, b, c) { - var d = false, e = Vf; - var f2 = b.contextType; - "object" === typeof f2 && null !== f2 ? f2 = eh(f2) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f2 = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf); - b = new b(c, f2); - a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null; - b.updater = Ei; - a.stateNode = b; - b._reactInternals = a; - d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f2); - return b; -} -function Hi(a, b, c, d) { - a = b.state; - "function" === typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d); - "function" === typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d); - b.state !== a && Ei.enqueueReplaceState(b, b.state, null); -} -function Ii(a, b, c, d) { - var e = a.stateNode; - e.props = c; - e.state = a.memoizedState; - e.refs = {}; - kh(a); - var f2 = b.contextType; - "object" === typeof f2 && null !== f2 ? e.context = eh(f2) : (f2 = Zf(b) ? Xf : H.current, e.context = Yf(a, f2)); - e.state = a.memoizedState; - f2 = b.getDerivedStateFromProps; - "function" === typeof f2 && (Di(a, b, f2, c), e.state = a.memoizedState); - "function" === typeof b.getDerivedStateFromProps || "function" === typeof e.getSnapshotBeforeUpdate || "function" !== typeof e.UNSAFE_componentWillMount && "function" !== typeof e.componentWillMount || (b = e.state, "function" === typeof e.componentWillMount && e.componentWillMount(), "function" === typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), b !== e.state && Ei.enqueueReplaceState(e, e.state, null), qh(a, c, e, d), e.state = a.memoizedState); - "function" === typeof e.componentDidMount && (a.flags |= 4194308); -} -function Ji(a, b) { - try { - var c = "", d = b; - do - c += Pa(d), d = d.return; - while (d); - var e = c; - } catch (f2) { - e = "\nError generating stack: " + f2.message + "\n" + f2.stack; - } - return { value: a, source: b, stack: e, digest: null }; -} -function Ki(a, b, c) { - return { value: a, source: null, stack: null != c ? c : null, digest: null != b ? b : null }; -} -function Li(a, b) { - try { - console.error(b.value); - } catch (c) { - setTimeout(function() { - throw c; - }); - } -} -var Mi = "function" === typeof WeakMap ? WeakMap : Map; -function Ni(a, b, c) { - c = mh(-1, c); - c.tag = 3; - c.payload = { element: null }; - var d = b.value; - c.callback = function() { - Oi || (Oi = true, Pi = d); - Li(a, b); - }; - return c; -} -function Qi(a, b, c) { - c = mh(-1, c); - c.tag = 3; - var d = a.type.getDerivedStateFromError; - if ("function" === typeof d) { - var e = b.value; - c.payload = function() { - return d(e); - }; - c.callback = function() { - Li(a, b); - }; - } - var f2 = a.stateNode; - null !== f2 && "function" === typeof f2.componentDidCatch && (c.callback = function() { - Li(a, b); - "function" !== typeof d && (null === Ri ? Ri = /* @__PURE__ */ new Set([this]) : Ri.add(this)); - var c2 = b.stack; - this.componentDidCatch(b.value, { componentStack: null !== c2 ? c2 : "" }); - }); - return c; -} -function Si(a, b, c) { - var d = a.pingCache; - if (null === d) { - d = a.pingCache = new Mi(); - var e = /* @__PURE__ */ new Set(); - d.set(b, e); - } else e = d.get(b), void 0 === e && (e = /* @__PURE__ */ new Set(), d.set(b, e)); - e.has(c) || (e.add(c), a = Ti.bind(null, a, b, c), b.then(a, a)); -} -function Ui(a) { - do { - var b; - if (b = 13 === a.tag) b = a.memoizedState, b = null !== b ? null !== b.dehydrated ? true : false : true; - if (b) return a; - a = a.return; - } while (null !== a); - return null; -} -function Vi(a, b, c, d, e) { - if (0 === (a.mode & 1)) return a === b ? a.flags |= 65536 : (a.flags |= 128, c.flags |= 131072, c.flags &= -52805, 1 === c.tag && (null === c.alternate ? c.tag = 17 : (b = mh(-1, 1), b.tag = 2, nh(c, b, 1))), c.lanes |= 1), a; - a.flags |= 65536; - a.lanes = e; - return a; -} -var Wi = ua.ReactCurrentOwner, dh = false; -function Xi(a, b, c, d) { - b.child = null === a ? Vg(b, null, c, d) : Ug(b, a.child, c, d); -} -function Yi(a, b, c, d, e) { - c = c.render; - var f2 = b.ref; - ch(b, e); - d = Nh(a, b, c, d, f2, e); - c = Sh(); - if (null !== a && !dh) return b.updateQueue = a.updateQueue, b.flags &= -2053, a.lanes &= ~e, Zi(a, b, e); - I && c && vg(b); - b.flags |= 1; - Xi(a, b, d, e); - return b.child; -} -function $i(a, b, c, d, e) { - if (null === a) { - var f2 = c.type; - if ("function" === typeof f2 && !aj(f2) && void 0 === f2.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, b.type = f2, bj(a, b, f2, d, e); - a = Rg(c.type, null, d, b, b.mode, e); - a.ref = b.ref; - a.return = b; - return b.child = a; - } - f2 = a.child; - if (0 === (a.lanes & e)) { - var g = f2.memoizedProps; - c = c.compare; - c = null !== c ? c : Ie; - if (c(g, d) && a.ref === b.ref) return Zi(a, b, e); - } - b.flags |= 1; - a = Pg(f2, d); - a.ref = b.ref; - a.return = b; - return b.child = a; -} -function bj(a, b, c, d, e) { - if (null !== a) { - var f2 = a.memoizedProps; - if (Ie(f2, d) && a.ref === b.ref) if (dh = false, b.pendingProps = d = f2, 0 !== (a.lanes & e)) 0 !== (a.flags & 131072) && (dh = true); - else return b.lanes = a.lanes, Zi(a, b, e); - } - return cj(a, b, c, d, e); -} -function dj(a, b, c) { - var d = b.pendingProps, e = d.children, f2 = null !== a ? a.memoizedState : null; - if ("hidden" === d.mode) if (0 === (b.mode & 1)) b.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G(ej, fj), fj |= c; - else { - if (0 === (c & 1073741824)) return a = null !== f2 ? f2.baseLanes | c : c, b.lanes = b.childLanes = 1073741824, b.memoizedState = { baseLanes: a, cachePool: null, transitions: null }, b.updateQueue = null, G(ej, fj), fj |= a, null; - b.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }; - d = null !== f2 ? f2.baseLanes : c; - G(ej, fj); - fj |= d; - } - else null !== f2 ? (d = f2.baseLanes | c, b.memoizedState = null) : d = c, G(ej, fj), fj |= d; - Xi(a, b, e, c); - return b.child; -} -function gj(a, b) { - var c = b.ref; - if (null === a && null !== c || null !== a && a.ref !== c) b.flags |= 512, b.flags |= 2097152; -} -function cj(a, b, c, d, e) { - var f2 = Zf(c) ? Xf : H.current; - f2 = Yf(b, f2); - ch(b, e); - c = Nh(a, b, c, d, f2, e); - d = Sh(); - if (null !== a && !dh) return b.updateQueue = a.updateQueue, b.flags &= -2053, a.lanes &= ~e, Zi(a, b, e); - I && d && vg(b); - b.flags |= 1; - Xi(a, b, c, e); - return b.child; -} -function hj(a, b, c, d, e) { - if (Zf(c)) { - var f2 = true; - cg(b); - } else f2 = false; - ch(b, e); - if (null === b.stateNode) ij(a, b), Gi(b, c, d), Ii(b, c, d, e), d = true; - else if (null === a) { - var g = b.stateNode, h = b.memoizedProps; - g.props = h; - var k2 = g.context, l2 = c.contextType; - "object" === typeof l2 && null !== l2 ? l2 = eh(l2) : (l2 = Zf(c) ? Xf : H.current, l2 = Yf(b, l2)); - var m2 = c.getDerivedStateFromProps, q2 = "function" === typeof m2 || "function" === typeof g.getSnapshotBeforeUpdate; - q2 || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k2 !== l2) && Hi(b, g, d, l2); - jh = false; - var r2 = b.memoizedState; - g.state = r2; - qh(b, d, g, e); - k2 = b.memoizedState; - h !== d || r2 !== k2 || Wf.current || jh ? ("function" === typeof m2 && (Di(b, c, m2, d), k2 = b.memoizedState), (h = jh || Fi(b, c, h, d, r2, k2, l2)) ? (q2 || "function" !== typeof g.UNSAFE_componentWillMount && "function" !== typeof g.componentWillMount || ("function" === typeof g.componentWillMount && g.componentWillMount(), "function" === typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), "function" === typeof g.componentDidMount && (b.flags |= 4194308)) : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), b.memoizedProps = d, b.memoizedState = k2), g.props = d, g.state = k2, g.context = l2, d = h) : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), d = false); - } else { - g = b.stateNode; - lh(a, b); - h = b.memoizedProps; - l2 = b.type === b.elementType ? h : Ci(b.type, h); - g.props = l2; - q2 = b.pendingProps; - r2 = g.context; - k2 = c.contextType; - "object" === typeof k2 && null !== k2 ? k2 = eh(k2) : (k2 = Zf(c) ? Xf : H.current, k2 = Yf(b, k2)); - var y2 = c.getDerivedStateFromProps; - (m2 = "function" === typeof y2 || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q2 || r2 !== k2) && Hi(b, g, d, k2); - jh = false; - r2 = b.memoizedState; - g.state = r2; - qh(b, d, g, e); - var n2 = b.memoizedState; - h !== q2 || r2 !== n2 || Wf.current || jh ? ("function" === typeof y2 && (Di(b, c, y2, d), n2 = b.memoizedState), (l2 = jh || Fi(b, c, l2, d, r2, n2, k2) || false) ? (m2 || "function" !== typeof g.UNSAFE_componentWillUpdate && "function" !== typeof g.componentWillUpdate || ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(d, n2, k2), "function" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, n2, k2)), "function" === typeof g.componentDidUpdate && (b.flags |= 4), "function" === typeof g.getSnapshotBeforeUpdate && (b.flags |= 1024)) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 1024), b.memoizedProps = d, b.memoizedState = n2), g.props = d, g.state = n2, g.context = k2, d = l2) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && r2 === a.memoizedState || (b.flags |= 1024), d = false); - } - return jj(a, b, c, d, f2, e); -} -function jj(a, b, c, d, e, f2) { - gj(a, b); - var g = 0 !== (b.flags & 128); - if (!d && !g) return e && dg(b, c, false), Zi(a, b, f2); - d = b.stateNode; - Wi.current = b; - var h = g && "function" !== typeof c.getDerivedStateFromError ? null : d.render(); - b.flags |= 1; - null !== a && g ? (b.child = Ug(b, a.child, null, f2), b.child = Ug(b, null, h, f2)) : Xi(a, b, h, f2); - b.memoizedState = d.state; - e && dg(b, c, true); - return b.child; -} -function kj(a) { - var b = a.stateNode; - b.pendingContext ? ag(a, b.pendingContext, b.pendingContext !== b.context) : b.context && ag(a, b.context, false); - yh(a, b.containerInfo); -} -function lj(a, b, c, d, e) { - Ig(); - Jg(e); - b.flags |= 256; - Xi(a, b, c, d); - return b.child; -} -var mj = { dehydrated: null, treeContext: null, retryLane: 0 }; -function nj(a) { - return { baseLanes: a, cachePool: null, transitions: null }; -} -function oj(a, b, c) { - var d = b.pendingProps, e = L.current, f2 = false, g = 0 !== (b.flags & 128), h; - (h = g) || (h = null !== a && null === a.memoizedState ? false : 0 !== (e & 2)); - if (h) f2 = true, b.flags &= -129; - else if (null === a || null !== a.memoizedState) e |= 1; - G(L, e & 1); - if (null === a) { - Eg(b); - a = b.memoizedState; - if (null !== a && (a = a.dehydrated, null !== a)) return 0 === (b.mode & 1) ? b.lanes = 1 : "$!" === a.data ? b.lanes = 8 : b.lanes = 1073741824, null; - g = d.children; - a = d.fallback; - return f2 ? (d = b.mode, f2 = b.child, g = { mode: "hidden", children: g }, 0 === (d & 1) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = g) : f2 = pj(g, d, 0, null), a = Tg(a, d, c, null), f2.return = b, a.return = b, f2.sibling = a, b.child = f2, b.child.memoizedState = nj(c), b.memoizedState = mj, a) : qj(b, g); - } - e = a.memoizedState; - if (null !== e && (h = e.dehydrated, null !== h)) return rj(a, b, g, d, h, e, c); - if (f2) { - f2 = d.fallback; - g = b.mode; - e = a.child; - h = e.sibling; - var k2 = { mode: "hidden", children: d.children }; - 0 === (g & 1) && b.child !== e ? (d = b.child, d.childLanes = 0, d.pendingProps = k2, b.deletions = null) : (d = Pg(e, k2), d.subtreeFlags = e.subtreeFlags & 14680064); - null !== h ? f2 = Pg(h, f2) : (f2 = Tg(f2, g, c, null), f2.flags |= 2); - f2.return = b; - d.return = b; - d.sibling = f2; - b.child = d; - d = f2; - f2 = b.child; - g = a.child.memoizedState; - g = null === g ? nj(c) : { baseLanes: g.baseLanes | c, cachePool: null, transitions: g.transitions }; - f2.memoizedState = g; - f2.childLanes = a.childLanes & ~c; - b.memoizedState = mj; - return d; - } - f2 = a.child; - a = f2.sibling; - d = Pg(f2, { mode: "visible", children: d.children }); - 0 === (b.mode & 1) && (d.lanes = c); - d.return = b; - d.sibling = null; - null !== a && (c = b.deletions, null === c ? (b.deletions = [a], b.flags |= 16) : c.push(a)); - b.child = d; - b.memoizedState = null; - return d; -} -function qj(a, b) { - b = pj({ mode: "visible", children: b }, a.mode, 0, null); - b.return = a; - return a.child = b; -} -function sj(a, b, c, d) { - null !== d && Jg(d); - Ug(b, a.child, null, c); - a = qj(b, b.pendingProps.children); - a.flags |= 2; - b.memoizedState = null; - return a; -} -function rj(a, b, c, d, e, f2, g) { - if (c) { - if (b.flags & 256) return b.flags &= -257, d = Ki(Error(p(422))), sj(a, b, g, d); - if (null !== b.memoizedState) return b.child = a.child, b.flags |= 128, null; - f2 = d.fallback; - e = b.mode; - d = pj({ mode: "visible", children: d.children }, e, 0, null); - f2 = Tg(f2, e, g, null); - f2.flags |= 2; - d.return = b; - f2.return = b; - d.sibling = f2; - b.child = d; - 0 !== (b.mode & 1) && Ug(b, a.child, null, g); - b.child.memoizedState = nj(g); - b.memoizedState = mj; - return f2; - } - if (0 === (b.mode & 1)) return sj(a, b, g, null); - if ("$!" === e.data) { - d = e.nextSibling && e.nextSibling.dataset; - if (d) var h = d.dgst; - d = h; - f2 = Error(p(419)); - d = Ki(f2, d, void 0); - return sj(a, b, g, d); - } - h = 0 !== (g & a.childLanes); - if (dh || h) { - d = Q; - if (null !== d) { - switch (g & -g) { - case 4: - e = 2; - break; - case 16: - e = 8; - break; - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - e = 32; - break; - case 536870912: - e = 268435456; - break; - default: - e = 0; - } - e = 0 !== (e & (d.suspendedLanes | g)) ? 0 : e; - 0 !== e && e !== f2.retryLane && (f2.retryLane = e, ih(a, e), gi(d, a, e, -1)); - } - tj(); - d = Ki(Error(p(421))); - return sj(a, b, g, d); - } - if ("$?" === e.data) return b.flags |= 128, b.child = a.child, b = uj.bind(null, a), e._reactRetry = b, null; - a = f2.treeContext; - yg = Lf(e.nextSibling); - xg = b; - I = true; - zg = null; - null !== a && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a.id, sg = a.overflow, qg = b); - b = qj(b, d.children); - b.flags |= 4096; - return b; -} -function vj(a, b, c) { - a.lanes |= b; - var d = a.alternate; - null !== d && (d.lanes |= b); - bh(a.return, b, c); -} -function wj(a, b, c, d, e) { - var f2 = a.memoizedState; - null === f2 ? a.memoizedState = { isBackwards: b, rendering: null, renderingStartTime: 0, last: d, tail: c, tailMode: e } : (f2.isBackwards = b, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d, f2.tail = c, f2.tailMode = e); -} -function xj(a, b, c) { - var d = b.pendingProps, e = d.revealOrder, f2 = d.tail; - Xi(a, b, d.children, c); - d = L.current; - if (0 !== (d & 2)) d = d & 1 | 2, b.flags |= 128; - else { - if (null !== a && 0 !== (a.flags & 128)) a: for (a = b.child; null !== a; ) { - if (13 === a.tag) null !== a.memoizedState && vj(a, c, b); - else if (19 === a.tag) vj(a, c, b); - else if (null !== a.child) { - a.child.return = a; - a = a.child; - continue; - } - if (a === b) break a; - for (; null === a.sibling; ) { - if (null === a.return || a.return === b) break a; - a = a.return; - } - a.sibling.return = a.return; - a = a.sibling; - } - d &= 1; - } - G(L, d); - if (0 === (b.mode & 1)) b.memoizedState = null; - else switch (e) { - case "forwards": - c = b.child; - for (e = null; null !== c; ) a = c.alternate, null !== a && null === Ch(a) && (e = c), c = c.sibling; - c = e; - null === c ? (e = b.child, b.child = null) : (e = c.sibling, c.sibling = null); - wj(b, false, e, c, f2); - break; - case "backwards": - c = null; - e = b.child; - for (b.child = null; null !== e; ) { - a = e.alternate; - if (null !== a && null === Ch(a)) { - b.child = e; - break; - } - a = e.sibling; - e.sibling = c; - c = e; - e = a; - } - wj(b, true, c, null, f2); - break; - case "together": - wj(b, false, null, null, void 0); - break; - default: - b.memoizedState = null; - } - return b.child; -} -function ij(a, b) { - 0 === (b.mode & 1) && null !== a && (a.alternate = null, b.alternate = null, b.flags |= 2); -} -function Zi(a, b, c) { - null !== a && (b.dependencies = a.dependencies); - rh |= b.lanes; - if (0 === (c & b.childLanes)) return null; - if (null !== a && b.child !== a.child) throw Error(p(153)); - if (null !== b.child) { - a = b.child; - c = Pg(a, a.pendingProps); - b.child = c; - for (c.return = b; null !== a.sibling; ) a = a.sibling, c = c.sibling = Pg(a, a.pendingProps), c.return = b; - c.sibling = null; - } - return b.child; -} -function yj(a, b, c) { - switch (b.tag) { - case 3: - kj(b); - Ig(); - break; - case 5: - Ah(b); - break; - case 1: - Zf(b.type) && cg(b); - break; - case 4: - yh(b, b.stateNode.containerInfo); - break; - case 10: - var d = b.type._context, e = b.memoizedProps.value; - G(Wg, d._currentValue); - d._currentValue = e; - break; - case 13: - d = b.memoizedState; - if (null !== d) { - if (null !== d.dehydrated) return G(L, L.current & 1), b.flags |= 128, null; - if (0 !== (c & b.child.childLanes)) return oj(a, b, c); - G(L, L.current & 1); - a = Zi(a, b, c); - return null !== a ? a.sibling : null; - } - G(L, L.current & 1); - break; - case 19: - d = 0 !== (c & b.childLanes); - if (0 !== (a.flags & 128)) { - if (d) return xj(a, b, c); - b.flags |= 128; - } - e = b.memoizedState; - null !== e && (e.rendering = null, e.tail = null, e.lastEffect = null); - G(L, L.current); - if (d) break; - else return null; - case 22: - case 23: - return b.lanes = 0, dj(a, b, c); - } - return Zi(a, b, c); -} -var zj, Aj, Bj, Cj; -zj = function(a, b) { - for (var c = b.child; null !== c; ) { - if (5 === c.tag || 6 === c.tag) a.appendChild(c.stateNode); - else if (4 !== c.tag && null !== c.child) { - c.child.return = c; - c = c.child; - continue; - } - if (c === b) break; - for (; null === c.sibling; ) { - if (null === c.return || c.return === b) return; - c = c.return; - } - c.sibling.return = c.return; - c = c.sibling; - } -}; -Aj = function() { -}; -Bj = function(a, b, c, d) { - var e = a.memoizedProps; - if (e !== d) { - a = b.stateNode; - xh(uh.current); - var f2 = null; - switch (c) { - case "input": - e = Ya(a, e); - d = Ya(a, d); - f2 = []; - break; - case "select": - e = A({}, e, { value: void 0 }); - d = A({}, d, { value: void 0 }); - f2 = []; - break; - case "textarea": - e = gb(a, e); - d = gb(a, d); - f2 = []; - break; - default: - "function" !== typeof e.onClick && "function" === typeof d.onClick && (a.onclick = Bf); - } - ub(c, d); - var g; - c = null; - for (l2 in e) if (!d.hasOwnProperty(l2) && e.hasOwnProperty(l2) && null != e[l2]) if ("style" === l2) { - var h = e[l2]; - for (g in h) h.hasOwnProperty(g) && (c || (c = {}), c[g] = ""); - } else "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null)); - for (l2 in d) { - var k2 = d[l2]; - h = null != e ? e[l2] : void 0; - if (d.hasOwnProperty(l2) && k2 !== h && (null != k2 || null != h)) if ("style" === l2) if (h) { - for (g in h) !h.hasOwnProperty(g) || k2 && k2.hasOwnProperty(g) || (c || (c = {}), c[g] = ""); - for (g in k2) k2.hasOwnProperty(g) && h[g] !== k2[g] && (c || (c = {}), c[g] = k2[g]); - } else c || (f2 || (f2 = []), f2.push( - l2, - c - )), c = k2; - else "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h = h ? h.__html : void 0, null != k2 && h !== k2 && (f2 = f2 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f2 = f2 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D("scroll", a), f2 || h === k2 || (f2 = [])) : (f2 = f2 || []).push(l2, k2)); - } - c && (f2 = f2 || []).push("style", c); - var l2 = f2; - if (b.updateQueue = l2) b.flags |= 4; - } -}; -Cj = function(a, b, c, d) { - c !== d && (b.flags |= 4); -}; -function Dj(a, b) { - if (!I) switch (a.tailMode) { - case "hidden": - b = a.tail; - for (var c = null; null !== b; ) null !== b.alternate && (c = b), b = b.sibling; - null === c ? a.tail = null : c.sibling = null; - break; - case "collapsed": - c = a.tail; - for (var d = null; null !== c; ) null !== c.alternate && (d = c), c = c.sibling; - null === d ? b || null === a.tail ? a.tail = null : a.tail.sibling = null : d.sibling = null; - } -} -function S(a) { - var b = null !== a.alternate && a.alternate.child === a.child, c = 0, d = 0; - if (b) for (var e = a.child; null !== e; ) c |= e.lanes | e.childLanes, d |= e.subtreeFlags & 14680064, d |= e.flags & 14680064, e.return = a, e = e.sibling; - else for (e = a.child; null !== e; ) c |= e.lanes | e.childLanes, d |= e.subtreeFlags, d |= e.flags, e.return = a, e = e.sibling; - a.subtreeFlags |= d; - a.childLanes = c; - return b; -} -function Ej(a, b, c) { - var d = b.pendingProps; - wg(b); - switch (b.tag) { - case 2: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return S(b), null; - case 1: - return Zf(b.type) && $f(), S(b), null; - case 3: - d = b.stateNode; - zh(); - E(Wf); - E(H); - Eh(); - d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null); - if (null === a || null === a.child) Gg(b) ? b.flags |= 4 : null === a || a.memoizedState.isDehydrated && 0 === (b.flags & 256) || (b.flags |= 1024, null !== zg && (Fj(zg), zg = null)); - Aj(a, b); - S(b); - return null; - case 5: - Bh(b); - var e = xh(wh.current); - c = b.type; - if (null !== a && null != b.stateNode) Bj(a, b, c, d, e), a.ref !== b.ref && (b.flags |= 512, b.flags |= 2097152); - else { - if (!d) { - if (null === b.stateNode) throw Error(p(166)); - S(b); - return null; - } - a = xh(uh.current); - if (Gg(b)) { - d = b.stateNode; - c = b.type; - var f2 = b.memoizedProps; - d[Of] = b; - d[Pf] = f2; - a = 0 !== (b.mode & 1); - switch (c) { - case "dialog": - D("cancel", d); - D("close", d); - break; - case "iframe": - case "object": - case "embed": - D("load", d); - break; - case "video": - case "audio": - for (e = 0; e < lf.length; e++) D(lf[e], d); - break; - case "source": - D("error", d); - break; - case "img": - case "image": - case "link": - D( - "error", - d - ); - D("load", d); - break; - case "details": - D("toggle", d); - break; - case "input": - Za(d, f2); - D("invalid", d); - break; - case "select": - d._wrapperState = { wasMultiple: !!f2.multiple }; - D("invalid", d); - break; - case "textarea": - hb(d, f2), D("invalid", d); - } - ub(c, f2); - e = null; - for (var g in f2) if (f2.hasOwnProperty(g)) { - var h = f2[g]; - "children" === g ? "string" === typeof h ? d.textContent !== h && (true !== f2.suppressHydrationWarning && Af(d.textContent, h, a), e = ["children", h]) : "number" === typeof h && d.textContent !== "" + h && (true !== f2.suppressHydrationWarning && Af( - d.textContent, - h, - a - ), e = ["children", "" + h]) : ea.hasOwnProperty(g) && null != h && "onScroll" === g && D("scroll", d); - } - switch (c) { - case "input": - Va(d); - db(d, f2, true); - break; - case "textarea": - Va(d); - jb(d); - break; - case "select": - case "option": - break; - default: - "function" === typeof f2.onClick && (d.onclick = Bf); - } - d = e; - b.updateQueue = d; - null !== d && (b.flags |= 4); - } else { - g = 9 === e.nodeType ? e : e.ownerDocument; - "http://www.w3.org/1999/xhtml" === a && (a = kb(c)); - "http://www.w3.org/1999/xhtml" === a ? "script" === c ? (a = g.createElement("div"), a.innerHTML = " - - diff --git a/mcp/popup.js b/mcp/popup.js deleted file mode 100644 index 1bf6bcd..0000000 --- a/mcp/popup.js +++ /dev/null @@ -1,96 +0,0 @@ -const STORAGE_KEY = 'react_debugger_disabled_sites'; - -function getHostname(url) { - try { - return new URL(url).hostname; - } catch { - return null; - } -} - -async function getDisabledSites() { - const result = await chrome.storage.local.get(STORAGE_KEY); - return result[STORAGE_KEY] || []; -} - -async function setDisabledSites(sites) { - await chrome.storage.local.set({ [STORAGE_KEY]: sites }); -} - -async function isSiteEnabled(hostname) { - const disabledSites = await getDisabledSites(); - return !disabledSites.includes(hostname); -} - -async function toggleSite(hostname, enabled) { - const disabledSites = await getDisabledSites(); - - if (enabled) { - const index = disabledSites.indexOf(hostname); - if (index > -1) { - disabledSites.splice(index, 1); - } - } else { - if (!disabledSites.includes(hostname)) { - disabledSites.push(hostname); - } - } - - await setDisabledSites(disabledSites); -} - -function updateUI(hostname, enabled) { - const statusEl = document.getElementById('status'); - const statusText = document.getElementById('statusText'); - const toggle = document.getElementById('siteToggle'); - - toggle.checked = enabled; - - if (enabled) { - statusEl.className = 'status enabled'; - statusText.textContent = 'Enabled for this site'; - } else { - statusEl.className = 'status disabled'; - statusText.textContent = 'Disabled for this site'; - } -} - -async function init() { - const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); - const hostname = getHostname(tab?.url); - - const siteNameEl = document.getElementById('siteName'); - const toggle = document.getElementById('siteToggle'); - const reloadBtn = document.getElementById('reloadBtn'); - const clearBtn = document.getElementById('clearBtn'); - - if (!hostname) { - siteNameEl.textContent = 'Cannot detect site'; - toggle.disabled = true; - return; - } - - siteNameEl.textContent = hostname; - - const enabled = await isSiteEnabled(hostname); - updateUI(hostname, enabled); - - toggle.addEventListener('change', async () => { - const newEnabled = toggle.checked; - await toggleSite(hostname, newEnabled); - updateUI(hostname, newEnabled); - }); - - reloadBtn.addEventListener('click', () => { - chrome.tabs.reload(tab.id); - window.close(); - }); - - clearBtn.addEventListener('click', async () => { - await setDisabledSites([]); - updateUI(hostname, true); - toggle.checked = true; - }); -} - -document.addEventListener('DOMContentLoaded', init); diff --git a/mcp/styles/panel.css b/mcp/styles/panel.css deleted file mode 100644 index 324b776..0000000 --- a/mcp/styles/panel.css +++ /dev/null @@ -1,3834 +0,0 @@ -:root { - /* Base palette — blue-tinted dark */ - --bg-primary: #0d1117; - --bg-secondary: #161b22; - --bg-tertiary: #1c2128; - --bg-hover: #2d333b; - --bg-card: #161b22; - --bg-inset: #0d1117; - - /* Text hierarchy */ - --text-primary: #e6edf3; - --text-secondary: #8b949e; - --text-muted: #484f58; - - /* Borders & dividers */ - --border-color: #30363d; - --border-subtle: #21262d; - - /* Accent colors — vibrant */ - --accent-blue: #58a6ff; - --accent-green: #3fb950; - --accent-yellow: #d29922; - --accent-red: #f85149; - --accent-purple: #bc8cff; - --accent-cyan: #39d2c0; - - /* Shadows */ - --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); - --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3); - --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5); - --shadow-glow-blue: 0 0 12px rgba(88, 166, 255, 0.15); - - /* Radii */ - --radius-sm: 4px; - --radius-md: 8px; - --radius-lg: 12px; - - /* Transitions */ - --transition-fast: 0.12s ease; - --transition-normal: 0.2s ease; - - /* Typography */ - --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace; -} - -* { - box-sizing: border-box; - margin: 0; - padding: 0; -} - -body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif; - font-size: 12px; - color: var(--text-primary); - background: var(--bg-primary); - line-height: 1.5; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.panel { - display: flex; - flex-direction: column; - height: 100vh; - overflow: hidden; -} - -.panel-header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 16px; - background: var(--bg-secondary); - border-bottom: 1px solid var(--border-color); - box-shadow: var(--shadow-sm); -} - -.logo { - display: flex; - align-items: center; - gap: 8px; -} - -.logo-icon { - width: 20px; - height: 20px; - object-fit: contain; -} - -.logo-text { - font-weight: 600; - font-size: 14px; -} - -.version { - font-size: 10px; - color: var(--text-muted); - padding: 2px 6px; - background: var(--bg-tertiary); - border-radius: 4px; -} - -.header-badges { - display: flex; - gap: 8px; -} - -.mode-badge { - font-size: 10px; - font-weight: 600; - padding: 2px 8px; - border-radius: 4px; -} - -.mode-dev { - background: rgba(255, 164, 0, 0.2); - color: var(--accent-yellow); -} - -.mode-prod { - background: rgba(12, 206, 107, 0.2); - color: var(--accent-green); -} - -.mode-active { - background: rgba(12, 206, 107, 0.2); - color: var(--accent-green); -} - -.mode-paused { - background: rgba(140, 140, 140, 0.2); - color: var(--text-secondary); -} - -.mode-redux { - background: rgba(157, 121, 215, 0.2); - color: var(--accent-purple); -} - -.header-right { - display: flex; - align-items: center; - gap: 12px; -} - -.debugger-toggle { - display: flex; - align-items: center; - gap: 8px; - padding: 4px 8px; - background: var(--bg-tertiary); - border: 1px solid var(--border-color); - border-radius: 16px; - cursor: pointer; - transition: all 0.2s; -} - -.debugger-toggle:hover { - background: var(--bg-hover); -} - -.toggle-track { - position: relative; - width: 32px; - height: 18px; - background: var(--text-muted); - border-radius: 9px; - transition: background 0.2s; -} - -.debugger-toggle.enabled .toggle-track { - background: var(--accent-green); -} - -.toggle-thumb { - position: absolute; - top: 2px; - left: 2px; - width: 14px; - height: 14px; - background: white; - border-radius: 50%; - transition: transform 0.2s; -} - -.debugger-toggle.enabled .toggle-thumb { - transform: translateX(14px); -} - -.toggle-label { - font-size: 10px; - font-weight: 600; - color: var(--text-secondary); - min-width: 24px; -} - -.debugger-toggle.enabled .toggle-label { - color: var(--accent-green); -} - -.debugger-disabled-placeholder { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; - padding: 40px; - text-align: center; - color: var(--text-secondary); -} - -.placeholder-icon { - color: var(--text-muted); - margin-bottom: 16px; -} - -.debugger-disabled-placeholder h2 { - font-size: 18px; - font-weight: 500; - margin-bottom: 8px; - color: var(--text-primary); -} - -.debugger-disabled-placeholder p { - max-width: 320px; - margin-bottom: 20px; - line-height: 1.6; -} - -.enable-btn { - padding: 10px 24px; - background: var(--accent-green); - color: white; - border: none; - border-radius: 6px; - font-size: 13px; - font-weight: 500; - cursor: pointer; - transition: all 0.2s; -} - -.enable-btn:hover { - background: #0ab35c; - transform: translateY(-1px); -} - -.tab-nav { - display: flex; - background: var(--bg-secondary); - border-bottom: 1px solid var(--border-color); - overflow-x: auto; -} - -.tab-button { - display: flex; - align-items: center; - gap: 6px; - padding: 10px 16px; - background: none; - border: none; - border-bottom: 3px solid transparent; - color: var(--text-secondary); - cursor: pointer; - transition: all var(--transition-fast); - white-space: nowrap; - font-size: 12px; - font-weight: 500; -} - -.tab-button:hover { - background: rgba(88, 166, 255, 0.04); - color: var(--text-primary); -} - -.tab-button.active { - color: var(--text-primary); - border-bottom-color: var(--accent-blue); - background: rgba(88, 166, 255, 0.06); - box-shadow: inset 0 -1px 8px rgba(88, 166, 255, 0.08); -} - -.tab-label { - font-size: 12px; -} - -.tab-badge { - font-size: 10px; - font-weight: 600; - padding: 1px 6px; - background: var(--accent-red); - color: white; - border-radius: 10px; -} - -.tab-content { - flex: 1; - overflow: auto; - padding: 16px; -} - -.tab-panel { - max-width: 1200px; -} - -.tab-header { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 16px; -} - -.tab-header h2 { - font-size: 16px; - font-weight: 600; -} - -.tab-actions { - display: flex; - align-items: center; - gap: 12px; -} - -.issue-count { - font-size: 12px; - color: var(--text-secondary); -} - -.clear-btn, -.refresh-btn, -.dispatch-btn { - padding: 6px 12px; - font-size: 12px; - background: var(--bg-tertiary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-primary); - cursor: pointer; - transition: all 0.2s; -} - -.clear-btn:hover, -.refresh-btn:hover, -.dispatch-btn:hover { - background: var(--bg-hover); -} - -.dispatch-btn { - background: var(--accent-blue); - border-color: var(--accent-blue); -} - -.dispatch-btn:hover { - opacity: 0.9; -} - -.section { - margin-bottom: 24px; -} - -.section h3 { - font-size: 13px; - font-weight: 600; - margin-bottom: 8px; - color: var(--text-secondary); - min-height: 20px; -} - -.section-desc { - font-size: 11px; - color: var(--text-muted); - margin-bottom: 12px; - min-height: 17px; -} - -.issues-list { - display: flex; - flex-direction: column; - gap: 8px; -} - -.issue-card { - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-left-width: 3px; - border-radius: var(--radius-md); - overflow: hidden; - box-shadow: var(--shadow-sm); - transition: box-shadow var(--transition-fast), border-color var(--transition-fast); -} - -.issue-card:hover { - border-color: var(--bg-hover); - box-shadow: var(--shadow-md); -} - -.issue-header { - display: flex; - align-items: center; - gap: 12px; - padding: 10px 12px; - cursor: pointer; - transition: background 0.2s; -} - -.issue-header:hover { - background: var(--bg-hover); -} - -.issue-icon { - font-size: 16px; -} - -.issue-info { - flex: 1; - min-width: 0; -} - -.issue-title-row { - display: flex; - align-items: center; - gap: 8px; - margin-bottom: 4px; -} - -.issue-title { - font-size: 13px; - font-weight: 500; - margin: 0; -} - -.severity-badge { - font-size: 9px; - font-weight: 600; - padding: 2px 6px; - border-radius: 3px; - text-transform: uppercase; - letter-spacing: 0.5px; -} - -.issue-location { - display: flex; - align-items: center; - gap: 6px; - flex-wrap: wrap; -} - -.element-type { - font-family: var(--font-mono); - font-size: 11px; - color: var(--accent-purple); - background: rgba(138, 43, 226, 0.15); - padding: 1px 5px; - border-radius: 3px; -} - -.issue-component { - font-size: 11px; - color: var(--text-muted); -} - -.issue-component strong { - color: var(--accent-blue); -} - -.component-path { - font-size: 10px; - color: var(--text-muted); - opacity: 0.8; -} - -.render-count-badge { - font-size: 11px; - font-weight: 600; - font-family: var(--font-mono); - padding: 2px 6px; - background: rgba(255, 164, 0, 0.2); - color: var(--accent-yellow); - border-radius: 4px; - margin-left: 4px; -} - -.expand-button { - padding: 4px 8px; - background: none; - border: none; - color: var(--text-secondary); - cursor: pointer; - font-size: 10px; -} - -.issue-details { - padding: 12px 16px; - border-top: 1px solid var(--border-color); - background: var(--bg-tertiary); -} - -.issue-message { - margin-bottom: 12px; - color: var(--text-primary); -} - -.issue-why { - margin-bottom: 12px; - padding: 8px; - background: rgba(0, 122, 204, 0.1); - border-radius: 4px; -} - -.issue-why strong { - color: var(--accent-blue); - font-size: 11px; -} - -.issue-why p { - margin-top: 4px; - font-size: 12px; -} - -.issue-suggestion { - margin-bottom: 12px; -} - -.issue-suggestion strong { - color: var(--accent-green); - font-size: 11px; -} - -.issue-suggestion p { - margin-top: 4px; -} - -.issue-code { - margin-bottom: 12px; -} - -.issue-code strong { - font-size: 11px; - color: var(--text-secondary); -} - -.issue-code pre { - margin-top: 4px; - padding: 8px; - background: var(--bg-primary); - border-radius: 4px; - overflow-x: auto; -} - -.issue-code code { - font-family: var(--font-mono); - font-size: 11px; - white-space: pre-wrap; -} - -.issue-actions { - display: flex; - gap: 12px; -} - -.learn-link { - font-size: 11px; - color: var(--accent-blue); - text-decoration: none; -} - -.issue-elements { - margin-bottom: 12px; - padding: 8px; - background: var(--bg-primary); - border-radius: 4px; -} - -.issue-elements strong { - font-size: 11px; - color: var(--text-secondary); - display: block; - margin-bottom: 8px; -} - -.elements-list { - display: flex; - flex-direction: column; - gap: 4px; - max-height: 200px; - overflow-y: auto; -} - -.element-item { - display: flex; - align-items: center; - gap: 8px; - font-family: var(--font-mono); - font-size: 11px; - padding: 4px 8px; - background: var(--bg-secondary); - border-radius: 3px; - border-left: 2px solid transparent; -} - -.element-item.missing-key { - border-left-color: var(--accent-red); - background: rgba(255, 68, 68, 0.08); -} - -.element-item .el-index { - color: var(--text-muted); - min-width: 30px; -} - -.element-item .el-type { - color: var(--accent-purple); - flex: 1; -} - -.element-item .el-key { - color: var(--accent-green); -} - -.element-item .el-key.null { - color: var(--accent-red); - font-style: italic; -} - -.element-item.more { - color: var(--text-muted); - font-style: italic; - justify-content: center; -} - -.learn-link:hover { - text-decoration: underline; -} - -.closure-info { - margin-bottom: 12px; - padding: 12px; - background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 87, 34, 0.1) 100%); - border: 1px solid rgba(255, 152, 0, 0.3); - border-radius: 6px; -} - -.closure-info > strong { - display: block; - font-size: 11px; - color: var(--accent-yellow); - margin-bottom: 10px; -} - -.closure-timeline { - display: flex; - align-items: center; - gap: 12px; - margin-bottom: 12px; - padding: 8px; - background: var(--bg-primary); - border-radius: 4px; -} - -.timeline-item { - display: flex; - flex-direction: column; - align-items: center; - gap: 4px; -} - -.timeline-badge { - padding: 3px 8px; - font-size: 10px; - font-weight: 600; - border-radius: 3px; - background: var(--accent-green); - color: white; -} - -.timeline-badge.warning { - background: var(--accent-red); -} - -.timeline-detail { - font-size: 11px; - color: var(--text-secondary); - font-family: var(--font-mono); -} - -.timeline-arrow { - font-size: 18px; - color: var(--text-muted); - flex-shrink: 0; -} - -.closure-details { - display: flex; - flex-direction: column; - gap: 6px; - margin-bottom: 10px; -} - -.closure-row { - display: flex; - align-items: center; - gap: 8px; - font-size: 11px; -} - -.closure-label { - color: var(--text-muted); - min-width: 100px; -} - -.closure-value { - font-family: var(--font-mono); - color: var(--accent-purple); - background: var(--bg-primary); - padding: 2px 6px; - border-radius: 3px; -} - -.closure-type { - padding: 2px 8px; - border-radius: 3px; - font-size: 10px; - font-weight: 600; - text-transform: uppercase; -} - -.closure-type.type-setTimeout, -.closure-type.type-setInterval { - background: rgba(33, 150, 243, 0.2); - color: #2196f3; -} - -.closure-type.type-eventListener { - background: rgba(156, 39, 176, 0.2); - color: #9c27b0; -} - -.closure-type.type-promise { - background: rgba(0, 150, 136, 0.2); - color: #009688; -} - -.closure-type.type-callback { - background: rgba(255, 152, 0, 0.2); - color: #ff9800; -} - -.closure-stale-count { - font-weight: 600; - color: var(--accent-red); -} - -.captured-values { - margin-top: 10px; - padding-top: 10px; - border-top: 1px solid var(--border-color); -} - -.captured-values strong { - display: block; - font-size: 10px; - color: var(--text-secondary); - margin-bottom: 6px; -} - -.values-list { - display: flex; - flex-wrap: wrap; - gap: 6px; -} - -.value-item code { - padding: 3px 8px; - font-size: 11px; - background: rgba(244, 67, 54, 0.15); - color: var(--accent-red); - border-radius: 3px; - font-family: var(--font-mono); -} - -.empty-state { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - padding: 48px 24px; - text-align: center; - min-height: 200px; -} - -.empty-icon { - font-size: 48px; - margin-bottom: 16px; - width: 48px; - height: 48px; - line-height: 1; -} - -.empty-state h2 { - font-size: 18px; - margin-bottom: 8px; -} - -.empty-state p { - color: var(--text-secondary); - margin-bottom: 4px; -} - -.empty-state .hint { - font-size: 11px; - color: var(--text-muted); -} - -.panel-loading { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100vh; -} - -.spinner { - width: 32px; - height: 32px; - border: 3px solid var(--border-color); - border-top-color: var(--accent-blue); - border-radius: 50%; - animation: spin 1s linear infinite; -} - -@keyframes spin { - to { transform: rotate(360deg); } -} - -.panel-empty { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100vh; - text-align: center; - padding: 24px; -} - -.scan-toggle { - padding: 6px 12px; - font-size: 11px; - font-weight: 600; - border: 1px solid var(--border-color); - border-radius: 4px; - background: var(--bg-secondary); - color: var(--text-secondary); - cursor: pointer; - transition: all 0.2s; -} - -.scan-toggle:hover { - background: var(--bg-hover); -} - -.scan-toggle.active { - background: rgba(64, 196, 99, 0.2); - border-color: #40c463; - color: #40c463; -} - -.scan-info-container { - margin-bottom: 16px; -} - -.scan-info-container:empty { - margin-bottom: 0; -} - -.scan-info { - display: flex; - align-items: center; - gap: 8px; - padding: 10px 12px; - background: rgba(64, 196, 99, 0.1); - border: 1px solid rgba(64, 196, 99, 0.3); - border-radius: 6px; - font-size: 11px; - min-height: 42px; -} - -.scan-indicator { - color: #40c463; - animation: pulse 1.5s ease-in-out infinite; -} - -@keyframes pulse { - 0%, 100% { opacity: 1; } - 50% { opacity: 0.4; } -} - -.scan-legend { - display: flex; - gap: 4px; - margin-left: auto; -} - -.legend-item { - padding: 2px 6px; - border-radius: 3px; - font-size: 9px; - font-weight: 600; - color: white; -} - -.stats-grid { - display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 12px; - margin-bottom: 24px; -} - -@media (max-width: 600px) { - .stats-grid { - grid-template-columns: repeat(2, 1fr); - } -} - -.stat-card { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - padding: 16px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: var(--radius-md); - min-height: 80px; - min-width: 120px; - box-shadow: var(--shadow-sm); - transition: box-shadow var(--transition-fast), transform var(--transition-fast); -} - -.stat-card:hover { - box-shadow: var(--shadow-md); - transform: translateY(-1px); -} - -.stat-value { - font-size: 24px; - font-weight: 600; - color: var(--text-primary); - min-width: 110px; - text-align: center; - font-variant-numeric: tabular-nums; - font-family: var(--font-mono); - line-height: 1.2; - transition: color 0.2s ease; -} - -.stat-label { - font-size: 11px; - color: var(--text-muted); - margin-top: 4px; - text-align: center; - white-space: nowrap; -} - -.render-table { - overflow-x: auto; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 6px; -} - -.render-table table { - width: 100%; - border-collapse: collapse; - table-layout: fixed; - min-width: 500px; -} - -.render-table th, -.render-table td { - padding: 10px 14px; - text-align: left; - border-bottom: 1px solid var(--border-color); - vertical-align: middle; -} - -.render-table th { - font-size: 11px; - font-weight: 600; - color: var(--text-secondary); - background: var(--bg-tertiary); - text-transform: uppercase; - letter-spacing: 0.5px; - white-space: nowrap; -} - -.render-table td { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.render-table tbody tr:last-child td { - border-bottom: none; -} - - -.render-table tbody tr:hover { - background: rgba(88, 166, 255, 0.04); -} - -.render-table tbody tr:nth-child(even) { - background: rgba(255, 255, 255, 0.01); -} - -.render-table tbody tr:nth-child(even):hover { - background: rgba(88, 166, 255, 0.04); -} - -/* Slowest Components Table - 4 columns */ -.render-table.slow-table table { - min-width: 450px; -} - -.render-table.slow-table th:nth-child(1), -.render-table.slow-table td:nth-child(1) { - width: 40%; - min-width: 150px; -} -.render-table.slow-table th:nth-child(2), -.render-table.slow-table td:nth-child(2) { - width: 20%; - min-width: 90px; - text-align: right; -} -.render-table.slow-table th:nth-child(3), -.render-table.slow-table td:nth-child(3) { - width: 20%; - min-width: 90px; - text-align: right; -} -.render-table.slow-table th:nth-child(4), -.render-table.slow-table td:nth-child(4) { - width: 20%; - min-width: 80px; - text-align: right; -} - -/* Top Re-rendering Components Table - 5 columns */ -.render-table.rerender-table table { - min-width: 650px; - table-layout: fixed; -} - -.render-table.rerender-table th:nth-child(1), -.render-table.rerender-table td:nth-child(1) { - width: 25%; - min-width: 150px; - max-width: 200px; -} -.render-table.rerender-table th:nth-child(2), -.render-table.rerender-table td:nth-child(2) { - width: 10%; - min-width: 70px; - text-align: right; -} -.render-table.rerender-table th:nth-child(3), -.render-table.rerender-table td:nth-child(3) { - width: 12%; - min-width: 85px; - text-align: right; -} -.render-table.rerender-table th:nth-child(4), -.render-table.rerender-table td:nth-child(4) { - width: 12%; - min-width: 85px; - text-align: right; -} -.render-table.rerender-table th:nth-child(5), -.render-table.rerender-table td:nth-child(5) { - width: 41%; - min-width: 160px; -} - -.render-table tr.warning { - background: rgba(255, 164, 0, 0.1); -} - -.component-name { - font-family: var(--font-mono); - font-size: 12px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - color: var(--text-primary); -} - -.render-count { - font-weight: 600; - font-variant-numeric: tabular-nums; - font-family: var(--font-mono); - font-size: 12px; - color: var(--text-primary); -} - -.render-time { - font-variant-numeric: tabular-nums; - font-family: var(--font-mono); - font-size: 12px; -} - -.trigger-reason { - display: flex; - align-items: center; - gap: 6px; - flex-wrap: nowrap; - overflow: hidden; -} - -.trigger-badge { - display: inline-block; - padding: 3px 8px; - font-size: 10px; - font-weight: 600; - border-radius: 4px; - background: var(--bg-tertiary); - text-align: center; - text-transform: lowercase; - white-space: nowrap; -} - -.trigger-props { background: rgba(0, 122, 204, 0.2); color: var(--accent-blue); } -.trigger-state { background: rgba(157, 121, 215, 0.2); color: var(--accent-purple); } -.trigger-context { background: rgba(255, 164, 0, 0.2); color: var(--accent-yellow); } -.trigger-parent { background: rgba(140, 140, 140, 0.2); color: var(--text-secondary); } -.trigger-force { background: rgba(255, 78, 66, 0.2); color: var(--accent-red); } -.trigger-mount { background: rgba(12, 206, 107, 0.2); color: var(--accent-green); } -.trigger-unknown { background: var(--bg-tertiary); color: var(--text-muted); } - -.changed-keys { - font-size: 10px; - color: var(--text-muted); - max-width: 120px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-family: var(--font-mono); -} - -.info-section { - padding: 16px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; -} - -.tips-list { - list-style: disc; - padding-left: 20px; -} - -.tips-list li { - margin-bottom: 6px; - color: var(--text-secondary); -} - -.tips-list code { - font-family: var(--font-mono); - font-size: 11px; - padding: 1px 4px; - background: var(--bg-tertiary); - border-radius: 2px; - color: var(--accent-blue); -} - -.cls-score-section { - margin-bottom: 24px; -} - -.cls-score-card { - padding: 20px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; -} - -.cls-score-header { - display: flex; - justify-content: space-between; - align-items: baseline; - margin-bottom: 16px; -} - -.cls-label { - font-size: 14px; - color: var(--text-secondary); -} - -.cls-value { - font-size: 32px; - font-weight: 600; -} - -.cls-bar-container { - margin-bottom: 16px; -} - -.cls-bar-bg { - position: relative; - height: 8px; - background: var(--bg-tertiary); - border-radius: 4px; - overflow: visible; -} - -.cls-bar-fill { - height: 100%; - border-radius: 4px; - transition: width 0.3s; -} - -.cls-threshold { - position: absolute; - top: 12px; - font-size: 10px; - color: var(--text-muted); -} - -.cls-threshold::before { - content: ''; - position: absolute; - top: -8px; - left: 50%; - width: 1px; - height: 8px; - background: var(--border-color); -} - -.cls-rating { - display: flex; - align-items: center; - gap: 8px; -} - -.rating-emoji { - font-size: 18px; -} - -.rating-text { - font-size: 12px; - color: var(--text-secondary); -} - -.contributors-table table { - width: 100%; - border-collapse: collapse; -} - -.contributors-table th, -.contributors-table td { - padding: 8px 12px; - text-align: left; - border-bottom: 1px solid var(--border-color); -} - -.contributors-table th { - font-size: 11px; - font-weight: 600; - color: var(--text-secondary); - background: var(--bg-tertiary); -} - -.element-selector code { - font-family: var(--font-mono); - font-size: 11px; - padding: 2px 6px; - background: var(--bg-primary); - border-radius: 2px; -} - -.shift-value { - font-family: var(--font-mono); - font-weight: 600; -} - -.timeline-list { - display: flex; - flex-direction: column; - gap: 4px; - overflow-y: auto; -} - -.timeline-entry { - display: flex; - align-items: center; - gap: 12px; - padding: 6px 12px; - background: var(--bg-secondary); - border-radius: 4px; -} - -.timeline-time { - font-size: 11px; - color: var(--text-muted); - font-family: var(--font-mono); -} - -.timeline-source { - flex: 1; - font-size: 12px; - font-family: var(--font-mono); -} - -.timeline-value { - font-size: 12px; - font-weight: 600; - font-family: var(--font-mono); -} - -.redux-panel .redux-layout { - display: grid; - grid-template-columns: 300px 1fr; - gap: 16px; - margin-bottom: 24px; -} - -.redux-actions-panel, -.redux-state-panel { - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; - overflow: hidden; -} - -.redux-actions-panel h3, -.redux-state-panel h3 { - padding: 12px; - background: var(--bg-tertiary); - border-bottom: 1px solid var(--border-color); - margin: 0; -} - -.actions-list { - max-height: 400px; - overflow-y: auto; -} - -.action-item { - display: flex; - align-items: center; - gap: 8px; - padding: 8px 12px; - border-bottom: 1px solid var(--border-color); - cursor: pointer; - transition: background 0.2s; -} - -.action-item:hover { - background: var(--bg-hover); -} - -.action-item.selected { - background: rgba(0, 122, 204, 0.2); -} - -.action-time { - font-size: 10px; - color: var(--text-muted); - font-family: var(--font-mono); -} - -.action-type { - font-size: 12px; - font-family: var(--font-mono); - color: var(--accent-blue); -} - -.no-actions, -.no-state { - padding: 24px; - text-align: center; - color: var(--text-muted); -} - -.state-tree { - padding: 12px; - font-family: var(--font-mono); - font-size: 11px; - max-height: 400px; - overflow: auto; - position: relative; -} - -.state-tree-saving { - pointer-events: none; - opacity: 0.6; -} - -.state-saving-overlay { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(var(--bg-primary-rgb, 26, 26, 26), 0.85); - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - gap: 8px; - z-index: 10; - font-size: 12px; - color: var(--text-secondary); - border-radius: 6px; -} - -.mini-spinner { - width: 20px; - height: 20px; - border: 2px solid var(--border-color); - border-top-color: var(--accent-blue); - border-radius: 50%; - animation: mini-spin 0.8s linear infinite; -} - -@keyframes mini-spin { - to { - transform: rotate(360deg); - } -} - -.saving-indicator { - font-size: 11px; - color: var(--accent-blue); - font-weight: normal; - margin-left: 8px; - animation: pulse-opacity 1s ease-in-out infinite; -} - -@keyframes pulse-opacity { - 0%, 100% { opacity: 1; } - 50% { opacity: 0.5; } -} - -.json-children { - padding-left: 16px; -} - -.json-item { - line-height: 1.8; -} - -.json-key { - color: var(--accent-purple); -} - -.json-string { - color: var(--accent-green); -} - -.json-number { - color: var(--accent-yellow); -} - -.json-boolean { - color: var(--accent-blue); -} - -.json-null, -.json-undefined { - color: var(--text-muted); - font-style: italic; -} - -.bracket { - color: var(--text-secondary); -} - -.collapsed-hint { - color: var(--text-muted); - font-style: italic; - margin: 0 4px; -} - -.expand-btn { - padding: 0 4px; - background: none; - border: none; - color: var(--text-muted); - cursor: pointer; - font-size: 10px; -} - -.dispatch-section { - padding: 16px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; -} - -.dispatch-form { - display: flex; - flex-direction: column; - gap: 12px; -} - -.form-row { - display: flex; - flex-direction: column; - gap: 4px; -} - -.form-row label { - font-size: 11px; - color: var(--text-secondary); -} - -.form-row input, -.form-row textarea { - padding: 8px 12px; - font-family: var(--font-mono); - font-size: 12px; - background: var(--bg-primary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-primary); -} - -.form-row input:focus, -.form-row textarea:focus { - outline: none; - border-color: var(--accent-blue); -} - -@media (max-width: 768px) { - .redux-panel .redux-layout { - grid-template-columns: 1fr; - } -} - -/* Redux State Editing */ -.state-header { - display: flex; - justify-content: space-between; - align-items: center; - padding: 12px; - background: var(--bg-tertiary); - border-bottom: 1px solid var(--border-color); -} - -.state-header h3 { - margin: 0; - padding: 0; - background: none; - border: none; -} - -.state-controls { - display: flex; - gap: 6px; - align-items: center; -} - -.search-input { - padding: 4px 8px; - font-size: 11px; - font-family: var(--font-mono); - background: var(--bg-primary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-primary); - width: 150px; -} - -.search-input:focus { - outline: none; - border-color: var(--accent-blue); -} - -.small-btn { - padding: 4px 8px; - font-size: 12px; - font-weight: 600; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-secondary); - cursor: pointer; - transition: all 0.2s; -} - -.small-btn:hover { - background: var(--bg-hover); - color: var(--text-primary); -} - -.small-btn.danger { - color: var(--accent-red); - border-color: var(--accent-red); -} - -.small-btn.danger:hover { - background: rgba(255, 78, 66, 0.2); -} - -.icon-btn { - padding: 4px 8px; - font-size: 14px; - background: transparent; - border: none; - cursor: pointer; - border-radius: 4px; - transition: background 0.2s; -} - -.icon-btn:hover { - background: var(--bg-hover); -} - -.header-actions { - display: flex; - gap: 8px; -} - -.type-hint { - color: var(--text-muted); - font-size: 10px; - margin-left: 4px; -} - -.editable { - cursor: pointer; - padding: 1px 3px; - border-radius: 2px; - transition: background 0.2s; -} - -.editable:hover { - background: var(--bg-hover); - outline: 1px dashed var(--accent-blue); -} - -.editing-container { - display: inline-flex; - align-items: flex-start; - gap: 6px; - flex-wrap: wrap; -} - -.edit-input { - padding: 4px 8px; - font-size: 11px; - font-family: var(--font-mono); - background: var(--bg-primary); - border: 1px solid var(--accent-blue); - border-radius: 4px; - color: var(--text-primary); - min-width: 100px; -} - -.edit-input.json-edit { - min-width: 250px; - min-height: 80px; - resize: both; -} - -.edit-input:focus { - outline: none; - border-color: var(--accent-blue); - box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2); -} - -.edit-actions { - display: flex; - gap: 4px; -} - -.edit-btn { - padding: 4px 8px; - font-size: 12px; - border: none; - border-radius: 4px; - cursor: pointer; - transition: all 0.2s; -} - -.edit-btn.save { - background: var(--accent-green); - color: white; -} - -.edit-btn.save:hover { - background: #3aa856; -} - -.edit-btn.cancel { - background: var(--bg-tertiary); - color: var(--text-secondary); -} - -.edit-btn.cancel:hover { - background: var(--accent-red); - color: white; -} - -.edit-hint { - font-size: 10px; - color: var(--text-muted); - text-align: center; - padding: 8px; - margin: 0; - border-top: 1px solid var(--border-color); -} - -.array-item-row { - display: flex; - align-items: flex-start; - gap: 4px; -} - -.array-item-row:hover .array-item-actions { - opacity: 1; -} - -.array-item-actions { - display: inline-flex; - gap: 2px; - opacity: 0; - transition: opacity 0.2s; - margin-left: 8px; - flex-shrink: 0; -} - -.array-action-btn { - padding: 0 4px; - font-size: 10px; - line-height: 16px; - background: var(--bg-tertiary); - border: 1px solid var(--border-color); - border-radius: 3px; - color: var(--text-secondary); - cursor: pointer; - transition: all 0.15s; -} - -.array-action-btn:hover:not(:disabled) { - background: var(--bg-hover); - color: var(--text-primary); - border-color: var(--accent-blue); -} - -.array-action-btn:disabled { - opacity: 0.3; - cursor: not-allowed; -} - -.array-action-btn.delete { - color: var(--accent-red); -} - -.array-action-btn.delete:hover:not(:disabled) { - background: rgba(255, 78, 66, 0.2); - border-color: var(--accent-red); -} - -.action-detail { - padding: 12px; - border-top: 1px solid var(--border-color); - background: var(--bg-tertiary); -} - -.action-detail h4 { - margin: 0 0 8px 0; - font-size: 12px; - color: var(--accent-blue); -} - -.action-payload { - font-size: 11px; -} - -.action-payload strong { - display: block; - color: var(--text-secondary); - margin-bottom: 4px; -} - -.action-payload pre { - margin: 0; - padding: 8px; - background: var(--bg-primary); - border-radius: 4px; - overflow-x: auto; - font-family: var(--font-mono); - font-size: 10px; - max-height: 150px; - overflow-y: auto; -} - -.json-date { - color: var(--accent-yellow); -} - -.json-special { - color: var(--accent-purple); - font-style: italic; -} - -.json-index { - color: var(--text-muted); -} - -.detection-tips { - margin-top: 16px; - padding: 12px; - background: var(--bg-secondary); - border-radius: 8px; - text-align: left; -} - -.detection-tips h4 { - margin: 0 0 8px 0; - font-size: 12px; - color: var(--text-secondary); -} - -.detection-tips ul { - margin: 0; - padding-left: 20px; -} - -.detection-tips li { - font-size: 11px; - color: var(--text-muted); - margin-bottom: 4px; -} - -.dispatch-btn { - padding: 8px 16px; - font-size: 12px; - font-weight: 600; - background: var(--accent-blue); - color: white; - border: none; - border-radius: 4px; - cursor: pointer; - transition: background 0.2s; -} - -.dispatch-btn:hover { - background: #0066b8; -} - -.code-block { - margin: 8px 0 0 0; - padding: 12px; - background: var(--bg-primary); - border: 1px solid var(--border-color); - border-radius: 4px; - font-family: var(--font-mono); - font-size: 11px; - overflow-x: auto; - white-space: pre-wrap; - color: var(--text-secondary); -} - -.section-desc { - font-size: 12px; - color: var(--text-secondary); - margin: 0 0 8px 0; -} - -/* Memory Tab Styles */ -.memory-warnings-container { - min-height: 52px; - margin-bottom: 16px; -} - -.memory-warnings-placeholder { - height: 52px; -} - -.memory-panel .memory-warnings { - display: flex; - flex-direction: column; - gap: 8px; -} - -.memory-warning { - display: flex; - align-items: center; - gap: 8px; - padding: 10px 12px; - background: rgba(255, 78, 66, 0.1); - border: 1px solid rgba(255, 78, 66, 0.3); - border-radius: 6px; - font-size: 12px; - color: var(--accent-red); -} - -.memory-warning .warning-icon { - font-size: 16px; -} - -.memory-bar-container { - margin-bottom: 16px; -} - -.memory-bar-bg { - height: 12px; - background: var(--bg-tertiary); - border-radius: 6px; - overflow: hidden; -} - -.memory-bar-fill { - height: 100%; - border-radius: 6px; - transition: width 0.3s, background 0.3s; -} - -.memory-bar-labels { - display: flex; - justify-content: space-between; - margin-top: 4px; - font-size: 10px; - color: var(--text-muted); -} - -.memory-bar-labels .threshold-70 { - position: absolute; - left: 70%; - color: var(--accent-yellow); -} - -.memory-bar-labels .threshold-90 { - position: absolute; - left: 90%; - color: var(--accent-red); -} - -.growth-rate-display { - display: flex; - flex-direction: column; - gap: 4px; - padding: 12px; - background: var(--bg-secondary); - border-radius: 8px; -} - -.growth-rate-value { - font-size: 24px; - font-weight: 600; - font-family: var(--font-mono); - font-variant-numeric: tabular-nums; - min-width: 140px; - transition: color 0.2s ease; -} - -.growth-rate-hint { - font-size: 12px; - color: var(--text-secondary); -} - -.memory-chart { - display: flex; - gap: 8px; - height: 150px; - padding: 12px; - background: var(--bg-secondary); - border-radius: 8px; -} - -.chart-y-axis { - display: flex; - flex-direction: column; - justify-content: space-between; - font-size: 10px; - color: var(--text-muted); - min-width: 50px; - text-align: right; - padding-right: 8px; -} - -.chart-area { - flex: 1; - background: var(--bg-tertiary); - border-radius: 4px; - overflow: hidden; -} - -.chart-area svg { - width: 100%; - height: 100%; -} - -.chart-legend { - display: flex; - gap: 16px; - margin-top: 8px; - font-size: 11px; - color: var(--text-secondary); -} - -.legend-item { - display: flex; - align-items: center; - gap: 6px; -} - -.legend-color { - width: 12px; - height: 3px; - border-radius: 2px; -} - -.info-banner { - display: flex; - align-items: flex-start; - gap: 8px; - padding: 12px; - margin-bottom: 16px; - background: rgba(0, 122, 204, 0.1); - border: 1px solid rgba(0, 122, 204, 0.3); - border-radius: 6px; - font-size: 12px; - color: var(--text-secondary); - min-height: 48px; -} - -.info-banner strong { - color: var(--accent-blue); -} - -/* Custom Scrollbar */ -::-webkit-scrollbar { - width: 6px; - height: 6px; -} -::-webkit-scrollbar-track { - background: transparent; -} -::-webkit-scrollbar-thumb { - background: rgba(139, 148, 158, 0.25); - border-radius: 3px; -} -::-webkit-scrollbar-thumb:hover { - background: rgba(139, 148, 158, 0.4); -} -::-webkit-scrollbar-corner { - background: transparent; -} - -/* Timeline Tab Styles */ -.timeline-panel { - height: calc(100vh - 105px); - display: flex; - flex-direction: column; -} - -.timeline-filters { - display: flex; - flex-wrap: wrap; - gap: 12px; - margin-bottom: 16px; - align-items: center; -} - -.filter-toggles { - display: flex; - gap: 6px; - flex-wrap: wrap; -} - -.filter-toggle { - display: flex; - align-items: center; - gap: 4px; - padding: 4px 8px; - background: var(--bg-secondary); - border: 2px solid transparent; - border-radius: 4px; - cursor: pointer; - font-size: 11px; - color: var(--text-secondary); - transition: all 0.2s; -} - -.filter-toggle:hover { - background: var(--bg-hover); -} - -.filter-toggle.active { - color: var(--text-primary); - background: var(--bg-tertiary); -} - -.filter-icon { - font-size: 12px; -} - -.filter-label { - font-weight: 500; -} - -.filter-count { - font-size: 10px; - padding: 1px 5px; - background: var(--bg-primary); - border-radius: 10px; - color: var(--text-muted); -} - -.filter-search { - display: flex; - gap: 8px; - align-items: center; - margin-left: auto; -} - -.clear-filters-btn { - padding: 4px 8px; - font-size: 11px; - background: var(--bg-tertiary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-secondary); - cursor: pointer; -} - -.clear-filters-btn:hover { - background: var(--bg-hover); -} - -.timeline-list { - flex: 1; - min-height: 0; - overflow-y: auto; - display: flex; - flex-direction: column; - gap: 4px; -} - -.timeline-event { - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-left-width: 3px; - border-radius: 4px; - transition: all 0.2s; -} - -.timeline-event:hover { - background: var(--bg-tertiary); -} - -.timeline-event.selected { - border-color: var(--accent-blue); - box-shadow: 0 0 0 1px var(--accent-blue); -} - -.timeline-event.correlated { - background: rgba(168, 85, 247, 0.15); - border-color: #a855f7; -} - -.timeline-event.correlated .event-header { - background: rgba(168, 85, 247, 0.1); -} - -.event-header { - display: flex; - align-items: center; - gap: 8px; - padding: 8px 12px; - cursor: pointer; -} - -.event-icon { - font-size: 14px; - width: 20px; - text-align: center; -} - -.event-time { - font-family: var(--font-mono); - font-size: 10px; - color: var(--text-muted); - min-width: 80px; -} - -.event-type { - font-family: var(--font-mono); - font-size: 10px; - font-weight: 600; - text-transform: uppercase; - min-width: 55px; -} - -.render-order { - font-family: var(--font-mono); - font-size: 10px; - font-weight: 600; - color: var(--text-muted); - background: var(--bg-tertiary); - padding: 1px 4px; - border-radius: 3px; - margin-right: 4px; -} - -.parent-component { - font-size: 10px; - color: var(--text-muted); - margin-left: 4px; - font-style: italic; -} - -.component-path { - font-family: var(--font-mono); - font-size: 10px; - color: var(--text-muted); - padding: 4px 8px; - background: var(--bg-primary); - border-radius: 4px; - margin-top: 4px; - display: flex; - flex-wrap: wrap; - gap: 2px; - align-items: center; -} - -.component-path .path-separator { - color: var(--text-muted); - margin: 0 2px; -} - -.component-path .path-item { - color: var(--accent-purple); -} - -.component-path .path-item.current { - color: var(--accent-blue); - font-weight: 600; -} - -.event-summary { - display: flex; - align-items: center; - gap: 8px; - flex: 1; - font-size: 12px; - overflow: hidden; -} - -.event-summary strong { - font-family: var(--font-mono); - color: var(--text-primary); -} - -.event-trigger { - font-size: 10px; - padding: 1px 6px; - background: var(--bg-tertiary); - border-radius: 3px; -} - -.event-duration { - font-size: 10px; - color: var(--text-muted); - font-family: var(--font-mono); -} - -.event-source { - font-size: 10px; - padding: 1px 6px; - background: rgba(168, 85, 247, 0.2); - color: #a855f7; - border-radius: 3px; -} - -.event-effect-type { - font-size: 10px; - padding: 1px 6px; - background: rgba(255, 164, 0, 0.2); - color: var(--accent-yellow); - border-radius: 3px; -} - -.event-effect-type.run { - background: rgba(12, 206, 107, 0.2); - color: var(--accent-green); -} - -.event-effect-type.cleanup { - background: rgba(255, 78, 66, 0.2); - color: var(--accent-red); -} - -.effect-index { - font-family: var(--font-mono); - font-size: 10px; - color: var(--text-muted); - background: var(--bg-tertiary); - padding: 1px 4px; - border-radius: 3px; -} - -.effect-deps { - font-size: 10px; - color: var(--text-muted); - font-family: var(--font-mono); - max-width: 150px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.effect-hint { - font-size: 10px; - color: var(--accent-purple); - background: rgba(157, 121, 215, 0.15); - padding: 1px 6px; - border-radius: 3px; - font-family: var(--font-mono); - max-width: 150px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.effect-cleanup-badge { - font-size: 9px; - padding: 1px 4px; - background: rgba(0, 122, 204, 0.2); - color: var(--accent-blue); - border-radius: 3px; -} - -.hook-index { - font-family: var(--font-mono); - font-size: 10px; - color: var(--text-muted); - background: var(--bg-tertiary); - padding: 1px 4px; - border-radius: 3px; -} - -.state-change-value { - font-family: var(--font-mono); - font-size: 10px; - color: var(--accent-purple); - max-width: 200px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.action-type { - font-size: 10px; - padding: 1px 6px; - background: rgba(157, 121, 215, 0.2); - color: var(--accent-purple); - border-radius: 3px; -} - -.event-error { - color: var(--accent-red); -} - -.error-type { - font-size: 10px; - padding: 1px 6px; - background: rgba(255, 78, 66, 0.2); - border-radius: 3px; -} - -.error-message { - opacity: 0.8; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.memory-spike { - font-size: 9px; - padding: 1px 6px; - background: var(--accent-red); - color: white; - border-radius: 3px; - font-weight: 600; -} - -.event-expand { - font-size: 10px; - color: var(--text-muted); - transition: transform 0.2s; -} - -.timeline-event.expanded .event-expand { - transform: rotate(0deg); -} - -.event-details { - padding: 12px; - border-top: 1px solid var(--border-color); - background: var(--bg-tertiary); - font-size: 12px; -} - -.detail-row { - margin-bottom: 6px; -} - -.detail-row strong { - color: var(--text-secondary); - margin-right: 8px; -} - -.detail-row.warning { - color: var(--accent-yellow); - font-weight: 600; -} - -.fiber-depth { - font-family: var(--font-mono); - font-size: 8px; - color: var(--text-muted); - letter-spacing: 1px; - margin-right: 2px; -} - -.render-reason-summary { - font-size: 10px; - color: var(--accent-purple); - background: rgba(157, 121, 215, 0.1); - padding: 1px 6px; - border-radius: 3px; - max-width: 200px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.render-reason-box { - background: rgba(0, 122, 204, 0.1); - padding: 8px; - border-radius: 4px; - border-left: 3px solid var(--accent-blue); - margin: 8px 0; -} - -.changes-list { - margin-top: 6px; - padding: 8px; - background: var(--bg-primary); - border-radius: 4px; -} - -.change-item { - display: flex; - align-items: center; - gap: 6px; - font-family: var(--font-mono); - font-size: 11px; - padding: 3px 0; - border-bottom: 1px solid var(--border-color); -} - -.change-item:last-child { - border-bottom: none; -} - -.change-key { - color: var(--accent-purple); - font-weight: 500; - min-width: 80px; -} - -.change-old { - color: var(--accent-red); - background: rgba(255, 78, 66, 0.1); - padding: 1px 4px; - border-radius: 2px; - max-width: 120px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.change-arrow { - color: var(--text-muted); -} - -.change-new { - color: var(--accent-green); - background: rgba(12, 206, 107, 0.1); - padding: 1px 4px; - border-radius: 2px; - max-width: 120px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.state-name { - font-family: var(--font-mono); - font-size: 10px; - color: var(--accent-blue); - background: rgba(0, 122, 204, 0.15); - padding: 1px 6px; - border-radius: 3px; - font-weight: 500; -} - -.context-type { - font-size: 10px; - padding: 1px 6px; - background: rgba(249, 115, 22, 0.2); - color: #f97316; - border-radius: 3px; -} - -.context-changed-keys { - font-family: var(--font-mono); - font-size: 10px; - color: var(--text-muted); - max-width: 150px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.error-stack { - margin-top: 8px; - padding: 8px; - background: var(--bg-primary); - border-radius: 4px; - font-family: var(--font-mono); - font-size: 10px; - overflow-x: auto; - white-space: pre-wrap; - max-height: 200px; - overflow-y: auto; -} - -.event-count { - font-size: 12px; - color: var(--text-muted); -} - -.tab-header-actions { - display: flex; - align-items: center; - gap: 12px; -} - -.clear-all-btn { - padding: 4px 10px; - font-size: 11px; - background: var(--accent-red); - border: none; - border-radius: 4px; - color: white; - cursor: pointer; - font-weight: 500; - transition: all 0.2s; -} - -.clear-all-btn:hover { - background: #e63939; - transform: translateY(-1px); -} - -/* Correlation Panel */ -.correlation-panel { - margin-top: 12px; - padding: 10px; - background: rgba(168, 85, 247, 0.1); - border: 1px solid rgba(168, 85, 247, 0.3); - border-radius: 6px; -} - -.correlation-panel strong { - display: block; - font-size: 11px; - color: #a855f7; - margin-bottom: 8px; -} - -.correlation-list { - margin: 0; - padding-left: 20px; - font-size: 11px; - color: var(--text-secondary); -} - -.correlation-list li { - margin-bottom: 4px; -} - -.correlation-hint { - margin: 8px 0 0 0; - font-size: 10px; - color: var(--text-muted); - font-style: italic; -} - -/* Redux Setup Guide */ -.redux-setup-guide { - padding: 16px; - margin-top: 16px; -} - -.redux-setup-guide h3 { - font-size: 14px; - margin-bottom: 12px; - color: var(--text-primary); -} - -.setup-intro { - font-size: 12px; - color: var(--text-secondary); - margin-bottom: 16px; -} - -.setup-method { - margin-bottom: 16px; - padding: 12px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 6px; -} - -.setup-method h4 { - font-size: 12px; - color: var(--accent-blue); - margin-bottom: 8px; -} - -.method-desc { - font-size: 11px; - color: var(--text-secondary); -} - -.code-snippet { - margin: 0; - padding: 12px; - background: var(--bg-primary); - border-radius: 4px; - font-family: var(--font-mono); - font-size: 11px; - line-height: 1.5; - overflow-x: auto; - white-space: pre; - color: var(--text-secondary); -} - -.detection-status { - margin-top: 16px; - padding: 12px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 6px; -} - -.detection-status h4 { - font-size: 12px; - color: var(--text-secondary); - margin-bottom: 8px; -} - -.detection-checklist { - list-style: none; - padding: 0; - margin: 0; -} - -.detection-checklist li { - display: flex; - align-items: center; - gap: 8px; - font-size: 11px; - color: var(--text-muted); - padding: 4px 0; -} - -.check-icon { - font-size: 12px; - color: var(--accent-red); -} - -/* Snapshot Panel Styles */ -.snapshot-panel { - margin-bottom: 16px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 6px; - overflow: hidden; -} - -.snapshot-header { - display: flex; - align-items: center; - gap: 8px; - padding: 10px 12px; - background: var(--bg-tertiary); - cursor: pointer; - user-select: none; -} - -.snapshot-header:hover { - background: var(--bg-hover); -} - -.snapshot-toggle { - font-size: 10px; - color: var(--text-muted); - width: 12px; -} - -.snapshot-title { - font-size: 12px; - font-weight: 600; - color: var(--text-primary); - flex: 1; -} - -.snapshot-create-btn { - padding: 4px 10px; - font-size: 11px; - font-weight: 500; - background: var(--accent-blue); - border: none; - border-radius: 4px; - color: white; - cursor: pointer; - transition: opacity 0.2s; -} - -.snapshot-create-btn:hover:not(:disabled) { - opacity: 0.9; -} - -.snapshot-create-btn:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -.snapshot-content { - padding: 12px; -} - -.snapshot-empty { - font-size: 12px; - color: var(--text-muted); - text-align: center; - padding: 12px; -} - -.snapshot-list { - display: flex; - flex-direction: column; - gap: 8px; -} - -.snapshot-item { - background: var(--bg-tertiary); - border: 1px solid var(--border-color); - border-radius: 4px; - overflow: hidden; -} - -.snapshot-item:hover { - border-color: var(--accent-blue); -} - -.snapshot-item.expanded { - border-color: var(--accent-blue); -} - -.snapshot-item-header { - display: flex; - align-items: center; - gap: 12px; - padding: 8px 12px; - cursor: pointer; -} - -.snapshot-time { - font-family: var(--font-mono); - font-size: 11px; - color: var(--text-secondary); -} - -.snapshot-count { - font-size: 11px; - color: var(--text-muted); - flex: 1; -} - -.snapshot-actions { - display: flex; - gap: 6px; -} - -.snapshot-action-btn { - padding: 3px 8px; - font-size: 10px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 3px; - color: var(--text-secondary); - cursor: pointer; - transition: all 0.2s; -} - -.snapshot-action-btn:hover { - background: var(--bg-hover); - color: var(--text-primary); -} - -.snapshot-action-btn.delete { - color: var(--accent-red); -} - -.snapshot-action-btn.delete:hover { - background: rgba(255, 78, 66, 0.2); - border-color: var(--accent-red); -} - -.snapshot-details { - padding: 12px; - border-top: 1px solid var(--border-color); - background: var(--bg-primary); - max-height: 300px; - overflow-y: auto; -} - -.snapshot-table { - width: 100%; - border-collapse: collapse; - font-size: 11px; -} - -.snapshot-table th, -.snapshot-table td { - padding: 6px 10px; - text-align: left; - border-bottom: 1px solid var(--border-color); -} - -.snapshot-table th { - font-weight: 600; - color: var(--text-secondary); - background: var(--bg-secondary); - position: sticky; - top: 0; -} - -.snapshot-table td { - color: var(--text-primary); -} - -.snapshot-table .component-name { - font-family: var(--font-mono); -} - -.snapshot-table .trigger-badge { - display: inline-block; - padding: 2px 6px; - font-size: 10px; - background: var(--bg-tertiary); - border-radius: 3px; - color: var(--text-secondary); -} - -/* ============================================ - AI Analysis Tab Styles - ============================================ */ - -.ai-panel { - display: flex; - flex-direction: column; - gap: 12px; -} - -/* Status Bar */ -.ai-status-bar { - display: flex; - gap: 16px; - padding: 8px 12px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 6px; - font-size: 11px; - color: var(--text-secondary); - flex-wrap: wrap; -} - -.ai-status-item { - display: flex; - align-items: center; - gap: 4px; - white-space: nowrap; -} - -/* Action Bar */ -.ai-action-bar { - display: flex; - align-items: center; - gap: 12px; -} - -.ai-rate-warning { - font-size: 11px; - color: var(--accent-yellow); -} - -/* Buttons */ -.ai-btn { - padding: 8px 16px; - font-size: 12px; - font-weight: 600; - border: 1px solid var(--border-color); - border-radius: 6px; - cursor: pointer; - transition: all 0.2s; - white-space: nowrap; -} - -.ai-btn:disabled { - opacity: 0.4; - cursor: not-allowed; -} - -.ai-btn-primary { - background: var(--accent-blue); - border-color: var(--accent-blue); - color: white; -} - -.ai-btn-primary:hover:not(:disabled) { - background: #0066b8; -} - -.ai-btn-secondary { - background: var(--bg-tertiary); - color: var(--text-primary); -} - -.ai-btn-secondary:hover:not(:disabled) { - background: var(--bg-hover); -} - -.ai-btn-cancel { - background: var(--accent-red); - border-color: var(--accent-red); - color: white; -} - -.ai-btn-cancel:hover { - background: #e63939; -} - -.ai-analyze-btn { - font-size: 13px; - padding: 10px 20px; -} - -/* Settings Button */ -.ai-settings-btn { - padding: 4px 8px; - background: none; - border: none; - cursor: pointer; - font-size: 16px; - border-radius: 4px; - transition: background 0.2s; -} - -.ai-settings-btn:hover { - background: var(--bg-hover); -} - -/* Settings Panel */ -.ai-settings-panel { - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; - overflow: hidden; -} - -.ai-settings-header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 12px; - background: var(--bg-tertiary); - border-bottom: 1px solid var(--border-color); -} - -.ai-settings-header h3 { - font-size: 13px; - font-weight: 600; - margin: 0; -} - -.ai-settings-close { - padding: 2px 6px; - background: none; - border: none; - color: var(--text-secondary); - cursor: pointer; - font-size: 14px; - border-radius: 4px; - transition: background 0.2s; -} - -.ai-settings-close:hover { - background: var(--bg-hover); - color: var(--text-primary); -} - -.ai-settings-body { - padding: 12px; - display: flex; - flex-direction: column; - gap: 12px; -} - -.ai-settings-field { - display: flex; - flex-direction: column; - gap: 4px; -} - -.ai-settings-field span { - font-size: 11px; - font-weight: 600; - color: var(--text-secondary); -} - -.ai-settings-field input, -.ai-settings-field select { - padding: 8px 10px; - font-size: 12px; - font-family: var(--font-mono); - background: var(--bg-primary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-primary); - transition: border-color 0.2s; -} - -.ai-settings-field input:focus, -.ai-settings-field select:focus { - outline: none; - border-color: var(--accent-blue); -} - -.ai-settings-field select { - cursor: pointer; -} - -.ai-settings-actions { - display: flex; - justify-content: flex-end; - gap: 8px; - padding-top: 4px; -} - -.ai-settings-contact { - padding: 10px 0 4px; - border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06)); - margin-top: 4px; - text-align: center; -} - -.ai-settings-contact p { - font-size: 11px; - color: var(--text-secondary); - margin: 0 0 6px; -} - -.ai-settings-contact-link { - display: inline-block; - font-size: 12px; - font-weight: 500; - color: var(--accent-blue, #58a6ff); - text-decoration: none; - padding: 4px 10px; - border-radius: var(--radius-sm, 4px); - background: rgba(88, 166, 255, 0.08); - transition: background 0.15s ease, color 0.15s ease; -} - -.ai-settings-contact-link:hover { - background: rgba(88, 166, 255, 0.16); - color: #79bbff; -} - -.ai-key-input-row { - display: flex; - gap: 6px; -} - -.ai-key-input-row input { - flex: 1; -} - -.ai-key-hint { - font-size: 10px; - color: var(--text-muted); - margin-top: 2px; -} - -.ai-key-status { - font-size: 9px; - font-weight: 600; - padding: 1px 6px; - border-radius: 3px; - margin-left: 6px; - text-transform: uppercase; - letter-spacing: 0.5px; -} - -.ai-key-status--valid { - background: rgba(63, 185, 80, 0.15); - color: var(--accent-green); -} - -.ai-key-status--invalid { - background: rgba(248, 81, 73, 0.15); - color: var(--accent-red); -} - -.ai-btn-small { - padding: 4px 10px; - font-size: 11px; - font-weight: 500; - background: var(--bg-tertiary); - border: 1px solid var(--border-color); - border-radius: 4px; - color: var(--text-primary); - cursor: pointer; - transition: background 0.15s; - white-space: nowrap; -} - -.ai-btn-small:hover { - background: var(--bg-hover); -} - -.ai-btn-small:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -.ai-pro-badge { - font-size: 9px; - font-weight: 700; - padding: 2px 8px; - border-radius: 4px; - background: linear-gradient(135deg, rgba(88, 166, 255, 0.2), rgba(188, 140, 255, 0.2)); - color: var(--accent-blue); - border: 1px solid rgba(88, 166, 255, 0.3); - letter-spacing: 1px; -} - -.ai-paywall { - display: flex; - flex-direction: column; - align-items: center; - padding: 32px 20px; - text-align: center; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: var(--radius-md, 8px); -} - -.ai-paywall h3 { - font-size: 15px; - font-weight: 600; - margin: 0 0 8px; - color: var(--text-primary); -} - -.ai-paywall p { - font-size: 12px; - color: var(--text-secondary); - margin: 0 0 4px; - max-width: 320px; -} - -.ai-paywall-unlock { - color: var(--text-muted) !important; - font-size: 11px !important; - margin-bottom: 16px !important; -} - -.ai-paywall-actions { - display: flex; - gap: 10px; - margin-top: 4px; -} - -.ai-btn-link { - text-decoration: none; - display: inline-flex; - align-items: center; -} - -.empty-state-icon--lock { - background: rgba(255, 164, 0, 0.12); - border: 2px solid rgba(255, 164, 0, 0.4); -} - -.empty-state-icon--lock::before { - width: 10px; - height: 10px; - border: 2.5px solid var(--accent-yellow); - border-radius: 3px; - background: none; -} - -/* Loading */ -.ai-loading { - display: flex; - flex-direction: column; - align-items: center; - padding: 32px 16px; - gap: 12px; - text-align: center; -} - -.ai-loading p { - font-size: 13px; - color: var(--text-primary); - margin: 0; -} - -.ai-loading-hint { - font-size: 11px !important; - color: var(--text-muted) !important; -} - -.ai-loading-spinner { - width: 32px; - height: 32px; - border: 3px solid var(--border-color); - border-top-color: var(--accent-blue); - border-radius: 50%; - animation: spin 1s linear infinite; -} - -/* Error */ -.ai-error { - display: flex; - align-items: center; - gap: 8px; - padding: 10px 12px; - background: rgba(255, 78, 66, 0.1); - border: 1px solid rgba(255, 78, 66, 0.3); - border-radius: 6px; - font-size: 12px; -} - -.ai-error-icon { - font-size: 14px; - flex-shrink: 0; -} - -.ai-error-msg { - color: var(--accent-red); -} - -/* Results */ -.ai-results { - display: flex; - flex-direction: column; - gap: 16px; -} - -/* Summary */ -.ai-summary { - padding: 14px; - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; -} - -.ai-summary-header { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 8px; -} - -.ai-summary-header h3 { - font-size: 14px; - font-weight: 600; - margin: 0; -} - -.ai-summary-meta { - display: flex; - gap: 10px; - font-size: 10px; - color: var(--text-muted); - font-family: var(--font-mono); -} - -.ai-summary-text { - font-size: 12px; - color: var(--text-secondary); - line-height: 1.6; - margin: 0; -} - -/* Sections */ -.ai-section { - background: var(--bg-secondary); - border: 1px solid var(--border-color); - border-radius: 8px; - overflow: hidden; -} - -.ai-section-title { - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 14px; - font-size: 13px; - font-weight: 600; - margin: 0; - background: var(--bg-tertiary); - border-bottom: 1px solid var(--border-color); -} - -.ai-section-badges { - display: flex; - gap: 6px; -} - -.ai-badge { - font-size: 10px; - font-weight: 600; - padding: 2px 8px; - border-radius: 10px; - background: var(--bg-primary); - color: var(--text-muted); -} - -.ai-badge-critical { - background: rgba(255, 68, 68, 0.2); - color: #ff4444; -} - -.ai-badge-warning { - background: rgba(255, 170, 0, 0.2); - color: #ffaa00; -} - -/* Item Cards */ -.ai-items-list { - display: flex; - flex-direction: column; -} - -.ai-item-card { - padding: 10px 14px; - border-left: 3px solid transparent; - border-bottom: 1px solid var(--border-color); - cursor: pointer; - transition: background 0.15s; -} - -.ai-item-card:last-child { - border-bottom: none; -} - -.ai-item-card:hover { - background: var(--bg-hover) !important; -} - -.ai-item-header { - display: flex; - align-items: center; - gap: 8px; -} - -.ai-item-icon { - font-size: 12px; - flex-shrink: 0; -} - -.ai-item-title { - flex: 1; - font-size: 12px; - font-weight: 500; - color: var(--text-primary); -} - -.ai-item-severity { - font-size: 9px; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.5px; -} - -.ai-item-expand { - font-size: 9px; - color: var(--text-muted); - margin-left: 4px; -} - -.ai-item-body { - margin-top: 8px; - padding-top: 8px; - border-top: 1px solid var(--border-color); - font-size: 12px; - line-height: 1.6; -} - -.ai-item-desc { - color: var(--text-secondary); - margin: 0 0 6px 0; -} - -.ai-item-suggestion { - padding: 6px 8px; - background: rgba(12, 206, 107, 0.08); - border-radius: 4px; - font-size: 11px; - color: var(--text-secondary); - margin-bottom: 6px; -} - -.ai-item-suggestion strong { - color: var(--accent-green); - margin-right: 4px; -} - -.ai-item-components { - font-size: 11px; - color: var(--text-muted); -} - -.ai-item-components strong { - color: var(--text-secondary); - margin-right: 4px; -} - -/* Disclaimer */ -.ai-disclaimer { - padding: 10px 12px; - font-size: 11px; - color: var(--text-muted); - background: rgba(255, 164, 0, 0.06); - border: 1px solid rgba(255, 164, 0, 0.15); - border-radius: 6px; - text-align: center; -} - -/* ============================================ - Badge & Indicator System (Emoji Replacement) - ============================================ */ - -/* --- Indicator Dots (severity markers) --- */ -.indicator-dot { - display: inline-block; - width: 8px; - height: 8px; - border-radius: 50%; - flex-shrink: 0; - vertical-align: middle; -} -.indicator-dot--error { - background: var(--accent-red); -} -.indicator-dot--warning { - background: var(--accent-yellow); -} -.indicator-dot--info { - background: var(--accent-blue); -} -.indicator-dot--success { - background: var(--accent-green); -} -.indicator-dot--critical { - background: var(--accent-red); - box-shadow: 0 0 6px rgba(255, 78, 66, 0.5); -} - -/* --- Section Header Badges (tab/section labels) --- */ -.section-badge { - display: inline-block; - width: 4px; - height: 16px; - border-radius: 2px; - margin-right: 8px; - vertical-align: middle; -} -.section-badge--timeline { - background: var(--accent-blue); -} -.section-badge--ui-state { - background: var(--accent-purple); -} -.section-badge--performance { - background: var(--accent-yellow); -} -.section-badge--memory { - background: var(--accent-green); -} -.section-badge--side-effects { - background: var(--accent-blue); -} -.section-badge--cls { - background: var(--accent-yellow); -} -.section-badge--redux { - background: var(--accent-purple); -} -.section-badge--ai { - background: var(--accent-blue); -} -.section-badge--security { - background: var(--accent-green); -} - -/* --- Event Type Indicators (timeline events) --- */ -.event-type-indicator { - display: inline-block; - width: 8px; - height: 8px; - border-radius: 50%; - flex-shrink: 0; - vertical-align: middle; -} -.event-type-indicator--render { - background: var(--accent-blue); -} -.event-type-indicator--state { - background: #a855f7; -} -.event-type-indicator--effect { - background: var(--accent-yellow); -} -.event-type-indicator--error { - background: var(--accent-red); -} -.event-type-indicator--memory { - background: var(--accent-green); -} -.event-type-indicator--context { - background: #f97316; -} - -/* --- Status Badges (rating indicators) --- */ -.status-badge { - display: inline-block; - width: 10px; - height: 10px; - border-radius: 50%; - vertical-align: middle; - flex-shrink: 0; -} -.status-badge--good { - background: var(--accent-green); -} -.status-badge--warning { - background: var(--accent-yellow); -} -.status-badge--poor { - background: var(--accent-red); -} -.status-badge--neutral { - background: var(--text-muted); -} - -/* --- Action Badges (inline icon-like elements) --- */ -.action-badge { - display: inline-flex; - align-items: center; - justify-content: center; - width: 16px; - height: 16px; - border-radius: 4px; - margin-right: 4px; - vertical-align: middle; - flex-shrink: 0; -} -.action-badge::before { - content: ''; - display: block; -} -.action-badge--suggestion { - background: rgba(12, 206, 107, 0.15); -} -.action-badge--suggestion::before { - width: 8px; - height: 8px; - background: var(--accent-green); - border-radius: 50%; -} -.action-badge--learn { - background: rgba(0, 122, 204, 0.15); -} -.action-badge--learn::before { - width: 8px; - height: 6px; - background: var(--accent-blue); - border-radius: 1px; -} -.action-badge--search { - background: rgba(0, 122, 204, 0.15); -} -.action-badge--search::before { - width: 6px; - height: 6px; - border: 2px solid var(--accent-blue); - border-radius: 50%; - background: transparent; -} -.action-badge--settings { - background: rgba(140, 140, 140, 0.15); -} -.action-badge--settings::before { - width: 8px; - height: 8px; - border: 2px solid var(--text-secondary); - border-radius: 50%; - background: transparent; -} -.action-badge--scan { - background: rgba(0, 122, 204, 0.15); -} -.action-badge--scan::before { - width: 6px; - height: 6px; - border: 2px solid var(--accent-blue); - border-radius: 50%; - background: transparent; -} -.action-badge--analyze { - background: rgba(0, 122, 204, 0.15); -} -.action-badge--analyze::before { - width: 6px; - height: 6px; - border: 2px solid var(--accent-blue); - border-radius: 50%; - background: transparent; -} -.action-badge--cancel { - background: rgba(255, 78, 66, 0.15); -} -.action-badge--cancel::before { - width: 6px; - height: 6px; - background: var(--accent-red); - border-radius: 1px; -} -.action-badge--play { - background: rgba(12, 206, 107, 0.15); -} -.action-badge--play::before { - width: 0; - height: 0; - border-left: 6px solid var(--accent-green); - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - background: none; -} -.action-badge--stop { - background: rgba(255, 78, 66, 0.15); -} -.action-badge--stop::before { - width: 6px; - height: 6px; - background: var(--accent-red); - border-radius: 1px; -} -.action-badge--refresh { - background: rgba(0, 122, 204, 0.15); -} -.action-badge--refresh::before { - width: 6px; - height: 6px; - border: 2px solid var(--accent-blue); - border-radius: 50%; - border-bottom-color: transparent; - background: none; -} - -/* --- AI Status Icons --- */ -.ai-status-icon { - display: inline-block; - width: 12px; - height: 12px; - margin-right: 4px; - vertical-align: middle; - border-radius: 3px; -} -.ai-status-icon--chart { - background: rgba(0, 122, 204, 0.25); - border: 1px solid var(--accent-blue); -} -.ai-status-icon--cache { - background: rgba(12, 206, 107, 0.25); - border: 1px solid var(--accent-green); -} -.ai-status-icon--tokens { - background: rgba(255, 164, 0, 0.25); - border: 1px solid var(--accent-yellow); -} -.ai-status-icon--model { - background: rgba(157, 121, 215, 0.25); - border: 1px solid var(--accent-purple); -} - -/* --- Empty State Icons (large centered) --- */ -.empty-state-icon { - display: flex; - align-items: center; - justify-content: center; - width: 48px; - height: 48px; - border-radius: 50%; - margin: 0 auto 16px; -} -.empty-state-icon::before { - content: ''; - display: block; -} -.empty-state-icon--check { - background: rgba(12, 206, 107, 0.12); - border: 2px solid rgba(12, 206, 107, 0.4); -} -.empty-state-icon--check::before { - width: 14px; - height: 8px; - border-left: 2.5px solid var(--accent-green); - border-bottom: 2.5px solid var(--accent-green); - transform: rotate(-45deg) translateY(-2px); - background: none; -} -.empty-state-icon--chart { - background: rgba(0, 122, 204, 0.12); - border: 2px solid rgba(0, 122, 204, 0.4); -} -.empty-state-icon--chart::before { - width: 16px; - height: 16px; - border-left: 2.5px solid var(--accent-blue); - border-bottom: 2.5px solid var(--accent-blue); - background: none; -} -.empty-state-icon--timer { - background: rgba(0, 122, 204, 0.12); - border: 2px solid rgba(0, 122, 204, 0.4); -} -.empty-state-icon--timer::before { - width: 14px; - height: 14px; - border: 2.5px solid var(--accent-blue); - border-radius: 50%; - background: none; -} -.empty-state-icon--robot { - background: rgba(0, 122, 204, 0.12); - border: 2px solid rgba(0, 122, 204, 0.4); -} -.empty-state-icon--robot::before { - width: 16px; - height: 12px; - border: 2.5px solid var(--accent-blue); - border-radius: 4px; - background: none; -} -.empty-state-icon--redux { - background: rgba(157, 121, 215, 0.12); - border: 2px solid rgba(157, 121, 215, 0.4); -} -.empty-state-icon--redux::before { - width: 14px; - height: 12px; - border: 2.5px solid var(--accent-purple); - border-radius: 3px; - background: none; -} -.empty-state-icon--memory { - background: rgba(12, 206, 107, 0.12); - border: 2px solid rgba(12, 206, 107, 0.4); -} -.empty-state-icon--memory::before { - width: 14px; - height: 14px; - border: 2.5px solid var(--accent-green); - border-radius: 50%; - background: none; -} -.empty-state-icon--react { - background: rgba(0, 122, 204, 0.12); - border: 2px solid rgba(0, 122, 204, 0.4); -} -.empty-state-icon--react::before { - width: 10px; - height: 10px; - background: var(--accent-blue); - border-radius: 50%; -} - -/* --- Disclaimer Badge --- */ -.disclaimer-badge { - display: inline-flex; - align-items: center; - justify-content: center; - width: 16px; - height: 16px; - border-radius: 50%; - background: rgba(255, 164, 0, 0.15); - border: 1.5px solid var(--accent-yellow); - margin-right: 6px; - vertical-align: middle; - flex-shrink: 0; -} -.disclaimer-badge::before { - content: ''; - display: block; - width: 2px; - height: 8px; - background: var(--accent-yellow); - border-radius: 1px; -} From b720c8c2056442c7d0b91c96bcb4a99190a7959c Mon Sep 17 00:00:00 2001 From: Kunal Jaiswal <140198382+Kunall7890@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:30:16 +0530 Subject: [PATCH 3/3] fix: cross-platform binary resolution and timeout cleanup in benchmark --- scripts/bench-mcp-latency.mjs | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/scripts/bench-mcp-latency.mjs b/scripts/bench-mcp-latency.mjs index 9bdeec0..07dac15 100644 --- a/scripts/bench-mcp-latency.mjs +++ b/scripts/bench-mcp-latency.mjs @@ -1,11 +1,9 @@ // scripts/bench-mcp-latency.mjs // Cross-platform MCP tool latency benchmark // Usage: node scripts/bench-mcp-latency.mjs [--runs 50] - -import { spawn } from "node:child_process"; +import { spawn, execSync } from "node:child_process"; import { writeFileSync, mkdirSync } from "node:fs"; import { platform, release, version } from "node:os"; -import { execSync } from "node:child_process"; const RUNS = parseInt(process.argv[process.argv.indexOf("--runs") + 1] || "50"); @@ -42,7 +40,8 @@ function percentile(sorted, p) { // Resolve the CLI binary path once — avoids repeated npx resolution overhead function resolveBin() { try { - const lines = execSync("where react-debugger", { encoding: "utf8" }) + const cmd = platform() === "win32" ? "where" : "which"; + const lines = execSync(`${cmd} react-debugger`, { encoding: "utf8" }) .trim() .split("\n") .map(l => l.trim()); @@ -72,11 +71,23 @@ async function measureRound() { let stdout = ""; let responded = false; + // 15s timeout — generous for cold npx starts + const timer = setTimeout(() => { + if (!responded) { + responded = true; + child.kill("SIGTERM"); + reject(new Error("Timeout after 15000ms")); + } + }, 15000); + + const cleanup = () => clearTimeout(timer); + // Collect stdout — resolve as soon as ANY data comes back child.stdout.on("data", (chunk) => { stdout += chunk.toString(); if (!responded) { responded = true; + cleanup(); const elapsed = performance.now() - start; child.kill("SIGTERM"); resolve(elapsed); @@ -100,22 +111,20 @@ async function measureRound() { child.stdin.write(initMsg); child.on("error", (err) => { - if (!responded) reject(err); + if (!responded) { + responded = true; + cleanup(); + reject(err); + } }); child.on("close", (code) => { if (!responded) { + responded = true; + cleanup(); reject(new Error(`Process exited with code ${code} without responding`)); } }); - - // 15s timeout — generous for cold npx starts - setTimeout(() => { - if (!responded) { - child.kill("SIGTERM"); - reject(new Error("Timeout after 15000ms")); - } - }, 15000); }); }