js.foresight-devtools 1.4.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +10 -4
- package/dist/index.d.mts +612 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2194 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +64 -65
- package/dist/index.d.ts +0 -569
- package/dist/index.js +0 -2031
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/types/types.ts","../src/svg/svg-icons.ts","../src/lit-entry/control-panel/base-tab/chip.ts","../src/lit-entry/control-panel/base-tab/tab-content.ts","../src/lit-entry/control-panel/base-tab/tab-header.ts","../src/lit-entry/control-panel/dropdown/base-dropdown.ts","../src/lit-entry/control-panel/dropdown/single-select-dropdown.ts","../src/lit-entry/control-panel/copy-icon/copy-icon.ts","../src/lit-entry/control-panel/base-tab/expandable-item.ts","../src/lit-entry/control-panel/element-tab/reactivate-countdown.ts","../src/lit-entry/control-panel/element-tab/single-element.ts","../src/lit-entry/control-panel/element-tab/element-tab.ts","../src/lit-entry/control-panel/base-tab/tab-selector.ts","../src/lit-entry/control-panel/dropdown/multi-select-dropdown.ts","../src/helpers/safeSerializeEventData.ts","../src/lit-entry/control-panel/log-tab/log-store.ts","../src/lit-entry/control-panel/log-tab/single-log.ts","../src/lit-entry/control-panel/log-tab/log-tab.ts","../src/constants.ts","../src/lit-entry/control-panel/settings-tab/setting-item/setting-item.ts","../src/lit-entry/control-panel/settings-tab/setting-item/setting-item-checkbox.ts","../src/lit-entry/control-panel/settings-tab/setting-item/setting-item-range.ts","../src/lit-entry/control-panel/settings-tab/settings-tab.ts","../src/lit-entry/control-panel/control-panel.ts","../src/lit-entry/debug-overlay/element-overlays.ts","../src/lit-entry/debug-overlay/mouse-trajectory.ts","../src/lit-entry/debug-overlay/scroll-trajectory.ts","../src/lit-entry/debug-overlay/debug-overlay.ts","../src/lit-entry/foresight-devtools.ts"],"sourcesContent":["import type { HitSlop, ForesightEvent } from \"js.foresight\"\n\nexport type Corner = \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\"\n\nexport type DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\nexport type ShowSettings = {\n /**\n * Show the debugger control panel.\n * @default true\n */\n controlPanel: boolean\n /**\n * Show name tags above each registered element.\n * @default true\n */\n nameTags: boolean\n /**\n * Show element hit-slop overlays (the expanded boundary around each registered element).\n *\n * Note: turning this off also hides name tags, since the labels live inside\n * the same overlay host.\n *\n * @default true\n */\n elementOverlays: boolean\n /**\n * Show the predicted mouse trajectory line.\n * @default true\n */\n mouseTrajectory: boolean\n /**\n * Show the predicted scroll trajectory line.\n * @default true\n */\n scrollTrajectory: boolean\n}\n\nexport type ShowKey = keyof ShowSettings\n\nexport const SHOW_KEYS = [\n \"controlPanel\",\n \"nameTags\",\n \"elementOverlays\",\n \"mouseTrajectory\",\n \"scrollTrajectory\",\n] as const satisfies readonly ShowKey[]\n\nexport type DevtoolsSettings = {\n /**\n * Granular visibility flags for the devtools UI.\n *\n * @link https://foresightjs.com/docs/getting_started/debug\n */\n show: ShowSettings\n\n /**\n * Determines if the debugger control panel should be initialized in a minimized state.\n *\n * @link https://foresightjs.com/docs/getting_started/debug\n *\n * @default false\n */\n isControlPanelDefaultMinimized: boolean\n /**\n * Specifies the default sorting order for the list of registered elements in the debugger panel.\n * - `'visibility'`: Sorts elements by their viewport visibility (visible elements first),\n * with a secondary documentOrder sort.\n * - `'documentOrder'`: Sorts elements based on their order of appearance in the\n * document's structure (matching the HTML source).\n * - `'insertionOrder'`: Sorts by registration order.\n *\n *\n * @link https://foresightjs.com/docs/getting_started/debug\n *\n * @default 'visibility'\n *\n */\n sortElementList: SortElementList\n\n logging: LogEvents & {\n logLocation: LoggingLocations\n }\n}\n\nexport type LogEvents = {\n [K in ForesightEvent]: boolean\n}\n\nexport type LoggingLocations = \"controlPanel\" | \"console\" | \"both\" | \"none\"\n\nexport type ControllerTabs = \"settings\" | \"elements\" | \"logs\"\n\nexport type SortElementList = \"documentOrder\" | \"visibility\" | \"insertionOrder\"\n\nexport type ForesightDevtoolsData = {\n settings: Readonly<DevtoolsSettings>\n}\n\nexport type DebuggerBooleanSettingKeys = ShowKey\n\nexport type ElementOverlays = {\n expandedOverlay: HTMLElement\n nameLabel: HTMLElement\n}\n\nexport type callbackAnimation = {\n hitSlop: Exclude<HitSlop, number>\n overlay: HTMLElement\n timeoutId: ReturnType<typeof setTimeout>\n}\n\nexport type SectionStates = {\n mouse: boolean\n keyboard: boolean\n scroll: boolean\n general: boolean\n}\n","import { html } from \"lit\"\n\nexport const CONTROL_PANEL_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"2\" y=\"2\" width=\"20\" height=\"15\" rx=\"2\" ry=\"2\"></rect>\n <line x1=\"2\" y1=\"17\" x2=\"22\" y2=\"17\"></line>\n <line x1=\"7\" y1=\"21\" x2=\"17\" y2=\"21\"></line>\n <line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line>\n </svg>\n`\n\nexport const CONSOLE_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"4 17 10 11 4 5\"></polyline>\n <line x1=\"12\" y1=\"19\" x2=\"20\" y2=\"19\"></line>\n </svg>\n`\n\nexport const NONE_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9\"></path>\n <path d=\"M13.73 21a2 2 0 0 1-3.46 0\"></path>\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\"></line>\n </svg>\n`\n\nexport const BOTH_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M12 2v8\" />\n <path d=\"M12 10l-6 6\" />\n <path d=\"M12 10l6 6\" />\n <circle cx=\"6\" cy=\"18\" r=\"2\" />\n <circle cx=\"18\" cy=\"18\" r=\"2\" />\n </svg>\n`\n\n// Keep the existing SVGs that were not requested to be changed\nexport const VISIBILITY_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n`\nexport const DOCUMENT_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z\" />\n <polyline points=\"14 2 14 8 20 8\" />\n <line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\" />\n <line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\" />\n <line x1=\"10\" y1=\"9\" x2=\"8\" y2=\"9\" />\n </svg>\n`\n\nexport const INSERTION_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01\" />\n </svg>\n`\n\nexport const FILTER_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polygon points=\"22,3 2,3 10,12.46 10,19 14,21 14,12.46\" />\n </svg>\n`\n\nexport const CLEAR_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"4.93\" y1=\"4.93\" x2=\"19.07\" y2=\"19.07\" />\n </svg>\n`\n\nexport const COPY_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"></path>\n </svg>\n`\n\nexport const TICK_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\"></polyline>\n </svg>\n`\n\nexport const WARNING_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"\n ></path>\n <line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line>\n <line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line>\n </svg>\n`\n\n// Alternative: State machine style icon\nexport const STATE_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"6\" cy=\"12\" r=\"3\"></circle>\n <circle cx=\"18\" cy=\"12\" r=\"3\"></circle>\n <path d=\"M9 12h6\"></path>\n <path d=\"M15 9l3 3-3 3\"></path>\n <circle cx=\"12\" cy=\"6\" r=\"2\"></circle>\n <circle cx=\"12\" cy=\"18\" r=\"2\"></circle>\n <path d=\"M10 8l2-2 2 2\"></path>\n <path d=\"M14 16l-2 2-2-2\"></path>\n </svg>\n`\n\nexport const UNREGISTER_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"3 6 5 6 21 6\"></polyline>\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"></path>\n <line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\"></line>\n <line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\"></line>\n </svg>\n`\n\nexport const TOUCH_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M18 8a6 6 0 0 0-12 0c0 2 3 4 6 6 3-2 6-4 6-6z\" />\n <circle cx=\"12\" cy=\"8\" r=\"3\" />\n </svg>\n`\n\nexport const VIEWPORT_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\" />\n <line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\" />\n <circle cx=\"12\" cy=\"10\" r=\"2\" />\n </svg>\n`\n\nexport const DISABLED_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"4.93\" y1=\"4.93\" x2=\"19.07\" y2=\"19.07\" />\n </svg>\n`\n\nexport const ENABLE_SVG = html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M18.36 6.64a9 9 0 1 1-12.73 0\" />\n <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"12\" />\n </svg>\n`\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n@customElement(\"chip-element\")\nexport class ChipElement extends LitElement {\n static styles = [\n css`\n :host {\n display: inline-block;\n }\n\n .chip {\n display: inline-flex;\n align-items: center;\n padding: 3px 8px;\n background-color: rgba(255, 255, 255, 0.05);\n color: #e8e8e8;\n font-size: 10px;\n font-weight: 500;\n white-space: nowrap;\n border: 1px solid rgba(255, 255, 255, 0.1);\n font-family: \"SF Mono\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace;\n letter-spacing: 0.02em;\n line-height: 1.2;\n transition: all 0.2s ease;\n }\n `,\n ]\n\n @property({ type: String }) title: string = \"\"\n\n render() {\n return html`\n <span class=\"chip\" title=\"${this.title}\">\n <slot></slot>\n </span>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"chip-element\": ChipElement\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n@customElement(\"tab-content\")\nexport class TabContent extends LitElement {\n static styles = [\n css`\n :host {\n overflow: hidden;\n }\n\n .content-container::-webkit-scrollbar {\n width: 8px;\n }\n\n .content-container::-webkit-scrollbar-track {\n background: rgba(30, 30, 30, 0.5);\n }\n\n .content-container::-webkit-scrollbar-thumb {\n background-color: rgba(176, 196, 222, 0.5);\n border: 2px solid rgba(0, 0, 0, 0.2);\n }\n\n .content-container::-webkit-scrollbar-thumb:hover {\n background-color: rgba(176, 196, 222, 0.7);\n }\n\n .content-container {\n scrollbar-gutter: stable;\n height: 100%;\n min-height: 150px;\n overflow-y: auto;\n scrollbar-width: thin;\n scrollbar-color: rgba(176, 196, 222, 0.5) rgba(30, 30, 30, 0.5);\n }\n\n .no-content-message {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n color: #afafaf;\n font-style: italic;\n font-family: \"Courier New\", monospace;\n }\n `,\n ]\n\n @property({ type: String, attribute: \"no-content-message\" })\n noContentMessage: string = \"No content available.\"\n\n @property({ type: Boolean })\n hasContent: boolean = true\n\n render() {\n return html`\n <div class=\"content-container\">\n ${this.hasContent\n ? html`<slot></slot>`\n : html`<div class=\"no-content-message\">${this.noContentMessage}</div>`}\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"tab-content\": TabContent\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\n\n@customElement(\"tab-header\")\nexport class TabHeader extends LitElement {\n static styles = [\n css`\n :host {\n }\n .tab-bar-info {\n display: flex;\n gap: 12px;\n align-items: center;\n flex: 1;\n }\n\n .stats-chips {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n\n .chip {\n font-size: 11px;\n font-weight: 500;\n padding: 4px 8px;\n border: 1px solid #555;\n white-space: nowrap;\n letter-spacing: 0.3px;\n background: rgba(40, 40, 40, 0.7);\n color: #b0c4de;\n }\n\n .tab-bar-actions {\n display: flex;\n gap: 6px;\n align-items: center;\n position: relative;\n flex-direction: row;\n }\n .tab-bar-elements {\n display: flex;\n justify-content: space-between;\n padding: 4px 0 4px 0;\n border-bottom: 1px solid #444;\n position: sticky;\n top: 0;\n z-index: 5;\n min-height: 36px;\n }\n `,\n ]\n\n render() {\n return html`\n <div class=\"tab-bar-elements\">\n <div class=\"tab-bar-info\">\n <div class=\"stats-chips\">\n <slot name=\"chips\"></slot>\n </div>\n </div>\n <div class=\"tab-bar-actions\">\n <slot name=\"actions\"></slot>\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"tab-header\": TabHeader\n }\n}\n","import { LitElement, html, css, type TemplateResult } from \"lit\"\nimport { property, state } from \"lit/decorators.js\"\n\nexport type DropdownOption = {\n value: string\n label: string\n title: string\n icon: TemplateResult\n}\n\nexport abstract class BaseDropdown extends LitElement {\n private static currentlyOpen: BaseDropdown | null = null\n\n static styles = [\n css`\n :host {\n display: inline-block;\n }\n\n .dropdown-container {\n position: relative;\n display: inline-block;\n }\n\n .trigger-button {\n background: none;\n border: none;\n color: white;\n cursor: pointer;\n padding: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n transition: all 0.2s ease;\n }\n\n .trigger-button svg {\n width: 16px;\n height: 16px;\n stroke: white;\n transition: stroke 0.2s;\n }\n\n .trigger-button .arrow-icon {\n width: 10px;\n height: 10px;\n stroke: white;\n fill: none;\n stroke-width: 2;\n transition:\n transform 0.2s ease,\n stroke 0.2s;\n }\n\n .trigger-button:hover {\n background-color: rgba(176, 196, 222, 0.1);\n }\n\n .trigger-button:hover svg,\n .trigger-button:hover .arrow-icon {\n stroke: #b0c4de;\n }\n\n .trigger-button.active {\n background-color: rgba(176, 196, 222, 0.2);\n }\n\n .trigger-button.active svg {\n stroke: #b0c4de;\n }\n\n .trigger-button.active .arrow-icon {\n transform: rotate(180deg);\n stroke: #b0c4de;\n }\n\n .dropdown-menu {\n position: fixed;\n z-index: 9999;\n display: none;\n flex-direction: column;\n background-color: #3a3a3a;\n border: 1px solid #555;\n min-width: 200px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);\n overflow: hidden;\n }\n\n .dropdown-menu.active {\n display: flex;\n }\n\n .dropdown-menu button {\n background: none;\n border: none;\n color: #ccc;\n font-size: 12px;\n text-align: left;\n padding: 8px 12px;\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-menu button:hover {\n background-color: #555;\n color: white;\n }\n\n .dropdown-menu button.active {\n color: #b0c4de;\n font-weight: bold;\n background-color: rgba(176, 196, 222, 0.1);\n }\n\n .dropdown-menu button.active::after {\n content: \"✓\";\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n color: #b0c4de;\n font-weight: bold;\n }\n `,\n ]\n\n @state() protected isDropdownOpen: boolean = false\n @property({ type: Array }) dropdownOptions: DropdownOption[] = []\n\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener(\"click\", this._handleOutsideClick)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener(\"click\", this._handleOutsideClick)\n if (BaseDropdown.currentlyOpen === this) {\n BaseDropdown.currentlyOpen = null\n }\n }\n\n protected _toggleDropdown = (event: MouseEvent) => {\n event.stopPropagation()\n\n if (this.isDropdownOpen) {\n this._closeDropdown()\n } else {\n if (BaseDropdown.currentlyOpen && BaseDropdown.currentlyOpen !== this) {\n BaseDropdown.currentlyOpen._closeDropdown()\n }\n\n this.isDropdownOpen = true\n BaseDropdown.currentlyOpen = this\n\n this._positionDropdown()\n }\n }\n\n protected _closeDropdown(): void {\n this.isDropdownOpen = false\n if (BaseDropdown.currentlyOpen === this) {\n BaseDropdown.currentlyOpen = null\n }\n }\n\n protected _positionDropdown() {\n if (typeof window === \"undefined\") {\n return\n }\n\n const triggerButton = this.shadowRoot?.querySelector(\".trigger-button\") as HTMLElement\n const dropdownMenu = this.shadowRoot?.querySelector(\".dropdown-menu\") as HTMLElement\n\n if (triggerButton && dropdownMenu) {\n const rect = triggerButton.getBoundingClientRect()\n const dropdownHeight = dropdownMenu.offsetHeight || 200\n\n const top = rect.bottom + 5\n const right = window.innerWidth - rect.right\n\n const availableSpaceBelow = window.innerHeight - rect.bottom\n const shouldPositionAbove = availableSpaceBelow < dropdownHeight && rect.top > dropdownHeight\n\n if (shouldPositionAbove) {\n dropdownMenu.style.top = `${rect.top - dropdownHeight - 5}px`\n } else {\n dropdownMenu.style.top = `${top}px`\n }\n\n dropdownMenu.style.right = `${right}px`\n }\n }\n\n protected _handleOutsideClick = (event: MouseEvent) => {\n if (this.isDropdownOpen) {\n if (!event.composedPath().includes(this)) {\n this._closeDropdown()\n }\n }\n }\n\n protected abstract _handleOptionClick(option: DropdownOption): void\n protected abstract _getTriggerIcon(): TemplateResult\n protected abstract _isOptionSelected(option: DropdownOption): boolean\n protected abstract _getTriggerTitle(): string\n protected abstract _getTriggerLabel(): string\n\n render() {\n const buttonClass = `trigger-button ${this.isDropdownOpen ? \"active\" : \"\"}`\n const menuClass = `dropdown-menu ${this.isDropdownOpen ? \"active\" : \"\"}`\n\n return html`\n <div class=\"dropdown-container\">\n <button\n class=\"${buttonClass}\"\n title=\"${this._getTriggerTitle()}\"\n @click=\"${this._toggleDropdown}\"\n aria-haspopup=\"true\"\n aria-expanded=\"${this.isDropdownOpen}\"\n aria-controls=\"dropdown-menu\"\n aria-label=\"${this._getTriggerLabel()}\"\n >\n ${this._getTriggerIcon()}\n <svg\n class=\"arrow-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"6 9 12 15 18 9\"></polyline>\n </svg>\n </button>\n\n <div class=\"${menuClass}\" id=\"dropdown-menu\" role=\"menu\">\n ${this.dropdownOptions.map(\n option => html`\n <button\n value=\"${option.value}\"\n title=\"${option.title}\"\n class=\"${this._isOptionSelected(option) ? \"active\" : \"\"}\"\n @click=\"${() => this._handleOptionClick(option)}\"\n role=\"menuitem\"\n >\n ${option.label}\n </button>\n `\n )}\n </div>\n </div>\n `\n }\n}\n","import { html, type TemplateResult } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { BaseDropdown, type DropdownOption } from \"./base-dropdown\"\n\nexport type { DropdownOption } from \"./base-dropdown\"\n\n@customElement(\"single-select-dropdown\")\nexport class SingleSelectDropdown extends BaseDropdown {\n @property({ type: String }) selectedOptionValue: string = \"\"\n @property({ type: Function }) onSelectionChange?: (value: string) => void\n\n connectedCallback() {\n super.connectedCallback()\n if (this.dropdownOptions.length > 0 && !this.selectedOptionValue) {\n this.selectedOptionValue = this.dropdownOptions[0].value\n }\n }\n\n willUpdate(changedProperties: Map<PropertyKey, unknown>) {\n if (\n changedProperties.has(\"dropdownOptions\") &&\n this.dropdownOptions.length > 0 &&\n !this.selectedOptionValue\n ) {\n this.selectedOptionValue = this.dropdownOptions[0].value\n }\n }\n\n protected _handleOptionClick(option: DropdownOption): void {\n if (option.value !== this.selectedOptionValue) {\n this.selectedOptionValue = option.value\n this.onSelectionChange?.(option.value)\n }\n\n this._closeDropdown()\n }\n\n protected _getTriggerIcon(): TemplateResult {\n const selectedOption = this._getSelectedOption()\n\n return selectedOption ? selectedOption.icon : html``\n }\n\n protected _isOptionSelected(option: DropdownOption): boolean {\n return option.value === this.selectedOptionValue\n }\n\n protected _getTriggerTitle(): string {\n const selected = this._getSelectedOption()\n\n return selected ? selected.title : \"Change selection\"\n }\n\n protected _getTriggerLabel(): string {\n const selected = this._getSelectedOption()\n\n return selected ? `Current selection: ${selected.label}` : \"No selection\"\n }\n\n private _getSelectedOption(): DropdownOption | undefined {\n return this.dropdownOptions.find(option => option.value === this.selectedOptionValue)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"single-select-dropdown\": SingleSelectDropdown\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\nimport { COPY_SVG, TICK_SVG } from \"../../../svg/svg-icons\"\n\n@customElement(\"copy-icon\")\nexport class CopyIcon extends LitElement {\n static styles = css`\n .copy-button {\n background: transparent;\n border: 0px;\n cursor: pointer;\n padding: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.6;\n transition:\n opacity 0.2s ease,\n background-color 0.2s ease;\n }\n\n :host([positioned]) .copy-button {\n position: absolute;\n top: 10px;\n right: 1px;\n }\n\n .copy-button:hover {\n background-color: rgba(176, 196, 222, 0.1);\n }\n\n .copy-button:hover svg {\n stroke: #b0c4de;\n }\n\n .copy-button svg {\n width: 14px;\n height: 14px;\n stroke: #ddd;\n stroke-width: 2.5;\n }\n\n .copy-button.copied svg {\n stroke: #4caf50;\n }\n `\n\n @property({ type: String }) title: string = \"Copy to clipboard\"\n @property({ type: Function }) onCopy?: (event: MouseEvent) => Promise<void> | void\n\n @state() private isCopied: boolean = false\n @state() private copyTimeout: ReturnType<typeof setTimeout> | null = null\n\n private async handleClick(event: MouseEvent): Promise<void> {\n if (this.isCopied) {\n return\n }\n\n if (this.onCopy) {\n try {\n await this.onCopy(event)\n } catch (error) {\n console.error(\"Error in onCopy function:\", error)\n }\n }\n\n this.isCopied = true\n\n if (this.copyTimeout) {\n clearTimeout(this.copyTimeout)\n }\n\n this.copyTimeout = setTimeout(() => {\n this.isCopied = false\n this.copyTimeout = null\n }, 2000)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n if (this.copyTimeout) {\n clearTimeout(this.copyTimeout)\n this.copyTimeout = null\n }\n }\n\n render() {\n return html`\n <button\n class=\"copy-button ${this.isCopied ? \"copied\" : \"\"}\"\n title=\"${this.title}\"\n @click=${this.handleClick}\n >\n ${this.isCopied ? TICK_SVG : COPY_SVG}\n </button>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"copy-icon\": CopyIcon\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport \"../copy-icon/copy-icon\"\n\n@customElement(\"expandable-item\")\nexport class ExpandableItem extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n .item-entry {\n margin-bottom: 2px;\n font-size: 11px;\n line-height: 1.3;\n overflow: hidden;\n transition: all 0.2s ease;\n border-left: 2px solid var(--border-color, #555);\n padding-left: 6px;\n }\n\n .item-entry:hover:not(.expanded) {\n background-color: rgba(255, 255, 255, 0.02);\n }\n\n .item-entry.expanded {\n background-color: rgba(255, 255, 255, 0.03);\n }\n\n .item-header {\n display: flex;\n align-items: center;\n padding: 3px 4px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n gap: 8px;\n min-height: 20px;\n }\n\n .item-header:hover:not(.expanded) {\n background-color: rgba(255, 255, 255, 0.03);\n }\n\n .item-details {\n position: relative;\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n }\n\n .item-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n user-select: none;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .item-toggle:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .item-toggle svg {\n width: 14px;\n height: 14px;\n fill: none;\n stroke: #b0c4de;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n transition: all 0.2s ease;\n }\n\n .item-toggle:hover svg {\n stroke: #d4e4f4;\n }\n\n .item-toggle.expanded svg {\n transform: rotate(90deg);\n }\n\n .item-content {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n overflow: hidden;\n }\n\n .item-data {\n color: #e0e0e0;\n white-space: pre;\n font-size: 11px;\n margin: 0;\n padding: 0;\n font-family: \"Courier New\", monospace;\n line-height: 1.3;\n display: block;\n overflow-x: auto;\n }\n `,\n ]\n\n @property() borderColor: string = \"#555\"\n @property() showCopyButton: boolean = false\n @property() itemId: string = \"\"\n @property() isExpanded: boolean = false\n @property() onToggle: ((itemId: string) => void) | undefined\n\n private toggleExpand(): void {\n if (this.onToggle) {\n this.onToggle(this.itemId)\n }\n }\n\n private async handleCopy(event: MouseEvent): Promise<void> {\n event.stopPropagation()\n const detailsSlot = this.shadowRoot?.querySelector('slot[name=\"details\"]') as HTMLSlotElement\n if (detailsSlot) {\n const assignedNodes = detailsSlot.assignedNodes()\n const textContent = assignedNodes.map(node => node.textContent).join(\"\")\n try {\n await navigator.clipboard.writeText(textContent)\n } catch (err) {\n console.error(\"Failed to copy text: \", err)\n }\n }\n }\n\n render() {\n this.style.setProperty(\"--border-color\", this.borderColor)\n\n return html`\n <div class=\"item-entry ${this.isExpanded ? \"expanded\" : \"\"}\">\n <div class=\"item-header ${this.isExpanded ? \"expanded\" : \"\"}\" @click=\"${this.toggleExpand}\">\n <div class=\"item-content\">\n <slot name=\"content\"></slot>\n </div>\n <span class=\"item-toggle ${this.isExpanded ? \"expanded\" : \"\"}\">\n <svg viewBox=\"0 0 24 24\">\n <polyline points=\"9,18 15,12 9,6\"></polyline>\n </svg>\n </span>\n </div>\n ${this.isExpanded\n ? html`\n <div class=\"item-details\">\n <copy-icon\n positioned\n title=\"Copy Details\"\n .onCopy=${(event: MouseEvent) => this.handleCopy(event)}\n ></copy-icon>\n <pre class=\"item-data\">\n <slot name=\"details\"></slot>\n </pre>\n </div>\n `\n : \"\"}\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"expandable-item\": ExpandableItem\n }\n}\n","import { ForesightManager, type ForesightElement, type ForesightElementState } from \"js.foresight\"\nimport { LitElement, css, html } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\n\n@customElement(\"reactivate-countdown\")\nexport class ReactivateCountdown extends LitElement {\n static styles = [\n css`\n :host {\n display: inline-block;\n }\n\n .reactivate-button {\n all: unset;\n cursor: pointer;\n padding: 2px 4px;\n transition: background-color 0.2s ease;\n }\n\n .reactivate-button:hover {\n background-color: rgba(255, 165, 0, 0.1);\n }\n\n .countdown-time {\n color: #ffa726;\n font-weight: 500;\n font-size: 10px;\n }\n\n .countdown-time.infinity {\n font-size: 12px;\n font-weight: 600;\n }\n\n .countdown-time.clickable {\n cursor: pointer;\n }\n `,\n ]\n\n @property({ attribute: false }) element!: ForesightElement\n @property({ attribute: false }) state!: ForesightElementState\n @state()\n private remainingTime: number = 0\n\n @state()\n private isCountdownActive: boolean = false\n\n private intervalId: number | null = null\n private startTime: number = 0\n private lastDisplayedTime: string = \"\"\n private countdownForElement: ForesightElement | null = null\n private countdownReactivateAfter: number = 0\n\n connectedCallback() {\n super.connectedCallback()\n this.checkAndStartCountdown()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.clearCountdown()\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties)\n if (changedProperties.has(\"state\")) {\n this.checkAndStartCountdown()\n }\n }\n\n private checkAndStartCountdown() {\n const state = this.state\n\n if (!state) {\n this.clearCountdown()\n\n return\n }\n\n // Show countdown when:\n // 1. Callback is inactive (not currently active)\n // 2. Callback has completed at least once (has a status)\n // 3. reactivateAfter is not 0 (otherwise instant reactivation)\n const hasCallbackHistory = state.status !== undefined\n const shouldShowCountdown = !state.isActive && hasCallbackHistory && state.reactivateAfter > 0\n\n if (shouldShowCountdown) {\n this.startCountdown()\n } else {\n this.clearCountdown()\n }\n }\n\n private startCountdown() {\n // Don't restart if already counting down for the same element with the same duration\n if (\n this.isCountdownActive &&\n this.countdownForElement === this.element &&\n this.countdownReactivateAfter === this.state.reactivateAfter\n ) {\n return\n }\n\n this.clearCountdown()\n\n const state = this.state\n if (!state) {\n return\n }\n\n this.countdownForElement = this.element\n this.countdownReactivateAfter = state.reactivateAfter\n this.isCountdownActive = true\n\n if (state.reactivateAfter === Infinity) {\n this.remainingTime = Infinity\n\n return\n }\n\n const reactivateAfter = state.reactivateAfter\n\n // Use the current time as the anchor; the countdown is (re)started each\n // time the state transitions to inactive, which happens right after the\n // callback completes.\n this.startTime = Date.now()\n\n const updateCountdown = () => {\n const elapsed = Date.now() - this.startTime\n const remaining = Math.max(0, reactivateAfter - elapsed)\n const formatted = this.formatTime(remaining)\n\n if (formatted !== this.lastDisplayedTime) {\n this.lastDisplayedTime = formatted\n this.remainingTime = remaining\n this.requestUpdate()\n }\n\n if (remaining <= 0 || this.state.isActive) {\n this.clearCountdown()\n }\n }\n\n updateCountdown()\n\n if (this.remainingTime > 0 && typeof window !== \"undefined\") {\n this.intervalId = window.setInterval(updateCountdown, 100)\n }\n }\n\n private clearCountdown() {\n if (this.intervalId !== null) {\n clearInterval(this.intervalId)\n this.intervalId = null\n }\n\n this.isCountdownActive = false\n this.remainingTime = 0\n this.lastDisplayedTime = \"\"\n this.countdownForElement = null\n this.countdownReactivateAfter = 0\n }\n\n private handleTimerClick = (e: MouseEvent) => {\n e.stopPropagation()\n ForesightManager.instance.reactivate(this.element)\n }\n\n private formatTime(ms: number): string {\n if (ms === Infinity) {\n return \"∞\"\n }\n\n const totalSeconds = Math.ceil(ms / 1000)\n\n if (totalSeconds < 60) {\n return `${totalSeconds}s`\n }\n\n const minutes = Math.floor(totalSeconds / 60)\n const seconds = totalSeconds % 60\n\n if (minutes < 60) {\n return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`\n }\n\n const hours = Math.floor(minutes / 60)\n const remainingMinutes = minutes % 60\n\n if (remainingMinutes > 0) {\n return `${hours}h ${remainingMinutes}m`\n }\n\n return `${hours}h`\n }\n\n render() {\n if (!this.isCountdownActive) {\n return html``\n }\n\n if (this.remainingTime === Infinity) {\n return html`\n <button\n class=\"reactivate-button\"\n @click=\"${this.handleTimerClick}\"\n title=\"Click to reactivate manually\"\n >\n <span class=\"countdown-time infinity\">∞</span>\n </button>\n `\n }\n\n if (this.remainingTime <= 0) {\n return html``\n }\n\n return html`\n <button\n class=\"reactivate-button\"\n @click=\"${this.handleTimerClick}\"\n title=\"Click to reactivate immediately\"\n >\n <span class=\"countdown-time clickable\">${this.formatTime(this.remainingTime)}</span>\n </button>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"reactivate-countdown\": ReactivateCountdown\n }\n}\n","import type {\n DeviceStrategyChangedEvent,\n ForesightElement,\n ForesightElementState,\n} from \"js.foresight\"\nimport { LitElement, html, css } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\nimport \"../base-tab/expandable-item\"\nimport \"./reactivate-countdown\"\nimport { ForesightManager } from \"js.foresight\"\nimport { DISABLED_SVG, ENABLE_SVG, UNREGISTER_SVG } from \"../../../svg/svg-icons\"\n@customElement(\"single-element\")\nexport class SingleElement extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n .element-wrapper {\n display: block;\n }\n\n .element-content {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n min-width: 0;\n }\n\n .status-indicator {\n margin-left: 2px;\n width: 8px;\n height: 8px;\n flex-shrink: 0;\n transition: all 0.3s ease;\n }\n\n .status-indicator.visible {\n background-color: #4caf50;\n box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);\n }\n\n .status-indicator.hidden {\n background-color: #666;\n box-shadow: 0 0 0 2px rgba(102, 102, 102, 0.2);\n }\n\n .status-indicator.prefetching {\n background-color: #ffeb3b;\n box-shadow: 0 0 0 2px rgba(255, 235, 59, 0.4);\n }\n\n .status-indicator.inactive {\n background-color: #999;\n box-shadow: 0 0 0 2px rgba(153, 153, 153, 0.3);\n }\n\n .reason-tags {\n display: inline-flex;\n align-items: baseline;\n gap: 7px;\n flex-shrink: 0;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 10px;\n }\n\n .reason-tag {\n white-space: nowrap;\n color: color-mix(in srgb, var(--reason-color) 80%, #fff);\n }\n\n .reason-tag::before {\n content: \"/\";\n margin-right: 3px;\n color: #555;\n }\n\n .status-indicator.touch-device {\n background-color: #ba68c8;\n box-shadow: 0 0 0 2px rgba(186, 104, 200, 0.4);\n }\n\n .unregister-button,\n .toggle-enabled-button,\n .enable-button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n padding: 1px;\n cursor: pointer;\n color: #999;\n }\n\n .unregister-button svg,\n .toggle-enabled-button svg,\n .enable-button svg {\n width: 12px;\n height: 12px;\n }\n\n .unregister-button:hover {\n background-color: rgba(255, 107, 107, 0.1);\n color: #ff6b6b;\n }\n\n .toggle-enabled-button:hover {\n background-color: rgba(255, 165, 0, 0.1);\n color: #ffa726;\n }\n\n .enable-button:hover {\n background-color: rgba(76, 175, 80, 0.1);\n color: #4caf50;\n }\n\n .element-name {\n flex-grow: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 11px;\n font-weight: 500;\n color: #e8e8e8;\n }\n\n .element-name.callback-active {\n color: #fff;\n font-weight: 600;\n }\n\n .element-name.callback-inactive {\n color: #999;\n font-weight: 500;\n }\n\n .reactivate-countdown {\n font-size: 14px;\n color: #ffa726;\n font-weight: 500;\n min-width: 0;\n white-space: nowrap;\n }\n\n .reactivate-countdown:empty {\n display: none;\n }\n\n :host(.not-visible) {\n opacity: 0.5;\n }\n\n .element-wrapper.not-visible {\n opacity: 0.5;\n }\n `,\n ]\n\n @property({ attribute: false }) element!: ForesightElement\n @property({ attribute: false }) state!: ForesightElementState\n @property() isExpanded: boolean = false\n @property() onToggle: ((elementId: string) => void) | undefined\n\n @state() private currentDeviceStrategy: string = \"mouse\"\n private _abortController: AbortController | null = null\n connectedCallback() {\n super.connectedCallback()\n this._abortController = new AbortController()\n const { signal } = this._abortController\n\n // Initialize current device strategy\n this.currentDeviceStrategy = ForesightManager.instance.getManagerData.currentDeviceStrategy\n\n // Listen for device strategy changes\n ForesightManager.instance.addEventListener(\n \"deviceStrategyChanged\",\n (e: DeviceStrategyChangedEvent) => {\n this.currentDeviceStrategy = e.newStrategy\n },\n { signal }\n )\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._abortController?.abort()\n this._abortController = null\n }\n\n private getInactiveReasons(): { label: string; color: string; description: string }[] {\n const reasons: { label: string; color: string; description: string }[] = []\n\n if (!this.state.isEnabled) {\n reasons.push({\n label: \"disabled\",\n color: \"#9e9e9e\",\n description: \"Element is disabled, so its callback won't run until you re-enable it.\",\n })\n }\n\n if (this.state.isParked) {\n reasons.push({\n label: \"parked\",\n color: \"#7986cb\",\n description:\n \"Element is detached from the DOM and parked: kept registered but inactive until it reconnects.\",\n })\n }\n\n if (this.state.isLimitedConnection) {\n reasons.push({\n label: \"limited\",\n color: \"#ffb74d\",\n description:\n \"Element is on a limited connection (e.g. Save-Data or slow network), so prediction is paused.\",\n })\n }\n\n // Already fired its callback; stays inactive until reactivated, which by\n // default (`reactivateAfter: Infinity`) never happens.\n if (\n this.state.isEnabled &&\n !this.state.isParked &&\n !this.state.isLimitedConnection &&\n !this.state.isActive &&\n this.state.isPredicted\n ) {\n reasons.push({\n label: \"fired\",\n color: \"#4dd0e1\",\n description:\n \"Callback already fired. Stays inactive until reactivated (never, unless reactivateAfter is set).\",\n })\n }\n\n return reasons\n }\n\n private getBorderColor(): string {\n if (this.state.isCallbackRunning) {\n return \"#ffeb3b\"\n }\n\n if (!this.state.isActive) {\n return \"#999\"\n }\n\n // Use purple for touch devices when active (no opacity variation)\n if (this.currentDeviceStrategy === \"touch\") {\n return \"#ba68c8\"\n }\n\n // Use green for desktop devices when active\n return this.state.isIntersectingWithViewport ? \"#4caf50\" : \"#666\"\n }\n\n private getStatusIndicatorClass(): string {\n if (this.state.isCallbackRunning) {\n return \"prefetching\"\n }\n\n if (!this.state.isActive) {\n return \"inactive\"\n }\n\n // Use purple indicator for touch devices (no visibility distinction)\n if (this.currentDeviceStrategy === \"touch\") {\n return \"touch-device\"\n }\n\n return this.state.isIntersectingWithViewport ? \"visible\" : \"hidden\"\n }\n\n private getStatusText(): string {\n if (this.state.isCallbackRunning) {\n return \"callback active\"\n }\n\n if (!this.state.isActive) {\n const reasons = this.getInactiveReasons()\n\n return reasons.length ? `inactive: ${reasons.map(r => r.label).join(\", \")}` : \"inactive\"\n }\n\n const baseStatus = this.state.isIntersectingWithViewport ? \"in viewport\" : \"not in viewport\"\n const deviceStatus = this.currentDeviceStrategy === \"touch\" ? \" (touch device)\" : \"\"\n\n return baseStatus + deviceStatus\n }\n\n private formatElementDetails(): string {\n if (!this.isExpanded) {\n return \"\"\n }\n\n return JSON.stringify({ ...this.state, status: this.getStatusText() }, null, 2)\n }\n\n private handleUnregister = (e: MouseEvent) => {\n e.stopPropagation()\n ForesightManager.instance.unregister(this.element, \"devtools\")\n }\n\n private handleToggleEnabled = (e: MouseEvent) => {\n e.stopPropagation()\n ForesightManager.instance.updateElementOptions(this.element, {\n enabled: !this.state.isEnabled,\n })\n }\n\n render() {\n // Don't apply opacity reduction for touch devices since visibility detection isn't reliable\n const isNotVisible =\n !this.state.isIntersectingWithViewport && this.currentDeviceStrategy !== \"touch\"\n const inactiveReasons = this.getInactiveReasons()\n\n return html`\n <div class=\"element-wrapper ${isNotVisible ? \"not-visible\" : \"\"}\">\n <expandable-item\n .borderColor=${this.getBorderColor()}\n .showCopyButton=${true}\n .itemId=${this.state.id}\n .isExpanded=${this.isExpanded}\n .onToggle=${this.onToggle}\n >\n <div slot=\"content\" class=\"element-content\" title=\"Status: ${this.getStatusText()}\">\n <div class=\"status-indicator ${this.getStatusIndicatorClass()}\"></div>\n <span\n class=\"element-name ${this.state.isCallbackRunning\n ? \"callback-active\"\n : !this.state.isActive\n ? \"callback-inactive\"\n : \"\"}\"\n >\n ${this.state.name || \"unnamed\"}\n </span>\n ${inactiveReasons.length\n ? html`\n <span class=\"reason-tags\">\n ${inactiveReasons.map(\n reason =>\n html`<span\n class=\"reason-tag\"\n style=\"--reason-color: ${reason.color}\"\n title=\"${reason.label}: ${reason.description}\"\n >${reason.label}</span\n >`\n )}\n </span>\n `\n : \"\"}\n ${this.state.isEnabled\n ? html`\n <reactivate-countdown .element=${this.element} .state=${this.state}>\n </reactivate-countdown>\n <button\n class=\"toggle-enabled-button\"\n @click=\"${this.handleToggleEnabled}\"\n title=\"Disable element\"\n >\n ${DISABLED_SVG}\n </button>\n `\n : html`\n <button\n class=\"enable-button\"\n @click=\"${this.handleToggleEnabled}\"\n title=\"Enable element\"\n >\n ${ENABLE_SVG}\n </button>\n `}\n <button\n class=\"unregister-button\"\n @click=\"${this.handleUnregister}\"\n title=\"Unregister element\"\n >\n ${UNREGISTER_SVG}\n </button>\n </div>\n <div slot=\"details\">${this.formatElementDetails()}</div>\n </expandable-item>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"single-element\": SingleElement\n }\n}\n","import { css, html, LitElement } from \"lit\"\nimport { customElement, state } from \"lit/decorators.js\"\nimport { repeat } from \"lit/directives/repeat.js\"\n\nimport type {\n CallbackHits,\n CallbackInvokedEvent,\n ElementRegisteredEvent,\n ElementUnregisteredEvent,\n} from \"js.foresight\"\nimport { ForesightManager, type ForesightElement, type ForesightElementState } from \"js.foresight\"\n\ntype ElementListEntry = { element: ForesightElement; state: ForesightElementState }\nimport { DOCUMENT_SVG, INSERTION_SVG, VISIBILITY_SVG } from \"../../../svg/svg-icons\"\nimport type { SortElementList } from \"../../../types/types\"\nimport { ForesightDevtools } from \"../../foresight-devtools\"\nimport \"../base-tab/chip\"\nimport \"../base-tab/tab-content\"\nimport \"../base-tab/tab-header\"\nimport \"../dropdown/single-select-dropdown\"\nimport type { DropdownOption } from \"../dropdown/single-select-dropdown\"\nimport \"../element-tab/single-element\"\nimport \"./reactivate-countdown\"\n\n@customElement(\"element-tab\")\nexport class ElementTab extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .chips-container {\n display: flex;\n gap: 8px;\n }\n\n .element-section {\n margin-bottom: 16px;\n }\n\n .element-section:last-child {\n margin-bottom: 0;\n }\n\n .section-header {\n margin: 4px 0 4px 0;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n .section-header:hover {\n opacity: 0.8;\n }\n\n .section-header::before {\n content: \"▼\";\n display: inline-block;\n transition: transform 0.15s ease;\n font-size: 10px;\n }\n\n .section-header.collapsed::before {\n transform: rotate(-90deg);\n }\n\n .section-header.active {\n color: #e8e8e8;\n }\n\n .section-header.inactive {\n color: #999;\n }\n `\n\n private get hitCount(): CallbackHits {\n return ForesightManager.instance.getManagerData.globalCallbackHits\n }\n\n @state() private sortDropdown: DropdownOption[]\n @state() private sortOrder: SortElementList\n @state() private elementListItems: Map<ForesightElement, ForesightElementState> = new Map()\n @state() private noContentMessage: string = \"No Elements Registered To The Foresight Manager\"\n @state() private expandedElementIds: Set<string> = new Set()\n @state() private activeSectionCollapsed = false\n @state() private inactiveSectionCollapsed = false\n private _abortController: AbortController | null = null\n private _elementSubscriptions: Map<ForesightElement, () => void> = new Map()\n private _pendingElementUpdates: Map<ForesightElement, ForesightElementState> = new Map()\n private _updateDebounceId: ReturnType<typeof setTimeout> | null = null\n // Cached sorted element order; states are looked up at render time so the\n // cache never holds stale state objects.\n private _cachedActiveElements: ForesightElement[] = []\n private _cachedInactiveElements: ForesightElement[] = []\n private _elementsCacheDirty = true\n\n constructor() {\n super()\n this.sortOrder = ForesightDevtools.instance.devtoolsSettings.sortElementList\n this.sortDropdown = [\n {\n value: \"visibility\",\n label: \"Visibility\",\n title: \"Sort by Visibility\",\n icon: VISIBILITY_SVG,\n },\n {\n value: \"documentOrder\",\n label: \"Document Order\",\n title: \"Sort by Document Order\",\n icon: DOCUMENT_SVG,\n },\n {\n value: \"insertionOrder\",\n label: \"Insertion Order\",\n title: \"Sort by Insertion Order\",\n icon: INSERTION_SVG,\n },\n ]\n }\n\n private handleSortChange = (value: string): void => {\n this.sortOrder = value as SortElementList\n this._elementsCacheDirty = true\n }\n\n private handleElementToggle = (elementId: string): void => {\n const newExpandedElementIds = new Set(this.expandedElementIds)\n if (newExpandedElementIds.has(elementId)) {\n newExpandedElementIds.delete(elementId)\n } else {\n newExpandedElementIds.add(elementId)\n }\n\n this.expandedElementIds = newExpandedElementIds\n }\n\n private _generateHitsChipTitle(hitCounts: CallbackHits): string {\n const lines: string[] = []\n\n // Header with total\n lines.push(`Total Callback Hits: ${hitCounts.total}`)\n lines.push(\"\")\n\n // Desktop Strategy Section\n const mouseTotal = hitCounts.mouse.trajectory + hitCounts.mouse.hover\n const scrollTotal =\n hitCounts.scroll.up + hitCounts.scroll.down + hitCounts.scroll.left + hitCounts.scroll.right\n const tabTotal = hitCounts.tab.forwards + hitCounts.tab.reverse\n\n lines.push(\"Desktop Strategy\")\n if (mouseTotal > 0) {\n lines.push(\n ` Mouse (${mouseTotal}): ${hitCounts.mouse.trajectory} trajectory, ${hitCounts.mouse.hover} hover`\n )\n } else {\n lines.push(\" Mouse: No hits\")\n }\n\n if (scrollTotal > 0) {\n lines.push(\n ` Scroll (${scrollTotal}): Up ${hitCounts.scroll.up}, Down ${hitCounts.scroll.down}, Left ${hitCounts.scroll.left}, Right ${hitCounts.scroll.right}`\n )\n } else {\n lines.push(\" Scroll: No hits\")\n }\n\n if (tabTotal > 0) {\n lines.push(\n ` Tab (${tabTotal}): ${hitCounts.tab.forwards} forward, ${hitCounts.tab.reverse} reverse`\n )\n } else {\n lines.push(\" Tab: No hits\")\n }\n\n lines.push(\"\")\n\n // Touch Strategy Section\n const touchStrategyTotal = hitCounts.touch + hitCounts.viewport\n lines.push(\"Touch Strategy\")\n if (hitCounts.touch > 0) {\n lines.push(` Touch Start: ${hitCounts.touch}`)\n } else {\n lines.push(\" Touch Start: No hits\")\n }\n\n if (hitCounts.viewport > 0) {\n lines.push(` Viewport Enter: ${hitCounts.viewport}`)\n } else {\n lines.push(\" Viewport Enter: No hits\")\n }\n\n if (touchStrategyTotal === 0 && mouseTotal + scrollTotal + tabTotal === 0) {\n lines.push(\"\")\n lines.push(\"Interact with registered elements to see callback statistics\")\n }\n\n return lines.join(\"\\n\")\n }\n\n private _subscribeToElement(element: ForesightElement): void {\n if (this._elementSubscriptions.has(element)) {\n return\n }\n\n const unsubscribe = ForesightManager.instance.subscribeToElement(element, () => {\n const state = ForesightManager.instance.registeredElements.get(element)\n if (!state || !state.isRegistered) {\n return\n }\n\n this._pendingElementUpdates.set(element, state)\n this._scheduleDebouncedUpdate()\n })\n\n if (unsubscribe) {\n this._elementSubscriptions.set(element, unsubscribe)\n }\n }\n\n private _unsubscribeFromElement(element: ForesightElement): void {\n this._elementSubscriptions.get(element)?.()\n this._elementSubscriptions.delete(element)\n }\n\n connectedCallback() {\n super.connectedCallback()\n this._abortController = new AbortController()\n const { signal } = this._abortController\n this.updateElementListFromManager()\n\n for (const element of this.elementListItems.keys()) {\n this._subscribeToElement(element)\n }\n\n ForesightManager.instance.addEventListener(\n \"elementRegistered\",\n (e: ElementRegisteredEvent) => {\n this.elementListItems.set(e.element, e.state)\n this._subscribeToElement(e.element)\n this._elementsCacheDirty = true\n this.requestUpdate()\n },\n { signal }\n )\n\n ForesightManager.instance.addEventListener(\n \"elementUnregistered\",\n (e: ElementUnregisteredEvent) => {\n this._unsubscribeFromElement(e.element)\n this.elementListItems.delete(e.element)\n // Drop any queued update so a later debounce flush can't re-add it.\n this._pendingElementUpdates.delete(e.element)\n if (!this.elementListItems.size) {\n this.noContentMessage = \"No Elements Registered To The Foresight Manager\"\n }\n\n this._elementsCacheDirty = true\n this.requestUpdate()\n },\n { signal }\n )\n\n ForesightManager.instance.addEventListener(\n \"callbackInvoked\",\n (e: CallbackInvokedEvent) => {\n this._pendingElementUpdates.set(e.element, e.state)\n this._scheduleDebouncedUpdate()\n },\n { signal }\n )\n\n // The manager has already updated its global hit counters; just re-render.\n ForesightManager.instance.addEventListener(\n \"callbackCompleted\",\n () => {\n this.requestUpdate()\n },\n { signal }\n )\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._abortController?.abort()\n this._abortController = null\n\n for (const unsub of this._elementSubscriptions.values()) {\n unsub()\n }\n this._elementSubscriptions.clear()\n\n if (this._updateDebounceId !== null) {\n clearTimeout(this._updateDebounceId)\n this._updateDebounceId = null\n }\n\n this._pendingElementUpdates.clear()\n }\n\n private _scheduleDebouncedUpdate(): void {\n // Already scheduled, let the pending timeout handle it\n if (this._updateDebounceId !== null) {\n return\n }\n\n // Debounce updates to ~60fps (16ms) to batch rapid updates\n this._updateDebounceId = setTimeout(() => {\n this._updateDebounceId = null\n this._flushPendingUpdates()\n }, 16)\n }\n\n private _flushPendingUpdates(): void {\n if (this._pendingElementUpdates.size === 0) {\n return\n }\n\n // Apply all pending updates in one batch; the sort order only depends on\n // membership, isActive and isIntersectingWithViewport.\n for (const [element, state] of this._pendingElementUpdates) {\n const previous = this.elementListItems.get(element)\n if (\n !previous ||\n previous.isActive !== state.isActive ||\n previous.isIntersectingWithViewport !== state.isIntersectingWithViewport\n ) {\n this._elementsCacheDirty = true\n }\n\n this.elementListItems.set(element, state)\n }\n this._pendingElementUpdates.clear()\n this.requestUpdate()\n }\n\n private updateElementListFromManager() {\n this.elementListItems = new Map(ForesightManager.instance.registeredElements)\n this._elementsCacheDirty = true\n }\n\n private getSortedElements(): ElementListEntry[] {\n const entries: ElementListEntry[] = Array.from(this.elementListItems, ([element, state]) => ({\n element,\n state,\n }))\n\n switch (this.sortOrder) {\n case \"insertionOrder\":\n return entries\n case \"documentOrder\":\n return entries.sort(this.sortByDocumentPosition)\n case \"visibility\":\n return entries.sort((a, b) => {\n if (a.state.isIntersectingWithViewport !== b.state.isIntersectingWithViewport) {\n return a.state.isIntersectingWithViewport ? -1 : 1\n }\n\n return this.sortByDocumentPosition(a, b)\n })\n default:\n this.sortOrder satisfies never\n\n return entries\n }\n }\n\n private _recomputeElementsCache(): void {\n if (!this._elementsCacheDirty) {\n return\n }\n\n const active: ForesightElement[] = []\n const inactive: ForesightElement[] = []\n for (const entry of this.getSortedElements()) {\n // Disabled elements are inactive too; their reason is shown as a badge on the\n // row rather than a separate section.\n if (entry.state.isActive) {\n active.push(entry.element)\n } else {\n inactive.push(entry.element)\n }\n }\n this._cachedActiveElements = active\n this._cachedInactiveElements = inactive\n this._elementsCacheDirty = false\n }\n\n private get activeElements(): ForesightElement[] {\n this._recomputeElementsCache()\n\n return this._cachedActiveElements\n }\n\n private get inactiveElements(): ForesightElement[] {\n this._recomputeElementsCache()\n\n return this._cachedInactiveElements\n }\n\n private sortByDocumentPosition = (a: ElementListEntry, b: ElementListEntry) => {\n const position = a.element.compareDocumentPosition(b.element)\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1\n }\n\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1\n }\n\n return 0\n }\n\n private renderElementSection(\n label: string,\n modifierClass: string,\n elements: ForesightElement[],\n collapsed: boolean,\n toggleCollapsed: () => void\n ) {\n if (elements.length === 0) {\n return \"\"\n }\n\n return html`\n <div class=\"element-section\">\n <h3\n class=\"section-header ${modifierClass} ${collapsed ? \"collapsed\" : \"\"}\"\n @click=${toggleCollapsed}\n >\n ${label} (${elements.length})\n </h3>\n ${!collapsed\n ? repeat(\n elements,\n element => this.elementListItems.get(element)?.id ?? \"\",\n element => {\n const state = this.elementListItems.get(element)\n if (!state) {\n return \"\"\n }\n\n return html`\n <single-element\n .element=${element}\n .state=${state}\n .isExpanded=${this.expandedElementIds.has(state.id)}\n .onToggle=${this.handleElementToggle}\n >\n </single-element>\n `\n }\n )\n : \"\"}\n </div>\n `\n }\n\n render() {\n return html`\n <tab-header>\n <div slot=\"chips\" class=\"chips-container\">\n <chip-element title=\"${this._generateHitsChipTitle(this.hitCount)}\">\n ${this.hitCount.total} hits\n </chip-element>\n </div>\n <div slot=\"actions\">\n <single-select-dropdown\n .dropdownOptions=\"${this.sortDropdown}\"\n .selectedOptionValue=\"${this.sortOrder}\"\n .onSelectionChange=\"${this.handleSortChange}\"\n ></single-select-dropdown>\n </div>\n </tab-header>\n <tab-content\n .noContentMessage=${this.noContentMessage}\n .hasContent=${!!this.elementListItems.size}\n >\n ${this.renderElementSection(\n \"Active Elements\",\n \"active\",\n this.activeElements,\n this.activeSectionCollapsed,\n () => {\n this.activeSectionCollapsed = !this.activeSectionCollapsed\n }\n )}\n ${this.renderElementSection(\n \"Inactive Elements\",\n \"inactive\",\n this.inactiveElements,\n this.inactiveSectionCollapsed,\n () => {\n this.inactiveSectionCollapsed = !this.inactiveSectionCollapsed\n }\n )}\n </tab-content>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"element-tab\": ElementTab\n }\n}\n","import { css, html, LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport type { ControllerTabs } from \"../../../types/types\"\n\n@customElement(\"tab-selector\")\nexport class TabSelector extends LitElement {\n static styles = css`\n .tab-selector-wrapper {\n border-bottom: 2px solid #444;\n margin-top: 12px;\n display: flex;\n justify-content: space-evenly;\n width: 100%;\n }\n\n .tab-button {\n background: none;\n border: none;\n color: #9e9e9e;\n flex: 1;\n padding: 8px;\n cursor: pointer;\n border-bottom: 2px solid transparent;\n transition: all 0.2s ease;\n font-size: 13px;\n font-weight: 500;\n text-align: center;\n }\n .tab-button:hover {\n color: #b0c4de;\n background-color: rgba(176, 196, 222, 0.1);\n }\n\n .tab-button.active {\n color: #b0c4de;\n border-bottom-color: #b0c4de;\n }\n `\n\n @property({ type: String })\n activeTab: ControllerTabs = \"settings\"\n\n private tabs: ControllerTabs[] = [\"settings\", \"elements\", \"logs\"]\n\n private _handleTabClick(selectedTab: ControllerTabs) {\n this.dispatchEvent(\n new CustomEvent(\"tab-change\", {\n detail: { tab: selectedTab },\n bubbles: true,\n composed: true,\n })\n )\n }\n\n protected render() {\n return html`\n <div class=\"tab-selector-wrapper\">\n ${this.tabs.map(\n tab => html`\n <button\n class=\"tab-button ${this.activeTab === tab ? \"active\" : \"\"}\"\n @click=\"${() => this._handleTabClick(tab)}\"\n data-tab=\"${tab}\"\n >\n ${tab.charAt(0).toUpperCase() + tab.slice(1)}\n </button>\n `\n )}\n </div>\n `\n }\n}\n","import { html, css, type TemplateResult } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { BaseDropdown, type DropdownOption } from \"./base-dropdown\"\nimport { FILTER_SVG } from \"../../../svg/svg-icons\"\n\n@customElement(\"multi-select-dropdown\")\nexport class MultiSelectDropdown extends BaseDropdown {\n static styles = [\n ...BaseDropdown.styles,\n css`\n .dropdown-menu button.active::after {\n content: \"✓\";\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n color: #b0c4de;\n font-weight: bold;\n }\n\n .selected-count {\n font-size: 10px;\n color: #b0c4de;\n margin-left: 2px;\n }\n `,\n ]\n\n @property({ type: Array }) selectedValues: string[] = []\n @property() onSelectionChange?: (changedValue: string, isSelected: boolean) => void\n\n protected _handleOptionClick(option: DropdownOption): void {\n const isCurrentlySelected = this.selectedValues.includes(option.value)\n\n if (isCurrentlySelected) {\n this.selectedValues = this.selectedValues.filter(value => value !== option.value)\n } else {\n this.selectedValues = [...this.selectedValues, option.value]\n }\n\n const newSelectionState = !isCurrentlySelected\n this.onSelectionChange?.(option.value, newSelectionState)\n }\n\n protected _getTriggerIcon(): TemplateResult {\n return FILTER_SVG\n }\n\n protected _isOptionSelected(option: DropdownOption): boolean {\n return this.selectedValues.includes(option.value)\n }\n\n protected _getTriggerTitle(): string {\n const count = this.selectedValues.length\n if (count === 0) {\n return \"No items selected\"\n } else if (count === 1) {\n return \"1 item selected\"\n } else {\n return `${count} items selected`\n }\n }\n\n protected _getTriggerLabel(): string {\n return `Filter options: ${this.selectedValues.length} selected`\n }\n\n render() {\n const buttonClass = `trigger-button ${this.isDropdownOpen ? \"active\" : \"\"}`\n const menuClass = `dropdown-menu ${this.isDropdownOpen ? \"active\" : \"\"}`\n\n return html`\n <div class=\"dropdown-container\">\n <button\n class=\"${buttonClass}\"\n title=\"${this._getTriggerTitle()}\"\n @click=\"${this._toggleDropdown}\"\n aria-haspopup=\"true\"\n aria-expanded=\"${this.isDropdownOpen}\"\n aria-controls=\"dropdown-menu\"\n aria-label=\"${this._getTriggerLabel()}\"\n >\n ${this._getTriggerIcon()}\n <span class=\"selected-count\">${this.selectedValues.length}</span>\n <svg\n class=\"arrow-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"6 9 12 15 18 9\"></polyline>\n </svg>\n </button>\n\n <div class=\"${menuClass}\" id=\"dropdown-menu\" role=\"menu\">\n ${this.dropdownOptions.map(\n option => html`\n <button\n value=\"${option.value}\"\n title=\"${option.title}\"\n class=\"${this._isOptionSelected(option) ? \"active\" : \"\"}\"\n @click=\"${() => this._handleOptionClick(option)}\"\n role=\"menuitem\"\n >\n ${option.label}\n </button>\n `\n )}\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"multi-select-dropdown\": MultiSelectDropdown\n }\n}\n","import type {\n CallbackHits,\n CallbackHitType,\n ForesightElementState,\n ForesightEvent,\n ForesightEventMap,\n ForesightManagerData,\n ForesightManagerSettings,\n HitSlop,\n ForesightPoint,\n ScrollDirection,\n UpdatedManagerSetting,\n} from \"js.foresight\"\n\ntype SerializedEventType = ForesightEvent | \"serializationError\" | \"managerDataPayload\"\n\nexport type ControlPanelLogEntry = {\n eventData: SerializedEventData\n}\n\ninterface PayloadBase {\n type: SerializedEventType\n localizedTimestamp: string\n summary: string // The text / data you see as preview on the right of the event (keep this short)\n logId: string\n}\n\ninterface ElementRegisteredPayload extends PayloadBase {\n type: \"elementRegistered\"\n name: string\n id: string\n state: ForesightElementState\n hitslop: HitSlop\n meta: Record<string, unknown>\n}\n\ninterface ElementUnregisteredEvent extends PayloadBase {\n type: \"elementUnregistered\"\n name: string\n id: string\n state: ForesightElementState\n meta: Record<string, unknown>\n wasLastRegisteredElement: boolean\n}\n\ninterface CallbackInvokedPayload extends PayloadBase {\n type: \"callbackInvoked\"\n name: string\n hitType: CallbackHitType\n state: ForesightElementState\n meta: Record<string, unknown>\n}\n\ninterface CallbackCompletedPayload extends PayloadBase {\n type: \"callbackCompleted\"\n elapsed: string\n name: string\n hitType: CallbackHitType\n status: \"success\" | \"error\" | undefined\n errorMessage: string | undefined | null\n state: ForesightElementState\n wasLastActiveElement: boolean\n meta: Record<string, unknown>\n}\n\ninterface MouseTrajectoryUpdatePayload extends PayloadBase {\n type: \"mouseTrajectoryUpdate\"\n currentPoint: ForesightPoint\n predictedPoint: ForesightPoint\n positionCount: number\n mousePredictionEnabled: boolean\n}\n\ninterface ScrollTrajectoryUpdatePayload extends PayloadBase {\n type: \"scrollTrajectoryUpdate\"\n currentPoint: ForesightPoint\n predictedPoint: ForesightPoint\n scrollDirection: ScrollDirection\n}\n\ninterface ManagerSettingsChangedPayload extends PayloadBase {\n type: \"managerSettingsChanged\"\n globalSettings: ForesightManagerSettings\n settingsChanged: UpdatedManagerSetting[]\n}\n\ninterface DeviceStrategyChangedPayload extends PayloadBase {\n type: \"deviceStrategyChanged\"\n oldStrategy: string\n newStrategy: string\n}\n\ninterface SerializationErrorPayload extends PayloadBase {\n type: \"serializationError\"\n error: \"Failed to serialize event data\"\n errorMessage: string\n}\n\ninterface ManagerDataPayload extends PayloadBase {\n type: \"managerDataPayload\"\n warning: string\n globalCallbackHits: CallbackHits\n eventListenerCount: Record<string, number>\n managerSettings: ForesightManagerSettings\n registeredElements: Array<ForesightElementState & { elementInfo: string }>\n loadedModules: ForesightManagerData[\"loadedModules\"]\n}\n\nexport type SerializedEventData =\n | ElementRegisteredPayload\n | ElementUnregisteredEvent\n | CallbackInvokedPayload\n | CallbackCompletedPayload\n | MouseTrajectoryUpdatePayload\n | ScrollTrajectoryUpdatePayload\n | ManagerSettingsChangedPayload\n | DeviceStrategyChangedPayload\n | ManagerDataPayload\n | SerializationErrorPayload\n\nexport const safeSerializeManagerData = (\n data: ForesightManagerData,\n logId: string\n): ManagerDataPayload => {\n const eventListeners: Record<string, number> = {}\n data.eventListeners.forEach((listeners, eventType) => {\n eventListeners[eventType] = listeners.length\n })\n const registeredElements: Array<ForesightElementState & { elementInfo: string }> = []\n data.registeredElements.forEach((state, element) => {\n registeredElements.push({\n ...state,\n elementInfo: `${element.id ? `#${element.id}` : \"\"}${\n element.className ? `.${element.className.replace(/\\s+/g, \".\")}` : \"\"\n }`,\n })\n })\n\n return {\n type: \"managerDataPayload\",\n warning: \"this is a lot easier to view in the console\",\n logId: logId,\n globalCallbackHits: data.globalCallbackHits,\n localizedTimestamp: new Date().toLocaleTimeString(),\n eventListenerCount: eventListeners,\n managerSettings: data.globalSettings,\n registeredElements: registeredElements,\n loadedModules: data.loadedModules,\n summary: `${registeredElements.length} elements, ${\n Object.values(eventListeners).flat().length\n } listeners,\n ${data.globalCallbackHits.total} hits`,\n }\n}\n\n/**\n * Safely serializes ForesightJS event data into a JSON-serializable format\n * for logging and debugging purposes.\n *\n * @param event - The ForesightJS event to serialize\n * @returns Serialized event data or error object if serialization fails\n */\nexport const safeSerializeEventData = <K extends keyof ForesightEventMap>(\n event: ForesightEventMap[K],\n logId: string\n): SerializedEventData => {\n try {\n // For different event types, extract only the relevant serializable data\n switch (event.type) {\n case \"elementRegistered\":\n return {\n type: \"elementRegistered\",\n name: event.state.name,\n id: event.element.id || \"\",\n state: event.state,\n hitslop: event.state.hitSlop,\n localizedTimestamp: new Date(event.timestamp).toLocaleTimeString(),\n meta: event.state.meta,\n logId: logId,\n summary:\n event.state.registerCount > 1\n ? `${event.state.name} - ${getOrdinalSuffix(event.state.registerCount)} time`\n : event.state.name,\n }\n case \"elementUnregistered\":\n return {\n type: \"elementUnregistered\",\n name: event.state.name,\n id: event.element.id || \"\",\n meta: event.state.meta,\n state: event.state,\n wasLastRegisteredElement: event.wasLastRegisteredElement,\n localizedTimestamp: new Date(event.timestamp).toLocaleTimeString(),\n logId: logId,\n summary: `${event.state.name} - ${event.unregisterReason}`,\n }\n case \"callbackInvoked\":\n return {\n type: \"callbackInvoked\",\n name: event.state.name,\n hitType: event.hitType,\n state: event.state,\n meta: event.state.meta,\n localizedTimestamp: new Date(event.timestamp).toLocaleTimeString(),\n logId: logId,\n summary: `${event.state.name} - ${event.hitType.kind}`,\n }\n case \"callbackCompleted\": {\n const elapsed = formatElapsed(event.state.durationMs || 0)\n\n return {\n type: \"callbackCompleted\",\n name: event.state.name,\n hitType: event.hitType,\n state: event.state,\n meta: event.state.meta,\n wasLastActiveElement: event.wasLastActiveElement,\n elapsed: elapsed,\n localizedTimestamp: new Date(event.timestamp).toLocaleTimeString(),\n logId: logId,\n status: event.state.status,\n errorMessage: event.state.error,\n summary: `${event.state.name} - ${elapsed}`,\n }\n }\n case \"mouseTrajectoryUpdate\":\n return {\n type: \"mouseTrajectoryUpdate\",\n currentPoint: event.trajectoryPositions?.currentPoint,\n predictedPoint: event.trajectoryPositions?.predictedPoint,\n positionCount: event.trajectoryPositions?.positions?.length || 0,\n mousePredictionEnabled: event.predictionEnabled,\n localizedTimestamp: new Date().toLocaleTimeString(),\n logId: logId,\n summary: \"\",\n }\n case \"scrollTrajectoryUpdate\":\n return {\n type: \"scrollTrajectoryUpdate\",\n currentPoint: event.currentPoint,\n predictedPoint: event.predictedPoint,\n scrollDirection: event.scrollDirection,\n localizedTimestamp: new Date().toLocaleTimeString(),\n logId: logId,\n summary: event.scrollDirection,\n }\n case \"managerSettingsChanged\":\n return {\n type: \"managerSettingsChanged\",\n globalSettings: event.managerData?.globalSettings || {},\n settingsChanged: event.updatedSettings,\n localizedTimestamp: new Date(event.timestamp).toLocaleTimeString(),\n logId: logId,\n summary: event.updatedSettings.map(setting => setting.setting).join(\", \"),\n }\n case \"deviceStrategyChanged\":\n return {\n type: \"deviceStrategyChanged\",\n oldStrategy: event.oldStrategy,\n newStrategy: event.newStrategy,\n localizedTimestamp: new Date(event.timestamp).toLocaleTimeString(),\n logId: logId,\n summary: `${event.oldStrategy} → ${event.newStrategy}`,\n }\n default: {\n const _exhaustiveCheck: never = event\n\n return {\n type: \"serializationError\",\n error: \"Failed to serialize event data\",\n errorMessage: JSON.stringify(_exhaustiveCheck),\n localizedTimestamp: new Date().toLocaleTimeString(),\n logId: logId,\n summary: \"\",\n }\n }\n }\n } catch (error) {\n // Fallback if serialization fails\n return {\n type: \"serializationError\",\n error: \"Failed to serialize event data\",\n localizedTimestamp: new Date().toLocaleTimeString(),\n errorMessage: error instanceof Error ? error.message : String(error),\n logId: logId,\n summary: \"\",\n }\n }\n}\n\n/**\n * Formats a duration in milliseconds into seconds.\n *\n * @param {number} ms Duration in milliseconds\n * @returns {string} Duration in seconds, e.g. “0.50 s” or “1.23 s”\n */\nconst formatElapsed = (ms: number): string => {\n return `${(ms / 1000).toFixed(4)} s`\n}\n\nconst getOrdinalSuffix = (n: number): string => {\n const lastTwo = n % 100\n if (lastTwo >= 11 && lastTwo <= 13) {\n return `${n}th`\n }\n\n switch (n % 10) {\n case 1:\n return `${n}st`\n case 2:\n return `${n}nd`\n case 3:\n return `${n}rd`\n default:\n return `${n}th`\n }\n}\n","import { ForesightManager } from \"js.foresight\"\nimport type { ForesightEvent, ForesightEventMap } from \"js.foresight\"\nimport {\n safeSerializeEventData,\n safeSerializeManagerData,\n type SerializedEventData,\n} from \"../../../helpers/safeSerializeEventData\"\nimport type { LogEvents, LoggingLocations } from \"../../../types/types\"\nimport { ForesightDevtools } from \"../../foresight-devtools\"\n\nexport const MAX_LOGS = 100\n\nexport const EVENT_COLORS: Record<ForesightEvent, string> = {\n elementRegistered: \"#2196f3\",\n callbackInvoked: \"#00bcd4\",\n callbackCompleted: \"#4caf50\",\n elementUnregistered: \"#ff9800\",\n managerSettingsChanged: \"#f44336\",\n mouseTrajectoryUpdate: \"#78909c\",\n scrollTrajectoryUpdate: \"#607d8b\",\n deviceStrategyChanged: \"#9c27b0\",\n}\n\n/**\n * Collects manager events into a log buffer outside the Lit tree, so logs\n * keep accumulating while the log tab is unmounted (panel minimized or\n * another tab active) and survive remounts.\n */\nexport class EventLogStore {\n logs: Array<SerializedEventData> = []\n logLocation: LoggingLocations\n eventsEnabled: LogEvents\n private logIdCounter: number = 0\n private changeListeners: Set<() => void> = new Set()\n private managerListeners: Map<\n ForesightEvent,\n (event: ForesightEventMap[ForesightEvent]) => void\n > = new Map()\n private isAttached: boolean = false\n\n constructor() {\n const {\n logging: { logLocation, ...eventFlags },\n } = ForesightDevtools.instance.devtoolsSettings\n this.logLocation = logLocation\n this.eventsEnabled = eventFlags\n }\n\n /** Start listening to manager events. Idempotent; called when the control panel mounts. */\n attach(): void {\n if (this.isAttached) {\n return\n }\n\n this.isAttached = true\n for (const [eventType, enabled] of Object.entries(this.eventsEnabled)) {\n if (enabled) {\n this.addManagerListener(eventType as ForesightEvent)\n }\n }\n }\n\n /** Stop listening to manager events; the collected logs are kept. */\n detach(): void {\n this.managerListeners.forEach((handler, eventType) => {\n ForesightManager.instance.removeEventListener(eventType, handler)\n })\n this.managerListeners.clear()\n this.isAttached = false\n }\n\n subscribe(listener: () => void): () => void {\n this.changeListeners.add(listener)\n\n return () => this.changeListeners.delete(listener)\n }\n\n setLogLocation(location: LoggingLocations): void {\n this.logLocation = location\n this.notify()\n }\n\n setEventEnabled(eventType: ForesightEvent, enabled: boolean): void {\n this.eventsEnabled = {\n ...this.eventsEnabled,\n [eventType]: enabled,\n }\n if (this.isAttached) {\n if (enabled) {\n this.addManagerListener(eventType)\n } else {\n this.removeManagerListener(eventType)\n }\n }\n\n this.notify()\n }\n\n clear(): void {\n this.logs = []\n this.notify()\n }\n\n logManagerData(): void {\n if (this.logLocation === \"none\") {\n return\n }\n\n if (this.logLocation === \"console\" || this.logLocation === \"both\") {\n console.log(ForesightManager.instance.getManagerData)\n }\n\n if (this.logLocation === \"controlPanel\" || this.logLocation === \"both\") {\n this.addLog(\n safeSerializeManagerData(\n ForesightManager.instance.getManagerData,\n (++this.logIdCounter).toString()\n )\n )\n }\n }\n\n private addManagerListener(eventType: ForesightEvent): void {\n if (this.managerListeners.has(eventType)) {\n return\n }\n\n const handler = (event: ForesightEventMap[typeof eventType]) => {\n this.handleEvent(eventType, event)\n }\n this.managerListeners.set(eventType, handler)\n ForesightManager.instance.addEventListener(eventType, handler)\n }\n\n private removeManagerListener(eventType: ForesightEvent): void {\n const handler = this.managerListeners.get(eventType)\n if (handler) {\n ForesightManager.instance.removeEventListener(eventType, handler)\n this.managerListeners.delete(eventType)\n }\n }\n\n private handleEvent<K extends ForesightEvent>(eventType: K, event: ForesightEventMap[K]): void {\n if (this.logLocation === \"none\") {\n return\n }\n\n if (this.logLocation === \"console\" || this.logLocation === \"both\") {\n const color = EVENT_COLORS[eventType] || \"#ffffff\"\n console.log(`%c[ForesightJS] ${eventType}`, `color: ${color}; font-weight: bold;`, event)\n }\n\n if (this.logLocation === \"controlPanel\" || this.logLocation === \"both\") {\n const log = safeSerializeEventData(event, (++this.logIdCounter).toString())\n if (log.type === \"serializationError\") {\n console.error(log.error, log.errorMessage)\n\n return\n }\n\n this.addLog(log)\n }\n }\n\n private addLog(log: SerializedEventData): void {\n this.logs.unshift(log)\n if (this.logs.length > MAX_LOGS) {\n this.logs.pop()\n }\n\n this.notify()\n }\n\n private notify(): void {\n for (const listener of this.changeListeners) {\n listener()\n }\n }\n}\n\nlet storeInstance: EventLogStore | null = null\n\n/** Lazily created so importing this module doesn't initialize the devtools. */\nexport const getEventLogStore = (): EventLogStore => {\n return (storeInstance ??= new EventLogStore())\n}\n","import { LitElement, html, css, PropertyValues } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport type { SerializedEventData } from \"../../../helpers/safeSerializeEventData\"\nimport { EVENT_COLORS } from \"./log-store\"\nimport \"../base-tab/expandable-item\"\n\n@customElement(\"single-log\")\nexport class SingleLog extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n /*\n * The background color is now driven by a CSS variable.\n * This allows us to set it from TypeScript without touching the class.\n */\n background-color: var(--log-background-color, transparent);\n }\n\n .log-time {\n color: #b8b8b8;\n font-weight: 500;\n font-size: 10px;\n font-family: \"SF Mono\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace;\n min-width: 70px;\n max-width: 70px;\n text-align: left;\n letter-spacing: 0.02em;\n flex-shrink: 0;\n }\n\n .log-type-badge {\n display: inline-flex;\n align-items: center;\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.02em;\n /* The color is driven by a CSS variable set in updated() */\n color: var(--log-color, #b0c4de);\n min-width: 90px;\n max-width: 90px;\n white-space: nowrap;\n text-align: left;\n margin-left: 10px;\n flex-shrink: 0;\n }\n\n .log-summary {\n flex: 1;\n color: #ccc;\n font-size: 11px;\n opacity: 0.9;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-left: 6px;\n font-weight: 400;\n min-width: 0;\n }\n\n .log-content {\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n }\n\n /*\n * The :host(.error-status) selector is no longer needed,\n * as all styling is now handled by setting CSS variables below.\n * This makes the component's styling more self-contained.\n */\n `,\n ]\n\n @property({ attribute: false })\n log: SerializedEventData\n\n constructor(log: SerializedEventData) {\n super()\n this.log = log\n }\n\n @property({ type: Boolean })\n isExpanded: boolean = false\n\n @property()\n onToggle: ((logId: string) => void) | undefined\n\n protected updated(changedProperties: PropertyValues<this>) {\n // Only run this logic if the `log` property has changed.\n if (changedProperties.has(\"log\") && this.log) {\n const log = this.log\n const isError = log.type === \"callbackCompleted\" && \"status\" in log && log.status === \"error\"\n\n // Instead of toggling a class, we now set CSS custom properties\n // directly on the host element's style. This is an encapsulated\n // pattern that does not interfere with external classes.\n const color = isError ? \"#f44336\" : this.getLogTypeColor(log.type)\n const bgColor = isError ? \"rgba(244, 67, 54, 0.1)\" : \"transparent\"\n\n this.style.setProperty(\"--log-color\", color)\n this.style.setProperty(\"--log-background-color\", bgColor)\n }\n }\n\n private serializeLogDataWithoutSummary(log: SerializedEventData): string {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { summary: _, ...rest } = log\n\n return JSON.stringify(rest, null, 2)\n }\n\n private getLogTypeColor(logType: string): string {\n return (EVENT_COLORS as Record<string, string>)[logType] || \"#555\"\n }\n\n private getEventDisplayName(eventType: string): string {\n const eventNames: Record<string, string> = {\n elementRegistered: \"Registered\",\n elementUnregistered: \"Unregistered\",\n callbackInvoked: \"Invoked\",\n callbackCompleted: \"Completed\",\n mouseTrajectoryUpdate: \"Mouse\",\n scrollTrajectoryUpdate: \"Scroll\",\n managerSettingsChanged: \"Settings\",\n managerDataPayload: \"ManagerData\",\n deviceStrategyChanged: \"Strategy\",\n }\n\n return eventNames[eventType] || eventType\n }\n\n private truncateLogSummary(summary: string, maxLength: number = 50): string {\n if (summary.length <= maxLength) {\n return summary\n }\n\n return summary.substring(0, maxLength) + \"...\"\n }\n\n render() {\n const log = this.log\n const isError = log.type === \"callbackCompleted\" && \"status\" in log && log.status === \"error\"\n\n // The border color for the child component is still fine to calculate here.\n const borderColor = isError ? \"#f44336\" : this.getLogTypeColor(log.type)\n\n return html`\n <expandable-item\n .borderColor=${borderColor}\n .itemId=${log.logId}\n .isExpanded=${this.isExpanded}\n .onToggle=${this.onToggle}\n >\n <div slot=\"content\">\n <div class=\"log-content\">\n <span class=\"log-time\">${log.localizedTimestamp}</span>\n <span class=\"log-type-badge\">${this.getEventDisplayName(log.type)}</span>\n <span class=\"log-summary\">${this.truncateLogSummary(log.summary)}</span>\n </div>\n </div>\n <div slot=\"details\">${this.serializeLogDataWithoutSummary(log)}</div>\n </expandable-item>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"single-log\": SingleLog\n }\n}\n","import type { ForesightEvent } from \"js.foresight\"\nimport { LitElement, css, html } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\nimport { repeat } from \"lit/directives/repeat.js\"\nimport {\n BOTH_SVG,\n CLEAR_SVG,\n CONSOLE_SVG,\n CONTROL_PANEL_SVG,\n FILTER_SVG,\n NONE_SVG,\n STATE_SVG,\n WARNING_SVG,\n} from \"../../../svg/svg-icons\"\nimport type { LoggingLocations } from \"../../../types/types\"\nimport \"../base-tab/chip\"\nimport \"../base-tab/tab-content\"\nimport \"../base-tab/tab-header\"\nimport \"../copy-icon/copy-icon\"\nimport \"../dropdown/multi-select-dropdown\"\nimport type { DropdownOption } from \"../dropdown/single-select-dropdown\"\nimport { getEventLogStore, MAX_LOGS } from \"./log-store\"\nimport \"./single-log\"\n\n@customElement(\"log-tab\")\nexport class LogTab extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .chips-container {\n display: flex;\n gap: 4px;\n }\n\n .single-button {\n background: none;\n border: none;\n color: white;\n cursor: pointer;\n padding: 6px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n vertical-align: top;\n }\n\n .single-button svg {\n width: 16px;\n height: 16px;\n stroke: white;\n transition: stroke 0.2s;\n }\n\n .single-button:hover {\n background-color: rgba(176, 196, 222, 0.1);\n }\n\n .single-button:hover svg {\n stroke: #b0c4de;\n }\n\n .single-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .single-button:disabled:hover {\n background: none;\n }\n\n .single-button:disabled svg {\n stroke: #666;\n }\n\n .no-items {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 200px;\n text-align: center;\n font-family: \"Courier New\", monospace;\n font-style: italic;\n padding: 20px;\n color: #999;\n }\n\n .warning-container {\n background: none;\n border: none;\n color: #ffc107;\n cursor: help;\n padding: 6px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n vertical-align: top;\n }\n\n .warning-container svg {\n width: 16px;\n height: 16px;\n stroke: #ffc107;\n fill: none;\n transition: stroke 0.2s;\n }\n\n .warning-container:hover {\n background-color: rgba(255, 193, 7, 0.1);\n }\n\n .warning-container:hover svg {\n stroke: #ffdc3e;\n }\n `,\n ]\n\n private store = getEventLogStore()\n @state() private logDropdown: DropdownOption[]\n @state() private filterDropdown: DropdownOption[]\n @state() private expandedLogIds: Set<string> = new Set()\n\n @property() noContentMessage: string = \"No logs available\"\n private _unsubscribeStore: (() => void) | null = null\n\n constructor() {\n super()\n this.logDropdown = [\n {\n value: \"controlPanel\",\n label: \"Control Panel\",\n title: \"Log only to the control panel\",\n icon: CONTROL_PANEL_SVG,\n },\n {\n value: \"console\",\n label: \"Console\",\n title: \"Log only to the console\",\n icon: CONSOLE_SVG,\n },\n {\n value: \"both\",\n label: \"Both\",\n title: \"Log to both the control panel and the console\",\n icon: BOTH_SVG,\n },\n {\n value: \"none\",\n label: \"None\",\n title: \"Dont log anywhere\",\n icon: NONE_SVG,\n },\n ]\n\n this.filterDropdown = [\n {\n value: \"elementRegistered\",\n label: \"Element Registered\",\n title: \"Show element registration events\",\n icon: FILTER_SVG,\n },\n {\n value: \"elementUnregistered\",\n label: \"Element Unregistered\",\n title: \"Show element unregistration events\",\n icon: FILTER_SVG,\n },\n {\n value: \"callbackInvoked\",\n label: \"Callback Invoked\",\n title: \"Show callback invoked events\",\n icon: FILTER_SVG,\n },\n {\n value: \"callbackCompleted\",\n label: \"Callback Completed\",\n title: \"Show callback completed events\",\n icon: FILTER_SVG,\n },\n {\n value: \"mouseTrajectoryUpdate\",\n label: \"Mouse Trajectory Update\",\n title: \"Show mouse trajectory update events\",\n icon: FILTER_SVG,\n },\n {\n value: \"scrollTrajectoryUpdate\",\n label: \"Scroll Trajectory Update\",\n title: \"Show scroll trajectory update events\",\n icon: FILTER_SVG,\n },\n {\n value: \"managerSettingsChanged\",\n label: \"Manager Settings Changed\",\n title: \"Show manager settings change events\",\n icon: FILTER_SVG,\n },\n {\n value: \"deviceStrategyChanged\",\n label: \"Strategy Changed\",\n title: \"Show strategy change events\",\n icon: FILTER_SVG,\n },\n ]\n }\n\n private handleLogLocationChange = (value: string): void => {\n this.store.setLogLocation(value as LoggingLocations)\n }\n\n private handleFilterChange = (changedEventType: string, isEnabled: boolean): void => {\n this.store.setEventEnabled(changedEventType as ForesightEvent, isEnabled)\n }\n\n private getSelectedEventFilters(): string[] {\n return Object.entries(this.store.eventsEnabled)\n .filter(([, enabled]) => enabled)\n .map(([eventType]) => eventType)\n }\n\n //TODO check if devtools is open, but is harder than I thought. Look into later\n private shouldShowPerformanceWarning(): boolean {\n const { logLocation, eventsEnabled } = this.store\n const hasConsoleOutput = logLocation === \"console\" || logLocation === \"both\"\n const hasFrequentEvents =\n eventsEnabled.mouseTrajectoryUpdate || eventsEnabled.scrollTrajectoryUpdate\n\n return hasConsoleOutput && hasFrequentEvents\n }\n\n private getNoLogsMessage(): string {\n const enabledCount = Object.values(this.store.eventsEnabled).filter(Boolean).length\n if (enabledCount === 0) {\n return \"Logging for all events is turned off\"\n }\n\n if (this.store.logLocation === \"console\") {\n return \"No logs to display. Logging location is set to console - check browser console for events.\"\n }\n\n if (this.store.logLocation === \"none\") {\n return \"No logs to display. Logging location is set to none\"\n }\n\n return \"Interact with Foresight to generate events.\"\n }\n\n private handleLogToggle = (logId: string): void => {\n const newExpandedLogIds = new Set(this.expandedLogIds)\n if (newExpandedLogIds.has(logId)) {\n newExpandedLogIds.delete(logId)\n } else {\n newExpandedLogIds.add(logId)\n }\n\n this.expandedLogIds = newExpandedLogIds\n }\n\n private clearLogs(): void {\n this.store.clear()\n this.expandedLogIds.clear()\n this.noContentMessage = \"Logs cleared\"\n }\n\n private logManagerData = (): void => {\n this.store.logManagerData()\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this._unsubscribeStore = this.store.subscribe(() => this.requestUpdate())\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this._unsubscribeStore?.()\n this._unsubscribeStore = null\n }\n\n render() {\n const logs = this.store.logs\n\n return html`\n <tab-header>\n <div slot=\"chips\" class=\"chips-container\">\n <chip-element title=\"Number of logged events (Max ${MAX_LOGS})\">\n ${logs.length} events\n </chip-element>\n </div>\n <div slot=\"actions\">\n ${this.shouldShowPerformanceWarning()\n ? html`\n <div\n class=\"warning-container\"\n title=\"Console logging can be slow with frequent trajectory events.\nConsider using 'Control Panel' only for better performance.\"\n >\n ${WARNING_SVG}\n </div>\n `\n : \"\"}\n <single-select-dropdown\n .dropdownOptions=\"${this.logDropdown}\"\n .selectedOptionValue=\"${this.store.logLocation}\"\n .onSelectionChange=\"${this.handleLogLocationChange}\"\n ></single-select-dropdown>\n\n <multi-select-dropdown\n .dropdownOptions=\"${this.filterDropdown}\"\n .selectedValues=\"${this.getSelectedEventFilters()}\"\n .onSelectionChange=\"${this.handleFilterChange}\"\n ></multi-select-dropdown>\n <button\n class=\"single-button\"\n title=\"Log the state from the manager\"\n @click=\"${this.logManagerData}\"\n >\n ${STATE_SVG}\n </button>\n <button\n class=\"single-button\"\n title=\"Clear all logs\"\n ?disabled=\"${logs.length === 0}\"\n @click=\"${this.clearLogs}\"\n >\n ${CLEAR_SVG}\n </button>\n </div>\n </tab-header>\n <tab-content .noContentMessage=${this.noContentMessage} .hasContent=${!!logs.length}>\n ${logs.length === 0\n ? html`<div class=\"no-items\">${this.getNoLogsMessage()}</div>`\n : repeat(\n logs,\n log => log.logId,\n log => html`\n <single-log\n .log=${log}\n .isExpanded=${this.expandedLogIds.has(log.logId)}\n .onToggle=${this.handleLogToggle}\n ></single-log>\n `\n )}\n </tab-content>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"log-tab\": LogTab\n }\n}\n","export const DEFAULT_IS_DEBUGGER_MINIMIZED = false\nexport const DEFAULT_SHOW_DEBUGGER = true\nexport const DEFAULT_SHOW_NAME_TAGS = true\nexport const DEFAULT_SORT_ELEMENT_LIST = \"visibility\" as const\nexport const MAX_POSITION_HISTORY_SIZE = 30\nexport const MAX_SCROLL_MARGIN = 300\nexport const MAX_TAB_OFFSET = 20\nexport const MAX_TRAJECTORY_PREDICTION_TIME = 200\nexport const MIN_POSITION_HISTORY_SIZE = 2\nexport const MIN_SCROLL_MARGIN = 30\nexport const MIN_TAB_OFFSET = 0\nexport const MIN_TRAJECTORY_PREDICTION_TIME = 10\nexport const POSITION_HISTORY_SIZE_UNIT = \"points\"\nexport const SCROLL_MARGIN_UNIT = \"px\"\nexport const TAB_OFFSET_UNIT = \"tabs\"\nexport const TRAJECTORY_PREDICTION_TIME_UNIT = \"ms\"\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n@customElement(\"setting-item\")\nexport class SettingItem extends LitElement {\n static styles = [\n css`\n .setting-item {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 0;\n border-bottom: 1px solid rgba(80, 80, 80, 0.2);\n }\n\n .setting-item:last-child {\n border-bottom: none;\n }\n .setting-controls {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n }\n .setting-description {\n font-size: 11px;\n color: #9e9e9e;\n line-height: 1.3;\n font-weight: normal;\n }\n .setting-item label {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-weight: 500;\n color: #fff;\n font-size: 13px;\n min-width: 180px;\n }\n .setting-header {\n font-weight: 500;\n color: #fff;\n font-size: 13px;\n }\n `,\n ]\n\n @property({ type: String }) header: string = \"\"\n @property({ type: String }) description: string = \"\"\n\n render() {\n return html`<div class=\"setting-item\">\n <label>\n <span class=\"setting-header\">${this.header}</span>\n <span class=\"setting-description\"> ${this.description} </span>\n </label>\n <div class=\"setting-controls\">\n <slot name=\"controls\"></slot>\n </div>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"setting-item\": SettingItem\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\nimport \"./setting-item\"\nimport { ForesightManager, type ForesightManagerSettings } from \"js.foresight\"\nimport type { DevtoolsSettings, ShowKey } from \"../../../../types/types\"\n\ntype ShowSettingKey = `show.${ShowKey}`\n@customElement(\"setting-item-checkbox\")\nexport class SettingItemCheckbox extends LitElement {\n static styles = [\n css`\n input[type=\"checkbox\"] {\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n position: relative;\n width: 44px;\n height: 22px;\n background-color: #444;\n cursor: pointer;\n outline: none;\n transition: all 0.3s ease;\n vertical-align: middle;\n flex-shrink: 0;\n margin: 0;\n border: 2px solid #555;\n }\n\n input[type=\"checkbox\"]::before {\n content: \"\";\n position: absolute;\n width: 16px;\n height: 16px;\n background-color: white;\n top: 1px;\n left: 1px;\n transition: all 0.3s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n }\n\n input[type=\"checkbox\"]:checked {\n background-color: #b0c4de;\n border-color: #b0c4de;\n }\n\n input[type=\"checkbox\"]:checked::before {\n transform: translateX(22px);\n background-color: white;\n }\n\n input[type=\"checkbox\"]:hover {\n box-shadow: 0 0 0 3px rgba(176, 196, 222, 0.1);\n }\n `,\n ]\n\n @property({ type: Boolean }) isChecked: boolean = false\n @property({ type: String }) header: string = \"\"\n @property({ type: String }) description: string = \"\"\n @property({ type: String }) setting:\n | keyof ForesightManagerSettings\n | keyof DevtoolsSettings\n | ShowSettingKey = \"enableMousePrediction\"\n\n private handleCheckboxChange(event: Event): void {\n const target = event.target\n if (target instanceof HTMLInputElement) {\n const targetIsChecked = target.checked\n\n if (String(this.setting).startsWith(\"show.\")) {\n this.dispatchEvent(\n new CustomEvent(\"setting-changed\", {\n detail: { setting: this.setting, value: targetIsChecked },\n bubbles: true,\n })\n )\n } else {\n ForesightManager.instance.alterGlobalSettings({\n [this.setting]: targetIsChecked,\n })\n }\n }\n }\n\n render() {\n return html`<setting-item header=${this.header} description=${this.description}>\n <input\n slot=\"controls\"\n type=\"checkbox\"\n .checked=${this.isChecked}\n @change=${this.handleCheckboxChange}\n />\n </setting-item>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"setting-item-checkbox\": SettingItemCheckbox\n }\n}\n","import { LitElement, html, css, type PropertyValues } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\n\nimport \"./setting-item\"\nimport { ForesightManager, type ForesightManagerSettings } from \"js.foresight\"\n@customElement(\"setting-item-range\")\nexport class SettingItemRange extends LitElement {\n static styles = [\n css`\n .setting-range-value {\n font-size: 12px;\n color: #b0c4de;\n font-weight: 500;\n min-width: 45px;\n text-align: right;\n }\n\n .range-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n }\n\n input[type=\"range\"] {\n margin: 0;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n background: transparent;\n height: 22px;\n vertical-align: middle;\n width: 100px;\n }\n\n input[type=\"range\"]::-webkit-slider-runnable-track {\n height: 6px;\n background: #444;\n border: 1px solid #555;\n }\n\n input[type=\"range\"]::-moz-range-track {\n height: 6px;\n background: #444;\n border: 1px solid #555;\n }\n\n input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n margin-top: -7px;\n background: #b0c4de;\n height: 20px;\n width: 20px;\n border: 2px solid #333;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n transition: all 0.2s ease;\n }\n\n input[type=\"range\"]::-moz-range-thumb {\n background: #b0c4de;\n height: 20px;\n width: 20px;\n border: 2px solid #333;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n transition: all 0.2s ease;\n }\n\n input[type=\"range\"]:hover::-webkit-slider-thumb {\n transform: scale(1.1);\n box-shadow: 0 0 0 4px rgba(176, 196, 222, 0.2);\n }\n\n input[type=\"range\"]:hover::-moz-range-thumb {\n transform: scale(1.1);\n box-shadow: 0 0 0 4px rgba(176, 196, 222, 0.2);\n }\n `,\n ]\n\n @property({ type: Number }) minValue: number = 0\n @property({ type: Number }) maxValue: number = 100\n @property({ type: Number }) currentValue: number = 50\n @property({ type: String }) unit: string = \"px\"\n @property({ type: String }) header: string = \"\"\n @property({ type: String }) description: string = \"\"\n @property({ type: String }) setting: keyof ForesightManagerSettings = \"tabOffset\"\n\n @state() private displayValue: number = 50\n\n private handleRangeInput(event: Event): void {\n const target = event.target\n if (target instanceof HTMLInputElement) {\n this.displayValue = parseInt(target.value, 10)\n }\n }\n\n private handleRangeChange(event: Event): void {\n const target = event.target\n if (target instanceof HTMLInputElement) {\n const value = parseInt(target.value, 10)\n this.displayValue = value\n ForesightManager.instance.alterGlobalSettings({\n [this.setting]: value,\n })\n }\n }\n\n willUpdate(changedProperties: PropertyValues) {\n super.willUpdate(changedProperties)\n if (changedProperties.has(\"currentValue\")) {\n this.displayValue = this.currentValue\n }\n }\n\n render() {\n return html`<setting-item header=${this.header} description=${this.description}>\n <div slot=\"controls\" class=\"range-wrapper\">\n <input\n slot=\"controls\"\n type=\"range\"\n min=\"${this.minValue}\"\n max=\"${this.maxValue}\"\n step=\"1\"\n .value=${this.displayValue}\n @input=${this.handleRangeInput}\n @change=${this.handleRangeChange}\n />\n <span class=\"setting-range-value\">${this.displayValue} ${this.unit}</span>\n </div>\n </setting-item>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"setting-item-range\": SettingItemRange\n }\n}\n","import type {\n ForesightManagerSettings,\n TouchDeviceStrategy,\n MinimumConnectionType,\n UpdatedManagerSetting,\n} from \"js.foresight\"\nimport { ForesightManager } from \"js.foresight\"\nimport { css, html, LitElement } from \"lit\"\nimport { customElement, state } from \"lit/decorators.js\"\n\nimport {\n SHOW_KEYS,\n type Corner,\n type DevtoolsSettings,\n type ShowKey,\n type ShowSettings,\n} from \"../../../types/types\"\nimport {\n MAX_POSITION_HISTORY_SIZE,\n MAX_SCROLL_MARGIN,\n MAX_TAB_OFFSET,\n MAX_TRAJECTORY_PREDICTION_TIME,\n MIN_POSITION_HISTORY_SIZE,\n MIN_SCROLL_MARGIN,\n MIN_TAB_OFFSET,\n MIN_TRAJECTORY_PREDICTION_TIME,\n POSITION_HISTORY_SIZE_UNIT,\n SCROLL_MARGIN_UNIT,\n TAB_OFFSET_UNIT,\n TRAJECTORY_PREDICTION_TIME_UNIT,\n} from \"../../../constants\"\nimport \"../base-tab/tab-content\"\nimport \"../base-tab/tab-header\"\nimport \"../copy-icon/copy-icon\"\nimport \"./setting-item/setting-item-checkbox\"\nimport \"./setting-item/setting-item-range\"\nimport \"./setting-item/setting-item\"\nimport \"../dropdown/single-select-dropdown\"\nimport type { DropdownOption } from \"../dropdown/single-select-dropdown\"\nimport \"../base-tab/chip\"\nimport { ForesightDevtools } from \"../../foresight-devtools\"\n\n// A helper type to represent a change in a Devtools setting\ntype UpdatedDevtoolsSetting = {\n [K in ShowKey]: {\n setting: `show.${K}`\n newValue: ShowSettings[K]\n oldValue: ShowSettings[K]\n }\n}[ShowKey]\n\n@customElement(\"settings-tab\")\nexport class SettingsTab extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .settings-content {\n display: block;\n }\n\n .settings-section {\n display: flex;\n flex-direction: column;\n gap: 16px;\n }\n\n .settings-group {\n background: rgba(30, 30, 30, 0.6);\n padding: 16px;\n border: 1px solid rgba(176, 196, 222, 0.1);\n }\n\n .settings-group h4 {\n margin: 0 0 12px 0;\n font-size: 14px;\n font-weight: 600;\n color: #b0c4de;\n border-bottom: 1px solid rgba(176, 196, 222, 0.2);\n padding-bottom: 8px;\n }\n `\n\n @state() private managerSettings: ForesightManagerSettings\n @state() private initialSettings: Readonly<{\n manager: ForesightManagerSettings\n devtools: DevtoolsSettings\n }>\n @state() private devtoolsSettings: DevtoolsSettings\n @state() private changedSettings: (UpdatedManagerSetting | UpdatedDevtoolsSetting)[] = []\n @state() private currentCorner: Corner = \"bottom-right\"\n @state() private touchDeviceStrategyOptions: DropdownOption[] = [\n {\n value: \"onTouchStart\",\n label: \"On Touch Start\",\n title: \"Execute callbacks when user touches registered elements\",\n icon: html`<span>Touch</span>`,\n },\n {\n value: \"viewport\",\n label: \"Viewport Entry\",\n title: \"Execute callbacks when registered elements enter the viewport\",\n icon: html`<span>Viewport</span>`,\n },\n {\n value: \"none\",\n label: \"None\",\n title: \"Disable touch device prediction\",\n icon: html`<span>None</span>`,\n },\n ]\n\n @state() private minimumConnectionTypeOptions: DropdownOption[] = [\n {\n value: \"slow-2g\",\n label: \"Slow 2G\",\n title: \"Slow 2G\",\n icon: html`<span>Slow 2G</span>`,\n },\n {\n value: \"2g\",\n label: \"2G\",\n title: \"2G\",\n icon: html`<span>2G</span>`,\n },\n {\n value: \"3g\",\n label: \"3G\",\n title: \"3G\",\n icon: html`<span>3G</span>`,\n },\n {\n value: \"4g\",\n label: \"4G\",\n title: \"4G\",\n icon: html`<span>4G</span>`,\n },\n ]\n\n @state() private cornerOptions: DropdownOption[] = [\n {\n value: \"top-left\",\n label: \"Top Left\",\n title: \"Position control panel in top-left corner\",\n icon: html`<span>↖</span>`,\n },\n {\n value: \"top-right\",\n label: \"Top Right\",\n title: \"Position control panel in top-right corner\",\n icon: html`<span>↗</span>`,\n },\n {\n value: \"bottom-left\",\n label: \"Bottom Left\",\n title: \"Position control panel in bottom-left corner\",\n icon: html`<span>↙</span>`,\n },\n {\n value: \"bottom-right\",\n label: \"Bottom Right\",\n title: \"Position control panel in bottom-right corner\",\n icon: html`<span>↘</span>`,\n },\n ]\n\n private _abortController: AbortController | null = null\n\n constructor() {\n super()\n const currentDevtoolsSettings = ForesightDevtools.instance.devtoolsSettings\n const currentManagerSettings = ForesightManager.instance.getManagerData.globalSettings\n\n // Shallow copy is sufficient except for `show`, which we deep-copy so\n // the live and initial snapshots can diverge as the user toggles flags.\n this.devtoolsSettings = {\n ...currentDevtoolsSettings,\n show: { ...currentDevtoolsSettings.show },\n }\n this.managerSettings = Object.assign({}, currentManagerSettings)\n this.currentCorner = this.getCurrentCorner()\n\n this.initialSettings = {\n devtools: {\n ...currentDevtoolsSettings,\n show: { ...currentDevtoolsSettings.show },\n },\n manager: Object.assign({}, currentManagerSettings),\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this._abortController = new AbortController()\n const { signal } = this._abortController\n ForesightManager.instance.addEventListener(\n \"managerSettingsChanged\",\n e => {\n this.managerSettings = e.managerData.globalSettings\n this._updateChangedSettings()\n },\n { signal }\n )\n\n this._updateChangedSettings()\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this._abortController?.abort()\n this._abortController = null\n }\n\n private _updateChangedSettings(): void {\n const changes: (UpdatedManagerSetting | UpdatedDevtoolsSetting)[] = []\n this._checkManagerSettingsChanges(changes)\n this._checkDevtoolsSettingsChanges(changes)\n this.changedSettings = changes\n }\n\n private _checkManagerSettingsChanges(\n changes: (UpdatedManagerSetting | UpdatedDevtoolsSetting)[]\n ): void {\n const managerKeys: (keyof ForesightManagerSettings)[] = [\n \"enableMousePrediction\",\n \"enableTabPrediction\",\n \"enableScrollPrediction\",\n \"trajectoryPredictionTime\",\n \"positionHistorySize\",\n \"tabOffset\",\n \"scrollMargin\",\n \"touchDeviceStrategy\",\n \"minimumConnectionType\",\n ]\n\n for (const key of managerKeys) {\n const oldValue = this.initialSettings.manager[key]\n const newValue = this.managerSettings[key]\n if (oldValue !== newValue) {\n changes.push({\n setting: key,\n oldValue,\n newValue,\n } as UpdatedManagerSetting)\n }\n }\n }\n\n private _checkDevtoolsSettingsChanges(\n changes: (UpdatedManagerSetting | UpdatedDevtoolsSetting)[]\n ): void {\n for (const key of SHOW_KEYS) {\n const oldValue = this.initialSettings.devtools.show[key]\n const newValue = this.devtoolsSettings.show[key]\n if (oldValue !== newValue) {\n changes.push({\n setting: `show.${key}`,\n oldValue,\n newValue,\n } as UpdatedDevtoolsSetting)\n }\n }\n }\n\n private _handleDevtoolsSettingChange(e: CustomEvent<{ setting: string; value: boolean }>): void {\n const { setting, value } = e.detail\n\n if (!setting.startsWith(\"show.\")) {\n return\n }\n\n const key = setting.slice(\"show.\".length) as ShowKey\n if (!SHOW_KEYS.includes(key)) {\n return\n }\n\n this.devtoolsSettings = {\n ...this.devtoolsSettings,\n show: { ...this.devtoolsSettings.show, [key]: value },\n }\n ForesightDevtools.instance.alterDevtoolsSettings({ show: { [key]: value } })\n this._updateChangedSettings()\n }\n\n private _handleTouchDeviceStrategyChange = (value: string): void => {\n ForesightManager.instance.alterGlobalSettings({\n touchDeviceStrategy: value as TouchDeviceStrategy,\n })\n }\n\n private _handleMinimumConnectionTypeChange = (value: string): void => {\n ForesightManager.instance.alterGlobalSettings({\n minimumConnectionType: value as MinimumConnectionType,\n })\n }\n\n private _handleCornerChange = (value: Corner): void => {\n this.currentCorner = value\n // Dispatch custom event that bubbles up to control panel\n this.dispatchEvent(\n new CustomEvent(\"corner-change\", {\n detail: { corner: value },\n bubbles: true,\n composed: true,\n })\n )\n }\n\n private getCurrentCorner(): Corner {\n // Get corner from localStorage directly since it's the source of truth\n try {\n const stored = localStorage.getItem(\"foresight-devtools-control-panel-corner\")\n if (stored && [\"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\"].includes(stored)) {\n return stored as Corner\n }\n } catch (error) {\n console.warn(\"ForesightDevtools: Failed to load corner from localStorage:\", error)\n }\n\n return \"bottom-right\"\n }\n\n private async handleCopySettings(): Promise<void> {\n if (!this.managerSettings) {\n return\n }\n\n try {\n const settingsCode = this.generateSettingsCode(this.managerSettings)\n if (navigator.clipboard && navigator.clipboard.writeText) {\n await navigator.clipboard.writeText(settingsCode)\n }\n } catch (error) {\n console.error(\"Failed to copy settings code:\", error)\n }\n }\n\n private generateSettingsCode(settings: ForesightManagerSettings): string {\n const settingsObject = {\n enableMousePrediction: settings.enableMousePrediction,\n enableTabPrediction: settings.enableTabPrediction,\n enableScrollPrediction: settings.enableScrollPrediction,\n positionHistorySize: settings.positionHistorySize,\n trajectoryPredictionTime: settings.trajectoryPredictionTime,\n tabOffset: settings.tabOffset,\n scrollMargin: settings.scrollMargin,\n touchDeviceStrategy: settings.touchDeviceStrategy,\n minimumConnectionType: settings.minimumConnectionType,\n }\n\n return `ForesightManager.initialize(${JSON.stringify(settingsObject, null, 2)})`\n }\n\n render() {\n if (!this.managerSettings || !this.devtoolsSettings) {\n return html`<tab-content\n .noContentMessage=${\"Loading settings...\"}\n .hasContent=${false}\n ></tab-content>`\n }\n\n const settings = this.managerSettings\n\n const chipTitle =\n this.changedSettings.length > 0\n ? `Settings that have been changed this session compared to your initialized settings.\\nClick on the copy icon to easely copy the new setting into your project\\n\\n` +\n this.changedSettings\n .map(\n change =>\n `${change.setting}: ${JSON.stringify(change.oldValue)} -> ${JSON.stringify(\n change.newValue\n )}`\n )\n .join(\"\\n\")\n : \"No settings changed from initial values\"\n\n return html`\n <tab-header>\n <div slot=\"chips\" class=\"chips-container\">\n <chip-element .title=${chipTitle}> ${this.changedSettings.length} changed </chip-element>\n </div>\n <div slot=\"actions\">\n <copy-icon\n title=\"Copy current settings as code\"\n .onCopy=${() => this.handleCopySettings()}\n ></copy-icon>\n </div>\n </tab-header>\n\n <tab-content .hasContent=${true}>\n <div class=\"settings-content\">\n <div class=\"settings-section\">\n <div class=\"settings-group\">\n <h4>Mouse Prediction</h4>\n <setting-item-checkbox\n .isChecked=${settings.enableMousePrediction}\n header=\"Enable Mouse Prediction\"\n description=\"Execute callbacks when mouse is ${settings.trajectoryPredictionTime}ms away from registered elements in mouse direction\"\n setting=\"enableMousePrediction\"\n ></setting-item-checkbox>\n <setting-item-range\n .currentValue=${settings.trajectoryPredictionTime}\n .maxValue=${MAX_TRAJECTORY_PREDICTION_TIME}\n .minValue=${MIN_TRAJECTORY_PREDICTION_TIME}\n .unit=${TRAJECTORY_PREDICTION_TIME_UNIT}\n header=\"Prediction Time\"\n description=\"How far into the future to calculate mouse trajectory path\"\n setting=\"trajectoryPredictionTime\"\n ></setting-item-range>\n <setting-item-range\n .currentValue=${settings.positionHistorySize}\n .maxValue=${MAX_POSITION_HISTORY_SIZE}\n .minValue=${MIN_POSITION_HISTORY_SIZE}\n .unit=${POSITION_HISTORY_SIZE_UNIT}\n header=\"Position History Size\"\n description=\"How far into the future, in ${POSITION_HISTORY_SIZE_UNIT}, to calculate mouse trajectory path\"\n setting=\"positionHistorySize\"\n >\n </setting-item-range>\n </div>\n <div class=\"settings-group\">\n <h4>Keyboard Navigation</h4>\n <setting-item-checkbox\n .isChecked=${settings.enableTabPrediction}\n header=\"Enable Tab Prediction\"\n description=\"Execute callbacks when user ${settings.tabOffset} tabbable elements away from registered elements in tab direction\"\n setting=\"enableTabPrediction\"\n >\n </setting-item-checkbox>\n <setting-item-range\n .currentValue=${settings.tabOffset}\n .maxValue=${MAX_TAB_OFFSET}\n .minValue=${MIN_TAB_OFFSET}\n .unit=${TAB_OFFSET_UNIT}\n header=\"Tab Offset\"\n description=\"Number of tabbable elements to look ahead when predicting navigation\"\n setting=\"tabOffset\"\n >\n </setting-item-range>\n </div>\n\n <div class=\"settings-group\">\n <h4>Scroll Prediction</h4>\n <setting-item-checkbox\n .isChecked=${settings.enableScrollPrediction}\n header=\"Enable Scroll Prediction\"\n description=\"Execute callbacks when user is ${settings.scrollMargin}px away from registered elements in scroll direction\"\n setting=\"enableScrollPrediction\"\n ></setting-item-checkbox>\n <setting-item-range\n .currentValue=${settings.scrollMargin}\n .maxValue=${MAX_SCROLL_MARGIN}\n .minValue=${MIN_SCROLL_MARGIN}\n .unit=${SCROLL_MARGIN_UNIT}\n header=\"Scroll Margin\"\n description=\"Pixel distance to check from mouse position in scroll direction\"\n setting=\"scrollMargin\"\n ></setting-item-range>\n </div>\n\n <div class=\"settings-group\">\n <h4>Touch Device</h4>\n <setting-item\n header=\"Touch Device Strategy\"\n description=\"How to handle prediction on touch devices\"\n >\n <single-select-dropdown\n slot=\"controls\"\n .dropdownOptions=${this.touchDeviceStrategyOptions}\n .selectedOptionValue=${settings.touchDeviceStrategy}\n .onSelectionChange=${this._handleTouchDeviceStrategyChange}\n ></single-select-dropdown>\n </setting-item>\n </div>\n\n <div class=\"settings-group\">\n <h4>Minimum Connection</h4>\n <setting-item\n header=\"Minimum Connection Type\"\n description=\"Minimum connection speed required to register elements\"\n >\n <single-select-dropdown\n slot=\"controls\"\n .dropdownOptions=${this.minimumConnectionTypeOptions}\n .selectedOptionValue=${settings.minimumConnectionType}\n .onSelectionChange=${this._handleMinimumConnectionTypeChange}\n ></single-select-dropdown>\n </setting-item>\n </div>\n\n <!-- Developer Tools Group -->\n <div class=\"settings-group\">\n <h4>Developer Tools</h4>\n <setting-item-checkbox\n .isChecked=${this.devtoolsSettings.show.nameTags}\n header=\"Show Name Tags\"\n description=\"Display name tags over each registered element in the debugger\"\n setting=\"show.nameTags\"\n @setting-changed=${this._handleDevtoolsSettingChange}\n ></setting-item-checkbox>\n <setting-item-checkbox\n .isChecked=${this.devtoolsSettings.show.elementOverlays}\n header=\"Show Element Overlays\"\n description=\"Render hit-slop boundary overlays around registered elements. Note: turning this off also hides name tags.\"\n setting=\"show.elementOverlays\"\n @setting-changed=${this._handleDevtoolsSettingChange}\n ></setting-item-checkbox>\n <setting-item-checkbox\n .isChecked=${this.devtoolsSettings.show.mouseTrajectory}\n header=\"Show Mouse Trajectory\"\n description=\"Render the predicted mouse trajectory line\"\n setting=\"show.mouseTrajectory\"\n @setting-changed=${this._handleDevtoolsSettingChange}\n ></setting-item-checkbox>\n <setting-item-checkbox\n .isChecked=${this.devtoolsSettings.show.scrollTrajectory}\n header=\"Show Scroll Trajectory\"\n description=\"Render the predicted scroll trajectory line\"\n setting=\"show.scrollTrajectory\"\n @setting-changed=${this._handleDevtoolsSettingChange}\n ></setting-item-checkbox>\n <setting-item\n header=\"Panel Position\"\n description=\"Choose which corner to position the control panel\"\n >\n <single-select-dropdown\n slot=\"controls\"\n .dropdownOptions=${this.cornerOptions}\n .selectedOptionValue=${this.currentCorner}\n .onSelectionChange=${this._handleCornerChange}\n ></single-select-dropdown>\n </setting-item>\n </div>\n </div>\n </div>\n </tab-content>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"settings-tab\": SettingsTab\n }\n}\n","import { LitElement, css, html } from \"lit\"\nimport { customElement, state } from \"lit/decorators.js\"\nimport { ForesightManager } from \"js.foresight\"\n\nimport \"./element-tab/element-tab\"\nimport \"./base-tab/tab-selector\"\nimport \"./log-tab/log-tab\"\nimport \"./settings-tab/settings-tab\"\nimport { getEventLogStore } from \"./log-tab/log-store\"\nimport type { ControllerTabs, Corner } from \"../../types/types\"\nimport { ForesightDevtools } from \"../foresight-devtools\"\n\n@customElement(\"control-panel\")\nexport class ControlPanel extends LitElement {\n static styles = css`\n .control-wrapper {\n --panel-offset: 10px;\n padding: 12px;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.9);\n color: white;\n font-family: Arial, sans-serif;\n font-size: 13px;\n z-index: 10001;\n pointer-events: auto;\n display: flex;\n flex-direction: column;\n width: 450px;\n height: 450px;\n transition:\n width 0.3s ease,\n height 0.3s ease;\n box-sizing: border-box;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n }\n\n .control-wrapper.top-left {\n top: var(--panel-offset);\n left: var(--panel-offset);\n }\n .control-wrapper.top-right {\n top: var(--panel-offset);\n right: var(--panel-offset);\n }\n .control-wrapper.bottom-left {\n bottom: var(--panel-offset);\n left: var(--panel-offset);\n }\n .control-wrapper.bottom-right {\n bottom: var(--panel-offset);\n right: var(--panel-offset);\n }\n\n .control-wrapper.minimized {\n width: 230px;\n height: 45px;\n }\n\n .title-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0;\n flex-shrink: 0;\n }\n\n .title-wrapper h1 {\n margin: 0;\n font-size: 15px;\n }\n\n .minimize-button {\n background: none;\n border: none;\n color: white;\n font-size: 22px;\n cursor: pointer;\n line-height: 1;\n padding: 0;\n }\n\n .tab-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n }\n\n .tab-content {\n flex: 1;\n position: relative;\n }\n\n .tab-content > * {\n display: flex;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n .touch-device-warning {\n background-color: rgba(255, 193, 7, 0.9);\n color: #000;\n padding: 8px 12px;\n margin: 8px 0;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n }\n\n .touch-device-warning.hidden {\n display: none;\n }\n\n .warning-content {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .warning-icon {\n font-weight: bold;\n font-size: 14px;\n }\n\n .dismiss-button {\n background: none;\n border: none;\n color: #000;\n font-size: 16px;\n cursor: pointer;\n padding: 0;\n line-height: 1;\n font-weight: bold;\n }\n\n .dismiss-button:hover {\n opacity: 0.7;\n }\n `\n @state() private activeTab: ControllerTabs\n @state() private isMinimized: boolean =\n ForesightDevtools.instance.devtoolsSettings.isControlPanelDefaultMinimized\n @state() private isTouchDevice: boolean = false\n @state() private isWarningDismissed: boolean = false\n @state() private corner: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\" =\n \"bottom-right\"\n\n private localStorageSelectedTabKey = \"foresight-devtools-control-panel-tab\"\n private localStorageCornerKey = \"foresight-devtools-control-panel-corner\"\n private _abortController: AbortController | null = null\n\n constructor() {\n super()\n this.activeTab = this.getStoredTab()\n this.corner = this.getStoredCorner()\n this.isTouchDevice = ForesightManager.instance.getManagerData.currentDeviceStrategy === \"touch\"\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this._abortController = new AbortController()\n const { signal } = this._abortController\n\n getEventLogStore().attach()\n\n ForesightManager.instance.addEventListener(\n \"deviceStrategyChanged\",\n e => {\n this.isTouchDevice = e.newStrategy === \"touch\"\n if (e.newStrategy === \"touch\") {\n this.isWarningDismissed = false\n }\n },\n { signal }\n )\n\n // Listen for corner change events\n this.addEventListener(\n \"corner-change\",\n ((e: CustomEvent) => {\n this.setCorner(e.detail.corner)\n }) as EventListener,\n { signal }\n )\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this._abortController?.abort()\n this._abortController = null\n getEventLogStore().detach()\n }\n\n private getStoredTab(): ControllerTabs {\n try {\n const tab = localStorage.getItem(this.localStorageSelectedTabKey)\n\n return (tab as ControllerTabs) || \"logs\"\n } catch (error) {\n console.error(error)\n\n return \"logs\"\n }\n }\n\n private getStoredCorner(): Corner {\n try {\n const stored = localStorage.getItem(this.localStorageCornerKey)\n if (stored) {\n return stored as Corner\n }\n } catch (error) {\n console.error(\"ForesightDevtools: Failed to load corner from localStorage:\", error)\n }\n\n return \"bottom-right\"\n }\n\n private _handleTabChange(event: CustomEvent) {\n this.activeTab = event.detail.tab\n this.setStoredTab(this.activeTab)\n }\n\n private setStoredTab(tab: ControllerTabs): void {\n try {\n localStorage.setItem(this.localStorageSelectedTabKey, tab)\n } catch (error) {\n console.warn(\"ForesightDevtools: Failed to save tab preference to localStorage:\", error)\n }\n }\n\n private setStoredCorner(corner: Corner): void {\n try {\n localStorage.setItem(this.localStorageCornerKey, corner)\n } catch (error) {\n console.warn(\"ForesightDevtools: Failed to save corner to localStorage:\", error)\n }\n }\n\n private dismissWarning(): void {\n this.isWarningDismissed = true\n }\n\n public setCorner(corner: Corner): void {\n this.corner = corner\n this.setStoredCorner(this.corner)\n this.requestUpdate()\n }\n\n private handleMinimizeClick(event: Event): void {\n event.stopPropagation()\n this.isMinimized = !this.isMinimized\n }\n\n private getMinimizeSymbol(): string {\n return this.isMinimized ? \"+\" : \"−\"\n }\n\n /**\n * Only the active tab is mounted; hidden tabs would otherwise keep their\n * manager listeners and element subscriptions running invisibly.\n */\n private renderActiveTab() {\n switch (this.activeTab) {\n case \"elements\":\n return html`<element-tab></element-tab>`\n case \"settings\":\n return html`<settings-tab></settings-tab>`\n case \"logs\":\n default:\n return html`<log-tab></log-tab>`\n }\n }\n\n protected render() {\n return html`\n <div class=\"control-wrapper ${this.corner} ${this.isMinimized ? \"minimized\" : \"\"}\">\n <div class=\"title-wrapper\">\n <button @click=\"${this.handleMinimizeClick}\" class=\"minimize-button\">\n ${this.getMinimizeSymbol()}\n </button>\n <h1>Foresight DevTools</h1>\n <div></div>\n </div>\n\n <div\n class=\"touch-device-warning ${this.isMinimized ||\n !this.isTouchDevice ||\n this.isWarningDismissed\n ? \"hidden\"\n : \"\"}\"\n >\n <div class=\"warning-content\">\n <span class=\"warning-icon\">⚠️</span>\n <span>Touch device mode: Overlays and visibility sorting not available</span>\n </div>\n <button @click=\"${this.dismissWarning}\" class=\"dismiss-button\" title=\"Dismiss warning\">\n ×\n </button>\n </div>\n\n ${this.isMinimized\n ? \"\"\n : html`\n <div class=\"tab-container\">\n <tab-selector\n .activeTab=\"${this.activeTab}\"\n @tab-change=\"${this._handleTabChange}\"\n ></tab-selector>\n\n <div class=\"tab-content\">${this.renderActiveTab()}</div>\n </div>\n `}\n </div>\n `\n }\n}\n","import { LitElement, html, css, type PropertyValues } from \"lit\"\nimport { customElement, state, query, property } from \"lit/decorators.js\"\nimport {\n type ForesightElement,\n type ForesightElementState,\n type ElementBounds,\n type CallbackHitType,\n ForesightManager,\n} from \"js.foresight\"\nimport type {\n CallbackCompletedEvent,\n CallbackInvokedEvent,\n ElementRegisteredEvent,\n ElementUnregisteredEvent,\n} from \"js.foresight\"\n\ntype HitSlop = ForesightElementState[\"hitSlop\"]\n\ninterface ElementOverlay {\n nameLabel: HTMLElement\n slopArea: HTMLElement\n /** Last applied document-coordinate rect; unchanged means no style writes needed. */\n lastSlopRect: { left: number; top: number; width: number; height: number } | null\n /** Size + hit slop the cached border radius was computed for. */\n lastRadiusKey: string | null\n}\n\ninterface CallbackAnimation {\n element: ForesightElement\n timeoutId: ReturnType<typeof setTimeout>\n}\n\n@customElement(\"element-overlays\")\nexport class ElementOverlays extends LitElement {\n @state() private overlayMap: Map<ForesightElement, ElementOverlay> = new Map()\n @state() private callbackAnimations: Map<ForesightElement, CallbackAnimation> = new Map()\n private _elementSubscriptions: Map<ForesightElement, () => void> = new Map()\n @query(\"#overlays-container\") private containerElement!: HTMLElement\n\n @property({ type: Boolean }) showNameTags = true\n\n static styles = [\n css`\n /* Anchored to the document origin (initial containing block), not the\n viewport: overlays are placed in document coordinates so the compositor\n moves them together with the page content during scroll, instead of\n JS chasing the scroll position a frame behind. */\n :host {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n pointer-events: none;\n z-index: 9999;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .slop-area {\n position: absolute;\n top: 0;\n left: 0;\n box-sizing: border-box;\n will-change: transform;\n border: 1px dashed rgba(100, 116, 139, 0.4);\n background-color: rgba(100, 116, 139, 0.05);\n transition:\n border-color 0.2s ease,\n background-color 0.2s ease,\n box-shadow 0.2s ease;\n pointer-events: none;\n }\n\n .slop-area[data-hit=\"mouse\"] {\n border-color: #3b82f6;\n background-color: rgba(59, 130, 246, 0.1);\n animation: glow-mouse 2s ease-in-out infinite;\n }\n\n .slop-area[data-hit=\"scroll\"] {\n border-color: #eab308;\n background-color: rgba(234, 179, 8, 0.1);\n animation: glow-scroll 2s ease-in-out infinite;\n }\n\n .slop-area[data-hit=\"tab\"] {\n border-color: #f97316;\n background-color: rgba(249, 115, 22, 0.1);\n animation: glow-tab 2s ease-in-out infinite;\n }\n\n @keyframes glow-mouse {\n 0% {\n box-shadow: 0 0 5px 2px rgba(59, 130, 246, 0.3);\n }\n 50% {\n box-shadow: 0 0 15px 4px rgba(59, 130, 246, 0.6);\n }\n 100% {\n box-shadow: 0 0 5px 2px rgba(59, 130, 246, 0.3);\n }\n }\n\n @keyframes glow-scroll {\n 0% {\n box-shadow: 0 0 5px 2px rgba(234, 179, 8, 0.3);\n }\n 50% {\n box-shadow: 0 0 15px 4px rgba(234, 179, 8, 0.6);\n }\n 100% {\n box-shadow: 0 0 5px 2px rgba(234, 179, 8, 0.3);\n }\n }\n\n @keyframes glow-tab {\n 0% {\n box-shadow: 0 0 5px 2px rgba(249, 115, 22, 0.3);\n }\n 50% {\n box-shadow: 0 0 15px 4px rgba(249, 115, 22, 0.6);\n }\n 100% {\n box-shadow: 0 0 5px 2px rgba(249, 115, 22, 0.3);\n }\n }\n\n .name-label {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n background-color: rgba(27, 31, 35, 0.85);\n backdrop-filter: blur(4px);\n color: white;\n padding: 4px 8px;\n font-size: 11px;\n font-family:\n -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif,\n \"Apple Color Emoji\", \"Segoe UI Emoji\";\n z-index: 10001;\n white-space: nowrap;\n pointer-events: none;\n }\n `,\n ]\n\n private _abortController: AbortController | null = null\n\n connectedCallback(): void {\n super.connectedCallback()\n this._abortController = new AbortController()\n const { signal } = this._abortController\n ForesightManager.instance.addEventListener(\n \"elementRegistered\",\n (e: ElementRegisteredEvent) => {\n this._subscribeToElement(e.element)\n if (e.state.isIntersectingWithViewport) {\n this.createOrUpdateElementOverlay(e.element, e.state)\n }\n },\n { signal }\n )\n ForesightManager.instance.addEventListener(\n \"elementUnregistered\",\n (e: ElementUnregisteredEvent) => {\n this._unsubscribeFromElement(e.element)\n this.removeElementOverlay(e.element)\n },\n { signal }\n )\n\n // Subscribe to already-registered elements\n for (const [element, state] of ForesightManager.instance.registeredElements) {\n this._subscribeToElement(element)\n if (state.isIntersectingWithViewport && state.isActive) {\n this.createOrUpdateElementOverlay(element, state)\n }\n }\n ForesightManager.instance.addEventListener(\n \"callbackInvoked\",\n (e: CallbackInvokedEvent) => {\n this.highlightElementCallback(e.element, e.hitType)\n },\n { signal }\n )\n ForesightManager.instance.addEventListener(\n \"callbackCompleted\",\n (e: CallbackCompletedEvent) => {\n this.unhighlightElementCallback(e.element)\n this.removeElementOverlay(e.element)\n },\n { signal }\n )\n }\n\n protected willUpdate(changed: PropertyValues<this>): void {\n if (changed.has(\"showNameTags\")) {\n this.updateNameTagVisibility(this.showNameTags)\n }\n }\n\n private _subscribeToElement(element: ForesightElement): void {\n if (this._elementSubscriptions.has(element)) {\n return\n }\n\n const update = () => {\n const state = ForesightManager.instance.registeredElements.get(element)\n if (!state || !state.isIntersectingWithViewport || !state.isActive) {\n this.removeElementOverlay(element)\n\n return\n }\n\n this.createOrUpdateElementOverlay(element, state)\n }\n\n // State and geometry are published on separate channels: logical changes\n // (active/intersecting/name) come through subscribeToElement, rect changes\n // during scroll/resize through subscribeToElementBounds.\n const unsubscribeState = ForesightManager.instance.subscribeToElement(element, update)\n const unsubscribeBounds = ForesightManager.instance.subscribeToElementBounds(element, update)\n\n if (unsubscribeState || unsubscribeBounds) {\n this._elementSubscriptions.set(element, () => {\n unsubscribeState?.()\n unsubscribeBounds?.()\n })\n }\n }\n\n private _unsubscribeFromElement(element: ForesightElement): void {\n this._elementSubscriptions.get(element)?.()\n this._elementSubscriptions.delete(element)\n }\n\n private createOverlay(element: ForesightElement): ElementOverlay {\n const slopArea = document.createElement(\"div\")\n slopArea.className = \"slop-area\"\n const nameLabel = document.createElement(\"div\")\n nameLabel.className = \"name-label\"\n this.containerElement.appendChild(slopArea)\n this.containerElement.appendChild(nameLabel)\n const overlay = { nameLabel, slopArea, lastSlopRect: null, lastRadiusKey: null }\n this.overlayMap.set(element, overlay)\n\n return overlay\n }\n\n /**\n * The slop area is the element's own shape offset outward by the hit slop:\n * every corner keeps the element's border radius, grown by the slop on each\n * axis. Sharp corners stay sharp, since offsetting a rectangle outward does\n * not round its corners.\n */\n private expandedBorderRadius(element: ForesightElement, hitSlop: HitSlop): string {\n const style = getComputedStyle(element as HTMLElement)\n const rect = (element as HTMLElement).getBoundingClientRect()\n\n const corner = (value: string, slopX: number, slopY: number): [number, number] => {\n const [xRaw, yRaw = xRaw] = value.split(\" \")\n const parse = (raw: string, base: number) => {\n const parsed = parseFloat(raw) || 0\n\n return raw.endsWith(\"%\") ? (parsed / 100) * base : parsed\n }\n const x = parse(xRaw, rect.width)\n const y = parse(yRaw, rect.height)\n\n return [x === 0 ? 0 : x + slopX, y === 0 ? 0 : y + slopY]\n }\n\n const tl = corner(style.borderTopLeftRadius, hitSlop.left, hitSlop.top)\n const tr = corner(style.borderTopRightRadius, hitSlop.right, hitSlop.top)\n const br = corner(style.borderBottomRightRadius, hitSlop.right, hitSlop.bottom)\n const bl = corner(style.borderBottomLeftRadius, hitSlop.left, hitSlop.bottom)\n\n return `${tl[0]}px ${tr[0]}px ${br[0]}px ${bl[0]}px / ${tl[1]}px ${tr[1]}px ${br[1]}px ${bl[1]}px`\n }\n\n private updateSlopArea(\n overlay: ElementOverlay,\n element: ForesightElement,\n hitSlop: HitSlop,\n bounds: ElementBounds\n ): void {\n const { expandedRect } = bounds\n // The manager reports viewport-relative rects; convert to document\n // coordinates, which stay constant during scroll.\n const left = expandedRect.left + window.scrollX\n const top = expandedRect.top + window.scrollY\n const width = expandedRect.right - expandedRect.left\n const height = expandedRect.bottom - expandedRect.top\n\n const last = overlay.lastSlopRect\n if (\n last &&\n last.left === left &&\n last.top === top &&\n last.width === width &&\n last.height === height\n ) {\n return\n }\n\n overlay.lastSlopRect = { left, top, width, height }\n\n const { style } = overlay.slopArea\n style.transform = `translate3d(${left}px, ${top}px, 0)`\n style.width = `${width}px`\n style.height = `${height}px`\n\n const radiusKey = `${width}|${height}|${hitSlop.top}|${hitSlop.right}|${hitSlop.bottom}|${hitSlop.left}`\n if (overlay.lastRadiusKey !== radiusKey) {\n overlay.lastRadiusKey = radiusKey\n style.borderRadius = this.expandedBorderRadius(element, hitSlop)\n }\n }\n\n private updateNameLabel(\n overlay: ElementOverlay,\n state: ForesightElementState,\n bounds: ElementBounds\n ): void {\n const { nameLabel } = overlay\n const { expandedRect } = bounds\n\n if (!this.showNameTags || state.name === \"unnamed\") {\n nameLabel.style.display = \"none\"\n } else {\n nameLabel.textContent = state.name\n nameLabel.style.display = \"block\"\n nameLabel.style.transform = `translate3d(${expandedRect.left + window.scrollX}px, ${\n expandedRect.top - 25 + window.scrollY\n }px, 0)`\n }\n }\n\n private createOrUpdateElementOverlay(element: ForesightElement, state: ForesightElementState) {\n const bounds = ForesightManager.instance.getElementBounds(element)\n if (!bounds) {\n return\n }\n\n let overlay = this.overlayMap.get(element)\n if (!overlay) {\n overlay = this.createOverlay(element)\n }\n\n this.updateSlopArea(overlay, element, state.hitSlop, bounds)\n this.updateNameLabel(overlay, state, bounds)\n }\n\n private removeElementOverlay(element: ForesightElement) {\n const overlay = this.overlayMap.get(element)\n if (overlay) {\n overlay.nameLabel.remove()\n overlay.slopArea.remove()\n this.overlayMap.delete(element)\n }\n\n this.clearCallbackAnimationTimeout(element)\n }\n\n private clearCallbackAnimationTimeout(element: ForesightElement) {\n const existingAnimation = this.callbackAnimations.get(element)\n if (existingAnimation) {\n clearTimeout(existingAnimation.timeoutId)\n this.callbackAnimations.delete(element)\n }\n }\n\n private highlightElementCallback(element: ForesightElement, hitType: CallbackHitType) {\n this.clearCallbackAnimationTimeout(element)\n\n const overlay = this.overlayMap.get(element)\n if (!overlay) {\n return\n }\n\n switch (hitType.kind) {\n case \"mouse\":\n case \"scroll\":\n case \"tab\":\n overlay.slopArea.dataset.hit = hitType.kind\n break\n case \"touch\":\n break\n case \"viewport\":\n break\n default:\n hitType satisfies never\n }\n }\n\n private unhighlightElementCallback(element: ForesightElement) {\n const animationDelay = setTimeout(() => {\n const overlay = this.overlayMap.get(element)\n if (overlay) {\n delete overlay.slopArea.dataset.hit\n }\n\n this.callbackAnimations.delete(element)\n }, 400)\n\n this.callbackAnimations.set(element, {\n element,\n timeoutId: animationDelay,\n })\n }\n\n public updateNameTagVisibility(showNameTags: boolean) {\n this.overlayMap.forEach(overlay => {\n const nameLabel = overlay.nameLabel\n if (!showNameTags) {\n nameLabel.style.display = \"none\"\n } else {\n nameLabel.style.display = \"block\"\n }\n })\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n for (const unsub of this._elementSubscriptions.values()) {\n unsub()\n }\n this._elementSubscriptions.clear()\n\n this.callbackAnimations.forEach(animation => {\n clearTimeout(animation.timeoutId)\n })\n this.callbackAnimations.clear()\n\n for (const overlay of this.overlayMap.values()) {\n overlay.nameLabel.remove()\n overlay.slopArea.remove()\n }\n this.overlayMap.clear()\n this._abortController?.abort()\n this._abortController = null\n }\n\n render() {\n return html` <div id=\"overlays-container\"></div> `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"element-overlays\": ElementOverlays\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport {\n ForesightManager,\n type MouseTrajectoryUpdateEvent,\n type ManagerSettingsChangedEvent,\n} from \"js.foresight\"\nimport type { ElementUnregisteredEvent } from \"js.foresight\"\nimport type { CallbackCompletedEvent } from \"js.foresight\"\n\nexport type Point = {\n x: number\n y: number\n}\n@customElement(\"mouse-trajectory\")\nexport class MouseTrajectory extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .trajectory-line {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform, width;\n transform-origin: left center;\n height: 4px;\n background: linear-gradient(90deg, #3b82f6, rgba(59, 130, 246, 0.4));\n z-index: 9999;\n border-radius: 2px;\n box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);\n }\n\n .trajectory-line::after {\n content: \"\";\n position: absolute;\n right: -6px;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border-left: 8px solid #3b82f6;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6));\n }\n `,\n ]\n\n private _abortController = new AbortController()\n private _lineEl: HTMLElement | null = null\n private _mousePredictionIsEnabled =\n ForesightManager.instance.getManagerData.globalSettings.enableMousePrediction\n private _isVisible = false\n\n connectedCallback(): void {\n super.connectedCallback()\n const { signal } = this._abortController\n\n ForesightManager.instance.addEventListener(\"callbackCompleted\", this.handleTrajectoryReset, {\n signal,\n })\n\n ForesightManager.instance.addEventListener(\"elementUnregistered\", this.handleTrajectoryReset, {\n signal,\n })\n\n ForesightManager.instance.addEventListener(\n \"mouseTrajectoryUpdate\",\n this.handleTrajectoryUpdate,\n { signal }\n )\n\n ForesightManager.instance.addEventListener(\n \"scrollTrajectoryUpdate\",\n () => {\n this._setVisible(false)\n },\n { signal }\n )\n\n ForesightManager.instance.addEventListener(\n \"managerSettingsChanged\",\n this.handleSettingsChange,\n { signal }\n )\n }\n\n protected firstUpdated(): void {\n this._lineEl = this.shadowRoot!.querySelector<HTMLElement>(\".trajectory-line\")\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this._abortController.abort()\n }\n\n private _setVisible(visible: boolean): void {\n if (this._isVisible === visible) {\n return\n }\n\n this._isVisible = visible\n if (this._lineEl) {\n this._lineEl.style.display = visible ? \"block\" : \"none\"\n }\n }\n\n private handleTrajectoryReset = (e: CallbackCompletedEvent | ElementUnregisteredEvent) => {\n const shouldReset =\n (\"wasLastActiveElement\" in e && e.wasLastActiveElement) ||\n (\"wasLastRegisteredElement\" in e && e.wasLastRegisteredElement)\n\n if (shouldReset) {\n this._setVisible(false)\n if (this._lineEl) {\n this._lineEl.style.transform = \"translate3d(0px, 0px, 0) rotate(0deg)\"\n this._lineEl.style.width = \"0px\"\n }\n }\n }\n\n private handleSettingsChange = (e: ManagerSettingsChangedEvent) => {\n const isEnabled = e.managerData.globalSettings.enableMousePrediction\n this._mousePredictionIsEnabled = isEnabled\n if (!isEnabled) {\n this._setVisible(false)\n }\n }\n\n private handleTrajectoryUpdate = (e: MouseTrajectoryUpdateEvent) => {\n if (!this._mousePredictionIsEnabled) {\n return\n }\n\n this._setVisible(true)\n\n const { currentPoint, predictedPoint } = e.trajectoryPositions\n const dx = predictedPoint.x - currentPoint.x\n const dy = predictedPoint.y - currentPoint.y\n const length = Math.sqrt(dx * dx + dy * dy)\n const angle = Math.atan2(dy, dx) * 57.29577951308232 // Pre-calculate rad to deg\n\n if (this._lineEl) {\n this._lineEl.style.transform = `translate3d(${currentPoint.x}px, ${currentPoint.y}px, 0) rotate(${angle}deg)`\n this._lineEl.style.width = `${length}px`\n }\n }\n\n render() {\n return html`<div class=\"trajectory-line\"></div>`\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport type {\n ScrollTrajectoryUpdateEvent,\n ManagerSettingsChangedEvent,\n ElementUnregisteredEvent,\n CallbackCompletedEvent,\n} from \"js.foresight\"\nimport { ForesightManager } from \"js.foresight\"\nimport type { Point } from \"./mouse-trajectory\"\n\n@customElement(\"scroll-trajectory\")\nexport class ScrollTrajectory extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .scroll-trajectory-line {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform, width;\n transform-origin: left center;\n height: 4px;\n background: repeating-linear-gradient(\n 90deg,\n #eab308 0px,\n #eab308 8px,\n transparent 8px,\n transparent 16px\n );\n z-index: 9999;\n border-radius: 2px;\n animation: scroll-dash-flow 1.5s linear infinite;\n box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);\n }\n\n .scroll-trajectory-line::after {\n content: \"\";\n position: absolute;\n right: -6px;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border-left: 8px solid #eab308;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.6));\n animation: scroll-arrow-pulse 1.5s ease-in-out infinite;\n }\n\n @keyframes scroll-dash-flow {\n 0% {\n background-position: 0px 0px;\n }\n 100% {\n background-position: 16px 0px;\n }\n }\n\n @keyframes scroll-arrow-pulse {\n 0%,\n 100% {\n transform: translateY(-50%) scale(1);\n filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.6));\n }\n 50% {\n transform: translateY(-50%) scale(1.2);\n filter: drop-shadow(0 0 12px rgba(234, 179, 8, 0.8));\n }\n }\n `,\n ]\n\n private _abortController = new AbortController()\n private _lineEl: HTMLElement | null = null\n private _scrollPredictionIsEnabled =\n ForesightManager.instance.getManagerData.globalSettings.enableScrollPrediction\n private _scrollMargin = ForesightManager.instance.getManagerData.globalSettings.scrollMargin\n private _isVisible = false\n private _latestCurrentPoint: Point | null = null\n private _latestPredictedPoint: Point | null = null\n private _isUpdateScheduled = false\n\n connectedCallback(): void {\n super.connectedCallback()\n const { signal } = this._abortController\n\n ForesightManager.instance.addEventListener(\"scrollTrajectoryUpdate\", this.handleScrollUpdate, {\n signal,\n })\n\n ForesightManager.instance.addEventListener(\n \"mouseTrajectoryUpdate\",\n () => {\n this._setVisible(false)\n },\n { signal }\n )\n\n ForesightManager.instance.addEventListener(\"callbackCompleted\", this.handleTrajectoryReset, {\n signal,\n })\n\n ForesightManager.instance.addEventListener(\"elementUnregistered\", this.handleTrajectoryReset, {\n signal,\n })\n\n ForesightManager.instance.addEventListener(\n \"managerSettingsChanged\",\n this.handleSettingsChange,\n { signal }\n )\n }\n\n protected firstUpdated(): void {\n this._lineEl = this.shadowRoot!.querySelector<HTMLElement>(\".scroll-trajectory-line\")\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this._abortController.abort()\n }\n\n private _setVisible(visible: boolean): void {\n if (this._isVisible === visible) {\n return\n }\n\n this._isVisible = visible\n if (this._lineEl) {\n this._lineEl.style.display = visible ? \"block\" : \"none\"\n }\n }\n\n private handleTrajectoryReset = (e: CallbackCompletedEvent | ElementUnregisteredEvent) => {\n const shouldReset =\n (\"wasLastActiveElement\" in e && e.wasLastActiveElement) ||\n (\"wasLastRegisteredElement\" in e && e.wasLastRegisteredElement)\n\n if (shouldReset) {\n this._setVisible(false)\n if (this._lineEl) {\n this._lineEl.style.transform = \"translate(0px, 0px) rotate(0deg)\"\n }\n }\n }\n\n private handleSettingsChange = (e: ManagerSettingsChangedEvent) => {\n const isEnabled = e.managerData.globalSettings.enableScrollPrediction\n this._scrollPredictionIsEnabled = isEnabled\n if (!isEnabled) {\n this._setVisible(false)\n }\n\n const scrollMarginUpdate = e.updatedSettings.find(update => update.setting === \"scrollMargin\")\n if (scrollMarginUpdate) {\n this._scrollMargin = scrollMarginUpdate.newValue\n if (this._lineEl) {\n this._lineEl.style.width = `${this._scrollMargin}px`\n }\n }\n }\n\n private handleScrollUpdate = (e: ScrollTrajectoryUpdateEvent) => {\n if (!this._scrollPredictionIsEnabled) {\n return\n }\n\n this._setVisible(true)\n this._latestCurrentPoint = e.currentPoint\n this._latestPredictedPoint = e.predictedPoint\n\n if (!this._isUpdateScheduled) {\n this._isUpdateScheduled = true\n this.applyScrollTransform()\n }\n }\n\n private applyScrollTransform = () => {\n if (!this._latestCurrentPoint || !this._latestPredictedPoint) {\n this._isUpdateScheduled = false\n\n return\n }\n\n const dx = this._latestPredictedPoint.x - this._latestCurrentPoint.x\n const dy = this._latestPredictedPoint.y - this._latestCurrentPoint.y\n const angle = (Math.atan2(dy, dx) * 180) / Math.PI\n\n if (this._lineEl) {\n this._lineEl.style.transform = `translate(${this._latestCurrentPoint.x}px, ${this._latestCurrentPoint.y}px) rotate(${angle}deg)`\n }\n\n this._isUpdateScheduled = false\n }\n\n render() {\n return html`<div class=\"scroll-trajectory-line\" style=\"width: ${this._scrollMargin}px\"></div>`\n }\n}\n","import { LitElement, css, html } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\nimport \"./element-overlays\"\nimport \"./mouse-trajectory\"\nimport \"./scroll-trajectory\"\nimport { ForesightManager } from \"js.foresight\"\nimport type { DeviceStrategyChangedEvent } from \"js.foresight\"\n\n@customElement(\"debug-overlay\")\nexport class DebugOverlay extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n #overlay-container {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n z-index: 9999;\n }\n `,\n ]\n\n private _abortController: AbortController | null = null\n @state()\n private _strategy: \"mouse\" | \"touch\" | \"pen\" =\n ForesightManager.instance.getManagerData.currentDeviceStrategy\n\n @property({ type: Boolean }) showElementOverlays = true\n @property({ type: Boolean }) showMouseTrajectory = true\n @property({ type: Boolean }) showScrollTrajectory = true\n @property({ type: Boolean }) showNameTags = true\n\n connectedCallback(): void {\n super.connectedCallback()\n this._abortController = new AbortController()\n const { signal } = this._abortController\n\n ForesightManager.instance.addEventListener(\n \"deviceStrategyChanged\",\n this.handleDeviceStrategyChange,\n { signal }\n )\n }\n\n private handleDeviceStrategyChange = (event: DeviceStrategyChangedEvent) =>\n (this._strategy = event.newStrategy)\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this._abortController?.abort()\n }\n\n render() {\n return html`\n <div id=\"overlay-container\">\n ${this._strategy === \"mouse\"\n ? html`\n <mouse-trajectory ?hidden=${!this.showMouseTrajectory}></mouse-trajectory>\n <scroll-trajectory ?hidden=${!this.showScrollTrajectory}></scroll-trajectory>\n `\n : \"\"}\n </div>\n <!-- element-overlays positions itself in document coordinates and must stay\n outside #overlay-container: the fixed container would become its\n containing block and pin it back to the viewport. -->\n ${this._strategy === \"mouse\"\n ? html`\n <element-overlays\n ?hidden=${!this.showElementOverlays}\n .showNameTags=${this.showNameTags}\n ></element-overlays>\n `\n : \"\"}\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"debug-overlay\": DebugOverlay\n }\n}\n","import { LitElement, css, html } from \"lit\"\nimport { customElement, state } from \"lit/decorators.js\"\nimport {\n SHOW_KEYS,\n type DeepPartial,\n type DevtoolsSettings,\n type LogEvents,\n type ShowKey,\n type ShowSettings,\n} from \"../types/types\"\n\nimport \"./control-panel/control-panel\"\nimport \"./debug-overlay/debug-overlay\"\n\n@customElement(\"foresight-devtools\")\nexport class ForesightDevtools extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n `,\n ]\n\n @state() private isInitialized = false\n\n private static _instance: ForesightDevtools | null = null\n\n public devtoolsSettings: Required<DevtoolsSettings> = {\n show: {\n controlPanel: true,\n nameTags: true,\n elementOverlays: true,\n mouseTrajectory: true,\n scrollTrajectory: true,\n },\n isControlPanelDefaultMinimized: false,\n sortElementList: \"visibility\",\n logging: {\n logLocation: \"controlPanel\",\n callbackCompleted: true,\n callbackInvoked: true,\n elementRegistered: false,\n elementUnregistered: false,\n managerSettingsChanged: true,\n mouseTrajectoryUpdate: false,\n scrollTrajectoryUpdate: false,\n deviceStrategyChanged: true,\n },\n }\n\n private constructor() {\n super()\n }\n\n private static createAndAppendInstance(): void {\n if (typeof window === \"undefined\" || typeof document === \"undefined\") {\n return\n }\n\n ForesightDevtools._instance = document.createElement(\"foresight-devtools\") as ForesightDevtools\n document.body.appendChild(ForesightDevtools._instance)\n }\n\n public static initialize(props?: DeepPartial<DevtoolsSettings>): ForesightDevtools {\n if (!ForesightDevtools._instance) {\n ForesightDevtools.createAndAppendInstance()\n }\n\n if (!ForesightDevtools._instance) {\n return ForesightDevtools._instance!\n }\n\n const devtools = ForesightDevtools._instance\n devtools.isInitialized = true\n devtools.alterDevtoolsSettings(props)\n\n return devtools\n }\n\n public static get instance(): ForesightDevtools {\n if (!ForesightDevtools._instance) {\n return ForesightDevtools.initialize()\n }\n\n return ForesightDevtools._instance!\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.cleanup()\n }\n\n private shouldUpdateSetting<T>(newValue: T | undefined, currentValue: T): newValue is T {\n return newValue !== undefined && newValue !== currentValue\n }\n\n private updateLoggingSetting<K extends keyof LogEvents>(\n key: K,\n newValue: LogEvents[K] | undefined\n ): void {\n if (this.shouldUpdateSetting(newValue, this.devtoolsSettings.logging[key])) {\n this.devtoolsSettings.logging[key] = newValue!\n }\n }\n\n private updateShowSetting<K extends ShowKey>(\n key: K,\n newValue: ShowSettings[K] | undefined\n ): boolean {\n if (this.shouldUpdateSetting(newValue, this.devtoolsSettings.show[key])) {\n this.devtoolsSettings.show[key] = newValue!\n\n return true\n }\n\n return false\n }\n\n /**\n * Set every flag inside `show` to the same value. Useful for \"turn the\n * entire devtools UI off\" without listing each key.\n */\n public setAllShow(value: boolean) {\n const show = Object.fromEntries(SHOW_KEYS.map(k => [k, value])) as ShowSettings\n this.alterDevtoolsSettings({ show })\n }\n\n public alterDevtoolsSettings(props?: DeepPartial<DevtoolsSettings>) {\n if (props === undefined) {\n return\n }\n\n if (props.show) {\n let needsUpdate = false\n for (const key of SHOW_KEYS) {\n if (this.updateShowSetting(key, props.show[key])) {\n needsUpdate = true\n }\n }\n if (needsUpdate) {\n this.requestUpdate()\n }\n }\n\n if (\n this.shouldUpdateSetting(\n props.isControlPanelDefaultMinimized,\n this.devtoolsSettings.isControlPanelDefaultMinimized\n )\n ) {\n this.devtoolsSettings.isControlPanelDefaultMinimized = props.isControlPanelDefaultMinimized!\n }\n\n if (this.shouldUpdateSetting(props.sortElementList, this.devtoolsSettings.sortElementList)) {\n this.devtoolsSettings.sortElementList = props.sortElementList!\n }\n\n // Handle logging settings\n if (props.logging) {\n if (\n this.shouldUpdateSetting(\n props.logging.logLocation,\n this.devtoolsSettings.logging.logLocation\n )\n ) {\n this.devtoolsSettings.logging.logLocation = props.logging.logLocation\n }\n\n this.updateLoggingSetting(\"callbackCompleted\", props.logging.callbackCompleted)\n this.updateLoggingSetting(\"callbackInvoked\", props.logging.callbackInvoked)\n this.updateLoggingSetting(\"elementRegistered\", props.logging.elementRegistered)\n this.updateLoggingSetting(\"elementUnregistered\", props.logging.elementUnregistered)\n this.updateLoggingSetting(\"managerSettingsChanged\", props.logging.managerSettingsChanged)\n this.updateLoggingSetting(\"mouseTrajectoryUpdate\", props.logging.mouseTrajectoryUpdate)\n this.updateLoggingSetting(\"scrollTrajectoryUpdate\", props.logging.scrollTrajectoryUpdate)\n this.updateLoggingSetting(\"deviceStrategyChanged\", props.logging.deviceStrategyChanged)\n }\n }\n\n private cleanup() {\n // Just trigger a re-render to hide the components\n this.requestUpdate()\n }\n\n render() {\n if (!this.isInitialized) {\n return html``\n }\n\n const { show } = this.devtoolsSettings\n\n return html`\n ${show.controlPanel ? html`<control-panel></control-panel>` : \"\"}\n <debug-overlay\n .showElementOverlays=${show.elementOverlays}\n .showMouseTrajectory=${show.mouseTrajectory}\n .showScrollTrajectory=${show.scrollTrajectory}\n .showNameTags=${show.nameTags}\n ></debug-overlay>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"foresight-devtools\": ForesightDevtools\n }\n}\n"],"mappings":"4OA4CA,MAAa,EAAY,CACvB,eACA,WACA,kBACA,kBACA,mBACD,CChDY,EAAoB,CAAI;;;;;;;;;;;;;;;;;EAmBxB,EAAc,CAAI;;;;;;;;;;;;;;;EAiBlB,GAAW,CAAI;;;;;;;;;;;;;;;;EAkBf,GAAW,CAAI;;;;;;;;;;;;;;;;;;EAqBf,EAAiB,CAAI;;;;;;;;;;;;;;;EAgBrB,GAAe,CAAI;;;;;;;;;;;;;;;;;;EAoBnB,GAAgB,CAAI;;;;;;;;;;;;;;EAgBpB,EAAa,CAAI;;;;;;;;;;;;;;EAgBjB,GAAY,CAAI;;;;;;;;;;;;;;;EAiBhB,GAAW,CAAI;;;;;;;;;;;;;;;EAiBf,EAAW,CAAI;;;;;;;;;;;;;;EAgBf,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