diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d95f81b..16d1c52eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -186,9 +186,12 @@ notes. Entries describe what users experience, not internal refactors. ### Changed -- The editor page fetches about a fifth less JavaScript before it can start - (281 KB instead of 350 KB compressed). Browser-agent text reading and the - install prompt now load when they are first needed. +- The editor page fetches less than half the JavaScript it did before it can + start (163 KB instead of 350 KB compressed). Browser-agent text reading and + the install prompt load when first needed, and an unused character-set + detector is no longer shipped. +- The local history page no longer downloads the editor to show its list + (122 KB instead of 148 KB compressed). - Voice controls stay in place while recording or finishing. Explanations appear without moving the draft, and cancelling preserves the text typed before dictation. - **Configured assistants reopen in chat.** Enable a downloaded model or reconnect diff --git a/CLAUDE.md b/CLAUDE.md index 7c397fae6..9e2083862 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -98,6 +98,8 @@ lib/ # 应用层(纯 TypeScript,只在本站点用) session.ts # 会话身份:mint docId 并写进 ?saved= recovery.ts # 启动恢复条(Office Document Recovery 模型) types.ts / index.ts # 记录形状与保留期工具 / 对外装配(含 savedToDisk 回调注入) + preferences.ts / relative-time.ts # 自动保存开关与"5 分钟前"——/history 只能从这两个、types、store 取东西; + # import recovery / autosave 会把整套编辑器拉进历史页(editor-startup-payload.spec 钉住) history-page.ts # /history 页面(第三个 vite entry,见 history.html) sw-update.ts # SW 更新策略的编辑器一侧(有文档打开时不提升 worker);落地页一侧在 public/sw-register.js agent-plugin/ # Agent 协同编辑:editor-bridge(直调 window.editor)、tools、ui/ diff --git a/docs/explorations/2026-10-24-jschardet-and-history-payload.md b/docs/explorations/2026-10-24-jschardet-and-history-payload.md new file mode 100644 index 000000000..0c6907305 --- /dev/null +++ b/docs/explorations/2026-10-24-jschardet-and-history-payload.md @@ -0,0 +1,106 @@ +# Startup payload, round two: jschardet and the history page + +Follow-up to `2026-10-24-editor-startup-payload.md`. Measuring the startup +graph again, module by module through sourcemaps, turned up two more problems. + +## jschardet: 332 KB of an entry chunk nobody called + +After round one, the editor's entry chunk was 417 KB, and 466 KB of its source +was jschardet, a statistical charset detector. + +Nothing in this app detects charsets statistically. CSV decoding uses +`decodeTextBytes` (`ranuts/utils/binary`), which tries a strict utf-8 decode, +then gb18030, then latin1, without jschardet. The import came from +`ranuts/utils/str.ts`, which imported `detect` from jschardet at the top for +three functions: `checkEncoding`, `arrayBufferToString` and `transformText`. +The same file holds `MessageCodec`, and `lib/events.ts` uses it at startup. + +jschardet is CommonJS. Bundlers treat its import as a side effect and cannot +remove it, so every consumer of anything in `str.ts` shipped the whole +detector. + +The fix belongs in ranuts (chaxus/ran#443, released in 0.5.1): the three +functions moved to `utils/charset.ts`. `ranuts/utils` exports the same names. +A ranuts test bundles a `MessageCodec` consumer and a `checkEncoding` consumer +through Vite, and checks that the detector appears only in the second. + +Before the release, a consumer-side `treeshake.moduleSideEffects` override in +`vite.config.ts` confirmed the number: editor entry chunk 417 KB → 85 KB. That +override was dropped in favour of the upstream fix. This PR only upgrades +ranuts and ranui to 0.5.1 (ranview 0.2.1 comes with ranui). + +The upgrade also re-syncs the ranui files this repo keeps in `public/` +(`ran-tokens.css`, `ranui-iife/*`). The steps are the same ones `bin/build.sh` +runs on every build. + +## The history page loaded the editor + +CLAUDE.md describes `/history` as not loading the editor. In practice it did, +through two imports: + +- `formatRelativeTime` from `lib/history/recovery.ts`, which imports + `lib/document.ts` and so the whole open pipeline; +- `isAutosaveEnabled` / `setAutosaveEnabled` from `lib/history/autosave.ts`, + which imports `onlyoffice/save-stream.ts`. + +Both helpers are pure. They now live in `lib/history/relative-time.ts` and +`lib/history/preferences.ts`. The history page writes the preference with +`writeAutosavePreference`. The editor-side `setAutosaveEnabled` keeps its old +behavior: it writes the preference, then stops the running session. On the +history page that second step was always a no-op, because no session runs +there. + +## Measurements + +The static startup graph, summed per chunk from `.vite/manifest.json`: + +| Page | Before (main `47ee1d3a`) | After | +| ------------------------- | ------------------------- | ------------------------ | +| `/editor` | 866 KB raw / 280 KB gzip | 537 KB raw / 163 KB gzip | +| `/history` | 476 KB raw / 148 KB gzip | 400 KB raw / 122 KB gzip | +| `/editor` vs. pre-round-1 | 1102 KB raw / 350 KB gzip | 537 KB raw / 163 KB gzip | + +## Tests and reverse validation + +`test/e2e/editor-startup-payload.spec.ts` now covers both pages: + +- `/editor` must not contain the agent tools, the PWA library, or jschardet's + charset table (`windows-1255`). +- `/history` must not contain the save pipeline's `Save conversion failed`, or + jschardet. + +Reverse validation: + +- **ranuts back at 0.5.0:** the editor case failed on jschardet in the entry + chunk. +- **History page importing `history/recovery` and `history/autosave` again:** + the history case failed on the save pipeline in the `document` chunk. + +## Left for later + +All seven site languages' message tables (about 215 KB of source in one shared +chunk) load on both pages, though each page uses one. Loading them per locale +changes `@ranuts/shared/i18n`, whose `t()` is synchronous and is used by three +sites. That is a shared-contract change, not a payload fix. + +## The ranui upgrade hid the assistant's portals under the panel + +The first CI run of this PR failed one case: `agent-dictation.spec.ts`, docx. +Hovering the voice privacy hint timed out because the composer textarea was on +top of it. + +- **Cause:** in ranui 0.5.1 the floating controller writes the portal layer + inline, as `z-index: var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, +1100))`. Our `.agent-speech-popover` and `r-dropdown[role='listbox']` rules + set a plain `z-index: 100000`, and an inline style beats a stylesheet rule. + So both portals dropped to 1100, under the assistant panel at 10000. +- **Bisected:** main with only ranui moved to 0.5.1 fails the same way. With + 0.5.0 the hint's portal sits at 100000. +- **Fix:** set `--ran-dropdown-host-z-index: 100000` instead, which ranui's + own inline value reads. +- **Second victim:** select lists opened from the panel go through the same + controller, so they were also drawn under it, and no test noticed. + `agent-portal-layer.spec.ts` now opens a settings select and asserts its + list is the topmost element at its centre. +- **Reverse validation:** with the stylesheet change reverted, both the new + case and the dictation case fail. diff --git a/lib/history-page.ts b/lib/history-page.ts index 45d23a4e7..849400961 100644 --- a/lib/history-page.ts +++ b/lib/history-page.ts @@ -20,10 +20,10 @@ import '../styles/history.css'; import { saveFileToDisk } from 'ranuts/utils'; import { applyDocumentLanguage, getLanguage, localeHomePath, t, withLocale } from '@ranuts/shared/i18n'; import { getDocumentMimeType } from '@ranuts/shared/document-utils'; -import { formatRelativeTime } from './history/recovery'; +import { formatRelativeTime } from './history/relative-time'; import { clearAllHistory, deleteDoc, getLatestSnapshot, historyUsage, listDocs, pruneExpired } from './history/store'; import { stashPendingFile } from './pending-open'; -import { isAutosaveEnabled, setAutosaveEnabled } from './history/autosave'; +import { isAutosaveEnabled, writeAutosavePreference } from './history/preferences'; import { daysUntilExpiry, hasUnsavedWork, type HistoryDoc } from './history/types'; import { confirmDialog } from './confirm-dialog'; @@ -280,7 +280,7 @@ function buildAutosaveToggle(refresh: () => void): HTMLElement { .attr('type', 'checkbox') .attr('role', 'switch') .on('change', (event: Event) => { - setAutosaveEnabled((event.target as HTMLInputElement).checked); + writeAutosavePreference((event.target as HTMLInputElement).checked); refresh(); }) .build() as HTMLInputElement; diff --git a/lib/history/autosave.ts b/lib/history/autosave.ts index 82df4acee..d45f45006 100644 --- a/lib/history/autosave.ts +++ b/lib/history/autosave.ts @@ -19,13 +19,13 @@ * never clear the unsaved-changes warning, and never touch the user's file. */ import { t } from '@ranuts/shared/i18n'; -import { localStorageGetItem, localStorageSetItem } from 'ranuts/utils'; import { requestSaveDocument } from '../onlyoffice/save-stream'; import { getReadonlyMode } from '../onlyoffice/readonly'; import { getLastEditAt, hasUnsavedChanges } from '../unsaved-guard'; import { isEmbedMode } from '../embed-mode'; import { captureSavePoint, type SavePoint } from '../onlyoffice/save-point'; import { extensionOf, markOpened, putSnapshot } from './store'; +import { isAutosaveEnabled, writeAutosavePreference } from './preferences'; import type { HistoryDoc, HistoryOrigin } from './types'; /** @@ -66,8 +66,6 @@ export const IDLE_GRACE_MS = 2_000; /** Consecutive export failures before this session gives up. */ export const MAX_CONSECUTIVE_FAILURES = 3; -const AUTOSAVE_PREF_KEY = 'document-autosave-enabled'; - export interface AutosaveSessionInput { /** * The document's identity for this editing session. @@ -110,15 +108,8 @@ export function shouldSnapshot(state: SnapshotDecision): boolean { return state.now - state.lastEditAt >= IDLE_GRACE_MS; } -export function isAutosaveEnabled(): boolean { - // Default on. Off by default would mean the feature does not exist for - // almost everyone, and the loss it prevents happens before anyone goes - // looking through settings. - return localStorageGetItem(AUTOSAVE_PREF_KEY) !== 'false'; -} - export function setAutosaveEnabled(enabled: boolean): void { - localStorageSetItem(AUTOSAVE_PREF_KEY, enabled ? 'true' : 'false'); + writeAutosavePreference(enabled); if (!enabled) stopAutosaveSession(); } diff --git a/lib/history/index.ts b/lib/history/index.ts index 7a7a7b301..7035405b2 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -55,9 +55,9 @@ export { beginAutosaveSession, clearDocumentSession, getActiveDocumentId, - isAutosaveEnabled, setAutosaveEnabled, stopAutosaveSession, } from './autosave'; +export { isAutosaveEnabled } from './preferences'; export { clearAllHistory, deleteDoc, getLatestSnapshot, listDocs } from './store'; export type { HistoryDoc } from './types'; diff --git a/lib/history/preferences.ts b/lib/history/preferences.ts new file mode 100644 index 000000000..169851c38 --- /dev/null +++ b/lib/history/preferences.ts @@ -0,0 +1,20 @@ +/** + * The autosave on/off preference. Kept apart from the scheduler in + * ./autosave.ts so the /history page can read and write it without importing + * the save pipeline (and with it the editor stack). + */ +import { localStorageGetItem, localStorageSetItem } from 'ranuts/utils'; + +const AUTOSAVE_PREF_KEY = 'document-autosave-enabled'; + +export function isAutosaveEnabled(): boolean { + // Default on. Off by default would mean the feature does not exist for + // almost everyone, and the loss it prevents happens before anyone goes + // looking through settings. + return localStorageGetItem(AUTOSAVE_PREF_KEY) !== 'false'; +} + +/** Store the preference only; an editor page also stops its running session (see setAutosaveEnabled). */ +export function writeAutosavePreference(enabled: boolean): void { + localStorageSetItem(AUTOSAVE_PREF_KEY, enabled ? 'true' : 'false'); +} diff --git a/lib/history/recovery.ts b/lib/history/recovery.ts index f889bd6ad..dc60c79bd 100644 --- a/lib/history/recovery.ts +++ b/lib/history/recovery.ts @@ -15,33 +15,6 @@ import { getLatestSnapshot, readDocumentRecord } from './store'; import type { HistoryDoc } from './types'; import { readActiveSourceRecord } from '../active-document-source'; -/** A short "5 minutes ago", for the history list's timestamps. */ -export function formatRelativeTime(timestamp: number, now = Date.now()): string { - const seconds = Math.round((timestamp - now) / 1000); - const units: Array<[Intl.RelativeTimeFormatUnit, number]> = [ - ['second', 60], - ['minute', 60], - ['hour', 24], - ['day', 7], - ['week', 5], - ]; - let value = seconds; - let unit: Intl.RelativeTimeFormatUnit = 'second'; - for (const [name, size] of units) { - unit = name; - if (Math.abs(value) < size) break; - value = Math.round(value / size); - } - try { - return new Intl.RelativeTimeFormat(document.documentElement.lang || undefined, { numeric: 'auto' }).format( - value, - unit, - ); - } catch { - return new Date(timestamp).toLocaleString(); - } -} - /** * Reopen the document from its newest snapshot. * diff --git a/lib/history/relative-time.ts b/lib/history/relative-time.ts new file mode 100644 index 000000000..e7a1c92eb --- /dev/null +++ b/lib/history/relative-time.ts @@ -0,0 +1,26 @@ +/** A short "5 minutes ago", for the history list's timestamps. */ +export function formatRelativeTime(timestamp: number, now = Date.now()): string { + const seconds = Math.round((timestamp - now) / 1000); + const units: Array<[Intl.RelativeTimeFormatUnit, number]> = [ + ['second', 60], + ['minute', 60], + ['hour', 24], + ['day', 7], + ['week', 5], + ]; + let value = seconds; + let unit: Intl.RelativeTimeFormatUnit = 'second'; + for (const [name, size] of units) { + unit = name; + if (Math.abs(value) < size) break; + value = Math.round(value / size); + } + try { + return new Intl.RelativeTimeFormat(document.documentElement.lang || undefined, { numeric: 'auto' }).format( + value, + unit, + ); + } catch { + return new Date(timestamp).toLocaleString(); + } +} diff --git a/package.json b/package.json index 5dd5c26da..0f7b635cd 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "@ranuts/converter": "workspace:*", "@ranuts/shared": "workspace:*", "pdfjs-dist": "5.4.624", - "ranui": "0.5.0", - "ranuts": "0.5.0" + "ranui": "0.5.1", + "ranuts": "0.5.1" } } diff --git a/packages/chat-ui/package.json b/packages/chat-ui/package.json index 9e449c5a1..d53935ee0 100644 --- a/packages/chat-ui/package.json +++ b/packages/chat-ui/package.json @@ -23,8 +23,8 @@ }, "dependencies": { "marked": "16.4.2", - "ranui": "0.5.0", - "ranuts": "0.5.0" + "ranui": "0.5.1", + "ranuts": "0.5.1" }, "devDependencies": { "typescript": "^6.0.3" diff --git a/packages/converter/package.json b/packages/converter/package.json index 6ddecb87a..351f9bc23 100644 --- a/packages/converter/package.json +++ b/packages/converter/package.json @@ -23,8 +23,8 @@ }, "dependencies": { "@ranuts/shared": "workspace:*", - "ranui": "0.5.0", - "ranuts": "0.5.0" + "ranui": "0.5.1", + "ranuts": "0.5.1" }, "devDependencies": { "typescript": "^6.0.3" diff --git a/packages/shared/package.json b/packages/shared/package.json index 9fbdd095a..aafa3966a 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -38,7 +38,7 @@ "prepare": "tsc -p tsconfig.json" }, "dependencies": { - "ranuts": "0.5.0" + "ranuts": "0.5.1" }, "devDependencies": { "typescript": "^6.0.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd935ccf8..b1c856aa0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,11 +37,11 @@ importers: specifier: 5.4.624 version: 5.4.624 ranui: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 ranuts: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 devDependencies: '@playwright/test': specifier: ^1.64.0 @@ -108,11 +108,11 @@ importers: specifier: 16.4.2 version: 16.4.2 ranui: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 ranuts: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 devDependencies: typescript: specifier: ^6.0.3 @@ -124,11 +124,11 @@ importers: specifier: workspace:* version: link:../shared ranui: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 ranuts: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 devDependencies: typescript: specifier: ^6.0.3 @@ -137,8 +137,8 @@ importers: packages/shared: dependencies: ranuts: - specifier: 0.5.0 - version: 0.5.0 + specifier: 0.5.1 + version: 0.5.1 devDependencies: typescript: specifier: ^6.0.3 @@ -146,8 +146,8 @@ importers: packages: - '@alixex/ranview@0.2.0': - resolution: {integrity: sha512-0amq1DhpdJQiwGBe0n5CwsrgJvv0GuTuF1wDw+SPePPh9MdoP+pk2SY5E1I8MJ6wvC8beIWxII12KIbfbgIjRw==} + '@alixex/ranview@0.2.1': + resolution: {integrity: sha512-cAzNX3+sXayjEg8TBWaWD7u6CoSYtAFJ2T4I7AJFOF9gCLMqnnhXr1nmcfudJERmQ1wJ3T36PtT92nRME3/SOQ==} engines: {node: '>=24.0.0'} '@anthropic-ai/sdk@0.106.0': @@ -1173,12 +1173,12 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - ranui@0.5.0: - resolution: {integrity: sha512-XYYbyHiVD56YZmw8HEbxIz9hpJQo/ytuVQrbTMKuG900Rvr/DvAo6fYRPTz5VNDzBBPIr3PjDmBBeJQOU7jJfg==} + ranui@0.5.1: + resolution: {integrity: sha512-kvqSdrCbLOjfIuqiGNUv1lBl01VTLRy0UMr65mX1GLy8uSUmN5dy+DUZ3eQEgysfGnbRiO9Speni5PcC38NzuQ==} engines: {node: '>=24.0.0'} - ranuts@0.5.0: - resolution: {integrity: sha512-lpzx1NoyNHL+rkJaJApeOJDQewf8T6mxberuwu1Mb67s62H0OrKoMoXjmEB/9B74cFblfNt6jIfRBI+stQsU0w==} + ranuts@0.5.1: + resolution: {integrity: sha512-ohiVcoyRPouymZmzpJ/sawJ6QtZh66Lypx/n8l8Qt7y7QDGP3Y4+JWX7by+Yx7e0sEDgrz/qx6qk9rVbOEZomA==} engines: {node: '>=24.0.0'} regex-recursion@6.0.2: @@ -1436,9 +1436,9 @@ packages: snapshots: - '@alixex/ranview@0.2.0': + '@alixex/ranview@0.2.1': dependencies: - ranuts: 0.5.0 + ranuts: 0.5.1 '@anthropic-ai/sdk@0.106.0': dependencies: @@ -2237,17 +2237,17 @@ snapshots: punycode@2.3.1: {} - ranui@0.5.0: + ranui@0.5.1: dependencies: - '@alixex/ranview': 0.2.0 + '@alixex/ranview': 0.2.1 dompurify: 3.4.16 marked: 18.0.9 - ranuts: 0.5.0 + ranuts: 0.5.1 remend: 1.3.0 shiki: 4.4.3 temml: 0.13.4 - ranuts@0.5.0: + ranuts@0.5.1: dependencies: jschardet: 3.1.4 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7ed75da23..80f404ac1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,7 +3,7 @@ packages: minimumReleaseAgeExclude: - ranui - ranuts - - '@alixex/ranview@0.2.0' + - '@alixex/ranview@0.2.1' patchedDependencies: '@mlc-ai/web-llm@0.2.85': patches/@mlc-ai__web-llm@0.2.85.patch '@wllama/wllama@3.6.1': patches/@wllama__wllama@3.6.1.patch diff --git a/public/ran-tokens.css b/public/ran-tokens.css index aaa5b4cc2..941cc89e1 100644 --- a/public/ran-tokens.css +++ b/public/ran-tokens.css @@ -1,2 +1,2 @@ /* VENDORED — DO NOT EDIT. Generated from ranui/dist/ranui.css (the ranui design-token :root layer) by bin/build.sh on every build, so it never drifts from the installed ranui version. Landing pages this so the --ran-* tokens resolve at first paint; static pages under public/ have no bundler and cannot import from node_modules. Source of truth: ranui in https://github.com/chaxus/ran (package: ranui) — change tokens there, not here. */ -:root{--ran-background-100: #ffffff;--ran-background-200: #fafafa;--ran-gray-100: #f2f2f2;--ran-gray-200: #ebebeb;--ran-gray-300: #e6e6e6;--ran-gray-400: #eaeaea;--ran-gray-500: #c9c9c9;--ran-gray-600: #a8a8a8;--ran-gray-700: #8f8f8f;--ran-gray-800: #7d7d7d;--ran-gray-900: #4d4d4d;--ran-gray-1000: #171717;--ran-gray-alpha-100: #0000000d;--ran-gray-alpha-200: #00000015;--ran-gray-alpha-300: #0000001a;--ran-gray-alpha-400: #00000014;--ran-gray-alpha-500: #00000036;--ran-gray-alpha-600: #0000003d;--ran-gray-alpha-700: #00000070;--ran-gray-alpha-800: #00000082;--ran-gray-alpha-900: #000000b3;--ran-gray-alpha-1000: #000000e8;--ran-blue-100: #f0f7ff;--ran-blue-200: #e9f4ff;--ran-blue-300: #dfefff;--ran-blue-400: #cae7ff;--ran-blue-500: #94ccff;--ran-blue-600: #48aeff;--ran-blue-700: #006bff;--ran-blue-800: #0059ec;--ran-blue-900: #005ff2;--ran-blue-1000: #002359;--ran-red-100: #ffeeef;--ran-red-200: #ffe8ea;--ran-red-300: #ffe3e4;--ran-red-400: #ffd7d6;--ran-red-500: #ffb1b3;--ran-red-600: #ff676d;--ran-red-700: #fc0035;--ran-red-800: #ea001d;--ran-red-900: #d8001b;--ran-red-1000: #47000c;--ran-amber-100: #fff6de;--ran-amber-200: #fff4cf;--ran-amber-300: #fff1c1;--ran-amber-400: #ffdc73;--ran-amber-500: #ffc543;--ran-amber-600: #ffa600;--ran-amber-700: #ffae00;--ran-amber-800: #ff9300;--ran-amber-900: #aa4d00;--ran-amber-1000: #561900;--ran-green-100: #ecfdec;--ran-green-200: #e5fce7;--ran-green-300: #d3fad1;--ran-green-400: #b9f5bc;--ran-green-500: #82eb8d;--ran-green-600: #4ce15e;--ran-green-700: #28a948;--ran-green-800: #279141;--ran-green-900: #107d32;--ran-green-1000: #003a00;--ran-color-primary: var(--ran-gray-1000);--ran-color-primary-hover: #383838;--ran-color-primary-active: #4d4d4d;--ran-color-primary-text: var(--ran-background-100);--ran-color-success: var(--ran-green-700);--ran-color-warning: var(--ran-amber-700);--ran-color-danger: var(--ran-red-700);--ran-color-warning-foreground: var(--ran-amber-900);--ran-color-danger-foreground: var(--ran-red-900);--ran-color-bg: var(--ran-background-100);--ran-color-bg-subtle: var(--ran-background-200);--ran-color-bg-elevated: var(--ran-background-100);--ran-color-bg-muted: var(--ran-gray-100);--ran-color-bg-hover: var(--ran-gray-200);--ran-color-bg-active: var(--ran-gray-300);--ran-color-text: var(--ran-gray-1000);--ran-color-text-secondary: var(--ran-gray-900);--ran-color-text-disabled: var(--ran-gray-700);--ran-color-border: var(--ran-gray-400);--ran-color-border-secondary: var(--ran-gray-300);--ran-color-border-hover: var(--ran-gray-500);--ran-color-border-active: var(--ran-gray-600);--ran-color-link: var(--ran-blue-700);--ran-font-family: "Geist", "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--ran-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--ran-font-size: 14px;--ran-line-height: 1.5715;--ran-text-heading-weight: 600;--ran-text-heading-tracking: -.03em;--ran-text-heading-1: 32px;--ran-text-heading-2: 24px;--ran-text-heading-3: 20px;--ran-text-heading-4: 16px;--ran-text-label-weight: 500;--ran-text-label-1: 14px;--ran-text-label-2: 13px;--ran-text-label-3: 12px;--ran-text-copy-weight: 400;--ran-text-copy-1: 16px;--ran-text-copy-2: 14px;--ran-text-button-size: 14px;--ran-text-button-weight: 500;--ran-text-button-line-height: 1;--ran-text-mono-weight-regular: 400;--ran-text-mono-weight-medium: 500;--ran-radius-sm: 6px;--ran-radius-md: 12px;--ran-radius-lg: 16px;--ran-radius-full: 9999px;--ran-space-1: 4px;--ran-space-2: 8px;--ran-space-3: 12px;--ran-space-4: 16px;--ran-space-6: 24px;--ran-space-8: 32px;--ran-space-10: 40px;--ran-space-16: 64px;--ran-space-24: 96px;--ran-size-1: 16px;--ran-size-2: 18px;--ran-size-3: 20px;--ran-size-4: 24px;--ran-size-5: 28px;--ran-size-6: 30px;--ran-size-7: 32px;--ran-shadow-elevated: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 4px -2px rgba(0, 0, 0, .05);--ran-shadow-menu: 0 2px 4px rgba(0, 0, 0, .05), 0 8px 24px -6px rgba(0, 0, 0, .14);--ran-shadow-modal: 0 4px 12px rgba(0, 0, 0, .08), 0 20px 48px -12px rgba(0, 0, 0, .22);--ran-z-modal: 1000;--ran-z-dropdown: 1100;--ran-z-message: 1200;--ran-focus-ring: 0 0 0 2px var(--ran-background-100), 0 0 0 4px var(--ran-blue-700);--ran-focus-ring-inverse-color: #fff;--ran-motion-duration-fast: .15s;--ran-motion-duration-base: .2s;--ran-motion-duration-slow: .35s;--ran-motion-ease-standard: cubic-bezier(.645, .045, .355, 1);--ran-motion-ease-snappy: cubic-bezier(.33, 0, .15, 1);--ran-motion-ease-spring: cubic-bezier(.34, 1.26, .5, 1);--ran-motion-ease-bouncy: cubic-bezier(.34, 1.56, .64, 1);--ran-motion-ease-smooth: cubic-bezier(.4, 0, .2, 1);--ran-skin-border-width: 1px;--ran-skin-border-style: solid;--ran-skin-raised-shadow: var(--ran-shadow-elevated);--ran-skin-font-family: var(--ran-font-family);--ran-skin-border-image-width: 4px}@media(prefers-color-scheme:dark){:root:not([data-ran-theme=light]):not([theme=light]):not(.light){--ran-background-100: #000000;--ran-background-200: #000000;--ran-gray-100: #1a1a1a;--ran-gray-200: #1f1f1f;--ran-gray-300: #292929;--ran-gray-400: #2e2e2e;--ran-gray-500: #454545;--ran-gray-600: #878787;--ran-gray-700: #8f8f8f;--ran-gray-800: #7d7d7d;--ran-gray-900: #a0a0a0;--ran-gray-1000: #ededed;--ran-gray-alpha-100: #ffffff12;--ran-gray-alpha-200: #ffffff17;--ran-gray-alpha-300: #ffffff21;--ran-gray-alpha-400: #ffffff24;--ran-gray-alpha-500: #ffffff3d;--ran-gray-alpha-600: #ffffff82;--ran-gray-alpha-700: #ffffff8a;--ran-gray-alpha-800: #ffffff78;--ran-gray-alpha-900: #ffffff9c;--ran-gray-alpha-1000: #ffffffeb;--ran-blue-100: #06193a;--ran-blue-200: #022248;--ran-blue-300: #002f62;--ran-blue-400: #003674;--ran-blue-500: #00418b;--ran-blue-600: #0090ff;--ran-blue-700: #006efe;--ran-blue-800: #005be7;--ran-blue-900: #47a8ff;--ran-blue-1000: #eaf6ff;--ran-red-100: #330a11;--ran-red-200: #440d13;--ran-red-300: #5d0e17;--ran-red-400: #6f101b;--ran-red-500: #88151f;--ran-red-600: #f32e40;--ran-red-700: #f13242;--ran-red-800: #e2162a;--ran-red-900: #ff565f;--ran-red-1000: #ffe9ed;--ran-amber-100: #2a1700;--ran-amber-200: #361900;--ran-amber-300: #502800;--ran-amber-400: #5b3000;--ran-amber-500: #703e00;--ran-amber-600: #ed9a00;--ran-amber-700: #ffae00;--ran-amber-800: #ff9300;--ran-amber-900: #ff9300;--ran-amber-1000: #fff3d5;--ran-green-100: #002608;--ran-green-200: #00320b;--ran-green-300: #003a0e;--ran-green-400: #004615;--ran-green-500: #006717;--ran-green-600: #00952d;--ran-green-700: #00ac3a;--ran-green-800: #009432;--ran-green-900: #00ca50;--ran-green-1000: #d8ffe4;--ran-color-bg-elevated: var(--ran-gray-100);--ran-color-primary-hover: #cccccc;--ran-color-primary-active: #b3b3b3;--ran-shadow-elevated: 0 1px 2px rgba(0, 0, 0, .16);--ran-shadow-menu: 0 1px 1px rgba(0, 0, 0, .2), 0 4px 8px -4px rgba(0, 0, 0, .4), 0 16px 24px -8px rgba(0, 0, 0, .5);--ran-shadow-modal: 0 1px 1px rgba(0, 0, 0, .2), 0 8px 16px -4px rgba(0, 0, 0, .4), 0 24px 32px -8px rgba(0, 0, 0, .5)}}:root[data-ran-theme=dark],:root[theme=dark],:root.dark{--ran-background-100: #000000;--ran-background-200: #000000;--ran-gray-100: #1a1a1a;--ran-gray-200: #1f1f1f;--ran-gray-300: #292929;--ran-gray-400: #2e2e2e;--ran-gray-500: #454545;--ran-gray-600: #878787;--ran-gray-700: #8f8f8f;--ran-gray-800: #7d7d7d;--ran-gray-900: #a0a0a0;--ran-gray-1000: #ededed;--ran-gray-alpha-100: #ffffff12;--ran-gray-alpha-200: #ffffff17;--ran-gray-alpha-300: #ffffff21;--ran-gray-alpha-400: #ffffff24;--ran-gray-alpha-500: #ffffff3d;--ran-gray-alpha-600: #ffffff82;--ran-gray-alpha-700: #ffffff8a;--ran-gray-alpha-800: #ffffff78;--ran-gray-alpha-900: #ffffff9c;--ran-gray-alpha-1000: #ffffffeb;--ran-blue-100: #06193a;--ran-blue-200: #022248;--ran-blue-300: #002f62;--ran-blue-400: #003674;--ran-blue-500: #00418b;--ran-blue-600: #0090ff;--ran-blue-700: #006efe;--ran-blue-800: #005be7;--ran-blue-900: #47a8ff;--ran-blue-1000: #eaf6ff;--ran-red-100: #330a11;--ran-red-200: #440d13;--ran-red-300: #5d0e17;--ran-red-400: #6f101b;--ran-red-500: #88151f;--ran-red-600: #f32e40;--ran-red-700: #f13242;--ran-red-800: #e2162a;--ran-red-900: #ff565f;--ran-red-1000: #ffe9ed;--ran-amber-100: #2a1700;--ran-amber-200: #361900;--ran-amber-300: #502800;--ran-amber-400: #5b3000;--ran-amber-500: #703e00;--ran-amber-600: #ed9a00;--ran-amber-700: #ffae00;--ran-amber-800: #ff9300;--ran-amber-900: #ff9300;--ran-amber-1000: #fff3d5;--ran-green-100: #002608;--ran-green-200: #00320b;--ran-green-300: #003a0e;--ran-green-400: #004615;--ran-green-500: #006717;--ran-green-600: #00952d;--ran-green-700: #00ac3a;--ran-green-800: #009432;--ran-green-900: #00ca50;--ran-green-1000: #d8ffe4;--ran-color-bg-elevated: var(--ran-gray-100);--ran-color-primary-hover: #cccccc;--ran-color-primary-active: #b3b3b3;--ran-shadow-elevated: 0 1px 2px rgba(0, 0, 0, .16);--ran-shadow-menu: 0 1px 1px rgba(0, 0, 0, .2), 0 4px 8px -4px rgba(0, 0, 0, .4), 0 16px 24px -8px rgba(0, 0, 0, .5);--ran-shadow-modal: 0 1px 1px rgba(0, 0, 0, .2), 0 8px 16px -4px rgba(0, 0, 0, .4), 0 24px 32px -8px rgba(0, 0, 0, .5)} +:root{--ran-background-100: #ffffff;--ran-background-200: #fafafa;--ran-gray-100: #f2f2f2;--ran-gray-200: #ebebeb;--ran-gray-300: #e6e6e6;--ran-gray-400: #eaeaea;--ran-gray-500: #c9c9c9;--ran-gray-600: #a8a8a8;--ran-gray-700: #8f8f8f;--ran-gray-800: #7d7d7d;--ran-gray-900: #4d4d4d;--ran-gray-1000: #171717;--ran-gray-alpha-100: #0000000d;--ran-gray-alpha-200: #00000015;--ran-gray-alpha-300: #0000001a;--ran-gray-alpha-400: #00000014;--ran-gray-alpha-500: #00000036;--ran-gray-alpha-600: #0000003d;--ran-gray-alpha-700: #00000070;--ran-gray-alpha-800: #00000082;--ran-gray-alpha-900: #000000b3;--ran-gray-alpha-1000: #000000e8;--ran-blue-100: #f0f7ff;--ran-blue-200: #e9f4ff;--ran-blue-300: #dfefff;--ran-blue-400: #cae7ff;--ran-blue-500: #94ccff;--ran-blue-600: #48aeff;--ran-blue-700: #006bff;--ran-blue-800: #0059ec;--ran-blue-900: #005ff2;--ran-blue-1000: #002359;--ran-red-100: #ffeeef;--ran-red-200: #ffe8ea;--ran-red-300: #ffe3e4;--ran-red-400: #ffd7d6;--ran-red-500: #ffb1b3;--ran-red-600: #ff676d;--ran-red-700: #fc0035;--ran-red-800: #ea001d;--ran-red-900: #d8001b;--ran-red-1000: #47000c;--ran-amber-100: #fff6de;--ran-amber-200: #fff4cf;--ran-amber-300: #fff1c1;--ran-amber-400: #ffdc73;--ran-amber-500: #ffc543;--ran-amber-600: #ffa600;--ran-amber-700: #ffae00;--ran-amber-800: #ff9300;--ran-amber-900: #aa4d00;--ran-amber-1000: #561900;--ran-green-100: #ecfdec;--ran-green-200: #e5fce7;--ran-green-300: #d3fad1;--ran-green-400: #b9f5bc;--ran-green-500: #82eb8d;--ran-green-600: #4ce15e;--ran-green-700: #28a948;--ran-green-800: #279141;--ran-green-900: #107d32;--ran-green-1000: #003a00;--ran-color-primary: var(--ran-gray-1000);--ran-color-primary-hover: #383838;--ran-color-primary-active: #4d4d4d;--ran-color-primary-text: var(--ran-background-100);--ran-color-success: var(--ran-green-700);--ran-color-warning: var(--ran-amber-700);--ran-color-danger: var(--ran-red-700);--ran-color-warning-foreground: var(--ran-amber-900);--ran-color-danger-foreground: var(--ran-red-900);--ran-color-bg: var(--ran-background-100);--ran-color-bg-subtle: var(--ran-background-200);--ran-color-bg-elevated: var(--ran-background-100);--ran-color-bg-muted: var(--ran-gray-100);--ran-color-bg-hover: var(--ran-gray-200);--ran-color-bg-active: var(--ran-gray-300);--ran-color-text: var(--ran-gray-1000);--ran-color-text-secondary: var(--ran-gray-900);--ran-color-text-disabled: var(--ran-gray-700);--ran-color-border: var(--ran-gray-400);--ran-color-border-secondary: var(--ran-gray-300);--ran-color-border-hover: var(--ran-gray-500);--ran-color-border-active: var(--ran-gray-600);--ran-color-link: var(--ran-blue-700);--ran-font-family: "Geist", "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--ran-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--ran-font-size: 14px;--ran-line-height: 1.5715;--ran-text-heading-weight: 600;--ran-text-heading-tracking: -.03em;--ran-text-heading-1: 32px;--ran-text-heading-2: 24px;--ran-text-heading-3: 20px;--ran-text-heading-4: 16px;--ran-text-label-weight: 500;--ran-text-label-1: 14px;--ran-text-label-2: 13px;--ran-text-label-3: 12px;--ran-text-copy-weight: 400;--ran-text-copy-1: 16px;--ran-text-copy-2: 14px;--ran-text-button-size: 14px;--ran-text-button-weight: 500;--ran-text-button-line-height: 1;--ran-text-mono-weight-regular: 400;--ran-text-mono-weight-medium: 500;--ran-radius-sm: 6px;--ran-radius-md: 12px;--ran-radius-lg: 16px;--ran-radius-full: 9999px;--ran-space-1: 4px;--ran-space-2: 8px;--ran-space-3: 12px;--ran-space-4: 16px;--ran-space-6: 24px;--ran-space-8: 32px;--ran-space-10: 40px;--ran-space-16: 64px;--ran-space-24: 96px;--ran-size-1: 16px;--ran-size-2: 18px;--ran-size-3: 20px;--ran-size-4: 24px;--ran-size-5: 28px;--ran-size-6: 30px;--ran-size-7: 32px;--ran-shadow-elevated: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 4px -2px rgba(0, 0, 0, .05);--ran-shadow-menu: 0 2px 4px rgba(0, 0, 0, .05), 0 8px 24px -6px rgba(0, 0, 0, .14);--ran-shadow-modal: 0 4px 12px rgba(0, 0, 0, .08), 0 20px 48px -12px rgba(0, 0, 0, .22);--ran-z-modal: 1000;--ran-z-dropdown: 1100;--ran-z-message: 1200;--ran-focus-ring: 0 0 0 2px var(--ran-background-100), 0 0 0 4px var(--ran-blue-700);--ran-focus-ring-inverse-color: #fff;--ran-media-background: #000;--ran-motion-duration-fast: .15s;--ran-motion-duration-base: .2s;--ran-motion-duration-slow: .35s;--ran-motion-ease-standard: cubic-bezier(.645, .045, .355, 1);--ran-motion-ease-snappy: cubic-bezier(.33, 0, .15, 1);--ran-motion-ease-spring: cubic-bezier(.34, 1.26, .5, 1);--ran-motion-ease-bouncy: cubic-bezier(.34, 1.56, .64, 1);--ran-motion-ease-smooth: cubic-bezier(.4, 0, .2, 1);--ran-skin-border-width: 1px;--ran-skin-border-style: solid;--ran-skin-raised-shadow: var(--ran-shadow-elevated);--ran-skin-font-family: var(--ran-font-family);--ran-skin-border-image-width: 4px}@media(prefers-color-scheme:dark){:root:not([data-ran-theme=light]):not([theme=light]):not(.light){--ran-background-100: #000000;--ran-background-200: #000000;--ran-gray-100: #1a1a1a;--ran-gray-200: #1f1f1f;--ran-gray-300: #292929;--ran-gray-400: #2e2e2e;--ran-gray-500: #454545;--ran-gray-600: #878787;--ran-gray-700: #8f8f8f;--ran-gray-800: #7d7d7d;--ran-gray-900: #a0a0a0;--ran-gray-1000: #ededed;--ran-gray-alpha-100: #ffffff12;--ran-gray-alpha-200: #ffffff17;--ran-gray-alpha-300: #ffffff21;--ran-gray-alpha-400: #ffffff24;--ran-gray-alpha-500: #ffffff3d;--ran-gray-alpha-600: #ffffff82;--ran-gray-alpha-700: #ffffff8a;--ran-gray-alpha-800: #ffffff78;--ran-gray-alpha-900: #ffffff9c;--ran-gray-alpha-1000: #ffffffeb;--ran-blue-100: #06193a;--ran-blue-200: #022248;--ran-blue-300: #002f62;--ran-blue-400: #003674;--ran-blue-500: #00418b;--ran-blue-600: #0090ff;--ran-blue-700: #006efe;--ran-blue-800: #005be7;--ran-blue-900: #47a8ff;--ran-blue-1000: #eaf6ff;--ran-red-100: #330a11;--ran-red-200: #440d13;--ran-red-300: #5d0e17;--ran-red-400: #6f101b;--ran-red-500: #88151f;--ran-red-600: #f32e40;--ran-red-700: #f13242;--ran-red-800: #e2162a;--ran-red-900: #ff565f;--ran-red-1000: #ffe9ed;--ran-amber-100: #2a1700;--ran-amber-200: #361900;--ran-amber-300: #502800;--ran-amber-400: #5b3000;--ran-amber-500: #703e00;--ran-amber-600: #ed9a00;--ran-amber-700: #ffae00;--ran-amber-800: #ff9300;--ran-amber-900: #ff9300;--ran-amber-1000: #fff3d5;--ran-green-100: #002608;--ran-green-200: #00320b;--ran-green-300: #003a0e;--ran-green-400: #004615;--ran-green-500: #006717;--ran-green-600: #00952d;--ran-green-700: #00ac3a;--ran-green-800: #009432;--ran-green-900: #00ca50;--ran-green-1000: #d8ffe4;--ran-color-bg-elevated: var(--ran-gray-100);--ran-color-primary-hover: #cccccc;--ran-color-primary-active: #b3b3b3;--ran-shadow-elevated: 0 1px 2px rgba(0, 0, 0, .16);--ran-shadow-menu: 0 1px 1px rgba(0, 0, 0, .2), 0 4px 8px -4px rgba(0, 0, 0, .4), 0 16px 24px -8px rgba(0, 0, 0, .5);--ran-shadow-modal: 0 1px 1px rgba(0, 0, 0, .2), 0 8px 16px -4px rgba(0, 0, 0, .4), 0 24px 32px -8px rgba(0, 0, 0, .5)}}:root[data-ran-theme=dark],:root[theme=dark],:root.dark{--ran-background-100: #000000;--ran-background-200: #000000;--ran-gray-100: #1a1a1a;--ran-gray-200: #1f1f1f;--ran-gray-300: #292929;--ran-gray-400: #2e2e2e;--ran-gray-500: #454545;--ran-gray-600: #878787;--ran-gray-700: #8f8f8f;--ran-gray-800: #7d7d7d;--ran-gray-900: #a0a0a0;--ran-gray-1000: #ededed;--ran-gray-alpha-100: #ffffff12;--ran-gray-alpha-200: #ffffff17;--ran-gray-alpha-300: #ffffff21;--ran-gray-alpha-400: #ffffff24;--ran-gray-alpha-500: #ffffff3d;--ran-gray-alpha-600: #ffffff82;--ran-gray-alpha-700: #ffffff8a;--ran-gray-alpha-800: #ffffff78;--ran-gray-alpha-900: #ffffff9c;--ran-gray-alpha-1000: #ffffffeb;--ran-blue-100: #06193a;--ran-blue-200: #022248;--ran-blue-300: #002f62;--ran-blue-400: #003674;--ran-blue-500: #00418b;--ran-blue-600: #0090ff;--ran-blue-700: #006efe;--ran-blue-800: #005be7;--ran-blue-900: #47a8ff;--ran-blue-1000: #eaf6ff;--ran-red-100: #330a11;--ran-red-200: #440d13;--ran-red-300: #5d0e17;--ran-red-400: #6f101b;--ran-red-500: #88151f;--ran-red-600: #f32e40;--ran-red-700: #f13242;--ran-red-800: #e2162a;--ran-red-900: #ff565f;--ran-red-1000: #ffe9ed;--ran-amber-100: #2a1700;--ran-amber-200: #361900;--ran-amber-300: #502800;--ran-amber-400: #5b3000;--ran-amber-500: #703e00;--ran-amber-600: #ed9a00;--ran-amber-700: #ffae00;--ran-amber-800: #ff9300;--ran-amber-900: #ff9300;--ran-amber-1000: #fff3d5;--ran-green-100: #002608;--ran-green-200: #00320b;--ran-green-300: #003a0e;--ran-green-400: #004615;--ran-green-500: #006717;--ran-green-600: #00952d;--ran-green-700: #00ac3a;--ran-green-800: #009432;--ran-green-900: #00ca50;--ran-green-1000: #d8ffe4;--ran-color-bg-elevated: var(--ran-gray-100);--ran-color-primary-hover: #cccccc;--ran-color-primary-active: #b3b3b3;--ran-shadow-elevated: 0 1px 2px rgba(0, 0, 0, .16);--ran-shadow-menu: 0 1px 1px rgba(0, 0, 0, .2), 0 4px 8px -4px rgba(0, 0, 0, .4), 0 16px 24px -8px rgba(0, 0, 0, .5);--ran-shadow-modal: 0 1px 1px rgba(0, 0, 0, .2), 0 8px 16px -4px rgba(0, 0, 0, .4), 0 24px 32px -8px rgba(0, 0, 0, .5)} diff --git a/public/ranui-iife/button.iife.js b/public/ranui-iife/button.iife.js index 2bb0d7c08..3f0a2b582 100644 --- a/public/ranui-iife/button.iife.js +++ b/public/ranui-iife/button.iife.js @@ -1 +1 @@ -var ranui_button=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=()=>{if(typeof window<`u`){let e=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(e)?`ipad`:/android/.test(e)?`android`:/iphone/.test(e)?`iphone`:`pc`}return`pc`},n=/["'&<>]/;function r(e){let t=``+e,r=n.exec(t);if(!r)return t;let i,a=``,o=0,s=0;for(o=r.index;o{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},a=new Map,o=new Map,s=`data-adopted-style`,c=`data-adopted-sheet`,l=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},u=(e,t,n=s)=>{if(!(typeof document>`u`)&&t&&!l(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},ee=(e,t,n=c)=>{if(!(typeof document>`u`)&&t&&!l(e,t,o)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},te=`:host{box-sizing:var(--ran-btn-box-sizing,border-box);position:var(--ran-btn-position,relative);display:var(--ran-btn-display,inline-flex);align-self:var(--ran-btn-align-self,flex-start);background-image:var(--ran-btn-background-image,none);box-shadow:var(--ran-btn-box-shadow,var(--ran-skin-raised-shadow,0 2px #00000004));border-radius:var(--ran-btn-border-radius,var(--ran-radius-sm,6px));cursor:var(--ran-btn-cursor,pointer);user-select:var(--ran-btn-user-select,none);touch-action:var(--ran-btn-touch-action,manipulation);overflow:var(--ran-btn-overflow,hidden);pointer-events:var(--ran-btn-pointer-events,auto)}:host .ran-btn{box-sizing:var(--ran-btn-surface-box-sizing,border-box);position:var(--ran-btn-surface-position,relative);display:var(--ran-btn-surface-display,block);background-image:var(--ran-btn-surface-background-image,none);cursor:var(--ran-btn-surface-cursor,pointer);transition:var(--ran-btn-surface-transition,opacity var(--ran-motion-duration-base,.2s) var(--ran-motion-ease-standard,cubic-bezier(.645, .045, .355, 1)));user-select:var(--ran-btn-surface-user-select,none);touch-action:var(--ran-btn-surface-touch-action,manipulation);border-radius:var(--ran-btn-border-radius,var(--ran-radius-sm,6px));background:var(--ran-btn-surface-background,var(--ran-color-bg-elevated,#fff))}:host,:host(:active),:host(:focus){-webkit-tap-highlight-color:transparent;outline:0}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-surface-outline,0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline,2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset,2px)}:host([type=primary]) .ran-btn-content{background-color:var(--ran-btn-background,var(--ran-color-primary,#171717));background-image:var(--ran-btn-content-background-image,none);border-color:var(--ran-btn-border-color,var(--ran-color-primary,#171717));color:var(--ran-btn-color,var(--ran-color-primary-text,#fff))}:host([type=primary]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, var(--ran-color-primary-text,#fff) 10%, transparent 10.01%))}:host([type=primary]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-active-background,var(--ran-color-primary-active,#4d4d4d));border-color:var(--ran-btn-active-border-color,var(--ran-color-primary-active,#4d4d4d))}@media (width>=1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-hover-border-color,var(--ran-color-border-hover,#c9c9c9));color:var(--ran-btn-hover-color,var(--ran-color-text,#171717))}:host([type=primary]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-hover-background,var(--ran-color-primary-hover,#383838));border-color:var(--ran-btn-hover-border-color,var(--ran-color-primary-hover,#383838));color:var(--ran-btn-hover-color,var(--ran-color-primary-text,#fff))}:host([type=warning]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-warning-background,var(--ran-color-danger,#ff4d4f));color:var(--ran-btn-warning-color,#fff)}}:host([type=warning]) .ran-btn-content{border-color:var(--ran-btn-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-warning-background,var(--ran-color-danger,#ff4d4f));background-image:var(--ran-btn-content-background-image,none);color:var(--ran-btn-warning-color,#fff)}:host([type=warning]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type=text]){box-shadow:var(--ran-btn-text-box-shadow,none)}:host([type=text]) .ran-btn{background:var(--ran-btn-text-surface-background,transparent)}:host([type=text]) .ran-btn-content{border:var(--ran-btn-text-border,none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor,not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events,all);opacity:var(--ran-btn-disabled-opacity,.6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-surface-disabled-cursor,not-allowed);pointer-events:var(--ran-btn-surface-disabled-pointer-events,all);opacity:var(--ran-btn-surface-disabled-opacity,.6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform,translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity,.3);transition:var(--ran-btn-after-transition,0s)}:host(:not([disabled]):active) .ran-btn-content{transform:var(--ran-btn-active-transform,scale(.96))}@media (width>=1024px){:host(:not([disabled],[effect=false])) .ran-btn:after{content:"";width:100%;height:100%;left:var(--ran-x,0);top:var(--ran-y,0);pointer-events:none;background-image:radial-gradient(circle, var(--ran-gray-alpha-400,#00000014) 10%, transparent 10.01%);opacity:0;background-position:50%;background-repeat:no-repeat;transition:transform .3s,opacity .8s;display:block;position:absolute;transform:translate(-50%,-50%)scale(10)}}:host .slot{display:var(--ran-btn-slot-display,block)}:host([hidden]){display:none}.ran-btn-content{display:var(--ran-btn-content-display,flex);justify-content:var(--ran-btn-content-justify-content,space-between);align-items:var(--ran-btn-align-items,center);padding:var(--ran-btn-padding,var(--ran-space-2,8px) var(--ran-space-4,16px));border:var(--ran-btn-border,1px solid transparent);border-image-source:var(--ran-btn-border-image-source,none);border-image-slice:var(--ran-btn-border-image-slice,8);border-image-width:var(--ran-btn-border-image-width,var(--ran-skin-border-image-width,4px));border-radius:var(--ran-btn-border-radius,var(--ran-radius-sm,6px));border-color:var(--ran-btn-border-color,var(--ran-color-border,#eaeaea));color:var(--ran-btn-color,var(--ran-color-text,#000000d9));line-height:var(--ran-btn-line-height,var(--ran-text-button-line-height,1));font-size:var(--ran-btn-font-size,var(--ran-text-button-size,14px));font-weight:var(--ran-btn-font-weight,var(--ran-text-button-weight,500));font-family:var(--ran-btn-font-family,var(--ran-skin-font-family,inherit));white-space:var(--ran-btn-white-space,nowrap);text-align:var(--ran-btn-text-align,center);box-sizing:var(--ran-btn-content-box-sizing,border-box);transition:var(--ran-btn-transition,transform var(--ran-motion-duration-base,.2s) var(--ran-motion-ease-spring,cubic-bezier(.34, 1.26, .5, 1)));border-image-outset:0;border-image-repeat:stretch}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right,var(--ran-space-1,4px))}@media (prefers-reduced-motion:reduce){.ran-btn-content{transition:none}}`,d=typeof document>`u`,f=0,p=1,m=2,h=null,g=null,_=0,v=new Set,y=!1;function b(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(re(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)E(e,m);_===0&&ie()}}]}function x(e){let t=T(e,!0);return ne(t),O(t),()=>A(t)}function S(e){let t=h;h=null;try{return e()}finally{h=t}}function C(e){let t={owned:[],cleanups:[],owner:g},n=g,r=h;g=t,h=null;try{return e(()=>ae(t))}finally{g=n,h=r}}function w(e){g&&g.cleanups.push(e)}function T(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:m,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:g}}function ne(e){g&&g.owned.push(e)}function re(e){h&&(h.sources.add(e),e.observers.add(h))}function E(e,t){if(e.disposed||e.state>=t)return;let n=e.state===f;if(e.state=t,e.isEffect)v.add(e);else if(n)for(let t of e.observers)E(t,p)}function ie(){if(!(_>0||y)){y=!0;try{for(;v.size>0;){let e=[...v];v.clear();for(let t of e)t.disposed||D(t)}}finally{y=!1}}}function D(e){if(!(e.disposed||e.state===f)){if(e.state===p)for(let t of e.sources)`fn`in t&&D(t);e.state===m&&O(e),e.state=f}}function O(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);k(e);let t=h,n=g;h=e,g=e,e.running=!0,e.state=f;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)E(t,m)}}finally{e.running=!1,h=t,g=n}}function k(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function A(e){e.disposed||(e.disposed=!0,k(e),e.observers.clear())}function ae(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function j(e){return r(e)}var oe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,se=`.#[`;function ce(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var le=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ue=(e,t)=>{let n=t.trim();if(!n)return!1;let r=ce(n);return r!==null&&r.every(t=>le(e,t))},M=(e,t,n)=>{for(let r of e)oe(r)&&(ue(r,t)&&n.push(r),M(r.childrenList,t,n))},N=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}},de=new Map,P=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??de}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:r(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new N)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new fe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${j(t)}"`).join(``),i=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=i?` style="${j(i)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof N,e.serialize())).join(``):o+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},fe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}serialize(){return``}},F={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){F.append(e,n);continue}if(typeof n==`function`){F.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof R?n.build():typeof n==`string`&&!d?document.createTextNode(n):n;e.appendChild(t)}}},I=`http://www.w3.org/2000/svg`,L=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),R=class{runtime;el;constructor(e,t,n=F){this.runtime=n;let r=t??(L.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=d?new P(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{d?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(d){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new z(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(d)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},z=class{runtime;root;hostEl;constructor(e,t,n,r=F){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(d)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return d?this.root.serialize():this.root.innerHTML}},B=()=>({current:null}),V=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(V(t)):e.concat(t),[]),H=e=>e==null?null:e instanceof R?e.build():typeof e==`string`?d?e:document.createTextNode(e):e,pe=(e,t)=>{if(d){W(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};x(()=>{let e=t();a();let n=document.createDocumentFragment();i=C(t=>(W(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),w(()=>i?.())},me=`__ranFor`,he=e=>typeof e==`object`&&!!e&&e[me]===!0,ge=(e,t,n)=>{let[r,i]=b(t),a=null,o=C(t=>{let i=H(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},U=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},_e=(e,t)=>{if(d){(t.each()??[]).forEach((n,r)=>{let i=H(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;w(()=>{for(let e of r.values())e.dispose();r.clear()}),x(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Se()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=ge(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();U(n,a),r=i})},ve=`__ranIndex`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=b(e),a=null,o=C(e=>{let i=H(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},xe=(e,t)=>{if(d){(t.each()??[]).forEach((n,r)=>{let i=H(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];w(()=>{for(let e of r)e.dispose();r=[]}),x(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}U(n,r.map(e=>e.node).filter(e=>e!=null))})},W=(e,t)=>{d?S(()=>G(e,t)):G(e,t)},G=(e,t)=>{V(t).forEach(t=>{if(he(t)){_e(e,t);return}if(ye(t)){xe(e,t);return}if(typeof t==`function`){pe(e,t);return}let n=H(t);n!=null&&e.appendChild(n)})},Se=()=>!1,Ce={bind(e,t){if(typeof e!=`function`){t(e);return}d?S(()=>t(e())):x(()=>t(e()))},append:W},we=class extends R{constructor(e,t){super(e,t,Ce)}};function Te(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,I),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ee,Div:K,Svg:De,Span:Oe,Slot:ke,ButtonBuilder:Ae,InputBuilder:je,Style:Me,Label:Ne,Ul:Pe,Li:Fe,Section:Ie,Article:Le,Nav:Re,Header:ze,Footer:Be,Main:Ve,DeclarativeShadow:He}=Te(we),Ue=new Map;function We(e,t){d?(Ue.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ge=typeof document<`u`?HTMLElement:P,Ke=[!1,`false`,null,void 0],q=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!Ke.includes(n))},J=`data-ranui`,qe=`data-ranui-sheet`,Je=(e,t)=>u(e,t,J),Ye=(e,t)=>ee(e,t,qe),Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Z=new Map,Xe=e=>{let t=Z.get(e);if(t!==void 0)return t;let n=e?`${e}\n${X}`:X;return Z.set(e,n),n},Ze=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Je(r,Xe(t)),r},Q=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},Qe=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Ye(t,a)};function $e(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}var $=class extends Ge{_btn;_btnContent;_iconElement;_slot;_shadowDom;_events=new i;debounceTimeId;static get observedAttributes(){return[`disabled`,`icon`,`effect`,`iconSize`,`type`,`aria-label`,`sheet`]}constructor(){super(),this._shadowDom=Ze(this,te);let e=B(),t=B(),n=K().class(`ran-btn`).attr(`part`,`button`).role(`button`).tabIndex(0).children(K().class(`ran-btn-content`).ref(e).attr(`part`,`content`).children(ke().ref(t).class(`slot`))).build();this._shadowDom.appendChild(n),this._btn=n,this._btnContent=Q(e,`content`),this._slot=Q(t,`slot`)}get sheet(){return this.getAttribute(`sheet`)||``}set sheet(e){this.setAttribute(`sheet`,e||``),this.handlerExternalCss()}get disabled(){return q(this)}set disabled(e){!e||e===`false`?(this.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`)):(this.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`))}get iconSize(){return this.getAttribute(`iconSize`)||``}set iconSize(e){!e||e===`false`?this.removeAttribute(`iconSize`):(this.setAttribute(`iconSize`,e),this.setIcon())}get icon(){return this.getAttribute(`icon`)||``}set icon(e){!e||e===`false`?this.removeAttribute(`icon`):(this.setAttribute(`icon`,e),this.setIcon())}get effect(){return this.getAttribute(`effect`)!==`false`}set effect(e){!e||e===`false`?this.setAttribute(`effect`,`false`):this.removeAttribute(`effect`)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}setIcon=()=>{if(typeof document>`u`||!this._slot)return;let e=this.icon;if(!e){this._iconElement&&=(this._iconElement.remove(),void 0);return}if(this._iconElement)this._iconElement.setAttribute(`name`,e);else{let t=this._shadowDom.querySelector(`r-icon`);t||(t=Ee(`r-icon`).attr(`color`,`currentColor`).class(`icon`).build(),this._slot.insertAdjacentElement(`beforebegin`,t)),this._iconElement=t,this._iconElement.setAttribute(`name`,e)}let t=Number.parseFloat(getComputedStyle(this._btnContent).fontSize)||14,n=this.iconSize||`${Math.round(t*1.15)}`;this._iconElement.setAttribute(`size`,String(n))};mousedown=e=>{if(t()===`pc`&&!this.disabled){this.debounceMouseEvent();let{left:t,top:n}=this.getBoundingClientRect();this._btn.style.setProperty(`--ran-x`,`${e.clientX-t}px`),this._btn.style.setProperty(`--ran-y`,`${e.clientY-n}px`)}};mouseup=()=>{t()===`pc`&&(this.debounceTimeId||=setTimeout(()=>{this._btn.style.removeProperty(`--ran-x`),this._btn.style.removeProperty(`--ran-y`),this.debounceMouseEvent()},600))};keydown=e=>{q(this)||$e(e)&&(e.preventDefault(),this.click())};debounceMouseEvent=()=>{this.debounceTimeId&&=(clearTimeout(this.debounceTimeId),void 0)};handlerExternalCss=()=>{Qe(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11yState=()=>{let e=q(this);this._btn.setAttribute(`aria-disabled`,e?`true`:`false`),this._btn.tabIndex=e?-1:0,e?(this.setAttribute(`aria-disabled`,`true`),this._btnContent.setAttribute(`disabled`,`true`)):(this.removeAttribute(`aria-disabled`),this._btnContent.removeAttribute(`disabled`))};connectedCallback(){this.handlerExternalCss(),this.setIcon(),this.syncA11yState(),this.syncAriaLabel(),this._events.on(this._btn,`mousedown`,this.mousedown).on(this._btn,`mouseup`,this.mouseup).on(this._btn,`keydown`,this.keydown)}disconnectedCallback(){this.debounceMouseEvent(),this._events.abort()}syncAriaLabel=()=>{let e=this.getAttribute(`aria-label`);e===null?this._btn.removeAttribute(`aria-label`):this._btn.setAttribute(`aria-label`,e)};attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._btnContent&&this.syncA11yState(),e===`aria-label`&&this.syncAriaLabel(),(e===`icon`||e===`iconSize`)&&this.setIcon(),e===`sheet`&&this.handlerExternalCss())}};return We(`r-button`,$),e.Button=$,e.default=$,e})({}); \ No newline at end of file +var ranui_button=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=()=>{if(typeof window<`u`){let e=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(e)?`ipad`:/android/.test(e)?`android`:/iphone/.test(e)?`iphone`:`pc`}return`pc`},n=/["'&<>]/;function r(e){let t=``+e,r=n.exec(t);if(!r)return t;let i,a=``,o=0,s=0;for(o=r.index;o{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},a=new Map,o=`data-adopted-style`,s=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},c=(e,t,n=o)=>{if(typeof document<`u`&&t&&!s(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},ee=`:host{box-sizing:var(--ran-btn-box-sizing,border-box);position:var(--ran-btn-position,relative);display:var(--ran-btn-display,inline-flex);align-self:var(--ran-btn-align-self,flex-start);background-image:var(--ran-btn-background-image,none);box-shadow:var(--ran-btn-box-shadow,var(--ran-skin-raised-shadow,0 2px #00000004));border-radius:var(--ran-btn-border-radius,var(--ran-radius-sm,6px));cursor:var(--ran-btn-cursor,pointer);user-select:var(--ran-btn-user-select,none);touch-action:var(--ran-btn-touch-action,manipulation);overflow:var(--ran-btn-overflow,hidden);pointer-events:var(--ran-btn-pointer-events,auto)}:host .ran-btn{box-sizing:var(--ran-btn-surface-box-sizing,border-box);position:var(--ran-btn-surface-position,relative);display:var(--ran-btn-surface-display,block);background-image:var(--ran-btn-surface-background-image,none);cursor:var(--ran-btn-surface-cursor,pointer);transition:var(--ran-btn-surface-transition,opacity var(--ran-motion-duration-base,.2s) var(--ran-motion-ease-standard,cubic-bezier(.645, .045, .355, 1)));user-select:var(--ran-btn-surface-user-select,none);touch-action:var(--ran-btn-surface-touch-action,manipulation);border-radius:var(--ran-btn-border-radius,var(--ran-radius-sm,6px));background:var(--ran-btn-surface-background,var(--ran-color-bg-elevated,#fff))}:host,:host(:active),:host(:focus){-webkit-tap-highlight-color:transparent;outline:0}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-surface-outline,0)}:host .ran-btn:focus-visible{outline:var(--ran-btn-focus-outline,2px solid var(--ran-color-link));outline-offset:var(--ran-btn-focus-outline-offset,-2px)}:host([type=primary]) .ran-btn-content{background-color:var(--ran-btn-background,var(--ran-color-primary,#171717));background-image:var(--ran-btn-content-background-image,none);border-color:var(--ran-btn-border-color,var(--ran-color-primary,#171717));color:var(--ran-btn-color,var(--ran-color-primary-text,#fff))}:host([type=primary]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, var(--ran-color-primary-text,#fff) 10%, transparent 10.01%))}:host([type=primary]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-active-background,var(--ran-color-primary-active,#4d4d4d));border-color:var(--ran-btn-active-border-color,var(--ran-color-primary-active,#4d4d4d))}@media (width>=1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-hover-border-color,var(--ran-color-border-hover,#c9c9c9));color:var(--ran-btn-hover-color,var(--ran-color-text,#171717))}:host([type=primary]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-hover-background,var(--ran-color-primary-hover,#383838));border-color:var(--ran-btn-hover-border-color,var(--ran-color-primary-hover,#383838));color:var(--ran-btn-hover-color,var(--ran-color-primary-text,#fff))}:host([type=warning]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-warning-background,var(--ran-color-danger,#ff4d4f));color:var(--ran-btn-warning-color,#fff)}}:host([type=warning]) .ran-btn-content{border-color:var(--ran-btn-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-warning-background,var(--ran-color-danger,#ff4d4f));background-image:var(--ran-btn-content-background-image,none);color:var(--ran-btn-warning-color,#fff)}:host([type=warning]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type=text]){box-shadow:var(--ran-btn-text-box-shadow,none)}:host([type=text]) .ran-btn{background:var(--ran-btn-text-surface-background,transparent)}:host([type=text]) .ran-btn-content{border:var(--ran-btn-text-border,none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor,not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events,all);opacity:var(--ran-btn-disabled-opacity,.6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-surface-disabled-cursor,not-allowed);pointer-events:var(--ran-btn-surface-disabled-pointer-events,all);opacity:var(--ran-btn-surface-disabled-opacity,.6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform,translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity,.3);transition:var(--ran-btn-after-transition,0s)}:host(:not([disabled]):active) .ran-btn-content{transform:var(--ran-btn-active-transform,scale(.96))}@media (width>=1024px){:host(:not([disabled],[effect=false])) .ran-btn:after{content:"";width:100%;height:100%;left:var(--ran-x,0);top:var(--ran-y,0);pointer-events:none;background-image:radial-gradient(circle, var(--ran-gray-alpha-400,#00000014) 10%, transparent 10.01%);opacity:0;background-position:50%;background-repeat:no-repeat;transition:transform .3s,opacity .8s;display:block;position:absolute;transform:translate(-50%,-50%)scale(10)}}:host .slot{display:var(--ran-btn-slot-display,block)}:host([hidden]){display:none}.ran-btn-content{display:var(--ran-btn-content-display,flex);justify-content:var(--ran-btn-content-justify-content,space-between);align-items:var(--ran-btn-align-items,center);padding:var(--ran-btn-padding,var(--ran-space-2,8px) var(--ran-space-4,16px));border:var(--ran-btn-border,1px solid transparent);border-image-source:var(--ran-btn-border-image-source,none);border-image-slice:var(--ran-btn-border-image-slice,8);border-image-width:var(--ran-btn-border-image-width,var(--ran-skin-border-image-width,4px));border-radius:var(--ran-btn-border-radius,var(--ran-radius-sm,6px));border-color:var(--ran-btn-border-color,var(--ran-color-border,#eaeaea));color:var(--ran-btn-color,var(--ran-color-text,#000000d9));line-height:var(--ran-btn-line-height,var(--ran-text-button-line-height,1));font-size:var(--ran-btn-font-size,var(--ran-text-button-size,14px));font-weight:var(--ran-btn-font-weight,var(--ran-text-button-weight,500));font-family:var(--ran-btn-font-family,var(--ran-skin-font-family,inherit));white-space:var(--ran-btn-white-space,nowrap);text-align:var(--ran-btn-text-align,center);box-sizing:var(--ran-btn-content-box-sizing,border-box);transition:var(--ran-btn-transition,transform var(--ran-motion-duration-base,.2s) var(--ran-motion-ease-spring,cubic-bezier(.34, 1.26, .5, 1)));border-image-outset:0;border-image-repeat:stretch}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right,var(--ran-space-1,4px))}@media (prefers-reduced-motion:reduce){.ran-btn-content{transition:none}}`,l=typeof document>`u`,u=0,d=1,f=2,p=null,m=null,h=0,g=new Set,_=!1;function v(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(re(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)C(e,f);h===0&&ie()}}]}function y(e){let t=te(e,!0);return ne(t),T(t),()=>D(t)}function b(e){let t=p;p=null;try{return e()}finally{p=t}}function x(e){let t={owned:[],cleanups:[],owner:m},n=m,r=p;m=t,p=null;try{return e(()=>ae(t))}finally{m=n,p=r}}function S(e){m&&m.cleanups.push(e)}function te(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:f,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:m}}function ne(e){m&&m.owned.push(e)}function re(e){p&&(p.sources.add(e),e.observers.add(p))}function C(e,t){if(e.disposed||e.state>=t)return;let n=e.state===u;if(e.state=t,e.isEffect)g.add(e);else if(n)for(let t of e.observers)C(t,d)}function ie(){if(!(h>0||_)){_=!0;try{for(;g.size>0;){let e=[...g];g.clear();for(let t of e)t.disposed||w(t)}}finally{_=!1}}}function w(e){if(!(e.disposed||e.state===u)){if(e.state===d)for(let t of e.sources)`fn`in t&&w(t);e.state===f&&T(e),e.state=u}}function T(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=p,n=m;p=e,m=e,e.running=!0,e.state=u;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)C(t,f)}}finally{e.running=!1,p=t,m=n}}function E(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function ae(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function O(e){return r(e)}var oe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,se=`.#[`;function ce(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var le=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ue=(e,t)=>{let n=t.trim();if(!n)return!1;let r=ce(n);return r!==null&&r.every(t=>le(e,t))},k=(e,t,n)=>{for(let r of e)oe(r)&&(ue(r,t)&&n.push(r),k(r.childrenList,t,n))},A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}},de=new Map,j=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??de}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:r(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new A)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new fe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${O(t)}"`).join(``),i=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=i?` style="${O(i)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof A,e.serialize())).join(``):o+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},fe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}serialize(){return``}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){M.append(e,n);continue}if(typeof n==`function`){M.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof N?n.build():typeof n==`string`&&!l?document.createTextNode(n):n;e.appendChild(t)}}},pe=`http://www.w3.org/2000/svg`,me=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,n=M){this.runtime=n;let r=t??(me.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=l?new j(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{l?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(l){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new he(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(l)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},he=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(l)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return l?this.root.serialize():this.root.innerHTML}},P=()=>({current:null}),F=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(F(t)):e.concat(t),[]),I=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?l?e:document.createTextNode(e):e,L=(e,t)=>{if(l){B(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};y(()=>{let e=t();a();let n=document.createDocumentFragment();i=x(t=>(B(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),S(()=>i?.())},R=`__ranFor`,ge=e=>typeof e==`object`&&!!e&&e[R]===!0,_e=(e,t,n)=>{let[r,i]=v(t),a=null,o=x(t=>{let i=I(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},z=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ve=(e,t)=>{if(l){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;S(()=>{for(let e of r.values())e.dispose();r.clear()}),y(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){H()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=_e(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();z(n,a),r=i})},ye=`__ranIndex`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=v(e),a=null,o=x(e=>{let i=I(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Se=(e,t)=>{if(l){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];S(()=>{for(let e of r)e.dispose();r=[]}),y(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}z(n,r.map(e=>e.node).filter(e=>e!=null))})},B=(e,t)=>{l?b(()=>V(e,t)):V(e,t)},V=(e,t)=>{F(t).forEach(t=>{if(ge(t)){ve(e,t);return}if(be(t)){Se(e,t);return}if(typeof t==`function`){L(e,t);return}let n=I(t);n!=null&&e.appendChild(n)})},H=()=>!1,Ce={bind(e,t){typeof e==`function`?l?b(()=>t(e())):y(()=>t(e())):t(e)},append:B},we=class extends N{constructor(e,t){super(e,t,Ce)}};function Te(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,pe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ee,Div:U,Svg:De,Span:Oe,Slot:ke,ButtonBuilder:Ae,InputBuilder:je,Style:Me,Label:Ne,Ul:Pe,Li:Fe,Section:Ie,Article:Le,Nav:Re,Header:ze,Footer:Be,Main:Ve,DeclarativeShadow:He}=Te(we),Ue=new Map;function We(e,t){l?(Ue.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ge=typeof document<`u`?HTMLElement:j,Ke=[!1,`false`,null,void 0],W=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!(!t||Ke.includes(n))},qe=`data-ranui`,G=`data-ranui-sheet`,Je=(e,t)=>c(e,t,qe),K=new WeakMap,q=new Map,Ye=e=>{if(typeof CSSStyleSheet>`u`)return;let t=q.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},q.set(e,t)}catch{return}return t.users++,t.sheet},J=e=>{let t=q.get(e);t&&--t.users===0&&q.delete(e)},Xe=(e,t)=>{if(typeof document>`u`)return;let n=K.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),J(n.text)):n&&e.querySelector(`style[${G}]`)?.remove(),K.delete(e),!t))return;let r=Ye(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{J(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(G,``),n.textContent=t,e.appendChild(n)}K.set(e,{text:t,sheet:r})},Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Z=new Map,Ze=e=>{let t=Z.get(e);if(t!==void 0)return t;let n=e?`${e}\n${X}`:X;return Z.set(e,n),n},Qe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Je(r,Ze(t)),r},Q=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},$e=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Xe(t,e.getAttribute(`sheet`)||``)};function et(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}var $=class extends Ge{_btn;_btnContent;_iconElement;_slot;_shadowDom;_events=new i;debounceTimeId;static get observedAttributes(){return[`disabled`,`icon`,`effect`,`iconSize`,`type`,`aria-label`,`sheet`]}constructor(){super(),this._shadowDom=Qe(this,ee);let e=P(),t=P(),n=U().class(`ran-btn`).attr(`part`,`button`).role(`button`).tabIndex(0).children(U().class(`ran-btn-content`).ref(e).attr(`part`,`content`).children(ke().ref(t).class(`slot`))).build();this._shadowDom.appendChild(n),this._btn=n,this._btnContent=Q(e,`content`),this._slot=Q(t,`slot`)}get sheet(){return this.getAttribute(`sheet`)||``}set sheet(e){this.setAttribute(`sheet`,e||``),this.handlerExternalCss()}get disabled(){return W(this)}set disabled(e){!e||e===`false`?(this.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`)):(this.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`))}get iconSize(){return this.getAttribute(`iconSize`)||``}set iconSize(e){!e||e===`false`?this.removeAttribute(`iconSize`):(this.setAttribute(`iconSize`,e),this.setIcon())}get icon(){return this.getAttribute(`icon`)||``}set icon(e){!e||e===`false`?this.removeAttribute(`icon`):(this.setAttribute(`icon`,e),this.setIcon())}get effect(){return this.getAttribute(`effect`)!==`false`}set effect(e){!e||e===`false`?this.setAttribute(`effect`,`false`):this.removeAttribute(`effect`)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}focus(e){W(this)||this._btn.focus(e)}click(){W(this)||super.click()}_guardDisabledClick=e=>{W(this)&&(e.preventDefault(),e.stopImmediatePropagation())};setIcon=()=>{if(typeof document>`u`||!this._slot)return;let e=this.icon;if(!e){this._iconElement&&=(this._iconElement.remove(),void 0);return}if(this._iconElement)this._iconElement.setAttribute(`name`,e);else{let t=this._shadowDom.querySelector(`r-icon`);t||(t=Ee(`r-icon`).attr(`color`,`currentColor`).class(`icon`).build(),this._slot.insertAdjacentElement(`beforebegin`,t)),this._iconElement=t,this._iconElement.setAttribute(`name`,e)}let t=Number.parseFloat(getComputedStyle(this._btnContent).fontSize)||14,n=this.iconSize||`${Math.round(t*1.15)}`;this._iconElement.setAttribute(`size`,String(n))};mousedown=e=>{if(t()===`pc`&&!this.disabled){this.debounceMouseEvent();let{left:t,top:n}=this.getBoundingClientRect();this._btn.style.setProperty(`--ran-x`,`${e.clientX-t}px`),this._btn.style.setProperty(`--ran-y`,`${e.clientY-n}px`)}};mouseup=()=>{t()===`pc`&&(this.debounceTimeId||=setTimeout(()=>{this._btn.style.removeProperty(`--ran-x`),this._btn.style.removeProperty(`--ran-y`),this.debounceMouseEvent()},600))};keydown=e=>{W(this)||et(e)&&(e.preventDefault(),this.click())};debounceMouseEvent=()=>{this.debounceTimeId&&=(clearTimeout(this.debounceTimeId),void 0)};handlerExternalCss=()=>{$e(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11yState=()=>{let e=W(this);this._btn.setAttribute(`aria-disabled`,e?`true`:`false`),this._btn.tabIndex=e?-1:0,e?(this.setAttribute(`aria-disabled`,`true`),this._btnContent.setAttribute(`disabled`,`true`)):(this.removeAttribute(`aria-disabled`),this._btnContent.removeAttribute(`disabled`))};connectedCallback(){this.handlerExternalCss(),this.setIcon(),this.syncA11yState(),this.syncAriaLabel(),this._events.on(this,`click`,this._guardDisabledClick,{capture:!0}).on(this._btn,`mousedown`,this.mousedown).on(this._btn,`mouseup`,this.mouseup).on(this._btn,`keydown`,this.keydown)}disconnectedCallback(){this.debounceMouseEvent(),this._events.abort()}syncAriaLabel=()=>{let e=this.getAttribute(`aria-label`);e===null?this._btn.removeAttribute(`aria-label`):this._btn.setAttribute(`aria-label`,e)};attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._btnContent&&this.syncA11yState(),e===`aria-label`&&this.syncAriaLabel(),(e===`icon`||e===`iconSize`)&&this.setIcon(),e===`sheet`&&this.handlerExternalCss())}};return We(`r-button`,$),e.Button=$,e.default=$,e})({}); \ No newline at end of file diff --git a/public/ranui-iife/card.iife.js b/public/ranui-iife/card.iife.js index 71dd4d919..9ccbdce1d 100644 --- a/public/ranui-iife/card.iife.js +++ b/public/ranui-iife/card.iife.js @@ -1 +1 @@ -var ranui_card=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:var(--ran-card-display,block);box-sizing:border-box;min-height:var(--ran-card-min-height,0)}:host([hidden]){display:none}:host([hoverable]:hover) .ran-card{border-color:var(--ran-card-hover-border-color,var(--ran-color-border-hover,#c9c9c9));box-shadow:var(--ran-card-hover-shadow,var(--ran-shadow-elevated,0 1px 2px #0000000a))}.ran-card{align-content:start;gap:var(--ran-card-gap,var(--ran-space-4,16px));min-width:0;height:100%;padding:var(--ran-card-padding,var(--ran-space-4,16px));border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-card-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-card-radius,var(--ran-radius-md));background:var(--ran-card-background,var(--ran-color-bg));box-shadow:var(--ran-card-shadow,none);box-sizing:border-box;display:grid}.ran-card-header{justify-content:space-between;align-items:flex-start;gap:var(--ran-card-header-gap,var(--ran-space-4,16px));display:flex}.ran-card-title-area{flex:1;min-width:0}.ran-card-title{color:var(--ran-card-title-color,var(--ran-color-text));font-size:var(--ran-card-title-font-size,var(--ran-text-heading-4,16px));font-weight:var(--ran-card-title-font-weight,var(--ran-text-heading-weight,600));letter-spacing:var(--ran-card-title-letter-spacing,var(--ran-text-heading-tracking,-.03em));margin:0;line-height:1.3}.ran-card-title:empty{display:none}.ran-card-description{margin:var(--ran-card-description-margin-top,var(--ran-space-1,4px)) 0 0;color:var(--ran-card-description-color,var(--ran-color-text-secondary));font-size:var(--ran-card-description-font-size,var(--ran-text-copy-2,14px));font-weight:var(--ran-card-description-font-weight,var(--ran-text-copy-weight,400));line-height:1.5}.ran-card-description:empty{display:none}.ran-card-body,.ran-card-footer{min-width:0}:host(:not([title]):not([description])) .ran-card-header{display:none}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},te=(e,t,n=s)=>{if(!(typeof document>`u`)&&t&&!c(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},ne=(e,t,n=ee)=>{if(!(typeof document>`u`)&&t&&!c(e,t,o)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(C(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)w(e,d);m===0&&ie()}}]}function v(e){let t=re(e,!0);return S(t),E(t),()=>O(t)}function y(e){let t=f;f=null;try{return e()}finally{f=t}}function b(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>k(t))}finally{p=n,f=r}}function x(e){p&&p.cleanups.push(e)}function re(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function S(e){p&&p.owned.push(e)}function C(e){f&&(f.sources.add(e),e.observers.add(f))}function w(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)w(t,u)}function ie(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||T(t)}}finally{g=!1}}}function T(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&T(t);e.state===d&&E(e),e.state=l}}function E(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);D(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)w(t,d)}}finally{e.running=!1,f=t,p=n}}function D(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function O(e){e.disposed||(e.disposed=!0,D(e),e.observers.clear())}function k(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function A(e){return i(e)}var ae=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,oe=`.#[`;function se(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var ce=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},le=(e,t)=>{let n=t.trim();if(!n)return!1;let r=se(n);return r!==null&&r.every(t=>ce(e,t))},j=(e,t,n)=>{for(let r of e)ae(r)&&(le(r,t)&&n.push(r),j(r.childrenList,t,n))},M=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}},ue=new Map,N=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ue}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new M)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new de(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${A(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${A(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof M,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},de=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}serialize(){return``}},P={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){P.append(e,r);continue}if(typeof r==`function`){P.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof F?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},fe=`http://www.w3.org/2000/svg`,pe=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),F=class{runtime;el;constructor(e,t,r=P){this.runtime=r;let i=t??(pe.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new N(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new me(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},me=class{runtime;root;hostEl;constructor(e,t,n,r=P){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},I=()=>({current:null}),L=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(L(t)):e.concat(t),[]),R=e=>e==null?null:e instanceof F?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,z=(e,t)=>{if(n){V(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();o();let n=document.createDocumentFragment();a=b(t=>(V(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),x(()=>a?.())},he=`__ranFor`,ge=e=>typeof e==`object`&&!!e&&e[he]===!0,_e=(e,t,n)=>{let[r,i]=_(t),a=null,o=b(t=>{let i=R(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},B=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ve=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;x(()=>{for(let e of i.values())e.dispose();i.clear()}),v(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){Ce()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=_e(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();B(r,a),i=n})},ye=`__ranIndex`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=_(e),a=null,o=b(e=>{let i=R(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];x(()=>{for(let e of i)e.dispose();i=[]}),v(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}B(r,i.map(e=>e.node).filter(e=>e!=null))})},V=(e,t)=>{n?y(()=>H(e,t)):H(e,t)},H=(e,t)=>{L(t).forEach(t=>{if(ge(t)){ve(e,t);return}if(be(t)){Se(e,t);return}if(typeof t==`function`){z(e,t);return}let n=R(t);n!=null&&e.appendChild(n)})},Ce=()=>!1,we={bind(e,t){if(typeof e!=`function`){t(e);return}n?y(()=>t(e())):v(()=>t(e()))},append:V},Te=class extends F{constructor(e,t){super(e,t,we)}};function Ee(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,fe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:De,Div:U,Svg:Oe,Span:ke,Slot:W,ButtonBuilder:Ae,InputBuilder:je,Style:Me,Label:Ne,Ul:Pe,Li:Fe,Section:Ie,Article:Le,Nav:Re,Header:ze,Footer:Be,Main:Ve,DeclarativeShadow:He}=Ee(Te),Ue=new Map;function We(e,t){n?(Ue.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ge=typeof document<`u`?HTMLElement:N,Ke=`data-ranui`,qe=`data-ranui-sheet`,Je=(e,t)=>te(e,t,Ke),Ye=(e,t)=>ne(e,t,qe),G=new WeakMap,K=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,q=new Map,J=e=>{let t=q.get(e);if(t!==void 0)return t;let n=e?`${e}\n${K}`:K;return q.set(e,n),n},Xe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||G.get(e)||e.attachShadow(n);return G.set(e,r),Je(r,J(t)),r},Y=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Q=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Ye(t,a)},$=class extends Ge{_shadowDom;_titleEl;_descriptionEl;_headerEl;_footerEl;static get observedAttributes(){return[`heading`,`description`,`sheet`,`hoverable`]}constructor(){super(),this._shadowDom=Xe(this,t);let e=I(),n=I(),r=I(),i=I(),a=I(),o=U().class(`ran-card`).attr(`part`,`card`).children(U().class(`ran-card-header`).ref(e).attr(`part`,`header`).children(U().class(`ran-card-title-area`).children(U().class(`ran-card-title`).ref(n).attr(`part`,`title`),U().class(`ran-card-description`).ref(r).attr(`part`,`description`)),W().attr(`name`,`extra`).attr(`part`,`extra`)),U().class(`ran-card-body`).attr(`part`,`body`).children(W()),U().class(`ran-card-footer`).ref(i).attr(`part`,`footer`).children(W().attr(`name`,`footer`).ref(a))).build();this._shadowDom.appendChild(o),this._headerEl=Y(e,`header`),this._titleEl=Y(n,`title`),this._descriptionEl=Y(r,`description`),this._footerEl=Y(i,`footer`),this._footerEl.style.display=`none`;let s=Y(a,`slot[name="footer"]`);s.addEventListener(`slotchange`,()=>{this._footerEl.style.display=s.assignedElements().length>0?``:`none`})}get heading(){return X(this,`heading`)}set heading(e){Z(this,`heading`,e)}get description(){return X(this,`description`)}set description(e){Z(this,`description`,e)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}get hoverable(){return this.hasAttribute(`hoverable`)}set hoverable(e){e?this.setAttribute(`hoverable`,``):this.removeAttribute(`hoverable`)}_syncTitle(){this._titleEl.textContent=this.getAttribute(`heading`)??``}_syncDescription(){this._descriptionEl.textContent=this.getAttribute(`description`)??``}connectedCallback(){this._syncTitle(),this._syncDescription(),Q(this,this._shadowDom,`sheet`,null,this.sheet)}attributeChangedCallback(e,t,n){t!==n&&(e===`heading`&&this._syncTitle(),e===`description`&&this._syncDescription(),e===`sheet`&&Q(this,this._shadowDom,e,t,n))}};return We(`r-card`,$),e.Card=$,e.default=$,e})({}); \ No newline at end of file +var ranui_card=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:var(--ran-card-display,block);box-sizing:border-box;min-height:var(--ran-card-min-height,0)}:host([hidden]){display:none}:host([hoverable]:hover) .ran-card{border-color:var(--ran-card-hover-border-color,var(--ran-color-border-hover,#c9c9c9));box-shadow:var(--ran-card-hover-shadow,var(--ran-shadow-elevated,0 1px 2px #0000000a))}.ran-card{align-content:start;gap:var(--ran-card-gap,var(--ran-space-4,16px));min-width:0;height:100%;padding:var(--ran-card-padding,var(--ran-space-4,16px));border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-card-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-card-radius,var(--ran-radius-md));background:var(--ran-card-background,var(--ran-color-bg));box-shadow:var(--ran-card-shadow,none);box-sizing:border-box;display:grid}.ran-card-header{justify-content:space-between;align-items:flex-start;gap:var(--ran-card-header-gap,var(--ran-space-4,16px));flex-wrap:wrap;min-width:0;display:flex}.ran-card-title-area{overflow-wrap:anywhere;flex:auto;min-width:0}.ran-card-title{color:var(--ran-card-title-color,var(--ran-color-text));font-size:var(--ran-card-title-font-size,var(--ran-text-heading-4,16px));font-weight:var(--ran-card-title-font-weight,var(--ran-text-heading-weight,600));letter-spacing:var(--ran-card-title-letter-spacing,var(--ran-text-heading-tracking,-.03em));margin:0;line-height:1.3}.ran-card-title:empty{display:none}.ran-card-description{margin:var(--ran-card-description-margin-top,var(--ran-space-1,4px)) 0 0;color:var(--ran-card-description-color,var(--ran-color-text-secondary));font-size:var(--ran-card-description-font-size,var(--ran-text-copy-2,14px));font-weight:var(--ran-card-description-font-weight,var(--ran-text-copy-weight,400));line-height:1.5}.ran-card-description:empty{display:none}.ran-card-body,.ran-card-footer{min-width:0}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},c=(e,t,n=o)=>{if(typeof document<`u`&&t&&!s(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)S(e,d);m===0&&re()}}]}function v(e){let t=ee(e,!0);return te(t),w(t),()=>E(t)}function y(e){let t=f;f=null;try{return e()}finally{f=t}}function b(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>ie(t))}finally{p=n,f=r}}function x(e){p&&p.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function te(e){p&&p.owned.push(e)}function ne(e){f&&(f.sources.add(e),e.observers.add(f))}function S(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)S(t,u)}function re(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||C(t)}}finally{g=!1}}}function C(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&C(t);e.state===d&&w(e),e.state=l}}function w(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);T(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)S(t,d)}}finally{e.running=!1,f=t,p=n}}function T(e){for(let t of e.owned)E(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function E(e){e.disposed||(e.disposed=!0,T(e),e.observers.clear())}function ie(e){for(let t of e.owned)E(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function D(e){return i(e)}var ae=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,oe=`.#[`;function se(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var ce=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},le=(e,t)=>{let n=t.trim();if(!n)return!1;let r=se(n);return r!==null&&r.every(t=>ce(e,t))},O=(e,t,n)=>{for(let r of e)ae(r)&&(le(r,t)&&n.push(r),O(r.childrenList,t,n))},k=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},A=new Map,j=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??A}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new k)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new ue(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${D(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${D(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof k,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},ue=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return``}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){M.append(e,r);continue}if(typeof r==`function`){M.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof N?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},de=`http://www.w3.org/2000/svg`,fe=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,r=M){this.runtime=r;let i=t??(fe.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new j(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new pe(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},pe=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},P=()=>({current:null}),F=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(F(t)):e.concat(t),[]),I=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,me=(e,t)=>{if(n){R(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();o();let n=document.createDocumentFragment();a=b(t=>(R(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),x(()=>a?.())},he=`__ranFor`,ge=e=>typeof e==`object`&&!!e&&e[he]===!0,_e=(e,t,n)=>{let[r,i]=_(t),a=null,o=b(t=>{let i=I(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},L=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ve=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;x(()=>{for(let e of i.values())e.dispose();i.clear()}),v(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){Ce()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=_e(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();L(r,a),i=n})},ye=`__ranIndex`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=_(e),a=null,o=b(e=>{let i=I(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];x(()=>{for(let e of i)e.dispose();i=[]}),v(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}L(r,i.map(e=>e.node).filter(e=>e!=null))})},R=(e,t)=>{n?y(()=>z(e,t)):z(e,t)},z=(e,t)=>{F(t).forEach(t=>{if(ge(t)){ve(e,t);return}if(be(t)){Se(e,t);return}if(typeof t==`function`){me(e,t);return}let n=I(t);n!=null&&e.appendChild(n)})},Ce=()=>!1,we={bind(e,t){typeof e==`function`?n?y(()=>t(e())):v(()=>t(e())):t(e)},append:R},Te=class extends N{constructor(e,t){super(e,t,we)}};function Ee(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,de),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:De,Div:B,Svg:Oe,Span:ke,Slot:V,ButtonBuilder:Ae,InputBuilder:je,Style:Me,Label:Ne,Ul:Pe,Li:Fe,Section:Ie,Article:Le,Nav:Re,Header:ze,Footer:Be,Main:Ve,DeclarativeShadow:He}=Ee(Te),Ue=new Map;function We(e,t){n?(Ue.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ge=typeof document<`u`?HTMLElement:j,Ke=`data-ranui`,H=`data-ranui-sheet`,qe=(e,t)=>c(e,t,Ke),U=new WeakMap,W=new Map,Je=e=>{if(typeof CSSStyleSheet>`u`)return;let t=W.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},W.set(e,t)}catch{return}return t.users++,t.sheet},G=e=>{let t=W.get(e);t&&--t.users===0&&W.delete(e)},Ye=(e,t)=>{if(typeof document>`u`)return;let n=U.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),G(n.text)):n&&e.querySelector(`style[${H}]`)?.remove(),U.delete(e),!t))return;let r=Je(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{G(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(H,``),n.textContent=t,e.appendChild(n)}U.set(e,{text:t,sheet:r})},K=new WeakMap,q=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,J=new Map,Xe=e=>{let t=J.get(e);if(t!==void 0)return t;let n=e?`${e}\n${q}`:q;return J.set(e,n),n},Ze=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||K.get(e)||e.attachShadow(n);return K.set(e,r),qe(r,Xe(t)),r},Y=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},Q=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Ye(t,e.getAttribute(`sheet`)||``)},$=class extends Ge{_shadowDom;_titleEl;_descriptionEl;_headerEl;_footerEl;_extraSlot;static get observedAttributes(){return[`heading`,`description`,`sheet`,`hoverable`]}constructor(){super(),this._shadowDom=Ze(this,t);let e=P(),n=P(),r=P(),i=P(),a=P(),o=P(),s=B().class(`ran-card`).attr(`part`,`card`).children(B().class(`ran-card-header`).ref(e).attr(`part`,`header`).children(B().class(`ran-card-title-area`).children(B().class(`ran-card-title`).ref(n).attr(`part`,`title`),B().class(`ran-card-description`).ref(r).attr(`part`,`description`)),V().attr(`name`,`extra`).attr(`part`,`extra`).ref(o)),B().class(`ran-card-body`).attr(`part`,`body`).children(V()),B().class(`ran-card-footer`).ref(i).attr(`part`,`footer`).children(V().attr(`name`,`footer`).ref(a))).build();this._shadowDom.appendChild(s),this._headerEl=Y(e,`header`),this._titleEl=Y(n,`title`),this._descriptionEl=Y(r,`description`),this._footerEl=Y(i,`footer`),this._extraSlot=Y(o,`slot[name="extra"]`),this._extraSlot.addEventListener(`slotchange`,()=>this._syncHeader()),this._footerEl.style.display=`none`;let c=Y(a,`slot[name="footer"]`);c.addEventListener(`slotchange`,()=>{this._footerEl.style.display=c.assignedElements().length>0?``:`none`})}get heading(){return X(this,`heading`)}set heading(e){Z(this,`heading`,e)}get description(){return X(this,`description`)}set description(e){Z(this,`description`,e)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}get hoverable(){return this.hasAttribute(`hoverable`)}set hoverable(e){e?this.setAttribute(`hoverable`,``):this.removeAttribute(`hoverable`)}_syncTitle(){this._titleEl.textContent=this.getAttribute(`heading`)??``,this._syncHeader()}_syncDescription(){this._descriptionEl.textContent=this.getAttribute(`description`)??``,this._syncHeader()}_syncHeader(){let e=this._titleEl.textContent?.trim()||this._descriptionEl.textContent?.trim()||this._extraSlot.assignedElements().length>0;this._headerEl.style.display=e?``:`none`}connectedCallback(){this._syncTitle(),this._syncDescription(),Q(this,this._shadowDom,`sheet`,null,this.sheet)}attributeChangedCallback(e,t,n){t!==n&&(e===`heading`&&this._syncTitle(),e===`description`&&this._syncDescription(),e===`sheet`&&Q(this,this._shadowDom,e,t,n))}};return We(`r-card`,$),e.Card=$,e.default=$,e})({}); \ No newline at end of file diff --git a/public/ranui-iife/checkbox.iife.js b/public/ranui-iife/checkbox.iife.js index 416706010..6e859b48e 100644 --- a/public/ranui-iife/checkbox.iife.js +++ b/public/ranui-iife/checkbox.iife.js @@ -1 +1 @@ -var ranui_checkbox=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},n=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=new Map,c=`data-adopted-style`,l=`data-adopted-sheet`,u=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},d=(e,t,n=c)=>{if(!(typeof document>`u`)&&t&&!u(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},ee=(e,t,n=l)=>{if(!(typeof document>`u`)&&t&&!u(e,t,s)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},f=typeof document>`u`,p=0,m=1,h=2,g=null,_=null,v=0,y=new Set,b=!1;function x(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(re(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)E(e,h);v===0&&ie()}}]}function S(e){let t=te(e,!0);return ne(t),O(t),()=>A(t)}function C(e){let t=g;g=null;try{return e()}finally{g=t}}function w(e){let t={owned:[],cleanups:[],owner:_},n=_,r=g;_=t,g=null;try{return e(()=>j(t))}finally{_=n,g=r}}function T(e){_&&_.cleanups.push(e)}function te(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:h,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:_}}function ne(e){_&&_.owned.push(e)}function re(e){g&&(g.sources.add(e),e.observers.add(g))}function E(e,t){if(e.disposed||e.state>=t)return;let n=e.state===p;if(e.state=t,e.isEffect)y.add(e);else if(n)for(let t of e.observers)E(t,m)}function ie(){if(!(v>0||b)){b=!0;try{for(;y.size>0;){let e=[...y];y.clear();for(let t of e)t.disposed||D(t)}}finally{b=!1}}}function D(e){if(!(e.disposed||e.state===p)){if(e.state===m)for(let t of e.sources)`fn`in t&&D(t);e.state===h&&O(e),e.state=p}}function O(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);k(e);let t=g,n=_;g=e,_=e,e.running=!0,e.state=p;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)E(t,h)}}finally{e.running=!1,g=t,_=n}}function k(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function A(e){e.disposed||(e.disposed=!0,k(e),e.observers.clear())}function j(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function M(e){return i(e)}var ae=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,oe=`.#[`;function se(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var ce=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},le=(e,t)=>{let n=t.trim();if(!n)return!1;let r=se(n);return r!==null&&r.every(t=>ce(e,t))},N=(e,t,n)=>{for(let r of e)ae(r)&&(le(r,t)&&n.push(r),N(r.childrenList,t,n))},P=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}},ue=new Map,F=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ue}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new P)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new de(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${M(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${M(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof P,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},de=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}serialize(){return``}},I={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){I.append(e,n);continue}if(typeof n==`function`){I.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof L?n.build():typeof n==`string`&&!f?document.createTextNode(n):n;e.appendChild(t)}}},fe=`http://www.w3.org/2000/svg`,pe=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),L=class{runtime;el;constructor(e,t,n=I){this.runtime=n;let r=t??(pe.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=f?new F(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{f?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(f){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new R(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(f)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},R=class{runtime;root;hostEl;constructor(e,t,n,r=I){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(f)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return f?this.root.serialize():this.root.innerHTML}},z=()=>({current:null}),B=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(B(t)):e.concat(t),[]),V=e=>e==null?null:e instanceof L?e.build():typeof e==`string`?f?e:document.createTextNode(e):e,me=(e,t)=>{if(f){U(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};S(()=>{let e=t();a();let n=document.createDocumentFragment();i=w(t=>(U(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),T(()=>i?.())},he=`__ranFor`,ge=e=>typeof e==`object`&&!!e&&e[he]===!0,_e=(e,t,n)=>{let[r,i]=x(t),a=null,o=w(t=>{let i=V(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},H=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ve=(e,t)=>{if(f){(t.each()??[]).forEach((n,r)=>{let i=V(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;T(()=>{for(let e of r.values())e.dispose();r.clear()}),S(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Ce()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=_e(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();H(n,a),r=i})},ye=`__ranIndex`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=x(e),a=null,o=w(e=>{let i=V(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Se=(e,t)=>{if(f){(t.each()??[]).forEach((n,r)=>{let i=V(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];T(()=>{for(let e of r)e.dispose();r=[]}),S(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}H(n,r.map(e=>e.node).filter(e=>e!=null))})},U=(e,t)=>{f?C(()=>W(e,t)):W(e,t)},W=(e,t)=>{B(t).forEach(t=>{if(ge(t)){ve(e,t);return}if(be(t)){Se(e,t);return}if(typeof t==`function`){me(e,t);return}let n=V(t);n!=null&&e.appendChild(n)})},Ce=()=>!1,we={bind(e,t){if(typeof e!=`function`){t(e);return}f?C(()=>t(e())):S(()=>t(e()))},append:U},Te=class extends L{constructor(e,t){super(e,t,we)}};function Ee(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,fe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:De,Div:G,Svg:Oe,Span:K,Slot:ke,ButtonBuilder:Ae,InputBuilder:je,Style:Me,Label:Ne,Ul:Pe,Li:Fe,Section:Ie,Article:Le,Nav:Re,Header:ze,Footer:Be,Main:Ve,DeclarativeShadow:He}=Ee(Te),q=[!1,`false`,null,void 0],Ue=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!q.includes(n))},We=new Map;function Ge(e,t){f?(We.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ke=typeof document<`u`?HTMLElement:F,qe=`data-ranui`,Je=`data-ranui-sheet`,Ye=(e,t)=>d(e,t,qe),Xe=(e,t)=>ee(e,t,Je),J=new WeakMap,Y=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,X=new Map,Z=e=>{let t=X.get(e);if(t!==void 0)return t;let n=e?`${e}\n${Y}`:Y;return X.set(e,n),n},Ze=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||J.get(e)||e.attachShadow(n);return J.set(e,r),Ye(r,Z(t)),r},Q=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},Qe=(e,t,n=``)=>e.getAttribute(t)??n,$e=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},et=(e,t,n,r={})=>{if(n){e.setAttribute(t,``),r.aria&&e.setAttribute(`aria-${r.aria}`,`true`);return}e.removeAttribute(t),r.aria&&e.removeAttribute(`aria-${r.aria}`)},tt=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Xe(t,a)};function nt(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}function rt(e,t,n){let{disabled:r,required:i,isEmpty:a,message:o=`Please fill out this field.`,anchor:s,ariaTarget:c=e}=n;i?c.setAttribute(`aria-required`,`true`):c.removeAttribute(`aria-required`);let l=!r&&i&&a;l?c.setAttribute(`aria-invalid`,`true`):c.removeAttribute(`aria-invalid`),t&&(l?t.setValidity?.({valueMissing:!0},o,s):t.setValidity?.({}))}function it(e){return e?.checkValidity?.()??!0}function at(e){return e?.reportValidity?.()??!0}var ot=`:host{position:var(--ran-checkbox-host-position,relative);display:var(--ran-checkbox-host-display,inline-flex);margin:var(--ran-checkbox-host-margin,0);padding:var(--ran-checkbox-host-padding,0);box-sizing:var(--ran-checkbox-host-box-sizing,border-box);list-style:var(--ran-checkbox-host-list-style,none)}:host([disabled]){opacity:var(--ran-checkbox-disabled-opacity,.6)}:host([disabled]) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor,not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events,all)}:host([disabled]) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color,var(--ran-color-bg-muted,#f2f2f2));border:1px solid var(--ran-color-border,#eaeaea)}:host([disabled]) .ran-checkbox-inner:after{cursor:not-allowed;pointer-events:none;opacity:var(--ran-checkbox-tick-opacity,0);border-color:var(--ran-checkbox-disabled-tick-color,var(--ran-color-text-disabled,var(--ran-gray-600)))}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color,var(--ran-color-bg-muted,#f2f2f2))}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-tick-checked-opacity,1)}:host([hidden]){display:none}.ran-checkbox-wrapper{align-items:center;gap:var(--ran-checkbox-label-gap,8px);cursor:pointer;line-height:1;display:inline-flex}.ran-checkbox-label{color:var(--ran-checkbox-label-color,var(--ran-color-text,#000000e0));font-size:var(--ran-checkbox-label-font-size,var(--ran-text-label-1,14px));font-weight:var(--ran-checkbox-label-font-weight,var(--ran-text-label-weight,500));font-family:var(--ran-checkbox-label-font-family,var(--ran-skin-font-family,inherit));line-height:var(--ran-checkbox-label-line-height,1.5);-webkit-user-select:none;user-select:none}.ran-checkbox{position:var(--ran-checkbox-position,relative);display:var(--ran-checkbox-display,block);box-sizing:var(--ran-checkbox-box-sizing,border-box);margin:var(--ran-checkbox-margin,0);width:var(--ran-checkbox-width,var(--ran-size-1,16px));height:var(--ran-checkbox-height,var(--ran-size-1,16px));padding:var(--ran-checkbox-padding,0);color:var(--ran-checkbox-color,var(--ran-color-text,#000000e0));font-size:var(--ran-checkbox-font-size,var(--ran-text-label-1,14px));line-height:var(--ran-checkbox-line-height,1);list-style:var(--ran-checkbox-list-style,none);font-family:var(--ran-checkbox-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));white-space:var(--ran-checkbox-white-space,nowrap);cursor:var(--ran-checkbox-cursor,pointer);border-radius:var(--ran-checkbox-border-radius,4px)}.ran-checkbox-input{position:var(--ran-checkbox-input-position,absolute);inset:var(--ran-checkbox-input-inset,0);z-index:var(--ran-checkbox-input-z-index,1);cursor:var(--ran-checkbox-input-cursor,pointer);opacity:var(--ran-checkbox-input-opacity,0);margin:var(--ran-checkbox-input-margin,0)}.ran-checkbox-inner{box-sizing:var(--ran-checkbox-inner-box-sizing,border-box);display:var(--ran-checkbox-inner-display,block);width:var(--ran-checkbox-inner-width,var(--ran-size-1,16px));height:var(--ran-checkbox-inner-height,var(--ran-size-1,16px));direction:var(--ran-checkbox-inner-direction,ltr);background-color:var(--ran-checkbox-inner-background-color,var(--ran-color-bg-elevated,#fff));border:var(--ran-checkbox-inner-border,1px solid var(--ran-color-border,#eaeaea));border-image-source:var(--ran-checkbox-inner-border-image-source,none);border-image-slice:var(--ran-checkbox-inner-border-image-slice,8);border-image-width:var(--ran-checkbox-inner-border-image-width,var(--ran-skin-border-image-width,4px));border-radius:var(--ran-checkbox-inner-border-radius,4px);border-collapse:var(--ran-checkbox-inner-border-collapse,separate);border-image-outset:0;border-image-repeat:stretch}.ran-checkbox-inner:after{box-sizing:var(--ran-checkbox-tick-box-sizing,border-box);position:var(--ran-checkbox-tick-position,absolute);top:var(--ran-checkbox-tick-top,50%);display:var(--ran-checkbox-tick-display,table);width:var(--ran-checkbox-tick-width,calc(16px / 14 * 5));height:var(--ran-checkbox-tick-height,calc(16px / 14 * 8));border:var(--ran-checkbox-tick-border,2px solid #fff);border-top:var(--ran-checkbox-tick-border-top,0);border-inline-start:var(--ran-checkbox-tick-border-inline-start,0);opacity:var(--ran-checkbox-tick-opacity,0);content:var(--ran-checkbox-tick-content,"");transition:var(--ran-checkbox-tick-transition,transform .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s);transform:var(--ran-checkbox-tick-transform,rotate(45deg) scale(1) translate(-50%, -50%));inset-inline-start:var(--ran-checkbox-tick-inset-inline-start,25%)}.ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color,var(--ran-color-primary,#006bff));background-image:var(--ran-checkbox-checked-background-image,none);border:var(--ran-checkbox-checked-border,1px solid var(--ran-color-primary,#006bff));animation:var(--ran-checkbox-pop-animation,ran-checkbox-pop var(--ran-motion-duration-base,.2s) var(--ran-motion-ease-bouncy,cubic-bezier(.34, 1.56, .64, 1)))}.ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-tick-checked-opacity,1)}.ran-checkbox:has(.ran-checkbox-input:focus-visible) .ran-checkbox-inner{box-shadow:var(--ran-checkbox-focus-box-shadow,var(--ran-focus-ring));border-color:var(--ran-checkbox-focus-border-color,var(--ran-color-primary,#171717))}@keyframes ran-checkbox-pop{0%{transform:scale(1)}45%{transform:scale(1.14)}to{transform:scale(1)}}@media (prefers-reduced-motion:reduce){.ran-checkbox-checked .ran-checkbox-inner{animation:none}}`,$=class extends Ke{static formAssociated=!0;_events=new a;_internals;checkInput;checkInner;context;container;_shadowDom;static get observedAttributes(){return[`disabled`,`checked`,`value`,`required`,`sheet`]}_defaultChecked=!1;_defaultCaptured=!1;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=Ze(this,ot);let e=z(),t=z(),n=z(),r=G().class(`ran-checkbox-wrapper`).part(`wrapper`).children(G().class(`ran-checkbox`).ref(e).part(`checkbox`).children(je().class(`ran-checkbox-input`).ref(t).part(`input`).attr(`type`,`checkbox`),K().class(`ran-checkbox-inner`).ref(n).part(`inner`)),K().class(`ran-checkbox-label`).part(`label`).children(ke())).build();this._shadowDom.appendChild(r),this.container=Q(e,`ran checkbox`),this.checkInput=Q(t,`input`),this.checkInner=Q(n,`inner`),this.checkInput.setAttribute(`aria-hidden`,`true`),this.checkInput.tabIndex=-1,this.context={checked:!1}}get disabled(){return Ue(this)}set disabled(e){q.includes(e)?this.removeAttribute(`disabled`):this.setAttribute(`disabled`,``)}get required(){return this.hasAttribute(`required`)}set required(e){et(this,`required`,!(!e||e===`false`))}get value(){let e=this.getAttribute(`value`);return q.includes(e)&&(this.context.checked=!1),`${this.context.checked}`}set value(e){q.includes(e)?(this.setAttribute(`value`,`false`),this.context.checked=!1):(this.setAttribute(`value`,`true`),this.context.checked=!0),this.updateChecked()}get checked(){let e=this.getAttribute(`checked`);return q.includes(e)&&(this.context.checked=!1),this.context.checked}set checked(e){q.includes(e)?(this.setAttribute(`checked`,`false`),this.context.checked=!1):(this.setAttribute(`checked`,`true`),this.context.checked=!0),this.updateChecked()}get sheet(){return Qe(this,`sheet`)}set sheet(e){$e(this,`sheet`,e)}handlerExternalCss=()=>{tt(this,this._shadowDom,`sheet`,null,this.sheet)};updateChecked=()=>{let{checked:e}=this.context;e?(this.setAttribute(`checked`,`true`),this.setAttribute(`value`,`true`),t(this.container,`ran-checkbox-checked`)):(this.setAttribute(`checked`,`false`),this.setAttribute(`value`,`false`),n(this.container,`ran-checkbox-checked`)),this.syncA11yAndForm()};syncA11yAndForm=()=>{let{checked:e}=this.context;this.setAttribute(`role`,`checkbox`),this.setAttribute(`aria-checked`,e?`true`:`false`),this.disabled?(this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1):(this.removeAttribute(`aria-disabled`),(this.tabIndex<0||!this.hasAttribute(`tabindex`))&&(this.tabIndex=0)),this._internals?.setFormValue?.(e?this.getAttribute(`value`)||`true`:null),this._updateValidity()};_updateValidity=()=>{rt(this,this._internals,{disabled:this.disabled,required:this.required,isEmpty:!this.context.checked,message:`Please check this box if you want to proceed.`,anchor:this})};checkValidity(){return it(this._internals)}reportValidity(){return at(this._internals)}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??``}formResetCallback(){this.checked=this._defaultChecked}update=()=>{this.updateChecked()};onChange=()=>{if(this.disabled)return;let{checked:e}=this.context;this.context.checked=!e,this.dispatchEvent(new CustomEvent(`change`,{detail:{checked:this.context.checked}})),this.update()};onKeydown=e=>{nt(e)&&(e.preventDefault(),this.onChange())};connectedCallback(){this.handlerExternalCss(),this._defaultCaptured||=(this._defaultChecked=this.context.checked,!0),this._events.on(this,`click`,this.onChange),this._events.on(this,`keydown`,this.onKeydown),this.syncA11yAndForm()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`checked`&&(this.checked=n,this.value=n),e===`value`&&(this.checked=n,this.value=n),e===`disabled`?this.syncA11yAndForm():e===`required`&&this._updateValidity(),e===`sheet`&&this.handlerExternalCss())}};return Ge(`r-checkbox`,$),e.Checkbox=$,e.default=$,e})({}); \ No newline at end of file +var ranui_checkbox=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},n=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=`data-adopted-style`,c=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},l=(e,t,n=s)=>{if(typeof document<`u`&&t&&!c(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},u=typeof document>`u`,d=0,f=1,p=2,m=null,h=null,g=0,_=new Set,v=!1;function y(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)w(e,p);g===0&&re()}}]}function b(e){let t=ee(e,!0);return te(t),E(t),()=>O(t)}function x(e){let t=m;m=null;try{return e()}finally{m=t}}function S(e){let t={owned:[],cleanups:[],owner:h},n=h,r=m;h=t,m=null;try{return e(()=>ie(t))}finally{h=n,m=r}}function C(e){h&&h.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:p,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:h}}function te(e){h&&h.owned.push(e)}function ne(e){m&&(m.sources.add(e),e.observers.add(m))}function w(e,t){if(e.disposed||e.state>=t)return;let n=e.state===d;if(e.state=t,e.isEffect)_.add(e);else if(n)for(let t of e.observers)w(t,f)}function re(){if(!(g>0||v)){v=!0;try{for(;_.size>0;){let e=[..._];_.clear();for(let t of e)t.disposed||T(t)}}finally{v=!1}}}function T(e){if(!(e.disposed||e.state===d)){if(e.state===f)for(let t of e.sources)`fn`in t&&T(t);e.state===p&&E(e),e.state=d}}function E(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);D(e);let t=m,n=h;m=e,h=e,e.running=!0,e.state=d;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)w(t,p)}}finally{e.running=!1,m=t,h=n}}function D(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function O(e){e.disposed||(e.disposed=!0,D(e),e.observers.clear())}function ie(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function k(e){return i(e)}var ae=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,oe=`.#[`;function se(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var ce=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},A=(e,t)=>{let n=t.trim();if(!n)return!1;let r=se(n);return r!==null&&r.every(t=>ce(e,t))},j=(e,t,n)=>{for(let r of e)ae(r)&&(A(r,t)&&n.push(r),j(r.childrenList,t,n))},M=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}},le=new Map,N=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??le}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new M)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new ue(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${k(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${k(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof M,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},ue=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}serialize(){return``}},P={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){P.append(e,n);continue}if(typeof n==`function`){P.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof F?n.build():typeof n==`string`&&!u?document.createTextNode(n):n;e.appendChild(t)}}},de=`http://www.w3.org/2000/svg`,fe=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),F=class{runtime;el;constructor(e,t,n=P){this.runtime=n;let r=t??(fe.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=u?new N(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{u?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(u){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new pe(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(u)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},pe=class{runtime;root;hostEl;constructor(e,t,n,r=P){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(u)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return u?this.root.serialize():this.root.innerHTML}},I=()=>({current:null}),L=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(L(t)):e.concat(t),[]),R=e=>e==null?null:e instanceof F?e.build():typeof e==`string`?u?e:document.createTextNode(e):e,me=(e,t)=>{if(u){B(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};b(()=>{let e=t();a();let n=document.createDocumentFragment();i=S(t=>(B(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),C(()=>i?.())},he=`__ranFor`,ge=e=>typeof e==`object`&&!!e&&e[he]===!0,_e=(e,t,n)=>{let[r,i]=y(t),a=null,o=S(t=>{let i=R(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},z=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ve=(e,t)=>{if(u){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;C(()=>{for(let e of r.values())e.dispose();r.clear()}),b(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Ce()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=_e(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();z(n,a),r=i})},ye=`__ranIndex`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=y(e),a=null,o=S(e=>{let i=R(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Se=(e,t)=>{if(u){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];C(()=>{for(let e of r)e.dispose();r=[]}),b(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}z(n,r.map(e=>e.node).filter(e=>e!=null))})},B=(e,t)=>{u?x(()=>V(e,t)):V(e,t)},V=(e,t)=>{L(t).forEach(t=>{if(ge(t)){ve(e,t);return}if(be(t)){Se(e,t);return}if(typeof t==`function`){me(e,t);return}let n=R(t);n!=null&&e.appendChild(n)})},Ce=()=>!1,we={bind(e,t){typeof e==`function`?u?x(()=>t(e())):b(()=>t(e())):t(e)},append:B},Te=class extends F{constructor(e,t){super(e,t,we)}};function Ee(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,de),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:De,Div:H,Svg:Oe,Span:U,Slot:ke,ButtonBuilder:Ae,InputBuilder:je,Style:Me,Label:Ne,Ul:Pe,Li:Fe,Section:Ie,Article:Le,Nav:Re,Header:ze,Footer:Be,Main:Ve,DeclarativeShadow:He}=Ee(Te),W=[!1,`false`,null,void 0],Ue=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!(!t||W.includes(n))},We=new Map;function Ge(e,t){u?(We.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ke=typeof document<`u`?HTMLElement:N,qe=`data-ranui`,G=`data-ranui-sheet`,Je=(e,t)=>l(e,t,qe),K=new WeakMap,q=new Map,Ye=e=>{if(typeof CSSStyleSheet>`u`)return;let t=q.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},q.set(e,t)}catch{return}return t.users++,t.sheet},J=e=>{let t=q.get(e);t&&--t.users===0&&q.delete(e)},Xe=(e,t)=>{if(typeof document>`u`)return;let n=K.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),J(n.text)):n&&e.querySelector(`style[${G}]`)?.remove(),K.delete(e),!t))return;let r=Ye(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{J(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(G,``),n.textContent=t,e.appendChild(n)}K.set(e,{text:t,sheet:r})},Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Z=new Map,Ze=e=>{let t=Z.get(e);if(t!==void 0)return t;let n=e?`${e}\n${X}`:X;return Z.set(e,n),n},Qe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Je(r,Ze(t)),r},Q=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},$e=(e,t,n=``)=>e.getAttribute(t)??n,et=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},tt=(e,t,n,r={})=>{n?(e.setAttribute(t,``),r.aria&&e.setAttribute(`aria-${r.aria}`,`true`)):(e.removeAttribute(t),r.aria&&e.removeAttribute(`aria-${r.aria}`))},nt=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Xe(t,e.getAttribute(`sheet`)||``)};function rt(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}function it(e,t,n){let{disabled:r,required:i,isEmpty:a,message:o=`Please fill out this field.`,anchor:s,ariaTarget:c=e}=n;i?c.setAttribute(`aria-required`,`true`):c.removeAttribute(`aria-required`);let l=!r&&i&&a;l?c.setAttribute(`aria-invalid`,`true`):c.removeAttribute(`aria-invalid`),t&&(l?t.setValidity?.({valueMissing:!0},o,s):t.setValidity?.({}))}function at(e){return e?.checkValidity?.()??!0}function ot(e){return e?.reportValidity?.()??!0}var st=`:host{position:var(--ran-checkbox-host-position,relative);display:var(--ran-checkbox-host-display,inline-flex);margin:var(--ran-checkbox-host-margin,0);padding:var(--ran-checkbox-host-padding,0);box-sizing:var(--ran-checkbox-host-box-sizing,border-box);list-style:var(--ran-checkbox-host-list-style,none)}:host([disabled]:not([disabled=false])){opacity:var(--ran-checkbox-disabled-opacity,.6)}:host([disabled]:not([disabled=false])) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor,not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events,all)}:host([disabled]:not([disabled=false])) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color,var(--ran-color-bg-muted,#f2f2f2));border:1px solid var(--ran-color-border,#eaeaea)}:host([disabled]:not([disabled=false])) .ran-checkbox-inner:after{cursor:not-allowed;pointer-events:none;opacity:var(--ran-checkbox-tick-opacity,0);border-color:var(--ran-checkbox-disabled-tick-color,var(--ran-color-text-disabled,var(--ran-gray-600)))}:host([disabled]:not([disabled=false])) .ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color,var(--ran-color-bg-muted,#f2f2f2))}:host([disabled]:not([disabled=false])) .ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-tick-checked-opacity,1)}:host([hidden]){display:none}.ran-checkbox-wrapper{column-gap:var(--ran-checkbox-label-gap,8px);cursor:pointer;max-width:100%;font-size:var(--ran-checkbox-label-font-size,var(--ran-text-label-1,14px));line-height:var(--ran-checkbox-label-line-height,1.5);grid-template-rows:1lh auto;grid-template-columns:auto minmax(0,1fr);display:inline-grid}.ran-checkbox-wrapper>.ran-checkbox{grid-area:1/1;align-self:center}.ran-checkbox-wrapper>.ran-checkbox-label{grid-area:1/2/span 2}.ran-checkbox-label{color:var(--ran-checkbox-label-color,var(--ran-color-text,#000000e0));font-size:var(--ran-checkbox-label-font-size,var(--ran-text-label-1,14px));font-weight:var(--ran-checkbox-label-font-weight,var(--ran-text-label-weight,500));font-family:var(--ran-checkbox-label-font-family,var(--ran-skin-font-family,inherit));line-height:var(--ran-checkbox-label-line-height,1.5);-webkit-user-select:none;user-select:none}.ran-checkbox{position:var(--ran-checkbox-position,relative);display:var(--ran-checkbox-display,block);box-sizing:var(--ran-checkbox-box-sizing,border-box);margin:var(--ran-checkbox-margin,0);width:var(--ran-checkbox-width,var(--ran-size-1,16px));height:var(--ran-checkbox-height,var(--ran-size-1,16px));padding:var(--ran-checkbox-padding,0);color:var(--ran-checkbox-color,var(--ran-color-text,#000000e0));font-size:var(--ran-checkbox-font-size,var(--ran-text-label-1,14px));line-height:var(--ran-checkbox-line-height,1);list-style:var(--ran-checkbox-list-style,none);font-family:var(--ran-checkbox-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));white-space:var(--ran-checkbox-white-space,nowrap);cursor:var(--ran-checkbox-cursor,pointer);border-radius:var(--ran-checkbox-border-radius,4px)}.ran-checkbox-input{position:var(--ran-checkbox-input-position,absolute);inset:var(--ran-checkbox-input-inset,0);z-index:var(--ran-checkbox-input-z-index,1);cursor:var(--ran-checkbox-input-cursor,pointer);opacity:var(--ran-checkbox-input-opacity,0);margin:var(--ran-checkbox-input-margin,0)}.ran-checkbox-inner{box-sizing:var(--ran-checkbox-inner-box-sizing,border-box);display:var(--ran-checkbox-inner-display,block);width:var(--ran-checkbox-inner-width,var(--ran-size-1,16px));height:var(--ran-checkbox-inner-height,var(--ran-size-1,16px));direction:var(--ran-checkbox-inner-direction,ltr);background-color:var(--ran-checkbox-inner-background-color,var(--ran-color-bg-elevated,#fff));border:var(--ran-checkbox-inner-border,1px solid var(--ran-color-border,#eaeaea));border-image-source:var(--ran-checkbox-inner-border-image-source,none);border-image-slice:var(--ran-checkbox-inner-border-image-slice,8);border-image-width:var(--ran-checkbox-inner-border-image-width,var(--ran-skin-border-image-width,4px));border-radius:var(--ran-checkbox-inner-border-radius,4px);border-collapse:var(--ran-checkbox-inner-border-collapse,separate);border-image-outset:0;border-image-repeat:stretch}.ran-checkbox-inner:after{box-sizing:var(--ran-checkbox-tick-box-sizing,border-box);position:var(--ran-checkbox-tick-position,absolute);top:var(--ran-checkbox-tick-top,50%);display:var(--ran-checkbox-tick-display,table);width:var(--ran-checkbox-tick-width,calc(16px / 14 * 5));height:var(--ran-checkbox-tick-height,calc(16px / 14 * 8));border:var(--ran-checkbox-tick-border,2px solid var(--ran-color-primary-text,#fff));border-top:var(--ran-checkbox-tick-border-top,0);border-inline-start:var(--ran-checkbox-tick-border-inline-start,0);opacity:var(--ran-checkbox-tick-opacity,0);content:var(--ran-checkbox-tick-content,"");transition:var(--ran-checkbox-tick-transition,transform .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s);transform:var(--ran-checkbox-tick-transform,rotate(45deg) scale(1) translate(-50%, -50%));inset-inline-start:var(--ran-checkbox-tick-inset-inline-start,25%)}.ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color,var(--ran-color-primary,#006bff));background-image:var(--ran-checkbox-checked-background-image,none);border:var(--ran-checkbox-checked-border,1px solid var(--ran-color-primary,#006bff));animation:var(--ran-checkbox-pop-animation,ran-checkbox-pop var(--ran-motion-duration-base,.2s) var(--ran-motion-ease-bouncy,cubic-bezier(.34, 1.56, .64, 1)))}.ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-tick-checked-opacity,1)}.ran-checkbox:has(.ran-checkbox-input:focus-visible) .ran-checkbox-inner{box-shadow:var(--ran-checkbox-focus-box-shadow,var(--ran-focus-ring));border-color:var(--ran-checkbox-focus-border-color,var(--ran-color-primary,#171717))}@keyframes ran-checkbox-pop{0%{transform:scale(1)}45%{transform:scale(1.14)}to{transform:scale(1)}}@media (prefers-reduced-motion:reduce){.ran-checkbox-checked .ran-checkbox-inner{animation:none}}`,$=class extends Ke{static formAssociated=!0;_events=new a;_internals;checkInput;checkInner;context;container;_shadowDom;static get observedAttributes(){return[`disabled`,`checked`,`value`,`required`,`sheet`]}_defaultChecked=!1;_defaultCaptured=!1;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=Qe(this,st);let e=I(),t=I(),n=I(),r=H().class(`ran-checkbox-wrapper`).part(`wrapper`).children(H().class(`ran-checkbox`).ref(e).part(`checkbox`).children(je().class(`ran-checkbox-input`).ref(t).part(`input`).attr(`type`,`checkbox`),U().class(`ran-checkbox-inner`).ref(n).part(`inner`)),U().class(`ran-checkbox-label`).part(`label`).children(ke())).build();this._shadowDom.appendChild(r),this.container=Q(e,`ran checkbox`),this.checkInput=Q(t,`input`),this.checkInner=Q(n,`inner`),this.checkInput.setAttribute(`aria-hidden`,`true`),this.checkInput.tabIndex=-1,this.context={checked:!1}}get disabled(){return Ue(this)}set disabled(e){W.includes(e)?this.removeAttribute(`disabled`):this.setAttribute(`disabled`,``)}get required(){return this.hasAttribute(`required`)}set required(e){tt(this,`required`,!(!e||e===`false`))}get value(){let e=this.getAttribute(`value`);return W.includes(e)&&(this.context.checked=!1),`${this.context.checked}`}set value(e){W.includes(e)?(this.setAttribute(`value`,`false`),this.context.checked=!1):(this.setAttribute(`value`,`true`),this.context.checked=!0),this.updateChecked()}get checked(){let e=this.getAttribute(`checked`);return W.includes(e)&&(this.context.checked=!1),this.context.checked}set checked(e){W.includes(e)?(this.setAttribute(`checked`,`false`),this.context.checked=!1):(this.setAttribute(`checked`,`true`),this.context.checked=!0),this.updateChecked()}get sheet(){return $e(this,`sheet`)}set sheet(e){et(this,`sheet`,e)}handlerExternalCss=()=>{nt(this,this._shadowDom,`sheet`,null,this.sheet)};updateChecked=()=>{let{checked:e}=this.context;e?(this.setAttribute(`checked`,`true`),this.setAttribute(`value`,`true`),t(this.container,`ran-checkbox-checked`)):(this.setAttribute(`checked`,`false`),this.setAttribute(`value`,`false`),n(this.container,`ran-checkbox-checked`)),this.syncA11yAndForm()};syncA11yAndForm=()=>{let{checked:e}=this.context;this.setAttribute(`role`,`checkbox`),this.setAttribute(`aria-checked`,e?`true`:`false`),this.disabled?(this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1):(this.removeAttribute(`aria-disabled`),(this.tabIndex<0||!this.hasAttribute(`tabindex`))&&(this.tabIndex=0)),this._internals?.setFormValue?.(e?this.getAttribute(`value`)||`true`:null),this._updateValidity()};_updateValidity=()=>{it(this,this._internals,{disabled:this.disabled,required:this.required,isEmpty:!this.context.checked,message:`Please check this box if you want to proceed.`,anchor:this})};checkValidity(){return at(this._internals)}reportValidity(){return ot(this._internals)}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??``}formResetCallback(){this.checked=this._defaultChecked}update=()=>{this.updateChecked()};onChange=()=>{if(this.disabled)return;let{checked:e}=this.context;this.context.checked=!e,this.dispatchEvent(new CustomEvent(`change`,{detail:{checked:this.context.checked}})),this.update()};onKeydown=e=>{rt(e)&&(e.preventDefault(),this.onChange())};connectedCallback(){this.handlerExternalCss(),this._defaultCaptured||=(this._defaultChecked=this.context.checked,!0),this._events.on(this,`click`,this.onChange),this._events.on(this,`keydown`,this.onKeydown),this.syncA11yAndForm()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&n===`false`?this.removeAttribute(`disabled`):(e===`checked`&&(this.checked=n,this.value=n),e===`value`&&(this.checked=n,this.value=n),e===`disabled`?this.syncA11yAndForm():e===`required`&&this._updateValidity(),e===`sheet`&&this.handlerExternalCss()))}};return Ge(`r-checkbox`,$),e.Checkbox=$,e.default=$,e})({}); \ No newline at end of file diff --git a/public/ranui-iife/content.iife.js b/public/ranui-iife/content.iife.js index 8be5c30d4..351a54f0c 100644 --- a/public/ranui-iife/content.iife.js +++ b/public/ranui-iife/content.iife.js @@ -1 +1 @@ -var ranui_content=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{visibility:hidden;position:absolute}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},c=(e,t,n=o)=>{if(!(typeof document>`u`)&&t&&!s(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)S(e,d);m===0&&C()}}]}function v(e){let t=ee(e,!0);return te(t),T(t),()=>D(t)}function y(e){let t=f;f=null;try{return e()}finally{f=t}}function b(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>O(t))}finally{p=n,f=r}}function x(e){p&&p.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function te(e){p&&p.owned.push(e)}function ne(e){f&&(f.sources.add(e),e.observers.add(f))}function S(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)S(t,u)}function C(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||w(t)}}finally{g=!1}}}function w(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&w(t);e.state===d&&T(e),e.state=l}}function T(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)S(t,d)}}finally{e.running=!1,f=t,p=n}}function E(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function O(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function k(e){return i(e)}var A=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,j=`.#[`;function M(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var re=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ie=(e,t)=>{let n=t.trim();if(!n)return!1;let r=M(n);return r!==null&&r.every(t=>re(e,t))},N=(e,t,n)=>{for(let r of e)A(r)&&(ie(r,t)&&n.push(r),N(r.childrenList,t,n))},P=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}},ae=new Map,F=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ae}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new P)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new oe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${k(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${k(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof P,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},oe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}serialize(){return``}},I={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){I.append(e,r);continue}if(typeof r==`function`){I.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof z?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},L=`http://www.w3.org/2000/svg`,R=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),z=class{runtime;el;constructor(e,t,r=I){this.runtime=r;let i=t??(R.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new F(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new B(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},B=class{runtime;root;hostEl;constructor(e,t,n,r=I){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},V=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(V(t)):e.concat(t),[]),H=e=>e==null?null:e instanceof z?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,U=(e,t)=>{if(n){J(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();o();let n=document.createDocumentFragment();a=b(t=>(J(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),x(()=>a?.())},W=`__ranFor`,G=e=>typeof e==`object`&&!!e&&e[W]===!0,K=(e,t,n)=>{let[r,i]=_(t),a=null,o=b(t=>{let i=H(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},q=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=H(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;x(()=>{for(let e of i.values())e.dispose();i.clear()}),v(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){fe()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=K(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();q(r,a),i=n})},ce=`__ranIndex`,le=e=>typeof e==`object`&&!!e&&e[ce]===!0,ue=(e,t,n)=>{let[r,i]=_(e),a=null,o=b(e=>{let i=H(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},de=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=H(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];x(()=>{for(let e of i)e.dispose();i=[]}),v(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}q(r,i.map(e=>e.node).filter(e=>e!=null))})},J=(e,t)=>{n?y(()=>Y(e,t)):Y(e,t)},Y=(e,t)=>{V(t).forEach(t=>{if(G(t)){se(e,t);return}if(le(t)){de(e,t);return}if(typeof t==`function`){U(e,t);return}let n=H(t);n!=null&&e.appendChild(n)})},fe=()=>!1,pe={bind(e,t){if(typeof e!=`function`){t(e);return}n?y(()=>t(e())):v(()=>t(e()))},append:J},me=class extends z{constructor(e,t){super(e,t,pe)}};function he(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,L),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:ge,Div:_e,Svg:ve,Span:ye,Slot:be,ButtonBuilder:xe,InputBuilder:Se,Style:Ce,Label:we,Ul:Te,Li:Ee,Section:De,Article:Oe,Nav:ke,Header:Ae,Footer:je,Main:Me,DeclarativeShadow:Ne}=he(me),Pe=new Map;function Fe(e,t){n?(Pe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ie=typeof document<`u`?HTMLElement:F,Le=`data-ranui`,Re=(e,t)=>c(e,t,Le),X=new WeakMap,Z=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Q=new Map,ze=e=>{let t=Q.get(e);if(t!==void 0)return t;let n=e?`${e}\n${Z}`:Z;return Q.set(e,n),n},Be=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||X.get(e)||e.attachShadow(n);return X.set(e,r),Re(r,ze(t)),r},$=class extends Ie{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=Be(this,t);let e=be().class(`slot`).build();this._shadowDom.appendChild(e),this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{for(let t of e)(t.type===`childList`||t.type===`attributes`)&&this.onChange(t)};onChange=e=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{type:e.type,value:{content:this.children,mutation:e}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}};return Fe(`r-content`,$),e.Content=$,e.default=$,e})({}); \ No newline at end of file +var ranui_content=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{visibility:hidden;position:absolute}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},c=(e,t,n=o)=>{if(typeof document<`u`&&t&&!s(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)S(e,d);m===0&&C()}}]}function v(e){let t=ee(e,!0);return te(t),T(t),()=>D(t)}function y(e){let t=f;f=null;try{return e()}finally{f=t}}function b(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>O(t))}finally{p=n,f=r}}function x(e){p&&p.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function te(e){p&&p.owned.push(e)}function ne(e){f&&(f.sources.add(e),e.observers.add(f))}function S(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)S(t,u)}function C(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||w(t)}}finally{g=!1}}}function w(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&w(t);e.state===d&&T(e),e.state=l}}function T(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)S(t,d)}}finally{e.running=!1,f=t,p=n}}function E(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function O(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function k(e){return i(e)}var A=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,j=`.#[`;function M(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var re=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ie=(e,t)=>{let n=t.trim();if(!n)return!1;let r=M(n);return r!==null&&r.every(t=>re(e,t))},N=(e,t,n)=>{for(let r of e)A(r)&&(ie(r,t)&&n.push(r),N(r.childrenList,t,n))},P=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}},ae=new Map,F=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ae}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new P)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new oe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${k(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${k(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof P,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}`}},oe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}serialize(){return``}},I={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){I.append(e,r);continue}if(typeof r==`function`){I.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof z?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},L=`http://www.w3.org/2000/svg`,R=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),z=class{runtime;el;constructor(e,t,r=I){this.runtime=r;let i=t??(R.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new F(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new B(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},B=class{runtime;root;hostEl;constructor(e,t,n,r=I){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},V=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(V(t)):e.concat(t),[]),H=e=>e==null?null:e instanceof z?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,U=(e,t)=>{if(n){J(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();o();let n=document.createDocumentFragment();a=b(t=>(J(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),x(()=>a?.())},W=`__ranFor`,G=e=>typeof e==`object`&&!!e&&e[W]===!0,K=(e,t,n)=>{let[r,i]=_(t),a=null,o=b(t=>{let i=H(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},q=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=H(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;x(()=>{for(let e of i.values())e.dispose();i.clear()}),v(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){fe()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=K(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();q(r,a),i=n})},ce=`__ranIndex`,le=e=>typeof e==`object`&&!!e&&e[ce]===!0,ue=(e,t,n)=>{let[r,i]=_(e),a=null,o=b(e=>{let i=H(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},de=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=H(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];x(()=>{for(let e of i)e.dispose();i=[]}),v(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}q(r,i.map(e=>e.node).filter(e=>e!=null))})},J=(e,t)=>{n?y(()=>Y(e,t)):Y(e,t)},Y=(e,t)=>{V(t).forEach(t=>{if(G(t)){se(e,t);return}if(le(t)){de(e,t);return}if(typeof t==`function`){U(e,t);return}let n=H(t);n!=null&&e.appendChild(n)})},fe=()=>!1,pe={bind(e,t){typeof e==`function`?n?y(()=>t(e())):v(()=>t(e())):t(e)},append:J},me=class extends z{constructor(e,t){super(e,t,pe)}};function he(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,L),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:ge,Div:_e,Svg:ve,Span:ye,Slot:be,ButtonBuilder:xe,InputBuilder:Se,Style:Ce,Label:we,Ul:Te,Li:Ee,Section:De,Article:Oe,Nav:ke,Header:Ae,Footer:je,Main:Me,DeclarativeShadow:Ne}=he(me),Pe=new Map;function Fe(e,t){n?(Pe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ie=typeof document<`u`?HTMLElement:F,Le=`data-ranui`,Re=(e,t)=>c(e,t,Le),X=new WeakMap,Z=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Q=new Map,ze=e=>{let t=Q.get(e);if(t!==void 0)return t;let n=e?`${e}\n${Z}`:Z;return Q.set(e,n),n},Be=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||X.get(e)||e.attachShadow(n);return X.set(e,r),Re(r,ze(t)),r},$=class extends Ie{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=Be(this,t);let e=be().class(`slot`).build();this._shadowDom.appendChild(e),this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{let t=e.filter(e=>e.type===`childList`||e.type===`attributes`);if(!t.length)return;let n=t[t.length-1];this.dispatchEvent(new CustomEvent(`change`,{detail:{type:t.some(e=>e.type===`childList`)?`childList`:`attributes`,value:{content:this.children,mutation:n,mutations:t}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}};return Fe(`r-content`,$),e.Content=$,e.default=$,e})({}); \ No newline at end of file diff --git a/public/ranui-iife/input.iife.js b/public/ranui-iife/input.iife.js index ac95cd1f6..ba73a23d3 100644 --- a/public/ranui-iife/input.iife.js +++ b/public/ranui-iife/input.iife.js @@ -1,38 +1,38 @@ -var ranui_input=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i=typeof document>`u`,a=/["'&<>]/;function o(e){let t=``+e,n=a.exec(t);if(!n)return t;let r,i=``,o=0,s=0;for(o=n.index;o{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},ee=new Map,te=new Map,ne=`data-adopted-style`,re=`data-adopted-sheet`,c=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},ie=(e,t,n=ne)=>{if(!(typeof document>`u`)&&t&&!c(e,t,ee)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},ae=(e,t,n=re)=>{if(!(typeof document>`u`)&&t&&!c(e,t,te)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ce(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)S(e,d);m===0&&le()}}]}function v(e){let t=oe(e,!0);return se(t),w(t),()=>E(t)}function y(e){let t=f;f=null;try{return e()}finally{f=t}}function b(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>ue(t))}finally{p=n,f=r}}function x(e){p&&p.cleanups.push(e)}function oe(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function se(e){p&&p.owned.push(e)}function ce(e){f&&(f.sources.add(e),e.observers.add(f))}function S(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)S(t,u)}function le(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||C(t)}}finally{g=!1}}}function C(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&C(t);e.state===d&&w(e),e.state=l}}function w(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);T(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)S(t,d)}}finally{e.running=!1,f=t,p=n}}function T(e){for(let t of e.owned)E(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function E(e){e.disposed||(e.disposed=!0,T(e),e.observers.clear())}function ue(e){for(let t of e.owned)E(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function D(e){return o(e)}var de=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,fe=`.#[`;function pe(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var me=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},he=(e,t)=>{let n=t.trim();if(!n)return!1;let r=pe(n);return r!==null&&r.every(t=>me(e,t))},O=(e,t,n)=>{for(let r of e)de(r)&&(he(r,t)&&n.push(r),O(r.childrenList,t,n))},k=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?o(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},ge=new Map,A=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ge}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:o(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new k)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new _e(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${D(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${D(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?o(e):(e instanceof k,e.serialize())).join(``):a+=o(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}`}},_e=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return``}},j={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){j.append(e,n);continue}if(typeof n==`function`){j.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof M?n.build():typeof n==`string`&&!i?document.createTextNode(n):n;e.appendChild(t)}}},ve=`http://www.w3.org/2000/svg`,ye=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),M=class{runtime;el;constructor(e,t,n=j){this.runtime=n;let r=t??(ye.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=i?new A(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{i?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(i){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new be(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(i)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},be=class{runtime;root;hostEl;constructor(e,t,n,r=j){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(i)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return i?this.root.serialize():this.root.innerHTML}},xe=()=>({current:null}),N=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(N(t)):e.concat(t),[]),P=e=>e==null?null:e instanceof M?e.build():typeof e==`string`?i?e:document.createTextNode(e):e,Se=(e,t)=>{if(i){I(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let a=null,o=()=>{a?.(),a=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();o();let n=document.createDocumentFragment();a=b(t=>(I(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),x(()=>a?.())},Ce=`__ranFor`,we=e=>typeof e==`object`&&!!e&&e[Ce]===!0,Te=(e,t,n)=>{let[r,i]=_(t),a=null,o=b(t=>{let i=P(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},F=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},Ee=(e,t)=>{if(i){(t.each()??[]).forEach((n,r)=>{let i=P(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;x(()=>{for(let e of r.values())e.dispose();r.clear()}),v(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){je()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=Te(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();F(n,a),r=i})},De=`__ranIndex`,Oe=e=>typeof e==`object`&&!!e&&e[De]===!0,ke=(e,t,n)=>{let[r,i]=_(e),a=null,o=b(e=>{let i=P(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ae=(e,t)=>{if(i){(t.each()??[]).forEach((n,r)=>{let i=P(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];x(()=>{for(let e of r)e.dispose();r=[]}),v(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}F(n,r.map(e=>e.node).filter(e=>e!=null))})},I=(e,t)=>{i?y(()=>L(e,t)):L(e,t)},L=(e,t)=>{N(t).forEach(t=>{if(we(t)){Ee(e,t);return}if(Oe(t)){Ae(e,t);return}if(typeof t==`function`){Se(e,t);return}let n=P(t);n!=null&&e.appendChild(n)})},je=()=>!1,Me={bind(e,t){if(typeof e!=`function`){t(e);return}i?y(()=>t(e())):v(()=>t(e()))},append:I},Ne=class extends M{constructor(e,t){super(e,t,Me)}};function Pe(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,ve),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:R,Div:z,Svg:Fe,Span:Ie,Slot:Le,ButtonBuilder:Re,InputBuilder:ze,Style:Be,Label:Ve,Ul:He,Li:Ue,Section:We,Article:Ge,Nav:Ke,Header:qe,Footer:Je,Main:Ye,DeclarativeShadow:Xe}=Pe(Ne),B=[!1,`false`,null,void 0],V=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!B.includes(n))},Ze=new Map;function H(e,t){i?(Ze.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var U=typeof document<`u`?HTMLElement:A,Qe=`data-ranui`,$e=`data-ranui-sheet`,et=(e,t)=>ie(e,t,Qe),tt=(e,t)=>ae(e,t,$e),W=new WeakMap,G=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,K=new Map,nt=e=>{let t=K.get(e);if(t!==void 0)return t;let n=e?`${e}\n${G}`:G;return K.set(e,n),n},q=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||W.get(e)||e.attachShadow(n);return W.set(e,r),et(r,nt(t)),r},rt=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},J=(e,t,n=``)=>e.getAttribute(t)??n,Y=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},it=(e,t,n,r={})=>{if(n){e.setAttribute(t,``),r.aria&&e.setAttribute(`aria-${r.aria}`,`true`);return}e.removeAttribute(t),r.aria&&e.removeAttribute(`aria-${r.aria}`)},X=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&tt(t,a)};function at(e){return e?.checkValidity?.()??!0}function ot(e){return e?.reportValidity?.()??!0}var st=`:host{display:var(--ran-icon-host-display,inline-flex)}:host([spin]){animation-name:var(--ran-icon-host-spin-animation,rotate);animation-duration:var(--ran-icon-host-spin-animation,1.4s);animation-timing-function:linear;animation-iteration-count:var(--ran-icon-host-spin-animation,infinite)}.ran-icon{display:var(--ran-icon-display,flex);align-items:var(--ran-icon-align-items,center);justify-content:var(--ran-icon-justify-content,center);color:var(--ran-icon-color,inherit);font-size:var(--ran-icon-font-size,1em);margin:var(--ran-icon-margin,0)}.ran-icon svg{width:var(--ran-icon-svg-width,1em);height:var(--ran-icon-svg-height,1em);fill:var(--ran-icon-svg-fill,currentColor);stroke:var(--ran-icon-svg-stroke,currentColor)}@keyframes rotate{to{transform:var(--ran-icon-host-spin-transform,rotate(360deg))}}`,ct=r({default:()=>Z}),Z,lt=n((()=>{Z=`()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i=typeof document>`u`,a=/["'&<>]/;function o(e){let t=``+e,n=a.exec(t);if(!n)return t;let r,i=``,o=0,s=0;for(o=n.index;o{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},ee=new Map,te=`data-adopted-style`,ne=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},re=(e,t,n=te)=>{if(typeof document<`u`&&t&&!ne(e,t,ee)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},c=0,l=1,u=2,d=null,f=null,p=0,m=new Set,h=!1;function g(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(oe(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)x(e,u);p===0&&se()}}]}function _(e){let t=ie(e,!0);return ae(t),le(t),()=>S(t)}function v(e){let t=d;d=null;try{return e()}finally{d=t}}function y(e){let t={owned:[],cleanups:[],owner:f},n=f,r=d;f=t,d=null;try{return e(()=>de(t))}finally{f=n,d=r}}function b(e){f&&f.cleanups.push(e)}function ie(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:u,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:f}}function ae(e){f&&f.owned.push(e)}function oe(e){d&&(d.sources.add(e),e.observers.add(d))}function x(e,t){if(e.disposed||e.state>=t)return;let n=e.state===c;if(e.state=t,e.isEffect)m.add(e);else if(n)for(let t of e.observers)x(t,l)}function se(){if(!(p>0||h)){h=!0;try{for(;m.size>0;){let e=[...m];m.clear();for(let t of e)t.disposed||ce(t)}}finally{h=!1}}}function ce(e){if(!(e.disposed||e.state===c)){if(e.state===l)for(let t of e.sources)`fn`in t&&ce(t);e.state===u&&le(e),e.state=c}}function le(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);ue(e);let t=d,n=f;d=e,f=e,e.running=!0,e.state=c;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)x(t,u)}}finally{e.running=!1,d=t,f=n}}function ue(e){for(let t of e.owned)S(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function S(e){e.disposed||(e.disposed=!0,ue(e),e.observers.clear())}function de(e){for(let t of e.owned)S(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function C(e){return o(e)}var fe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,pe=`.#[`;function me(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var he=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ge=(e,t)=>{let n=t.trim();if(!n)return!1;let r=me(n);return r!==null&&r.every(t=>he(e,t))},w=(e,t,n)=>{for(let r of e)fe(r)&&(ge(r,t)&&n.push(r),w(r.childrenList,t,n))},T=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?o(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return w(this.childrenList,e,t),t}},_e=new Map,E=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??_e}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:o(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new T)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new ve(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return w(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${C(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${C(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?o(e):(e instanceof T,e.serialize())).join(``):a+=o(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}`}},ve=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return w(this.childrenList,e,t),t}serialize(){return``}},D={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){D.append(e,n);continue}if(typeof n==`function`){D.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof O?n.build():typeof n==`string`&&!i?document.createTextNode(n):n;e.appendChild(t)}}},ye=`http://www.w3.org/2000/svg`,be=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),O=class{runtime;el;constructor(e,t,n=D){this.runtime=n;let r=t??(be.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=i?new E(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{i?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(i){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new xe(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(i)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},xe=class{runtime;root;hostEl;constructor(e,t,n,r=D){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(i)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return i?this.root.serialize():this.root.innerHTML}},Se=()=>({current:null}),Ce=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(Ce(t)):e.concat(t),[]),k=e=>e==null?null:e instanceof O?e.build():typeof e==`string`?i?e:document.createTextNode(e):e,we=(e,t)=>{if(i){A(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let a=null,o=()=>{a?.(),a=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};_(()=>{let e=t();o();let n=document.createDocumentFragment();a=y(t=>(A(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),b(()=>a?.())},Te=`__ranFor`,Ee=e=>typeof e==`object`&&!!e&&e[Te]===!0,De=(e,t,n)=>{let[r,i]=g(t),a=null,o=y(t=>{let i=k(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},Oe=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ke=(e,t)=>{if(i){(t.each()??[]).forEach((n,r)=>{let i=k(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;b(()=>{for(let e of r.values())e.dispose();r.clear()}),_(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Pe()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=De(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();Oe(n,a),r=i})},Ae=`__ranIndex`,je=e=>typeof e==`object`&&!!e&&e[Ae]===!0,Me=(e,t,n)=>{let[r,i]=g(e),a=null,o=y(e=>{let i=k(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ne=(e,t)=>{if(i){(t.each()??[]).forEach((n,r)=>{let i=k(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];b(()=>{for(let e of r)e.dispose();r=[]}),_(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}Oe(n,r.map(e=>e.node).filter(e=>e!=null))})},A=(e,t)=>{i?v(()=>j(e,t)):j(e,t)},j=(e,t)=>{Ce(t).forEach(t=>{if(Ee(t)){ke(e,t);return}if(je(t)){Ne(e,t);return}if(typeof t==`function`){we(e,t);return}let n=k(t);n!=null&&e.appendChild(n)})},Pe=()=>!1,Fe={bind(e,t){typeof e==`function`?i?v(()=>t(e())):_(()=>t(e())):t(e)},append:A},Ie=class extends O{constructor(e,t){super(e,t,Fe)}};function Le(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,ye),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:M,Div:N,Svg:Re,Span:ze,Slot:Be,ButtonBuilder:Ve,InputBuilder:He,Style:Ue,Label:We,Ul:Ge,Li:Ke,Section:qe,Article:Je,Nav:Ye,Header:Xe,Footer:Ze,Main:Qe,DeclarativeShadow:$e}=Le(Ie),P=[!1,`false`,null,void 0],F=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!(!t||P.includes(n))},et=new Map;function I(e,t){i?(et.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var L=typeof document<`u`?HTMLElement:E,tt=`data-ranui`,R=`data-ranui-sheet`,nt=(e,t)=>re(e,t,tt),z=new WeakMap,B=new Map,rt=e=>{if(typeof CSSStyleSheet>`u`)return;let t=B.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},B.set(e,t)}catch{return}return t.users++,t.sheet},V=e=>{let t=B.get(e);t&&--t.users===0&&B.delete(e)},it=(e,t)=>{if(typeof document>`u`)return;let n=z.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),V(n.text)):n&&e.querySelector(`style[${R}]`)?.remove(),z.delete(e),!t))return;let r=rt(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{V(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(R,``),n.textContent=t,e.appendChild(n)}z.set(e,{text:t,sheet:r})},H=new WeakMap,U=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,W=new Map,at=e=>{let t=W.get(e);if(t!==void 0)return t;let n=e?`${e}\n${U}`:U;return W.set(e,n),n},G=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||H.get(e)||e.attachShadow(n);return H.set(e,r),nt(r,at(t)),r},ot=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},K=(e,t,n=``)=>e.getAttribute(t)??n,q=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},st=(e,t,n,r={})=>{n?(e.setAttribute(t,``),r.aria&&e.setAttribute(`aria-${r.aria}`,`true`)):(e.removeAttribute(t),r.aria&&e.removeAttribute(`aria-${r.aria}`))},J=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&it(t,e.getAttribute(`sheet`)||``)};function ct(e){return e?.checkValidity?.()??!0}function lt(e){return e?.reportValidity?.()??!0}var ut=`:host{display:var(--ran-icon-host-display,inline-flex)}:host([spin]){animation-name:var(--ran-icon-host-spin-animation,rotate);animation-duration:var(--ran-icon-host-spin-animation,1.4s);animation-timing-function:linear;animation-iteration-count:var(--ran-icon-host-spin-animation,infinite)}.ran-icon{display:var(--ran-icon-display,flex);align-items:var(--ran-icon-align-items,center);justify-content:var(--ran-icon-justify-content,center);color:var(--ran-icon-color,inherit);font-size:var(--ran-icon-font-size,1em);margin:var(--ran-icon-margin,0)}.ran-icon svg{width:var(--ran-icon-svg-width,1em);height:var(--ran-icon-svg-height,1em);fill:var(--ran-icon-svg-fill,currentColor);stroke:var(--ran-icon-svg-stroke,currentColor)}@keyframes rotate{to{transform:var(--ran-icon-host-spin-transform,rotate(360deg))}}`,dt=r({default:()=>Y}),Y,ft=n((()=>{Y=` -`})),ut=r({default:()=>dt}),dt,ft=n((()=>{dt=``})),pt=r({default:()=>X}),X,mt=n((()=>{X=` -`})),pt=r({default:()=>mt}),mt,ht=n((()=>{mt=``})),gt=r({default:()=>_t}),_t,vt=n((()=>{_t=` -`})),yt=r({default:()=>bt}),bt,xt=n((()=>{bt=``})),St=r({default:()=>Ct}),Ct,wt=n((()=>{Ct=``})),Tt=r({default:()=>Et}),Et,Dt=n((()=>{Et=``})),Ot=r({default:()=>kt}),kt,At=n((()=>{kt=` -`})),jt=r({default:()=>Mt}),Mt,Nt=n((()=>{Mt=``})),Pt=r({default:()=>Ft}),Ft,It=n((()=>{Ft=``})),Lt=r({default:()=>Rt}),Rt,zt=n((()=>{Rt=``})),Bt=r({default:()=>Vt}),Vt,Ht=n((()=>{Vt=``})),Ut=r({default:()=>Wt}),Wt,Gt=n((()=>{Wt=``})),Kt=r({default:()=>qt}),qt,Jt=n((()=>{qt=` +`})),ht=r({default:()=>gt}),gt,_t=n((()=>{gt=``})),vt=r({default:()=>yt}),yt,bt=n((()=>{yt=` +`})),xt=r({default:()=>St}),St,Ct=n((()=>{St=``})),wt=r({default:()=>Tt}),Tt,Et=n((()=>{Tt=``})),Dt=r({default:()=>Ot}),Ot,kt=n((()=>{Ot=``})),At=r({default:()=>jt}),jt,Mt=n((()=>{jt=` +`})),Nt=r({default:()=>Pt}),Pt,Ft=n((()=>{Pt=``})),It=r({default:()=>Lt}),Lt,Rt=n((()=>{Lt=``})),zt=r({default:()=>Bt}),Bt,Vt=n((()=>{Bt=``})),Ht=r({default:()=>Ut}),Ut,Wt=n((()=>{Ut=``})),Gt=r({default:()=>Kt}),Kt,qt=n((()=>{Kt=``})),Jt=r({default:()=>Yt}),Yt,Xt=n((()=>{Yt=` -`})),Yt=r({default:()=>Xt}),Xt,Zt=n((()=>{Xt=` +`})),Zt=r({default:()=>Qt}),Qt,$t=n((()=>{Qt=` -`})),Qt=r({default:()=>$t}),$t,en=n((()=>{$t=` +`})),en=r({default:()=>tn}),tn,nn=n((()=>{tn=` -`})),tn=r({default:()=>nn}),nn,rn=n((()=>{nn=``})),an=r({default:()=>on}),on,sn=n((()=>{on=` -`})),cn=r({default:()=>ln}),ln,un=n((()=>{ln=` +`})),rn=r({default:()=>an}),an,on=n((()=>{an=``})),sn=r({default:()=>cn}),cn,ln=n((()=>{cn=` +`})),un=r({default:()=>dn}),dn,fn=n((()=>{dn=` -`})),dn=r({default:()=>fn}),fn,pn=n((()=>{fn=``})),mn=r({default:()=>hn}),hn,gn=n((()=>{hn=``})),_n=r({default:()=>vn}),vn,yn=n((()=>{vn=` +`})),pn=r({default:()=>mn}),mn,hn=n((()=>{mn=``})),gn=r({default:()=>_n}),_n,vn=n((()=>{_n=``})),yn=r({default:()=>bn}),bn,xn=n((()=>{bn=` -`})),bn=r({default:()=>xn}),xn,Sn=n((()=>{xn=` -`})),Cn=r({default:()=>wn}),wn,Tn=n((()=>{wn=` `})),Sn=r({default:()=>Cn}),Cn,wn=n((()=>{Cn=` +`})),Tn=r({default:()=>En}),En,Dn=n((()=>{En=` -`})),En=r({default:()=>Dn}),Dn,On=n((()=>{Dn=``})),kn=r({default:()=>An}),An,jn=n((()=>{An=` +`})),On=r({default:()=>kn}),kn,An=n((()=>{kn=``})),jn=r({default:()=>Mn}),Mn,Nn=n((()=>{Mn=` -`})),Mn=r({default:()=>Nn}),Nn,Pn=n((()=>{Nn=` -`})),Fn=r({default:()=>In}),In,Ln=n((()=>{In=``})),Rn=r({default:()=>zn}),zn,Bn=n((()=>{zn=` -`})),Vn=r({default:()=>Hn}),Hn,Un=n((()=>{Hn=` -`})),Wn=r({default:()=>Gn}),Gn,Kn=n((()=>{Gn=` -`})),qn=r({default:()=>Jn}),Jn,Yn=n((()=>{Jn=` -`})),Xn=r({default:()=>Zn}),Zn,Qn=n((()=>{Zn=` -`})),$n=r({default:()=>er}),er,tr=n((()=>{er=` -`})),nr=r({default:()=>rr}),rr,ir=n((()=>{rr=` -`})),ar=r({default:()=>or}),or,sr=n((()=>{or=` -`})),cr=r({default:()=>lr}),lr,ur=n((()=>{lr=``})),dr=r({default:()=>fr}),fr,pr=n((()=>{fr=``})),mr=r({default:()=>hr}),hr,gr=n((()=>{hr=``})),_r=r({default:()=>vr}),vr,yr=n((()=>{vr=` -`})),br=r({default:()=>xr}),xr,Sr=n((()=>{xr=``})),Cr=r({default:()=>wr}),wr,Tr=n((()=>{wr=``})),Pn=r({default:()=>Fn}),Fn,In=n((()=>{Fn=` +`})),Ln=r({default:()=>Rn}),Rn,zn=n((()=>{Rn=``})),Bn=r({default:()=>Vn}),Vn,Hn=n((()=>{Vn=` +`})),Un=r({default:()=>Wn}),Wn,Gn=n((()=>{Wn=` +`})),Kn=r({default:()=>qn}),qn,Jn=n((()=>{qn=` +`})),Yn=r({default:()=>Xn}),Xn,Zn=n((()=>{Xn=` +`})),Qn=r({default:()=>$n}),$n,er=n((()=>{$n=` +`})),tr=r({default:()=>nr}),nr,rr=n((()=>{nr=` +`})),ir=r({default:()=>ar}),ar,or=n((()=>{ar=` +`})),sr=r({default:()=>cr}),cr,lr=n((()=>{cr=` +`})),ur=r({default:()=>dr}),dr,fr=n((()=>{dr=``})),pr=r({default:()=>mr}),mr,hr=n((()=>{mr=``})),gr=r({default:()=>_r}),_r,vr=n((()=>{_r=``})),yr=r({default:()=>br}),br,xr=n((()=>{br=` +`})),Sr=r({default:()=>Cr}),Cr,wr=n((()=>{Cr=``})),Tr=r({default:()=>Er}),Er,Dr=n((()=>{Er=` -`})),Er=r({default:()=>Dr}),Dr,Or=n((()=>{Dr=``})),kr=r({default:()=>Ar}),Ar,jr=n((()=>{Ar=` +`})),Or=r({default:()=>Z}),Z,kr=n((()=>{Z=``})),Ar=r({default:()=>jr}),jr,Mr=n((()=>{jr=` -`})),Mr=r({default:()=>Nr}),Nr,Pr=n((()=>{Nr=``})),Fr=r({default:()=>Ir}),Ir,Lr=n((()=>{Ir=` -`})),Rr=r({default:()=>zr}),zr,Br=n((()=>{zr=` -`})),Vr=r({default:()=>Hr}),Hr,Ur=n((()=>{Hr=``})),Wr=r({default:()=>Gr}),Gr,Kr=n((()=>{Gr=``})),qr=r({default:()=>Jr}),Jr,Yr=n((()=>{Jr=``})),Xr=r({default:()=>Zr}),Zr,Qr=n((()=>{Zr=``})),$r=r({default:()=>ei}),ei,ti=n((()=>{ei=``})),ni=!1,ri=new Map,ii=!1,Q=e=>/]/i.test(e),ai=e=>{if(typeof e==`string`)return Q(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&Q(n))return n;let r=t.default;if(typeof r==`string`&&Q(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&Q(e.data))return e.data}},oi=(e,t)=>{ii=!0;let n=ai(t);n&&(ri.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))},si=Object.assign({"../../assets/icons/add-user.svg":()=>Promise.resolve().then(()=>(lt(),ct)).then(e=>e.default),"../../assets/icons/arrow-down.svg":()=>Promise.resolve().then(()=>(ft(),ut)).then(e=>e.default),"../../assets/icons/book.svg":()=>Promise.resolve().then(()=>(ht(),pt)).then(e=>e.default),"../../assets/icons/cast.svg":()=>Promise.resolve().then(()=>(vt(),gt)).then(e=>e.default),"../../assets/icons/check-circle-fill.svg":()=>Promise.resolve().then(()=>(xt(),yt)).then(e=>e.default),"../../assets/icons/check-circle.svg":()=>Promise.resolve().then(()=>(wt(),St)).then(e=>e.default),"../../assets/icons/check.svg":()=>Promise.resolve().then(()=>(Dt(),Tt)).then(e=>e.default),"../../assets/icons/chevron-down.svg":()=>Promise.resolve().then(()=>(At(),Ot)).then(e=>e.default),"../../assets/icons/close-circle-fill.svg":()=>Promise.resolve().then(()=>(Nt(),jt)).then(e=>e.default),"../../assets/icons/close-circle.svg":()=>Promise.resolve().then(()=>(It(),Pt)).then(e=>e.default),"../../assets/icons/close.svg":()=>Promise.resolve().then(()=>(zt(),Lt)).then(e=>e.default),"../../assets/icons/copy.svg":()=>Promise.resolve().then(()=>(Ht(),Bt)).then(e=>e.default),"../../assets/icons/download.svg":()=>Promise.resolve().then(()=>(Gt(),Ut)).then(e=>e.default),"../../assets/icons/drop.svg":()=>Promise.resolve().then(()=>(Jt(),Kt)).then(e=>e.default),"../../assets/icons/eye-close.svg":()=>Promise.resolve().then(()=>(Zt(),Yt)).then(e=>e.default),"../../assets/icons/eye.svg":()=>Promise.resolve().then(()=>(en(),Qt)).then(e=>e.default),"../../assets/icons/fullscreen.svg":()=>Promise.resolve().then(()=>(rn(),tn)).then(e=>e.default),"../../assets/icons/github.svg":()=>Promise.resolve().then(()=>(sn(),an)).then(e=>e.default),"../../assets/icons/globe.svg":()=>Promise.resolve().then(()=>(un(),cn)).then(e=>e.default),"../../assets/icons/home.svg":()=>Promise.resolve().then(()=>(pn(),dn)).then(e=>e.default),"../../assets/icons/info-circle-fill.svg":()=>Promise.resolve().then(()=>(gn(),mn)).then(e=>e.default),"../../assets/icons/info-circle.svg":()=>Promise.resolve().then(()=>(yn(),_n)).then(e=>e.default),"../../assets/icons/issue.svg":()=>Promise.resolve().then(()=>(Sn(),bn)).then(e=>e.default),"../../assets/icons/loading-scene.svg":()=>Promise.resolve().then(()=>(Tn(),Cn)).then(e=>e.default),"../../assets/icons/loading.svg":()=>Promise.resolve().then(()=>(On(),En)).then(e=>e.default),"../../assets/icons/lock.svg":()=>Promise.resolve().then(()=>(jn(),kn)).then(e=>e.default),"../../assets/icons/menu.svg":()=>Promise.resolve().then(()=>(Pn(),Mn)).then(e=>e.default),"../../assets/icons/message.svg":()=>Promise.resolve().then(()=>(Ln(),Fn)).then(e=>e.default),"../../assets/icons/mic-off.svg":()=>Promise.resolve().then(()=>(Bn(),Rn)).then(e=>e.default),"../../assets/icons/mic.svg":()=>Promise.resolve().then(()=>(Un(),Vn)).then(e=>e.default),"../../assets/icons/more.svg":()=>Promise.resolve().then(()=>(Kn(),Wn)).then(e=>e.default),"../../assets/icons/pause.svg":()=>Promise.resolve().then(()=>(Yn(),qn)).then(e=>e.default),"../../assets/icons/pencil.svg":()=>Promise.resolve().then(()=>(Qn(),Xn)).then(e=>e.default),"../../assets/icons/pip.svg":()=>Promise.resolve().then(()=>(tr(),$n)).then(e=>e.default),"../../assets/icons/play.svg":()=>Promise.resolve().then(()=>(ir(),nr)).then(e=>e.default),"../../assets/icons/plus.svg":()=>Promise.resolve().then(()=>(sr(),ar)).then(e=>e.default),"../../assets/icons/power-off.svg":()=>Promise.resolve().then(()=>(ur(),cr)).then(e=>e.default),"../../assets/icons/preview.svg":()=>Promise.resolve().then(()=>(pr(),dr)).then(e=>e.default),"../../assets/icons/refresh.svg":()=>Promise.resolve().then(()=>(gr(),mr)).then(e=>e.default),"../../assets/icons/search.svg":()=>Promise.resolve().then(()=>(yr(),_r)).then(e=>e.default),"../../assets/icons/setting.svg":()=>Promise.resolve().then(()=>(Sr(),br)).then(e=>e.default),"../../assets/icons/sort.svg":()=>Promise.resolve().then(()=>(Tr(),Cr)).then(e=>e.default),"../../assets/icons/team.svg":()=>Promise.resolve().then(()=>(Or(),Er)).then(e=>e.default),"../../assets/icons/unlock.svg":()=>Promise.resolve().then(()=>(jr(),kr)).then(e=>e.default),"../../assets/icons/user.svg":()=>Promise.resolve().then(()=>(Pr(),Mr)).then(e=>e.default),"../../assets/icons/volume-mute.svg":()=>Promise.resolve().then(()=>(Lr(),Fr)).then(e=>e.default),"../../assets/icons/volume.svg":()=>Promise.resolve().then(()=>(Br(),Rr)).then(e=>e.default),"../../assets/icons/warning-circle-fill.svg":()=>Promise.resolve().then(()=>(Ur(),Vr)).then(e=>e.default),"../../assets/icons/warning-circle.svg":()=>Promise.resolve().then(()=>(Kr(),Wr)).then(e=>e.default),"../../assets/icons/without-content.svg":()=>Promise.resolve().then(()=>(Yr(),qr)).then(e=>e.default),"../../assets/icons/zoom-in.svg":()=>Promise.resolve().then(()=>(Qr(),Xr)).then(e=>e.default),"../../assets/icons/zoom-out.svg":()=>Promise.resolve().then(()=>(ti(),$r)).then(e=>e.default)}),ci={};for(let[e,t]of Object.entries(si)){let n=e.split(`/`).pop()?.replace(/\.svg$/,``);n&&(ci[n]=t)}H(`r-icon`,class extends U{isDev=ni;_events=new s;static get observedAttributes(){return[`name`,`size`,`color`,`spin`,`decorative`,`aria-label`,`sheet`]}_icon;_div;_shadowDom;_onIconRegistered=e=>{let t=e.detail?.name;t&&t===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=q(this,st);let e=z().class(`ran-icon`).part(`ran-icon`).build();this._shadowDom.appendChild(e),this._div=e}get name(){return J(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return J(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return J(this,`color`)}set color(e){e&&this.setAttribute(`color`,e)}get spin(){return this.hasAttribute(`spin`)}set spin(e){e?this.setAttribute(`spin`,``):this.removeAttribute(`spin`)}get decorative(){let e=this.getAttribute(`decorative`);return e==null?!this.hasAttribute(`aria-label`):e!==`false`&&e!==`0`}set decorative(e){this.setAttribute(`decorative`,e?`true`:`false`)}get ariaLabel(){return J(this,`aria-label`)}set ariaLabel(e){Y(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return J(this,`sheet`)}set sheet(e){Y(this,`sheet`,e)}handlerExternalCss=()=>{X(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11y=()=>{if(this._icon){if(this.decorative){this.setAttribute(`aria-hidden`,`true`),this.removeAttribute(`role`),this._icon.setAttribute(`aria-hidden`,`true`),this._icon.setAttribute(`focusable`,`false`);return}this.removeAttribute(`aria-hidden`),this.setAttribute(`role`,`img`),this._icon.removeAttribute(`aria-hidden`),this._icon.setAttribute(`focusable`,`false`)}};setIcon=()=>{if(typeof document>`u`)return;this._icon&&=(this._icon.remove(),void 0);let e=this.name;if(e){if(e.startsWith(`{t().then(t=>{oi(e,t)}).catch(t=>{this.isDev&&console.warn(`[ranui-icon] lazy load builtin failed: ${e}`,t)})};isSvgText=e=>Q(e);parseSvg=e=>{let t=new window.DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.tagName.toLowerCase()===`parsererror`||t.tagName.toLowerCase()!==`svg`)return;let n=new XMLSerializer().serializeToString(t),r=R(`template`).build();r.innerHTML=n.trim();let i=r.content.firstElementChild;if(!(!i||i.tagName.toLowerCase()!==`svg`))return i};renderSvg=(e,t)=>{let n=this.parseSvg(e);n?(this._icon=n,this._icon.setAttribute(`part`,`icon-svg`),this._icon.setAttribute(`data-name`,t),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${t}`)};setSize=()=>{if(this._icon){let e=this.size||`1em`;this._icon.setAttribute(`width`,e),this._icon.setAttribute(`height`,e);let t=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;this._icon.style.setProperty(`width`,t),this._icon.style.setProperty(`height`,t)}};setColor=()=>{if(this._icon){let e=this.color||`currentColor`;this._icon.style.setProperty(`color`,e),this._icon.style.setProperty(`fill`,e),this._icon.style.setProperty(`stroke`,e)}};setSpin=()=>{this.spin?this._div.classList.add(`ran-icon-spin`):this._div.classList.remove(`ran-icon-spin`)};connectedCallback(){this._events.on(window,`ranui-icon-registered`,this._onIconRegistered),this.handlerExternalCss(),this.setIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`name`&&this.setIcon(),e===`size`&&this.setSize(),e===`color`&&this.setColor(),e===`spin`&&this.setSpin(),(e===`decorative`||e===`aria-label`)&&this.syncA11y(),e===`sheet`&&this.handlerExternalCss())}});var li=`:host{position:var(--ran-input-host-position,relative);display:var(--ran-input-host-display,block);box-sizing:var(--ran-input-host-box-sizing,border-box)}.ran-input-label{display:var(--ran-input-label-display,block);margin-bottom:var(--ran-input-label-margin-bottom,var(--ran-space-1,4px));font-size:var(--ran-input-label-font-size,var(--ran-text-label-1,14px));font-weight:var(--ran-input-label-font-weight,var(--ran-text-label-weight,500));color:var(--ran-input-label-color,var(--ran-color-text,#171717))}:host([status=error]) .ran-input-label{color:var(--ran-input-label-error-color,var(--ran-color-danger-foreground,#d8001b))}:host([status=warning]) .ran-input-label{color:var(--ran-input-label-warning-color,var(--ran-color-warning-foreground,#aa4d00))}:host([disabled]) .ran-input-label{color:var(--ran-input-label-disabled-color,var(--ran-color-text-disabled,#999));cursor:var(--ran-input-label-disabled-cursor,not-allowed)}.ran-input{box-sizing:var(--ran-input-box-sizing,border-box);position:var(--ran-input-position,relative);display:var(--ran-input-display,flex);align-items:var(--ran-input-align-items,center);width:var(--ran-input-width,100%);height:var(--ran-input-height,100%);min-width:var(--ran-input-min-width,0);padding:var(--ran-input-padding,0px 0px 0px 4px);color:var(--ran-input-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-font-size,var(--ran-text-label-3,12px));font-family:var(--ran-input-font-family,var(--ran-skin-font-family,inherit));line-height:var(--ran-input-line-height,1.5715);background-color:var(--ran-input-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-background-image,none);border:var(--ran-input-border,1px solid var(--ran-color-border,#eaeaea));border-image-source:var(--ran-input-border-image-source,none);border-image-slice:var(--ran-input-border-image-slice,8);border-image-width:var(--ran-input-border-image-width,var(--ran-skin-border-image-width,4px));border-radius:var(--ran-input-border-radius,var(--ran-radius-sm,6px));transition:var(--ran-input-transition,none);min-height:var(--ran-input-min-height,var(--ran-size-7,32px));border-image-outset:0;border-image-repeat:stretch}.ran-input .ran-icon{display:var(--ran-input-icon-display,flex);align-items:var(--ran-input-icon-align-items,center);justify-content:var(--ran-input-icon-justify-content,center)}.ran-input:has(.ran-input-content:focus-visible){border-color:var(--ran-input-active-border-color,var(--ran-color-link,#006bff));box-shadow:var(--ran-input-active-box-shadow,var(--ran-focus-ring));border-right-width:var(--ran-input-active-border-right-width,1px);outline:var(--ran-input-active-outline,0)}.ran-input:hover{border-color:var(--ran-input-hover-border-color,var(--ran-color-border-hover,#c9c9c9));border-right-width:var(--ran-input-hover-border-right-width,1px)}.ran-input[status=error] .ran-input-content,.ran-input[status=warning] .ran-input-content{padding-right:var(--ran-input-content-status-padding-right,var(--ran-space-8,32px))}.ran-input[status=error]:after,.ran-input[status=warning]:after{content:"";top:50%;right:var(--ran-input-status-icon-right,var(--ran-space-3,12px));width:var(--ran-input-status-icon-width,var(--ran-size-1,16px));height:var(--ran-input-status-icon-height,var(--ran-size-1,16px));pointer-events:none;position:absolute;transform:translateY(-50%);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.ran-input[status=error]{border-color:var(--ran-input-error-border-color,var(--ran-color-danger,#ff4d4f))}.ran-input[status=error]:after{background-color:var(--ran-color-danger,#ff4d4f);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[status=warning]{border-color:var(--ran-input-warning-border-color,var(--ran-color-warning,#faad14))}.ran-input[status=warning]:after{background-color:var(--ran-color-warning,#faad14);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[disabled]{color:var(--ran-input-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-disabled-box-shadow,none);cursor:var(--ran-input-disabled-cursor,not-allowed);opacity:var(--ran-input-disabled-opacity,1)}.ran-input[disabled]>.ran-input-content{color:var(--ran-input-content-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-content-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-content-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-content-disabled-box-shadow,none);cursor:var(--ran-input-content-disabled-cursor,not-allowed);opacity:var(--ran-input-content-disabled-opacity,1)}.ran-input-content{writing-mode:var(--ran-input-content-writing-mode,horizontal-tb);text-rendering:var(--ran-input-content-text-rendering,auto);letter-spacing:var(--ran-input-content-letter-spacing,normal);word-spacing:var(--ran-input-content-word-spacing,normal);text-transform:var(--ran-input-content-text-transform,none);text-indent:var(--ran-input-content-text-indent,0px);text-shadow:var(--ran-input-content-text-shadow,none);text-align:var(--ran-input-content-text-align,start);cursor:var(--ran-input-content-cursor,text);touch-action:var(--ran-input-content-touch-action,manipulation);-webkit-appearance:var(--ran-input-content--webkit-appearance,none);text-overflow:var(--ran-input-content-text-overflow,ellipsis);box-sizing:var(--ran-input-content-box-sizing,border-box);margin:var(--ran-input-content-margin,0);font-variant:var(--ran-input-content-font-variant,tabular-nums);list-style:var(--ran-input-content-list-style,none);font-feature-settings:var(--ran-input-content-font-feature-settings,"tnum");position:var(--ran-input-content-position,relative);border:var(--ran-input-content-border,none);width:var(--ran-input-content-width,100%);height:var(--ran-input-content-height,100%);min-height:var(--ran-input-content-min-height,var(--ran-size-6,30px));min-width:var(--ran-input-content-min-width,0);color:var(--ran-input-content-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-content-font-size,var(--ran-text-copy-2,14px));line-height:var(--ran-input-content-line-height,1.48);background-color:var(--ran-input-content-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-content-background-image,none);transition:var(--ran-input-content-transition,none);outline:var(--ran-input-content-outline,none);border-radius:var(--ran-input-content-border-radius,var(--ran-radius-sm,6px));padding:var(--ran-input-content-padding,0 0 0 var(--ran-space-1,4px));font-weight:var(--ran-input-content-font-weight,var(--ran-text-copy-weight,400));-webkit-tap-highlight-color:transparent}.ran-input-content:focus,.ran-input-content:focus-visible,.ran-input-content:hover{border:var(--ran-input-content-hover-border,none);outline:var(--ran-input-content-hover-outline,none);box-shadow:var(--ran-input-content-hover-box-shadow,none)}.ran-input-content::placeholder{color:var(--ran-input-content-placeholder-color,var(--ran-color-text-disabled,#999))}.ran-input-content::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.ran-input-message{margin-top:var(--ran-input-message-margin-top,4px);font-size:var(--ran-input-message-font-size,var(--ran-text-label-3,12px));font-weight:var(--ran-input-message-font-weight,var(--ran-text-label-weight,500));line-height:var(--ran-input-message-line-height,1.5);color:var(--ran-input-message-color,var(--ran-color-text-secondary,#8c8c8c))}.ran-input-message:empty{display:none}:host([status=error]) .ran-input-message{color:var(--ran-input-message-error-color,var(--ran-color-danger-foreground,#d8001b))}:host([status=warning]) .ran-input-message{color:var(--ran-input-message-warning-color,var(--ran-color-warning-foreground,#aa4d00))}`,ui=0,$=class extends U{static formAssociated=!0;_internals;static get observedAttributes(){return[`label`,`disabled`,`name`,`placeholder`,`type`,`icon`,`value`,`status`,`message`,`min`,`max`,`step`,`required`,`sheet`]}_events=new s;_shadowDom;_input;_label;_inputContent;_icon;_message;_defaultValue=``;_defaultValueCaptured=!1;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=q(this,li);let e=xe(),t=z().class(`ran-input`).part(`input`).children(ze().class(`ran-input-content`).ref(e).part(`content`)).build();this._shadowDom.appendChild(t),this._input=t,this._inputContent=rt(e,`content`),this._inputContent.id||(this._inputContent.id=`ran-input-${++ui}`)}focus(e){this._inputContent?.focus(e)}blur(){this._inputContent?.blur()}select(){this._inputContent?.select?.()}get value(){return this.getAttribute(`value`)||``}set value(e){this._inputContent.value=e,Y(this,`value`,e,{removeEmpty:!0}),this._syncValue()}get placeholder(){return this.getAttribute(`placeholder`)||``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`)}get required(){return this.hasAttribute(`required`)}set required(e){it(this,`required`,!(!e||e===`false`))}get disabled(){return V(this)}set disabled(e){B.includes(e)?(this.removeAttribute(`disabled`),this._input.removeAttribute(`disabled`),this._inputContent.removeAttribute(`disabled`)):(this.setAttribute(`disabled`,``),this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``))}get label(){return this.getAttribute(`label`)||``}set label(e){this.setAttribute(`label`,e)}get status(){return this.getAttribute(`status`)||``}set status(e){e?(this.setAttribute(`status`,e),this._input.setAttribute(`status`,e)):(this.removeAttribute(`status`),this._input.removeAttribute(`status`))}get message(){return this.getAttribute(`message`)||``}set message(e){e?this.setAttribute(`message`,e):this.removeAttribute(`message`)}get name(){return this.getAttribute(`name`)||``}set name(e){this.setAttribute(`name`,e)}get min(){return this.getAttribute(`min`)||``}set min(e){this.type===`number`&&this.setAttribute(`min`,e)}get max(){return this.getAttribute(`max`)||``}set max(e){this.type===`number`&&this.setAttribute(`max`,e)}get step(){return this.getAttribute(`step`)||``}set step(e){this.type===`number`&&this.setAttribute(`step`,e)}get icon(){return this.getAttribute(`icon`)||``}set icon(e){e?this.setAttribute(`icon`,e):this.removeAttribute(`icon`)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}get sheet(){return J(this,`sheet`)}set sheet(e){Y(this,`sheet`,e)}handlerExternalCss=()=>{X(this,this._shadowDom,`sheet`,null,this.sheet)};_updateValidity=()=>{let e=this._inputContent;this.required?e.setAttribute(`aria-required`,`true`):e.removeAttribute(`aria-required`);let t=e.validity;if(!this.disabled&&(t?!t.valid:this.required&&!this.value)){e.setAttribute(`aria-invalid`,`true`);let n={};for(let e of[`badInput`,`customError`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`])t?.[e]&&(n[e]=!0);t||(n.valueMissing=!0),this._internals?.setValidity?.(n,e.validationMessage||`Please fill out this field.`,e)}else e.removeAttribute(`aria-invalid`),this._internals?.setValidity?.({})};_syncValue=()=>{let e=this.value;this._inputContent.value!==e&&(this._inputContent.value=e),e?this._input.setAttribute(`value`,e):this._input.removeAttribute(`value`),this._internals?.setFormValue?.(this._inputContent.value),this._updateValidity()};checkValidity(){return at(this._internals)}reportValidity(){return ot(this._internals)}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??``}formResetCallback(){this.value=this._defaultValue}customInput=e=>{e.stopPropagation(),e.preventDefault();let{target:t,data:n=``}=e;Y(this,`value`,t?.value??n??``,{removeEmpty:!0}),this._syncValue(),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:this.value}}))};customKeydown=e=>{e.key!==`Enter`||e.isComposing||this._internals?.form?.requestSubmit()};customChange=()=>{Y(this,`value`,this._inputContent?.value??this.value,{removeEmpty:!0}),this._syncValue(),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value}}))};listenPlaceholder=(e,t)=>{e===`placeholder`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`placeholder`):this._inputContent.setAttribute(`placeholder`,t))};listenLabel=(e,t)=>{e===`label`&&this._inputContent&&(t==null?(this._input.removeAttribute(`label`),this._label&&=(this._label.remove(),void 0)):this._label?this._label.textContent=t:(this._label=Ve().class(`ran-input-label`).part(`label`).text(t).build(),this._label.htmlFor=this._inputContent.id,this._shadowDom.insertBefore(this._label,this._input)))};listenType=(e,t)=>{if(e===`type`&&this._inputContent){t?this._inputContent.setAttribute(`type`,t):this._inputContent.removeAttribute(`type`);for(let e of[`min`,`max`,`step`])this.listenNumericConstraint(e,this.getAttribute(e));this._syncValue()}};listenStatus=(e,t)=>{e===`status`&&this._input&&(t?this._input.setAttribute(`status`,t):this._input.removeAttribute(`status`))};listenMessage=(e,t)=>{e===`message`&&(t?(this._message||(this._message=z().class(`ran-input-message`).part(`message`).build(),this._message.id=`${this._inputContent.id}-message`,this._shadowDom.appendChild(this._message),this._inputContent.setAttribute(`aria-describedby`,this._message.id)),this._message.textContent=t):this._message&&=(this._inputContent.removeAttribute(`aria-describedby`),this._message.remove(),void 0))};listenNumericConstraint=(e,t)=>{(e===`min`||e===`max`||e===`step`)&&this._inputContent&&(this.type===`number`&&t!=null?this._inputContent.setAttribute(e,t):this._inputContent.removeAttribute(e),this._updateValidity())};listenRequired=(e,t)=>{e===`required`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`required`):this._inputContent.setAttribute(`required`,``),this._updateValidity())};listenDisabled=(e,t)=>{e===`disabled`&&this._input&&(B.includes(t)?(this._input.removeAttribute(`disabled`),this._inputContent.removeAttribute(`disabled`)):(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)),this._updateValidity())};listenIcon=(e,t,n)=>{e===`icon`&&t&&t!==n&&(this.removeAttribute(`label`),this.setAttribute(`icon`,t),this.dealIcon())};dealIcon=()=>{this._icon||(this._icon=R(`r-icon`).class(`ran-icon`).build(),this._inputContent.insertAdjacentElement(`beforebegin`,this._icon)),this.icon&&this._icon.setAttribute(`name`,this.icon)};listenEvent=(e,t,n)=>{this.listenType(e,n),this.listenPlaceholder(e,n),this.listenLabel(e,n),this.listenStatus(e,n),this.listenMessage(e,n),this.listenNumericConstraint(e,n),this.listenRequired(e,n),this.listenDisabled(e,n),this.listenIcon(e,n,t),e===`value`&&t!==n&&this._syncValue()};connectedCallback(){this.handlerExternalCss(),this._defaultValueCaptured||=(this._defaultValue=this.value,!0),this.value&&(this._inputContent.value=this.value,this._input.setAttribute(`value`,this.value)),this._internals?.setFormValue?.(this.value),this.status&&this._input.setAttribute(`status`,this.status),this.message&&this.listenMessage(`message`,this.message),V(this)&&(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)),this.type&&this._inputContent.setAttribute(`type`,this.type),this.type===`number`&&(this.min&&this._inputContent.setAttribute(`min`,this.min),this.max&&this._inputContent.setAttribute(`max`,this.max),this.step&&this._inputContent.setAttribute(`step`,this.step)),this.required&&this._inputContent.setAttribute(`required`,``),this._syncValue(),this._events.on(this._inputContent,`input`,this.customInput),this._events.on(this._inputContent,`change`,this.customChange),this._events.on(this._inputContent,`keydown`,this.customKeydown),document.readyState===`complete`&&this.dealIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(this.listenEvent(e,t,n),e===`sheet`&&this.handlerExternalCss())}};return H(`r-input`,$),e.Input=$,e.default=$,e})({}); \ No newline at end of file +`})),Nr=r({default:()=>Pr}),Pr,Fr=n((()=>{Pr=``})),Ir=r({default:()=>Lr}),Lr,Rr=n((()=>{Lr=` +`})),zr=r({default:()=>Br}),Br,Vr=n((()=>{Br=` +`})),Hr=r({default:()=>Ur}),Ur,Wr=n((()=>{Ur=``})),Gr=r({default:()=>Kr}),Kr,qr=n((()=>{Kr=``})),Jr=r({default:()=>Yr}),Yr,Xr=n((()=>{Yr=``})),Zr=r({default:()=>Qr}),Qr,$r=n((()=>{Qr=``})),ei=r({default:()=>ti}),ti,ni=n((()=>{ti=``})),ri=!1,ii=new Map,ai=!1,Q=e=>/]/i.test(e),oi=e=>{if(typeof e==`string`)return Q(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&Q(n))return n;let r=t.default;if(typeof r==`string`&&Q(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&Q(e.data))return e.data}},si=(e,t)=>{ai=!0;let n=oi(t);n&&(ii.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))},ci=Object.assign({"../../assets/icons/add-user.svg":()=>Promise.resolve().then(()=>(ft(),dt)).then(e=>e.default),"../../assets/icons/arrow-down.svg":()=>Promise.resolve().then(()=>(mt(),pt)).then(e=>e.default),"../../assets/icons/book.svg":()=>Promise.resolve().then(()=>(_t(),ht)).then(e=>e.default),"../../assets/icons/cast.svg":()=>Promise.resolve().then(()=>(bt(),vt)).then(e=>e.default),"../../assets/icons/check-circle-fill.svg":()=>Promise.resolve().then(()=>(Ct(),xt)).then(e=>e.default),"../../assets/icons/check-circle.svg":()=>Promise.resolve().then(()=>(Et(),wt)).then(e=>e.default),"../../assets/icons/check.svg":()=>Promise.resolve().then(()=>(kt(),Dt)).then(e=>e.default),"../../assets/icons/chevron-down.svg":()=>Promise.resolve().then(()=>(Mt(),At)).then(e=>e.default),"../../assets/icons/close-circle-fill.svg":()=>Promise.resolve().then(()=>(Ft(),Nt)).then(e=>e.default),"../../assets/icons/close-circle.svg":()=>Promise.resolve().then(()=>(Rt(),It)).then(e=>e.default),"../../assets/icons/close.svg":()=>Promise.resolve().then(()=>(Vt(),zt)).then(e=>e.default),"../../assets/icons/copy.svg":()=>Promise.resolve().then(()=>(Wt(),Ht)).then(e=>e.default),"../../assets/icons/download.svg":()=>Promise.resolve().then(()=>(qt(),Gt)).then(e=>e.default),"../../assets/icons/drop.svg":()=>Promise.resolve().then(()=>(Xt(),Jt)).then(e=>e.default),"../../assets/icons/eye-close.svg":()=>Promise.resolve().then(()=>($t(),Zt)).then(e=>e.default),"../../assets/icons/eye.svg":()=>Promise.resolve().then(()=>(nn(),en)).then(e=>e.default),"../../assets/icons/fullscreen.svg":()=>Promise.resolve().then(()=>(on(),rn)).then(e=>e.default),"../../assets/icons/github.svg":()=>Promise.resolve().then(()=>(ln(),sn)).then(e=>e.default),"../../assets/icons/globe.svg":()=>Promise.resolve().then(()=>(fn(),un)).then(e=>e.default),"../../assets/icons/home.svg":()=>Promise.resolve().then(()=>(hn(),pn)).then(e=>e.default),"../../assets/icons/info-circle-fill.svg":()=>Promise.resolve().then(()=>(vn(),gn)).then(e=>e.default),"../../assets/icons/info-circle.svg":()=>Promise.resolve().then(()=>(xn(),yn)).then(e=>e.default),"../../assets/icons/issue.svg":()=>Promise.resolve().then(()=>(wn(),Sn)).then(e=>e.default),"../../assets/icons/loading-scene.svg":()=>Promise.resolve().then(()=>(Dn(),Tn)).then(e=>e.default),"../../assets/icons/loading.svg":()=>Promise.resolve().then(()=>(An(),On)).then(e=>e.default),"../../assets/icons/lock.svg":()=>Promise.resolve().then(()=>(Nn(),jn)).then(e=>e.default),"../../assets/icons/menu.svg":()=>Promise.resolve().then(()=>(In(),Pn)).then(e=>e.default),"../../assets/icons/message.svg":()=>Promise.resolve().then(()=>(zn(),Ln)).then(e=>e.default),"../../assets/icons/mic-off.svg":()=>Promise.resolve().then(()=>(Hn(),Bn)).then(e=>e.default),"../../assets/icons/mic.svg":()=>Promise.resolve().then(()=>(Gn(),Un)).then(e=>e.default),"../../assets/icons/more.svg":()=>Promise.resolve().then(()=>(Jn(),Kn)).then(e=>e.default),"../../assets/icons/pause.svg":()=>Promise.resolve().then(()=>(Zn(),Yn)).then(e=>e.default),"../../assets/icons/pencil.svg":()=>Promise.resolve().then(()=>(er(),Qn)).then(e=>e.default),"../../assets/icons/pip.svg":()=>Promise.resolve().then(()=>(rr(),tr)).then(e=>e.default),"../../assets/icons/play.svg":()=>Promise.resolve().then(()=>(or(),ir)).then(e=>e.default),"../../assets/icons/plus.svg":()=>Promise.resolve().then(()=>(lr(),sr)).then(e=>e.default),"../../assets/icons/power-off.svg":()=>Promise.resolve().then(()=>(fr(),ur)).then(e=>e.default),"../../assets/icons/preview.svg":()=>Promise.resolve().then(()=>(hr(),pr)).then(e=>e.default),"../../assets/icons/refresh.svg":()=>Promise.resolve().then(()=>(vr(),gr)).then(e=>e.default),"../../assets/icons/search.svg":()=>Promise.resolve().then(()=>(xr(),yr)).then(e=>e.default),"../../assets/icons/setting.svg":()=>Promise.resolve().then(()=>(wr(),Sr)).then(e=>e.default),"../../assets/icons/sort.svg":()=>Promise.resolve().then(()=>(Dr(),Tr)).then(e=>e.default),"../../assets/icons/team.svg":()=>Promise.resolve().then(()=>(kr(),Or)).then(e=>e.default),"../../assets/icons/unlock.svg":()=>Promise.resolve().then(()=>(Mr(),Ar)).then(e=>e.default),"../../assets/icons/user.svg":()=>Promise.resolve().then(()=>(Fr(),Nr)).then(e=>e.default),"../../assets/icons/volume-mute.svg":()=>Promise.resolve().then(()=>(Rr(),Ir)).then(e=>e.default),"../../assets/icons/volume.svg":()=>Promise.resolve().then(()=>(Vr(),zr)).then(e=>e.default),"../../assets/icons/warning-circle-fill.svg":()=>Promise.resolve().then(()=>(Wr(),Hr)).then(e=>e.default),"../../assets/icons/warning-circle.svg":()=>Promise.resolve().then(()=>(qr(),Gr)).then(e=>e.default),"../../assets/icons/without-content.svg":()=>Promise.resolve().then(()=>(Xr(),Jr)).then(e=>e.default),"../../assets/icons/zoom-in.svg":()=>Promise.resolve().then(()=>($r(),Zr)).then(e=>e.default),"../../assets/icons/zoom-out.svg":()=>Promise.resolve().then(()=>(ni(),ei)).then(e=>e.default)}),li={};for(let[e,t]of Object.entries(ci)){let n=e.split(`/`).pop()?.replace(/\.svg$/,``);n&&(li[n]=t)}I(`r-icon`,class extends L{isDev=ri;_events=new s;static get observedAttributes(){return[`name`,`size`,`color`,`spin`,`decorative`,`aria-label`,`sheet`]}_icon;_div;_shadowDom;_onIconRegistered=e=>{let t=e.detail?.name;t&&t===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=G(this,ut);let e=N().class(`ran-icon`).part(`ran-icon`).build();this._shadowDom.appendChild(e),this._div=e}get name(){return K(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return K(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return K(this,`color`)}set color(e){e&&this.setAttribute(`color`,e)}get spin(){return this.hasAttribute(`spin`)}set spin(e){e?this.setAttribute(`spin`,``):this.removeAttribute(`spin`)}get decorative(){let e=this.getAttribute(`decorative`);return e==null?!this.hasAttribute(`aria-label`):e!==`false`&&e!==`0`}set decorative(e){this.setAttribute(`decorative`,e?`true`:`false`)}get ariaLabel(){return K(this,`aria-label`)}set ariaLabel(e){q(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return K(this,`sheet`)}set sheet(e){q(this,`sheet`,e)}handlerExternalCss=()=>{J(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11y=()=>{this._icon&&(this.decorative?(this.setAttribute(`aria-hidden`,`true`),this.removeAttribute(`role`),this._icon.setAttribute(`aria-hidden`,`true`),this._icon.setAttribute(`focusable`,`false`)):(this.removeAttribute(`aria-hidden`),this.setAttribute(`role`,`img`),this._icon.removeAttribute(`aria-hidden`),this._icon.setAttribute(`focusable`,`false`)))};setIcon=()=>{if(typeof document>`u`)return;this._icon&&=(this._icon.remove(),void 0);let e=this.name;if(e){if(e.startsWith(`{t().then(t=>{si(e,t)}).catch(t=>{this.isDev&&console.warn(`[ranui-icon] lazy load builtin failed: ${e}`,t)})};isSvgText=e=>Q(e);parseSvg=e=>{let t=new window.DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.tagName.toLowerCase()===`parsererror`||t.tagName.toLowerCase()!==`svg`)return;let n=new XMLSerializer().serializeToString(t),r=M(`template`).build();r.innerHTML=n.trim();let i=r.content.firstElementChild;if(i&&i.tagName.toLowerCase()===`svg`)return i};renderSvg=(e,t)=>{let n=this.parseSvg(e);n?(this._icon=n,this._icon.setAttribute(`part`,`icon-svg`),this._icon.setAttribute(`data-name`,t),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${t}`)};setSize=()=>{if(this._icon){let e=this.size||`1em`;this._icon.setAttribute(`width`,e),this._icon.setAttribute(`height`,e);let t=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;this._icon.style.setProperty(`width`,t),this._icon.style.setProperty(`height`,t)}};setColor=()=>{if(this._icon){let e=this.color||`currentColor`;this._icon.style.setProperty(`color`,e),this._icon.style.setProperty(`fill`,e),this._icon.style.setProperty(`stroke`,e)}};setSpin=()=>{this.spin?this._div.classList.add(`ran-icon-spin`):this._div.classList.remove(`ran-icon-spin`)};connectedCallback(){this._events.on(window,`ranui-icon-registered`,this._onIconRegistered),this.handlerExternalCss(),this.setIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`name`&&this.setIcon(),e===`size`&&this.setSize(),e===`color`&&this.setColor(),e===`spin`&&this.setSpin(),(e===`decorative`||e===`aria-label`)&&this.syncA11y(),e===`sheet`&&this.handlerExternalCss())}});var ui=`:host{position:var(--ran-input-host-position,relative);display:var(--ran-input-host-display,flex);box-sizing:var(--ran-input-host-box-sizing,border-box);flex-direction:column}.ran-input-label{display:var(--ran-input-label-display,block);margin-bottom:var(--ran-input-label-margin-bottom,var(--ran-space-1,4px));font-size:var(--ran-input-label-font-size,var(--ran-text-label-1,14px));font-weight:var(--ran-input-label-font-weight,var(--ran-text-label-weight,500));color:var(--ran-input-label-color,var(--ran-color-text,#171717));flex:none}:host([status=error]) .ran-input-label{color:var(--ran-input-label-error-color,var(--ran-color-danger-foreground,#d8001b))}:host([status=warning]) .ran-input-label{color:var(--ran-input-label-warning-color,var(--ran-color-warning-foreground,#aa4d00))}:host([disabled]) .ran-input-label{color:var(--ran-input-label-disabled-color,var(--ran-color-text-disabled,#999));cursor:var(--ran-input-label-disabled-cursor,not-allowed)}.ran-input{box-sizing:var(--ran-input-box-sizing,border-box);position:var(--ran-input-position,relative);display:var(--ran-input-display,flex);align-items:var(--ran-input-align-items,center);width:var(--ran-input-width,100%);height:var(--ran-input-height,auto);min-width:var(--ran-input-min-width,0);padding:var(--ran-input-padding,0px 0px 0px 4px);color:var(--ran-input-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-font-size,var(--ran-text-label-3,12px));font-family:var(--ran-input-font-family,var(--ran-skin-font-family,inherit));line-height:var(--ran-input-line-height,1.5715);background-color:var(--ran-input-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-background-image,none);border:var(--ran-input-border,1px solid var(--ran-color-border,#eaeaea));border-image-source:var(--ran-input-border-image-source,none);border-image-slice:var(--ran-input-border-image-slice,8);border-image-width:var(--ran-input-border-image-width,var(--ran-skin-border-image-width,4px));border-radius:var(--ran-input-border-radius,var(--ran-radius-sm,6px));transition:var(--ran-input-transition,none);min-height:var(--ran-input-min-height,var(--ran-size-7,32px));border-image-outset:0;border-image-repeat:stretch;flex:auto}.ran-input .ran-icon{display:var(--ran-input-icon-display,flex);align-items:var(--ran-input-icon-align-items,center);justify-content:var(--ran-input-icon-justify-content,center)}.ran-input:has(.ran-input-content:focus-visible){border-color:var(--ran-input-active-border-color,var(--ran-color-link,#006bff));box-shadow:var(--ran-input-active-box-shadow,var(--ran-focus-ring));border-right-width:var(--ran-input-active-border-right-width,1px);outline:var(--ran-input-active-outline,0)}.ran-input:hover{border-color:var(--ran-input-hover-border-color,var(--ran-color-border-hover,#c9c9c9));border-right-width:var(--ran-input-hover-border-right-width,1px)}.ran-input[status=error] .ran-input-content,.ran-input[status=warning] .ran-input-content{padding-right:var(--ran-input-content-status-padding-right,var(--ran-space-8,32px))}.ran-input[status=error]:after,.ran-input[status=warning]:after{content:"";top:50%;right:var(--ran-input-status-icon-right,var(--ran-space-3,12px));width:var(--ran-input-status-icon-width,var(--ran-size-1,16px));height:var(--ran-input-status-icon-height,var(--ran-size-1,16px));pointer-events:none;position:absolute;transform:translateY(-50%);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.ran-input[status=error]{border-color:var(--ran-input-error-border-color,var(--ran-color-danger,#ff4d4f))}.ran-input[status=error]:after{background-color:var(--ran-color-danger,#ff4d4f);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[status=warning]{border-color:var(--ran-input-warning-border-color,var(--ran-color-warning,#faad14))}.ran-input[status=warning]:after{background-color:var(--ran-color-warning,#faad14);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[disabled]{color:var(--ran-input-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-disabled-box-shadow,none);cursor:var(--ran-input-disabled-cursor,not-allowed);opacity:var(--ran-input-disabled-opacity,1)}.ran-input[disabled]>.ran-input-content{color:var(--ran-input-content-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-content-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-content-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-content-disabled-box-shadow,none);cursor:var(--ran-input-content-disabled-cursor,not-allowed);opacity:var(--ran-input-content-disabled-opacity,1)}.ran-input-content{writing-mode:var(--ran-input-content-writing-mode,horizontal-tb);text-rendering:var(--ran-input-content-text-rendering,auto);letter-spacing:var(--ran-input-content-letter-spacing,normal);word-spacing:var(--ran-input-content-word-spacing,normal);text-transform:var(--ran-input-content-text-transform,none);text-indent:var(--ran-input-content-text-indent,0px);text-shadow:var(--ran-input-content-text-shadow,none);text-align:var(--ran-input-content-text-align,start);cursor:var(--ran-input-content-cursor,text);touch-action:var(--ran-input-content-touch-action,manipulation);-webkit-appearance:var(--ran-input-content--webkit-appearance,none);text-overflow:var(--ran-input-content-text-overflow,ellipsis);box-sizing:var(--ran-input-content-box-sizing,border-box);margin:var(--ran-input-content-margin,0);font-variant:var(--ran-input-content-font-variant,tabular-nums);list-style:var(--ran-input-content-list-style,none);font-feature-settings:var(--ran-input-content-font-feature-settings,"tnum");position:var(--ran-input-content-position,relative);border:var(--ran-input-content-border,none);width:var(--ran-input-content-width,100%);height:var(--ran-input-content-height,100%);min-height:var(--ran-input-content-min-height,var(--ran-size-6,30px));min-width:var(--ran-input-content-min-width,0);color:var(--ran-input-content-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-content-font-size,var(--ran-text-copy-2,14px));line-height:var(--ran-input-content-line-height,1.48);background-color:var(--ran-input-content-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-content-background-image,none);transition:var(--ran-input-content-transition,none);outline:var(--ran-input-content-outline,none);border-radius:var(--ran-input-content-border-radius,var(--ran-radius-sm,6px));padding:var(--ran-input-content-padding,0 0 0 var(--ran-space-1,4px));font-weight:var(--ran-input-content-font-weight,var(--ran-text-copy-weight,400));-webkit-tap-highlight-color:transparent}.ran-input-content:focus,.ran-input-content:focus-visible,.ran-input-content:hover{border:var(--ran-input-content-hover-border,none);outline:var(--ran-input-content-hover-outline,none);box-shadow:var(--ran-input-content-hover-box-shadow,none)}.ran-input-content::placeholder{color:var(--ran-input-content-placeholder-color,var(--ran-color-text-disabled,#999))}.ran-input-content::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.ran-input-message{margin-top:var(--ran-input-message-margin-top,4px);font-size:var(--ran-input-message-font-size,var(--ran-text-label-3,12px));font-weight:var(--ran-input-message-font-weight,var(--ran-text-label-weight,500));line-height:var(--ran-input-message-line-height,1.5);color:var(--ran-input-message-color,var(--ran-color-text-secondary,#8c8c8c));flex:none}.ran-input-message:empty{display:none}:host([status=error]) .ran-input-message{color:var(--ran-input-message-error-color,var(--ran-color-danger-foreground,#d8001b));flex:none}:host([status=warning]) .ran-input-message{color:var(--ran-input-message-warning-color,var(--ran-color-warning-foreground,#aa4d00));flex:none}`,di=0,$=class extends L{static formAssociated=!0;_internals;static get observedAttributes(){return[`label`,`disabled`,`name`,`placeholder`,`type`,`icon`,`value`,`status`,`message`,`min`,`max`,`step`,`required`,`sheet`]}_events=new s;_shadowDom;_input;_label;_inputContent;_icon;_message;_defaultValue=``;_defaultValueCaptured=!1;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=G(this,ui);let e=Se(),t=N().class(`ran-input`).part(`input`).children(He().class(`ran-input-content`).ref(e).part(`content`)).build();this._shadowDom.appendChild(t),this._input=t,this._inputContent=ot(e,`content`),this._inputContent.id||(this._inputContent.id=`ran-input-${++di}`)}focus(e){this._inputContent?.focus(e)}blur(){this._inputContent?.blur()}select(){this._inputContent?.select?.()}get value(){return this.getAttribute(`value`)||``}set value(e){this._inputContent.value=e,q(this,`value`,e,{removeEmpty:!0}),this._syncValue()}get placeholder(){return this.getAttribute(`placeholder`)||``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`)}get required(){return this.hasAttribute(`required`)}set required(e){st(this,`required`,!(!e||e===`false`))}get disabled(){return F(this)}set disabled(e){P.includes(e)?(this.removeAttribute(`disabled`),this._input.removeAttribute(`disabled`),this._inputContent.removeAttribute(`disabled`)):(this.setAttribute(`disabled`,``),this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``))}get label(){return this.getAttribute(`label`)||``}set label(e){this.setAttribute(`label`,e)}get status(){return this.getAttribute(`status`)||``}set status(e){e?(this.setAttribute(`status`,e),this._input.setAttribute(`status`,e)):(this.removeAttribute(`status`),this._input.removeAttribute(`status`))}get message(){return this.getAttribute(`message`)||``}set message(e){e?this.setAttribute(`message`,e):this.removeAttribute(`message`)}get name(){return this.getAttribute(`name`)||``}set name(e){this.setAttribute(`name`,e)}get min(){return this.getAttribute(`min`)||``}set min(e){this.type===`number`&&this.setAttribute(`min`,e)}get max(){return this.getAttribute(`max`)||``}set max(e){this.type===`number`&&this.setAttribute(`max`,e)}get step(){return this.getAttribute(`step`)||``}set step(e){this.type===`number`&&this.setAttribute(`step`,e)}get icon(){return this.getAttribute(`icon`)||``}set icon(e){e?this.setAttribute(`icon`,e):this.removeAttribute(`icon`)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}get sheet(){return K(this,`sheet`)}set sheet(e){q(this,`sheet`,e)}handlerExternalCss=()=>{J(this,this._shadowDom,`sheet`,null,this.sheet)};_updateValidity=()=>{let e=this._inputContent;this.required?e.setAttribute(`aria-required`,`true`):e.removeAttribute(`aria-required`);let t=e.validity;if(!this.disabled&&(t?!t.valid:this.required&&!this.value)){e.setAttribute(`aria-invalid`,`true`);let n={};for(let e of[`badInput`,`customError`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`])t?.[e]&&(n[e]=!0);t||(n.valueMissing=!0),this._internals?.setValidity?.(n,e.validationMessage||`Please fill out this field.`,e)}else e.removeAttribute(`aria-invalid`),this._internals?.setValidity?.({})};_syncValue=()=>{let e=this.value;this._inputContent.value!==e&&(this._inputContent.value=e),e?this._input.setAttribute(`value`,e):this._input.removeAttribute(`value`),this._internals?.setFormValue?.(this._inputContent.value),this._updateValidity()};checkValidity(){return ct(this._internals)}reportValidity(){return lt(this._internals)}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??``}formResetCallback(){this.value=this._defaultValue}customInput=e=>{e.stopPropagation(),e.preventDefault();let{target:t,data:n=``}=e;q(this,`value`,t?.value??n??``,{removeEmpty:!0}),this._syncValue(),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:this.value}}))};customKeydown=e=>{e.key!==`Enter`||e.isComposing||this._internals?.form?.requestSubmit()};customChange=()=>{q(this,`value`,this._inputContent?.value??this.value,{removeEmpty:!0}),this._syncValue(),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value}}))};listenPlaceholder=(e,t)=>{e===`placeholder`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`placeholder`):this._inputContent.setAttribute(`placeholder`,t))};listenLabel=(e,t)=>{e===`label`&&this._inputContent&&(t==null?(this._input.removeAttribute(`label`),this._label&&=(this._label.remove(),void 0)):this._label?this._label.textContent=t:(this._label=We().class(`ran-input-label`).part(`label`).text(t).build(),this._label.htmlFor=this._inputContent.id,this._shadowDom.insertBefore(this._label,this._input)))};listenType=(e,t)=>{if(e===`type`&&this._inputContent){t?this._inputContent.setAttribute(`type`,t):this._inputContent.removeAttribute(`type`);for(let e of[`min`,`max`,`step`])this.listenNumericConstraint(e,this.getAttribute(e));this._syncValue()}};listenStatus=(e,t)=>{e===`status`&&this._input&&(t?this._input.setAttribute(`status`,t):this._input.removeAttribute(`status`))};listenMessage=(e,t)=>{e===`message`&&(t?(this._message||(this._message=N().class(`ran-input-message`).part(`message`).build(),this._message.id=`${this._inputContent.id}-message`,this._shadowDom.appendChild(this._message),this._inputContent.setAttribute(`aria-describedby`,this._message.id)),this._message.textContent=t):this._message&&=(this._inputContent.removeAttribute(`aria-describedby`),this._message.remove(),void 0))};listenNumericConstraint=(e,t)=>{(e===`min`||e===`max`||e===`step`)&&this._inputContent&&(this.type===`number`&&t!=null?this._inputContent.setAttribute(e,t):this._inputContent.removeAttribute(e),this._updateValidity())};listenRequired=(e,t)=>{e===`required`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`required`):this._inputContent.setAttribute(`required`,``),this._updateValidity())};listenDisabled=(e,t)=>{e===`disabled`&&this._input&&(P.includes(t)?(this._input.removeAttribute(`disabled`),this._inputContent.removeAttribute(`disabled`)):(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)),this._updateValidity())};listenIcon=(e,t,n)=>{e===`icon`&&t&&t!==n&&(this.setAttribute(`icon`,t),this.dealIcon())};dealIcon=()=>{this._icon||(this._icon=M(`r-icon`).class(`ran-icon`).build(),this._inputContent.insertAdjacentElement(`beforebegin`,this._icon)),this.icon&&this._icon.setAttribute(`name`,this.icon)};listenEvent=(e,t,n)=>{this.listenType(e,n),this.listenPlaceholder(e,n),this.listenLabel(e,n),this.listenStatus(e,n),this.listenMessage(e,n),this.listenNumericConstraint(e,n),this.listenRequired(e,n),this.listenDisabled(e,n),this.listenIcon(e,n,t),e===`value`&&t!==n&&this._syncValue()};connectedCallback(){this.handlerExternalCss(),this._defaultValueCaptured||=(this._defaultValue=this.value,!0),this.value&&(this._inputContent.value=this.value,this._input.setAttribute(`value`,this.value)),this._internals?.setFormValue?.(this.value),this.status&&this._input.setAttribute(`status`,this.status),this.message&&this.listenMessage(`message`,this.message),F(this)&&(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)),this.type&&this._inputContent.setAttribute(`type`,this.type),this.type===`number`&&(this.min&&this._inputContent.setAttribute(`min`,this.min),this.max&&this._inputContent.setAttribute(`max`,this.max),this.step&&this._inputContent.setAttribute(`step`,this.step)),this.required&&this._inputContent.setAttribute(`required`,``),this._syncValue(),this._events.on(this._inputContent,`input`,this.customInput),this._events.on(this._inputContent,`change`,this.customChange),this._events.on(this._inputContent,`keydown`,this.customKeydown),document.readyState===`complete`&&this.dealIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(this.listenEvent(e,t,n),e===`sheet`&&this.handlerExternalCss())}};return I(`r-input`,$),e.Input=$,e.default=$,e})({}); \ No newline at end of file diff --git a/public/ranui-iife/popover.iife.js b/public/ranui-iife/popover.iife.js index 929c9dab2..7a7d751b8 100644 --- a/public/ranui-iife/popover.iife.js +++ b/public/ranui-iife/popover.iife.js @@ -1 +1 @@ -var ranui_popover=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=(e,t=500)=>{let n=null,r,i=null,a=()=>{if(n=null,!i)return;let t=i,a=r;i=null,r=void 0,e.apply(a,t)},o=function(...e){r=this,i=e,n!==null&&clearTimeout(n),n=setTimeout(a,t)};return o.cancel=()=>{n!==null&&clearTimeout(n),n=null,i=null,r=void 0},o.flush=()=>{n!==null&&(clearTimeout(n),a())},o.pending=()=>n!==null,o},n=()=>typeof window<`u`,r=()=>{if(!n())return!1;let e=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(e)},i=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},a=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},o=/["'&<>]/;function s(e){let t=``+e,n=o.exec(t);if(!n)return t;let r,i=``,a=0,s=0;for(a=n.index;a{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},l=new Map,u=new Map,d=`data-adopted-style`,f=`data-adopted-sheet`,p=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},m=(e,t,n=d)=>{if(!(typeof document>`u`)&&t&&!p(e,t,l)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},h=(e,t,n=f)=>{if(!(typeof document>`u`)&&t&&!p(e,t,u)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},g=(e,t,n,r)=>e===`end`?t+n-r:e===`center`?t+(n-r)/2:t,_=()=>({top:0,left:0,width:typeof window<`u`?window.innerWidth:1/0,height:typeof window<`u`?window.innerHeight:1/0}),ee=e=>{let{anchor:t,floating:n,offset:r=0,padding:i=8}=e,a=e.boundary??_(),[o,s]=e.placement.split(`-`),c=s??`start`,l=o,u=l===`top`||l===`bottom`,d=t.width>0&&t.height>0&&n.width>0&&n.height>0;if(d&&u){let e=a.top+a.height-(t.top+t.height),i=t.top-a.top;l===`bottom`&&ee?l=`top`:l===`top`&&ii&&(l=`bottom`)}else if(d){let e=a.left+a.width-(t.left+t.width),i=t.left-a.left;l===`right`&&ee?l=`left`:l===`left`&&ii&&(l=`right`)}let f=(e,t,n)=>g(c,e,t,n),p,m;if(l===`bottom`?(p=t.top+t.height+r,m=f(t.left,t.width,n.width)):l===`top`?(p=t.top-n.height-r,m=f(t.left,t.width,n.width)):l===`right`?(p=f(t.top,t.height,n.height),m=t.left+t.width+r):(p=f(t.top,t.height,n.height),m=t.left-n.width-r),d&&u){let e=a.left+i,t=a.left+a.width-n.width-i;t>=e&&(m=Math.min(Math.max(m,e),t))}else if(d){let e=a.top+i,t=a.top+a.height-n.height-i;t>=e&&(p=Math.min(Math.max(p,e),t))}return{top:p,left:m,placement:s?`${l}-${c}`:l,side:l,align:c}},v=typeof document>`u`,y=0,b=1,x=2,S=null,C=null,w=0,T=new Set,E=!1;function te(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)j(e,x);w===0&&ae()}}]}function D(e){let t=ne(e,!0);return re(t),se(t),()=>M(t)}function O(e){let t=S;S=null;try{return e()}finally{S=t}}function k(e){let t={owned:[],cleanups:[],owner:C},n=C,r=S;C=t,S=null;try{return e(()=>le(t))}finally{C=n,S=r}}function A(e){C&&C.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:x,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:C}}function re(e){C&&C.owned.push(e)}function ie(e){S&&(S.sources.add(e),e.observers.add(S))}function j(e,t){if(e.disposed||e.state>=t)return;let n=e.state===y;if(e.state=t,e.isEffect)T.add(e);else if(n)for(let t of e.observers)j(t,b)}function ae(){if(!(w>0||E)){E=!0;try{for(;T.size>0;){let e=[...T];T.clear();for(let t of e)t.disposed||oe(t)}}finally{E=!1}}}function oe(e){if(!(e.disposed||e.state===y)){if(e.state===b)for(let t of e.sources)`fn`in t&&oe(t);e.state===x&&se(e),e.state=y}}function se(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);ce(e);let t=S,n=C;S=e,C=e,e.running=!0,e.state=y;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)j(t,x)}}finally{e.running=!1,S=t,C=n}}function ce(e){for(let t of e.owned)M(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function M(e){e.disposed||(e.disposed=!0,ce(e),e.observers.clear())}function le(e){for(let t of e.owned)M(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function ue(e){return s(e)}var de=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,fe=`.#[`;function pe(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var me=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},he=(e,t)=>{let n=t.trim();if(!n)return!1;let r=pe(n);return r!==null&&r.every(t=>me(e,t))},N=(e,t,n)=>{for(let r of e)de(r)&&(he(r,t)&&n.push(r),N(r.childrenList,t,n))},P=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?s(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}},ge=new Map,F=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ge}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:s(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new P)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new _e(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${ue(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${ue(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?s(e):(e instanceof P,e.serialize())).join(``):a+=s(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}`}},_e=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return N(this.childrenList,e,t),t}serialize(){return``}},I={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){I.append(e,n);continue}if(typeof n==`function`){I.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof L?n.build():typeof n==`string`&&!v?document.createTextNode(n):n;e.appendChild(t)}}},ve=`http://www.w3.org/2000/svg`,ye=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),L=class{runtime;el;constructor(e,t,n=I){this.runtime=n;let r=t??(ye.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=v?new F(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{v?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(v){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new be(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(v)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},be=class{runtime;root;hostEl;constructor(e,t,n,r=I){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(v)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return v?this.root.serialize():this.root.innerHTML}},R=()=>({current:null}),z=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(z(t)):e.concat(t),[]),B=e=>e==null?null:e instanceof L?e.build():typeof e==`string`?v?e:document.createTextNode(e):e,xe=(e,t)=>{if(v){V(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};D(()=>{let e=t();a();let n=document.createDocumentFragment();i=k(t=>(V(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),A(()=>i?.())},Se=`__ranFor`,Ce=e=>typeof e==`object`&&!!e&&e[Se]===!0,we=(e,t,n)=>{let[r,i]=te(t),a=null,o=k(t=>{let i=B(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},Te=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},Ee=(e,t)=>{if(v){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;A(()=>{for(let e of r.values())e.dispose();r.clear()}),D(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Me()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=we(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();Te(n,a),r=i})},De=`__ranIndex`,Oe=e=>typeof e==`object`&&!!e&&e[De]===!0,ke=(e,t,n)=>{let[r,i]=te(e),a=null,o=k(e=>{let i=B(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ae=(e,t)=>{if(v){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];A(()=>{for(let e of r)e.dispose();r=[]}),D(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}Te(n,r.map(e=>e.node).filter(e=>e!=null))})},V=(e,t)=>{v?O(()=>je(e,t)):je(e,t)},je=(e,t)=>{z(t).forEach(t=>{if(Ce(t)){Ee(e,t);return}if(Oe(t)){Ae(e,t);return}if(typeof t==`function`){xe(e,t);return}let n=B(t);n!=null&&e.appendChild(n)})},Me=()=>!1,Ne={bind(e,t){if(typeof e!=`function`){t(e);return}v?O(()=>t(e())):D(()=>t(e()))},append:V},Pe=class extends L{constructor(e,t){super(e,t,Ne)}};function Fe(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,ve),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ie,Div:H,Svg:Le,Span:Re,Slot:U,ButtonBuilder:ze,InputBuilder:Be,Style:Ve,Label:He,Ul:Ue,Li:We,Section:Ge,Article:Ke,Nav:qe,Header:Je,Footer:Ye,Main:Xe,DeclarativeShadow:Ze}=Fe(Pe),Qe=new Map;function W(e,t){v?(Qe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var G=typeof document<`u`?HTMLElement:F,$e=`data-ranui`,et=`data-ranui-sheet`,tt=(e,t)=>m(e,t,$e),nt=(e,t)=>h(e,t,et),rt=new WeakMap,it=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,K=new Map,at=e=>{let t=K.get(e);if(t!==void 0)return t;let n=e?`${e}\n${it}`:it;return K.set(e,n),n},q=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||rt.get(e)||e.attachShadow(n);return rt.set(e,r),tt(r,at(t)),r},J=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},Y=(e,t,n=``)=>e.getAttribute(t)??n,X=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},ot=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&nt(t,a)},st=`:host{visibility:hidden;position:absolute}`;W(`r-content`,class extends G{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=q(this,st);let e=U().class(`slot`).build();this._shadowDom.appendChild(e),this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{for(let t of e)(t.type===`childList`||t.type===`attributes`)&&this.onChange(t)};onChange=e=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{type:e.type,value:{content:this.children,mutation:e}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}});var ct=`@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:ranui-dropdown-down-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-down-out{animation:ranui-dropdown-down-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-up-in{animation:ranui-dropdown-up-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-up-out{animation:ranui-dropdown-up-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-left-in{animation:ranui-dropdown-left-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-left-out{animation:ranui-dropdown-left-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-right-in{animation:ranui-dropdown-right-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-right-out{animation:ranui-dropdown-right-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}:host([hidden]){display:none}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,var(--ran-text-label-1,14px));font-weight:var(--ran-dropdown-font-weight,var(--ran-text-label-weight,500));list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border:var(--ran-dropdown-border,1px solid var(--ran-color-border,#eaeaea));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-anchor-offset,0px))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0;left:50%}.ranui-dropdown-container .bottom{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-anchor-offset,0px))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);left:50%;top:max(0px, calc(100% - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px) + var(--ran-dropdown-arrow-overlap,2px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-shape-offset,calc(var(--ran-dropdown-arrow-width,16px) * -.301126)) + var(--ran-dropdown-arrow-anchor-offset-y,0px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(calc(0px - var(--ran-dropdown-arrow-overlap,2px))) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-shape-offset,calc(var(--ran-dropdown-arrow-width,16px) * -.301126)) + var(--ran-dropdown-arrow-anchor-offset-y,0px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow svg{width:100%;height:100%;display:block;overflow:visible}.ranui-dropdown-arrow path{fill:var(--ran-dropdown-arrow-fill-background,var(--ran-dropdown-arrow-tip-background,var(--ran-color-bg-elevated,#fff)));filter:var(--ran-dropdown-arrow-shadow,drop-shadow(2px 2px 3px #0000000d))}@media (prefers-reduced-motion:reduce){.ran-dropdown-down-in,.ran-dropdown-down-out,.ran-dropdown-up-in,.ran-dropdown-up-out,.ran-dropdown-left-in,.ran-dropdown-left-out,.ran-dropdown-right-in,.ran-dropdown-right-out{animation:none}}`;W(`r-dropdown`,class extends G{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=q(this,ct);let e=R(),t=R(),n=H().class(`ranui-dropdown-container`).children(H().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).ref(e).part(`dropdown`).children(U().class(`slot`).ref(t))).build();this._shadowDom.appendChild(n),this.container=n,this.dropdown=J(e,`ranui dropdown`),this._slot=J(t,`slot`)}get transit(){return Y(this,`transit`)}set transit(e){X(this,`transit`,e,{removeEmpty:!0})}get arrow(){return Y(this,`arrow`)}set arrow(e){X(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return Y(this,`sheet`)}set sheet(e){X(this,`sheet`,e)}handlerExternalCss=()=>{ot(this,this._shadowDom,`sheet`,null,this.sheet)};appliedTransit=``;handlerTransit=()=>{this.dropdown&&(this.appliedTransit&&a(this.dropdown,this.appliedTransit),this.appliedTransit=this.transit,this.appliedTransit&&i(this.dropdown,this.appliedTransit))};getAnimationTarget=()=>this.dropdown;handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=H().class(`ranui-dropdown-arrow`).build(),this.arrowIcon.innerHTML=``,this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&this.handlerTransit(),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var lt=`:host{display:var(--ran-popover-host-display,block)}.ran-popover{box-sizing:var(--ran-popover-box-sizing,border-box);position:var(--ran-popover-position,relative);display:var(--ran-popover-display,block);margin:var(--ran-popover-margin,0);padding:var(--ran-popover-padding,0)}.ran-popover-block{display:var(--ran-popover-block-display,block)}`,ut={bottom:{enter:`ran-dropdown-down-in`,exit:`ran-dropdown-down-out`},top:{enter:`ran-dropdown-up-in`,exit:`ran-dropdown-up-out`},left:{enter:`ran-dropdown-left-in`,exit:`ran-dropdown-left-out`},right:{enter:`ran-dropdown-right-in`,exit:`ran-dropdown-right-out`}},Z=Symbol.for(`ranui.floating.panel-owner`),dt=e=>e.getAnimationTarget?.()??e,ft=(e,t)=>{let n=dt(e);if(typeof n.getAnimations!=`function`||typeof requestAnimationFrame!=`function`){t();return}requestAnimationFrame(()=>{let e=n.getAnimations();if(!e.length){t();return}(async()=>{await Promise.allSettled(e.map(e=>e.finished)),t()})()})},pt=class{options;repositionBound=!1;outsideBinding=0;opened=!1;repositionFrame=0;generation=0;resolvedSide;constructor(e){this.options=e}get anchor(){return this.options.anchor?.()??this.options.host}containsEvent(e){let t=this.options.panel();return e.composedPath().some(e=>{let n=e instanceof Node?e:null,r=new Set;for(;n&&!r.has(n);){if(n===this.options.host||n===t)return!0;r.add(n),n=n[Z]??n.parentNode??(n instanceof ShadowRoot?n.host:null)}return!1})}bindOutside(e,t){let{host:n}=this.options,r=n.getRootNode(),i=n.ownerDocument,a=++this.outsideBinding,o=new WeakSet;r!==i&&e.on(r,`click`,e=>{o.add(e),this.opened&&!this.containsEvent(e)&&t(e)},{capture:!0}),e.on(i,`click`,e=>{if(!this.opened)return;let s=this.containsEvent(e),c=this.generation;if(r===i){s||t(e);return}setTimeout(()=>{a===this.outsideBinding&&c===this.generation&&n.isConnected&&this.opened&&!o.has(e)&&!s&&t(e)},0)},{capture:!0})}apply=e=>{let{host:t}=this.options;t.setAttribute(`aria-expanded`,e?`true`:`false`);let n=this.options.panel();if(!n||e===this.opened)return;this.opened=e;let r=++this.generation;if(e){n[Z]=t,this.resolvedSide=void 0,t.dispatchEvent(new CustomEvent(`show`)),n.style.setProperty(`display`,`block`),this.attachReposition(),this.position(!0),ft(n,()=>{r===this.generation&&(n.removeAttribute(`transit`),t.dispatchEvent(new CustomEvent(`after-show`)))});return}delete n[Z],this.detachReposition(),t.dispatchEvent(new CustomEvent(`hide`)),n.setAttribute(`transit`,ut[this.resolvedSide??this.side()].exit),ft(n,()=>{r===this.generation&&(n.style.setProperty(`display`,`none`),n.removeAttribute(`transit`),t.dispatchEvent(new CustomEvent(`after-hide`)))})};side=()=>this.options.placement().split(`-`)[0];position=(e=!1)=>{if(!this.options.panel())return;let t=()=>{let t=this.options.panel();t&&this.write(t,e)};e&&typeof requestAnimationFrame==`function`?requestAnimationFrame(t):t()};write(e,t){let{offset:n=0,containerId:r,beforeMeasure:i,measurePanel:a,adjust:o,afterPosition:s}=this.options,c=this.anchor.getBoundingClientRect();i?.(c,e);let l=this.options.host.getRootNode(),u=r?.()??``,d=u?l.getElementById?.(u)??document.getElementById(u):null,f=e.getBoundingClientRect(),p=a?.(e),m=f,h=p?.width??f.width,_=p?.height??f.height,v=this.options.placement(),[y,b]=v.split(`-`),x=b??`start`,S,C,w=y;if(d){let e=d.getBoundingClientRect();w===`top`||w===`bottom`?(S=w===`bottom`?c.bottom-e.top+n:c.top-e.top-_-n,C=g(x,c.left,c.width,h)-e.left):(S=g(x,c.top,c.height,_)-e.top,C=w===`right`?c.right-e.left+n:c.left-e.left-h-n)}else{let e=ee({anchor:{top:c.top,left:c.left,width:c.width,height:c.height},floating:{width:h,height:_},placement:v,offset:n});w=e.side,S=e.top+window.scrollY,C=e.left+window.scrollX}let T={top:S,left:C,side:w,align:x,anchorRect:c,panelRect:m,container:d},E=o?.(T,e);E&&(T.top=E.top,T.left=E.left),this.resolvedSide=T.side,e.style.setProperty(`position`,`absolute`),e.style.setProperty(`inset`,`${T.top}px auto auto ${T.left}px`),e.style.setProperty(`--ran-x`,`${T.left}px`),e.style.setProperty(`--ran-y`,`${T.top}px`),t&&e.setAttribute(`transit`,ut[T.side].enter),s?.(T,e)}reposition=()=>{if(!(!this.opened||this.repositionFrame)){if(typeof requestAnimationFrame!=`function`){this.position();return}this.repositionFrame=requestAnimationFrame(()=>{this.repositionFrame=0,this.opened&&this.position()})}};attachReposition(){this.repositionBound||typeof window>`u`||(window.addEventListener(`scroll`,this.reposition,!0),window.addEventListener(`resize`,this.reposition),this.repositionBound=!0)}detachReposition(){!this.repositionBound||typeof window>`u`||(window.removeEventListener(`scroll`,this.reposition,!0),window.removeEventListener(`resize`,this.reposition),this.repositionBound=!1)}destroy=()=>{this.generation++,this.outsideBinding++,this.opened=!1;let e=this.options.panel();e&&delete e[Z],this.repositionFrame&&typeof cancelAnimationFrame==`function`&&(cancelAnimationFrame(this.repositionFrame),this.repositionFrame=0),this.detachReposition()}};function mt(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}var ht=8,gt=300,Q=16,_t=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),vt={top:`bottom`,bottom:`top`,left:`right`,right:`left`},$=class extends G{_events=new c;_slot;popoverBlock;popoverContent;popoverInner;popoverInnerBlock;_shadowDom;removeTimeId;_repositionBound=!1;_floating=new pt({host:this,panel:()=>this.popoverContent,anchor:()=>Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this,placement:()=>this.placement,offset:ht,containerId:()=>this.getPopupContainerId,afterPosition:(e,t)=>{let{anchorRect:n,panelRect:r,side:i}=e,a=vt[i];a&&t.setAttribute(`arrow`,a),t.style.setProperty(`--ran-dropdown-arrow-anchor-width`,`${n.width}px`),t.style.setProperty(`--ran-dropdown-arrow-anchor-height`,`${n.height}px`),t.style.setProperty(`--ran-dropdown-min-width`,`${r.width}px`),t.style.setProperty(`--ran-dropdown-min-height`,`${r.height}px`);let o=t.getBoundingClientRect(),s=n.left+n.width/2,c=o.left+o.width/2;t.style.setProperty(`--ran-dropdown-arrow-anchor-offset`,`${s-c}px`),t.style.setProperty(`--ran-dropdown-arrow-anchor-offset-y`,`${n.top-o.top}px`)}});static get observedAttributes(){return[`open`,`placement`,`trigger`,`sheet`]}closePopover=()=>{this.setDropdownDisplayNone()};constructor(){super(),this._shadowDom=q(this,lt);let e=R(),t=H().class(`ran-popover-block`).role(`tooltip`).children(U().class(`slot`).ref(e)).build();this._shadowDom.appendChild(t),this.popoverBlock=t,this._slot=J(e,`slot`)}get placement(){return Y(this,`placement`,`top`)}set placement(e){X(this,`placement`,e)}get placementSide(){return this.placement.split(`-`)[0]}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}_applyOpen=()=>{this._floating.apply(this.open)};show=()=>{this.open=!0};hide=()=>{this.open=!1};toggle=()=>{this.open=!this.open};get trigger(){return Y(this,`trigger`,`hover`)}set trigger(e){X(this,`trigger`,e)}get getPopupContainerId(){return Y(this,`getPopupContainerId`)}set getPopupContainerId(e){X(this,`getPopupContainerId`,e)}get sheet(){return Y(this,`sheet`)}set sheet(e){X(this,`sheet`,e)}handlerExternalCss=()=>{ot(this,this._shadowDom,`sheet`,null,this.sheet)};initAria=()=>{this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.setAttribute(`aria-haspopup`,`dialog`),this.setAttribute(`aria-expanded`,`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};stopPropagation=e=>{e.stopPropagation()};createContent=e=>{if(e){if(!this.popoverContent){let e=getComputedStyle(this).getPropertyValue(`--ran-popover-content-padding`).trim()||`12px`;this.popoverContent=Ie(`r-dropdown`).class(`ran-popover-dropdown`).style(`display`,`none`).style(`position`,`absolute`).cssVar(`ran-dropdown-padding`,e).build(),this.popoverContent?.addEventListener(`click`,this.stopPropagation);let t=H().children(this.popoverContent).build();this.popoverInner=t,this.trigger.includes(`hover`)&&!r()&&(this.popoverContent?.addEventListener(`mouseleave`,this.blur),this.popoverContent?.addEventListener(`mouseenter`,this.removeDropDownTimeId));let n=this.getRootNode();((n.getElementById?n.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body).appendChild(t)}if(this.popoverContent&&e.length>0){this.popoverContent.innerHTML=``;let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);this.popoverContent.appendChild(t)}}};watchContent=e=>{let{value:t}=e.detail;this.createContent(t.content)};blur=t(()=>{this.removeTimeId&&this.removeDropDownTimeId(),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(),this.setDropdownDisplayNone()},gt)},Q);removeDropDownTimeId=t(()=>{this.trigger.includes(`hover`)&&!r()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)},Q);setDropdownDisplayBlock=t(()=>{this.open=!0},Q);setDropdownDisplayNone=t(()=>{this.open=!1},Q);placementPosition=()=>{this._floating.position()};hoverPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock()};clickContent=e=>{e.stopPropagation()};clickPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0,this.toggle()};keydownPopover=e=>{mt(e)&&(e.preventDefault(),this.setDropdownDisplayBlock()),e.key===`Escape`&&(e.preventDefault(),this.setDropdownDisplayNone())};clickRemovePopover=e=>{this.hoverRemovePopover(e)};popoverTrigger=()=>{this._events.abort();for(let e of this.children)e.tagName===`R-CONTENT`&&this._events.on(e,`change`,this.watchContent);this.trigger.includes(`hover`)&&!r()&&(this._events.on(this,`mouseenter`,this.hoverPopover),this._events.on(this,`mouseleave`,this.blur)),this._events.on(this,`click`,this.clickPopover).on(this,`keydown`,this.keydownPopover),this._floating.bindOutside(this._events,this.clickRemovePopover)};hoverRemovePopover=e=>{this._floating.containsEvent(e)||this.setDropdownDisplayNone()};changePlacement=t(()=>{if(!this.getPopupContainerId&&this.open)return;let e=vt[this.placementSide];e&&this.popoverContent?.setAttribute(`arrow`,e)},Q);connectedCallback(){this.initAria(),this.handlerExternalCss();for(let e of this.children)e.tagName===`R-CONTENT`&&this.createContent(e.children);this.popoverTrigger(),this.changePlacement()}disconnectedCallback(){this._events.abort(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),this.removeDropDownTimeId.cancel(),this._floating.destroy(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0,this.popoverInner?.remove(),this.popoverInner=void 0,this.popoverContent=void 0}attributeChangedCallback(e,t,n){t!==n&&(e===`trigger`&&this.popoverTrigger(),e===`placement`&&this.changePlacement(),e===`sheet`&&this.handlerExternalCss(),e===`open`&&this._applyOpen())}};return W(`r-popover`,$),e.PLACEMENT_TYPE=_t,e.Popover=$,e.default=$,e})({}); \ No newline at end of file +var ranui_popover=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=(e,t=500)=>{let n=null,r,i=null,a=()=>{if(n=null,!i)return;let t=i,a=r;i=null,r=void 0,e.apply(a,t)},o=function(...e){r=this,i=e,n!==null&&clearTimeout(n),n=setTimeout(a,t)};return o.cancel=()=>{n!==null&&clearTimeout(n),n=null,i=null,r=void 0},o.flush=()=>{n!==null&&(clearTimeout(n),a())},o.pending=()=>n!==null,o},n=()=>typeof window<`u`,r=()=>{if(!n())return!1;let e=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(e)},i=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},a=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},o=/["'&<>]/;function s(e){let t=``+e,n=o.exec(t);if(!n)return t;let r,i=``,a=0,s=0;for(a=n.index;a{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},l=new Map,u=`data-adopted-style`,d=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},f=(e,t,n=u)=>{if(typeof document<`u`&&t&&!d(e,t,l)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},p=(e,t,n,r)=>e===`end`?t+n-r:e===`center`?t+(n-r)/2:t,m=()=>({top:0,left:0,width:typeof window<`u`?window.innerWidth:1/0,height:typeof window<`u`?window.innerHeight:1/0}),h=e=>{let{anchor:t,floating:n,offset:r=0,padding:i=8}=e,a=e.boundary??m(),[o,s]=e.placement.split(`-`),c=s??`start`,l=o,u=l===`top`||l===`bottom`,d=t.width>0&&t.height>0&&n.width>0&&n.height>0;if(d&&u){let e=a.top+a.height-(t.top+t.height),i=t.top-a.top;l===`bottom`&&ee?l=`top`:l===`top`&&ii&&(l=`bottom`)}else if(d){let e=a.left+a.width-(t.left+t.width),i=t.left-a.left;l===`right`&&ee?l=`left`:l===`left`&&ii&&(l=`right`)}let f=(e,t,n)=>p(c,e,t,n),h,g;if(l===`bottom`?(h=t.top+t.height+r,g=f(t.left,t.width,n.width)):l===`top`?(h=t.top-n.height-r,g=f(t.left,t.width,n.width)):l===`right`?(h=f(t.top,t.height,n.height),g=t.left+t.width+r):(h=f(t.top,t.height,n.height),g=t.left-n.width-r),d&&u){let e=a.left+i,t=a.left+a.width-n.width-i;t>=e&&(g=Math.min(Math.max(g,e),t))}else if(d){let e=a.top+i,t=a.top+a.height-n.height-i;t>=e&&(h=Math.min(Math.max(h,e),t))}return{top:h,left:g,placement:s?`${l}-${c}`:l,side:l,align:c}},g=typeof document>`u`,_=0,v=1,y=2,b=null,x=null,S=0,C=new Set,w=!1;function T(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)A(e,y);S===0&&re()}}]}function E(e){let t=ee(e,!0);return te(t),ae(t),()=>j(t)}function D(e){let t=b;b=null;try{return e()}finally{b=t}}function O(e){let t={owned:[],cleanups:[],owner:x},n=x,r=b;x=t,b=null;try{return e(()=>se(t))}finally{x=n,b=r}}function k(e){x&&x.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:y,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:x}}function te(e){x&&x.owned.push(e)}function ne(e){b&&(b.sources.add(e),e.observers.add(b))}function A(e,t){if(e.disposed||e.state>=t)return;let n=e.state===_;if(e.state=t,e.isEffect)C.add(e);else if(n)for(let t of e.observers)A(t,v)}function re(){if(!(S>0||w)){w=!0;try{for(;C.size>0;){let e=[...C];C.clear();for(let t of e)t.disposed||ie(t)}}finally{w=!1}}}function ie(e){if(!(e.disposed||e.state===_)){if(e.state===v)for(let t of e.sources)`fn`in t&&ie(t);e.state===y&&ae(e),e.state=_}}function ae(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);oe(e);let t=b,n=x;b=e,x=e,e.running=!0,e.state=_;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)A(t,y)}}finally{e.running=!1,b=t,x=n}}function oe(e){for(let t of e.owned)j(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function j(e){e.disposed||(e.disposed=!0,oe(e),e.observers.clear())}function se(e){for(let t of e.owned)j(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function ce(e){return s(e)}var le=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ue=`.#[`;function de(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var fe=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},pe=(e,t)=>{let n=t.trim();if(!n)return!1;let r=de(n);return r!==null&&r.every(t=>fe(e,t))},M=(e,t,n)=>{for(let r of e)le(r)&&(pe(r,t)&&n.push(r),M(r.childrenList,t,n))},N=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?s(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}},me=new Map,he=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??me}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:s(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new N)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new ge(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${ce(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${ce(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?s(e):(e instanceof N,e.serialize())).join(``):a+=s(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}`}},ge=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}serialize(){return``}},P={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){P.append(e,n);continue}if(typeof n==`function`){P.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof F?n.build():typeof n==`string`&&!g?document.createTextNode(n):n;e.appendChild(t)}}},_e=`http://www.w3.org/2000/svg`,ve=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),F=class{runtime;el;constructor(e,t,n=P){this.runtime=n;let r=t??(ve.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=g?new he(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{g?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(g){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ye(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(g)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ye=class{runtime;root;hostEl;constructor(e,t,n,r=P){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(g)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return g?this.root.serialize():this.root.innerHTML}},I=()=>({current:null}),be=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(be(t)):e.concat(t),[]),L=e=>e==null?null:e instanceof F?e.build():typeof e==`string`?g?e:document.createTextNode(e):e,xe=(e,t)=>{if(g){R(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};E(()=>{let e=t();a();let n=document.createDocumentFragment();i=O(t=>(R(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),k(()=>i?.())},Se=`__ranFor`,Ce=e=>typeof e==`object`&&!!e&&e[Se]===!0,we=(e,t,n)=>{let[r,i]=T(t),a=null,o=O(t=>{let i=L(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},Te=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},Ee=(e,t)=>{if(g){(t.each()??[]).forEach((n,r)=>{let i=L(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;k(()=>{for(let e of r.values())e.dispose();r.clear()}),E(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Me()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=we(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();Te(n,a),r=i})},De=`__ranIndex`,Oe=e=>typeof e==`object`&&!!e&&e[De]===!0,ke=(e,t,n)=>{let[r,i]=T(e),a=null,o=O(e=>{let i=L(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ae=(e,t)=>{if(g){(t.each()??[]).forEach((n,r)=>{let i=L(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];k(()=>{for(let e of r)e.dispose();r=[]}),E(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}Te(n,r.map(e=>e.node).filter(e=>e!=null))})},R=(e,t)=>{g?D(()=>je(e,t)):je(e,t)},je=(e,t)=>{be(t).forEach(t=>{if(Ce(t)){Ee(e,t);return}if(Oe(t)){Ae(e,t);return}if(typeof t==`function`){xe(e,t);return}let n=L(t);n!=null&&e.appendChild(n)})},Me=()=>!1,Ne={bind(e,t){typeof e==`function`?g?D(()=>t(e())):E(()=>t(e())):t(e)},append:R},Pe=class extends F{constructor(e,t){super(e,t,Ne)}};function Fe(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,_e),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ie,Div:z,Svg:Le,Span:Re,Slot:B,ButtonBuilder:ze,InputBuilder:Be,Style:Ve,Label:He,Ul:Ue,Li:We,Section:Ge,Article:Ke,Nav:qe,Header:Je,Footer:Ye,Main:Xe,DeclarativeShadow:Ze}=Fe(Pe),Qe=new Map;function V(e,t){g?(Qe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var H=typeof document<`u`?HTMLElement:he,$e=`data-ranui`,et=`data-ranui-sheet`,tt=(e,t)=>f(e,t,$e),U=new WeakMap,W=new Map,nt=e=>{if(typeof CSSStyleSheet>`u`)return;let t=W.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},W.set(e,t)}catch{return}return t.users++,t.sheet},rt=e=>{let t=W.get(e);t&&--t.users===0&&W.delete(e)},it=(e,t)=>{if(typeof document>`u`)return;let n=U.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),rt(n.text)):n&&e.querySelector(`style[${et}]`)?.remove(),U.delete(e),!t))return;let r=nt(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{rt(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(et,``),n.textContent=t,e.appendChild(n)}U.set(e,{text:t,sheet:r})},at=new WeakMap,ot=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,st=new Map,ct=e=>{let t=st.get(e);if(t!==void 0)return t;let n=e?`${e}\n${ot}`:ot;return st.set(e,n),n},G=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||at.get(e)||e.attachShadow(n);return at.set(e,r),tt(r,ct(t)),r},K=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},q=(e,t,n=``)=>e.getAttribute(t)??n,J=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},lt=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&it(t,e.getAttribute(`sheet`)||``)},ut=`:host{visibility:hidden;position:absolute}`;V(`r-content`,class extends H{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=G(this,ut);let e=B().class(`slot`).build();this._shadowDom.appendChild(e),this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{let t=e.filter(e=>e.type===`childList`||e.type===`attributes`);if(!t.length)return;let n=t[t.length-1];this.dispatchEvent(new CustomEvent(`change`,{detail:{type:t.some(e=>e.type===`childList`)?`childList`:`attributes`,value:{content:this.children,mutation:n,mutations:t}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}});var dt=`@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:ranui-dropdown-down-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-down-out{animation:ranui-dropdown-down-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-up-in{animation:ranui-dropdown-up-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-up-out{animation:ranui-dropdown-up-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-left-in{animation:ranui-dropdown-left-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-left-out{animation:ranui-dropdown-left-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-right-in{animation:ranui-dropdown-right-in var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}.ran-dropdown-right-out{animation:ranui-dropdown-right-out var(--ran-dropdown-animation-duration,.3s);animation-fill-mode:forwards}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,auto)}:host([hidden]){display:none}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,var(--ran-text-label-1,14px));font-weight:var(--ran-dropdown-font-weight,var(--ran-text-label-weight,500));list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border:var(--ran-dropdown-border,1px solid var(--ran-color-border,#eaeaea));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-anchor-offset,0px))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0;left:50%}.ranui-dropdown-container .bottom{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-anchor-offset,0px))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);left:50%;top:max(0px, calc(100% - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px) + var(--ran-dropdown-arrow-overlap,2px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-shape-offset,calc(var(--ran-dropdown-arrow-width,16px) * -.301126)) + var(--ran-dropdown-arrow-anchor-offset-y,0px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(calc(0px - var(--ran-dropdown-arrow-overlap,2px))) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-shape-offset,calc(var(--ran-dropdown-arrow-width,16px) * -.301126)) + var(--ran-dropdown-arrow-anchor-offset-y,0px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow svg{width:100%;height:100%;display:block;overflow:visible}.ranui-dropdown-arrow path{fill:var(--ran-dropdown-arrow-fill-background,var(--ran-dropdown-arrow-tip-background,var(--ran-color-bg-elevated,#fff)));filter:var(--ran-dropdown-arrow-shadow,drop-shadow(2px 2px 3px #0000000d))}@media (prefers-reduced-motion:reduce){.ran-dropdown-down-in,.ran-dropdown-down-out,.ran-dropdown-up-in,.ran-dropdown-up-out,.ran-dropdown-left-in,.ran-dropdown-left-out,.ran-dropdown-right-in,.ran-dropdown-right-out{animation:none}}`;V(`r-dropdown`,class extends H{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=G(this,dt);let e=I(),t=I(),n=z().class(`ranui-dropdown-container`).children(z().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).ref(e).part(`dropdown`).children(B().class(`slot`).ref(t))).build();this._shadowDom.appendChild(n),this.container=n,this.dropdown=K(e,`ranui dropdown`),this._slot=K(t,`slot`)}get transit(){return q(this,`transit`)}set transit(e){J(this,`transit`,e,{removeEmpty:!0})}get arrow(){return q(this,`arrow`)}set arrow(e){J(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{lt(this,this._shadowDom,`sheet`,null,this.sheet)};appliedTransit=``;handlerTransit=()=>{this.dropdown&&(this.appliedTransit&&a(this.dropdown,this.appliedTransit),this.appliedTransit=this.transit,this.appliedTransit&&i(this.dropdown,this.appliedTransit))};getAnimationTarget=()=>this.dropdown;handlerArrow=()=>{let e=(this.arrow||``).trim();e?(!this.arrowIcon&&this.container&&(this.arrowIcon=z().class(`ranui-dropdown-arrow`).build(),this.arrowIcon.innerHTML=``,this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)):(this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&this.handlerTransit(),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var ft=`:host{display:var(--ran-popover-host-display,block)}.ran-popover{box-sizing:var(--ran-popover-box-sizing,border-box);position:var(--ran-popover-position,relative);display:var(--ran-popover-display,block);margin:var(--ran-popover-margin,0);padding:var(--ran-popover-padding,0)}.ran-popover-block{display:var(--ran-popover-block-display,block)}`,pt={bottom:{enter:`ran-dropdown-down-in`,exit:`ran-dropdown-down-out`},top:{enter:`ran-dropdown-up-in`,exit:`ran-dropdown-up-out`},left:{enter:`ran-dropdown-left-in`,exit:`ran-dropdown-left-out`},right:{enter:`ran-dropdown-right-in`,exit:`ran-dropdown-right-out`}},Y=Symbol.for(`ranui.floating.panel-owner`),X=Symbol.for(`ranui.floating.panel-escape`),Z=Symbol.for(`ranui.floating.active-panels`),mt=`ranui-floating-change`,ht=(e,t)=>{let n=new Set,r=e;for(;r&&!n.has(r);){if(r===t)return!0;n.add(r),r=r[Y]??r.parentNode??(r instanceof ShadowRoot?r.host:null)}return!1},gt=e=>[...e.ownerDocument[Z]??[]].filter(t=>t.isConnected&&ht(t,e)),_t=(e,t)=>{gt(e).at(-1)?.[X]?.(t)},Q=(e,t,n)=>{let r=e.ownerDocument;t?(e[Y]=t,e[X]=n,(r[Z]??=new Set).add(e)):(delete e[Y],delete e[X],r[Z]?.delete(e)),r.dispatchEvent(new Event(mt))},vt=e=>e.getAnimationTarget?.()??e,yt=(e,t)=>{let n=vt(e);typeof n.getAnimations!=`function`||typeof requestAnimationFrame!=`function`?t():requestAnimationFrame(()=>{let e=n.getAnimations();e.length?(async()=>{await Promise.allSettled(e.map(e=>e.finished)),t()})():t()})},bt=class{options;repositionBound=!1;outsideBinding=0;opened=!1;repositionFrame=0;generation=0;resolvedSide;constructor(e){this.options=e}get anchor(){return this.options.anchor?.()??this.options.host}containsEvent(e){let t=this.options.panel();return e.composedPath().some(e=>{let n=e instanceof Node?e:null,r=new Set;for(;n&&!r.has(n);){if(n===this.options.host||n===t)return!0;r.add(n),n=n[Y]??n.parentNode??(n instanceof ShadowRoot?n.host:null)}return!1})}bindOutside(e,t){let{host:n}=this.options,r=n.getRootNode(),i=n.ownerDocument,a=++this.outsideBinding,o=new WeakSet;r!==i&&e.on(r,`click`,e=>{o.add(e),this.opened&&!this.containsEvent(e)&&t(e)},{capture:!0}),e.on(i,`click`,e=>{if(!this.opened)return;let s=this.containsEvent(e),c=this.generation;r===i?s||t(e):setTimeout(()=>{a===this.outsideBinding&&c===this.generation&&n.isConnected&&this.opened&&!o.has(e)&&!s&&t(e)},0)},{capture:!0})}apply=e=>{let{host:t}=this.options;t.setAttribute(`aria-expanded`,e?`true`:`false`);let n=this.options.panel();if(!n||e===this.opened)return;this.opened=e;let r=++this.generation;e?(n.style.setProperty(`z-index`,`var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100))`),Q(n,t,this.options.onEscape),this.resolvedSide=void 0,t.dispatchEvent(new CustomEvent(`show`)),n.style.setProperty(`display`,`block`),this.attachReposition(),this.position(!0),yt(n,()=>{r===this.generation&&(n.removeAttribute(`transit`),t.dispatchEvent(new CustomEvent(`after-show`)))})):(Q(n),this.detachReposition(),t.dispatchEvent(new CustomEvent(`hide`)),n.setAttribute(`transit`,pt[this.resolvedSide??this.side()].exit),yt(n,()=>{r===this.generation&&(n.style.setProperty(`display`,`none`),n.removeAttribute(`transit`),t.dispatchEvent(new CustomEvent(`after-hide`)))}))};side=()=>this.options.placement().split(`-`)[0];position=(e=!1)=>{let t=this.options.panel();if(!t)return;let n=this.generation,r=()=>{let r=this.options.panel();r===t&&(!e||this.opened&&n===this.generation)&&this.write(r,e)};e&&typeof requestAnimationFrame==`function`?requestAnimationFrame(r):r()};write(e,t){let{offset:n=0,containerId:r,beforeMeasure:i,measurePanel:a,adjust:o,afterPosition:s}=this.options,c=this.anchor.getBoundingClientRect();i?.(c,e);let l=this.options.host.getRootNode(),u=r?.()??``,d=u?l.getElementById?.(u)??document.getElementById(u):null,f=e.getBoundingClientRect(),m=a?.(e),g=f,_=m?.width??f.width,v=m?.height??f.height,y=this.options.placement(),[b,x]=y.split(`-`),S=x??`start`,C,w,T=b;if(d){let e=d.getBoundingClientRect();T===`top`||T===`bottom`?(C=T===`bottom`?c.bottom-e.top+n:c.top-e.top-v-n,w=p(S,c.left,c.width,_)-e.left):(C=p(S,c.top,c.height,v)-e.top,w=T===`right`?c.right-e.left+n:c.left-e.left-_-n)}else{let e=h({anchor:{top:c.top,left:c.left,width:c.width,height:c.height},floating:{width:_,height:v},placement:y,offset:n});T=e.side,C=e.top+window.scrollY,w=e.left+window.scrollX}let E={top:C,left:w,side:T,align:S,anchorRect:c,panelRect:g,container:d},D=o?.(E,e);D&&(E.top=D.top,E.left=D.left),this.resolvedSide=E.side,e.style.setProperty(`position`,`absolute`),e.style.setProperty(`inset`,`${E.top}px auto auto ${E.left}px`),e.style.setProperty(`--ran-x`,`${E.left}px`),e.style.setProperty(`--ran-y`,`${E.top}px`),t&&e.setAttribute(`transit`,pt[E.side].enter),s?.(E,e)}reposition=()=>{this.opened&&!this.repositionFrame&&(typeof requestAnimationFrame==`function`?this.repositionFrame=requestAnimationFrame(()=>{this.repositionFrame=0,this.opened&&this.position()}):this.position())};attachReposition(){this.repositionBound||typeof window>`u`||(window.addEventListener(`scroll`,this.reposition,!0),window.addEventListener(`resize`,this.reposition),this.repositionBound=!0)}detachReposition(){this.repositionBound&&typeof window<`u`&&(window.removeEventListener(`scroll`,this.reposition,!0),window.removeEventListener(`resize`,this.reposition),this.repositionBound=!1)}destroy=()=>{this.generation++,this.outsideBinding++,this.opened=!1;let e=this.options.panel();e&&Q(e),this.repositionFrame&&typeof cancelAnimationFrame==`function`&&(cancelAnimationFrame(this.repositionFrame),this.repositionFrame=0),this.detachReposition()}};function xt(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}var St=8,Ct=300,$=16,wt=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),Tt={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Et=class extends H{_events=new c;_slot;popoverBlock;popoverContent;popoverInner;popoverInnerBlock;_shadowDom;removeTimeId;_repositionBound=!1;_returnFocus;_floating=new bt({onEscape:e=>this._dismissFromKeyboard(e),host:this,panel:()=>this.popoverContent,anchor:()=>Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this,placement:()=>this.placement,offset:St,containerId:()=>this.getPopupContainerId,afterPosition:(e,t)=>{let{anchorRect:n,panelRect:r,side:i}=e,a=Tt[i];a&&t.setAttribute(`arrow`,a),t.style.setProperty(`--ran-dropdown-arrow-anchor-width`,`${n.width}px`),t.style.setProperty(`--ran-dropdown-arrow-anchor-height`,`${n.height}px`),t.style.setProperty(`--ran-dropdown-min-width`,`${r.width}px`),t.style.setProperty(`--ran-dropdown-min-height`,`${r.height}px`);let o=t.getBoundingClientRect(),s=n.left+n.width/2,c=o.left+o.width/2;t.style.setProperty(`--ran-dropdown-arrow-anchor-offset`,`${s-c}px`),t.style.setProperty(`--ran-dropdown-arrow-anchor-offset-y`,`${n.top-o.top}px`)}});static get observedAttributes(){return[`open`,`placement`,`trigger`,`sheet`]}closePopover=()=>{this.setDropdownDisplayNone()};constructor(){super(),this._shadowDom=G(this,ft);let e=I(),t=z().class(`ran-popover-block`).role(`tooltip`).children(B().class(`slot`).ref(e)).build();this._shadowDom.appendChild(t),this.popoverBlock=t,this._slot=K(e,`slot`)}get placement(){return q(this,`placement`,`top`)}set placement(e){J(this,`placement`,e)}get placementSide(){return this.placement.split(`-`)[0]}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}_applyOpen=()=>{this._floating.apply(this.open)};show=()=>{this.open=!0};hide=()=>{this.open=!1};toggle=()=>{this.open=!this.open};get trigger(){return q(this,`trigger`,`hover`)}set trigger(e){J(this,`trigger`,e)}get getPopupContainerId(){return q(this,`getPopupContainerId`)}set getPopupContainerId(e){J(this,`getPopupContainerId`,e)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{lt(this,this._shadowDom,`sheet`,null,this.sheet)};initAria=()=>{this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.setAttribute(`aria-haspopup`,`dialog`),this.setAttribute(`aria-expanded`,`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};stopPropagation=e=>{e.stopPropagation()};createContent=e=>{if(e){if(!this.popoverContent){let e=getComputedStyle(this).getPropertyValue(`--ran-popover-content-padding`).trim()||`12px`;this.popoverContent=Ie(`r-dropdown`).class(`ran-popover-dropdown`).style(`display`,`none`).style(`position`,`absolute`).cssVar(`ran-dropdown-padding`,e).build(),this.popoverContent?.addEventListener(`click`,this.stopPropagation),this._events.on(this.popoverContent,`keydown`,this._dismissFromKeyboard);let t=z().children(this.popoverContent).build();this.popoverInner=t,this.trigger.includes(`hover`)&&!r()&&(this.popoverContent?.addEventListener(`mouseleave`,this.blur),this.popoverContent?.addEventListener(`mouseenter`,this.removeDropDownTimeId));let n=this.getRootNode();((n.getElementById?n.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body).appendChild(t)}if(this.popoverContent&&e.length>0){this.popoverContent.innerHTML=``;let t=document.createDocumentFragment();for(let n of Array.from(e))t.appendChild(n);this.popoverContent.appendChild(t)}}};watchContent=e=>{let{value:t}=e.detail;this.createContent(t.content)};blur=t(()=>{this.removeTimeId&&this.removeDropDownTimeId(),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(),this.setDropdownDisplayNone()},Ct)},$);removeDropDownTimeId=t(()=>{this.trigger.includes(`hover`)&&!r()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)},$);setDropdownDisplayBlock=t(()=>{this.open=!0},$);setDropdownDisplayNone=t(()=>{this.open=!1},$);placementPosition=()=>{this._floating.position()};hoverPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock()};clickContent=e=>{e.stopPropagation()};clickPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0;let t=!this.open;this.toggle(),t&&(this._returnFocus=e.composedPath().find(e=>e instanceof HTMLElement&&e!==this&&this.contains(e)&&e.tabIndex>=0)??Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this)};keydownPopover=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||(e.key===`Escape`?(this.setDropdownDisplayBlock.cancel(),this._dismissFromKeyboard(e)):xt(e)&&(e.preventDefault(),this.setDropdownDisplayBlock()))};_dismissFromKeyboard=e=>{e.key!==`Escape`||e.defaultPrevented||e.isComposing||e.keyCode===229||!this.open||(gt(this).some(e=>e!==this.popoverContent)?_t(this,e):(e.preventDefault(),e.stopPropagation(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0,this.hide(),this._returnFocus?.isConnected&&this._returnFocus.focus({preventScroll:!0,focusVisible:!0})))};clickRemovePopover=e=>{this.hoverRemovePopover(e)};popoverTrigger=()=>{this._events.abort();for(let e of this.children)e.tagName===`R-CONTENT`&&this._events.on(e,`change`,this.watchContent);this.trigger.includes(`hover`)&&!r()&&(this._events.on(this,`mouseenter`,this.hoverPopover),this._events.on(this,`mouseleave`,this.blur)),this._events.on(this,`click`,this.clickPopover).on(this,`keydown`,this.keydownPopover),this._events.on(this,`show`,()=>{let e=this.getRootNode().activeElement;this._returnFocus=e instanceof HTMLElement&&(e===this||this.contains(e))?e:Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this}),this.popoverContent&&this._events.on(this.popoverContent,`keydown`,this._dismissFromKeyboard),this._floating.bindOutside(this._events,this.clickRemovePopover)};hoverRemovePopover=e=>{this._floating.containsEvent(e)||this.setDropdownDisplayNone()};changePlacement=t(()=>{if(!this.getPopupContainerId&&this.open)return;let e=Tt[this.placementSide];e&&this.popoverContent?.setAttribute(`arrow`,e)},$);connectedCallback(){this.initAria(),this.handlerExternalCss();for(let e of this.children)e.tagName===`R-CONTENT`&&this.createContent(e.children);this.popoverTrigger(),this.changePlacement()}disconnectedCallback(){this._events.abort(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),this.removeDropDownTimeId.cancel(),this._floating.destroy(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0;let e=Array.from(this.children).find(e=>e.tagName===`R-CONTENT`);e&&this.popoverContent&&e.append(...Array.from(this.popoverContent.childNodes)),this.popoverInner?.remove(),this.popoverInner=void 0,this.popoverContent=void 0}attributeChangedCallback(e,t,n){t!==n&&(e===`trigger`&&this.popoverTrigger(),e===`placement`&&this.changePlacement(),e===`sheet`&&this.handlerExternalCss(),e===`open`&&this._applyOpen())}};return V(`r-popover`,Et),e.PLACEMENT_TYPE=wt,e.Popover=Et,e.default=Et,e})({}); \ No newline at end of file diff --git a/public/ranui-iife/theme-switch.iife.js b/public/ranui-iife/theme-switch.iife.js index 2d42ec81c..22a4115c5 100644 --- a/public/ranui-iife/theme-switch.iife.js +++ b/public/ranui-iife/theme-switch.iife.js @@ -1 +1 @@ -var ranui_theme_switch=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:var(--ran-theme-switch-display,inline-flex);box-sizing:border-box}:host([hidden]){display:none}.ran-theme-switch{align-items:center;gap:var(--ran-theme-switch-gap,var(--ran-space-1,4px));padding:var(--ran-theme-switch-padding,var(--ran-space-1,4px));border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-theme-switch-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-theme-switch-radius,var(--ran-radius-full,9999px));background:var(--ran-theme-switch-background,transparent);box-sizing:border-box;display:inline-flex}.ran-theme-switch button{width:var(--ran-theme-switch-button-size,var(--ran-size-5,28px));height:var(--ran-theme-switch-button-size,var(--ran-size-5,28px));border-radius:var(--ran-theme-switch-radius,var(--ran-radius-full,9999px));color:var(--ran-theme-switch-button-color,var(--ran-color-text-secondary,#4d4d4d));cursor:pointer;background:0 0;border:none;place-items:center;padding:0;display:grid}.ran-theme-switch button:hover{color:var(--ran-theme-switch-button-hover-color,var(--ran-color-text,#171717))}.ran-theme-switch button[aria-pressed=true]{background:var(--ran-theme-switch-button-active-background,var(--ran-color-bg-hover,#ebebeb));color:var(--ran-theme-switch-button-active-color,var(--ran-color-text,#171717))}.ran-theme-switch button:focus-visible{outline:var(--ran-theme-switch-button-focus-outline,2px solid var(--ran-color-primary,#006bff));outline-offset:var(--ran-theme-switch-button-focus-outline-offset,2px)}.ran-theme-switch svg{width:var(--ran-theme-switch-icon-size,var(--ran-size-1,16px));height:var(--ran-theme-switch-icon-size,var(--ran-size-1,16px))}`,n=typeof document>`u`,r=()=>{try{return typeof localStorage>`u`?null:localStorage}catch{return null}},i=(e,t)=>{try{r()?.setItem(e,t)}catch{}},a=e=>{try{return r()?.getItem(e)??``}catch{return``}},o=(e,t)=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return t(!1),()=>{};let n=window.matchMedia(e),r=()=>t(n.matches);if(r(),typeof n.addEventListener==`function`)return n.addEventListener(`change`,r),()=>n.removeEventListener(`change`,r);let i=n;return i.addListener(r),()=>i.removeListener(r)},s=/["'&<>]/;function c(e){let t=``+e,n=s.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},te=new Map,ne=new Map,re=`data-adopted-style`,ie=`data-adopted-sheet`,l=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},ae=(e,t,n=re)=>{if(!(typeof document>`u`)&&t&&!l(e,t,te)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},u=(e,t,n=ie)=>{if(!(typeof document>`u`)&&t&&!l(e,t,ne)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},d=0,f=1,p=2,m=null,h=null,g=0,_=new Set,v=!1;function y(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(T(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)E(e,p);g===0&&se()}}]}function b(e){let t=oe(e,!0);return w(t),O(t),()=>A(t)}function x(e){let t=m;m=null;try{return e()}finally{m=t}}function S(e){let t={owned:[],cleanups:[],owner:h},n=h,r=m;h=t,m=null;try{return e(()=>ce(t))}finally{h=n,m=r}}function C(e){h&&h.cleanups.push(e)}function oe(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:p,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:h}}function w(e){h&&h.owned.push(e)}function T(e){m&&(m.sources.add(e),e.observers.add(m))}function E(e,t){if(e.disposed||e.state>=t)return;let n=e.state===d;if(e.state=t,e.isEffect)_.add(e);else if(n)for(let t of e.observers)E(t,f)}function se(){if(!(g>0||v)){v=!0;try{for(;_.size>0;){let e=[..._];_.clear();for(let t of e)t.disposed||D(t)}}finally{v=!1}}}function D(e){if(!(e.disposed||e.state===d)){if(e.state===f)for(let t of e.sources)`fn`in t&&D(t);e.state===p&&O(e),e.state=d}}function O(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);k(e);let t=m,n=h;m=e,h=e,e.running=!0,e.state=d;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)E(t,p)}}finally{e.running=!1,m=t,h=n}}function k(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function A(e){e.disposed||(e.disposed=!0,k(e),e.observers.clear())}function ce(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function j(e){return c(e)}var le=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ue=`.#[`;function de(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var fe=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},pe=(e,t)=>{let n=t.trim();if(!n)return!1;let r=de(n);return r!==null&&r.every(t=>fe(e,t))},M=(e,t,n)=>{for(let r of e)le(r)&&(pe(r,t)&&n.push(r),M(r.childrenList,t,n))},N=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?c(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}},me=new Map,P=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??me}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:c(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new N)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new F(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${j(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${j(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?c(e):(e instanceof N,e.serialize())).join(``):a+=c(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}`}},F=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}serialize(){return``}},I={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){I.append(e,r);continue}if(typeof r==`function`){I.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof R?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},L=`http://www.w3.org/2000/svg`,he=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),R=class{runtime;el;constructor(e,t,r=I){this.runtime=r;let i=t??(he.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new P(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ge(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ge=class{runtime;root;hostEl;constructor(e,t,n,r=I){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},z=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(z(t)):e.concat(t),[]),B=e=>e==null?null:e instanceof R?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,_e=(e,t)=>{if(n){H(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};b(()=>{let e=t();o();let n=document.createDocumentFragment();a=S(t=>(H(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),C(()=>a?.())},ve=`__ranFor`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=y(t),a=null,o=S(t=>{let i=B(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},V=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},xe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;C(()=>{for(let e of i.values())e.dispose();i.clear()}),b(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){Ee()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=be(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();V(r,a),i=n})},Se=`__ranIndex`,Ce=e=>typeof e==`object`&&!!e&&e[Se]===!0,we=(e,t,n)=>{let[r,i]=y(e),a=null,o=S(e=>{let i=B(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Te=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];C(()=>{for(let e of i)e.dispose();i=[]}),b(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}V(r,i.map(e=>e.node).filter(e=>e!=null))})},H=(e,t)=>{n?x(()=>U(e,t)):U(e,t)},U=(e,t)=>{z(t).forEach(t=>{if(ye(t)){xe(e,t);return}if(Ce(t)){Te(e,t);return}if(typeof t==`function`){_e(e,t);return}let n=B(t);n!=null&&e.appendChild(n)})},Ee=()=>!1,De={bind(e,t){if(typeof e!=`function`){t(e);return}n?x(()=>t(e())):b(()=>t(e()))},append:H},Oe=class extends R{constructor(e,t){super(e,t,De)}};function ke(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,L),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ae,Div:je,Svg:Me,Span:Ne,Slot:Pe,ButtonBuilder:Fe,InputBuilder:Ie,Style:Le,Label:Re,Ul:ze,Li:Be,Section:Ve,Article:He,Nav:Ue,Header:We,Footer:Ge,Main:Ke,DeclarativeShadow:qe}=ke(Oe),Je=new Map;function Ye(e,t){n?(Je.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Xe=typeof document<`u`?HTMLElement:P,Ze=`data-ranui`,Qe=`data-ranui-sheet`,$e=(e,t)=>ae(e,t,Ze),et=(e,t)=>u(e,t,Qe),W=new WeakMap,G=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,K=new Map,q=e=>{let t=K.get(e);if(t!==void 0)return t;let n=e?`${e}\n${G}`:G;return K.set(e,n),n},tt=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||W.get(e)||e.attachShadow(n);return W.set(e,r),$e(r,q(t)),r},nt=(e,t,n=``)=>e.getAttribute(t)??n,rt=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},it=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&et(t,a)},J=`ran-theme`,at=`(prefers-color-scheme: dark)`,Y=null,X=e=>{if(e&&`style`in e)return e;if(e&&`documentElement`in e)return e.documentElement;if(!(typeof document>`u`))return document.documentElement},ot=(e,t)=>{e.setAttribute(`data-ran-theme`,t?`dark`:`light`),e.setAttribute(`theme`,t?`dark`:`light`)},st=()=>{Y?.(),Y=null},ct=(e,t)=>{let n=X(t);if(n){if(st(),e===`system`){if(typeof window>`u`)return;Y=o(at,e=>ot(n,e)),i(J,`system`);return}n.setAttribute(`data-ran-theme`,e),n.setAttribute(`theme`,e),i(J,e)}},lt=e=>{let t=X(e);if(!t)return``;let n=t.getAttribute(`data-ran-theme`)||t.getAttribute(`theme`)||``;return n===`light`||n===`dark`?a(J)===`system`?`system`:n:``},Z=[`system`,`light`,`dark`],ut={system:``,light:``,dark:``},Q=`ran-theme-switch-sync`,$=class extends Xe{static get observedAttributes(){return[`label-system`,`label-light`,`label-dark`,`sheet`]}_events=new ee;_shadowDom;_group;_buttons;constructor(){super(),this._shadowDom=tt(this,t),this._buttons=Z.map(e=>{let t=Fe().attr(`type`,`button`).data(`choice`,e).attr(`part`,`button ${e}`).aria(`pressed`,`false`).build();return n||(t.innerHTML=ut[e]),t}),this._group=je().class(`ran-theme-switch`).attr(`part`,`switch`).role(`group`).children(this._buttons).build(),this._shadowDom.appendChild(this._group)}get sheet(){return nt(this,`sheet`)}set sheet(e){rt(this,`sheet`,e)}get value(){return lt()||`system`}set value(e){Z.includes(e)&&this._select(e)}_label(e){let t={system:`System theme`,light:`Light theme`,dark:`Dark theme`}[e];return this.getAttribute(`label-${e}`)||t}_syncLabels(){this._group.setAttribute(`aria-label`,this.getAttribute(`label`)||`Theme`);for(let e of this._buttons)e.setAttribute(`aria-label`,this._label(e.dataset.choice))}_reflect(){let e=this.value;for(let t of this._buttons)t.setAttribute(`aria-pressed`,t.dataset.choice===e?`true`:`false`)}_select(e){ct(e),this._reflect(),this._syncMeta(e),document.dispatchEvent(new CustomEvent(Q)),this.dispatchEvent(new CustomEvent(`change`,{detail:{theme:e},bubbles:!0,composed:!0}))}_syncMeta(e){if(typeof requestAnimationFrame>`u`)return;let t=document.querySelectorAll(`meta[name="theme-color"]`);t.length&&requestAnimationFrame(()=>{for(let n of t)if(n.dataset.ranOriginalContent===void 0&&(n.dataset.ranOriginalContent=n.getAttribute(`content`)||``),e===`system`)n.setAttribute(`content`,n.dataset.ranOriginalContent);else{let e=getComputedStyle(document.documentElement).getPropertyValue(`--ran-color-bg`).trim()||getComputedStyle(document.body).backgroundColor;n.setAttribute(`content`,e)}})}_handleClick=e=>{let t=(e.target.closest?.(`button`))?.dataset.choice;t&&Z.includes(t)&&this._select(t)};_handleSync=()=>this._reflect();handlerExternalCss=()=>{it(this,this._shadowDom,`sheet`,null,this.sheet)};connectedCallback(){this.handlerExternalCss(),this._syncLabels(),this._reflect(),this._events.on(this._group,`click`,this._handleClick),document.addEventListener(Q,this._handleSync),typeof window<`u`&&window.addEventListener(`storage`,this._handleSync)}disconnectedCallback(){this._events.abort(),document.removeEventListener(Q,this._handleSync),typeof window<`u`&&window.removeEventListener(`storage`,this._handleSync)}attributeChangedCallback(e,t,n){t!==n&&(e===`sheet`&&this.handlerExternalCss(),e.startsWith(`label`)&&this._syncLabels())}};return Ye(`r-theme-switch`,$),e.ThemeSwitch=$,e.default=$,e})({}); \ No newline at end of file +var ranui_theme_switch=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:var(--ran-theme-switch-display,inline-flex);box-sizing:border-box}:host([hidden]){display:none}.ran-theme-switch{align-items:center;gap:var(--ran-theme-switch-gap,var(--ran-space-1,4px));padding:var(--ran-theme-switch-padding,var(--ran-space-1,4px));border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-theme-switch-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-theme-switch-radius,var(--ran-radius-full,9999px));background:var(--ran-theme-switch-background,transparent);box-sizing:border-box;display:inline-flex}.ran-theme-switch button{width:var(--ran-theme-switch-button-size,var(--ran-size-5,28px));height:var(--ran-theme-switch-button-size,var(--ran-size-5,28px));border-radius:var(--ran-theme-switch-radius,var(--ran-radius-full,9999px));color:var(--ran-theme-switch-button-color,var(--ran-color-text-secondary,#4d4d4d));cursor:pointer;background:0 0;border:none;place-items:center;padding:0;display:grid}.ran-theme-switch button:hover{color:var(--ran-theme-switch-button-hover-color,var(--ran-color-text,#171717))}.ran-theme-switch button[aria-pressed=true]{background:var(--ran-theme-switch-button-active-background,var(--ran-color-bg-hover,#ebebeb));color:var(--ran-theme-switch-button-active-color,var(--ran-color-text,#171717))}.ran-theme-switch button:focus-visible{outline:var(--ran-theme-switch-button-focus-outline,2px solid var(--ran-color-primary,#006bff));outline-offset:var(--ran-theme-switch-button-focus-outline-offset,2px)}.ran-theme-switch svg{width:var(--ran-theme-switch-icon-size,var(--ran-size-1,16px));height:var(--ran-theme-switch-icon-size,var(--ran-size-1,16px))}@media (pointer:coarse){.ran-theme-switch button{min-width:var(--ran-theme-switch-touch-size,44px);min-height:var(--ran-theme-switch-touch-size,44px)}}`,n=typeof document>`u`,r=()=>{try{return typeof localStorage>`u`?null:localStorage}catch{return null}},i=(e,t)=>{try{r()?.setItem(e,t)}catch{}},a=e=>{try{return r()?.getItem(e)??``}catch{return``}},o=(e,t)=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return t(!1),()=>{};let n=window.matchMedia(e),r=()=>t(n.matches);if(r(),typeof n.addEventListener==`function`)return n.addEventListener(`change`,r),()=>n.removeEventListener(`change`,r);let i=n;return i.addListener(r),()=>i.removeListener(r)},s=/["'&<>]/;function c(e){let t=``+e,n=s.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},u=new Map,ee=`data-adopted-style`,te=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},ne=(e,t,n=ee)=>{if(typeof document<`u`&&t&&!te(e,t,u)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},d=0,f=1,p=2,m=null,h=null,g=0,_=new Set,v=!1;function y(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ae(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)w(e,p);g===0&&oe()}}]}function b(e){let t=re(e,!0);return ie(t),E(t),()=>O(t)}function x(e){let t=m;m=null;try{return e()}finally{m=t}}function S(e){let t={owned:[],cleanups:[],owner:h},n=h,r=m;h=t,m=null;try{return e(()=>se(t))}finally{h=n,m=r}}function C(e){h&&h.cleanups.push(e)}function re(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:p,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:h}}function ie(e){h&&h.owned.push(e)}function ae(e){m&&(m.sources.add(e),e.observers.add(m))}function w(e,t){if(e.disposed||e.state>=t)return;let n=e.state===d;if(e.state=t,e.isEffect)_.add(e);else if(n)for(let t of e.observers)w(t,f)}function oe(){if(!(g>0||v)){v=!0;try{for(;_.size>0;){let e=[..._];_.clear();for(let t of e)t.disposed||T(t)}}finally{v=!1}}}function T(e){if(!(e.disposed||e.state===d)){if(e.state===f)for(let t of e.sources)`fn`in t&&T(t);e.state===p&&E(e),e.state=d}}function E(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);D(e);let t=m,n=h;m=e,h=e,e.running=!0,e.state=d;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)w(t,p)}}finally{e.running=!1,m=t,h=n}}function D(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function O(e){e.disposed||(e.disposed=!0,D(e),e.observers.clear())}function se(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function k(e){return c(e)}var ce=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,le=`.#[`;function ue(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n0?t:null}var de=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},fe=(e,t)=>{let n=t.trim();if(!n)return!1;let r=ue(n);return r!==null&&r.every(t=>de(e,t))},A=(e,t,n)=>{for(let r of e)ce(r)&&(fe(r,t)&&n.push(r),A(r.childrenList,t,n))},j=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?c(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}},pe=new Map,M=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??pe}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:c(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new j)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new me(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${k(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${k(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?c(e):(e instanceof j,e.serialize())).join(``):a+=c(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}`}},me=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}serialize(){return``}},N={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){N.append(e,r);continue}if(typeof r==`function`){N.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof P?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},he=`http://www.w3.org/2000/svg`,ge=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),P=class{runtime;el;constructor(e,t,r=N){this.runtime=r;let i=t??(ge.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new M(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new _e(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},_e=class{runtime;root;hostEl;constructor(e,t,n,r=N){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},F=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(F(t)):e.concat(t),[]),I=e=>e==null?null:e instanceof P?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ve=(e,t)=>{if(n){R(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};b(()=>{let e=t();o();let n=document.createDocumentFragment();a=S(t=>(R(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),C(()=>a?.())},ye=`__ranFor`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=y(t),a=null,o=S(t=>{let i=I(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},L=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},Se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;C(()=>{for(let e of i.values())e.dispose();i.clear()}),b(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){De()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=xe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();L(r,a),i=n})},Ce=`__ranIndex`,we=e=>typeof e==`object`&&!!e&&e[Ce]===!0,Te=(e,t,n)=>{let[r,i]=y(e),a=null,o=S(e=>{let i=I(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ee=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];C(()=>{for(let e of i)e.dispose();i=[]}),b(()=>{let e=t.each()??[];for(let n=0;n=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}L(r,i.map(e=>e.node).filter(e=>e!=null))})},R=(e,t)=>{n?x(()=>z(e,t)):z(e,t)},z=(e,t)=>{F(t).forEach(t=>{if(be(t)){Se(e,t);return}if(we(t)){Ee(e,t);return}if(typeof t==`function`){ve(e,t);return}let n=I(t);n!=null&&e.appendChild(n)})},De=()=>!1,Oe={bind(e,t){typeof e==`function`?n?x(()=>t(e())):b(()=>t(e())):t(e)},append:R},ke=class extends P{constructor(e,t){super(e,t,Oe)}};function Ae(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,he),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:je,Div:Me,Svg:Ne,Span:Pe,Slot:Fe,ButtonBuilder:Ie,InputBuilder:Le,Style:Re,Label:ze,Ul:Be,Li:Ve,Section:He,Article:Ue,Nav:We,Header:Ge,Footer:Ke,Main:qe,DeclarativeShadow:Je}=Ae(ke),Ye=new Map;function Xe(e,t){n?(Ye.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ze=typeof document<`u`?HTMLElement:M,Qe=`data-ranui`,B=`data-ranui-sheet`,$e=(e,t)=>ne(e,t,Qe),V=new WeakMap,H=new Map,et=e=>{if(typeof CSSStyleSheet>`u`)return;let t=H.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},H.set(e,t)}catch{return}return t.users++,t.sheet},U=e=>{let t=H.get(e);t&&--t.users===0&&H.delete(e)},tt=(e,t)=>{if(typeof document>`u`)return;let n=V.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),U(n.text)):n&&e.querySelector(`style[${B}]`)?.remove(),V.delete(e),!t))return;let r=et(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{U(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(B,``),n.textContent=t,e.appendChild(n)}V.set(e,{text:t,sheet:r})},W=new WeakMap,G=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,K=new Map,nt=e=>{let t=K.get(e);if(t!==void 0)return t;let n=e?`${e}\n${G}`:G;return K.set(e,n),n},rt=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||W.get(e)||e.attachShadow(n);return W.set(e,r),$e(r,nt(t)),r},it=(e,t,n=``)=>e.getAttribute(t)??n,at=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},ot=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&tt(t,e.getAttribute(`sheet`)||``)},q=`ran-theme`,J=`(prefers-color-scheme: dark)`,Y=null,X=e=>{if(e&&`style`in e)return e;if(e&&`documentElement`in e)return e.documentElement;if(typeof document<`u`)return document.documentElement},st=(e,t)=>{e.setAttribute(`data-ran-theme`,t?`dark`:`light`),e.setAttribute(`theme`,t?`dark`:`light`)},ct=()=>{Y?.(),Y=null},lt=(e,t)=>{let n=X(t);if(n){if(ct(),e===`system`){if(typeof window>`u`)return;Y=o(J,e=>st(n,e)),i(q,`system`)}else n.setAttribute(`data-ran-theme`,e),n.setAttribute(`theme`,e),i(q,e)}},ut=e=>{let t=X(e);if(!t)return``;let n=t.getAttribute(`data-ran-theme`)||t.getAttribute(`theme`)||``;return n===`light`||n===`dark`?a(q)===`system`?`system`:n:``},Z=[`system`,`light`,`dark`],dt={system:``,light:``,dark:``},Q=`ran-theme-switch-sync`,$=class extends Ze{static get observedAttributes(){return[`label`,`label-system`,`label-light`,`label-dark`,`sheet`]}_events=new l;_shadowDom;_group;_buttons;constructor(){super(),this._shadowDom=rt(this,t),this._buttons=Z.map(e=>{let t=Ie().attr(`type`,`button`).data(`choice`,e).attr(`part`,`button ${e}`).aria(`pressed`,`false`).build();return n||(t.innerHTML=dt[e]),t}),this._group=Me().class(`ran-theme-switch`).attr(`part`,`switch`).role(`group`).children(this._buttons).build(),this._shadowDom.appendChild(this._group)}get sheet(){return it(this,`sheet`)}set sheet(e){at(this,`sheet`,e)}get value(){return ut()||`system`}set value(e){Z.includes(e)&&this._select(e)}_label(e){let t={system:`System theme`,light:`Light theme`,dark:`Dark theme`}[e];return this.getAttribute(`label-${e}`)||t}_syncLabels(){this._group.setAttribute(`aria-label`,this.getAttribute(`label`)||`Theme`);for(let e of this._buttons)e.setAttribute(`aria-label`,this._label(e.dataset.choice))}_reflect(){let e=this.value;for(let t of this._buttons)t.setAttribute(`aria-pressed`,t.dataset.choice===e?`true`:`false`)}_select(e){lt(e),this._reflect(),this._syncMeta(e),document.dispatchEvent(new CustomEvent(Q)),this.dispatchEvent(new CustomEvent(`change`,{detail:{theme:e},bubbles:!0,composed:!0}))}_syncMeta(e){if(typeof requestAnimationFrame>`u`)return;let t=document.querySelectorAll(`meta[name="theme-color"]`);t.length&&requestAnimationFrame(()=>{for(let n of t)if(n.dataset.ranOriginalContent===void 0&&(n.dataset.ranOriginalContent=n.getAttribute(`content`)||``),e===`system`)n.setAttribute(`content`,n.dataset.ranOriginalContent);else{let e=getComputedStyle(document.documentElement).getPropertyValue(`--ran-color-bg`).trim()||getComputedStyle(document.body).backgroundColor;n.setAttribute(`content`,e)}})}_handleClick=e=>{let t=(e.target.closest?.(`button`))?.dataset.choice;t&&Z.includes(t)&&this._select(t)};_handleSync=()=>this._reflect();handlerExternalCss=()=>{ot(this,this._shadowDom,`sheet`,null,this.sheet)};connectedCallback(){this.handlerExternalCss(),this._syncLabels(),this._reflect(),this._events.on(this._group,`click`,this._handleClick),document.addEventListener(Q,this._handleSync),typeof window<`u`&&window.addEventListener(`storage`,this._handleSync)}disconnectedCallback(){this._events.abort(),document.removeEventListener(Q,this._handleSync),typeof window<`u`&&window.removeEventListener(`storage`,this._handleSync)}attributeChangedCallback(e,t,n){t!==n&&(e===`sheet`&&this.handlerExternalCss(),e.startsWith(`label`)&&this._syncLabels())}};return Xe(`r-theme-switch`,$),e.ThemeSwitch=$,e.default=$,e})({}); \ No newline at end of file diff --git a/styles/assistant.css b/styles/assistant.css index 553a4d5a3..181b8354a 100644 --- a/styles/assistant.css +++ b/styles/assistant.css @@ -443,10 +443,13 @@ body.agent-panel-resizing #app iframe { /* (Review / quote / clear moved into ChatView's `.cui-actions` slot above the input; the old top toolbar is gone.) */ -/* ranui renders select dropdowns as a body-level portal at z-index - 10, which the agent panel (z-index 10000) would otherwise cover — lift it. */ +/* ranui renders select dropdowns and popovers as body-level + portals, which the agent panel (z-index 10000) would otherwise cover. Since + ranui 0.5.1 the floating controller writes the layer inline as + var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100)), so lift it + through that property; a plain z-index rule loses to the inline style. */ r-dropdown[role='listbox'] { - z-index: 100000; + --ran-dropdown-host-z-index: 100000; } /* r-select / r-button below render themselves — host carries layout only. */ @@ -1604,9 +1607,9 @@ r-dropdown[role='listbox'] { --ran-popover-host-display: block; --ran-popover-content-padding: var(--ran-space-3); } -/* Match the existing select portal layer above the assistant panel. */ +/* Match the select portal layer above the assistant panel (see r-dropdown above). */ .agent-speech-popover { - z-index: 100000; + --ran-dropdown-host-z-index: 100000; } .agent-speech-hint { box-sizing: border-box; diff --git a/test/e2e/agent-portal-layer.spec.ts b/test/e2e/agent-portal-layer.spec.ts new file mode 100644 index 000000000..b1121ab0e --- /dev/null +++ b/test/e2e/agent-portal-layer.spec.ts @@ -0,0 +1,29 @@ +import { expect, test } from './lib/l0'; + +// ranui opens select lists and popovers as body-level portals. The +// assistant panel sits at z-index 10000, so each portal opened from inside it +// must be the topmost element where it is drawn, or the panel swallows clicks. +test('a select opened inside the assistant panel draws above the panel', async ({ page }) => { + test.setTimeout(90_000); + await page.addInitScript(() => localStorage.setItem('document-assistant-enabled', 'true')); + await page.goto('/editor?new=docx&locale=en'); + await page.waitForFunction(() => Boolean(window.__ooFrames.readyEditor())); + await page.frameLocator('iframe[name="frameEditor"]').locator('.agent-sidebar-entry').click(); + // Model discovery decides whether the panel lands in chat or settings; wait + // for it, then make sure the settings view (with its source select) is shown. + const panel = page.locator('.agent-runtime-panel'); + await expect(page.locator('.agent-model-cache > summary')).toContainText('(0)'); + if ((await panel.getAttribute('data-view')) !== 'settings') + await page.locator('.agent-panel-settings-toggle').click(); + await expect(panel).toHaveAttribute('data-view', 'settings'); + + await page.locator('.agent-panel-settings r-select:visible').first().click(); + const list = page.locator('r-dropdown[role="listbox"]:visible'); + await expect(list).toHaveCount(1); + const topmost = await list.evaluate((portal) => { + const box = portal.getBoundingClientRect(); + const hit = document.elementFromPoint(box.x + box.width / 2, box.y + box.height / 2); + return hit === portal || portal.contains(hit); + }); + expect(topmost).toBe(true); +}); diff --git a/test/e2e/editor-startup-payload.spec.ts b/test/e2e/editor-startup-payload.spec.ts index f31dba49d..8122e12ad 100644 --- a/test/e2e/editor-startup-payload.spec.ts +++ b/test/e2e/editor-startup-payload.spec.ts @@ -1,18 +1,24 @@ +import type { Page } from '@playwright/test'; import { expect, test } from './lib/l0'; // Code that only serves an optional, later interaction must not ride on the -// scripts every editor load fetches before it can run. Each probe is a string -// found only inside the module in question: an error message thrown in -// lib/agent-plugin/tools.ts, and an element the PWA library defines for itself. -const DEFERRED = [ - { owner: 'agent tool layer (lib/agent-plugin/tools.ts)', probe: 'replace_selection requires a nonempty string' }, - { owner: '@khmyznikov/pwa-install', probe: 'pwa-bottom-sheet' }, -]; +// scripts a page fetches before it can run. Each probe is a string found only +// inside the module in question. +const AGENT_TOOLS = { + owner: 'agent tool layer (lib/agent-plugin/tools.ts)', + probe: 'replace_selection requires a nonempty string', +}; +const PWA_INSTALL = { owner: '@khmyznikov/pwa-install', probe: 'pwa-bottom-sheet' }; +// jschardet's charset table; ranuts keeps it out of str.ts since 0.5.1, and +// nothing in this app sniffs charsets statistically. +const JSCHARDET = { owner: 'jschardet', probe: 'windows-1255' }; +// An error the save pipeline (lib/onlyoffice/save-stream.ts) raises: the +// history page lists and reopens records, it never saves through the editor. +const EDITOR_STACK = { owner: 'editor save pipeline', probe: 'Save conversion failed' }; -test('the editor startup scripts leave the agent tools and the PWA prompt out', async ({ page }) => { - await page.goto('/editor?new=docx'); - // Vite writes the entry and its whole static import graph into the HTML as - // the module script plus modulepreload links: that is the startup payload. +/** Vite writes an entry and its whole static import graph into the HTML as the + * module script plus modulepreload links: that is the startup payload. */ +async function startupScripts(page: Page): Promise { const urls = await page.evaluate(() => [ ...document.querySelectorAll( @@ -21,10 +27,24 @@ test('the editor startup scripts leave the agent tools and the PWA prompt out', ].map((node) => (node instanceof HTMLScriptElement ? node.src : node.href)), ); expect(urls.length).toBeGreaterThan(0); - for (const url of urls) { + return urls; +} + +async function expectAbsent(page: Page, deferred: Array<{ owner: string; probe: string }>) { + for (const url of await startupScripts(page)) { const body = await (await page.request.get(url)).text(); - for (const { owner, probe } of DEFERRED) expect(body.includes(probe), `${owner} is in ${url}`).toBe(false); + for (const { owner, probe } of deferred) expect(body.includes(probe), `${owner} is in ${url}`).toBe(false); } +} + +test('the editor startup scripts leave the agent tools, the PWA prompt and jschardet out', async ({ page }) => { + await page.goto('/editor?new=docx'); + await expectAbsent(page, [AGENT_TOOLS, PWA_INSTALL, JSCHARDET]); +}); + +test('the history page startup scripts leave the editor stack and jschardet out', async ({ page }) => { + await page.goto('/history'); + await expectAbsent(page, [EDITOR_STACK, JSCHARDET]); }); test('the PWA install element is still defined and mounted after startup', async ({ page }) => { diff --git a/test/unit/history-recovery.test.ts b/test/unit/history-recovery.test.ts index cd2b4ff15..c8ee61c45 100644 --- a/test/unit/history-recovery.test.ts +++ b/test/unit/history-recovery.test.ts @@ -8,7 +8,8 @@ vi.mock('../../lib/document', () => ({ openLocalFile })); import { DB_NAME, resetHistoryDbForTests } from '../../lib/history/db'; import { putSnapshot, resetHistoryClockForTests } from '../../lib/history/store'; -import { formatRelativeTime, restoreDocument } from '../../lib/history/recovery'; +import { restoreDocument } from '../../lib/history/recovery'; +import { formatRelativeTime } from '../../lib/history/relative-time'; async function wipe(): Promise { resetHistoryDbForTests(); diff --git a/test/unit/save-stream-lifecycle.test.ts b/test/unit/save-stream-lifecycle.test.ts index e0597f782..a09f2198c 100644 --- a/test/unit/save-stream-lifecycle.test.ts +++ b/test/unit/save-stream-lifecycle.test.ts @@ -7,7 +7,6 @@ vi.mock('../../lib/history/autosave', () => ({ getActiveDocumentId: () => 'save-document', clearDocumentSession: vi.fn(), beginAutosaveSession: vi.fn(), - isAutosaveEnabled: () => true, setAutosaveEnabled: vi.fn(), stopAutosaveSession: vi.fn(), cancelPendingSnapshot: vi.fn(),