diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b749f2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches-ignore: + - 'gh-pages' + pull_request: + branches: + - main + - development + +jobs: + lint-and-test: + name: Lint + Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install + run: npm install + + - name: Lint + run: npm run lint + + - name: Test + run: npm test diff --git a/.github/workflows/pr-version-bump.yml b/.github/workflows/pr-version-bump.yml new file mode 100644 index 0000000..bf0c420 --- /dev/null +++ b/.github/workflows/pr-version-bump.yml @@ -0,0 +1,126 @@ +name: PR version bump + +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + branches: + - main + +permissions: + contents: write + pull-requests: read + +concurrency: + group: pr-bump-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + bump: + name: Lint, test, bump + if: github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install + run: npm install + + - name: Lint + run: npm run lint + + - name: Test + run: npm test + + - name: Determine bump kind from PR labels + id: kind + run: | + LABELS='${{ toJson(github.event.pull_request.labels.*.name) }}' + echo "labels: $LABELS" + if echo "$LABELS" | grep -q '"major"'; then + echo "kind=major" >> "$GITHUB_OUTPUT" + elif echo "$LABELS" | grep -q '"minor"'; then + echo "kind=minor" >> "$GITHUB_OUTPUT" + else + echo "kind=patch" >> "$GITHUB_OUTPUT" + fi + + - name: Read PR and main versions + id: versions + run: | + PR_VERSION=$(node -p "require('./package.json').version") + git fetch origin main --depth=1 + if git cat-file -e origin/main:package.json 2>/dev/null; then + MAIN_VERSION=$(git show origin/main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf8')).version") + echo "main_has_pkg=true" >> "$GITHUB_OUTPUT" + else + MAIN_VERSION="" + echo "main_has_pkg=false" >> "$GITHUB_OUTPUT" + fi + echo "pr=$PR_VERSION" >> "$GITHUB_OUTPUT" + echo "main=$MAIN_VERSION" >> "$GITHUB_OUTPUT" + echo "PR version: $PR_VERSION" + echo "main version: ${MAIN_VERSION:-}" + + - name: Decide whether to skip the bump + id: skip + run: | + MAIN_HAS_PKG="${{ steps.versions.outputs.main_has_pkg }}" + PR="${{ steps.versions.outputs.pr }}" + MAIN="${{ steps.versions.outputs.main }}" + if [ "$MAIN_HAS_PKG" != "true" ]; then + echo "main has no package.json — first-release bootstrap. Skipping bump; PR's version will be released as-is." + echo "skip=true" >> "$GITHUB_OUTPUT" + elif [ "$PR" != "$MAIN" ]; then + echo "PR version differs from main — assuming manual bump. Skipping." + echo "skip=true" >> "$GITHUB_OUTPUT" + else + echo "skip=false" >> "$GITHUB_OUTPUT" + fi + + - name: Compute next version + if: steps.skip.outputs.skip == 'false' + id: next + run: | + KIND="${{ steps.kind.outputs.kind }}" + MAIN="${{ steps.versions.outputs.main }}" + NEXT=$(node -e " + const [maj, min, pat] = '$MAIN'.split('.').map(Number); + const kind = '$KIND'; + if (kind === 'major') console.log((maj+1) + '.0.0'); + else if (kind === 'minor') console.log(maj + '.' + (min+1) + '.0'); + else console.log(maj + '.' + min + '.' + (pat+1)); + ") + echo "version=$NEXT" >> "$GITHUB_OUTPUT" + echo "Next version: $NEXT" + + - name: Update package.json + if: steps.skip.outputs.skip == 'false' + run: | + NEXT="${{ steps.next.outputs.version }}" + node -e " + const fs = require('fs'); + const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + pkg.version = '$NEXT'; + fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n'); + " + + - name: Commit and push bump + if: steps.skip.outputs.skip == 'false' + run: | + NEXT="${{ steps.next.outputs.version }}" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add package.json + git commit -m "chore: bump version to $NEXT [skip ci]" + git push origin HEAD:${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..92d634d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,72 @@ +name: Release + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + release: + name: Tag and publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install + run: npm install + + - name: Lint + run: npm run lint + + - name: Test + run: npm test + + - name: Read version from package.json + id: pkg + run: | + VERSION=$(node -p "require('./package.json').version") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" + + - name: Check if tag already exists + id: check_tag + run: | + TAG="${{ steps.pkg.outputs.tag }}" + if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "exists=true" >> "$GITHUB_OUTPUT" + echo "Tag $TAG already exists. Skipping release." + else + echo "exists=false" >> "$GITHUB_OUTPUT" + echo "Tag $TAG does not exist. Will create release." + fi + + - name: Create tag + if: steps.check_tag.outputs.exists == 'false' + run: | + TAG="${{ steps.pkg.outputs.tag }}" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag -a "$TAG" -m "Release $TAG" + git push origin "$TAG" + + - name: Create GitHub Release + if: steps.check_tag.outputs.exists == 'false' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG="${{ steps.pkg.outputs.tag }}" + gh release create "$TAG" \ + --title "$TAG" \ + --generate-notes diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..290ce29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +.DS_Store +docs/ diff --git a/README.md b/README.md index 34029f5..9765d37 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Log Highlighter -A static, no-build browser tool for highlighting and filtering raw logs. Paste log text, define keyword groups (each gets a distinct pastel color), and the output panel highlights matches. Embedded JSON and Apple `NSDictionary` payloads inside log lines are detected and pretty-printed inline. +[![CI](https://github.com/al-af/LogHighlighter/actions/workflows/ci.yml/badge.svg)](https://github.com/al-af/LogHighlighter/actions/workflows/ci.yml) + +A static, no-build browser tool for highlighting and filtering raw logs. Paste log text, define keyword groups (each gets a distinct pastel color), and the output panel highlights matches. Embedded JSON and Apple `NSDictionary` payloads inside log lines are detected and pretty-printed inline. Android `logcat` lines (threadtime, time, and brief formats) are detected and colored by severity (V/D/I/W/E/F/A), so iOS and Android logs both render usefully. ## Structure @@ -15,8 +17,13 @@ A static, no-build browser tool for highlighting and filtering raw logs. Paste l │ ├── groups.js # group/keyword CRUD mutators │ ├── groupsView.js # renders #groups panel │ ├── payload.js # JSON + NSDictionary detection and pretty-print +│ ├── logcat.js # Android logcat line detection (level + tag) │ ├── highlight.js # HTML-escaping + overlap-free multi-group highlighter -│ └── output.js # renders #output panel (filter/full modes) +│ ├── output.js # renders #output panel (filter/full modes) +│ ├── storage.js # versioned localStorage I/O +│ ├── presets.js # named-preset CRUD +│ └── share.js # URL hash encode/decode for shareable links +├── tests/ # vitest unit tests └── .nojekyll # disables Jekyll processing on GitHub Pages ``` @@ -32,6 +39,36 @@ python3 -m http.server 8000 Then open . +## Tests + +Unit tests cover storage, presets, and share-link encoding. + +```bash +npm install +npm test +``` + +## Sharing setups + +Click **Share** in the Keyword Groups panel to copy a URL with your current groups encoded in the fragment. Send it to a teammate — they open the link, get your setup preloaded, and paste their own logs in. The share URL never includes log content. + +If the recipient already has local groups configured, a banner asks whether to use the shared setup, keep theirs, or merge. + +## Releases + +Releases are fully automated. The flow: + +1. Open a PR against `main`. +2. The **PR version bump** workflow runs lint + test, then commits a `package.json` bump back to your PR branch as `github-actions[bot]`. Default is a patch bump. Add a label to override: + - `minor` → minor version bump + - `major` → major version bump +3. Merge the PR. +4. The **Release** workflow tags the merge commit `v` and publishes a GitHub Release with auto-generated notes. + +If `package.json` is already ahead of `main` when the PR is opened (you bumped manually), the bot skips the bump and respects your version. + +The Release workflow is idempotent — pushing unrelated changes to `main` without a version bump does nothing. + ## Deploy to GitHub Pages One-time setup (run from the project root): diff --git a/docs/superpowers/plans/2026-05-26-loghighlighter-phase1.md b/docs/superpowers/plans/2026-05-26-loghighlighter-phase1.md new file mode 100644 index 0000000..5e0a82c --- /dev/null +++ b/docs/superpowers/plans/2026-05-26-loghighlighter-phase1.md @@ -0,0 +1,1201 @@ +# LogHighlighter Phase 1 Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Add persistence, named presets, and share-by-link to LogHighlighter so keyword setups survive refreshes and can be shared with teammates via URL. + +**Architecture:** Three new ES modules — `storage.js` (versioned localStorage I/O), `presets.js` (named preset CRUD), `share.js` (base64url hash encoding). One UI strip inside the Keyword Groups panel. `main.js` unifies mode mutations through `notify()` so auto-save subscribes once. + +**Tech Stack:** Vanilla ES modules, no build step. Vitest for unit tests (Node, native ESM, no bundler required). GitHub Pages for hosting. + +**Spec:** `docs/superpowers/specs/2026-05-26-loghighlighter-phase1-design.md` + +--- + +## File Structure + +**Create:** +- `package.json` — Vitest dev dependency, `test` script +- `vitest.config.js` — jsdom environment for DOM-aware tests +- `src/storage.js` — versioned localStorage I/O +- `src/presets.js` — preset CRUD +- `src/share.js` — URL hash encode/decode +- `tests/storage.test.js` +- `tests/presets.test.js` +- `tests/share.test.js` +- `.gitignore` — exclude `node_modules` + +**Modify:** +- `index.html` — add preset sub-strip, share banner element, link to module +- `src/main.js` — new init order, persist subscriber, mode through notify, wire preset + share UI, banner handlers +- `styles/app.css` — `.presets` row and `.share-banner` styles + +**Untouched:** `src/state.js`, `src/groups.js`, `src/groupsView.js`, `src/payload.js`, `src/highlight.js`, `src/output.js`, `src/logcat.js`, `.nojekyll`, `README.md`. + +--- + +## Task 1: Set up Vitest + +**Files:** +- Create: `package.json` +- Create: `vitest.config.js` +- Create: `.gitignore` +- Create: `tests/smoke.test.js` + +- [ ] **Step 1: Create `package.json`** + +```json +{ + "name": "loghighlighter", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "test": "vitest run", + "test:watch": "vitest" + }, + "devDependencies": { + "vitest": "^2.1.0", + "jsdom": "^25.0.0" + } +} +``` + +- [ ] **Step 2: Create `vitest.config.js`** + +```js +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'jsdom', + include: ['tests/**/*.test.js'], + }, +}); +``` + +- [ ] **Step 3: Create `.gitignore`** + +``` +node_modules/ +.DS_Store +``` + +- [ ] **Step 4: Install dependencies** + +Run: `npm install` + +Expected: `node_modules/` created, no errors. + +- [ ] **Step 5: Write smoke test** + +Create `tests/smoke.test.js`: + +```js +import { describe, it, expect } from 'vitest'; + +describe('smoke', () => { + it('runs', () => { + expect(1 + 1).toBe(2); + }); + + it('has DOM access (jsdom)', () => { + document.body.innerHTML = '
hi
'; + expect(document.getElementById('x').textContent).toBe('hi'); + }); +}); +``` + +- [ ] **Step 6: Run smoke test** + +Run: `npm test` + +Expected: `2 passed`. + +- [ ] **Step 7: Commit** + +```bash +git add package.json package-lock.json vitest.config.js .gitignore tests/smoke.test.js +git commit -m "chore: add vitest with jsdom for unit tests" +``` + +--- + +## Task 2: `src/storage.js` — versioned localStorage + +**Files:** +- Create: `src/storage.js` +- Create: `tests/storage.test.js` + +- [ ] **Step 1: Write failing test — save/load roundtrip** + +Create `tests/storage.test.js`: + +```js +import { describe, it, expect, beforeEach } from 'vitest'; +import { load, save, remove, isAvailable } from '../src/storage.js'; + +beforeEach(() => { + localStorage.clear(); +}); + +describe('storage', () => { + it('saves and loads a value', () => { + save('loghl:test', { hello: 'world' }); + expect(load('loghl:test')).toEqual({ hello: 'world' }); + }); +}); +``` + +- [ ] **Step 2: Run test, verify it fails** + +Run: `npm test -- tests/storage.test.js` + +Expected: FAIL — `Cannot find module '../src/storage.js'`. + +- [ ] **Step 3: Implement `src/storage.js`** + +```js +const VERSION = 1; +let availableCache = null; + +export function isAvailable() { + if (availableCache !== null) return availableCache; + try { + const probe = '__loghl_probe__'; + localStorage.setItem(probe, '1'); + localStorage.removeItem(probe); + availableCache = true; + } catch (_) { + availableCache = false; + } + return availableCache; +} + +export function load(key) { + if (!isAvailable()) return null; + try { + const raw = localStorage.getItem(key); + if (raw == null) return null; + const parsed = JSON.parse(raw); + if (!parsed || parsed.version !== VERSION) return null; + return parsed.data; + } catch (err) { + console.warn('[loghl:storage] load failed for', key, err); + return null; + } +} + +export function save(key, value) { + if (!isAvailable()) return false; + try { + const envelope = JSON.stringify({ version: VERSION, data: value }); + localStorage.setItem(key, envelope); + return true; + } catch (err) { + console.warn('[loghl:storage] save failed for', key, err); + return false; + } +} + +export function remove(key) { + if (!isAvailable()) return; + try { + localStorage.removeItem(key); + } catch (err) { + console.warn('[loghl:storage] remove failed for', key, err); + } +} +``` + +- [ ] **Step 4: Run test, verify it passes** + +Run: `npm test -- tests/storage.test.js` + +Expected: `1 passed`. + +- [ ] **Step 5: Add tests for null-on-missing, corrupt JSON, version mismatch** + +Append to `tests/storage.test.js` inside the `describe('storage', ...)` block: + +```js + it('returns null for missing key', () => { + expect(load('loghl:missing')).toBeNull(); + }); + + it('returns null for corrupt JSON', () => { + localStorage.setItem('loghl:bad', '{not-json'); + expect(load('loghl:bad')).toBeNull(); + }); + + it('returns null for version mismatch', () => { + localStorage.setItem('loghl:old', JSON.stringify({ version: 99, data: { x: 1 } })); + expect(load('loghl:old')).toBeNull(); + }); + + it('returns null for envelope without version', () => { + localStorage.setItem('loghl:naked', JSON.stringify({ x: 1 })); + expect(load('loghl:naked')).toBeNull(); + }); + + it('remove deletes a key', () => { + save('loghl:rm', { x: 1 }); + remove('loghl:rm'); + expect(load('loghl:rm')).toBeNull(); + }); + + it('isAvailable returns true in jsdom', () => { + expect(isAvailable()).toBe(true); + }); +``` + +- [ ] **Step 6: Run tests, verify all pass** + +Run: `npm test -- tests/storage.test.js` + +Expected: `7 passed`. + +- [ ] **Step 7: Commit** + +```bash +git add src/storage.js tests/storage.test.js +git commit -m "feat(storage): add versioned localStorage with fail-soft I/O" +``` + +--- + +## Task 3: `src/presets.js` — preset CRUD + +**Files:** +- Create: `src/presets.js` +- Create: `tests/presets.test.js` + +- [ ] **Step 1: Write failing test — list empty, save, list returns name** + +Create `tests/presets.test.js`: + +```js +import { describe, it, expect, beforeEach } from 'vitest'; +import { listPresets, savePreset, loadPreset, deletePreset, renamePreset, onChange } from '../src/presets.js'; + +beforeEach(() => { + localStorage.clear(); +}); + +const sampleGroups = [{ keywords: ['session'], colorIndex: 0 }]; + +describe('presets', () => { + it('list is empty initially', () => { + expect(listPresets()).toEqual([]); + }); + + it('saves a preset and lists it', () => { + const result = savePreset('Attribution', sampleGroups); + expect(result.ok).toBe(true); + expect(listPresets()).toEqual(['Attribution']); + }); +}); +``` + +- [ ] **Step 2: Run test, verify it fails** + +Run: `npm test -- tests/presets.test.js` + +Expected: FAIL — module not found. + +- [ ] **Step 3: Implement `src/presets.js`** + +```js +import { load, save } from './storage.js'; + +const KEY = 'loghl:presets'; +const MAX_NAME = 40; +const listeners = new Set(); + +function readAll() { + return load(KEY) || {}; +} + +function writeAll(all) { + save(KEY, all); + listeners.forEach(fn => fn()); +} + +function validateName(name) { + if (typeof name !== 'string') return { ok: false, reason: 'name must be a string' }; + const trimmed = name.trim(); + if (!trimmed.length) return { ok: false, reason: 'name is empty' }; + if (trimmed.length > MAX_NAME) return { ok: false, reason: `name exceeds ${MAX_NAME} chars` }; + if (/[\x00-\x1f\x7f]/.test(trimmed)) return { ok: false, reason: 'name contains control characters' }; + return { ok: true, trimmed }; +} + +export function listPresets() { + return Object.keys(readAll()); +} + +export function savePreset(name, groups) { + const v = validateName(name); + if (!v.ok) return v; + const all = readAll(); + all[v.trimmed] = { groups: structuredClone(groups), savedAt: Date.now() }; + writeAll(all); + return { ok: true }; +} + +export function loadPreset(name) { + const all = readAll(); + const entry = all[name]; + if (!entry) return null; + return structuredClone(entry.groups); +} + +export function deletePreset(name) { + const all = readAll(); + if (!(name in all)) return false; + delete all[name]; + writeAll(all); + return true; +} + +export function renamePreset(oldName, newName) { + const v = validateName(newName); + if (!v.ok) return v; + const all = readAll(); + if (!(oldName in all)) return { ok: false, reason: 'preset not found' }; + if (v.trimmed === oldName) return { ok: true }; + if (v.trimmed in all) return { ok: false, reason: 'name already exists' }; + all[v.trimmed] = all[oldName]; + delete all[oldName]; + writeAll(all); + return { ok: true }; +} + +export function onChange(fn) { + listeners.add(fn); + return () => listeners.delete(fn); +} +``` + +- [ ] **Step 4: Run tests, verify they pass** + +Run: `npm test -- tests/presets.test.js` + +Expected: `2 passed`. + +- [ ] **Step 5: Add tests for load, delete, rename, name validation, overwrite, onChange** + +Append inside the `describe('presets', ...)` block: + +```js + it('loadPreset returns the saved groups', () => { + savePreset('A', sampleGroups); + expect(loadPreset('A')).toEqual(sampleGroups); + }); + + it('loadPreset returns null for unknown name', () => { + expect(loadPreset('Nope')).toBeNull(); + }); + + it('savePreset auto-overwrites existing name', () => { + savePreset('A', sampleGroups); + const newer = [{ keywords: ['attribution'], colorIndex: 1 }]; + savePreset('A', newer); + expect(loadPreset('A')).toEqual(newer); + expect(listPresets()).toEqual(['A']); + }); + + it('savePreset trims whitespace', () => { + savePreset(' Trim Me ', sampleGroups); + expect(listPresets()).toEqual(['Trim Me']); + }); + + it('savePreset rejects empty name', () => { + expect(savePreset(' ', sampleGroups).ok).toBe(false); + }); + + it('savePreset rejects names over 40 chars', () => { + const long = 'x'.repeat(41); + expect(savePreset(long, sampleGroups).ok).toBe(false); + }); + + it('savePreset rejects names with control characters', () => { + expect(savePreset('A\nB', sampleGroups).ok).toBe(false); + }); + + it('deletePreset removes a preset and returns true', () => { + savePreset('A', sampleGroups); + expect(deletePreset('A')).toBe(true); + expect(listPresets()).toEqual([]); + }); + + it('deletePreset returns false for unknown name', () => { + expect(deletePreset('Nope')).toBe(false); + }); + + it('renamePreset moves an entry', () => { + savePreset('Old', sampleGroups); + const result = renamePreset('Old', 'New'); + expect(result.ok).toBe(true); + expect(listPresets()).toEqual(['New']); + expect(loadPreset('New')).toEqual(sampleGroups); + }); + + it('renamePreset rejects collision with existing name', () => { + savePreset('A', sampleGroups); + savePreset('B', sampleGroups); + expect(renamePreset('A', 'B').ok).toBe(false); + }); + + it('onChange fires after savePreset and deletePreset', () => { + let calls = 0; + onChange(() => calls++); + savePreset('A', sampleGroups); + deletePreset('A'); + expect(calls).toBe(2); + }); +``` + +- [ ] **Step 6: Run tests, verify all pass** + +Run: `npm test -- tests/presets.test.js` + +Expected: `14 passed`. + +- [ ] **Step 7: Commit** + +```bash +git add src/presets.js tests/presets.test.js +git commit -m "feat(presets): add named-preset CRUD on top of storage" +``` + +--- + +## Task 4: `src/share.js` — URL hash encode/decode + +**Files:** +- Create: `src/share.js` +- Create: `tests/share.test.js` + +- [ ] **Step 1: Write failing test — encode/decode roundtrip** + +Create `tests/share.test.js`: + +```js +import { describe, it, expect, beforeEach } from 'vitest'; +import { encodeGroups, decodeHash, consumeHash } from '../src/share.js'; + +const sampleGroups = [ + { keywords: ['session', 'attribution'], colorIndex: 0 }, + { keywords: ['CMP'], colorIndex: 3 }, +]; + +beforeEach(() => { + window.location.hash = ''; +}); + +describe('share', () => { + it('encodes and decodes a roundtrip', () => { + const link = encodeGroups(sampleGroups, 'filter'); + const hash = link.split('#')[1]; + window.location.hash = hash; + const decoded = decodeHash(); + expect(decoded.ok).toBe(true); + expect(decoded.groups).toEqual(sampleGroups); + expect(decoded.mode).toBe('filter'); + }); +}); +``` + +- [ ] **Step 2: Run test, verify it fails** + +Run: `npm test -- tests/share.test.js` + +Expected: FAIL — module not found. + +- [ ] **Step 3: Implement `src/share.js`** + +```js +const VERSION = 1; +const PALETTE_LEN = 10; + +function base64urlEncode(str) { + const bytes = new TextEncoder().encode(str); + let bin = ''; + for (const b of bytes) bin += String.fromCharCode(b); + return btoa(bin).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); +} + +function base64urlDecode(s) { + const pad = s.length % 4 === 0 ? '' : '='.repeat(4 - (s.length % 4)); + const b64 = s.replace(/-/g, '+').replace(/_/g, '/') + pad; + const bin = atob(b64); + const bytes = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i); + return new TextDecoder().decode(bytes); +} + +export function encodeGroups(groups, mode) { + const payload = { + v: VERSION, + g: groups.map(g => ({ k: g.keywords, c: g.colorIndex })), + m: mode, + }; + const encoded = base64urlEncode(JSON.stringify(payload)); + const base = window.location.href.split('#')[0]; + return `${base}#s=${encoded}`; +} + +export function decodeHash() { + const hash = window.location.hash; + if (!hash || !hash.startsWith('#s=')) return { ok: false, reason: 'no-hash' }; + const encoded = hash.slice(3); + let json; + try { + json = base64urlDecode(encoded); + } catch (_) { + return { ok: false, reason: 'malformed-base64' }; + } + let parsed; + try { + parsed = JSON.parse(json); + } catch (_) { + return { ok: false, reason: 'malformed-json' }; + } + if (!parsed || typeof parsed !== 'object') return { ok: false, reason: 'not-object' }; + if (parsed.v == null) return { ok: false, reason: 'missing-version' }; + if (parsed.v > VERSION) return { ok: false, reason: 'future-version' }; + if (!Array.isArray(parsed.g)) return { ok: false, reason: 'missing-groups' }; + const groups = parsed.g.map(g => ({ + keywords: Array.isArray(g.k) ? g.k.filter(s => typeof s === 'string') : [], + colorIndex: Number.isInteger(g.c) + ? ((g.c % PALETTE_LEN) + PALETTE_LEN) % PALETTE_LEN + : 0, + })); + const mode = parsed.m === 'full' ? 'full' : 'filter'; + return { ok: true, groups, mode }; +} + +export function stripHash() { + const url = window.location.href.split('#')[0]; + window.history.replaceState(null, '', url); +} + +export function consumeHash() { + const result = decodeHash(); + if (result.ok) stripHash(); + return result; +} +``` + +- [ ] **Step 4: Run test, verify it passes** + +Run: `npm test -- tests/share.test.js` + +Expected: `1 passed`. + +- [ ] **Step 5: Add tests for edge cases** + +Append inside the `describe('share', ...)` block: + +```js + it('returns no-hash when location has no hash', () => { + window.location.hash = ''; + expect(decodeHash()).toEqual({ ok: false, reason: 'no-hash' }); + }); + + it('rejects malformed base64', () => { + window.location.hash = '#s=!!!not-base64!!!'; + const r = decodeHash(); + expect(r.ok).toBe(false); + expect(['malformed-base64', 'malformed-json']).toContain(r.reason); + }); + + it('rejects malformed JSON', () => { + const bad = btoa('{not-json').replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${bad}`; + expect(decodeHash().reason).toBe('malformed-json'); + }); + + it('rejects future schema versions', () => { + const payload = btoa(JSON.stringify({ v: 99, g: [], m: 'filter' })) + .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + expect(decodeHash().reason).toBe('future-version'); + }); + + it('rejects missing groups field', () => { + const payload = btoa(JSON.stringify({ v: 1, m: 'filter' })) + .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + expect(decodeHash().reason).toBe('missing-groups'); + }); + + it('clamps out-of-range colorIndex', () => { + const payload = btoa(JSON.stringify({ + v: 1, + g: [{ k: ['x'], c: 99 }], + m: 'filter', + })).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + const r = decodeHash(); + expect(r.ok).toBe(true); + expect(r.groups[0].colorIndex).toBe(99 % 10); + }); + + it('defaults mode to filter when invalid', () => { + const payload = btoa(JSON.stringify({ v: 1, g: [], m: 'garbage' })) + .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + expect(decodeHash().mode).toBe('filter'); + }); + + it('consumeHash strips the hash on success', () => { + const link = encodeGroups(sampleGroups, 'filter'); + window.location.hash = link.split('#')[1]; + const r = consumeHash(); + expect(r.ok).toBe(true); + expect(window.location.hash).toBe(''); + }); + + it('consumeHash leaves hash when decode fails', () => { + window.location.hash = '#s=!!!bad!!!'; + consumeHash(); + expect(window.location.hash).toBe('#s=!!!bad!!!'); + }); +``` + +- [ ] **Step 6: Run tests, verify all pass** + +Run: `npm test -- tests/share.test.js` + +Expected: `10 passed`. + +- [ ] **Step 7: Commit** + +```bash +git add src/share.js tests/share.test.js +git commit -m "feat(share): add URL hash encode/decode for shareable links" +``` + +--- + +## Task 5: HTML markup + CSS for preset strip and share banner + +**Files:** +- Modify: `index.html` +- Modify: `styles/app.css` + +- [ ] **Step 1: Add preset sub-strip and share banner to `index.html`** + +In `index.html`, find the Keyword Groups panel block: + +```html +
+

Keyword Groups

+
+
+
+ + +
+
+
+``` + +Replace the `
` block with: + +```html +
+
+ + + + + +
+
+
+ + +
+
+``` + +Then immediately AFTER the closing `` tag (so the banner sits at the top of the document flow), add: + +```html + +``` + +- [ ] **Step 2: Add CSS for `.presets` and `.share-banner`** + +Append to `styles/app.css`: + +```css +.presets { + display: flex; + gap: 6px; + margin-bottom: 8px; + align-items: center; +} +.presets select { + flex: 1; + min-width: 0; + padding: 5px 6px; + border: 1px solid var(--border); + border-radius: 6px; + background: var(--panel); + font: inherit; + color: var(--text); +} +.presets button { + padding: 5px 10px; + border: 1px solid var(--border); + background: var(--panel); + border-radius: 6px; + cursor: pointer; + font: inherit; + color: var(--text); +} +.presets button:hover:not(:disabled) { background: #f0f0f0; } +.presets button:disabled { opacity: 0.5; cursor: not-allowed; } +.presets #presetDelete { padding: 5px 8px; } + +.share-banner { + display: flex; + gap: 8px; + align-items: center; + padding: 8px 16px; + background: #fff8d4; + border-bottom: 1px solid #e0c060; + font-size: 13px; +} +.share-banner[hidden] { display: none; } +.share-banner-text { flex: 1; } +.share-banner button { + padding: 4px 10px; + border: 1px solid var(--border); + background: var(--panel); + border-radius: 6px; + cursor: pointer; + font: inherit; + color: var(--text); +} +.share-banner button:hover { background: #f0f0f0; } +``` + +- [ ] **Step 3: Manual smoke check** + +Run: `python3 -m http.server 8765` then open `http://localhost:8765` in a browser. + +Expected: +- Preset strip visible above the empty groups list, with select and four buttons. +- No share banner visible. +- App still functions (add a keyword group; it appears). + +Stop the server with Ctrl+C. + +- [ ] **Step 4: Commit** + +```bash +git add index.html styles/app.css +git commit -m "feat(ui): add preset strip and share banner markup + styles" +``` + +--- + +## Task 6: Wire preset UI, share, banner, and persistence in `main.js` + +**Files:** +- Modify: `src/main.js` + +- [ ] **Step 1: Replace `src/main.js` with the new wiring** + +Replace the entire contents of `src/main.js` with: + +```js +import { state, subscribe, notify } from './state.js'; +import { addGroup } from './groups.js'; +import { renderGroups } from './groupsView.js'; +import { renderOutput } from './output.js'; +import { load, save } from './storage.js'; +import { listPresets, savePreset, loadPreset, deletePreset, onChange as onPresetsChange } from './presets.js'; +import { encodeGroups, consumeHash } from './share.js'; + +const STATE_KEY = 'loghl:state'; + +function applyLoadedState(loaded) { + if (!loaded) return; + if (Array.isArray(loaded.groups)) state.groups = loaded.groups; + if (loaded.mode === 'filter' || loaded.mode === 'full') state.mode = loaded.mode; +} + +function renderPresetSelect() { + const select = document.getElementById('presetSelect'); + const current = select.value; + while (select.options.length > 1) select.remove(1); + for (const name of listPresets()) { + const opt = document.createElement('option'); + opt.value = name; + opt.textContent = name; + select.appendChild(opt); + } + if (current && listPresets().includes(current)) select.value = current; +} + +function syncModeButtons() { + document.querySelectorAll('#mode button').forEach(b => { + b.classList.toggle('active', b.dataset.mode === state.mode); + }); +} + +function syncShareButton() { + document.getElementById('copyShareLink').disabled = state.groups.length === 0; + document.getElementById('presetSave').disabled = state.groups.length === 0; +} + +function dedupeGroups(groups) { + const seen = new Set(); + const out = []; + for (const g of groups) { + const key = g.keywords.slice().sort().join('').toLowerCase(); + if (seen.has(key)) continue; + seen.add(key); + out.push(g); + } + return out; +} + +function showBanner(sharedGroups, sharedMode) { + const banner = document.getElementById('shareBanner'); + const use = document.getElementById('shareBannerUse'); + const keep = document.getElementById('shareBannerKeep'); + const merge = document.getElementById('shareBannerMerge'); + document.getElementById('shareBannerCount').textContent = String(sharedGroups.length); + banner.hidden = false; + + const onUse = () => { + state.groups = sharedGroups; + state.mode = sharedMode; + syncModeButtons(); + notify(); + cleanup(); + }; + const onKeep = () => cleanup(); + const onMerge = () => { + state.groups = dedupeGroups([...state.groups, ...sharedGroups]); + notify(); + cleanup(); + }; + + function cleanup() { + banner.hidden = true; + use.removeEventListener('click', onUse); + keep.removeEventListener('click', onKeep); + merge.removeEventListener('click', onMerge); + } + + use.addEventListener('click', onUse); + keep.addEventListener('click', onKeep); + merge.addEventListener('click', onMerge); +} + +async function copyShareLink() { + const link = encodeGroups(state.groups, state.mode); + const btn = document.getElementById('copyShareLink'); + const original = btn.textContent; + const flash = () => { + btn.textContent = 'Copied ✓'; + setTimeout(() => { btn.textContent = original; }, 1800); + }; + try { + await navigator.clipboard.writeText(link); + flash(); + } catch (_) { + window.prompt('Copy this link:', link); + } +} + +// ── init ──────────────────────────────────────────────────────────────────── + +const saved = load(STATE_KEY); +applyLoadedState(saved); + +const hashResult = consumeHash(); +if (hashResult.ok) { + if (state.groups.length === 0) { + state.groups = hashResult.groups; + state.mode = hashResult.mode; + save(STATE_KEY, { groups: state.groups, mode: state.mode }); + } else { + showBanner(hashResult.groups, hashResult.mode); + } +} + +subscribe(renderGroups); +subscribe(renderOutput); +subscribe(syncShareButton); +subscribe(() => save(STATE_KEY, { groups: state.groups, mode: state.mode })); + +onPresetsChange(renderPresetSelect); + +// ── DOM wiring ────────────────────────────────────────────────────────────── + +document.getElementById('addGroup').addEventListener('click', () => { + const input = document.getElementById('newGroup'); + addGroup(input.value); + input.value = ''; + input.focus(); +}); + +document.getElementById('newGroup').addEventListener('keydown', e => { + if (e.key === 'Enter') { + e.preventDefault(); + document.getElementById('addGroup').click(); + } +}); + +document.getElementById('input').addEventListener('input', e => { + state.input = e.target.value; + renderOutput(); +}); + +document.getElementById('mode').addEventListener('click', e => { + const btn = e.target.closest('button[data-mode]'); + if (!btn) return; + state.mode = btn.dataset.mode; + syncModeButtons(); + notify(); +}); + +document.getElementById('presetLoad').addEventListener('click', () => { + const name = document.getElementById('presetSelect').value; + if (!name) return; + const groups = loadPreset(name); + if (!groups) return; + state.groups = groups; + notify(); +}); + +document.getElementById('presetSave').addEventListener('click', () => { + if (state.groups.length === 0) return; + const name = window.prompt('Preset name:'); + if (name == null) return; + if (listPresets().includes(name.trim()) && !window.confirm(`Overwrite preset "${name.trim()}"?`)) { + return; + } + const result = savePreset(name, state.groups); + if (!result.ok) window.alert(`Could not save: ${result.reason}`); + else document.getElementById('presetSelect').value = name.trim(); +}); + +document.getElementById('presetDelete').addEventListener('click', () => { + const name = document.getElementById('presetSelect').value; + if (!name) return; + if (!window.confirm(`Delete preset "${name}"?`)) return; + deletePreset(name); + document.getElementById('presetSelect').value = ''; +}); + +document.getElementById('copyShareLink').addEventListener('click', copyShareLink); + +window.addEventListener('hashchange', () => { + const r = consumeHash(); + if (r.ok) { + if (state.groups.length === 0) { + state.groups = r.groups; + state.mode = r.mode; + syncModeButtons(); + notify(); + } else { + showBanner(r.groups, r.mode); + } + } +}); + +// ── initial render ────────────────────────────────────────────────────────── + +renderPresetSelect(); +syncModeButtons(); +syncShareButton(); +renderGroups(); +renderOutput(); +``` + +- [ ] **Step 2: Manual smoke — persistence** + +Run: `python3 -m http.server 8765` then open `http://localhost:8765`. + +Steps: +1. Add a keyword group: `session, attribution`. +2. Confirm it shows in the groups panel. +3. Refresh the browser (`Cmd+R`). +4. Confirm the group is still there. + +Expected: group survives refresh. + +- [ ] **Step 3: Manual smoke — mode persistence** + +Continuing from Step 2: + +1. Click "Full" in the mode toggle. +2. Refresh. +3. Confirm "Full" is still selected and active. + +Expected: mode survives refresh. + +- [ ] **Step 4: Manual smoke — preset save/load/delete** + +1. Click "Save…", enter `MyPreset`. Click OK. +2. Confirm "MyPreset" appears in the preset dropdown. +3. Remove the group via its × button. Groups panel is empty. +4. Select "MyPreset" in the dropdown, click "Load". +5. Group reappears. +6. Click "×" (delete preset). Confirm prompt. Dropdown empty. + +Expected: all preset operations work end-to-end. + +- [ ] **Step 5: Manual smoke — share link** + +1. With at least one group present, click "Share". +2. Button flashes "Copied ✓". +3. Paste the URL into a new browser tab. +4. New tab opens with the same group(s) preloaded. + +Expected: shared link round-trips. (Note: `navigator.clipboard.writeText` requires HTTPS or localhost — `localhost:8765` qualifies.) + +- [ ] **Step 6: Manual smoke — share link with existing local state (banner)** + +1. In the original tab, add a different group: `foo, bar`. +2. Copy the share link from another setup (use the share link from Step 5). +3. Open a new tab with that link. +4. Modify localStorage in DevTools so the tab already has groups (`loghl:state` with content), OR add a group first, THEN paste the share URL into the address bar. +5. The yellow banner appears: "Loaded a shared setup (N groups). [Use shared] [Keep mine] [Merge]". +6. Click each option in three test runs; verify behavior: + - **Use shared**: replaces local groups with shared. + - **Keep mine**: dismisses banner, local groups unchanged. + - **Merge**: appends shared groups, dedupes exact matches. + +Expected: banner behaves per spec. + +Stop the server with Ctrl+C. + +- [ ] **Step 7: Run unit tests one more time** + +Run: `npm test` + +Expected: all tests pass (smoke + storage + presets + share). + +- [ ] **Step 8: Commit** + +```bash +git add src/main.js +git commit -m "feat(main): wire persistence, presets, and share-by-link" +``` + +--- + +## Task 7: Update README + +**Files:** +- Modify: `README.md` + +- [ ] **Step 1: Add new module entries and a usage section** + +In `README.md`, find the `src/` block in the directory tree and add the new modules. Replace the existing tree section with: + +``` +. +├── index.html # markup shell, loads ES module entry +├── styles/ +│ └── app.css # all styles +├── src/ +│ ├── main.js # entry: wires DOM listeners, kicks initial render +│ ├── state.js # PALETTE, state, subscribe/notify pub-sub +│ ├── groups.js # group/keyword CRUD mutators +│ ├── groupsView.js # renders #groups panel +│ ├── payload.js # JSON + NSDictionary detection and pretty-print +│ ├── logcat.js # Android logcat line detection (level + tag) +│ ├── highlight.js # HTML-escaping + overlap-free multi-group highlighter +│ ├── output.js # renders #output panel (filter/full modes) +│ ├── storage.js # versioned localStorage I/O +│ ├── presets.js # named-preset CRUD +│ └── share.js # URL hash encode/decode for shareable links +├── tests/ # vitest unit tests +└── .nojekyll # disables Jekyll processing on GitHub Pages +``` + +Append to the README, before the "Deploy to GitHub Pages" section: + +```markdown +## Tests + +Unit tests cover storage, presets, and share-link encoding. + +```bash +npm install +npm test +``` + +## Sharing setups + +Click **Share** in the Keyword Groups panel to copy a URL with your current groups encoded in the fragment. Send it to a teammate — they open the link, get your setup preloaded, and paste their own logs in. The share URL never includes log content. + +If the recipient already has local groups configured, a banner asks whether to use the shared setup, keep theirs, or merge. +``` + +- [ ] **Step 2: Commit** + +```bash +git add README.md +git commit -m "docs: document storage/presets/share modules and usage" +``` + +--- + +## Task 8: Final integration check + +**Files:** none modified. + +- [ ] **Step 1: Run all tests** + +Run: `npm test` + +Expected: all tests pass across `smoke`, `storage`, `presets`, `share`. + +- [ ] **Step 2: Serve and walk through the full workflow** + +Run: `python3 -m http.server 8765` then open `http://localhost:8765`. + +Walk through: +1. Add two groups: `session,attribution` and `error,fail`. +2. Paste a sample log into the input. Verify highlighting works. +3. Toggle Filter ↔ Full. Verify mode switches and persists on refresh. +4. Save preset "Debug", load preset, delete preset. +5. Click Share. Paste the URL into a new tab. Verify it preloads. +6. In a tab with existing groups, paste the share URL. Verify the banner appears and each button works. +7. Refresh the page repeatedly. Verify nothing is lost. + +Stop the server with Ctrl+C. + +- [ ] **Step 3: Verify no regressions in existing behavior** + +In the served page: +1. Pretty-printed JSON payloads still render multi-line. +2. NSDictionary payloads still reindent. +3. Logcat severity colors still render (V/D/I/W/E/F/A). +4. Filter mode still drops non-matching lines with `···` separators. + +Expected: all previous features behave identically. + +- [ ] **Step 4: No commit needed for this task.** + +If anything failed in the walkthrough, fix it as a new commit before declaring Phase 1 done. diff --git a/docs/superpowers/specs/2026-05-26-loghighlighter-phase1-design.md b/docs/superpowers/specs/2026-05-26-loghighlighter-phase1-design.md new file mode 100644 index 0000000..ecefad5 --- /dev/null +++ b/docs/superpowers/specs/2026-05-26-loghighlighter-phase1-design.md @@ -0,0 +1,282 @@ +# LogHighlighter v2 — Phase 1 Design + +**Date:** 2026-05-26 +**Scope:** Persistence + Named Presets + Share-by-link +**Out of scope (deferred):** regex support, match counts, n/N navigation, collapsible payloads, dark mode + +## 1. Goals + +Solve two stated pains: + +1. **Recurring debug sessions** — keyword groups disappear on page refresh. User re-types them every session. +2. **Sharing setup with teammates** — today, "paste the raw log + tell them which keywords" requires the teammate to manually re-create the configuration. + +These three features form a cohesive bundle. They share the same encoding logic, the same data shape, and the same schema version. They reinforce each other. + +## 2. Non-goals + +- Regex support, match counts, n/N navigation, collapsible payloads, dark mode — all deferred to future phases. Layer in only when friction is real. +- Persisting `state.input` (the log text). Logs can be MB-scale and may contain PII; persisting them across reloads is a data-retention risk with no UX win. +- Cloud sync, multi-user, server-side state — out of scope forever; this is a static tool. + +## 3. Architecture overview + +Three new modules, one UI strip, two small touchpoints in existing files. + +``` +src/ +├── storage.js NEW namespaced localStorage with versioned envelope +├── presets.js NEW preset CRUD (uses storage.js) +├── share.js NEW URL hash encode/decode + load-time banner +├── main.js MOD wire persist + load order + share button + presets UI +├── state.js — unchanged +├── groups.js — unchanged (mutators already call notify()) +├── ... — all other modules unchanged +``` + +Plus a UI strip inside the existing Keyword Groups panel (presets ` renderer +``` + +### Naming constraints +- Trim whitespace. +- 1–40 chars. +- Allow any printable Unicode except control chars. +- Exact-match (case-sensitive) duplicate detection. + +### Overwrite policy +`savePreset` auto-overwrites. The UI layer (not the data layer) shows a `confirm()` when the name already exists. + +### Load semantics +Full replace of `state.groups`. Not merge. Merge would force conflict resolution on `colorIndex` and would not match the user's mental model. + +## 6. Module: `src/share.js` + +### Responsibility +Encode the current keyword setup to a URL hash; decode and apply on load. + +### URL format +``` +https://user.github.io/LogHighlighter/#s= +``` + +Hash fragment, not query — never sent to the server. Single opaque key `s` — atomic, parser-simple. + +### Encoded payload +```js +{ v: 1, g: [{ k: [...keywords], c: colorIndex }], m: 'filter' | 'full' } +``` +Short keys (`g`, `k`, `c`, `m`) save ~25% on JSON before encoding. Schema version `v` is required. + +### What's encoded +- `groups` ✓ (the user's intent) +- `mode` ✓ (sender chose it deliberately; recipient sees the same view) +- `input` ✗ — same reasons as persistence +- theme/other prefs ✗ — recipient's preference wins + +### Size +Plain base64url, no compression. Typical payload (~5 groups × ~8 keywords): ~670 chars. No LZ-string dependency in Phase 1 — it doesn't earn its keep until payloads exceed ~1500 chars, which we won't hit without regex or massive keyword lists. If someone builds a 50-group setup, the link will still work; just longer. + +### Load-time behavior +On page boot, before reading localStorage: + +1. Check `location.hash` for `s=`. +2. Decode. On error, see §6 edge cases. +3. If decoded successfully: + - If `localStorage.groups` is empty/unset → **apply silently**, strip hash via `history.replaceState`, proceed. + - If existing local groups → show a non-blocking banner: + > *Loaded a shared setup (N groups). [Use shared] [Keep mine] [Merge]* + - "Use shared" (default): replace local groups with shared. + - "Keep mine": dismiss banner, do nothing. + - "Merge": append shared groups to local; dedupe by exact `keywords` array equality. +4. After choice, strip hash. + +### UI surface +- "Copy share link" button inside the Keyword Groups panel header (right-aligned). +- On click: copy to clipboard, swap button label to "Copied ✓" for 1.8s, then revert. +- Disabled when `state.groups` is empty, with tooltip "Add a keyword group first." +- Fallback: if `navigator.clipboard.writeText` fails (insecure context, permission), open a `prompt()` with the link preselected. + +### Edge cases +| Case | Behavior | +|---|---| +| Malformed base64 / JSON | Strip hash, `console.warn`, show dismissible banner "Shared link was invalid or corrupted." | +| Schema `v` > 1 | Banner: "Link made with a newer version. Update LogHighlighter or ask sender to re-share." Do not partially apply. | +| Missing required field (`g`) | Treat as malformed. | +| `colorIndex` out of range | Clamp: `colorIndex % PALETTE.length`. Don't reject. | +| `hashchange` mid-session | Listen for `hashchange`; replace any current banner with the new one. | +| Empty `groups: []` in payload | Valid — sender shared "no groups". Apply. | + +## 7. UI changes + +### Keyword Groups panel — preset sub-strip +Inserted as the first child of the existing `.panel-body` in the Keyword Groups panel, above the current add-group row: + +```html +
+ + + + + +
+``` + +- `Save…` prompts for a name via `prompt()` (v1; modal can come later). +- The ` + + + + + +
diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ec7fd2b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3250 @@ +{ + "name": "loghighlighter", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "loghighlighter", + "version": "0.1.0", + "devDependencies": { + "eslint": "^9.39.4", + "globals": "^15.15.0", + "jsdom": "^25.0.0", + "vitest": "^2.1.0" + } + }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.4.tgz", + "integrity": "sha512-F5QXMSiFebS9hKZj02XhWLLnRpJ3B3AROP0tWbFBSj+6kCbg5m9j5JoHKd4mmSVy5mS/IMQloYgYxCuJC0fxEQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.4.tgz", + "integrity": "sha512-GxxTKApUpzRhof7poWvCJHRF51C67u1R7D6DiluBE8wKU1u5GWE8t+v81JvJYtbawoBFX1hLv5Ei4eVjkWokaw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.4.tgz", + "integrity": "sha512-tua0TaJxMOB1R0V0RS1jFZ/RpURFDJIOR2A6jWwQeawuFyS4gBW+rntLRaQd0EQ4bd6Vp44Z2rXW+YYDBsj6IA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.4.tgz", + "integrity": "sha512-CSKq7MsP+5PFIcydhAiR1K0UhEI1A2jWXVKHPCBZ151yOutENwvnPocgVHkivu2kviURtCEB6zUQw0vs8RrhMg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.4.tgz", + "integrity": "sha512-+O8OkVdyvXMtJEciu2wS/pzm1IxntEEQx3z5TAVy4l32G0etZn+RsA48ARRrFm6Ri8fvqPQfgrvNxSjKAbnd3g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.4.tgz", + "integrity": "sha512-Iw3oMskH3AfNuhU0MSN7vNbdi4me/NiYo2azqPz/Le16zHSa+3RRmliCMWWQmh4lcndccU40xcJuTYJZxNo/lw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.4.tgz", + "integrity": "sha512-EIPRXTVQpHyF8WOo219AD2yEltPehLTcTMz2fn6JsatLYSzQf00hj3rulF+yauOlF9/FtM2WpkT/hJh/KJFGhA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.4.tgz", + "integrity": "sha512-J3Yh9PzzF1Ovah2At+lHiGQdsYgArxBbXv/zHfSyaiFQEqvNv7DcW98pCrmdjCZBrqBiKrKKe2V+aaSGWuBe/w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.4.tgz", + "integrity": "sha512-BFDEZMYfUvLn37ONE1yMBojPxnMlTFsdyNoqncT0qFq1mAfllL+ATMMJd8TeuVMiX84s1KbcxcZbXInmcO2mRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.4.tgz", + "integrity": "sha512-pc9EYOSlOgdQ2uPl1o9PF6/kLSgaUosia7gOuS8mB69IxJvlclko1MECXysjs5ryez1/5zjYqx3+xYU0TU6R1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.4.tgz", + "integrity": "sha512-NxnomyxYerDh5n4iLrNa+sH+Z+U4BMEE46V2PgQ/hoB909i8gV1M5wPojWg9fk1jWpO3IQnOs20K4wyZuFLEFQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.4.tgz", + "integrity": "sha512-nbJnQ8a3z1mtmrwImCYhc6BGpThAyYVRQxw9uKSKG4wR6aAYno9sVjJ0zaZcW9BPJX1GbrDPf+SvdWjgTuDmnw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.4.tgz", + "integrity": "sha512-2EU6acNrQLd8tYvo/LXW535wupT3m6fo7HKo6lr7ktQoItxTyOL1ZCR/GfGCuXl2vR+zmfI6eRXkSemafv+iVg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.4.tgz", + "integrity": "sha512-WeBtoMuaMxiiIrO2IYP3xs6GMWkJP2C0EoT8beTLkUPmzV1i/UcOSVw1d5r9KBODtHKilG5yFxsGRnBbK3wJ4A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.4.tgz", + "integrity": "sha512-FJHFfqpKUI3A10WrWKiFbBZ7yVbGT4q4B5o1qKFFojqpaYoh9LrQgqWCmmcxQzVSXYtyB5bzkXrYzlHTs21MYA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.4.tgz", + "integrity": "sha512-mcEl6CUT5IAUmQf1m9FYSmVqCJlpQ8r8eyftFUHG8i9OhY7BkBXSUdnLH5DOf0wCOjcP9v/QO93zpmF1SptCCw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.4.tgz", + "integrity": "sha512-ynt3JxVd2w2buzoKDWIyiV1pJW93xlQic1THVLXilz429oijRpSHivZAgp65KBu+cMcgf1eVVjdnTLvPxgCuoQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.4.tgz", + "integrity": "sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.4.tgz", + "integrity": "sha512-+qfSY27qIrFfI/Hom04KYFw3GKZSGU4lXus51wsb5EuySfFlWRwjkKWoE9emgRw/ukoT4Udsj4W/+xxG8VbPKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.4.tgz", + "integrity": "sha512-VpTfOPHgVXEBeeR8hZ2O0F3aSso+JDWqTWmTmzcQKted54IAdUVbxE+j/MVxUsKa8L20HJhv3vUezVPoquqWjA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.4.tgz", + "integrity": "sha512-IPOsh5aRYuLv/nkU51X10Bf75Bsf6+gZdx1X+QP5QM6lIJFHHqbHLG0uJn/hWthzo13UAc2umiUorqZy3axoZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.4.tgz", + "integrity": "sha512-4QzE9E81OohJ/HKzHhsqU+zcYYojVOXlFMs1DdyMT6qXl/niOH7AVElmmEdUNHHS/oRkc++d5k6Vy85zFs0DEw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.4.tgz", + "integrity": "sha512-zTPgT1YuHHcd+Tmx7h8aml0FWFVelV5N54oHow9SLj+GfoDy/huQ+UV396N/C7KpMDMiPspRktzM1/0r1usYEA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.4.tgz", + "integrity": "sha512-DRS4G7mi9lJxqEDezIkKCaUIKCrLUUDCUaCsTPCi/rtqaC6D/jjwslMQyiDU50Ka0JKpeXeRBFBAXwArY52vBw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.4.tgz", + "integrity": "sha512-QVTUovf40zgTqlFVrKA1uXMVvU2QWEFWfAH8Wdc48IxLvrJMQVMBRjuQyUpzZCDkakImib9eVazbWlC6ksWtJw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cssstyle/node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", + "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdom": { + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz", + "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.1.0", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.12", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.7.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nwsapi": { + "version": "2.2.23", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", + "integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rollup": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.4.tgz", + "integrity": "sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.4", + "@rollup/rollup-android-arm64": "4.60.4", + "@rollup/rollup-darwin-arm64": "4.60.4", + "@rollup/rollup-darwin-x64": "4.60.4", + "@rollup/rollup-freebsd-arm64": "4.60.4", + "@rollup/rollup-freebsd-x64": "4.60.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.4", + "@rollup/rollup-linux-arm-musleabihf": "4.60.4", + "@rollup/rollup-linux-arm64-gnu": "4.60.4", + "@rollup/rollup-linux-arm64-musl": "4.60.4", + "@rollup/rollup-linux-loong64-gnu": "4.60.4", + "@rollup/rollup-linux-loong64-musl": "4.60.4", + "@rollup/rollup-linux-ppc64-gnu": "4.60.4", + "@rollup/rollup-linux-ppc64-musl": "4.60.4", + "@rollup/rollup-linux-riscv64-gnu": "4.60.4", + "@rollup/rollup-linux-riscv64-musl": "4.60.4", + "@rollup/rollup-linux-s390x-gnu": "4.60.4", + "@rollup/rollup-linux-x64-gnu": "4.60.4", + "@rollup/rollup-linux-x64-musl": "4.60.4", + "@rollup/rollup-openbsd-x64": "4.60.4", + "@rollup/rollup-openharmony-arm64": "4.60.4", + "@rollup/rollup-win32-arm64-msvc": "4.60.4", + "@rollup/rollup-win32-ia32-msvc": "4.60.4", + "@rollup/rollup-win32-x64-gnu": "4.60.4", + "@rollup/rollup-win32-x64-msvc": "4.60.4", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup/node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==", + "dev": true, + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d56ddae --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "loghighlighter", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "test": "vitest run", + "test:watch": "vitest", + "lint": "eslint ." + }, + "devDependencies": { + "eslint": "^9.39.4", + "globals": "^15.15.0", + "jsdom": "^25.0.0", + "vitest": "^2.1.0" + } +} diff --git a/src/guide.js b/src/guide.js new file mode 100644 index 0000000..6365081 --- /dev/null +++ b/src/guide.js @@ -0,0 +1,101 @@ +// In-app user guide. A single modal that explains every visible control. + +const HTML = ` +
+ +`; + +let root = null; + +function close() { + if (!root) return; + root.remove(); + root = null; + document.removeEventListener('keydown', onKey); +} + +function onKey(e) { + if (e.key === 'Escape') close(); +} + +export function openGuide() { + if (root) return; + root = document.createElement('div'); + root.className = 'guide-root'; + root.innerHTML = HTML; + root.addEventListener('click', e => { + if (e.target.hasAttribute('data-guide-close')) close(); + }); + document.body.appendChild(root); + document.addEventListener('keydown', onKey); + root.querySelector('.guide-close').focus(); +} diff --git a/src/logcat.js b/src/logcat.js new file mode 100644 index 0000000..5642bcb --- /dev/null +++ b/src/logcat.js @@ -0,0 +1,26 @@ +// Logcat line parsing. Returns { level, tag } when the line matches a known +// logcat format, otherwise null. Level coloring is the only consumer right now; +// `tag` is exposed for future tag-based grouping. + +const DATE = String.raw`(?:\d{4}-)?\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3}`; +const LEVEL = `[VDIWEFA]`; + +const THREADTIME = new RegExp( + `^${DATE}\\s+\\d+\\s+\\d+\\s+(${LEVEL})\\s+([^:]+):` +); +const TIME = new RegExp( + `^${DATE}\\s+(${LEVEL})/([^(:]+?)(?:\\(\\s*\\d+\\))?:` +); +const BRIEF = new RegExp( + `^(${LEVEL})/([^(:]+?)(?:\\(\\s*\\d+\\))?:\\s` +); + +export function parseLogcat(line) { + let m = THREADTIME.exec(line); + if (m) return { level: m[1], tag: m[2].trim() }; + m = TIME.exec(line); + if (m) return { level: m[1], tag: m[2].trim() }; + m = BRIEF.exec(line); + if (m) return { level: m[1], tag: m[2].trim() }; + return null; +} diff --git a/src/main.js b/src/main.js index 0bdcf33..94417f6 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,136 @@ -import { state, subscribe } from './state.js'; +import { state, subscribe, notify } from './state.js'; import { addGroup } from './groups.js'; import { renderGroups } from './groupsView.js'; import { renderOutput } from './output.js'; +import { load, save } from './storage.js'; +import { listPresets, savePreset, loadPreset, deletePreset, onChange as onPresetsChange } from './presets.js'; +import { encodeGroups, consumeHash } from './share.js'; +import { openGuide } from './guide.js'; +import { openPresetEditor } from './presetEditor.js'; + +const STATE_KEY = 'loghl:state'; + +function applyLoadedState(loaded) { + if (!loaded) return; + if (Array.isArray(loaded.groups)) state.groups = loaded.groups; + if (loaded.mode === 'filter' || loaded.mode === 'full') state.mode = loaded.mode; +} + +function renderPresetSelect() { + const select = document.getElementById('presetSelect'); + const current = select.value; + while (select.options.length > 1) select.remove(1); + for (const name of listPresets()) { + const opt = document.createElement('option'); + opt.value = name; + opt.textContent = name; + select.appendChild(opt); + } + if (current && listPresets().includes(current)) select.value = current; + syncPresetSelectionButtons(); +} + +function syncModeButtons() { + document.querySelectorAll('#mode button').forEach(b => { + b.classList.toggle('active', b.dataset.mode === state.mode); + }); +} + +function syncShareButton() { + document.getElementById('copyShareLink').disabled = state.groups.length === 0; +} + +function syncPresetSelectionButtons() { + const hasSelection = document.getElementById('presetSelect').value !== ''; + document.getElementById('presetDelete').disabled = !hasSelection; +} + +function dedupeGroups(groups) { + const seen = new Set(); + const out = []; + for (const g of groups) { + const key = g.keywords.slice().sort().join('').toLowerCase(); + if (seen.has(key)) continue; + seen.add(key); + out.push(g); + } + return out; +} + +function showBanner(sharedGroups, sharedMode) { + const banner = document.getElementById('shareBanner'); + const use = document.getElementById('shareBannerUse'); + const keep = document.getElementById('shareBannerKeep'); + const merge = document.getElementById('shareBannerMerge'); + document.getElementById('shareBannerCount').textContent = String(sharedGroups.length); + banner.hidden = false; + + const onUse = () => { + state.groups = sharedGroups; + state.mode = sharedMode; + syncModeButtons(); + notify(); + cleanup(); + }; + const onKeep = () => cleanup(); + const onMerge = () => { + state.groups = dedupeGroups([...state.groups, ...sharedGroups]); + notify(); + cleanup(); + }; + + function cleanup() { + banner.hidden = true; + use.removeEventListener('click', onUse); + keep.removeEventListener('click', onKeep); + merge.removeEventListener('click', onMerge); + } + + use.addEventListener('click', onUse); + keep.addEventListener('click', onKeep); + merge.addEventListener('click', onMerge); +} + +async function copyShareLink() { + const link = encodeGroups(state.groups, state.mode); + const btn = document.getElementById('copyShareLink'); + const original = btn.textContent; + const flash = () => { + btn.textContent = 'Copied ✓'; + setTimeout(() => { btn.textContent = original; }, 1800); + }; + try { + await navigator.clipboard.writeText(link); + flash(); + } catch (_) { + window.prompt('Copy this link:', link); + } +} + +// ── init ──────────────────────────────────────────────────────────────────── + +const saved = load(STATE_KEY); +applyLoadedState(saved); + +const hashResult = consumeHash(); +if (hashResult.ok) { + if (state.groups.length === 0) { + state.groups = hashResult.groups; + state.mode = hashResult.mode; + save(STATE_KEY, { groups: state.groups, mode: state.mode }); + } else { + showBanner(hashResult.groups, hashResult.mode); + } +} subscribe(renderGroups); subscribe(renderOutput); +subscribe(syncShareButton); +subscribe(() => save(STATE_KEY, { groups: state.groups, mode: state.mode })); + +onPresetsChange(renderPresetSelect); + +// ── DOM wiring ────────────────────────────────────────────────────────────── document.getElementById('addGroup').addEventListener('click', () => { const input = document.getElementById('newGroup'); @@ -29,11 +155,63 @@ document.getElementById('mode').addEventListener('click', e => { const btn = e.target.closest('button[data-mode]'); if (!btn) return; state.mode = btn.dataset.mode; - document.querySelectorAll('#mode button').forEach(b => { - b.classList.toggle('active', b === btn); - }); - renderOutput(); + syncModeButtons(); + notify(); }); +document.getElementById('presetSelect').addEventListener('change', () => { + syncPresetSelectionButtons(); + const name = document.getElementById('presetSelect').value; + if (!name) return; + const groups = loadPreset(name); + if (!groups) return; + state.groups = groups; + notify(); +}); + +document.getElementById('presetCreate').addEventListener('click', async () => { + const result = await openPresetEditor(); + if (!result) return; + const { name, groups } = result; + if (listPresets().includes(name) && !window.confirm(`Overwrite existing preset "${name}"?`)) return; + const saved = savePreset(name, groups); + if (!saved.ok) { window.alert(`Could not create preset: ${saved.reason}`); return; } + document.getElementById('presetSelect').value = name; + syncPresetSelectionButtons(); +}); + +document.getElementById('presetDelete').addEventListener('click', () => { + const name = document.getElementById('presetSelect').value; + if (!name) return; + if (!window.confirm(`Delete preset "${name}"?`)) return; + deletePreset(name); + document.getElementById('presetSelect').value = ''; + syncPresetSelectionButtons(); +}); + +document.getElementById('copyShareLink').addEventListener('click', copyShareLink); + +document.getElementById('openGuide').addEventListener('click', openGuide); + +window.addEventListener('hashchange', () => { + const r = consumeHash(); + if (r.ok) { + if (state.groups.length === 0) { + state.groups = r.groups; + state.mode = r.mode; + syncModeButtons(); + notify(); + } else { + showBanner(r.groups, r.mode); + } + } +}); + +// ── initial render ────────────────────────────────────────────────────────── + +renderPresetSelect(); +syncModeButtons(); +syncShareButton(); +syncPresetSelectionButtons(); renderGroups(); renderOutput(); diff --git a/src/output.js b/src/output.js index eb1f821..479fbc6 100644 --- a/src/output.js +++ b/src/output.js @@ -1,7 +1,14 @@ import { state } from './state.js'; import { detectPayload } from './payload.js'; +import { parseLogcat } from './logcat.js'; import { escapeHTML, highlight } from './highlight.js'; +function lineDiv(line, innerHTML) { + const lc = parseLogcat(line); + const cls = lc ? ` class="lc lc-${lc.level}"` : ''; + return `${innerHTML}
`; +} + function lineMatches(line) { if (!state.groups.length) return false; const lower = line.toLowerCase(); @@ -47,11 +54,11 @@ export function renderOutput() { if (!matched) { dropped++; continue; } if (dropped > 0 && emittedAny) html.push('
···
'); dropped = 0; - html.push('
' + renderLine(line) + '
'); + html.push(lineDiv(line, renderLine(line))); emittedAny = true; } else { - if (matched) html.push('
' + renderLine(line) + '
'); - else html.push('
' + escapeHTML(line) + '
'); + if (matched) html.push(lineDiv(line, renderLine(line))); + else html.push(lineDiv(line, escapeHTML(line))); emittedAny = true; } } diff --git a/src/presetEditor.js b/src/presetEditor.js new file mode 100644 index 0000000..81430ee --- /dev/null +++ b/src/presetEditor.js @@ -0,0 +1,98 @@ +// Modal for creating (or editing) a preset. Pre-fills the keywords textarea +// from `initialGroups` so "save my current setup" still works in one click. +// +// Returns a promise that resolves to { name, groups } on Create, or null on +// Cancel / Esc / backdrop click. + +function parseKeywordLines(text) { + const groups = []; + for (const line of text.split('\n')) { + const raw = line.split(',').map(s => s.trim()).filter(Boolean); + const unique = []; + for (const k of raw) { + if (!unique.some(x => x.toLowerCase() === k.toLowerCase())) unique.push(k); + } + if (unique.length) groups.push({ keywords: unique, colorIndex: groups.length % 10 }); + } + return groups; +} + +function serializeGroups(groups) { + return groups.map(g => g.keywords.join(', ')).join('\n'); +} + +const HTML = ` +
+ +`; + +export function openPresetEditor({ initialName = '', initialGroups = [] } = {}) { + return new Promise(resolve => { + const root = document.createElement('div'); + root.className = 'editor-root'; + root.innerHTML = HTML; + document.body.appendChild(root); + + const nameInput = root.querySelector('#editorName'); + const kwInput = root.querySelector('#editorKeywords'); + const submit = root.querySelector('#editorSubmit'); + + nameInput.value = initialName; + kwInput.value = serializeGroups(initialGroups); + + function syncSubmit() { + const hasName = nameInput.value.trim().length > 0; + const hasGroups = parseKeywordLines(kwInput.value).length > 0; + submit.disabled = !(hasName && hasGroups); + } + syncSubmit(); + + function done(result) { + root.remove(); + document.removeEventListener('keydown', onKey); + resolve(result); + } + + function onKey(e) { + if (e.key === 'Escape') done(null); + else if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !submit.disabled) { + done({ name: nameInput.value.trim(), groups: parseKeywordLines(kwInput.value) }); + } + } + + nameInput.addEventListener('input', syncSubmit); + kwInput.addEventListener('input', syncSubmit); + root.addEventListener('click', e => { + if (e.target.hasAttribute('data-editor-close')) done(null); + }); + submit.addEventListener('click', () => { + done({ name: nameInput.value.trim(), groups: parseKeywordLines(kwInput.value) }); + }); + + document.addEventListener('keydown', onKey); + (initialName ? kwInput : nameInput).focus(); + }); +} diff --git a/src/presets.js b/src/presets.js new file mode 100644 index 0000000..6f15e7d --- /dev/null +++ b/src/presets.js @@ -0,0 +1,69 @@ +import { load, save } from './storage.js'; + +const KEY = 'loghl:presets'; +const MAX_NAME = 40; +const listeners = new Set(); + +function readAll() { + return load(KEY) || {}; +} + +function writeAll(all) { + save(KEY, all); + listeners.forEach(fn => fn()); +} + +function validateName(name) { + if (typeof name !== 'string') return { ok: false, reason: 'name must be a string' }; + const trimmed = name.trim(); + if (!trimmed.length) return { ok: false, reason: 'name is empty' }; + if (trimmed.length > MAX_NAME) return { ok: false, reason: `name exceeds ${MAX_NAME} chars` }; + if (/[\x00-\x1f\x7f]/.test(trimmed)) return { ok: false, reason: 'name contains control characters' }; + return { ok: true, trimmed }; +} + +export function listPresets() { + return Object.keys(readAll()); +} + +export function savePreset(name, groups) { + const v = validateName(name); + if (!v.ok) return v; + const all = readAll(); + all[v.trimmed] = { groups: structuredClone(groups), savedAt: Date.now() }; + writeAll(all); + return { ok: true }; +} + +export function loadPreset(name) { + const all = readAll(); + const entry = all[name]; + if (!entry) return null; + return structuredClone(entry.groups); +} + +export function deletePreset(name) { + const all = readAll(); + if (!(name in all)) return false; + delete all[name]; + writeAll(all); + return true; +} + +export function renamePreset(oldName, newName) { + const v = validateName(newName); + if (!v.ok) return v; + const all = readAll(); + if (!(oldName in all)) return { ok: false, reason: 'preset not found' }; + if (v.trimmed === oldName) return { ok: true }; + if (v.trimmed in all) return { ok: false, reason: 'name already exists' }; + all[v.trimmed] = all[oldName]; + delete all[oldName]; + writeAll(all); + return { ok: true }; +} + +export function onChange(fn) { + listeners.add(fn); + return () => listeners.delete(fn); +} diff --git a/src/share.js b/src/share.js new file mode 100644 index 0000000..5c6cc0a --- /dev/null +++ b/src/share.js @@ -0,0 +1,70 @@ +const VERSION = 1; +const PALETTE_LEN = 10; + +function base64urlEncode(str) { + const bytes = new TextEncoder().encode(str); + let bin = ''; + for (const b of bytes) bin += String.fromCharCode(b); + return btoa(bin).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); +} + +function base64urlDecode(s) { + const pad = s.length % 4 === 0 ? '' : '='.repeat(4 - (s.length % 4)); + const b64 = s.replace(/-/g, '+').replace(/_/g, '/') + pad; + const bin = atob(b64); + const bytes = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i); + return new TextDecoder().decode(bytes); +} + +export function encodeGroups(groups, mode) { + const payload = { + v: VERSION, + g: groups.map(g => ({ k: g.keywords, c: g.colorIndex })), + m: mode, + }; + const encoded = base64urlEncode(JSON.stringify(payload)); + const base = window.location.href.split('#')[0]; + return `${base}#s=${encoded}`; +} + +export function decodeHash() { + const hash = window.location.hash; + if (!hash || !hash.startsWith('#s=')) return { ok: false, reason: 'no-hash' }; + const encoded = hash.slice(3); + let json; + try { + json = base64urlDecode(encoded); + } catch (_) { + return { ok: false, reason: 'malformed-base64' }; + } + let parsed; + try { + parsed = JSON.parse(json); + } catch (_) { + return { ok: false, reason: 'malformed-json' }; + } + if (!parsed || typeof parsed !== 'object') return { ok: false, reason: 'not-object' }; + if (parsed.v == null) return { ok: false, reason: 'missing-version' }; + if (parsed.v > VERSION) return { ok: false, reason: 'future-version' }; + if (!Array.isArray(parsed.g)) return { ok: false, reason: 'missing-groups' }; + const groups = parsed.g.map(g => ({ + keywords: Array.isArray(g.k) ? g.k.filter(s => typeof s === 'string') : [], + colorIndex: Number.isInteger(g.c) + ? ((g.c % PALETTE_LEN) + PALETTE_LEN) % PALETTE_LEN + : 0, + })); + const mode = parsed.m === 'full' ? 'full' : 'filter'; + return { ok: true, groups, mode }; +} + +export function stripHash() { + const url = window.location.href.split('#')[0]; + window.history.replaceState(null, '', url); +} + +export function consumeHash() { + const result = decodeHash(); + if (result.ok) stripHash(); + return result; +} diff --git a/src/storage.js b/src/storage.js new file mode 100644 index 0000000..65a6e32 --- /dev/null +++ b/src/storage.js @@ -0,0 +1,50 @@ +const VERSION = 1; +let availableCache = null; + +export function isAvailable() { + if (availableCache !== null) return availableCache; + try { + const probe = '__loghl_probe__'; + localStorage.setItem(probe, '1'); + localStorage.removeItem(probe); + availableCache = true; + } catch (_) { + availableCache = false; + } + return availableCache; +} + +export function load(key) { + if (!isAvailable()) return null; + try { + const raw = localStorage.getItem(key); + if (raw == null) return null; + const parsed = JSON.parse(raw); + if (!parsed || parsed.version !== VERSION) return null; + return parsed.data; + } catch (err) { + console.warn('[loghl:storage] load failed for', key, err); + return null; + } +} + +export function save(key, value) { + if (!isAvailable()) return false; + try { + const envelope = JSON.stringify({ version: VERSION, data: value }); + localStorage.setItem(key, envelope); + return true; + } catch (err) { + console.warn('[loghl:storage] save failed for', key, err); + return false; + } +} + +export function remove(key) { + if (!isAvailable()) return; + try { + localStorage.removeItem(key); + } catch (err) { + console.warn('[loghl:storage] remove failed for', key, err); + } +} diff --git a/styles/app.css b/styles/app.css index 8bdec65..84c0ecf 100644 --- a/styles/app.css +++ b/styles/app.css @@ -173,3 +173,292 @@ main { #output .sep { color: var(--muted); text-align: center; padding: 4px 0; user-select: none; } .placeholder { color: var(--muted); font-family: inherit; font-size: 13px; } mark { padding: 0 1px; border-radius: 2px; color: #000; } + +#output .lc { border-left: 3px solid transparent; padding-left: 6px; } +#output .lc-V { border-left-color: #b0b0b0; color: #666; } +#output .lc-D { border-left-color: #5a9fd4; } +#output .lc-I { border-left-color: #4caf50; } +#output .lc-W { border-left-color: #f0a020; background: rgba(240, 160, 32, 0.06); } +#output .lc-E { border-left-color: #e04040; background: rgba(224, 64, 64, 0.07); } +#output .lc-F { border-left-color: #b00020; background: rgba(176, 0, 32, 0.10); font-weight: 600; } +#output .lc-A { border-left-color: #8a4dff; background: rgba(138, 77, 255, 0.07); } + +.presets { + display: flex; + gap: 6px; + margin-bottom: 8px; + align-items: center; +} +.presets select { + flex: 1; + min-width: 0; + padding: 5px 6px; + border: 1px solid var(--border); + border-radius: 6px; + background: var(--panel); + font: inherit; + color: var(--text); +} +.presets button { + padding: 5px 10px; + border: 1px solid var(--border); + background: var(--panel); + border-radius: 6px; + cursor: pointer; + font: inherit; + color: var(--text); +} +.presets button:hover:not(:disabled) { background: #f0f0f0; } +.presets button:disabled { opacity: 0.5; cursor: not-allowed; } +.presets #presetDelete { padding: 5px 8px; } + +.share-banner { + display: flex; + gap: 8px; + align-items: center; + padding: 8px 16px; + background: #fff8d4; + border-bottom: 1px solid #e0c060; + font-size: 13px; +} +.share-banner[hidden] { display: none; } +.share-banner-text { flex: 1; } +.share-banner button { + padding: 4px 10px; + border: 1px solid var(--border); + background: var(--panel); + border-radius: 6px; + cursor: pointer; + font: inherit; + color: var(--text); +} +.share-banner button:hover { background: #f0f0f0; } + +.header-right { + display: flex; + align-items: center; + gap: 10px; +} +.header-btn { + padding: 6px 12px; + border: 1px solid var(--border); + background: var(--panel); + border-radius: 6px; + cursor: pointer; + font: inherit; + color: var(--text); +} +.header-btn:hover { background: #f0f0f0; } + +.guide-root { + position: fixed; + inset: 0; + z-index: 100; + display: flex; + align-items: center; + justify-content: center; +} +.guide-backdrop { + position: absolute; + inset: 0; + background: rgba(0, 0, 0, 0.4); +} +.guide-dialog { + position: relative; + background: var(--panel); + border: 1px solid var(--border); + border-radius: 10px; + width: min(720px, 92vw); + max-height: 86vh; + display: flex; + flex-direction: column; + box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25); +} +.guide-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 12px 16px; + border-bottom: 1px solid var(--border); +} +.guide-header h2 { + margin: 0; + font-size: 16px; + font-weight: 600; +} +.guide-close { + border: 0; + background: transparent; + font-size: 22px; + line-height: 1; + cursor: pointer; + color: var(--muted); + padding: 0 4px; +} +.guide-close:hover { color: #d33; } +.guide-body { + padding: 12px 18px 18px; + overflow: auto; + font-size: 13px; + line-height: 1.55; +} +.guide-body section { margin-bottom: 14px; } +.guide-body section:last-child { margin-bottom: 0; } +.guide-body h3 { + margin: 6px 0 6px; + font-size: 13px; + text-transform: uppercase; + letter-spacing: 0.05em; + color: var(--muted); +} +.guide-body p { margin: 4px 0; } +.guide-body ul { margin: 4px 0; padding-left: 20px; } +.guide-body li { margin: 2px 0; } +.guide-body code { + font-family: var(--mono); + background: rgba(0, 0, 0, 0.06); + padding: 1px 4px; + border-radius: 3px; + font-size: 12px; +} +.guide-body kbd { + font-family: var(--mono); + background: #f3f3f3; + border: 1px solid var(--border); + border-radius: 3px; + padding: 1px 5px; + font-size: 11px; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08); +} +.guide-levels { list-style: none; padding-left: 0; } +.guide-levels li { display: flex; align-items: center; gap: 8px; } +.guide-levels .lvl { + display: inline-flex; + align-items: center; + justify-content: center; + width: 22px; + height: 22px; + border-radius: 4px; + font-family: var(--mono); + font-weight: 600; + font-size: 12px; + border-left: 3px solid transparent; +} +.guide-levels .lvl-V { border-left-color: #b0b0b0; color: #666; } +.guide-levels .lvl-D { border-left-color: #5a9fd4; } +.guide-levels .lvl-I { border-left-color: #4caf50; } +.guide-levels .lvl-W { border-left-color: #f0a020; background: rgba(240, 160, 32, 0.12); } +.guide-levels .lvl-E { border-left-color: #e04040; background: rgba(224, 64, 64, 0.14); } +.guide-levels .lvl-F { border-left-color: #b00020; background: rgba(176, 0, 32, 0.18); font-weight: 700; } +.guide-levels .lvl-A { border-left-color: #8a4dff; background: rgba(138, 77, 255, 0.14); } + +.editor-root { + position: fixed; + inset: 0; + z-index: 100; + display: flex; + align-items: center; + justify-content: center; +} +.editor-backdrop { + position: absolute; + inset: 0; + background: rgba(0, 0, 0, 0.4); +} +.editor-dialog { + position: relative; + background: var(--panel); + border: 1px solid var(--border); + border-radius: 10px; + width: min(520px, 92vw); + max-height: 86vh; + display: flex; + flex-direction: column; + box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25); +} +.editor-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 12px 16px; + border-bottom: 1px solid var(--border); +} +.editor-header h2 { margin: 0; font-size: 16px; font-weight: 600; } +.editor-close { + border: 0; + background: transparent; + font-size: 22px; + line-height: 1; + cursor: pointer; + color: var(--muted); + padding: 0 4px; +} +.editor-close:hover { color: #d33; } +.editor-body { + padding: 14px 18px; + display: flex; + flex-direction: column; + gap: 14px; + overflow: auto; +} +.editor-field { + display: flex; + flex-direction: column; + gap: 6px; +} +.editor-label { + font-size: 11px; + text-transform: uppercase; + letter-spacing: 0.06em; + color: var(--muted); + font-weight: 600; +} +.editor-field input, +.editor-field textarea { + width: 100%; + padding: 8px 10px; + border: 1px solid var(--border); + border-radius: 6px; + font-family: var(--mono); + font-size: 12px; + background: var(--panel); + color: var(--text); + outline: none; +} +.editor-field input:focus, +.editor-field textarea:focus { + border-color: var(--accent); +} +.editor-field textarea { + resize: vertical; + min-height: 120px; + line-height: 1.5; +} +.editor-hint { + font-size: 11px; + color: var(--muted); +} +.editor-footer { + display: flex; + justify-content: flex-end; + gap: 8px; + padding: 12px 16px; + border-top: 1px solid var(--border); +} +.editor-footer button { + padding: 6px 14px; + border: 1px solid var(--border); + background: var(--panel); + border-radius: 6px; + cursor: pointer; + font: inherit; + color: var(--text); +} +.editor-footer button:hover:not(:disabled) { background: #f0f0f0; } +.editor-footer button.primary { + background: var(--accent); + color: #fff; + border-color: var(--accent); +} +.editor-footer button.primary:hover:not(:disabled) { background: #234a85; } +.editor-footer button:disabled { opacity: 0.5; cursor: not-allowed; } diff --git a/tests/presets.test.js b/tests/presets.test.js new file mode 100644 index 0000000..f5b75c0 --- /dev/null +++ b/tests/presets.test.js @@ -0,0 +1,87 @@ +import { describe, it, expect, beforeEach } from 'vitest'; +import { listPresets, savePreset, loadPreset, deletePreset, renamePreset, onChange } from '../src/presets.js'; + +beforeEach(() => { + localStorage.clear(); +}); + +const sampleGroups = [{ keywords: ['session'], colorIndex: 0 }]; + +describe('presets', () => { + it('list is empty initially', () => { + expect(listPresets()).toEqual([]); + }); + + it('saves a preset and lists it', () => { + const result = savePreset('Attribution', sampleGroups); + expect(result.ok).toBe(true); + expect(listPresets()).toEqual(['Attribution']); + }); + + it('loadPreset returns the saved groups', () => { + savePreset('A', sampleGroups); + expect(loadPreset('A')).toEqual(sampleGroups); + }); + + it('loadPreset returns null for unknown name', () => { + expect(loadPreset('Nope')).toBeNull(); + }); + + it('savePreset auto-overwrites existing name', () => { + savePreset('A', sampleGroups); + const newer = [{ keywords: ['attribution'], colorIndex: 1 }]; + savePreset('A', newer); + expect(loadPreset('A')).toEqual(newer); + expect(listPresets()).toEqual(['A']); + }); + + it('savePreset trims whitespace', () => { + savePreset(' Trim Me ', sampleGroups); + expect(listPresets()).toEqual(['Trim Me']); + }); + + it('savePreset rejects empty name', () => { + expect(savePreset(' ', sampleGroups).ok).toBe(false); + }); + + it('savePreset rejects names over 40 chars', () => { + const long = 'x'.repeat(41); + expect(savePreset(long, sampleGroups).ok).toBe(false); + }); + + it('savePreset rejects names with control characters', () => { + expect(savePreset('A\nB', sampleGroups).ok).toBe(false); + }); + + it('deletePreset removes a preset and returns true', () => { + savePreset('A', sampleGroups); + expect(deletePreset('A')).toBe(true); + expect(listPresets()).toEqual([]); + }); + + it('deletePreset returns false for unknown name', () => { + expect(deletePreset('Nope')).toBe(false); + }); + + it('renamePreset moves an entry', () => { + savePreset('Old', sampleGroups); + const result = renamePreset('Old', 'New'); + expect(result.ok).toBe(true); + expect(listPresets()).toEqual(['New']); + expect(loadPreset('New')).toEqual(sampleGroups); + }); + + it('renamePreset rejects collision with existing name', () => { + savePreset('A', sampleGroups); + savePreset('B', sampleGroups); + expect(renamePreset('A', 'B').ok).toBe(false); + }); + + it('onChange fires after savePreset and deletePreset', () => { + let calls = 0; + onChange(() => calls++); + savePreset('A', sampleGroups); + deletePreset('A'); + expect(calls).toBe(2); + }); +}); diff --git a/tests/share.test.js b/tests/share.test.js new file mode 100644 index 0000000..7147c0f --- /dev/null +++ b/tests/share.test.js @@ -0,0 +1,88 @@ +import { describe, it, expect, beforeEach } from 'vitest'; +import { encodeGroups, decodeHash, consumeHash } from '../src/share.js'; + +const sampleGroups = [ + { keywords: ['session', 'attribution'], colorIndex: 0 }, + { keywords: ['CMP'], colorIndex: 3 }, +]; + +beforeEach(() => { + window.location.hash = ''; +}); + +describe('share', () => { + it('encodes and decodes a roundtrip', () => { + const link = encodeGroups(sampleGroups, 'filter'); + const hash = link.split('#')[1]; + window.location.hash = hash; + const decoded = decodeHash(); + expect(decoded.ok).toBe(true); + expect(decoded.groups).toEqual(sampleGroups); + expect(decoded.mode).toBe('filter'); + }); + + it('returns no-hash when location has no hash', () => { + window.location.hash = ''; + expect(decodeHash()).toEqual({ ok: false, reason: 'no-hash' }); + }); + + it('rejects malformed base64', () => { + window.location.hash = '#s=!!!not-base64!!!'; + const r = decodeHash(); + expect(r.ok).toBe(false); + expect(['malformed-base64', 'malformed-json']).toContain(r.reason); + }); + + it('rejects malformed JSON', () => { + const bad = btoa('{not-json').replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${bad}`; + expect(decodeHash().reason).toBe('malformed-json'); + }); + + it('rejects future schema versions', () => { + const payload = btoa(JSON.stringify({ v: 99, g: [], m: 'filter' })) + .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + expect(decodeHash().reason).toBe('future-version'); + }); + + it('rejects missing groups field', () => { + const payload = btoa(JSON.stringify({ v: 1, m: 'filter' })) + .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + expect(decodeHash().reason).toBe('missing-groups'); + }); + + it('clamps out-of-range colorIndex', () => { + const payload = btoa(JSON.stringify({ + v: 1, + g: [{ k: ['x'], c: 99 }], + m: 'filter', + })).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + const r = decodeHash(); + expect(r.ok).toBe(true); + expect(r.groups[0].colorIndex).toBe(99 % 10); + }); + + it('defaults mode to filter when invalid', () => { + const payload = btoa(JSON.stringify({ v: 1, g: [], m: 'garbage' })) + .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + window.location.hash = `#s=${payload}`; + expect(decodeHash().mode).toBe('filter'); + }); + + it('consumeHash strips the hash on success', () => { + const link = encodeGroups(sampleGroups, 'filter'); + window.location.hash = link.split('#')[1]; + const r = consumeHash(); + expect(r.ok).toBe(true); + expect(window.location.hash).toBe(''); + }); + + it('consumeHash leaves hash when decode fails', () => { + window.location.hash = '#s=!!!bad!!!'; + consumeHash(); + expect(window.location.hash).toBe('#s=!!!bad!!!'); + }); +}); diff --git a/tests/smoke.test.js b/tests/smoke.test.js new file mode 100644 index 0000000..2293648 --- /dev/null +++ b/tests/smoke.test.js @@ -0,0 +1,12 @@ +import { describe, it, expect } from 'vitest'; + +describe('smoke', () => { + it('runs', () => { + expect(1 + 1).toBe(2); + }); + + it('has DOM access (jsdom)', () => { + document.body.innerHTML = '
hi
'; + expect(document.getElementById('x').textContent).toBe('hi'); + }); +}); diff --git a/tests/storage.test.js b/tests/storage.test.js new file mode 100644 index 0000000..2fc964c --- /dev/null +++ b/tests/storage.test.js @@ -0,0 +1,42 @@ +import { describe, it, expect, beforeEach } from 'vitest'; +import { load, save, remove, isAvailable } from '../src/storage.js'; + +beforeEach(() => { + localStorage.clear(); +}); + +describe('storage', () => { + it('saves and loads a value', () => { + save('loghl:test', { hello: 'world' }); + expect(load('loghl:test')).toEqual({ hello: 'world' }); + }); + + it('returns null for missing key', () => { + expect(load('loghl:missing')).toBeNull(); + }); + + it('returns null for corrupt JSON', () => { + localStorage.setItem('loghl:bad', '{not-json'); + expect(load('loghl:bad')).toBeNull(); + }); + + it('returns null for version mismatch', () => { + localStorage.setItem('loghl:old', JSON.stringify({ version: 99, data: { x: 1 } })); + expect(load('loghl:old')).toBeNull(); + }); + + it('returns null for envelope without version', () => { + localStorage.setItem('loghl:naked', JSON.stringify({ x: 1 })); + expect(load('loghl:naked')).toBeNull(); + }); + + it('remove deletes a key', () => { + save('loghl:rm', { x: 1 }); + remove('loghl:rm'); + expect(load('loghl:rm')).toBeNull(); + }); + + it('isAvailable returns true in jsdom', () => { + expect(isAvailable()).toBe(true); + }); +}); diff --git a/vitest.config.js b/vitest.config.js new file mode 100644 index 0000000..bf48a75 --- /dev/null +++ b/vitest.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'jsdom', + include: ['tests/**/*.test.js'], + }, +});