From 531afeea9caf91f50f25e0e9dc318d76cdafb8b6 Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Sun, 29 Nov 2026 06:39:46 -0500 Subject: [PATCH 1/4] refactor(client): consolidate playback state and shared UI owners --- prototype/channel-browser/web.vite.config.ts | 13 -- prototype/channel-browser/web/index.html | 21 -- prototype/channel-browser/web/main.tsx | 1 - scripts/app-package-targets.mjs | 4 + scripts/build-channel-web.mjs | 2 +- scripts/package-app-candidate.mjs | 4 +- scripts/package-server-release.mjs | 10 +- scripts/release-artifacts.mjs | 12 +- scripts/server-package-targets.mjs | 6 + src/client/channel/attachments.ts | 63 +++--- .../components/ChannelConversation.tsx | 46 ++-- .../components/ChannelMessageContent.tsx | 8 +- .../channel/components/ChannelPeople.tsx | 47 +---- .../channel/components/ChannelStage.tsx | 4 +- .../channel/components/channel-identity.css | 1 - .../components/channel-room-controls.css | 1 - .../components/channel-share-control.css | 3 - src/client/channel/session.ts | 199 ++++++++++++------ src/client/channel/transport.ts | 49 ++--- src/client/channel/use-channel.ts | 33 ++- src/client/channel/watch-playback.ts | 36 ++-- src/client/components/living/Metrics.tsx | 13 -- src/client/locales/en.ts | 175 --------------- src/client/locales/ja.ts | 172 --------------- src/client/locales/ko.ts | 172 --------------- src/client/locales/zh-Hant.ts | 172 --------------- src/client/locales/zh.ts | 175 --------------- src/client/pages/ChannelRoomPreview.tsx | 4 +- src/client/pages/channel-living.css | 3 - src/client/remote-control/input-route.ts | 4 +- .../room-voice/participant-presentation.ts | 18 -- src/client/styles.css | 48 ----- src/shared/media-copy-accounting.ts | 64 ------ src/shared/protocol.ts | 8 - src/shared/video-codec-evidence.ts | 55 ----- tests/app-candidate.test.ts | 3 +- tests/channel-attachment-retention.test.ts | 28 ++- .../channel-conversation-presentation.test.ts | 77 ++++++- tests/channel-message-content.test.ts | 13 ++ tests/channel-session.test.ts | 35 +++ tests/channel-transport.test.ts | 97 +++++++++ tests/media-copy-accounting.test.ts | 97 --------- tests/publish-release.test.ts | 14 +- tests/release-automation.test.ts | 15 +- tests/release-update-index.test.ts | 25 ++- tests/remote-input.test.ts | 10 + tests/watch-peer-errors.test.ts | 7 +- tests/watch-playback.test.ts | 46 ++++ tests/watch-presentation.test.ts | 14 ++ vite.config.ts | 1 + 50 files changed, 643 insertions(+), 1485 deletions(-) delete mode 100644 prototype/channel-browser/web.vite.config.ts delete mode 100644 prototype/channel-browser/web/index.html delete mode 100644 prototype/channel-browser/web/main.tsx delete mode 100644 src/shared/media-copy-accounting.ts create mode 100644 tests/channel-transport.test.ts delete mode 100644 tests/media-copy-accounting.test.ts diff --git a/prototype/channel-browser/web.vite.config.ts b/prototype/channel-browser/web.vite.config.ts deleted file mode 100644 index 7e2c173f0..000000000 --- a/prototype/channel-browser/web.vite.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { resolve } from "node:path"; -import { defineConfig, mergeConfig } from "vite"; -import base from "../../vite.config.ts"; - -export default mergeConfig(base, defineConfig({ - root: resolve(import.meta.dirname, "web"), - publicDir: resolve(import.meta.dirname, "../../public"), - build: { - manifest: "vite-manifest.json", - outDir: resolve(import.meta.dirname, "../../build/channel-web"), - emptyOutDir: true, - }, -})); diff --git a/prototype/channel-browser/web/index.html b/prototype/channel-browser/web/index.html deleted file mode 100644 index cee4c9344..000000000 --- a/prototype/channel-browser/web/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - Piik - - - -
- - - diff --git a/prototype/channel-browser/web/main.tsx b/prototype/channel-browser/web/main.tsx deleted file mode 100644 index 65836a3c0..000000000 --- a/prototype/channel-browser/web/main.tsx +++ /dev/null @@ -1 +0,0 @@ -import "../../../src/client/main"; diff --git a/scripts/app-package-targets.mjs b/scripts/app-package-targets.mjs index 2798963c6..de3e61b42 100644 --- a/scripts/app-package-targets.mjs +++ b/scripts/app-package-targets.mjs @@ -91,6 +91,10 @@ export const APP_PACKAGE_TARGETS = [ }, ]; +export function appArtifactName(targetId) { + return targetId === ANDROID_APP_PACKAGE_TARGET.id ? ANDROID_APP_PACKAGE_TARGET.artifact : `piik-app-${targetId}.zip`; +} + export function appPackageTarget(id) { return APP_PACKAGE_TARGETS.find((target) => target.id === id) ?? null; } diff --git a/scripts/build-channel-web.mjs b/scripts/build-channel-web.mjs index b4fbe587a..4534a39e5 100644 --- a/scripts/build-channel-web.mjs +++ b/scripts/build-channel-web.mjs @@ -28,7 +28,7 @@ export function buildChannelWeb(root, { version, revision, cargoTarget }) { writeChannelWebLicenseNotices(root, join(root, 'public', 'third-party-licenses.txt')); for (const args of [ [join(root, 'prototype', 'channel-browser', 'build.mjs')], - [join(root, 'node_modules', 'vite', 'bin', 'vite.js'), 'build', '--config', 'prototype/channel-browser/web.vite.config.ts'], + [join(root, 'node_modules', 'vite', 'bin', 'vite.js'), 'build'], ]) { const result = spawnSync(process.execPath, args, { cwd: root, env, stdio: 'inherit', windowsHide: true }); if (result.error) throw result.error; diff --git a/scripts/package-app-candidate.mjs b/scripts/package-app-candidate.mjs index 2fbe96772..3c4a04285 100644 --- a/scripts/package-app-candidate.mjs +++ b/scripts/package-app-candidate.mjs @@ -17,7 +17,7 @@ import { pipeline } from "node:stream/promises"; import { fileURLToPath } from "node:url"; import { parseArgs } from "node:util"; -import { appPackageTarget, CLOUDFLARED_VERSION } from "./app-package-targets.mjs"; +import { appArtifactName, appPackageTarget, CLOUDFLARED_VERSION } from "./app-package-targets.mjs"; import { createZip, extractZip, tarExecutable } from "./archive-tool.mjs"; import { assertBuildInputRetained, assertCleanRevision, resetBuildWorkspace } from "./build-workspace.mjs"; import { buildVersion } from "./release-version.mjs"; @@ -122,7 +122,7 @@ try { mkdirSync(outputRoot, { recursive: false, mode: 0o700 }); outputOwned = true; - const archiveName = `piik-app-${target.id}.zip`; + const archiveName = appArtifactName(target.id); const archive = join(outputRoot, archiveName); createZip(packageRoot, archive); const extractedRoot = join(temporaryRoot, "extracted"); diff --git a/scripts/package-server-release.mjs b/scripts/package-server-release.mjs index 1b7cffc6a..69f636866 100644 --- a/scripts/package-server-release.mjs +++ b/scripts/package-server-release.mjs @@ -19,7 +19,7 @@ import { writeServerLicenseNotices } from "./package-licenses.mjs"; import { createZip, extractZip, tarExecutable } from "./archive-tool.mjs"; import { assertBuildInputRetained, assertCleanRevision, resetBuildWorkspace } from "./build-workspace.mjs"; import { buildVersion } from "./release-version.mjs"; -import { SERVER_PACKAGE_TARGETS } from "./server-package-targets.mjs"; +import { SERVER_PACKAGE_TARGETS, serverReleaseNames } from "./server-package-targets.mjs"; import { sha256, fileRecords, compareFileRecords } from "./package-files.mjs"; import { copyChannelWeb } from "./channel-web-artifact.mjs"; import { buildChannelWeb } from "./build-channel-web.mjs"; @@ -180,11 +180,7 @@ try { const paths = runtimePaths(target); const records = recordsFor(runtimeRoot, paths); - const stem = `piik-${releaseId}${target.suffix}`; - const manifestName = `${stem}.manifest.tsv`; - const archiveKind = target.goos === "windows" ? "zip" : "tar.gz"; - const artifactName = `${stem}-runtime.${archiveKind}`; - const descriptorName = `${stem}.release.json`; + const { manifest: manifestName, artifact: artifactName, descriptor: descriptorName } = serverReleaseNames(target, revision); mkdirSync(outputRoot, { recursive: false, mode: 0o700 }); outputOwned = true; const manifestPath = join(outputRoot, manifestName); @@ -196,7 +192,7 @@ try { "ascii", ); - if (archiveKind === "zip") { + if (target.goos === "windows") { createZip(runtimeRoot, artifactPath); mkdirSync(verifyRoot); extractZip(artifactPath, verifyRoot); diff --git a/scripts/release-artifacts.mjs b/scripts/release-artifacts.mjs index 97192286b..20045aa1d 100644 --- a/scripts/release-artifacts.mjs +++ b/scripts/release-artifacts.mjs @@ -2,8 +2,8 @@ import { createHash, createPublicKey, verify } from "node:crypto"; import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs"; import { basename, join, resolve } from "node:path"; import { isDeepStrictEqual } from "node:util"; -import { APP_PACKAGE_TARGETS, ANDROID_APP_PACKAGE_TARGET } from "./app-package-targets.mjs"; -import { SERVER_PACKAGE_TARGETS } from "./server-package-targets.mjs"; +import { appArtifactName, APP_PACKAGE_TARGETS, ANDROID_APP_PACKAGE_TARGET } from "./app-package-targets.mjs"; +import { SERVER_PACKAGE_TARGETS, serverReleaseNames } from "./server-package-targets.mjs"; export function updateIndex(release) { return { schema: 1, version: release.version, revision: release.revision, @@ -109,15 +109,19 @@ export function readReleaseArtifacts(directory, version, revision, { publicKey = const target = descriptor.target ?? "server"; if (targets.has(target)) throw new Error(`Duplicate release target: ${target}`); targets.add(target); + const serverTarget = SERVER_PACKAGE_TARGETS.find(candidate => candidate.id === target); + const serverNames = serverTarget && serverReleaseNames(serverTarget, revision); + if (descriptor.artifact !== (serverNames?.artifact ?? appArtifactName(target))) { + throw new Error(`Release artifact name mismatch: ${target}`); + } const archive = asset(descriptor.artifact); if (archive.sha256 !== descriptor.artifactSha256) { throw new Error(`Release artifact checksum mismatch: ${name}`); } packages.push(archive); packagesByTarget.set(target, archive); - const serverTarget = SERVER_PACKAGE_TARGETS.find(candidate => candidate.id === target); if (serverTarget) { - if (asset(descriptor.manifest).sha256 !== descriptor.manifestSha256) { + if (descriptor.manifest !== serverNames.manifest || asset(descriptor.manifest).sha256 !== descriptor.manifestSha256) { throw new Error("Server manifest checksum mismatch"); } servers.push({ ...archive, arch: serverTarget.goarch, goos: serverTarget.goos }); diff --git a/scripts/server-package-targets.mjs b/scripts/server-package-targets.mjs index 65a4d91b1..5d2f75f73 100644 --- a/scripts/server-package-targets.mjs +++ b/scripts/server-package-targets.mjs @@ -6,3 +6,9 @@ export const SERVER_PACKAGE_TARGETS = [ { id: "server-linux-arm64", goos: "linux", goarch: "arm64", rustTarget: "aarch64-unknown-linux-musl", suffix: "-linux-arm64" }, { id: "server-windows-amd64", goos: "windows", goarch: "amd64", rustTarget: "x86_64-pc-windows-msvc", suffix: "-windows-amd64" }, ]; + +export function serverReleaseNames(target, revision) { + const stem = `piik-${revision.slice(0, 7)}${target.suffix}`; + const extension = target.goos === "windows" ? "zip" : "tar.gz"; + return { artifact: `${stem}-runtime.${extension}`, manifest: `${stem}.manifest.tsv`, descriptor: `${stem}.release.json` }; +} diff --git a/src/client/channel/attachments.ts b/src/client/channel/attachments.ts index 43f8036db..104199628 100644 --- a/src/client/channel/attachments.ts +++ b/src/client/channel/attachments.ts @@ -178,11 +178,9 @@ export class ChannelAttachments { this.rooms = rooms; this.plans = plans; this.roomPeers = pairs.map(pair => [pair.peerId, pair.rooms]); let changed = this.availability.update(scope, previous); - for (const [id, entry] of this.sinks) { + for (const entry of this.sinks.values()) { if (!authorized.has(entry.key.roomId)) { - this.sinks.delete(id); - if (this.runtime) void this.runtime.then(runtime => this.invoke(runtime, () => runtime.delivery.cancel(JSON.stringify(entry.key)))).catch(() => {}); - void this.retireSink(entry.ready, new Error("room_unavailable")); + void this.stopSink(entry, new Error("room_unavailable")); changed = true; continue; } @@ -325,7 +323,7 @@ export class ChannelAttachments { private async clearSinks(matches: (entry: PendingSink) => boolean): Promise { const disposals = []; for (const entry of this.sinks.values()) { - if (matches(entry)) disposals.push(this.stopSink(entry, aborted(), true)); + if (matches(entry)) disposals.push(this.stopSink(entry, "clear")); } this.changed(); const results = await Promise.allSettled(disposals); @@ -441,7 +439,7 @@ export class ChannelAttachments { if (!current()) return; try { await this.command({ type: "file_receive", ...key, enabled: true }); } catch (error) { if (current()) await this.stopSink(entry, errorOf(error)); } - }, () => {}); // Local storage errors are delivered to the sink's consumers. + }, () => this.stopSink(entry, "released")); // Local storage errors are delivered to the sink's consumers. } private installSource(source: Source): void { const id = fileKeyString(source.key), download = this.downloads.get(id); @@ -664,8 +662,6 @@ export class ChannelAttachments { progress: { received: 0, total: attachment.size, state: plan ? this.transferState(plan) : "waiting" } }; this.sinks.set(id, entry); this.requestReceive(entry); - const creating = entry; - void entry.ready.catch(() => { if (this.sinks.get(id) === creating) { this.sinks.delete(id); this.changed(); } }); } const active = entry, consumer = Symbol(); active.consumers.add(consumer); this.changed(); @@ -673,11 +669,7 @@ export class ChannelAttachments { const cleanup = () => { signal.removeEventListener("abort", cancel); active.consumers.delete(consumer); }; const cancel = () => { cleanup(); reject(aborted()); - if (!active.consumers.size && this.sinks.get(id) === active) { - this.sinks.delete(id); this.changed(); this.invoke(runtime, () => runtime.delivery.cancel(JSON.stringify(key))); - void this.command({ type: "file_receive", ...key, enabled: false }).catch(() => {}); - void this.retireSink(active.ready, aborted()); - } + if (!active.consumers.size) void this.stopSink(active, aborted(), runtime); }; signal.addEventListener("abort", cancel, { once: true }); active.ready.then(sink => sink.promise).then(file => { cleanup(); resolve(file); }, error => { cleanup(); reject(error); }); @@ -706,7 +698,7 @@ export class ChannelAttachments { this.invoke(runtime, () => runtime.delivery.start(JSON.stringify(key))); return sink; } catch (error) { - if (this.sinks.get(fileKeyString(key))?.consumers === consumers) this.invoke(runtime, () => runtime.delivery.cancel(JSON.stringify(key))); + if (this.sinks.get(fileKeyString(key))?.consumers === consumers) void this.cancelDelivery(key, runtime); await this.disposeSink(sink, errorOf(error)); throw error; } } @@ -765,7 +757,7 @@ export class ChannelAttachments { } else { const entry = this.sinks.get(fileKeyString(key)); if (!entry) continue; - const sinkFailed = (error: unknown) => { if (this.sinks.get(fileKeyString(key)) === entry) void this.stopSink(entry, errorOf(error)); }; + const sinkFailed = (error: unknown) => { void this.stopSink(entry, errorOf(error)); }; void entry.ready.then(sink => { if (entry.clearing) return; if (effect.type === "failed") { if (!sink.complete) return this.stopSink(entry, new Error(effect.code)); return; } @@ -804,7 +796,7 @@ export class ChannelAttachments { if (retained) { try { await sink.directory.removeEntry(sink.name); - if (this.sinks.get(fileKeyString(key)) === entry) { this.sinks.delete(fileKeyString(key)); this.changed(); } + await this.stopSink(entry, "released"); } catch { /* The existing temporary owner retries cleanup on reset. */ } } @@ -814,25 +806,30 @@ export class ChannelAttachments { } } } - private async stopSink(entry: PendingSink, error: Error, clearFile = false): Promise { - const { key } = entry; - if (this.sinks.get(fileKeyString(key)) !== entry) return; + private async cancelDelivery(key: ChannelFileKey, runtime?: Runtime): Promise { + try { + const owner = runtime ?? await this.runtime; + if (owner) this.invoke(owner, () => owner.delivery.cancel(JSON.stringify(key))); + } catch { /* Local file cleanup still owns the writer and its pending writes. */ } + } + private async stopSink(entry: PendingSink, reason: Error | "clear" | "released", runtime?: Runtime): Promise { + const { key } = entry, id = fileKeyString(key); + if (this.sinks.get(id) !== entry) return; + const clearFile = reason === "clear"; if (clearFile) { entry.clearing = true; entry.progress = null; - } else this.sinks.delete(fileKeyString(key)); - this.changed(); - if (this.runtime) void this.runtime.then(runtime => this.invoke(runtime, () => runtime.delivery.cancel(JSON.stringify(key)))).catch(() => {}); - void this.command({ type: "file_receive", ...key, enabled: false }).catch(() => {}); - await this.retireSink(entry.ready, error, clearFile); - if (clearFile && this.sinks.get(fileKeyString(key)) === entry) this.sinks.delete(fileKeyString(key)); - } - private retireSink(ready: Promise, error: Error, clearFile = false): Promise { + } else this.sinks.delete(id); + const authorized = this.rooms.some(room => room.id === key.roomId && room.authorized); + if (authorized) this.changed(); // Room loss and reset publish the whole update. + if (reason === "released") return; + void this.cancelDelivery(key, runtime); + if (authorized) void this.command({ type: "file_receive", ...key, enabled: false }).catch(() => {}); const disposals = this.sinkDisposals; - const disposal = ready.then(sink => this.disposeSink(sink, error, clearFile), () => {}); + const disposal = entry.ready.then(sink => this.disposeSink(sink, clearFile ? aborted() : reason, clearFile), () => {}); disposals.add(disposal); - void disposal.finally(() => disposals.delete(disposal)).catch(() => {}); - return disposal; + try { await disposal; } finally { disposals.delete(disposal); } + if (clearFile && this.sinks.get(id) === entry) this.sinks.delete(id); } private async disposeSink(sink: Sink, error: Error, clearFile = false): Promise { sink.lifetime.abort(); sink.reject(error); @@ -846,13 +843,13 @@ export class ChannelAttachments { clearTimeout(this.expiry); this.expiry = undefined; this.lifetime.abort(); if (this.runtime) void this.runtime.then(runtime => runtime.delivery.free()).catch(() => {}); - const downloads = [...this.downloads.values()], sinks = [...this.sinks.values()]; + const downloads = [...this.downloads.values()]; this.availability.disconnect(); this.retainedClears.clear(); - this.savedReceipts.clear(); this.sources.clear(); this.sinks.clear(); this.downloads.clear(); this.runtime = null; this.plans = []; this.rooms = []; this.roomPeers = []; this.sessionId = null; this.scope = null; this.store = null; + this.savedReceipts.clear(); this.sources.clear(); this.downloads.clear(); this.runtime = null; this.plans = []; this.rooms = []; this.roomPeers = []; this.sessionId = null; this.scope = null; this.store = null; // Abort handlers run synchronously and must not send cancellation for the retired session. + for (const entry of this.sinks.values()) void this.stopSink(entry, aborted()); for (const download of downloads) download.controller.abort(); - for (const entry of sinks) void this.retireSink(entry.ready, aborted()); const storage = this.transferStorage, disposals = this.sinkDisposals; this.transferStorage = undefined; this.sinkDisposals = new Set(); diff --git a/src/client/channel/components/ChannelConversation.tsx b/src/client/channel/components/ChannelConversation.tsx index 60f0ea8c8..79585ca8d 100644 --- a/src/client/channel/components/ChannelConversation.tsx +++ b/src/client/channel/components/ChannelConversation.tsx @@ -21,6 +21,7 @@ import type { RoomInteractionSession } from "../../lib/room-interactions"; import { useSurfaceDocument } from "../../ui/panel-window"; import { Tooltip } from "../../components/living/Tooltip"; import { messageRemoved, type ChatOptions, type ChannelController } from "../types"; +import { useProfileDirectory } from "../use-channel"; import { loadRoomHosting } from "../hosting"; import { ChannelMentionSuggestions, editMentions, matchingMentionUsers, mentionQuery } from "./ChannelMentionSuggestions"; import "./channel-conversation.css"; @@ -192,41 +193,22 @@ export function ChannelConversation({ domainId, roomId, bindingId, roomName, roo && !draft.mentions.some(mention => selection.start > mention.start && selection.start <= mention.end) ? mentionQuery(draft.text, selection.start, selection.end) : null; const queryText = query && !hidden ? query.query : null; - const [mentionPage, setMentionPage] = useState<{ query: string; ids: string[]; next: string | null }>({ query: "", ids: [], next: null }); - const [mentionLoading, setMentionLoading] = useState(false), [mentionFailed, setMentionFailed] = useState(false); - const mentionRequest = useRef(null); - const [mentionRetry, setMentionRetry] = useState(0); + const search = useMemo(() => ({ query: queryText ?? "" }), [queryText, queryProfiles, available, conversationScope]); + const mentionPage = useProfileDirectory(queryProfiles, queryText !== null && available ? search : null); + useEffect(() => { + setMentionIndex(0); + void mentionPage.load(); + }, [search]); const candidates = useMemo(() => { if (queryText === null) return []; const localCandidates = matchingMentionUsers(users, queryText); - const matchingIds = new Set(localCandidates.map(user => user.id)); - if (mentionPage.query === queryText) { - for (const id of mentionPage.ids) matchingIds.add(id); - } + const matchingIds = new Set([...localCandidates.map(user => user.id), ...mentionPage.ids]); return matchingMentionUsers([...matchingIds].flatMap(id => { const summary = users.find(user => user.id === id), profile = profiles.get(id); return summary ? [{ ...summary, avatar: summary.version === profile?.version ? profile.avatar : null }] : profile ? [profile] : []; }), queryText); - }, [users, profiles, queryText, mentionPage, lang]); - const moreMentions = mentionPage.query === queryText && mentionPage.next !== null; - async function loadMentions(after?: string) { - if (queryText === null) return; - mentionRequest.current?.abort(); - const current = mentionRequest.current = new AbortController(), search = queryText; - setMentionLoading(true); setMentionFailed(false); - try { - const page = await queryProfiles({ query: search, ...(after ? { after } : {}) }, current.signal); - if (!current.signal.aborted) setMentionPage(previous => ({ query: search, - ids: [...new Set([...(after && previous.query === search ? previous.ids : []), ...page.profiles.map(user => user.id)])], next: page.nextCursor })); - } catch { if (!current.signal.aborted) setMentionFailed(true); } - finally { if (!current.signal.aborted) setMentionLoading(false); } - } - useEffect(() => { - setMentionPage({ query: queryText ?? "", ids: [], next: null }); setMentionIndex(0); setMentionFailed(false); setMentionLoading(false); - if (queryText !== null && available) void loadMentions(); - return () => { mentionRequest.current?.abort(); }; - }, [queryText, queryProfiles, available, conversationScope, mentionRetry]); + }, [users, profiles, queryText, mentionPage.ids, lang]); const activeMention = Math.min(mentionIndex, candidates.length - 1); const textLength = Array.from(text).length; const textTooLong = textLength > MAX_MESSAGE_CODE_POINTS; @@ -609,9 +591,9 @@ export function ChannelConversation({ domainId, roomId, bindingId, roomName, roo }} /> } {query && selectMention(user, query)} - loading={mentionLoading} error={mentionFailed} hasMore={moreMentions} onMore={() => { - if (mentionFailed && !mentionPage.ids.length) setMentionRetry(value => value + 1); - else void loadMentions(mentionPage.next ?? undefined); + loading={mentionPage.loading} error={mentionPage.failed} hasMore={!!mentionPage.next} onMore={() => { + if (mentionPage.failed && mentionPage.next === undefined) setMentionIndex(0); + void mentionPage.load(); }} />}
{attachmentsAvailable && <> { addFiles([...event.currentTarget.files ?? []]); event.currentTarget.value = ""; }} /> @@ -641,8 +623,8 @@ export function ChannelConversation({ domainId, roomId, bindingId, roomName, roo if (query && event.key === "Escape") { event.preventDefault(); setSelection(null); return; } if (query && (event.key === "ArrowDown" || event.key === "ArrowUp")) { event.preventDefault(); - if (event.key === "ArrowDown" && activeMention === candidates.length - 1 && (moreMentions || mentionFailed) && !mentionLoading) { - void loadMentions(mentionPage.next ?? undefined); setMentionIndex(candidates.length); + if (event.key === "ArrowDown" && activeMention === candidates.length - 1 && (mentionPage.next || mentionPage.failed) && !mentionPage.loading) { + void mentionPage.load(); setMentionIndex(candidates.length); } else if (candidates.length) setMentionIndex((activeMention + (event.key === "ArrowDown" ? 1 : -1) + candidates.length) % candidates.length); return; } diff --git a/src/client/channel/components/ChannelMessageContent.tsx b/src/client/channel/components/ChannelMessageContent.tsx index c8af87478..a32679dc3 100644 --- a/src/client/channel/components/ChannelMessageContent.tsx +++ b/src/client/channel/components/ChannelMessageContent.tsx @@ -33,7 +33,9 @@ export function ChannelMessageContent({ message, users, selfUserId }: { // Markdown also decodes entities; neither raw nor decoded text may forge a reference. const decoded = markdown.utils.unescapeAll(message.text); let marker = "\uE000"; - while ([message.text, decoded].some(text => text.includes(marker) || text.toLowerCase().includes(encodeURI(marker).toLowerCase()))) marker += "\uE000"; + while ([message.text, decoded].some(text => text.includes(marker) || text.toLowerCase().includes(encodeURI(marker).toLowerCase()))) { + marker = String.fromCharCode(marker.charCodeAt(0) + 1); + } const mentions = message.mentions ?? []; const references = mentions.map((mention, index) => ({ mention, marker: `${marker}${index}${marker}`, text: message.text.slice(mention.start, mention.end) })); @@ -67,13 +69,15 @@ export function ChannelMessageContent({ message, users, selfUserId }: { else if (token.type === "fence" || token.type === "code_block") result.push(); else if (token.type === "softbreak" || token.type === "hardbreak") result.push(
); else if (token.nesting === 1) { + const contentStart = index; const inner = children(); if (token.tag === "a") { const href = references.reduce((href, reference) => href.split(encodeURI(reference.marker)).join(encodeURI(reference.text)), restore(String(token.attrGet("href") ?? ""))); + const hasLabel = tokens.slice(contentStart, index - 1).some(token => token.content.trim()); // Chat links never navigate within the app or execute another URL scheme. result.push(isExternalLink(href) - ? {inner} : {inner}); + ? {hasLabel ? inner : href} : {inner}); } else if (tags.has(token.tag)) result.push(createElement(token.tag, { key, ...(token.tag === "ol" && token.attrGet("start") ? { start: Number(token.attrGet("start")) } : {}) }, inner)); else result.push({inner}); diff --git a/src/client/channel/components/ChannelPeople.tsx b/src/client/channel/components/ChannelPeople.tsx index a84e0dcc1..9f7090158 100644 --- a/src/client/channel/components/ChannelPeople.tsx +++ b/src/client/channel/components/ChannelPeople.tsx @@ -2,54 +2,23 @@ import { memberName, duplicateMemberNames } from "../member-name"; import { BackButton, Btn } from "../../components/living/primitives"; import { useCopy } from "../../ui/copy"; import type { ChannelController } from "../types"; +import { useProfileDirectory } from "../use-channel"; import type { ChannelUser as User } from "../protocol"; import { listeningVoicePublications, onlineUserIds, roomPresentUserIds, roomActivityPeople, userProfile } from "../presentation"; import { ChannelUser } from "./ChannelUser"; -import { memo, useEffect, useRef, useState } from "react"; +import { memo, useEffect, useMemo } from "react"; export const ChannelPeople = memo(function ChannelPeople({ channel, roomId, active, onBack }: { channel: ChannelController; roomId: string; active: boolean; onBack(): void }) { const { t } = useCopy(); const { state, self } = channel; - const [directory, setDirectory] = useState<{ ids: string[]; next?: string | null }>({ ids: [] }); - const [loading, setLoading] = useState(false), [failed, setFailed] = useState(false); - const request = useRef(null); - const firstPageLoaded = useRef(false); - const load = async (after?: string) => { - if (request.current || channel.connection !== "connected") return; - const current = request.current = new AbortController(); - setLoading(true); setFailed(false); - try { - const page = await channel.queryProfiles(after ? { after } : {}, current.signal); - if (!current.signal.aborted) { - const pageIds = page.profiles.map(user => user.id); - firstPageLoaded.current = true; - setDirectory(previous => ({ ids: [...new Set([...previous.ids, ...pageIds])], next: page.nextCursor })); - } - } catch { if (!current.signal.aborted) setFailed(true); } - finally { - if (request.current === current) { - request.current = null; - setLoading(false); - } - } - }; - useEffect(() => { - firstPageLoaded.current = false; - setDirectory({ ids: [] }); setLoading(false); setFailed(false); - return () => { - request.current?.abort(); - request.current = null; - }; - }, [state?.channel.id, self?.id]); + const query = useMemo(() => ({}), [state?.channel.id, self?.id]); + const directory = useProfileDirectory(channel.queryProfiles, query, active ? state?.users : undefined); + const { loading, failed } = directory; useEffect(() => { if (!active || channel.connection !== "connected") return; - if (!firstPageLoaded.current) void load(); + if (directory.next === undefined) void directory.load(); else void channel.loadProfiles(directory.ids).catch(() => {}); - }, [active, state?.channel.id, self?.id, channel.connection]); - useEffect(() => { - if (active) setDirectory(previous => state?.users.every(user => previous.ids.includes(user.id)) ? previous - : { ...previous, ids: [...new Set([...previous.ids, ...(state?.users.map(user => user.id) ?? [])])] }); - }, [active, state?.users]); + }, [active, query, channel.connection]); const online = onlineUserIds(state); const inRoom = state ? roomPresentUserIds(state, roomId) : new Set(); const groups: { label: string; users: User[] }[] = [ @@ -86,7 +55,7 @@ export const ChannelPeople = memo(function ChannelPeople({ channel, roomId, acti disabled={channel.connection !== "connected"} title={{ text: failed ? t("channel.people.retry") : t("channel.people.morePeople") }} cap={{ text: failed ? t("channel.people.retry") : t("channel.people.morePeople") }} - onClick={() => { void load(directory.next ?? undefined); }} />} + onClick={directory.load} />}
; }); diff --git a/src/client/channel/components/ChannelStage.tsx b/src/client/channel/components/ChannelStage.tsx index 14877d830..d2b79b6c2 100644 --- a/src/client/channel/components/ChannelStage.tsx +++ b/src/client/channel/components/ChannelStage.tsx @@ -426,7 +426,7 @@ export function ChannelStage({ layoutHome, companion, theaterMode: [theater, set onFocus(source.id); }}> {waiting ?
{t("screen.shareEnded", { name: source.name })}
: hasPicture(source) ? onRetryPicture(source.id) : undefined} retryAvailable={canSubscribe && !source.pending} + onRetryPicture={onRetryPicture ? () => onRetryPicture(source.id) : undefined} retryAvailable={canSubscribe && source.available !== false && !source.pending} failure={source.pictureFailure} clearFailure={source.clearPictureFailure} presentation={source.hidden ? "background" : thumbnail ? "thumbnail" : "full"} inputs={source.inputs} onPresentation={onPresentation} input={source.input} interaction={source.interaction} @@ -441,7 +441,7 @@ export function ChannelStage({ layoutHome, companion, theaterMode: [theater, set {!source.paused && !source.owned && !source.localSource && (retryable || help) &&
{onRetryPicture && retryable && onRetryPicture(source.id)} />} {help && span { font-size: 11px; line-height: 1.25; white-space: nowrap; } -.c3-identity-form { display: grid; gap: 16px; } .c3-form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; } .c3-identity-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; } .c3-identity-upload-actions { display: contents; } diff --git a/src/client/channel/components/channel-room-controls.css b/src/client/channel/components/channel-room-controls.css index 723e92be0..a16ef1de9 100644 --- a/src/client/channel/components/channel-room-controls.css +++ b/src/client/channel/components/channel-room-controls.css @@ -1,4 +1,3 @@ -.c3-invite-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; } .c3-settings-details { min-width: 0; } .c3-settings-details > summary { min-height: var(--control-size); padding-block: 12px; font-size: 13px; font-weight: 600; cursor: pointer; } .c3-settings-details[open] > :not(summary) { margin-top: 12px; } diff --git a/src/client/channel/components/channel-share-control.css b/src/client/channel/components/channel-share-control.css index 3be6aa2e0..32f499678 100644 --- a/src/client/channel/components/channel-share-control.css +++ b/src/client/channel/components/channel-share-control.css @@ -21,9 +21,6 @@ .c3-watch-source-dialog .c3-external-input > .lr-btn { align-self: start; } .c3-watch-source-dialog .c3-external-input > [tabindex="-1"]:focus { outline: none; } .c3-watch-source-list { gap: 12px; } -.c3-watch-source-choice { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; } -.c3-watch-source-choice > .lr-btn { justify-self: start; } -.c3-watch-source-alternative { border-block-start: 1px solid var(--line); padding-block-start: 8px; } .lr-anchored-card.c3-quality-picker { width: min(640px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 0; overflow: hidden; diff --git a/src/client/channel/session.ts b/src/client/channel/session.ts index 1d004d9b5..41e18ad79 100644 --- a/src/client/channel/session.ts +++ b/src/client/channel/session.ts @@ -83,6 +83,27 @@ interface ScreenWatch { operation?: Promise; } +/** + * What this page intends toward one watch source or screen publication: to follow it once it can, to follow it, or + * to stay away. The confirmed subscription stays the room's, read from its snapshot, and player readiness stays Stage's. + * + * A change of state replaces the record's object and a change of a field writes in place. Code that awaits and then + * asks whether the record it started from is still the current one compares objects, and relies on this. + */ +interface SourceIntent { + roomId: string; + /** The route this page's person chose by a switch that succeeded. A named successor starts with its predecessor's. */ + preference?: WatchMode; + /** The routes this page took by itself for the source. While it has any, the page chooses, not the person. */ + routes?: Set; +} +/** + * A successor the room named waits until this page follows it, carrying the source it replaces and the mode this page + * received that one by. A source this page left stays left until the room no longer names it or a successor of it. + */ +type WaitingSource = SourceIntent & { state: "waiting"; predecessor: { kind: "watch" | "screen"; id: string }; priorMode: WatchMode; browser: boolean }; +type Intent = WaitingSource | SourceIntent & { state: "followed" | "left" }; + async function waitForDisplaySurface(track: MediaStreamTrack, signal: AbortSignal): Promise { signal.throwIfAborted(); if (track.readyState !== "live") throw new Error("capture_unavailable"); @@ -253,15 +274,8 @@ export class ChannelSession { private captureLifetime = new AbortController(); private readonly pendingActions = new Set(); private readonly stages = new Map(); - private waitingWatchPages = new Map(); - // Sources this page left, by room: until the room sees the leave it can still name them on a successor. - private declinedSources = new Map(); + /** How this page follows each watch source or screen it follows, waits to follow or left, by the source's id. */ + private readonly intents = new Map(); private local = new Map(); private readonly voice = new VoiceParticipation({ local: this.local, @@ -418,7 +432,7 @@ export class ChannelSession { } const remoteControls = new Map([...(patch.remoteControls ?? this.view.remoteControls)].filter(([id]) => ownedScreens.has(id))); const errorRoomId = "error" in patch ? patch.errorRoomId : this.view.errorRoomId; - this.view = { ...this.view, ...patch, hostingRestoreFailure: this.hosting.restoreFailure, pending, errorRoomId, waitingWatchPages: new Set(this.waitingWatchPages.keys()), watchPlayers: new Map(this.watchPlayers()), pagePlayer: this.app?.pagePlayer ?? false, appConnected: this.app?.connected ?? false, + this.view = { ...this.view, ...patch, hostingRestoreFailure: this.hosting.restoreFailure, pending, errorRoomId, waitingWatchPages: new Set([...this.waitingSources()].map(([id]) => id)), watchPlayers: new Map(this.watchPlayers()), pagePlayer: this.app?.pagePlayer ?? false, appConnected: this.app?.connected ?? false, appPort: this.app?.connected ? this.app.port : undefined, backgroundVoiceShortcuts: this.app?.connected ? this.app.backgroundVoiceShortcuts : undefined, externalScreenInputAvailable: this.app?.connected === true && this.app.externalScreenInputAvailable, ownedScreens, localScreens, remoteControls }; @@ -687,7 +701,7 @@ export class ChannelSession { const previousRooms = this.view.state?.channel.rooms; // A room writer can resume while this endpoint's channel socket stays connected. for (const activity of state.watchActivities) { - if (this.watchPlayer(activity.id) || this.waitingWatchPages.has(activity.id)) continue; + if (this.watchPlayer(activity.id) || this.waitingFor(activity.id)) continue; const room = state.channel.rooms.find(room => room.id === activity.roomId); if (!room?.available || !room.authorized || (!restoring && !previousRooms?.some(previous => previous.id === room.id && !previous.available))) continue; @@ -723,23 +737,27 @@ export class ChannelSession { // A room names a predecessor only in the snapshot of a viewer that watched it, until that viewer joins or // declines the successor, so a named successor is followed unless this page holds, opens or declined it. // A named predecessor never returns: a declined source that is neither present nor named is settled. - for (const [id, roomId] of this.declinedSources) { - if (canFollow(roomId) && !state.watchActivities.some(next => next.id === id || next.predecessor?.id === id) - && !state.publications.some(next => next.id === id || next.kind === "screen" && next.predecessor?.id === id)) this.declinedSources.delete(id); + for (const [id, { roomId, state: kind }] of this.intents) { + if (kind === "left" && canFollow(roomId) && !state.watchActivities.some(next => next.id === id || next.predecessor?.id === id) + && !state.publications.some(next => next.id === id || next.kind === "screen" && next.predecessor?.id === id)) this.unleave(id); } - const declined = (next: { id: string; predecessor?: { id: string } }) => this.declinedSources.has(next.id) || !!next.predecessor && this.declinedSources.has(next.predecessor.id); + const left = (id: string) => this.intents.get(id)?.state === "left"; + const declined = (next: { id: string; predecessor?: { id: string } }) => left(next.id) || !!next.predecessor && left(next.predecessor.id); const nextScreens = state.publications.filter(next => next.kind === "screen" && next.predecessor && canFollow(next.roomId) && !declined(next) && !this.watching.has(next.id) && !state.subscriptions.includes(next.id)); const nextWatches = state.watchActivities.filter(next => next.predecessor && canFollow(next.roomId) && !declined(next) - && !this.watchPlayer(next.id) && !this.pendingWatchPlayer(next.id) && !this.waitingWatchPages.has(next.id) + && !this.watchPlayer(next.id) && !this.pendingWatchPlayer(next.id) && !this.waitingFor(next.id) && !state.watchSubscriptions.some(sub => sub.id === next.id)); for (const next of nextWatches) { const predecessor = next.predecessor!; - // The receiving method is this page's choice: carry it from the source it watched, through any successor still pending. - const prior = [...this.waitingWatchPages].find(([id, waiting]) => id === predecessor.id || waiting.predecessor.id === predecessor.id)?.[1]; - const explicitMode = prior ? prior.explicitMode : this.watchRouting.has(predecessor.id) ? undefined : this.watchPlayer(predecessor.id)?.mode ?? undefined; + // The receiving method is the person's choice: carry it from the source this page watched, through any successor still pending. + const prior = [...this.waitingSources()].find(([id, waiting]) => id === predecessor.id || waiting.predecessor.id === predecessor.id)?.[1]; + const source = this.intents.get(predecessor.id); + const preference = prior ? prior.preference : source?.routes ? undefined : source?.preference; const priorMode = prior?.priorMode ?? previous?.watchSubscriptions.find(sub => sub.id === predecessor.id)?.mode ?? "direct"; - this.waitingWatchPages.set(next.id, { roomId: next.roomId, priorMode, explicitMode, predecessor, browser: canWatchInBrowser(next.source) }); + // A successor starts with no routes of its own, after the sources already waiting. + this.intents.delete(next.id); + this.intents.set(next.id, { roomId: next.roomId, state: "waiting", preference, predecessor, priorMode, browser: canWatchInBrowser(next.source) }); } if (restoring) { // A leave made offline never reached the room, which still names the successor. @@ -800,24 +818,23 @@ export class ChannelSession { publicationReactions: new Map([...this.view.publicationReactions].filter(([id]) => state.publications.some(publication => publication.id === id && canRead(publication.roomId) && !freshBindings.has(publication.roomId)))), }); - for (const [id, waiting] of this.waitingWatchPages) { + for (const [id, waiting] of this.waitingSources()) { const next = state.watchActivities.find(activity => activity.id === id); const joined = state.watchSubscriptions.some(sub => sub.id === id); const player = this.watchPlayer(id); if (!next || !canFollow(waiting.roomId) || (!joined && previous?.watchSubscriptions.some(sub => sub.id === id)) || waiting.browser && joined && player) { - this.waitingWatchPages.delete(id); + this.stopWaiting(id, waiting); this.patch({}); continue; } if (nextWatches.includes(next) || restoring && !player && (waiting.browser || !joined)) { const socket = this.socket; - const opening = waiting.browser ? this.joinWatch(id, waiting.explicitMode) : this.request({ type: "join_watch", roomId: waiting.roomId, id, mode: "direct" }, undefined, waiting.roomId); + const opening = waiting.browser ? this.joinWatch(id, waiting.preference) : this.request({ type: "join_watch", roomId: waiting.roomId, id, mode: "direct" }, undefined, waiting.roomId); void opening.catch(error => { - // The activity is gone: nothing to decline, and this entry keeps the receiving method for the successor the room names next. + // The activity is gone: nothing to decline, and this record keeps the receiving method for the successor the room names next. if (error instanceof Error && error.message === "watch_unavailable") return; - if (this.socket === socket && this.waitingWatchPages.get(id) === waiting) { - this.waitingWatchPages.delete(id); + if (this.socket === socket && this.intents.get(id) === waiting) { this.declineSuccessor(waiting.roomId, { kind: "watch", id }); this.patch({}); } @@ -827,17 +844,22 @@ export class ChannelSession { const before = previous?.watchActivities.find(activity => activity.id === id); if (before?.byteSource && previous?.watchSubscriptions.some(sub => sub.id === id)) continue; if (waiting.priorMode === "peer" || !(this.view.pagePlayer && originalWatchURL(next.source)) || next.playback.timeline === "program") { - if (waiting.explicitMode === "peer") void this.joinWatch(id, "peer").catch(() => {}); + if (waiting.preference === "peer") void this.joinWatch(id, "peer").catch(() => {}); else { - this.watchRouting.set(id, new Set(["peer"])); + this.takeRoute(id, waiting.roomId, "peer"); void this.action(`watch-video:${id}`, () => this.joinWatchRoute(id, "peer")).catch(() => {}); } } } - for (const id of [...this.watchRouting.keys()]) { + for (const [id, follow] of this.intents) { const player = this.watchPlayer(id); - if (player) void this.followWatchFailure(id, player); - else if (!state.watchActivities.some(activity => activity.id === id)) this.watchRouting.delete(id); + if (player) { if (follow.routes) void this.followWatchFailure(id, player); } + else if (!state.watchActivities.some(activity => activity.id === id)) { + // The source is gone and nothing plays it: a followed record ends. One the page left stays until the room + // names neither it nor a successor, and takes no routes further. + if (follow.state === "followed") this.intents.delete(id); + else delete follow.routes; + } } for (const next of nextScreens) { const socket = this.socket; @@ -1309,7 +1331,7 @@ export class ChannelSession { for (const member of state?.voice ?? []) { if (member.sessionId === this.view.sessionId) rooms.add(member.roomId); } - for (const waiting of this.waitingWatchPages.values()) rooms.add(waiting.roomId); + for (const [, waiting] of this.waitingSources()) rooms.add(waiting.roomId); for (const [, player] of this.watchPlayers()) rooms.add(player.roomId); return rooms; } @@ -2290,7 +2312,7 @@ export class ChannelSession { if (signal?.aborted) throw new DOMException("Capture cancelled", "AbortError"); this.watching.get(publicationId)?.retry?.controller.abort(); this.watching.set(publicationId, watch); - this.declinedSources.delete(publicationId); + this.unleave(publicationId); try { const app = this.app; const publication = this.view.state?.publications.find(value => value.id === publicationId); @@ -2338,7 +2360,7 @@ export class ChannelSession { return this.action(`watch:${publicationId}`, async () => { this.retireWatch(publicationId); const roomId = this.view.state?.publications.find(value => value.id === publicationId)?.roomId; - if (roomId) this.declinedSources.set(publicationId, roomId); + if (roomId) this.leave(publicationId, roomId); this.refreshActivity(); if (this.view.connection === "connected") await this.request({ type: "subscribe", publicationId, enabled: false }); }, false); @@ -2648,7 +2670,7 @@ export class ChannelSession { private retireWatchPlayer(id: string, reason?: string): void { this.watchStage(id)?.retireWatch(id, reason); } private async joinWatchAndSyncClock(id: string, player: WatchPlayer, mode: WatchMode): Promise { player.mode = mode; - this.declinedSources.delete(id); + this.unleave(id); const start = performance.now(); await this.request({ type: "join_watch", roomId: player.roomId, id, mode }, event => { if (!player.signal.aborted && event.type === "watch_ready" @@ -2665,7 +2687,7 @@ export class ChannelSession { await Promise.all([...this.watchPlayers()].map(async ([id, player]) => { // Once the candidate requests its mode, it owns the subscription until commit or cancellation. if (player.mode === null || player.signal.aborted || this.hasJoiningWatchCandidate(id) - || this.waitingWatchPages.get(id)?.browser && this.pendingActions.has(`watch-video:${id}`)) return; + || this.waitingFor(id)?.browser && this.pendingActions.has(`watch-video:${id}`)) return; try { await this.joinWatchAndSyncClock(id, player, player.mode); if (player.owner && this.watchPlayer(id) === player) await this.reconcileWatchBytes(id, player); @@ -3047,8 +3069,9 @@ export class ChannelSession { await player.inheritListening(this.watchPlayer(id)); const activity = this.view.state?.watchActivities.find(activity => activity.id === id); if (!activity || this.pendingWatchPlayer(id) !== player) throw new DOMException("Cancelled", "AbortError"); - this.watchRouting.delete(id); - this.waitingWatchPages.delete(id); + this.preferRoute(id, "direct"); + const waiting = this.waitingFor(id); + if (waiting) this.stopWaiting(id, waiting); this.stage(player.roomId).confirmWatch(id, player); player.update(activity.playback); const state = this.view.state; @@ -3150,17 +3173,15 @@ export class ChannelSession { } else this.finishSourceSelection(roomId, selection); } } - /** The routes this endpoint has taken for an activity it joined without naming one. A named route is its person's choice and is not left alone. */ - private readonly watchRouting = new Map>(); private async watchRoutesOf(activity: WatchActivity): Promise { const hls = activity.byteSource?.format === "hls" && !canReceivePeerWatch("hls") && (await import("./watch-hls")).Hls.isSupported(); return watchRoutes(activity, format => canReceivePeerWatch(format, hls), this.watchPlayer(activity.id)); } /** A route that failed gives its place to the next one this endpoint has not taken for the activity. */ private async followWatchFailure(id: string, player: WatchPlayer): Promise { - const taken = this.watchRouting.get(id), key = `watch-video:${id}`; + const taken = this.intents.get(id)?.routes, key = `watch-video:${id}`; const failed = () => !!player.error && player.error !== "watch_update_failed" && player.error !== "watch_live_position_unavailable" - && this.watchRouting.get(id) === taken && this.watchPlayer(id) === player && !this.pendingActions.has(key); + && this.intents.get(id)?.routes === taken && this.watchPlayer(id) === player && !this.pendingActions.has(key); if (!taken || player.owner || !failed()) return; const activity = this.view.state?.watchActivities.find(value => value.id === id); const next = activity && (await this.watchRoutesOf(activity).catch(() => [])).find(route => !taken.has(route)); @@ -3173,12 +3194,11 @@ export class ChannelSession { } joinWatch = (id: string, mode?: WatchMode, reportError: ReportError = true): Promise => this.action(`watch-video:${id}`, async () => { if (mode) { - if (mode === "peer" && this.waitingWatchPages.get(id)?.browser) { + if (mode === "peer" && this.waitingFor(id)?.browser) { const activity = this.view.state?.watchActivities.find(value => value.id === id); if (!activity || !(await this.watchRoutesOf(activity)).includes(mode)) throw new Error("watch_source_unavailable"); } - await this.joinWatchRoute(id, mode); - this.watchRouting.delete(id); + await this.joinWatchRoute(id, mode, true); return; } const activity = this.view.state?.watchActivities.find(value => value.id === id); @@ -3186,15 +3206,21 @@ export class ChannelSession { // The site's route asks nothing; only without it does what this browser can receive matter. // With no route at all, the direct one names what is missing. const route = watchRoutes(activity, () => false, this.watchPlayer(id))[0] ?? (await this.watchRoutesOf(activity))[0] ?? "direct"; - this.watchRouting.set(id, new Set([route])); + this.takeRoute(id, activity.roomId, route); await this.joinWatchRoute(id, route); }, reportError).finally(() => { const player = this.watchPlayer(id); if (player) void this.followWatchFailure(id, player); }); - private async joinWatchRoute(id: string, mode: WatchMode): Promise { + private async joinWatchRoute(id: string, mode: WatchMode, manual = false): Promise { const current = this.watchPlayer(id); - if (current?.mode === mode && !current.error && current.presentation.kind !== "external") return; + if (current?.mode === mode && !current.error && current.presentation.kind !== "external") { + if (manual) { + await current.ready(); + if (this.watchPlayer(id) === current) this.preferRoute(id, mode); + } + return; + } const activity = this.view.state?.watchActivities.find(value => value.id === id); if (!activity) throw new Error("watch_unavailable"); if (mode === "peer") { @@ -3202,21 +3228,21 @@ export class ChannelSession { if (!source) throw new Error("watch_source_unavailable"); await this.joinWatchMedia(id, createResourceWatchMedia(source, (resourceId, offset, length, signal) => this.watchBytes.read(activity.roomId, id, source, resourceId, offset, length, signal), - { hlsDeadlineOwner: "reader", timeline: activity.playback.timeline }), mode); + { hlsDeadlineOwner: "reader", timeline: activity.playback.timeline }), mode, manual); return; } const url = activity.source.kind === "media" ? activity.source.url : activity.source.mediaUrl; if (url) { - await this.joinWatchMedia(id, new HTMLVideoMedia(url, activity.source.kind === "media" ? directWatchFormat(new URL(url)) : undefined, activity.playback.timeline)); + await this.joinWatchMedia(id, new HTMLVideoMedia(url, activity.source.kind === "media" ? directWatchFormat(new URL(url)) : undefined, activity.playback.timeline), mode, manual); return; } const embed = sharedWatchEmbed(activity.source); if (!embed) throw new Error(originalWatchURL(activity.source) ? "watch_page_required" : "watch_source_unavailable"); if (!canWatchInBrowser(activity.source, current)) throw new Error("watch_media_unsupported"); await this.joinWatchMedia(id, embed.provider === "youtube" - ? new YouTubeMedia(embed.id, undefined, true) : new PeerTubeMedia(embed.id, true)); + ? new YouTubeMedia(embed.id, undefined, true) : new PeerTubeMedia(embed.id, true), mode, manual); } - private async joinWatchMedia(id: string, media: WatchMedia, mode: WatchMode = "direct"): Promise { + private async joinWatchMedia(id: string, media: WatchMedia, mode: WatchMode, manual: boolean): Promise { const activity = this.view.state?.watchActivities.find(value => value.id === id); if (!activity) { media.close(); throw new Error("watch_unavailable"); } const previous = this.watchPlayer(id); @@ -3240,6 +3266,7 @@ export class ChannelSession { player.mode = mode; if (previous.mode === mode) player.inheritClock(previous); stage.useWatch(id, player); + if (manual) this.preferRoute(id, mode); player.update(current.playback); this.patch({}); if (embedded) await media.waitForPresentation?.(player.signal).catch(() => {}); @@ -3256,7 +3283,8 @@ export class ChannelSession { this.stage(player.roomId).useWatch(id, player); player.update(activity.playback); this.patch({}); - void player.ready().catch(error => { + const ready = player.ready(); + void ready.catch(error => { if (!player.signal.aborted && this.watchPlayer(id) === player) { player.error = error instanceof Error ? error.message : "watch_media_failed"; this.patch({}); @@ -3265,8 +3293,20 @@ export class ChannelSession { }); try { await this.joinWatchAndSyncClock(id, player, mode); - if (!this.waitingWatchPages.get(id)?.browser && this.waitingWatchPages.delete(id)) this.patch({}); + const waiting = this.waitingFor(id); + if (waiting && !waiting.browser) { + this.stopWaiting(id, waiting); + this.patch({}); + } this.browseRooms(); + if (manual) { + const intent = this.intents.get(id); + const selected = ready.then(() => { + if (this.intents.get(id) === intent && this.watchPlayer(id) === player && !player.error) this.preferRoute(id, mode); + }); + if (previous) await selected; + else void selected.catch(() => {}); + } } catch (error) { if (!player.signal.aborted && this.watchPlayer(id) === player) this.retireWatchPlayer(id); @@ -3278,13 +3318,11 @@ export class ChannelSession { private async leaveWatchResource(id: string): Promise { const candidate = this.retirePendingWatchPlayer(id); const player = this.watchPlayer(id); - const waiting = this.waitingWatchPages.get(id); + const waiting = this.waitingFor(id); if (player?.owner || (!waiting && !player && !candidate?.mode)) return; - this.watchRouting.delete(id); - this.waitingWatchPages.delete(id); const roomId = player?.roomId ?? waiting?.roomId ?? candidate!.roomId; - this.declinedSources.set(id, roomId); - if (waiting) this.declinedSources.set(waiting.predecessor.id, roomId); + this.leave(id, roomId); + if (waiting) this.leave(waiting.predecessor.id, roomId); this.retireWatchPlayer(id); this.refreshActivity(); this.browseRooms(); @@ -3300,11 +3338,45 @@ export class ChannelSession { } /** Tells the room this page will not follow a successor it named, so the room stops naming it. */ private declineSuccessor(roomId: string, source: { kind: "watch" | "screen"; id: string }): void { - if (this.declinedSources.has(source.id)) return; - this.declinedSources.set(source.id, roomId); + if (this.intents.get(source.id)?.state === "left") return; + this.leave(source.id, roomId); void this.request(source.kind === "watch" ? { type: "join_watch", roomId, id: source.id, mode: null } : { type: "subscribe", publicationId: source.id, enabled: false }, undefined, roomId).catch(() => {}); } + private *waitingSources(): Generator<[string, WaitingSource]> { + for (const [id, value] of this.intents) if (value.state === "waiting") yield [id, value]; + } + private waitingFor(id: string): WaitingSource | undefined { + const value = this.intents.get(id); + return value?.state === "waiting" ? value : undefined; + } + /** The page chooses a route for the source by itself, which sets aside the person's choice until they switch. */ + private takeRoute(id: string, roomId: string, route: WatchMode): void { + const value = this.intents.get(id); + if (value) value.routes = new Set([route]); + else this.intents.set(id, { roomId, state: "followed", routes: new Set([route]) }); + } + /** A switch the person made succeeded: the route is theirs, and the page stops choosing for the source. */ + private preferRoute(id: string, mode: WatchMode): void { + const value = this.intents.get(id), roomId = value?.roomId ?? this.watchPlayer(id)?.roomId; + if (value) { + value.preference = mode; + delete value.routes; + } else if (roomId) this.intents.set(id, { roomId, state: "followed", preference: mode }); + } + /** A successor no longer waits: what the page or the person chose for it stays while it is followed. */ + private stopWaiting(id: string, { roomId, preference, routes }: WaitingSource): void { + if (preference || routes) this.intents.set(id, { roomId, state: "followed", preference, routes }); + else this.intents.delete(id); + } + private leave(id: string, roomId: string): void { this.intents.set(id, { roomId, state: "left" }); } + /** This page follows a source it left again, or the room no longer names it. */ + private unleave(id: string): void { + const value = this.intents.get(id); + if (value?.state !== "left") return; + if (value.routes) this.intents.set(id, { roomId: value.roomId, state: "followed", routes: value.routes }); + else this.intents.delete(id); + } stopWatch = (id: string): Promise => this.action(`stop:${id}`, () => this.stopWatchResource(id, "stop-requested"), false); private async stopWatchResource(id: string, reason: "stop-requested" | "provider-session-ended" | "media-closed" | "screen-replacement"): Promise { @@ -3874,8 +3946,7 @@ export class ChannelSession { this.captureLifetime = new AbortController(); for (const stage of this.stages.values()) stage.close(); this.stages.clear(); - this.waitingWatchPages.clear(); - this.declinedSources.clear(); + this.intents.clear(); this.app?.stopCaptures(); this.input.reset(); this.attachments.reset(); @@ -3933,7 +4004,7 @@ export class ChannelSession { watchSubscriptions: state.watchSubscriptions.filter(value => { const current = this.watchPlayer(value.id); return current && (current.mode === value.mode || this.pendingWatchPlayer(value.id)?.mode === value.mode) - || value.mode === "direct" && this.waitingWatchPages.has(value.id); + || value.mode === "direct" && !!this.waitingFor(value.id); }), }; } diff --git a/src/client/channel/transport.ts b/src/client/channel/transport.ts index 5222b02df..a5319b0a9 100644 --- a/src/client/channel/transport.ts +++ b/src/client/channel/transport.ts @@ -479,7 +479,7 @@ export class ChannelTransport { } if (output.rejectedTracks?.length === tracks.length && tracks.every(track => output.rejectedTracks!.includes(track))) continue; output.rejectedTracks = undefined; - const previous = [...output.senders]; + const previousCount = output.senders.length; let attached = true; for (const track of tracks) { if (!output.senders.some(sender => sender.source === track)) { @@ -502,17 +502,8 @@ export class ChannelTransport { } } catch (error) { attached = false; - const live = previous.filter(sender => sender.sender.track?.readyState === "live"); - const retained = live.some(sender => sender.source.kind === (kind === "screen" ? "video" : "audio")) ? live : []; - for (const sender of output.senders) if (!retained.includes(sender)) this.removeSender(sender); - output.senders = retained; - for (const track of output.stream.getTracks()) { - if (!retained.some(sender => sender.source === track)) output.stream.removeTrack(track); - } console.warn("Channel media sender attach failed", { flowId: id, kind: track.kind }, error); - output.rejectedTracks = [...tracks]; - output.failed = retained.length === 0; - if (output.failed) this.options.outgoingFailed?.(id); + this.rejectSenders(id, output, output.senders.slice(previousCount), tracks); break; } } @@ -532,6 +523,20 @@ export class ChannelTransport { return !this.closed && this.sending.get(id) === owner && !owner.failed && owner.senders.includes(binding); } + /** The connection refused these senders. Their flow goes on with the rest while its main kind is still live, and fails otherwise. */ + private rejectSenders(id: string, output: OutgoingBinding, rejected: SenderBinding[], attempted = output.stream.getTracks()): void { + output.rejectedTracks = [...attempted]; + const kept = output.senders.filter(binding => !rejected.includes(binding)); + const main = output.kind === "screen" ? "video" : "audio"; + if (!kept.some(binding => binding.source.kind === main && binding.sender.track?.readyState === "live")) { + this.failOutput(id, output); + return; + } + for (const binding of rejected) this.removeSender(binding); + output.senders = kept; + for (const track of output.stream.getTracks()) if (!kept.some(binding => binding.source === track)) output.stream.removeTrack(track); + } + private failOutput(id: string, owner: OutgoingBinding): void { if (this.closed || this.sending.get(id) !== owner || owner.failed) return; owner.failed = true; @@ -668,13 +673,7 @@ export class ChannelTransport { this.offer(); } catch (error) { if (this.ownsSender(id, owner, active)) { - owner.rejectedTracks = owner.stream.getTracks(); - const retained = owner.senders.filter(binding => binding !== active && binding.sender.track?.readyState === "live"); - if (retained.some(binding => binding.source.kind === (owner.kind === "screen" ? "video" : "audio"))) { - for (const binding of owner.senders) if (!retained.includes(binding)) this.removeSender(binding); - owner.senders = retained; - for (const track of owner.stream.getTracks()) if (!retained.some(binding => binding.source === track)) owner.stream.removeTrack(track); - } else this.failOutput(id, owner); + this.rejectSenders(id, owner, [active]); console.warn("Channel media slot could not be rebound", { flowId: id }, error); } } finally { @@ -859,25 +858,15 @@ export class ChannelTransport { if (!this.stableSenders || this.pendingOffer || this.pc.signalingState !== "stable" || this.closed || ["failed", "closed"].includes(this.pc.connectionState)) throw error; this.localOfferFailed = true; - const reverted: string[] = [], failed: string[] = []; + const reverted: string[] = []; for (const [id, output] of this.sending) { const rejected = output.senders.filter(({ sender }) => senders.has(sender) && senders.get(sender) === sender.track && this.stableSenders!.get(sender) !== sender.track); if (!rejected.length) continue; reverted.push(id); - output.rejectedTracks = output.stream.getTracks(); - for (const sender of rejected) { - output.stream.removeTrack(sender.source); - this.removeSender(sender); - } - output.senders = output.senders.filter(sender => !rejected.includes(sender)); - if (!output.senders.some(({ sender }) => sender.track?.readyState === "live" && sender.track.kind === (output.kind === "screen" ? "video" : "audio"))) { - output.failed = true; - failed.push(id); - } + this.rejectSenders(id, output, rejected); } console.warn("Channel local offer failed", { flows: reverted }, error); - for (const id of failed) this.options.outgoingFailed?.(id); if ((this.channel && this.channel !== channel) || (this.bulk && this.bulk !== bulk) || [...this.sending.values()].some(output => output.senders.some(({ sender }) => !senders.has(sender) || senders.get(sender) !== sender.track))) this.retryOffer(); return; diff --git a/src/client/channel/use-channel.ts b/src/client/channel/use-channel.ts index f3eea8094..db01d0bc7 100644 --- a/src/client/channel/use-channel.ts +++ b/src/client/channel/use-channel.ts @@ -1,4 +1,4 @@ -import { useEffect, useState, useSyncExternalStore } from "react"; +import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react"; import { ChannelSession } from "./session"; import type { ChannelController } from "./types"; @@ -6,6 +6,37 @@ declare global { interface Window { __channelGate?: { session: ChannelSession; snapshot: () => ReturnType } } } +const emptyDirectory: { ids: string[]; next?: string | null; status?: "loading" | "failed" } = { ids: [] }; + +/** Replace the query object when its scope changes. The cursor is undefined until the first page succeeds. */ +export function useProfileDirectory(queryProfiles: ChannelController["queryProfiles"], query: { query?: string } | null, known?: readonly { id: string }[]) { + const [directory, setDirectory] = useState({ query, ...emptyDirectory }); + if (directory.query !== query) setDirectory({ query, ...emptyDirectory }); + const request = useRef(null); + useLayoutEffect(() => () => { + request.current?.abort(); + request.current = null; + }, [query]); + function merge(users: readonly { id: string }[], next?: string | null) { + setDirectory(previous => next === undefined && users.every(user => previous.ids.includes(user.id)) ? previous : { + ...previous, ids: [...new Set([...previous.ids, ...users.map(user => user.id)])], + ...(next !== undefined && { next, status: undefined }), + }); + } + useEffect(() => { if (known?.length) merge(known); }, [query, known]); + async function load() { + if (!query || request.current) return; + const current = request.current = new AbortController(); + setDirectory(previous => ({ ...previous, status: "loading" })); + try { + const page = await queryProfiles(directory.next ? { ...query, after: directory.next } : query, current.signal); + if (!current.signal.aborted) merge(page.profiles, page.nextCursor); + } catch { if (!current.signal.aborted) setDirectory(previous => ({ ...previous, status: "failed" })); } + finally { if (request.current === current) request.current = null; } + } + return { ids: directory.ids, next: directory.next, loading: directory.status === "loading", failed: directory.status === "failed", load }; +} + export function useChannel(): ChannelController { const [session] = useState(() => new ChannelSession()); const view = useSyncExternalStore(session.subscribe, session.getSnapshot); diff --git a/src/client/channel/watch-playback.ts b/src/client/channel/watch-playback.ts index 62b70fe52..20981d1a8 100644 --- a/src/client/channel/watch-playback.ts +++ b/src/client/channel/watch-playback.ts @@ -4,10 +4,12 @@ import { watchSeekPosition, type WatchListening, type WatchMedia, type WatchMedi const mediaFailure = (error?: unknown): string => error instanceof Error && error.message ? error.message : "watch_media_failed"; const HAVE_CURRENT_DATA = 2; const HAVE_FUTURE_DATA = 3; +const DRIFT_TOLERANCE_SECONDS = 0.35; +const FORCED_SEEK_TOLERANCE_SECONDS = 0.12; const unsupportedRate = Symbol("unsupported playback rate"); const retiredSource = Symbol("selected source retired"); -export function watchPosition(playback: WatchPlayback, now: number): number { +export function watchPosition(playback: Omit, now: number): number { return playback.position + (playback.paused ? 0 : Math.max(0, now - playback.anchorTime) / 1000 * playback.rate); } @@ -138,8 +140,8 @@ export class WatchPlayer { if (this.signal.aborted || (!committedPause && this.failure === retiredSource)) return; const state = committedPause ?? this.localState; if (state) { - const elapsed = state.paused || state.ended || this.ownerWaiting ? 0 : (performance.now() - this.observedAt) / 1000 * state.rate; - this.observe({ ...state, position: Math.min(state.position + elapsed, state.duration ?? Infinity), paused: true, readyState: 0, buffered: [] }); + const position = state.ended || this.ownerWaiting ? state.position : watchPosition({ ...state, anchorTime: this.observedAt }, performance.now()); + this.observe({ ...state, position: Math.min(position, state.duration ?? Infinity), paused: true, readyState: 0, buffered: [] }); } this.failure = retiredSource; this.changed(); @@ -214,14 +216,14 @@ export class WatchPlayer { this.observe(state); return { timeline: state.live ? "program" : "media", position: state.position, paused: state.paused || this.ownerWaiting || state.ended, rate: state.rate, anchorTime: Math.round((start + end) / 2 + this.offset) }; } - private observe(state: WatchMediaState): void { + private observe(state: WatchMediaState, now = performance.now()): void { if (this.signal.aborted) return; const previous = this.localState; const changed = !previous || Object.entries(state).some(([key, value]) => key !== "buffered" && previous[key as keyof WatchMediaState] !== value) || state.buffered?.length !== previous.buffered?.length || !!state.buffered?.some(([start, end], index) => start !== previous.buffered?.[index][0] || end !== previous.buffered?.[index][1]); - this.observedAt = performance.now(); + this.observedAt = now; if (!changed) return; this.localState = state; for (const listener of this.mediaListeners) listener(); @@ -278,16 +280,14 @@ export class WatchPlayer { private async alignCurrent(force: boolean, explicit: boolean): Promise { const state = await this.media.read(), now = performance.now(); if (this.failure === retiredSource) return false; - const previous = this.localState, previousAt = this.observedAt; - this.observe(state); this.observedAt = now; + const previous = this.localState, ready = state.readyState >= HAVE_FUTURE_DATA; + const driftTolerance = this.media.seekTolerance ?? DRIFT_TOLERANCE_SECONDS; + const bothPaused = previous?.paused && state.paused; + const movedLocally = this.media.seekEvents === false && previous && (bothPaused ? state.position !== previous.position + : ready && Math.abs(state.position - watchPosition({ ...previous, anchorTime: this.observedAt }, now)) > driftTolerance); + this.observe(state, now); if (this.owner) { - // Some platform players expose time but no user-seek event. Reuse this observation turn. - if (this.media.seekEvents === false && previous) { - const expected = previous.position + (previous.paused ? 0 : (now - previousAt) / 1000 * previous.rate); - const moved = state.paused && previous.paused ? state.position !== previous.position - : state.readyState >= HAVE_FUTURE_DATA && Math.abs(state.position - expected) > (this.media.seekTolerance ?? 0.35); - if (moved) void this.publish(true).catch(error => this.failMedia(error)); - } + if (movedLocally) void this.publish(true).catch(error => this.failMedia(error)); return true; } @@ -302,9 +302,8 @@ export class WatchPlayer { force = explicit || force && this.alignedPlayback !== playback; const buffered = state.buffered?.some(([start, end]) => start <= target && target < end); // A paused anchor identifies a fixed position, including one keyboard seek step. - const tolerance = force && playback.paused ? 0 : this.media.seekTolerance ?? (force ? 0.12 : 0.35); + const tolerance = !force ? driftTolerance : playback.paused ? 0 : this.media.seekTolerance ?? FORCED_SEEK_TOLERANCE_SECONDS; const displaced = Math.abs(state.position - target) > tolerance; - const ready = state.readyState >= HAVE_FUTURE_DATA; const resumed = this.stall === "waiting" && ready; if (playback.paused) this.stall = null; else if (this.stall && this.stall !== "waiting") { @@ -320,8 +319,7 @@ export class WatchPlayer { this.blockedReason = null; this.changed(); } // An iframe can report a shared seek one observation after dispatch. - if (!force && displaced && this.media.seekEvents === false && previous && (state.readyState >= HAVE_FUTURE_DATA && previous.readyState >= HAVE_FUTURE_DATA || state.paused && previous.paused) - && Math.abs(state.position - (previous.position + (previous.paused ? 0 : (now - previousAt) / 1000 * previous.rate))) > (this.media.seekTolerance ?? 0.35)) { + if (!force && displaced && movedLocally && (bothPaused || previous.readyState >= HAVE_FUTURE_DATA)) { this.blockedReason = "local-seek"; this.changed(); } const rejoin = resumed && displaced && !playback.paused && this.blockedReason !== "local-seek"; @@ -337,7 +335,7 @@ export class WatchPlayer { } if (this.error === "watch_live_position_unavailable") { this.error = null; this.changed(); } // A look that is neither a command nor a rejoin moves a viewer only inside its known buffer. - if (seekChanged || displaced && (force || rejoin || state.readyState >= HAVE_FUTURE_DATA && buffered)) patch.position = target; + if (seekChanged || displaced && (force || rejoin || ready && buffered)) patch.position = target; if (playback.paused && (!state.paused || pauseChanged)) patch.paused = true; const needsRate = state.rate !== playback.rate || force && prior && prior.rate !== playback.rate; if (needsRate && this.media.playbackRates && !this.media.playbackRates().includes(playback.rate)) { diff --git a/src/client/components/living/Metrics.tsx b/src/client/components/living/Metrics.tsx index e2969a96e..931dab238 100644 --- a/src/client/components/living/Metrics.tsx +++ b/src/client/components/living/Metrics.tsx @@ -186,19 +186,6 @@ export function MetricGroups({ groups, id }: { groups: readonly MetricGroup[]; i
; } -export function CaptureMetricCells({ resolution, frameRate, codec, hasSourceAudio }: { - resolution: string | null; frameRate: number | null; codec: string | null; hasSourceAudio: boolean; -}) { - const { t } = useCopy(); - return
- - - - -
; -} - export function MetricCell({ icon, label, value, hint, description, tone = "off" }: MetricValue) { const { t } = useCopy(); const presentation = METRIC_PRESENTATION[label]; diff --git a/src/client/locales/en.ts b/src/client/locales/en.ts index 4ac0564b8..d144e3e29 100644 --- a/src/client/locales/en.ts +++ b/src/client/locales/en.ts @@ -19,17 +19,14 @@ export const en: Record = { "watch.forward.noVideoTrack": "No video track is available to forward. You can still watch the original webpage.", "watch.forward.videoOnly": "Video only, without audio", "watch.forward.trackUnavailable": "Some sources could not be read or are not supported yet. You can select the remaining tracks.", - "watch.forward.selected": "Will forward: {video} + {audio}", "watch.forward.confirmTracks": "Confirm and start forwarding", "watch.forward.channels": "{count} channels", "watch.viewersCount": "Joined this watch: {count}", "watch.joined": "Joined this watch", "watch.noViewers": "No one else has joined this watch yet.", "watch.browserSource.title": "Choose playback source", - "watch.browserSource.help": "With direct playback, viewers each access the video source. App forwarding reads it on this device and uses its upload bandwidth.", "watch.browserSource.skip": "Sync video on its webpage", "watch.browserSource.originalHelp": "Everyone opens the same page in a Piik App that supports webpage playback. Each device streams from the site in sync with your player.", - "watch.browserSource.selectNamed": "Play {name} in Piik", "watch.forward.title": "Forward original video", "watch.forward.upload": "Use this device’s upload bandwidth to send original video through room connections.", "watch.forward.active": "Forwarding is on. Stopping it keeps the webpage open.", @@ -37,8 +34,6 @@ export const en: Record = { "watch.forward.prepare": "Choose video to forward", "watch.forward.choose": "Choose the original video resource. Confirming starts using this device’s upload bandwidth.", "watch.forward.enableNamed": "Forward {name}", - "watch.forward.shareFile": "Share this video", - "watch.forward.shareFileHelp": "Room members receive the video link and can play directly from the website. Receiving through your App uses your upload bandwidth.", "watch.forward.none": "No video resource is available to forward on this webpage yet.", "watch.forward.peer": "Receive from sharer", "watch.forward.direct": "Play directly from website", @@ -90,7 +85,6 @@ export const en: Record = { "room.chat.export": "Export chat text (TXT)", "room.chat.purgeHistory": "Clear room history", "room.chat.confirmPurgeHistory": "Permanently clear all messages and their attachments from “{name}”? Saved downloads are kept.", - "room.common.user": "User", "room.relay.webpage": "This webpage", "room.relay.app": "Connected App", "channel.forwarding.title": "Forwarding for others", @@ -101,7 +95,6 @@ export const en: Record = { "room.relay.appUnavailable": "App forwarding settings are unavailable.", "room.relay.route": "recipient", "room.relay.routes": "recipients", - "room.relay.followDefault": "Follow room default", "room.create.appHostedNote": "App hosts this room while it’s running.", "room.create.browserHostedNote": "Hosted by this page. The room pauses when this page closes.", "room.hosting.restoreFailed": "Couldn't reopen this browser's rooms", @@ -162,7 +155,6 @@ export const en: Record = { "room.action.remove": "Remove from list", "room.settings.confirmDelete": "Delete “{name}” and its chat history? Downloaded files are kept. If hosting has gone offline, only its list entry will be removed.", "room.settings.confirmRemove": "Remove “{name}” from this site’s room directory? This ends access through this site. The host keeps the room’s stored data.", - "room.settings.device": "This device", "room.settings.recordsTitle": "Records and backups", "room.settings.browserStoragePersistent": "Your browser protects these room records from automatic cleanup when storage is low.", "room.settings.browserStorageBestEffort": "Your browser may remove these room records when storage is low.", @@ -296,12 +288,8 @@ export const en: Record = { "screen.unplayable": "This browser could not play the shared picture.", "screen.deliveryRetry": "Picture delivery failed. Retrying.", "screen.pictureHelp": "Picture help", - "screen.pictureHelpViewer": "Select Retry picture. If it still fails, try another network.", - "screen.pictureHelpPublisher": "Ask the person sharing to check their preview and reselect the source if needed.", - "screen.pictureHelpForwarding": "If the site operator offers forwarding, a room manager can enable “{setting}” in room settings.", "screen.connectingPicture": "Connecting picture", "screen.focusNamed": "Focus {title}", - "screen.returnToGrid": "Return to grid", "screen.sharingControls": "Sharing controls: {title}", "screen.stopSharing": "Stop sharing {title}", "screen.shareEnded": "{name}'s share has ended", @@ -309,7 +297,6 @@ export const en: Record = { "screen.availableScreens": "Available screens", "screen.availableToWatch": "Available to watch", "screen.watch": "Watch", - "screen.changeLayout": "Change picture layout", "screen.waitingPicture": "Waiting for picture", "screen.playNamed": "Play {label}", "screen.directLimit": "Direct recipients", @@ -357,7 +344,6 @@ export const en: Record = { "channel.backupControls.roomRestoredWithoutFiles": "Room and chat history restored. Some files could not be cached. Save any readable copies you need before closing this page. You do not need to restore again.", "channel.attachment.thumbnail": "Thumbnail", "channel.attachment.loadingOriginalImage": "Loading original image…", - "channel.attachment.originalLoadFailed": "Couldn't load the original image.", "channel.attachment.cancelDownload": "Cancel download", "channel.attachment.savedCopyMissing": "The saved file could not be found.", "channel.attachment.revealSavedFailed": "Could not show the saved file in File Explorer.", @@ -418,7 +404,6 @@ export const en: Record = { "channel.inviteQrCode.generationFailed": "Could not create a QR code. Copy the invitation link instead.", "channel.inviteQrCode.saveImage": "Save image", "channel.inviteQrCode.saveFailed": "Could not save the image. Please try again.", - "channel.inviteQrCode.close": "Close", "channel.joinVoice.voiceJoined": "Voice joined", "channel.mentionSuggestions.mentionSomeone": "Mention someone", "channel.mentionSuggestions.users": "Users", @@ -513,13 +498,11 @@ export const en: Record = { "channel.voiceDock.voiceJoined": "Voice joined", "channel.voiceDock.voiceConnecting": "Connecting voice…", "channel.voiceDock.voiceConnected": "Voice connected", - "channel.voiceDock.openRoom": "Open {name}", "channel.invitationLink.copied": "Copied", "channel.invitationLink.copyInvitation": "Copy invitation", "channel.invitationLink.copyFailed": "Copy the link above manually.", "channel.invitationLink.qrCode": "QR code", "channel.previewPage.screenSharing": "Screen sharing", - "channel.previewPage.user": "User", "channel.previewPage.connected": "Connected to site", "channel.previewPage.connecting": "Connecting", "channel.previewPage.reconnecting": "Reconnecting", @@ -536,7 +519,6 @@ export const en: Record = { "channel.previewPage.viewTools": "View tools", "channel.previewPage.ongoingScreens": "Ongoing screens", "channel.previewPage.stillSharing": "Still sharing", - "channel.previewPage.stillWatching": "Joined a watch", "channel.previewPage.returnToRoom": "Return to {value}", "channel.previewPage.return": "Return", "channel.previewPage.stopSharingSource": "Stop sharing {title}", @@ -588,10 +570,8 @@ export const en: Record = { "watch.inWindow": "This video uses a separate webpage window.", "watch.inWindowSource": "This video plays in a separate webpage window. Closing it ends Watch together.", "watch.focusWindow": "Return to playback window", - "watch.inApp": "Watch in App", "watch.browserFailed": "This webpage video cannot play directly in this browser.", "watch.sharedControls": "Playback for everyone", - "watch.localControls": "Your sound and window", "watch.seek": "Playback progress for everyone", "watch.rate": "Playback speed for everyone", "watch.following": "Playback follows the sharer. Volume only affects you.", @@ -603,7 +583,6 @@ export const en: Record = { "watch.live": "Live", "watch.ended": "Ended", "watch.goLive": "Go live", - "watch.forward.fromApp": "Forward through App", "watch.sourceAccessRequired": "This source could not be prepared for synchronized playback.", "watch.liveDelay": "{seconds}s behind live", "watch.liveRemaining": "{seconds}s to end", @@ -746,7 +725,6 @@ export const en: Record = { "remote.leftStick": "Left stick", "remote.directionPad": "WASD movement pad", "remote.touchHelp": "Two-finger tap right-clicks; pinch to zoom. Two-finger swipes scroll normally, or pan when zoomed or the virtual mouse is expanded.", - "remote.resetZoom": "Reset picture zoom", "remote.key.Escape": "Escape", "remote.key.Tab": "Tab", "remote.key.ArrowLeft": "Left arrow", @@ -859,7 +837,6 @@ export const en: Record = { "playback.showControls": "Show playback controls", "playback.overlay": "On-screen chat", "playback.more": "Playback settings", - "playback.pictureFit": "Picture fit", "playback.viewControls": "Viewing options", "playback.windowControls": "Player window", "playback.changeFit": "Switch picture fit", @@ -876,9 +853,6 @@ export const en: Record = { "playback.fit.contain": "Fit", "playback.fit.cover": "Fill", "playback.fit.fill": "Stretch", - "playback.fitFull": "Show the whole picture at its original proportions.", - "playback.fitCrop": "Fill the player; some edges may be cropped.", - "playback.fitStretch": "Fill the player by stretching the picture.", "playback.route.auto": "Auto", "playback.route.p2p": "P2P only", "playback.route.sfu": "SFU only", @@ -918,7 +892,6 @@ export const en: Record = { "debug.exportFailed": "Could not download diagnostics; try again", "brand.home": "Piik home", "help.title": "Help", - "help.hint": "Help, diagnostics and version information", "help.troubleshooting": "Troubleshooting", "common.roomCode": "Room code", @@ -939,17 +912,13 @@ export const en: Record = { "common.disable": "Disable {name}", "common.increase": "Increase {name}", "common.decrease": "Decrease {name}", - "host.join.hide": "Hide room entry", "host.advanced.hide": "Hide sharing settings", - "host.password.settingsHide": "Hide password settings", "host.sourcePicker.audioOn": "Share sound", "host.sourcePicker.audioOff": "Stop sharing sound", "host.sourcePicker.audioLocked": "Sound sharing stays unchanged when switching sources", "common.viewers": "Viewers", "common.you": "you", "common.host": "Host", - "common.name.viewerDefault": "Viewer", - "common.name.hostDefault": "Host", "client.launch.title": "Open Piik", "client.launch.version": "Installed version {version}", @@ -995,10 +964,6 @@ export const en: Record = { "client.connect.navigationUnsupported": "This App uses the browser interface. Continue in this page.", "client.connect.navigationPopupBlocked": "Could not open a new window. Allow popups for this site and try again.", "client.connect.approving": "Waiting for App approval…", - "client.connect.standby": "App is ready", - "client.connect.guide": "Connect a site", - "client.connect.addSite": "Open a site", - "client.connect.addSiteHint": "Enter a Piik site address, then confirm its App access.", "client.bookmarks.title": "Saved sites", "client.sites.title": "Sites", "client.sites.hint": "Save sites for later. Manage App access and startup in each site’s details.", @@ -1041,8 +1006,6 @@ export const en: Record = { "client.connect.siteAddress": "Site address", "client.connect.continue": "Continue", "client.connect.openSite": "Open site", - "client.connect.approveAndOpen": "Allow and open", - "client.connect.standbyHint": "Click App at the top right of a Piik site, choose Open App page, then confirm Allow access.", "client.connect.openOnStart": "Open this site when App starts", "client.connect.openOwnedOnStart": "Open my site when App starts ({mode})", "client.connect.manage": "App is ready. Manage App.", @@ -1122,29 +1085,14 @@ export const en: Record = { "client.update.differentBuild": "This build differs from the official release", "client.update.official": "An official Piik release is available", - "gate.title": "Site access", - "gate.hint": "Enter the site passphrase", - "gate.password": "Site passphrase", - "gate.submit": "Enter site", "gate.checking": "Checking site access", - "gate.wrong": "Incorrect passphrase, try again", - "gate.unavailable": "Site access cannot be verified right now", - "gate.malformed": "Invalid room code format", - "gate.malformedHint": "Enter a four-digit room code between 1000 and 9999", - "gate.unavailableRoute": "Unavailable", "navigation.linkUnavailable": "Link unavailable", "navigation.askInvitation": "To join a room, ask the room owner for a new invitation.", "startup.failed": "Page couldn’t load", "startup.retry": "Refresh the page to try again.", "join.title": "Join a room", - "join.hint": "Enter a room code for {site}", - "join.submit": "Join", "join.password": "Room password", - "join.passwordError": "Could not join; try again", - "join.passwordRule": "Enter 1-{max} visible characters", - "join.passwordAction": "Enter room password", - "join.full": "Room is full", "host.title": "{name}'s screen", "host.start": "Start sharing", @@ -1160,8 +1108,6 @@ export const en: Record = { "host.commentary.unavailable": "Microphone mixing is unavailable. Picture and source sound sharing continue.", "host.commentary.description": "Add your voice to the shared picture, without joining room voice.", "host.commentary.duplicate": "The share microphone goes to people watching your share. The room voice microphone goes to people in your voice room. If you hear an echo, try turning off either microphone.", - "host.commentary.failed": "The shared microphone could not start. Check its permission and selected device.", - "host.audioInput.stopped": "An audio input stopped. Picture sharing continues.", "host.commentary.device": "Sharing microphone", "host.commentary.volume": "Sharing microphone volume", "voice.output.permissionHint": "Other playback devices appear after this page has microphone permission. Allow access, then refresh the list.", @@ -1179,7 +1125,6 @@ export const en: Record = { "host.device.refresh": "Refresh devices", "host.device.listFailed": "Could not load devices. Try refreshing.", "host.device.permission.microphone": "Turn on the microphone and allow access to see the available devices here.", - "host.microphone.volume": "Microphone volume", "host.microphone.voiceProcessing": "Noise & echo reduction", "host.microphone.voiceProcessingHint": "Reduce microphone noise and echo and adjust volume automatically. Turn this off if your input already processes voice.", "interaction.open": "Interact", @@ -1197,8 +1142,6 @@ export const en: Record = { "stats.avgRttHint": "Mean round-trip time; each peer or SFU connection counts once.", "stats.totalBitrateHint": "Sum of the stream bitrates in this direction.", "stats.avgLossHint": "Mean of the latest packet-loss reports for these streams.", - "stats.audioPresent": "Present", - "stats.audioAbsent": "Absent", "stats.droppedHint": "Video frames dropped during the current sampling interval.", "stats.inputFpsHint": "Frame rate arriving at the encoder.", "stats.decodeFps": "Decoded FPS", @@ -1222,17 +1165,9 @@ export const en: Record = { "voice.listeningVolume": "Master voice volume", "voice.personVolume": "Individual volume", "voice.listenPerson": "Listen to this person", - "voice.deafen": "Pause listening", - "voice.undeafen": "Resume listening", - "voice.deafenHint": "Pause room voice playback for you. Your microphone and forwarding continue.", - "voice.undeafenHint": "Resume room voice playback without changing your microphone.", "voice.leave.short": "Leave", "voice.listening.short": "Listen", "voice.leave": "Leave voice", - "voice.microphoneOn": "Turn on microphone", - "voice.microphoneOff": "Turn off microphone", - "voice.muteForMe": "Mute for me", - "voice.unmuteForMe": "Unmute for me", "voice.participant": "Participant", "voice.outside": "Outside voice", "voice.microphoneInactive": "Microphone off", @@ -1242,7 +1177,6 @@ export const en: Record = { "voice.cancelMicrophoneRequest": "Cancel microphone request", "voice.bitrate": "Room voice bitrate", "voice.bitrateHint": "The room owner sets the voice bitrate limit for everyone. Actual bitrate follows speech and network conditions. Enter {min}–{max} kbps.", - "host.sourceAudio.unavailable": "Source audio stopped. Picture sharing continues.", "voice.noise.enhanced": "Enhanced microphone noise reduction", "voice.noise.enhancedHint": "Processes speech as mono. Keeps browser echo cancellation; turn off to restore your original processing.", "voice.noise.unsupported": "Enhanced noise reduction is unavailable for this audio setup. Turn it off to use default processing, then rejoin voice if needed.", @@ -1250,11 +1184,6 @@ export const en: Record = { "voice.mode.failed": "Push to talk and voice activation aren’t working in this browser. Choose open microphone to talk.", "voice.error.microphoneDenied": "Microphone access was not allowed. Allow access, then try again.", "voice.error.microphoneUnavailable": "The microphone is unavailable on this page. Use HTTPS or a localhost address.", - "voice.error.microphoneMissing": "No available microphone was found.", - "voice.error.microphoneFailed": "The microphone could not be started. Try again.", - "voice.error.transport": "Voice could not connect. The room remains open. Try another network or browser.", - "voice.error.rejected": "The voice action was not accepted. Rejoin voice and try again.", - "voice.error.closed": "The Host has not opened room voice.", "interaction.settings": "Chat settings", "interaction.feedbackSounds": "Feedback sounds", "interaction.feedbackSoundsHint": "Choose which sounds to hear for background messages and throws.", @@ -1342,7 +1271,6 @@ export const en: Record = { "host.sourcePicker.excludeAudio": "Exclude application audio", "host.sourcePicker.refreshApplications": "Refresh application list", "host.sourcePicker.excludeListFailed": "Could not load applications. Refresh to try again.", - "host.fail.sourceAudio": "Could not update source audio. Please try again.", "host.sourcePicker.excludeNone": "None", "host.sourcePicker.excludeMissing": "Not listed; select again", "host.sourcePicker.excludeAudioChoose": "To keep room voices out of your stream, choose the app playing them. If its window is missing, open it and refresh the list.", @@ -1354,12 +1282,7 @@ export const en: Record = { "host.sourcePicker.unsupported": "App screen sharing is unavailable with these settings. Change the codec or share through your browser.", "host.sourcePicker.failed": "Could not load sources; refresh to retry.", "native.incompatible": "App and page versions are incompatible; update the App and reload.", - "native.fail.browserMedia": "The browser could not create a media connection; reload to retry.", - "native.fail.signaling": "Piik App signaling failed", - "native.fail.receiver": "Piik App media receive failed", "native.fail.requestTimeout": "Piik App timed out; try again in a moment.", - "native.fail.invalidResponse": "The page could not read Piik App's response. Update the App and refresh the page.", - "native.fail.edgePrepare": "Piik App could not prepare the media connection. Enable diagnostics and try again.", "shareHelp.open": "Select the status light for troubleshooting", "shareHelp.guide": "Open troubleshooting guide", "host.sourcePicker.window": "Share window: {title}", @@ -1371,7 +1294,6 @@ export const en: Record = { "host.sourcePicker.loading": "Finding sharing sources", "host.join": "Join a room", "host.starting": "Connecting", - "host.cancelStart": "Cancel", "host.live": "Sharing", "host.paused": "Paused", "host.ended": "Sharing stopped", @@ -1379,7 +1301,6 @@ export const en: Record = { "host.pause": "Pause sharing", "host.resume": "Resume sharing", "host.switchSource": "Switch source", - "host.switching": "Choosing", "host.stop": "Stop sharing", "host.noAudio": "Source sound is not being shared", "host.localPreviewPaused": "Local preview paused; sharing continues", @@ -1387,44 +1308,23 @@ export const en: Record = { "host.previewAutoPause": "Auto-pause preview", "host.previewAutoPauseHint": "Pause the local preview when switching tabs or windows; sharing continues. Turn off to watch on another monitor.", "host.pauseNotice": "Audio and video sharing paused", - "host.stopNotice": "Sharing stopped", - "host.roomReplaced": "Room code replaced", "host.roomReplace": "Replace room code", "host.roomReplaceConfirm": "Replace the room code: this ends the current share and disconnects viewers", - "host.terminated.stale": "Page updated; refresh to continue", - "host.terminated.session": "Another page took over this session; continue there", - "host.terminated.signal": "Server connection terminated; refresh to continue", "host.notice.qualityApplied": "Share settings applied", - "host.notice.qualitySet": "Quality switched to {label}", - "host.notice.audioSet": "Audio bitrate limit set to {kbps} kbps", - "host.notice.partialApply": "Settings updated, but some viewer connections could not apply them", - "host.notice.sourceSwitch.ok": "Share source switched", - "host.notice.sourceSwitch.partial": "Source switched, but {warning}", "host.name": "Display name", - "host.nameSave": "Save display name", - "host.nameCancel": "Cancel editing", "host.nameEdit": "Edit display name", - "host.nameError": "Invalid name, or longer than 24 characters", - "host.nameOffline": "Name saved; others will see it when the connection recovers", "host.invite": "Invite link", "host.invite.copy": "Copy invite link", - "host.invite.copyFailed": "Could not copy the link; try again", "host.invite.rotate": "Rotate invite link; viewers using the old link will need to rejoin", "host.invite.revoke": "Revoke invite link and disconnect viewers who joined with it", "host.invite.rotateShort": "Rotate link", "host.invite.revokeShort": "Revoke link", - "host.invite.updated": "Invite link rotated", - "host.invite.revoked": "Invite link revoked", - "host.invite.emptyOpen": "No invite link; the room code still works", "host.invite.address": "Room address", - "host.invite.copyAddress": "Copy room address", "host.invite.includeCredential": "Skip passwords", "host.invite.credentialHint": "Anyone with this link can join the room", "host.invite.credentialRequired": "This room is invite-only; turn on Skip passwords", - "host.invite.emptyPassword": "No invite link; room code plus password still works", - "host.invite.emptyPrivate": "No invite link; rotate one before inviting", "host.policy": "Admission", "host.policy.open": "Open", @@ -1439,22 +1339,12 @@ export const en: Record = { "host.policy.setPrivateInvite": "Room is now private, invite link only", "host.policy.setPrivatePassword": "Room is now private, invite link or password", "host.password.set": "Room password set", - "host.password.unset": "No room password", - "host.password.placeholder": "Set one to allow code entry", "host.password.setAction": "Set room password", - "host.password.changeAction": "Change room password", - "host.password.remove": "Remove room password", "host.password.show": "Show room password", "host.password.hide": "Hide room password", - "host.password.saved": "Room password set", - "host.password.updated": "Room password updated", - "host.password.removed": "Password removed; invite link only", - "host.password.rule": "1-{max} visible characters", - "host.accessFailed": "Cannot update room settings right now; try again later", "host.viewers.empty": "No viewers yet", - "host.quality": "Video preset", "host.quality.light": "Light", "host.quality.hd": "HD", "host.quality.highFps": "High FPS", @@ -1543,7 +1433,6 @@ export const en: Record = { "host.details.hide": "Hide connection details", "host.topology": "Connection topology", "host.topology.show": "Show connection topology", - "host.topology.hide": "Hide connection topology", "host.topology.pending": "Connecting", "state.signal.connected": "Server connected", @@ -1560,7 +1449,6 @@ export const en: Record = { "state.route.sfu": "Via server", "stats.title": "Connection data", - "stats.downstream": "Downstream receive data", "stats.more": "Detailed metrics", "stats.group.network": "Network", "stats.group.encoding": "Encoding", @@ -1602,7 +1490,6 @@ export const en: Record = { "stats.audioConcealed": "Audio concealments", "viewer.title": "{name}'s screen", - "viewer.titleFallback": "A friend's screen", "viewer.title.watching": "Watching", "viewer.title.waiting": "Waiting", "viewer.reconnect": "Reconnect", @@ -1611,7 +1498,6 @@ export const en: Record = { "viewer.msg.joining": "Joining the room", "viewer.msg.waitingHost": "Waiting for the host to share", "viewer.msg.preparingP2p": "Establishing P2P", - "viewer.msg.connectionRetry": "Retrying ({current}/{total})", "viewer.msg.preparingSfu": "Connecting server relay", "viewer.msg.allocating": "Allocating a route", "viewer.msg.receiving": "Receiving video", @@ -1629,20 +1515,11 @@ export const en: Record = { "viewer.msg.invalidInvite": "Invite link is no longer valid", "viewer.msg.closed": "Room closed", "viewer.msg.full": "Room is full", - "viewer.msg.accessFailed": "Unable to join the room", - "viewer.hint.accessFailed": "Reload this page to try again, or use an invite link from the host.", - "viewer.hint.full": "Try again when a seat opens up.", "viewer.msg.stale": "Page updated; refresh to continue", "viewer.msg.sessionReplaced": "Another page took over this session", "viewer.msg.signalTerminated": "Connection terminated; refresh to continue", "viewer.notice.signalRecovering": "Server reconnecting", "viewer.notice.hostOffline": "Host connection lost; picture may freeze", - "viewer.hint.denied": "Use the host's invite link, or try the room password.", - "viewer.hint.notFound": "Check that the room code belongs to {site}, or open the host’s invite link.", - "viewer.hint.closed": "Ask the host to create a new room and send an invite.", - "viewer.hint.sessionReplaced": "Continue on the other page, or reload here to reconnect.", - "viewer.hint.invite": "Ask the host for a new invite link.", - "viewer.hint.generic": "Reload this page to try again in a moment.", "mode.language": "Interface language", "mode.more": "More languages", @@ -1652,77 +1529,25 @@ export const en: Record = { "theme.dark.short": "Dark", "theme.light.short": "Light", - "gate.connectFailed": "Cannot reach the site; check your connection and retry", - "gate.expired": "Site access expired; verify again", - "gate.serviceUnavailable": "Site service unavailable ({status}); try again later", "host.notStarted": "Not started", - "host.startCancelled": "Start cancelled", - "host.switchingSource": "Switching source", "host.stageAria": "Share or join a room", - "host.captureAria": "Actual capture parameters", "host.quality.title": "{label} · {mbps} Mbps", "host.audio.title": "{label} · {kbps} kbps ceiling", - "host.roomClosed": "Room closed", - "host.pause.noTracksResume": "Cannot resume sharing; choose the source again", - "host.pause.signalRecovering": "Server reconnecting; sharing stays paused", - "host.pause.noTracksPause": "Cannot pause sharing; choose the source again", - "host.pause.stillPaused": "Sharing stays paused", - "host.shareEnded": "The current share has ended", "host.fail.start": "Failed to start sharing", - "host.err.createConnection": "Failed to create the connection", - "host.err.codecUnsupported": "Video codec unsupported; update or try another browser", - "host.fail.source": "Failed to switch share source", - "host.fail.quality": "Failed to apply quality settings", - "host.fail.room": "Room operation failed", - "host.err.invalidToken": "Share credentials are no longer valid; create the room again", - "host.err.accessDenied": "Not permitted", - "host.err.alreadyConnected": "This room is already shared in another page", - "host.err.peerGone": "The viewer connection has left", - "host.err.forbidden": "Action unavailable", - "host.err.serverError": "Service temporarily unavailable; try again later", - "host.err.createRoomStatus": "Cannot create a room right now ({status})", - "host.err.roomCapacity": "All room codes are in use. Try again later or use another Piik site.", - "host.err.replaceRoomStatus": "Cannot change rooms right now ({status})", - "host.err.updateRoomStatus": "Cannot update room settings right now ({status})", "host.capture.chooseInSystem": "Choose a picture in the system window.", "host.capture.preparingPicture": "Preparing the selected picture…", "host.capture.cancelPreparation": "Cancel preparation", "host.capture.cancelPreparationHint": "Cancelling this attempt keeps any current share running.", "host.capture.noSource": "No shareable screen source available", - "host.capture.readFailed": "Cannot read the selected source; choose it again", - "host.capture.unavailable": "This page cannot start screen sharing", - "host.capture.inactive": "Return to this page, then click Share and select a source again.", - "host.capture.constraints": "The selected source cannot meet the current picture settings. Lower the settings or choose another source.", - "host.notice.reconnecting": "some viewers are reconnecting", - "host.notice.sfuRecovering": "Server forwarding source switch failed; restoring viewer connections", - "host.password.inputPlaceholder": "Enter password", "stats.warn.codec": "Video codec is {codec}; expected H264 or VP8", "stats.warn.audioCodec": "Audio codec is {codec}; expected Opus", "viewer.msg.joinUnavailable": "Cannot join the room right now", - "viewer.stageAria": "Shared picture", - "host.warn.audioUnread": "The browser did not report the audio bitrate ceiling", - "host.warn.param.scaleResolutionDownBy": "resolution scaling", - "host.warn.param.degradationPreference": "quality preference", - "host.warn.param.scalabilityMode": "scalability mode", - "host.warn.sfuRecover": "Server forwarding: {params} failed; automatic recovery started", - "host.warn.sfuStage.connect": "connect", - "host.warn.sfuStage.source": "source", - "host.warn.sfuStage.videoPublish": "video publish", - "host.warn.sfuStage.senderConfig": "sender config", - "host.warn.sfuStage.audioPublish": "audio publish", - "host.warn.sfuStage.transport": "transport", - "host.fail.sfuAudioParams": "Failed to apply audio parameters for server forwarding", - "client.connect.replace": "This replaces {site} and disconnects its App sessions.", "voice.offline": "Disconnected", "interaction.effects": "Show reaction effects", - "host.capture.fpsUnknown": "Unknown frame rate", - "host.capture.codecPending": "Codec pending", - "host.capture.hasAudio": "Source audio included", - "host.capture.noAudio": "No source audio", }; export const enTitleFrames = { diff --git a/src/client/locales/ja.ts b/src/client/locales/ja.ts index 6841c4f04..3c4b81e8c 100644 --- a/src/client/locales/ja.ts +++ b/src/client/locales/ja.ts @@ -6,7 +6,6 @@ export const ja = { "watch.forward.noVideoTrack": "転送できる映像トラックがありません。元のウェブページでは引き続き視聴できます。", "watch.forward.videoOnly": "映像のみ、音声なし", "watch.forward.trackUnavailable": "一部のソースを読み込めないか、まだ対応していません。ほかのトラックを選べます。", - "watch.forward.selected": "転送する内容:{video} + {audio}", "watch.forward.confirmTracks": "確認して転送を開始", "watch.forward.channels": "{count} チャンネル", "watch.viewersCount": "視聴に参加:{count} 人", @@ -21,8 +20,6 @@ export const ja = { "watch.forward.prepare": "転送する動画を選択", "watch.forward.choose": "元の動画リソースを選択してください。確認後、アップロード帯域を使用します。", "watch.forward.enableNamed": "「{name}」を転送", - "watch.forward.shareFile": "この動画を共有", - "watch.forward.shareFileHelp": "視聴者には動画リンクが届き、まずサイトから再生します。再生できない場合は、あなたのアプリから受信できます。", "watch.forward.none": "このページでは転送できる動画がまだ見つかりません。", "watch.forward.peer": "共有者から受信", "watch.forward.direct": "サイトから直接再生", @@ -68,7 +65,6 @@ export const ja = { "room.chat.export": "チャットをテキストで書き出す(TXT)", "room.chat.purgeHistory": "部屋の履歴を消去", "room.chat.confirmPurgeHistory": "「{name}」のメッセージと添付ファイルをすべて完全に削除しますか?ダウンロード済みのファイルは残ります。", - "room.common.user": "ユーザー", "room.relay.webpage": "このページ", "room.relay.app": "接続中の App", "channel.forwarding.title": "ほかの人の転送を手伝う", @@ -83,7 +79,6 @@ export const ja = { "screen.directLimit": "直接の送信先数", "screen.directLimitDefault": "ルームの既定値({count})", "screen.directLimitHelp": "この画面をあなたから直接受け取るウェブページや App セッションの上限です。受け取った側からほかの人に転送できます。", - "room.relay.followDefault": "ルームの既定値に従う", "room.create.appHostedNote": "App の起動中は、App がこのルームをホストします。", "room.create.browserHostedNote": "このページがホストします。ページを閉じるとルームは一時停止します。", "room.create.serverHostedNote": "サーバーがルームをホストします。あなたが退出しても、ほかの人は利用できます。", @@ -135,7 +130,6 @@ export const ja = { "room.action.remove": "一覧から削除", "room.settings.confirmDelete": "「{name}」とチャット履歴を削除しますか?ダウンロード済みファイルは保持されます。ホストがオフラインの場合は、一覧の項目だけを削除します。", "room.settings.confirmRemove": "「{name}」をこのサイトの部屋一覧から削除しますか?このサイトから部屋に入れなくなります。ホストが保存した部屋のデータは保持されます。", - "room.settings.device": "このデバイス", "room.settings.recordsTitle": "記録とバックアップ", "room.backup.title": "ルームのバックアップ", "invite.room.title": "{name}に招待", @@ -243,12 +237,8 @@ export const ja = { "screen.unplayable": "このブラウザーでは共有画面を再生できませんでした。", "screen.deliveryRetry": "映像の配信に失敗しました。再試行しています。", "screen.pictureHelp": "映像のヘルプ", - "screen.pictureHelpViewer": "映像を再接続してください。解決しない場合は、別のネットワークをお試しください。", - "screen.pictureHelpPublisher": "共有者にプレビューの確認を依頼し、必要に応じて共有元を選び直してもらってください。", - "screen.pictureHelpForwarding": "サイト運営者が中継を提供している場合、ルーム管理者はルーム設定で「{setting}」を有効にできます。", "screen.connectingPicture": "映像に接続中", "screen.focusNamed": "{title}をフォーカス", - "screen.returnToGrid": "グリッドに戻る", "screen.sharingControls": "共有の操作:{title}", "screen.stopSharing": "{title}の共有を停止", "screen.shareEnded": "{name} の共有は終了しました", @@ -256,7 +246,6 @@ export const ja = { "screen.availableScreens": "利用可能な画面", "screen.availableToWatch": "視聴可能", "screen.watch": "視聴", - "screen.changeLayout": "映像のレイアウトを変更", "screen.waitingPicture": "映像を待っています", "screen.playNamed": "{label}を再生", "screen.shareTitle": "共有タイトル", @@ -296,7 +285,6 @@ export const ja = { "channel.backupControls.roomRestored": "ルームを復元しました。", "channel.attachment.thumbnail": "サムネイル", "channel.attachment.loadingOriginalImage": "元の画像を読み込み中…", - "channel.attachment.originalLoadFailed": "元の画像を読み込めませんでした。", "channel.attachment.cancelDownload": "ダウンロードをキャンセル", "channel.attachment.savedCopyMissing": "保存したファイルが見つかりません。", "channel.attachment.revealSavedFailed": "保存したファイルをエクスプローラーに表示できませんでした。", @@ -341,7 +329,6 @@ export const ja = { "channel.inviteQrCode.generationFailed": "QR コードを作成できませんでした。招待リンクをコピーしてください。", "channel.inviteQrCode.saveImage": "画像を保存", "channel.inviteQrCode.saveFailed": "画像を保存できませんでした。再試行してください。", - "channel.inviteQrCode.close": "閉じる", "channel.joinVoice.voiceJoined": "通話に参加しました", "channel.mentionSuggestions.mentionSomeone": "メンションする人を選択", "channel.mentionSuggestions.users": "ユーザー", @@ -429,13 +416,11 @@ export const ja = { "channel.voiceDock.voiceJoined": "通話に参加中", "channel.voiceDock.voiceConnecting": "通話に接続中…", "channel.voiceDock.voiceConnected": "通話に接続済み", - "channel.voiceDock.openRoom": "「{name}」を開く", "channel.invitationLink.copied": "コピーしました", "channel.invitationLink.copyInvitation": "招待をコピー", "channel.invitationLink.copyFailed": "上のリンクを手動でコピーしてください。", "channel.invitationLink.qrCode": "QR コード", "channel.previewPage.screenSharing": "画面共有", - "channel.previewPage.user": "ユーザー", "channel.previewPage.connected": "サイトに接続済み", "channel.previewPage.connecting": "接続中", "channel.previewPage.reconnecting": "再接続中", @@ -452,7 +437,6 @@ export const ja = { "channel.previewPage.viewTools": "ツールを表示", "channel.previewPage.ongoingScreens": "共有中の画面", "channel.previewPage.stillSharing": "共有を継続中", - "channel.previewPage.stillWatching": "視聴に参加", "channel.previewPage.returnToRoom": "{value}に戻る", "channel.previewPage.return": "戻る", "channel.previewPage.stopSharingSource": "{title}の共有を停止", @@ -489,10 +473,8 @@ export const ja = { "watch.inWindow": "この動画は別のページウィンドウで再生します。", "watch.inWindowSource": "この動画は別のページウィンドウで再生中です。閉じると「一緒に見る」が終了します。", "watch.focusWindow": "再生ウィンドウに戻る", - "watch.inApp": "App で見る", "watch.browserFailed": "このページの動画は、このブラウザーで直接再生できません。", "watch.sharedControls": "全員の再生操作", - "watch.localControls": "自分の音声とウィンドウ", "watch.seek": "全員の再生位置", "watch.rate": "全員の再生速度", "watch.failed": "動画を再生できませんでした。直接 URL を確認するか、退出して再参加してください。", @@ -626,7 +608,6 @@ export const ja = { "remote.textHelp": "Enter で改行します。ボタンを押すと接続先のカーソル位置に入力します。", "remote.textTooLong": "2 KB 以下に分割してください。", "remote.touchHelp": "2 本指のタップで右クリック、ピンチで拡大縮小します。2 本指のスワイプは通常スクロールし、拡大中や仮想マウスの展開中は表示位置を移動します。", - "remote.resetZoom": "映像の拡大率をリセット", "remote.key.Escape": "Escape", "remote.key.Tab": "Tab", "remote.key.ArrowLeft": "左矢印", @@ -733,7 +714,6 @@ export const ja = { "playback.showControls": "再生コントロールを表示", "playback.overlay": "画面上のチャット", "playback.more": "再生設定", - "playback.pictureFit": "映像の表示方法", "playback.viewControls": "視聴オプション", "playback.windowControls": "プレーヤーウィンドウ", "playback.changeFit": "映像の表示方法を切り替え", @@ -750,9 +730,6 @@ export const ja = { "playback.fit.contain": "全体を表示", "playback.fit.cover": "枠に合わせる", "playback.fit.fill": "引き伸ばす", - "playback.fitFull": "元の縦横比で映像全体を表示します。", - "playback.fitCrop": "プレーヤー全体に表示します。端が一部切れる場合があります。", - "playback.fitStretch": "映像を引き伸ばしてプレーヤー全体に表示します。", "playback.route.auto": "自動", "playback.route.p2p": "P2P のみ", "playback.route.sfu": "SFU のみ", @@ -792,7 +769,6 @@ export const ja = { "debug.exportFailed": "診断をダウンロードできませんでした。再試行してください", "brand.home": "Piik ホーム", "help.title": "ヘルプ", - "help.hint": "ヘルプ、診断、バージョン情報", "help.troubleshooting": "トラブルシューティング", "common.roomCode": "ルームコード", "host.roomCodePending": "共有を開始するとルームコードが表示されます", @@ -812,17 +788,13 @@ export const ja = { "common.disable": "{name}を無効にする", "common.increase": "{name}を増やす", "common.decrease": "{name}を減らす", - "host.join.hide": "ルームへの入り口を非表示", "host.advanced.hide": "共有設定を非表示", - "host.password.settingsHide": "パスワード設定を非表示", "host.sourcePicker.audioOn": "音声を共有", "host.sourcePicker.audioOff": "音声の共有を停止", "host.sourcePicker.audioLocked": "ソースの切り替え時に音声共有は変わりません", "common.viewers": "視聴者", "common.you": "自分", "common.host": "ホスト", - "common.name.viewerDefault": "視聴者", - "common.name.hostDefault": "ホスト", "client.launch.title": "Piik を開く", "client.launch.version": "インストール済み:{version}", "client.launch.local": "ローカルネットワーク", @@ -865,10 +837,6 @@ export const ja = { "client.connect.navigationUnsupported": "この App はブラウザーの画面を使用します。このページで続けてください。", "client.connect.navigationPopupBlocked": "新しいウィンドウを開けませんでした。このサイトのポップアップを許可して再試行してください。", "client.connect.approving": "App の承認を待っています…", - "client.connect.standby": "App の準備完了", - "client.connect.guide": "サイトに接続", - "client.connect.addSite": "サイトを開く", - "client.connect.addSiteHint": "Piik のサイトアドレスを入力し、App へのアクセスを承認してください。", "client.bookmarks.title": "保存したサイト", "client.launcher.manageSites": "サイトの管理", "client.sites.title": "サイト", @@ -909,8 +877,6 @@ export const ja = { "client.connect.siteAddress": "サイトのアドレス", "client.connect.continue": "続ける", "client.connect.openSite": "サイトを開く", - "client.connect.approveAndOpen": "許可して開く", - "client.connect.standbyHint": "Piik サイトの右上で「App」→「App のページを開く」を選び、「アクセスを許可」で承認してください。", "client.connect.openOnStart": "App 起動時にこのサイトを開く", "client.connect.openOwnedOnStart": "App 起動時に自分のサイトを開く({mode})", "client.connect.manage": "App の準備ができました。App を管理します。", @@ -979,26 +945,11 @@ export const ja = { "client.update.releasePage": "元のリリースを表示", "client.update.differentBuild": "このビルドは公式リリースと異なります", "client.update.official": "Piik の公式リリースがあります", - "gate.title": "サイトへのアクセス", - "gate.hint": "サイトの合言葉を入力してください", - "gate.password": "サイトの合言葉", - "gate.submit": "サイトに入る", "gate.checking": "サイトへのアクセスを確認中", - "gate.wrong": "合言葉が違います。再試行してください", - "gate.unavailable": "現在、サイトへのアクセスを確認できません", - "gate.malformed": "ルームコードの形式が無効です", - "gate.malformedHint": "1000〜9999 の 4 桁のルームコードを入力してください", - "gate.unavailableRoute": "利用不可", "startup.failed": "ページを読み込めませんでした", "startup.retry": "ページを再読み込みして再試行してください。", "join.title": "ルームに参加", - "join.hint": "{site}のルームコードを入力してください", - "join.submit": "参加", "join.password": "ルームのパスワード", - "join.passwordError": "参加できませんでした。再試行してください", - "join.passwordRule": "表示可能な文字を 1〜{max} 文字入力してください", - "join.passwordAction": "ルームのパスワードを入力", - "join.full": "ルームは満員です", "host.title": "{name}の画面", "host.start": "共有を開始", "host.sourcePicker.title": "共有するものを選択", @@ -1013,8 +964,6 @@ export const ja = { "host.commentary.unavailable": "マイクのミックスを利用できません。映像とソース音声の共有は継続します。", "host.commentary.description": "ルームの通話に参加せずに、共有映像に自分の声を加えます。", "host.commentary.duplicate": "共有と通話の両方でマイクが有効です。片方が無音になったりエコーが聞こえたりする場合は、どちらか一方を使用してください。", - "host.commentary.failed": "共有用のマイクを開始できませんでした。権限と選択したデバイスを確認してください。", - "host.audioInput.stopped": "音声入力が停止しました。映像の共有は継続します。", "host.commentary.device": "共有用マイク", "host.commentary.volume": "共有用マイクの音量", "voice.output.permissionHint": "システムの既定のデバイスのみ表示されています。ほかのデバイスを表示するには、このサイトの権限でマイクを許可し、一覧を更新してください。", @@ -1032,7 +981,6 @@ export const ja = { "host.device.refresh": "デバイス一覧を更新", "host.device.listFailed": "デバイスを読み込めませんでした。一覧を更新してください。", "host.device.permission.microphone": "マイクをオンにしてアクセスを許可すると、ここに使用可能なデバイスを表示します。", - "host.microphone.volume": "マイクの音量", "host.microphone.voiceProcessing": "ノイズとエコーを抑える", "host.microphone.voiceProcessingHint": "マイクのノイズとエコーを抑え、音量を自動調整します。入力側ですでに音声処理をしている場合はオフにしてください。", "interaction.open": "交流", @@ -1049,8 +997,6 @@ export const ja = { "stats.avgRttHint": "往復時間の平均です。ピアまたは SFU への各接続を 1 回ずつ数えます。", "stats.totalBitrateHint": "この方向のストリームのビットレート合計です。", "stats.avgLossHint": "各ストリームの最新のパケット損失報告の平均です。", - "stats.audioPresent": "あり", - "stats.audioAbsent": "なし", "stats.droppedHint": "現在の計測区間で欠落した映像フレーム数です。", "stats.inputFpsHint": "エンコーダーに入力されるフレームレートです。", "stats.pictureSend": "映像送信", @@ -1067,17 +1013,9 @@ export const ja = { "voice.listeningVolume": "通話全体の音量", "voice.personVolume": "個別の音量", "voice.listenPerson": "この人の声を聞く", - "voice.deafen": "聞くのを一時停止", - "voice.undeafen": "聞くのを再開", - "voice.deafenHint": "自分の通話音声の再生を一時停止します。マイクと転送は継続します。", - "voice.undeafenHint": "マイクを変更せずに通話音声の再生を再開します。", "voice.leave.short": "退出", "voice.listening.short": "聴く", "voice.leave": "通話から退出", - "voice.microphoneOn": "マイクをオン", - "voice.microphoneOff": "マイクをオフ", - "voice.muteForMe": "自分だけミュート", - "voice.unmuteForMe": "自分のミュートを解除", "voice.participant": "参加者", "voice.outside": "通話に未参加", "voice.microphoneInactive": "マイクはオフ", @@ -1086,14 +1024,8 @@ export const ja = { "voice.microphoneActive": "マイクはオン", "voice.bitrate": "ルームの通話ビットレート", "voice.bitrateHint": "ルームの所有者が全員の通話の上限を設定します。実際のビットレートは発話と回線状況に応じて変わります。{min}〜{max} kbps を入力してください。", - "host.sourceAudio.unavailable": "ソースの音声が停止しました。映像の共有は継続します。", "voice.error.microphoneDenied": "マイクへのアクセスが許可されませんでした。許可してから再試行してください。", "voice.error.microphoneUnavailable": "このページではマイクを利用できません。HTTPS または localhost のアドレスを使用してください。", - "voice.error.microphoneMissing": "利用可能なマイクが見つかりませんでした。", - "voice.error.microphoneFailed": "マイクを開始できませんでした。再試行してください。", - "voice.error.transport": "通話に接続できませんでした。ルームは開いたままです。別のネットワークやブラウザーをお試しください。", - "voice.error.rejected": "通話の操作が受け入れられませんでした。通話に参加し直して再試行してください。", - "voice.error.closed": "ホストがルームの通話を開いていません。", "voice.mode.failed": "このブラウザーではプッシュトゥトークと音声検出を使えません。「常時オン」に切り替えてください。", "interaction.settings": "チャット設定", "interaction.feedbackSounds": "通知音と効果音", @@ -1182,7 +1114,6 @@ export const ja = { "host.sourcePicker.excludeAudio": "アプリの音声を除外", "host.sourcePicker.refreshApplications": "アプリ一覧を更新", "host.sourcePicker.excludeListFailed": "アプリを読み込めませんでした。一覧を更新して再試行してください。", - "host.fail.sourceAudio": "ソースの音声を更新できませんでした。再試行してください。", "host.sourcePicker.excludeNone": "なし", "host.sourcePicker.excludeMissing": "一覧にありません。選び直してください", "host.sourcePicker.excludeAudioChoose": "除外するアプリのウィンドウを選択してください。見つからない場合はウィンドウを開いて一覧を更新してください。", @@ -1194,12 +1125,7 @@ export const ja = { "host.sourcePicker.unsupported": "この設定では App の画面共有を利用できません。コーデックを変更するか、ブラウザーで共有してください。", "host.sourcePicker.failed": "ソースを読み込めませんでした。一覧を更新して再試行してください。", "native.incompatible": "App とページのバージョンに互換性がありません。App を更新し、ページを再読み込みしてください。", - "native.fail.browserMedia": "ブラウザーがメディア接続を作成できませんでした。再読み込みしてください。", - "native.fail.signaling": "Piik App のシグナリングに失敗しました", - "native.fail.receiver": "Piik App のメディア受信に失敗しました", "native.fail.requestTimeout": "Piik App がタイムアウトしました。少し待ってから再試行してください。", - "native.fail.invalidResponse": "ページが Piik App の応答を読み取れませんでした。App を更新し、ページを再読み込みしてください。", - "native.fail.edgePrepare": "Piik App がメディア接続を準備できませんでした。診断を有効にして再試行してください。", "shareHelp.open": "状態ランプを選ぶと解決方法を表示します", "shareHelp.guide": "トラブルシューティングガイドを開く", "host.sourcePicker.window": "ウィンドウを共有:{title}", @@ -1211,7 +1137,6 @@ export const ja = { "host.sourcePicker.loading": "共有ソースを探しています", "host.join": "ルームに参加", "host.starting": "接続中", - "host.cancelStart": "キャンセル", "host.live": "共有中", "host.paused": "一時停止中", "host.ended": "共有を停止しました", @@ -1219,7 +1144,6 @@ export const ja = { "host.pause": "共有を一時停止", "host.resume": "共有を再開", "host.switchSource": "ソースを切り替え", - "host.switching": "選択中", "host.stop": "共有を停止", "host.noAudio": "ソースの音声は共有していません", "host.localPreviewPaused": "ローカルプレビューは一時停止中です。共有は継続します", @@ -1227,42 +1151,21 @@ export const ja = { "host.previewAutoPause": "プレビューを自動で一時停止", "host.previewAutoPauseHint": "タブやウィンドウを切り替えると、共有を続けたままローカルプレビューを一時停止します。別のモニターで確認する場合はオフにしてください。", "host.pauseNotice": "音声と映像の共有を一時停止しました", - "host.stopNotice": "共有を停止しました", - "host.roomReplaced": "ルームコードを変更しました", "host.roomReplace": "ルームコードを変更", "host.roomReplaceConfirm": "ルームコードを変更すると、現在の共有を終了し、視聴者の接続を切断します", - "host.terminated.stale": "ページが更新されました。再読み込みして続けてください", - "host.terminated.session": "別のページがこのセッションを引き継ぎました。そちらで続けてください", - "host.terminated.signal": "サーバー接続が終了しました。再読み込みして続けてください", "host.notice.qualityApplied": "共有設定を適用しました", - "host.notice.qualitySet": "画質を{label}に変更しました", - "host.notice.audioSet": "音声のビットレート上限を {kbps} kbps に設定しました", - "host.notice.partialApply": "設定を更新しましたが、一部の視聴者の接続に適用できませんでした", - "host.notice.sourceSwitch.ok": "共有ソースを切り替えました", - "host.notice.sourceSwitch.partial": "ソースを切り替えましたが、{warning}", "host.name": "表示名", - "host.nameSave": "表示名を保存", - "host.nameCancel": "編集をキャンセル", "host.nameEdit": "表示名を編集", - "host.nameError": "名前が無効か、24 文字を超えています", - "host.nameOffline": "名前を保存しました。接続が復旧すると他の人に反映されます", "host.invite": "招待リンク", "host.invite.copy": "招待リンクをコピー", - "host.invite.copyFailed": "リンクをコピーできませんでした。再試行してください", "host.invite.rotate": "招待リンクを更新します。以前のリンクを使った視聴者は再参加が必要です", "host.invite.revoke": "招待リンクを無効にし、そのリンクで参加した視聴者の接続を切断します", "host.invite.rotateShort": "リンクを更新", "host.invite.revokeShort": "リンクを無効にする", - "host.invite.updated": "招待リンクを更新しました", - "host.invite.revoked": "招待リンクを無効にしました", - "host.invite.emptyOpen": "招待リンクはありません。ルームコードは引き続き使用できます", "host.invite.address": "ルームのアドレス", - "host.invite.copyAddress": "ルームのアドレスをコピー", "host.invite.includeCredential": "パスワードを省略", "host.invite.credentialHint": "このリンクを持つ人は誰でもルームに参加できます", "host.invite.credentialRequired": "このルームは招待制です。「パスワードを省略」をオンにしてください", - "host.invite.emptyPassword": "招待リンクはありません。ルームコードとパスワードで参加できます", - "host.invite.emptyPrivate": "招待リンクはありません。招待前にリンクを更新してください", "host.policy": "入室方法", "host.policy.open": "公開", "host.policy.private": "非公開", @@ -1276,20 +1179,10 @@ export const ja = { "host.policy.setPrivateInvite": "ルームを非公開にしました。招待リンクでのみ参加できます", "host.policy.setPrivatePassword": "ルームを非公開にしました。招待リンクまたはパスワードで参加できます", "host.password.set": "ルームのパスワード設定済み", - "host.password.unset": "ルームのパスワードなし", - "host.password.placeholder": "設定するとコードで入室できます", "host.password.setAction": "ルームのパスワードを設定", - "host.password.changeAction": "ルームのパスワードを変更", - "host.password.remove": "ルームのパスワードを削除", "host.password.show": "ルームのパスワードを表示", "host.password.hide": "ルームのパスワードを非表示", - "host.password.saved": "ルームのパスワードを設定しました", - "host.password.updated": "ルームのパスワードを更新しました", - "host.password.removed": "パスワードを削除しました。招待リンクでのみ参加できます", - "host.password.rule": "表示可能な文字を 1〜{max} 文字", - "host.accessFailed": "現在ルーム設定を更新できません。後でもう一度お試しください", "host.viewers.empty": "視聴者はまだいません", - "host.quality": "映像プリセット", "host.quality.light": "軽量", "host.quality.hd": "HD", "host.quality.highFps": "高フレームレート", @@ -1373,7 +1266,6 @@ export const ja = { "host.details.hide": "接続の詳細を非表示", "host.topology": "接続構成", "host.topology.show": "接続構成を表示", - "host.topology.hide": "接続構成を非表示", "host.topology.pending": "接続中", "state.signal.connected": "サーバーに接続済み", "state.signal.connecting": "接続中", @@ -1388,7 +1280,6 @@ export const ja = { "state.route.p2p": "P2P 直接接続", "state.route.sfu": "サーバー経由", "stats.title": "接続データ", - "stats.downstream": "下流の受信データ", "stats.more": "詳細な指標", "stats.group.network": "ネットワーク", "stats.group.encoding": "エンコード", @@ -1429,7 +1320,6 @@ export const ja = { "stats.audioConcealedRate": "音声補間率", "stats.audioConcealed": "音声補間数", "viewer.title": "{name}の画面", - "viewer.titleFallback": "友だちの画面", "viewer.title.watching": "視聴中", "viewer.title.waiting": "待機中", "viewer.reconnect": "再接続", @@ -1438,7 +1328,6 @@ export const ja = { "viewer.msg.joining": "ルームに参加中", "viewer.msg.waitingHost": "ホストの共有を待っています", "viewer.msg.preparingP2p": "P2P 接続を確立中", - "viewer.msg.connectionRetry": "再試行中({current}/{total})", "viewer.msg.preparingSfu": "サーバー中継に接続中", "viewer.msg.allocating": "経路を割り当て中", "viewer.msg.receiving": "映像を受信中", @@ -1456,20 +1345,11 @@ export const ja = { "viewer.msg.invalidInvite": "招待リンクは無効になりました", "viewer.msg.closed": "ルームを閉じました", "viewer.msg.full": "ルームは満員です", - "viewer.msg.accessFailed": "ルームに参加できません", - "viewer.hint.accessFailed": "このページを再読み込みするか、ホストからの招待リンクを使用してください。", - "viewer.hint.full": "空きができたら再試行してください。", "viewer.msg.stale": "ページが更新されました。再読み込みして続けてください", "viewer.msg.sessionReplaced": "別のページがこのセッションを引き継ぎました", "viewer.msg.signalTerminated": "接続が終了しました。再読み込みして続けてください", "viewer.notice.signalRecovering": "サーバーに再接続中", "viewer.notice.hostOffline": "ホストとの接続が切れました。映像が止まる場合があります", - "viewer.hint.denied": "ホストの招待リンクを使用するか、ルームのパスワードをお試しください。", - "viewer.hint.notFound": "ルームコードが {site} のものか確認するか、ホストの招待リンクを開いてください。", - "viewer.hint.closed": "ホストに新しいルームの作成と招待を依頼してください。", - "viewer.hint.sessionReplaced": "別のページで続けるか、このページを再読み込みして再接続してください。", - "viewer.hint.invite": "ホストに新しい招待リンクを依頼してください。", - "viewer.hint.generic": "少し待ってからこのページを再読み込みしてください。", "mode.language": "表示言語", "mode.more": "その他の言語", "header.more": "その他のオプション", @@ -1477,69 +1357,17 @@ export const ja = { "theme.light": "ライトモードに切り替え", "theme.dark.short": "ダーク", "theme.light.short": "ライト", - "gate.connectFailed": "サイトに接続できません。接続を確認して再試行してください", - "gate.expired": "サイトへのアクセスが期限切れです。もう一度認証してください", - "gate.serviceUnavailable": "サイトのサービスを利用できません({status})。後でもう一度お試しください", "host.notStarted": "未開始", - "host.startCancelled": "開始をキャンセルしました", - "host.switchingSource": "ソースを切り替え中", "host.stageAria": "共有またはルームに参加", - "host.captureAria": "実際のキャプチャ設定値", "host.quality.title": "{label} · {mbps} Mbps", "host.audio.title": "{label} · 上限 {kbps} kbps", - "host.roomClosed": "ルームを閉じました", - "host.pause.noTracksResume": "共有を再開できません。ソースを選び直してください", - "host.pause.signalRecovering": "サーバーに再接続中です。共有は一時停止のままです", - "host.pause.noTracksPause": "共有を一時停止できません。ソースを選び直してください", - "host.pause.stillPaused": "共有は一時停止のままです", - "host.shareEnded": "現在の共有は終了しました", "host.fail.start": "共有を開始できませんでした", - "host.err.createConnection": "接続を作成できませんでした", - "host.err.codecUnsupported": "映像コーデックに対応していません。更新するか別のブラウザーをお試しください", - "host.fail.source": "共有ソースを切り替えられませんでした", - "host.fail.quality": "画質設定を適用できませんでした", - "host.fail.room": "ルームの操作に失敗しました", - "host.err.invalidToken": "共有の認証情報が無効になりました。ルームを作成し直してください", - "host.err.accessDenied": "許可されていません", - "host.err.alreadyConnected": "このルームは別のページですでに共有中です", - "host.err.peerGone": "視聴者の接続が退出しました", - "host.err.forbidden": "操作を利用できません", - "host.err.serverError": "サービスを一時的に利用できません。後でもう一度お試しください", - "host.err.createRoomStatus": "現在ルームを作成できません({status})", - "host.err.roomCapacity": "すべてのルームコードが使用中です。後で再試行するか、別の Piik サイトを使用してください。", - "host.err.replaceRoomStatus": "現在ルームを変更できません({status})", - "host.err.updateRoomStatus": "現在ルーム設定を更新できません({status})", "host.capture.noSource": "共有できる画面ソースがありません", - "host.capture.readFailed": "選択したソースを読み取れません。選び直してください", - "host.capture.unavailable": "このページでは画面共有を開始できません", - "host.capture.inactive": "このページに戻り、「共有」を押してソースを選び直してください。", - "host.capture.constraints": "選択したソースは現在の映像設定に対応できません。設定を下げるか、別のソースを選んでください。", - "host.notice.reconnecting": "一部の視聴者が再接続中です", - "host.notice.sfuRecovering": "サーバー転送のソース切り替えに失敗しました。視聴者の接続を復旧しています", - "host.password.inputPlaceholder": "パスワードを入力", "stats.warn.codec": "映像コーデックは {codec} です。H264 または VP8 を想定しています", "stats.warn.audioCodec": "音声コーデックは {codec} です。Opus を想定しています", "viewer.msg.joinUnavailable": "現在ルームに参加できません", - "viewer.stageAria": "共有映像", - "host.warn.audioUnread": "ブラウザーが音声ビットレートの上限を報告しませんでした", - "host.warn.param.scaleResolutionDownBy": "解像度の縮小率", - "host.warn.param.degradationPreference": "画質の優先項目", - "host.warn.param.scalabilityMode": "スケーラビリティモード", - "host.warn.sfuRecover": "サーバー転送:{params}に失敗しました。自動復旧を開始しました", - "host.warn.sfuStage.connect": "接続", - "host.warn.sfuStage.source": "ソース", - "host.warn.sfuStage.videoPublish": "映像の配信", - "host.warn.sfuStage.senderConfig": "送信設定", - "host.warn.sfuStage.audioPublish": "音声の配信", - "host.warn.sfuStage.transport": "トランスポート", - "host.fail.sfuAudioParams": "サーバー転送の音声パラメーターを適用できませんでした", - "client.connect.replace": "{site}を置き換え、その App セッションを切断します。", "voice.offline": "未接続", "interaction.effects": "リアクションの効果を表示", - "host.capture.fpsUnknown": "フレームレート不明", - "host.capture.codecPending": "コーデック未確定", - "host.capture.hasAudio": "ソース音声あり", - "host.capture.noAudio": "ソース音声なし", } satisfies Partial>; export const jaTitleFrames: TitleFrameCatalog = { diff --git a/src/client/locales/ko.ts b/src/client/locales/ko.ts index 17b350846..31f969e81 100644 --- a/src/client/locales/ko.ts +++ b/src/client/locales/ko.ts @@ -7,7 +7,6 @@ export const ko = { "watch.forward.noVideoTrack": "전송할 수 있는 영상 트랙이 없습니다. 원래 웹페이지에서 계속 시청할 수 있습니다.", "watch.forward.videoOnly": "영상만, 소리 없이", "watch.forward.trackUnavailable": "일부 소스를 읽을 수 없거나 아직 지원하지 않습니다. 나머지 트랙을 선택할 수 있습니다.", - "watch.forward.selected": "전송할 내용: {video} + {audio}", "watch.forward.confirmTracks": "확인하고 전송 시작", "watch.forward.channels": "{count}채널", "watch.viewersCount": "시청 참여: {count}명", @@ -22,8 +21,6 @@ export const ko = { "watch.forward.prepare": "전달할 동영상 선택", "watch.forward.choose": "원본 동영상 리소스를 선택하세요. 확인하면 업로드 대역폭을 사용해요.", "watch.forward.enableNamed": "{name} 전달", - "watch.forward.shareFile": "이 동영상 공유", - "watch.forward.shareFileHelp": "시청자는 동영상 링크를 받아 먼저 사이트에서 재생합니다. 재생에 실패하면 내 앱에서 받을 수 있습니다.", "watch.forward.none": "이 페이지에서 전달할 동영상 리소스를 아직 찾지 못했어요.", "watch.forward.peer": "공유자에게서 받기", "watch.forward.direct": "웹사이트에서 직접 재생", @@ -69,7 +66,6 @@ export const ko = { "room.chat.export": "채팅 텍스트 내보내기 (TXT)", "room.chat.purgeHistory": "방 기록 지우기", "room.chat.confirmPurgeHistory": "“{name}”의 모든 메시지와 첨부 파일을 영구 삭제할까요? 이미 다운로드한 파일은 그대로 남아요.", - "room.common.user": "사용자", "room.relay.webpage": "이 웹페이지", "room.relay.app": "연결된 App", "channel.forwarding.title": "다른 참가자를 위한 중계", @@ -84,7 +80,6 @@ export const ko = { "screen.directLimit": "직접 전송 대상 수", "screen.directLimitDefault": "방 기본값 사용 ({count})", "screen.directLimitHelp": "이 화면 공유를 내게서 직접 받는 웹페이지나 App 세션 수를 제한합니다. 받은 쪽에서 다른 참가자에게 중계할 수 있어요.", - "room.relay.followDefault": "방 기본값 따르기", "room.create.appHostedNote": "App이 실행되는 동안 방을 호스팅해요.", "room.create.browserHostedNote": "이 페이지에서 호스팅해요. 페이지를 닫으면 방이 일시 중지돼요.", "room.create.serverHostedNote": "서버가 방을 호스팅해요. 내가 나가도 다른 사람들은 방을 이용할 수 있어요.", @@ -136,7 +131,6 @@ export const ko = { "room.action.remove": "목록에서 제거", "room.settings.confirmDelete": "“{name}” 방과 채팅 기록을 삭제할까요? 다운로드한 파일은 유지돼요. 호스팅이 오프라인 상태라면 목록에서만 제거해요.", "room.settings.confirmRemove": "이 사이트의 방 목록에서 “{name}”을 제거할까요? 이 사이트를 통해 방에 들어갈 수 없게 됩니다. 호스트에 저장된 방 데이터는 유지됩니다.", - "room.settings.device": "이 기기", "room.settings.recordsTitle": "기록 및 백업", "room.backup.title": "방 백업", "invite.room.title": "{name}에 초대", @@ -244,12 +238,8 @@ export const ko = { "screen.unplayable": "이 브라우저에서 공유 화면을 재생하지 못했어요.", "screen.deliveryRetry": "화면을 전송하지 못했어요. 다시 시도하고 있어요.", "screen.pictureHelp": "화면 도움말", - "screen.pictureHelpViewer": "화면을 다시 연결해 보세요. 계속 실패하면 다른 네트워크를 사용해 보세요.", - "screen.pictureHelpPublisher": "공유자에게 미리보기를 확인하고 필요하면 공유 소스를 다시 선택해 달라고 요청하세요.", - "screen.pictureHelpForwarding": "사이트 운영자가 중계를 제공하면 방 관리자가 방 설정에서 ‘{setting}’을 켤 수 있어요.", "screen.connectingPicture": "화면 연결 중", "screen.focusNamed": "{title} 집중 보기", - "screen.returnToGrid": "격자 보기로 돌아가기", "screen.sharingControls": "공유 제어: {title}", "screen.stopSharing": "{title} 공유 중지", "screen.shareEnded": "{name} 님의 공유가 종료됐어요", @@ -257,7 +247,6 @@ export const ko = { "screen.availableScreens": "시청 가능한 화면", "screen.availableToWatch": "시청 가능", "screen.watch": "시청", - "screen.changeLayout": "화면 배치 변경", "screen.waitingPicture": "화면 기다리는 중", "screen.playNamed": "{label} 재생", "screen.shareTitle": "공유 제목", @@ -297,7 +286,6 @@ export const ko = { "channel.backupControls.roomRestored": "방을 복원했어요.", "channel.attachment.thumbnail": "미리보기", "channel.attachment.loadingOriginalImage": "원본 이미지 불러오는 중…", - "channel.attachment.originalLoadFailed": "원본 이미지를 불러오지 못했어요.", "channel.attachment.cancelDownload": "다운로드 취소", "channel.attachment.savedCopyMissing": "저장된 파일을 찾을 수 없어요.", "channel.attachment.revealSavedFailed": "저장한 파일을 파일 탐색기에 표시하지 못했습니다.", @@ -342,7 +330,6 @@ export const ko = { "channel.inviteQrCode.generationFailed": "QR 코드를 만들지 못했어요. 초대 링크를 복사해 주세요.", "channel.inviteQrCode.saveImage": "이미지 저장", "channel.inviteQrCode.saveFailed": "이미지를 저장하지 못했어요. 다시 시도해 주세요.", - "channel.inviteQrCode.close": "닫기", "channel.joinVoice.voiceJoined": "음성 참여 중", "channel.mentionSuggestions.mentionSomeone": "사용자 멘션", "channel.mentionSuggestions.users": "사용자", @@ -430,13 +417,11 @@ export const ko = { "channel.voiceDock.voiceJoined": "음성 참여 중", "channel.voiceDock.voiceConnecting": "음성 연결 중…", "channel.voiceDock.voiceConnected": "음성 연결됨", - "channel.voiceDock.openRoom": "{name} 열기", "channel.invitationLink.copied": "복사됨", "channel.invitationLink.copyInvitation": "초대 링크 복사", "channel.invitationLink.copyFailed": "위 링크를 직접 복사하세요.", "channel.invitationLink.qrCode": "QR 코드", "channel.previewPage.screenSharing": "화면 공유", - "channel.previewPage.user": "사용자", "channel.previewPage.connected": "사이트에 연결됨", "channel.previewPage.connecting": "연결 중", "channel.previewPage.reconnecting": "재연결 중", @@ -453,7 +438,6 @@ export const ko = { "channel.previewPage.viewTools": "보기 도구", "channel.previewPage.ongoingScreens": "사용 중인 화면", "channel.previewPage.stillSharing": "계속 공유 중", - "channel.previewPage.stillWatching": "시청에 참여함", "channel.previewPage.returnToRoom": "{value}로 돌아가기", "channel.previewPage.return": "돌아가기", "channel.previewPage.stopSharingSource": "{title} 공유 중지", @@ -490,10 +474,8 @@ export const ko = { "watch.inWindow": "별도의 웹페이지 창에서 재생하는 동영상이에요.", "watch.inWindowSource": "별도의 웹페이지 창에서 재생하는 동영상이에요. 그 창을 닫으면 함께 보기가 끝나요.", "watch.focusWindow": "재생 창으로 돌아가기", - "watch.inApp": "App에서 보기", "watch.browserFailed": "이 브라우저에서는 이 웹페이지 동영상을 직접 재생할 수 없어요.", "watch.sharedControls": "모두의 재생", - "watch.localControls": "내 소리와 창", "watch.seek": "모두의 재생 진행", "watch.rate": "모두의 재생 속도", "watch.failed": "동영상을 재생하지 못했어요. 직접 URL을 확인하거나 나갔다가 다시 참여하세요.", @@ -627,7 +609,6 @@ export const ko = { "remote.textHelp": "Enter를 누르면 줄을 바꿔요. 버튼을 누르면 원격 커서 위치에 입력해요.", "remote.textTooLong": "각각 2KB 이하로 나누어 보내세요.", "remote.touchHelp": "두 손가락으로 탭하면 오른쪽 클릭, 오므리거나 벌리면 확대·축소해요. 두 손가락으로 쓸어 넘기면 스크롤하고, 확대 중이거나 가상 마우스가 펼쳐져 있으면 화면을 이동해요.", - "remote.resetZoom": "화면 확대 초기화", "remote.key.Escape": "Escape", "remote.key.Tab": "Tab", "remote.key.ArrowLeft": "왼쪽 화살표", @@ -734,7 +715,6 @@ export const ko = { "playback.showControls": "재생 컨트롤 표시", "playback.overlay": "화면 위 채팅", "playback.more": "재생 설정", - "playback.pictureFit": "화면 맞춤", "playback.viewControls": "보기 옵션", "playback.windowControls": "플레이어 창", "playback.changeFit": "화면 맞춤 전환", @@ -751,9 +731,6 @@ export const ko = { "playback.fit.contain": "맞추기", "playback.fit.cover": "채우기", "playback.fit.fill": "늘리기", - "playback.fitFull": "원래 비율을 유지하며 화면 전체를 표시해요.", - "playback.fitCrop": "플레이어를 가득 채워요. 가장자리가 일부 잘릴 수 있어요.", - "playback.fitStretch": "화면을 늘려 플레이어를 가득 채워요.", "playback.route.auto": "자동", "playback.route.p2p": "P2P만", "playback.route.sfu": "SFU만", @@ -793,7 +770,6 @@ export const ko = { "debug.exportFailed": "진단을 다운로드하지 못했어요. 다시 시도하세요", "brand.home": "Piik 홈", "help.title": "도움말", - "help.hint": "도움말, 진단 및 버전 정보", "help.troubleshooting": "문제 해결", "common.roomCode": "방 코드", @@ -814,17 +790,13 @@ export const ko = { "common.disable": "{name} 끄기", "common.increase": "{name} 늘리기", "common.decrease": "{name} 줄이기", - "host.join.hide": "방 입장 영역 숨기기", "host.advanced.hide": "공유 설정 숨기기", - "host.password.settingsHide": "비밀번호 설정 숨기기", "host.sourcePicker.audioOn": "소리 공유", "host.sourcePicker.audioOff": "소리 공유 중지", "host.sourcePicker.audioLocked": "소스를 바꿔도 소리 공유 설정은 유지돼요", "common.viewers": "시청자", "common.you": "나", "common.host": "호스트", - "common.name.viewerDefault": "시청자", - "common.name.hostDefault": "호스트", "client.launch.title": "Piik 열기", "client.launch.version": "설치된 버전 {version}", @@ -868,10 +840,6 @@ export const ko = { "client.connect.navigationUnsupported": "이 App은 브라우저 인터페이스를 사용해요. 이 페이지에서 계속하세요.", "client.connect.navigationPopupBlocked": "새 창을 열 수 없어요. 이 사이트의 팝업을 허용하고 다시 시도하세요.", "client.connect.approving": "App 승인 기다리는 중…", - "client.connect.standby": "App 준비 완료", - "client.connect.guide": "사이트 연결", - "client.connect.addSite": "사이트 열기", - "client.connect.addSiteHint": "Piik 사이트 주소를 입력한 뒤 App 접근을 허용하세요.", "client.bookmarks.title": "저장된 사이트", "client.launcher.manageSites": "사이트 관리", "client.sites.title": "사이트 목록", @@ -912,8 +880,6 @@ export const ko = { "client.connect.siteAddress": "사이트 주소", "client.connect.continue": "계속", "client.connect.openSite": "사이트 열기", - "client.connect.approveAndOpen": "허용하고 열기", - "client.connect.standbyHint": "Piik 사이트 오른쪽 위의 App을 누르고 App 페이지 열기를 선택한 뒤 접근 허용을 확인하세요.", "client.connect.openOnStart": "App 시작 시 이 사이트 열기", "client.connect.openOwnedOnStart": "App 시작 시 내 사이트 열기 ({mode})", "client.connect.manage": "App이 준비됐어요. App 관리.", @@ -983,27 +949,12 @@ export const ko = { "client.update.differentBuild": "공식 릴리스와 다른 빌드예요", "client.update.official": "Piik 공식 릴리스가 있어요", - "gate.title": "사이트 접근", - "gate.hint": "사이트 암호를 입력하세요", - "gate.password": "사이트 암호", - "gate.submit": "사이트 입장", "gate.checking": "사이트 접근 확인 중", - "gate.wrong": "암호가 올바르지 않아요. 다시 시도하세요", - "gate.unavailable": "지금은 사이트 접근을 확인할 수 없어요", - "gate.malformed": "방 코드 형식이 올바르지 않아요", - "gate.malformedHint": "1000~9999 사이의 네 자리 방 코드를 입력하세요", - "gate.unavailableRoute": "사용 불가", "startup.failed": "페이지를 불러오지 못했어요", "startup.retry": "페이지를 새로고침하여 다시 시도하세요.", "join.title": "방 참여", - "join.hint": "{site}의 방 코드를 입력하세요", - "join.submit": "참여", "join.password": "방 비밀번호", - "join.passwordError": "참여하지 못했어요. 다시 시도하세요", - "join.passwordRule": "눈에 보이는 문자 1~{max}자를 입력하세요", - "join.passwordAction": "방 비밀번호 입력", - "join.full": "방이 가득 찼어요", "host.title": "{name}의 화면", "host.start": "공유 시작", @@ -1019,8 +970,6 @@ export const ko = { "host.commentary.unavailable": "마이크 믹싱을 사용할 수 없어요. 화면과 소스 소리는 계속 공유돼요.", "host.commentary.description": "방 음성에 참여하지 않고 공유 화면에 내 목소리를 더해요.", "host.commentary.duplicate": "공유 마이크와 음성 마이크가 모두 켜져 있어요. 소리가 안 들리거나 울리면 하나만 사용하세요.", - "host.commentary.failed": "공유 마이크를 시작하지 못했어요. 권한과 선택한 기기를 확인하세요.", - "host.audioInput.stopped": "오디오 입력이 중지됐어요. 화면 공유는 계속돼요.", "host.commentary.device": "공유용 마이크", "host.commentary.volume": "공유용 마이크 볼륨", "voice.output.permissionHint": "현재 시스템 기본 기기만 표시돼요. 다른 기기를 보려면 브라우저의 이 사이트 권한에서 마이크를 허용한 뒤 목록을 새로고침하세요.", @@ -1038,7 +987,6 @@ export const ko = { "host.device.refresh": "기기 새로고침", "host.device.listFailed": "기기를 불러오지 못했어요. 새로고침해 보세요.", "host.device.permission.microphone": "마이크를 켜고 접근을 허용하면 사용할 수 있는 기기가 여기에 표시돼요.", - "host.microphone.volume": "마이크 볼륨", "host.microphone.voiceProcessing": "소음 및 에코 감소", "host.microphone.voiceProcessingHint": "마이크 소음과 에코를 줄이고 볼륨을 자동으로 조절해요. 입력 장치에서 이미 음성을 처리한다면 이 옵션을 끄세요.", "interaction.open": "소통", @@ -1055,8 +1003,6 @@ export const ko = { "stats.avgRttHint": "평균 왕복 시간이에요. 각 피어 또는 SFU 연결을 한 번씩 계산해요.", "stats.totalBitrateHint": "이 방향의 스트림 비트레이트 합계예요.", "stats.avgLossHint": "이 스트림들의 최신 패킷 손실 보고서 평균이에요.", - "stats.audioPresent": "있음", - "stats.audioAbsent": "없음", "stats.droppedHint": "현재 측정 구간에 누락된 영상 프레임 수예요.", "stats.inputFpsHint": "인코더에 도달하는 프레임 레이트예요.", "stats.pictureSend": "화면 송신", @@ -1073,17 +1019,9 @@ export const ko = { "voice.listeningVolume": "전체 음성 볼륨", "voice.personVolume": "개별 볼륨", "voice.listenPerson": "이 사용자의 음성 듣기", - "voice.deafen": "듣기 일시 중지", - "voice.undeafen": "듣기 재개", - "voice.deafenHint": "내 방 음성 재생을 일시 중지해요. 마이크와 전달은 계속돼요.", - "voice.undeafenHint": "마이크 설정을 바꾸지 않고 방 음성 재생을 재개해요.", "voice.leave.short": "나가기", "voice.listening.short": "듣기", "voice.leave": "음성 나가기", - "voice.microphoneOn": "마이크 켜기", - "voice.microphoneOff": "마이크 끄기", - "voice.muteForMe": "나에게만 음소거", - "voice.unmuteForMe": "나에게만 음소거 해제", "voice.participant": "참여자", "voice.outside": "음성 미참여", "voice.microphoneInactive": "마이크 꺼짐", @@ -1092,14 +1030,8 @@ export const ko = { "voice.microphoneActive": "마이크 켜짐", "voice.bitrate": "방 음성 비트레이트", "voice.bitrateHint": "방 소유자가 모두의 음성 비트레이트 한도를 설정해요. 실제 비트레이트는 말소리와 네트워크 상태에 따라 조정돼요. {min}~{max}kbps를 입력하세요.", - "host.sourceAudio.unavailable": "소스 소리가 중지됐어요. 화면 공유는 계속돼요.", "voice.error.microphoneDenied": "마이크 접근이 허용되지 않았어요. 접근을 허용한 뒤 다시 시도하세요.", "voice.error.microphoneUnavailable": "이 페이지에서는 마이크를 사용할 수 없어요. HTTPS 또는 localhost 주소를 사용하세요.", - "voice.error.microphoneMissing": "사용 가능한 마이크를 찾지 못했어요.", - "voice.error.microphoneFailed": "마이크를 시작하지 못했어요. 다시 시도하세요.", - "voice.error.transport": "음성을 연결하지 못했어요. 방은 계속 열려 있어요. 다른 네트워크나 브라우저를 사용해 보세요.", - "voice.error.rejected": "음성 작업이 승인되지 않았어요. 음성에 다시 참여한 뒤 시도하세요.", - "voice.error.closed": "호스트가 아직 방 음성을 열지 않았어요.", "voice.mode.failed": "이 브라우저에서는 눌러서 말하기와 음성 감지를 사용할 수 없어요. 항상 켜짐으로 바꾸세요.", "interaction.settings": "채팅 설정", "interaction.feedbackSounds": "효과음", @@ -1188,7 +1120,6 @@ export const ko = { "host.sourcePicker.excludeAudio": "앱 소리 제외", "host.sourcePicker.refreshApplications": "앱 목록 새로고침", "host.sourcePicker.excludeListFailed": "앱을 불러오지 못했어요. 새로고침하여 다시 시도하세요.", - "host.fail.sourceAudio": "소스 소리를 업데이트하지 못했어요. 다시 시도해 주세요.", "host.sourcePicker.excludeNone": "없음", "host.sourcePicker.excludeMissing": "목록에 없어요. 다시 선택하세요", "host.sourcePicker.excludeAudioChoose": "제외할 앱 창을 선택하세요. 보이지 않으면 해당 창을 열고 새로고침하세요.", @@ -1200,12 +1131,7 @@ export const ko = { "host.sourcePicker.unsupported": "현재 설정으로는 App 화면 공유를 사용할 수 없어요. 코덱을 바꾸거나 브라우저에서 공유하세요.", "host.sourcePicker.failed": "소스를 불러오지 못했어요. 새로고침하여 다시 시도하세요.", "native.incompatible": "App과 페이지 버전이 호환되지 않아요. App을 업데이트하고 새로고침하세요.", - "native.fail.browserMedia": "브라우저가 미디어 연결을 만들지 못했어요. 새로고침하여 다시 시도하세요.", - "native.fail.signaling": "Piik App 시그널링 실패", - "native.fail.receiver": "Piik App 미디어 수신 실패", "native.fail.requestTimeout": "Piik App 연결 시간이 초과됐어요. 잠시 후 다시 시도하세요.", - "native.fail.invalidResponse": "페이지에서 Piik App의 응답을 읽지 못했어요. App을 업데이트하고 페이지를 새로고침하세요.", - "native.fail.edgePrepare": "Piik App이 미디어 연결을 준비하지 못했어요. 진단을 켜고 다시 시도하세요.", "shareHelp.open": "문제 해결 도움말을 보려면 상태 표시등을 선택하세요", "shareHelp.guide": "문제 해결 가이드 열기", "host.sourcePicker.window": "창 공유: {title}", @@ -1217,7 +1143,6 @@ export const ko = { "host.sourcePicker.loading": "공유 소스 찾는 중", "host.join": "방 참여", "host.starting": "연결 중", - "host.cancelStart": "취소", "host.live": "공유 중", "host.paused": "일시 중지됨", "host.ended": "공유 중지됨", @@ -1225,7 +1150,6 @@ export const ko = { "host.pause": "공유 일시 중지", "host.resume": "공유 재개", "host.switchSource": "소스 전환", - "host.switching": "선택 중", "host.stop": "공유 중지", "host.noAudio": "소스 소리를 공유하지 않고 있어요", "host.localPreviewPaused": "로컬 미리보기 일시 중지됨. 공유는 계속돼요", @@ -1233,44 +1157,23 @@ export const ko = { "host.previewAutoPause": "미리보기 자동 일시 중지", "host.previewAutoPauseHint": "탭이나 창을 바꾸면 로컬 미리보기를 일시 중지해요. 공유는 계속돼요. 다른 모니터에서 보려면 이 옵션을 끄세요.", "host.pauseNotice": "영상 및 소리 공유 일시 중지됨", - "host.stopNotice": "공유 중지됨", - "host.roomReplaced": "방 코드 변경됨", "host.roomReplace": "방 코드 변경", "host.roomReplaceConfirm": "방 코드를 변경하면 현재 공유가 종료되고 시청자의 연결이 끊겨요", - "host.terminated.stale": "페이지가 업데이트됐어요. 새로고침하여 계속하세요", - "host.terminated.session": "다른 페이지에서 이 세션을 이어받았어요. 해당 페이지에서 계속하세요", - "host.terminated.signal": "서버 연결이 종료됐어요. 새로고침하여 계속하세요", "host.notice.qualityApplied": "공유 설정 적용됨", - "host.notice.qualitySet": "화질이 {label}(으)로 변경됐어요", - "host.notice.audioSet": "오디오 비트레이트 한도가 {kbps}kbps로 설정됐어요", - "host.notice.partialApply": "설정을 업데이트했지만 일부 시청자 연결에는 적용하지 못했어요", - "host.notice.sourceSwitch.ok": "공유 소스 전환됨", - "host.notice.sourceSwitch.partial": "소스는 전환됐지만 {warning}", "host.name": "표시 이름", - "host.nameSave": "표시 이름 저장", - "host.nameCancel": "편집 취소", "host.nameEdit": "표시 이름 편집", - "host.nameError": "이름이 올바르지 않거나 24자를 넘었어요", - "host.nameOffline": "이름을 저장했어요. 연결이 복구되면 다른 사람에게 표시돼요", "host.invite": "초대 링크", "host.invite.copy": "초대 링크 복사", - "host.invite.copyFailed": "링크를 복사하지 못했어요. 다시 시도하세요", "host.invite.rotate": "초대 링크를 재발급해요. 이전 링크를 사용하는 시청자는 다시 참여해야 해요", "host.invite.revoke": "초대 링크를 폐기하고 해당 링크로 참여한 시청자의 연결을 끊어요", "host.invite.rotateShort": "링크 재발급", "host.invite.revokeShort": "링크 폐기", - "host.invite.updated": "초대 링크 재발급됨", - "host.invite.revoked": "초대 링크 폐기됨", - "host.invite.emptyOpen": "초대 링크가 없어요. 방 코드는 계속 사용할 수 있어요", "host.invite.address": "방 주소", - "host.invite.copyAddress": "방 주소 복사", "host.invite.includeCredential": "비밀번호 생략", "host.invite.credentialHint": "링크가 있는 사람은 누구나 방에 참여할 수 있어요", "host.invite.credentialRequired": "초대 전용 방이에요. 비밀번호 생략을 켜세요", - "host.invite.emptyPassword": "초대 링크가 없어요. 방 코드와 비밀번호로 참여할 수 있어요", - "host.invite.emptyPrivate": "초대 링크가 없어요. 초대하기 전에 새 링크를 발급하세요", "host.policy": "입장 방식", "host.policy.open": "열기", @@ -1285,22 +1188,12 @@ export const ko = { "host.policy.setPrivateInvite": "방이 비공개로 변경됐어요. 초대 링크로만 참여할 수 있어요", "host.policy.setPrivatePassword": "방이 비공개로 변경됐어요. 초대 링크나 비밀번호로 참여할 수 있어요", "host.password.set": "방 비밀번호 설정됨", - "host.password.unset": "방 비밀번호 없음", - "host.password.placeholder": "설정하면 코드로 입장할 수 있어요", "host.password.setAction": "방 비밀번호 설정", - "host.password.changeAction": "방 비밀번호 변경", - "host.password.remove": "방 비밀번호 삭제", "host.password.show": "방 비밀번호 표시", "host.password.hide": "방 비밀번호 숨기기", - "host.password.saved": "방 비밀번호 설정됨", - "host.password.updated": "방 비밀번호 변경됨", - "host.password.removed": "비밀번호가 삭제됐어요. 초대 링크로만 참여할 수 있어요", - "host.password.rule": "눈에 보이는 문자 1~{max}자", - "host.accessFailed": "지금은 방 설정을 바꿀 수 없어요. 나중에 다시 시도하세요", "host.viewers.empty": "아직 시청자가 없어요", - "host.quality": "영상 프리셋", "host.quality.light": "가볍게", "host.quality.hd": "HD", "host.quality.highFps": "높은 FPS", @@ -1389,7 +1282,6 @@ export const ko = { "host.details.hide": "연결 정보 숨기기", "host.topology": "연결 구조", "host.topology.show": "연결 구조 표시", - "host.topology.hide": "연결 구조 숨기기", "host.topology.pending": "연결 중", "state.signal.connected": "서버 연결됨", @@ -1406,7 +1298,6 @@ export const ko = { "state.route.sfu": "서버 경유", "stats.title": "연결 데이터", - "stats.downstream": "하위 수신 데이터", "stats.more": "상세 지표", "stats.group.network": "네트워크", "stats.group.encoding": "인코딩", @@ -1448,7 +1339,6 @@ export const ko = { "stats.audioConcealed": "오디오 손실 보정 횟수", "viewer.title": "{name}의 화면", - "viewer.titleFallback": "친구의 화면", "viewer.title.watching": "시청 중", "viewer.title.waiting": "대기 중", "viewer.reconnect": "재연결", @@ -1457,7 +1347,6 @@ export const ko = { "viewer.msg.joining": "방 참여 중", "viewer.msg.waitingHost": "호스트의 공유 기다리는 중", "viewer.msg.preparingP2p": "P2P 연결 중", - "viewer.msg.connectionRetry": "다시 시도 중 ({current}/{total})", "viewer.msg.preparingSfu": "서버 중계 연결 중", "viewer.msg.allocating": "경로 할당 중", "viewer.msg.receiving": "영상 수신 중", @@ -1475,20 +1364,11 @@ export const ko = { "viewer.msg.invalidInvite": "더 이상 유효하지 않은 초대 링크예요", "viewer.msg.closed": "방이 닫혔어요", "viewer.msg.full": "방이 가득 찼어요", - "viewer.msg.accessFailed": "방에 참여할 수 없어요", - "viewer.hint.accessFailed": "이 페이지를 새로고침하여 다시 시도하거나 호스트의 초대 링크를 사용하세요.", - "viewer.hint.full": "빈자리가 생기면 다시 시도하세요.", "viewer.msg.stale": "페이지가 업데이트됐어요. 새로고침하여 계속하세요", "viewer.msg.sessionReplaced": "다른 페이지에서 이 세션을 이어받았어요", "viewer.msg.signalTerminated": "연결이 종료됐어요. 새로고침하여 계속하세요", "viewer.notice.signalRecovering": "서버 재연결 중", "viewer.notice.hostOffline": "호스트 연결이 끊겨 화면이 멈출 수 있어요", - "viewer.hint.denied": "호스트의 초대 링크를 사용하거나 방 비밀번호를 입력해 보세요.", - "viewer.hint.notFound": "방 코드가 {site}의 코드인지 확인하거나 호스트의 초대 링크를 여세요.", - "viewer.hint.closed": "호스트에게 새 방을 만들고 초대 링크를 보내 달라고 요청하세요.", - "viewer.hint.sessionReplaced": "다른 페이지에서 계속하거나 여기서 새로고침하여 재연결하세요.", - "viewer.hint.invite": "호스트에게 새 초대 링크를 요청하세요.", - "viewer.hint.generic": "잠시 후 이 페이지를 새로고침하여 다시 시도하세요.", "mode.language": "인터페이스 언어", "mode.more": "다른 언어", @@ -1498,73 +1378,21 @@ export const ko = { "theme.dark.short": "다크", "theme.light.short": "가볍게", - "gate.connectFailed": "사이트에 연결할 수 없어요. 연결을 확인하고 다시 시도하세요", - "gate.expired": "사이트 접근이 만료됐어요. 다시 인증하세요", - "gate.serviceUnavailable": "사이트 서비스를 사용할 수 없어요 ({status}). 나중에 다시 시도하세요", "host.notStarted": "시작 전", - "host.startCancelled": "시작 취소됨", - "host.switchingSource": "소스 전환 중", "host.stageAria": "공유하거나 방에 참여하세요", - "host.captureAria": "실제 캡처 매개변수", "host.quality.title": "{label} · {mbps}Mbps", "host.audio.title": "{label} · 최대 {kbps}kbps", - "host.roomClosed": "방이 닫혔어요", - "host.pause.noTracksResume": "공유를 재개할 수 없어요. 소스를 다시 선택하세요", - "host.pause.signalRecovering": "서버 재연결 중이에요. 공유는 일시 중지 상태를 유지해요", - "host.pause.noTracksPause": "공유를 일시 중지할 수 없어요. 소스를 다시 선택하세요", - "host.pause.stillPaused": "공유는 일시 중지 상태를 유지해요", - "host.shareEnded": "현재 공유가 종료됐어요", "host.fail.start": "공유를 시작하지 못했어요", - "host.err.createConnection": "연결을 만들지 못했어요", - "host.err.codecUnsupported": "영상 코덱을 지원하지 않아요. 업데이트하거나 다른 브라우저를 사용하세요", - "host.fail.source": "공유 소스를 전환하지 못했어요", - "host.fail.quality": "화질 설정을 적용하지 못했어요", - "host.fail.room": "방 작업에 실패했어요", - "host.err.invalidToken": "공유 인증 정보가 더 이상 유효하지 않아요. 방을 다시 만드세요", - "host.err.accessDenied": "허용되지 않음", - "host.err.alreadyConnected": "이미 다른 페이지에서 공유 중인 방이에요", - "host.err.peerGone": "시청자 연결이 종료됐어요", - "host.err.forbidden": "사용할 수 없는 작업", - "host.err.serverError": "일시적으로 서비스를 사용할 수 없어요. 나중에 다시 시도하세요", - "host.err.createRoomStatus": "지금은 방을 만들 수 없어요 ({status})", - "host.err.roomCapacity": "모든 방 코드를 사용 중이에요. 나중에 다시 시도하거나 다른 Piik 사이트를 사용하세요.", - "host.err.replaceRoomStatus": "지금은 방을 바꿀 수 없어요 ({status})", - "host.err.updateRoomStatus": "지금은 방 설정을 바꿀 수 없어요 ({status})", "host.capture.noSource": "공유 가능한 화면 소스가 없어요", - "host.capture.readFailed": "선택한 소스를 읽을 수 없어요. 다시 선택하세요", - "host.capture.unavailable": "이 페이지에서는 화면 공유를 시작할 수 없어요", - "host.capture.inactive": "이 페이지로 돌아와 공유를 누르고 소스를 다시 선택하세요.", - "host.capture.constraints": "선택한 소스가 현재 화면 설정을 충족할 수 없어요. 설정을 낮추거나 다른 소스를 선택하세요.", - "host.notice.reconnecting": "일부 시청자가 재연결 중이에요", - "host.notice.sfuRecovering": "서버 전달 소스를 전환하지 못했어요. 시청자 연결을 복구하고 있어요", - "host.password.inputPlaceholder": "비밀번호 입력", "stats.warn.codec": "영상 코덱이 {codec}이에요. H264 또는 VP8이 필요해요", "stats.warn.audioCodec": "오디오 코덱이 {codec}이에요. Opus가 필요해요", "viewer.msg.joinUnavailable": "지금은 방에 참여할 수 없어요", - "viewer.stageAria": "공유 화면", - "host.warn.audioUnread": "브라우저가 오디오 비트레이트 상한을 보고하지 않았어요", - "host.warn.param.scaleResolutionDownBy": "해상도 배율", - "host.warn.param.degradationPreference": "품질 우선순위", - "host.warn.param.scalabilityMode": "확장성 모드", - "host.warn.sfuRecover": "서버 전달: {params} 실패. 자동 복구를 시작했어요", - "host.warn.sfuStage.connect": "연결", - "host.warn.sfuStage.source": "소스", - "host.warn.sfuStage.videoPublish": "영상 게시", - "host.warn.sfuStage.senderConfig": "송신 설정", - "host.warn.sfuStage.audioPublish": "오디오 게시", - "host.warn.sfuStage.transport": "전송", - "host.fail.sfuAudioParams": "서버 전달 오디오 매개변수를 적용하지 못했어요", - "client.connect.replace": "{site}을(를) 대체하고 해당 사이트의 App 세션 연결을 끊어요.", "voice.offline": "연결 끊김", "interaction.effects": "반응 효과 표시", - "host.capture.fpsUnknown": "프레임 레이트 알 수 없음", - "host.capture.codecPending": "코덱 확인 중", - "host.capture.hasAudio": "소스 소리 포함", - "host.capture.noAudio": "소스 소리 없음", } satisfies Partial>; export const koTitleFrames = { diff --git a/src/client/locales/zh-Hant.ts b/src/client/locales/zh-Hant.ts index e43bb8cd7..8bf98e0c1 100644 --- a/src/client/locales/zh-Hant.ts +++ b/src/client/locales/zh-Hant.ts @@ -6,7 +6,6 @@ export const zhHant = { "watch.forward.noVideoTrack": "沒有可轉發的影片軌道。你仍可在原網頁中觀看。", "watch.forward.videoOnly": "僅畫面,不帶聲音", "watch.forward.trackUnavailable": "部分來源無法讀取或目前不支援。可以選擇其餘軌道。", - "watch.forward.selected": "將轉發:{video} + {audio}", "watch.forward.confirmTracks": "確認並開始轉發", "watch.forward.channels": "{count} 聲道", "watch.viewersCount": "已加入觀看:{count} 人", @@ -21,8 +20,6 @@ export const zhHant = { "watch.forward.prepare": "選擇要轉發的影片", "watch.forward.choose": "選擇原始影片資源。確認後開始使用本機上傳頻寬。", "watch.forward.enableNamed": "轉發 {name}", - "watch.forward.shareFile": "分享這部影片", - "watch.forward.shareFileHelp": "觀眾會收到影片連結並優先從網站播放。播放失敗時,可以從你的 App 接收。", "watch.forward.none": "此網頁暫未發現可轉發的影片資源。", "watch.forward.peer": "從分享者接收", "watch.forward.direct": "從網站直接播放", @@ -68,7 +65,6 @@ export const zhHant = { "room.chat.export": "匯出文字記錄(TXT)", "room.chat.purgeHistory": "清空房間記錄", "room.chat.confirmPurgeHistory": "要永久清空「{name}」的所有訊息及附件嗎?已下載的檔案仍會保留。", - "room.common.user": "使用者", "room.relay.webpage": "此網頁", "room.relay.app": "已連線的 App", "channel.forwarding.title": "協助轉傳", @@ -83,7 +79,6 @@ export const zhHant = { "screen.directLimit": "直連接收端上限", "screen.directLimitDefault": "使用房間預設值({count})", "screen.directLimitHelp": "限制直接從你這裡接收這場分享的網頁或 App 工作階段數量。接收端可以再轉傳給其他人。", - "room.relay.followDefault": "使用房間預設值", "room.create.appHostedNote": "App 執行時會託管這個房間。", "room.create.browserHostedNote": "由此網頁托管,關閉網頁後房間會暫停。", "room.create.serverHostedNote": "房間由伺服器託管。你離開後,其他人仍可使用房間。", @@ -135,7 +130,6 @@ export const zhHant = { "room.action.remove": "從清單移除", "room.settings.confirmDelete": "要刪除「{name}」及其聊天記錄嗎?已下載的檔案會保留。若托管端已離線,只會從清單中移除。", "room.settings.confirmRemove": "要從本站房間目錄中移除「{name}」嗎?移除後將無法從本站進入,房間資料仍保留在託管端。", - "room.settings.device": "本機連線", "room.settings.recordsTitle": "記錄與備份", "room.backup.title": "房間備份", "invite.room.title": "邀請進入 {name}", @@ -243,12 +237,8 @@ export const zhHant = { "screen.unplayable": "瀏覽器無法播放分享畫面。", "screen.deliveryRetry": "畫面傳輸失敗,正在重試。", "screen.pictureHelp": "畫面說明", - "screen.pictureHelpViewer": "選擇「重新連線畫面」。如果仍然失敗,請試試其他網路。", - "screen.pictureHelpPublisher": "請分享者檢查本機預覽,必要時重新選擇分享來源。", - "screen.pictureHelpForwarding": "如果站點營運者提供轉發服務,房間管理員可在房間設定中開啟「{setting}」。", "screen.connectingPicture": "正在連線畫面", "screen.focusNamed": "聚焦 {title}", - "screen.returnToGrid": "返回並排", "screen.sharingControls": "{title}的分享控制", "screen.stopSharing": "停止分享 {title}", "screen.shareEnded": "{name} 的這路分享已結束", @@ -256,7 +246,6 @@ export const zhHant = { "screen.availableScreens": "可觀看的畫面", "screen.availableToWatch": "正在分享", "screen.watch": "觀看", - "screen.changeLayout": "切換畫面排列", "screen.waitingPicture": "等待畫面", "screen.playNamed": "播放 {label}", "screen.shareTitle": "分享標題", @@ -296,7 +285,6 @@ export const zhHant = { "channel.backupControls.roomRestored": "房間已還原。", "channel.attachment.thumbnail": "縮圖", "channel.attachment.loadingOriginalImage": "正在載入原圖…", - "channel.attachment.originalLoadFailed": "暫時無法載入原圖。", "channel.attachment.cancelDownload": "取消下載", "channel.attachment.savedCopyMissing": "找不到本機儲存的檔案。", "channel.attachment.revealSavedFailed": "無法在檔案總管中顯示已儲存的檔案。", @@ -341,7 +329,6 @@ export const zhHant = { "channel.inviteQrCode.generationFailed": "無法產生 QR Code,請複製邀請連結。", "channel.inviteQrCode.saveImage": "儲存圖片", "channel.inviteQrCode.saveFailed": "圖片未能儲存,請重試。", - "channel.inviteQrCode.close": "關閉", "channel.joinVoice.voiceJoined": "已加入語音", "channel.mentionSuggestions.mentionSomeone": "提及使用者", "channel.mentionSuggestions.users": "使用者", @@ -429,13 +416,11 @@ export const zhHant = { "channel.voiceDock.voiceJoined": "已加入語音", "channel.voiceDock.voiceConnecting": "正在接通語音…", "channel.voiceDock.voiceConnected": "語音已接通", - "channel.voiceDock.openRoom": "開啟「{name}」", "channel.invitationLink.copied": "已複製", "channel.invitationLink.copyInvitation": "複製邀請", "channel.invitationLink.copyFailed": "請手動複製上方連結。", "channel.invitationLink.qrCode": "QR Code", "channel.previewPage.screenSharing": "螢幕共享", - "channel.previewPage.user": "使用者", "channel.previewPage.connected": "站點已連線", "channel.previewPage.connecting": "正在連線", "channel.previewPage.reconnecting": "正在重新連線", @@ -452,7 +437,6 @@ export const zhHant = { "channel.previewPage.viewTools": "視圖工具", "channel.previewPage.ongoingScreens": "進行中的畫面", "channel.previewPage.stillSharing": "仍在分享", - "channel.previewPage.stillWatching": "已加入觀看", "channel.previewPage.returnToRoom": "返回 {value}", "channel.previewPage.return": "返回", "channel.previewPage.stopSharingSource": "停止分享 {title}", @@ -489,10 +473,8 @@ export const zhHant = { "watch.inWindow": "影片使用獨立網頁視窗播放。", "watch.inWindowSource": "影片在獨立網頁視窗播放,關閉它會結束同步觀看。", "watch.focusWindow": "返回播放視窗", - "watch.inApp": "在 App 觀看", "watch.browserFailed": "這個網頁的影片無法直接在目前的瀏覽器中播放。", "watch.sharedControls": "所有人的播放進度", - "watch.localControls": "你的聲音與視窗", "watch.seek": "所有人的播放進度", "watch.rate": "所有人的播放速度", "watch.failed": "無法播放此影片。請檢查直連網址是否可用,或重新加入。", @@ -626,7 +608,6 @@ export const zhHant = { "remote.textHelp": "按 Enter 可換行;點選按鈕後,文字會輸入到對方目前選取的位置。", "remote.textTooLong": "內容較長,請分段輸入(每次最多 2 KB)。", "remote.touchHelp": "以雙指輕點可按右鍵,捏合可縮放。雙指滑動預設會捲動;縮放後或展開虛擬滑鼠時,則會平移畫面。", - "remote.resetZoom": "還原畫面大小", "remote.key.Escape": "退出鍵", "remote.key.Tab": "Tab 鍵", "remote.key.ArrowLeft": "向左", @@ -733,7 +714,6 @@ export const zhHant = { "playback.showControls": "顯示播放控制項", "playback.overlay": "彈幕", "playback.more": "播放設定", - "playback.pictureFit": "畫面顯示", "playback.viewControls": "觀看選項", "playback.windowControls": "播放器視窗", "playback.changeFit": "切換畫面調整", @@ -750,9 +730,6 @@ export const zhHant = { "playback.fit.contain": "完整顯示", "playback.fit.cover": "依比例填滿", "playback.fit.fill": "延展填滿", - "playback.fitFull": "保留完整畫面與原始比例。", - "playback.fitCrop": "依原始比例填滿,邊緣可能會被裁切。", - "playback.fitStretch": "延展至播放器大小,畫面比例可能會改變。", "playback.route.auto": "自動", "playback.route.p2p": "僅 P2P", "playback.route.sfu": "僅 SFU", @@ -792,7 +769,6 @@ export const zhHant = { "debug.exportFailed": "診斷下載失敗,請重試", "brand.home": "Piik 首頁", "help.title": "說明", - "help.hint": "說明、診斷與版本資訊", "help.troubleshooting": "疑難排解", "common.roomCode": "房間代碼", "host.roomCodePending": "開始分享後產生房間代碼", @@ -812,17 +788,13 @@ export const zhHant = { "common.disable": "關閉{name}", "common.increase": "增大{name}", "common.decrease": "減小{name}", - "host.join.hide": "收起加入房間", "host.advanced.hide": "收起分享設定", - "host.password.settingsHide": "收起密碼設定", "host.sourcePicker.audioOn": "分享聲音", "host.sourcePicker.audioOff": "停止分享聲音", "host.sourcePicker.audioLocked": "切換來源時保持原來的聲音分享狀態", "common.viewers": "觀眾", "common.you": "你", "common.host": "房主", - "common.name.viewerDefault": "觀眾", - "common.name.hostDefault": "房主", "client.launch.title": "開啟 Piik", "client.launch.version": "目前版本 {version}", "client.launch.local": "區域網路使用", @@ -865,10 +837,6 @@ export const zhHant = { "client.connect.navigationUnsupported": "此 App 使用瀏覽器介面,請繼續在目前網頁使用。", "client.connect.navigationPopupBlocked": "無法開啟新視窗。請允許此站點開啟新視窗後再試。", "client.connect.approving": "正在等待 App 授權…", - "client.connect.standby": "App 已就緒", - "client.connect.guide": "如何連線站點", - "client.connect.addSite": "開啟站點", - "client.connect.addSiteHint": "輸入 Piik 站點網址,再確認它使用 App 的權限。", "client.bookmarks.title": "收藏的站點", "client.launcher.manageSites": "站點管理", "client.sites.title": "站點管理", @@ -909,8 +877,6 @@ export const zhHant = { "client.connect.siteAddress": "站點網址", "client.connect.continue": "繼續", "client.connect.openSite": "開啟站點", - "client.connect.approveAndOpen": "允許並開啟", - "client.connect.standbyHint": "在 Piik 站點右上角點選 App,選擇「開啟 App 頁面」,再確認「允許使用」。", "client.connect.openOnStart": "啟動 App 時開啟此站點", "client.connect.openOwnedOnStart": "啟動 App 時開啟我的站點({mode})", "client.connect.manage": "App 已就緒,點選管理。", @@ -979,26 +945,11 @@ export const zhHant = { "client.update.releasePage": "查看原始發布頁", "client.update.differentBuild": "目前構建與官方發行版不同", "client.update.official": "可取得 Piik 正式發行版", - "gate.title": "站點存取", - "gate.hint": "請輸入站點口令", - "gate.password": "站點口令", - "gate.submit": "進入站點", "gate.checking": "正在驗證站點存取", - "gate.wrong": "站點口令不正確,請重試", - "gate.unavailable": "暫時無法驗證站點存取", - "gate.malformed": "房間代碼格式不正確", - "gate.malformedHint": "請輸入 1000 至 9999 的四位房間代碼", - "gate.unavailableRoute": "無法存取", "startup.failed": "頁面未能載入", "startup.retry": "請重新整理頁面後重試。", "join.title": "加入房間", - "join.hint": "輸入 {site} 的房間代碼", - "join.submit": "加入", "join.password": "房間密碼", - "join.passwordError": "無法加入房間,請重試", - "join.passwordRule": "請輸入 1-{max} 個可見字元", - "join.passwordAction": "輸入房間密碼", - "join.full": "房間已滿", "host.title": "{name} 的螢幕", "host.start": "開始分享", "host.sourcePicker.title": "選擇分享來源", @@ -1013,8 +964,6 @@ export const zhHant = { "host.commentary.unavailable": "麥克風混音不可用,畫面和源聲音仍可繼續分享。", "host.commentary.description": "將你的聲音加入分享畫面,不需要加入房間語音。", "host.commentary.duplicate": "分享與語音都已開啟麥克風。若出現回音或其中一路沒有聲音,請關閉其中一路。", - "host.commentary.failed": "分享麥克風未能開啟,請檢查權限和所選裝置。", - "host.audioInput.stopped": "一項聲音輸入已停止,畫面分享繼續。", "host.commentary.device": "分享麥克風", "host.commentary.volume": "分享麥克風音量", "voice.output.permissionHint": "目前只顯示系統預設裝置。如需查看其他裝置,請在瀏覽器的本站權限中允許使用麥克風,再重新整理裝置清單。", @@ -1032,7 +981,6 @@ export const zhHant = { "host.device.refresh": "重新整理裝置", "host.device.listFailed": "暫時無法取得裝置,請重新整理重試。", "host.device.permission.microphone": "開啟麥克風並允許存取後,可以在這裡選擇裝置。", - "host.microphone.volume": "麥克風音量", "host.microphone.voiceProcessing": "降噪與回聲消除", "host.microphone.voiceProcessingHint": "開啟後由瀏覽器降低雜音、消除回聲並自動調節音量;輸入裝置已有語音處理時可關閉。", "interaction.open": "互動", @@ -1049,8 +997,6 @@ export const zhHant = { "stats.avgRttHint": "到對端或 SFU 的平均往返時間,連線不重復計數。", "stats.totalBitrateHint": "目前方向各路位元率之和。", "stats.avgLossHint": "各路最新上報封包遺失率的平均值。", - "stats.audioPresent": "已包含", - "stats.audioAbsent": "未包含", "stats.droppedHint": "目前取樣期間捨棄的影格數。", "stats.inputFpsHint": "交給編碼器的影格率。", "stats.pictureSend": "畫面傳送", @@ -1067,17 +1013,9 @@ export const zhHant = { "voice.listeningVolume": "總收聽音量", "voice.personVolume": "個人音量", "voice.listenPerson": "收聽此人", - "voice.deafen": "暫停收聽", - "voice.undeafen": "恢復收聽", - "voice.deafenHint": "僅暫停你這裡的語音播放,麥克風與轉發繼續。", - "voice.undeafenHint": "恢復房間語音收聽,不改變麥克風狀態。", "voice.leave.short": "退出", "voice.listening.short": "收聽", "voice.leave": "退出語音", - "voice.microphoneOn": "開啟麥克風", - "voice.microphoneOff": "關閉麥克風", - "voice.muteForMe": "本機靜音", - "voice.unmuteForMe": "恢復聲音", "voice.participant": "參與者", "voice.outside": "尚未加入語音", "voice.microphoneInactive": "麥克風已關閉", @@ -1086,14 +1024,8 @@ export const zhHant = { "voice.microphoneActive": "麥克風已開啟", "voice.bitrate": "房間語音位元率", "voice.bitrateHint": "房主統一調整語音上限,實際位元率隨發言與網路變化。可填寫 {min}–{max} kbps。", - "host.sourceAudio.unavailable": "來源聲音已停止,畫面分享繼續。", "voice.error.microphoneDenied": "未獲得麥克風權限,請允許存取後重試。", "voice.error.microphoneUnavailable": "此頁面無法使用麥克風,請透過 HTTPS 或本機地址存取。", - "voice.error.microphoneMissing": "沒有找到可用的麥克風。", - "voice.error.microphoneFailed": "未能開啟麥克風,請重試。", - "voice.error.transport": "語音未能連線,房間仍可使用。請換個網路或瀏覽器重試。", - "voice.error.rejected": "語音操作未獲接受,請重新加入語音後重試。", - "voice.error.closed": "房主尚未開啟房間語音。", "voice.mode.failed": "此瀏覽器無法使用按鍵說話和語音啟動,請改用開放麥克風。", "interaction.settings": "聊天設定", "interaction.feedbackSounds": "提示與互動聲音", @@ -1182,7 +1114,6 @@ export const zhHant = { "host.sourcePicker.excludeAudio": "排除應用程式聲音", "host.sourcePicker.refreshApplications": "重新整理應用程式清單", "host.sourcePicker.excludeListFailed": "無法取得應用程式清單,請重新整理重試。", - "host.fail.sourceAudio": "未能更新來源聲音,請重試", "host.sourcePicker.excludeNone": "不排除", "host.sourcePicker.excludeMissing": "不在清單中,請重新選擇", "host.sourcePicker.excludeAudioChoose": "選擇要排除聲音的應用程式視窗;若應用程式未列出,請先開啟它的視窗,再重新整理。", @@ -1194,12 +1125,7 @@ export const zhHant = { "host.sourcePicker.unsupported": "目前設定無法透過 App 分享畫面,請更換編碼或使用瀏覽器分享。", "host.sourcePicker.failed": "無法讀取來源清單,請重新整理重試。", "native.incompatible": "App 與頁面不相容,請更新 App 並重新整理頁面。", - "native.fail.browserMedia": "瀏覽器無法建立媒體連線,請重新整理頁面重試。", - "native.fail.signaling": "Piik App 信令失敗", - "native.fail.receiver": "Piik App 媒體接收失敗", "native.fail.requestTimeout": "Piik App 回應逾時,請稍後重試。", - "native.fail.invalidResponse": "無法辨識 Piik App 回傳的資料。請更新 App 並重新整理頁面。", - "native.fail.edgePrepare": "Piik App 未能準備媒體連線。請開啟診斷後重試。", "shareHelp.open": "點選狀態燈查看排解方法", "shareHelp.guide": "開啟疑難排解文件", "host.sourcePicker.window": "分享視窗:{title}", @@ -1211,7 +1137,6 @@ export const zhHant = { "host.sourcePicker.loading": "正在尋找分享來源", "host.join": "加入房間", "host.starting": "正在連線", - "host.cancelStart": "取消", "host.live": "分享中", "host.paused": "已暫停", "host.ended": "已停止分享", @@ -1219,7 +1144,6 @@ export const zhHant = { "host.pause": "暫停分享", "host.resume": "恢復分享", "host.switchSource": "切換來源", - "host.switching": "正在選擇", "host.stop": "停止分享", "host.noAudio": "未分享來源聲音", "host.localPreviewPaused": "本機預覽已暫停,分享仍在繼續", @@ -1227,42 +1151,21 @@ export const zhHant = { "host.previewAutoPause": "自動暫停預覽", "host.previewAutoPauseHint": "切換分頁或視窗時暫停本機預覽,分享仍繼續;第二螢幕觀看時可關閉。", "host.pauseNotice": "影音分享已暫停", - "host.stopNotice": "已停止分享", - "host.roomReplaced": "房間代碼已更換", "host.roomReplace": "更換房間代碼", "host.roomReplaceConfirm": "確認更換房間代碼:目前分享會結束,觀眾需要重新加入", - "host.terminated.stale": "頁面版本已更新,請重新整理後重試", - "host.terminated.session": "連線已由另一個頁面接管,請前往該頁繼續", - "host.terminated.signal": "伺服器連線已終止,請重新整理後重試", "host.notice.qualityApplied": "分享設定已套用", - "host.notice.qualitySet": "畫質已切換為 {label}", - "host.notice.audioSet": "音訊位元率上限已設為 {kbps} kbps", - "host.notice.partialApply": "分享設定已更新,但部分觀看連線未能套用新參數", - "host.notice.sourceSwitch.ok": "分享來源已切換", - "host.notice.sourceSwitch.partial": "分享來源已切換,但{warning}", "host.name": "暱稱", - "host.nameSave": "儲存暱稱", - "host.nameCancel": "取消編輯暱稱", "host.nameEdit": "編輯暱稱", - "host.nameError": "暱稱格式無效或超過 24 個字元", - "host.nameOffline": "暱稱已儲存,連線恢復後同步給其他人", "host.invite": "邀請連結", "host.invite.copy": "複製邀請連結", - "host.invite.copyFailed": "無法複製連結,請稍後重試", "host.invite.rotate": "更新邀請連結;使用舊連結的觀眾需要重新加入", "host.invite.revoke": "撤銷邀請連結,並中斷透過該連結加入的觀眾", "host.invite.rotateShort": "更新連結", "host.invite.revokeShort": "撤銷連結", - "host.invite.updated": "邀請連結已更新", - "host.invite.revoked": "邀請連結已撤銷", - "host.invite.emptyOpen": "暫無邀請連結,仍可憑房間代碼加入", "host.invite.address": "房間網址", - "host.invite.copyAddress": "複製房間網址", "host.invite.includeCredential": "免密碼邀請", "host.invite.credentialHint": "收到連結即可加入此房間", "host.invite.credentialRequired": "目前僅限邀請,請開啟免密碼邀請", - "host.invite.emptyPassword": "暫無邀請連結,仍可憑房間代碼和密碼加入", - "host.invite.emptyPrivate": "暫無邀請連結,請先更新連結再邀請他人", "host.policy": "準入方式", "host.policy.open": "公開", "host.policy.private": "私密", @@ -1276,20 +1179,10 @@ export const zhHant = { "host.policy.setPrivateInvite": "房間已設為私密,僅限邀請加入", "host.policy.setPrivatePassword": "房間已設為私密,可憑邀請或密碼加入", "host.password.set": "房間密碼已設定", - "host.password.unset": "房間密碼未設定", - "host.password.placeholder": "設定後可憑房間代碼加入", "host.password.setAction": "設定房間密碼", - "host.password.changeAction": "更改房間密碼", - "host.password.remove": "移除房間密碼", "host.password.show": "顯示房間密碼", "host.password.hide": "隱藏房間密碼", - "host.password.saved": "房間密碼已設定", - "host.password.updated": "房間密碼已更新", - "host.password.removed": "房間密碼已移除,僅限邀請加入", - "host.password.rule": "房間密碼只需 1-{max} 個可見字元", - "host.accessFailed": "目前無法更新房間設定,請稍後重試", "host.viewers.empty": "暫無觀眾", - "host.quality": "畫質預設", "host.quality.light": "輕量", "host.quality.hd": "高畫質", "host.quality.highFps": "高影格率", @@ -1373,7 +1266,6 @@ export const zhHant = { "host.details.hide": "隱藏連線詳細資訊", "host.topology": "連線拓撲", "host.topology.show": "顯示連線拓撲", - "host.topology.hide": "隱藏連線拓撲", "host.topology.pending": "連線中", "state.signal.connected": "伺服器已連線", "state.signal.connecting": "正在連線", @@ -1388,7 +1280,6 @@ export const zhHant = { "state.route.p2p": "P2P 直連", "state.route.sfu": "伺服器中轉", "stats.title": "連線資料", - "stats.downstream": "下游接收資料", "stats.more": "詳細指標", "stats.group.network": "網路", "stats.group.encoding": "編碼", @@ -1429,7 +1320,6 @@ export const zhHant = { "stats.audioConcealedRate": "音訊補償率", "stats.audioConcealed": "音訊補償", "viewer.title": "{name} 的螢幕", - "viewer.titleFallback": "好友螢幕", "viewer.title.watching": "觀看中", "viewer.title.waiting": "等待中", "viewer.reconnect": "重新連線", @@ -1438,7 +1328,6 @@ export const zhHant = { "viewer.msg.joining": "正在加入房間", "viewer.msg.waitingHost": "等待開始分享", "viewer.msg.preparingP2p": "正在建立 P2P", - "viewer.msg.connectionRetry": "正在重試({current}/{total})", "viewer.msg.preparingSfu": "正在連線伺服器中轉", "viewer.msg.allocating": "正在分配線路", "viewer.msg.receiving": "正在接收畫面", @@ -1456,20 +1345,11 @@ export const zhHant = { "viewer.msg.invalidInvite": "邀請連結無效或已失效", "viewer.msg.closed": "房間已關閉", "viewer.msg.full": "房間已滿", - "viewer.msg.accessFailed": "暫時無法加入房間", - "viewer.hint.accessFailed": "重新整理頁面後重試,或使用房主發來的邀請連結。", - "viewer.hint.full": "等有空位後再試。", "viewer.msg.stale": "頁面版本已更新,請重新整理後重試", "viewer.msg.sessionReplaced": "連線已由另一個頁面接管", "viewer.msg.signalTerminated": "連線已終止,請重新整理後重試", "viewer.notice.signalRecovering": "伺服器連線正在恢復", "viewer.notice.hostOffline": "房主連線已中斷,畫面可能停住", - "viewer.hint.denied": "請使用房主發來的邀請連結,或輸入房間密碼。", - "viewer.hint.notFound": "請確認這是 {site} 的房間代碼,或開啟房主的邀請連結。", - "viewer.hint.closed": "請讓房主重新建立房間並傳送邀請。", - "viewer.hint.sessionReplaced": "請前往另一頁面繼續,或重新整理本頁重新連線。", - "viewer.hint.invite": "請讓房主重新傳送邀請連結。", - "viewer.hint.generic": "請稍後重新整理頁面重試。", "mode.language": "介面語言", "mode.more": "更多語言", "header.more": "更多選項", @@ -1477,69 +1357,17 @@ export const zhHant = { "theme.light": "切換為淺色模式", "theme.dark.short": "深色", "theme.light.short": "淺色", - "gate.connectFailed": "無法連線站點,請檢查網路後重試", - "gate.expired": "站點存取已失效,請重新驗證", - "gate.serviceUnavailable": "站點服務暫不可用 ({status}),請稍後重試", "host.notStarted": "尚未開始", - "host.startCancelled": "啟動已取消", - "host.switchingSource": "正在切換來源", "host.stageAria": "分享或加入房間", - "host.captureAria": "實際擷取參數", "host.quality.title": "{label} · {mbps} Mbps", "host.audio.title": "{label} · {kbps} kbps 上限", - "host.roomClosed": "房間已關閉", - "host.pause.noTracksResume": "無法恢復分享,請重新選擇來源", - "host.pause.signalRecovering": "伺服器連線正在恢復,分享仍保持暫停", - "host.pause.noTracksPause": "無法暫停分享,請重新選擇來源", - "host.pause.stillPaused": "分享仍保持暫停", - "host.shareEnded": "目前分享已經結束", "host.fail.start": "啟動分享失敗", - "host.err.createConnection": "建立連線失敗", - "host.err.codecUnsupported": "瀏覽器不支援所需的視訊編碼,請更新或更換瀏覽器", - "host.fail.source": "切換分享來源失敗", - "host.fail.quality": "套用畫質設定失敗", - "host.fail.room": "房間操作失敗", - "host.err.invalidToken": "分享憑證已失效,請重新建立房間", - "host.err.accessDenied": "目前操作沒有權限", - "host.err.alreadyConnected": "此房間已在另一個頁面中分享", - "host.err.peerGone": "對應的觀看連線已經離開", - "host.err.forbidden": "目前操作不可用", - "host.err.serverError": "服務暫時不可用,請稍後重試", - "host.err.createRoomStatus": "目前無法建立房間 ({status})", - "host.err.roomCapacity": "站點房間代碼已用滿,請稍後重試或使用其他 Piik 站點。", - "host.err.replaceRoomStatus": "目前無法更換房間 ({status})", - "host.err.updateRoomStatus": "目前無法更新房間設定 ({status})", "host.capture.noSource": "沒有可用的螢幕分享來源", - "host.capture.readFailed": "無法讀取所選分享來源,請重新選擇來源", - "host.capture.unavailable": "目前頁面無法啟動螢幕分享", - "host.capture.inactive": "請回到目前頁面,再點選分享並選擇來源。", - "host.capture.constraints": "所選來源無法滿足目前畫面設定。請降低設定或換一個來源。", - "host.notice.reconnecting": "部分觀眾正在重新連線", - "host.notice.sfuRecovering": "伺服器中轉的畫面來源未切換成功,正在恢復觀看連線", - "host.password.inputPlaceholder": "輸入密碼", "stats.warn.codec": "視訊編碼為 {codec},預期 H264 或 VP8", "stats.warn.audioCodec": "音訊編碼為 {codec},預期 Opus", "viewer.msg.joinUnavailable": "暫時無法加入房間", - "viewer.stageAria": "共享畫面", - "host.warn.audioUnread": "瀏覽器未讀回音訊位元率上限", - "host.warn.param.scaleResolutionDownBy": "解析度縮放", - "host.warn.param.degradationPreference": "品質優先級", - "host.warn.param.scalabilityMode": "可擴充模式", - "host.warn.sfuRecover": "伺服器中轉{params}失敗,已啟動自動恢復", - "host.warn.sfuStage.connect": "連線", - "host.warn.sfuStage.source": "分享來源", - "host.warn.sfuStage.videoPublish": "視訊發布", - "host.warn.sfuStage.senderConfig": "影片參數組態", - "host.warn.sfuStage.audioPublish": "音訊發布", - "host.warn.sfuStage.transport": "傳輸", - "host.fail.sfuAudioParams": "套用伺服器中轉的音訊參數失敗", - "client.connect.replace": "將替換 {site},並中斷它的 App 連線。", "voice.offline": "已中斷連線", "interaction.effects": "顯示互動動效", - "host.capture.fpsUnknown": "影格率未知", - "host.capture.codecPending": "編碼待定", - "host.capture.hasAudio": "含來源音訊", - "host.capture.noAudio": "無來源音訊", } satisfies Partial>; export const zhHantTitleFrames: TitleFrameCatalog = { diff --git a/src/client/locales/zh.ts b/src/client/locales/zh.ts index 469db8735..689b021be 100644 --- a/src/client/locales/zh.ts +++ b/src/client/locales/zh.ts @@ -17,17 +17,14 @@ export const zh = { "watch.forward.noVideoTrack": "没有可转发的视频轨道。你仍可在原网页中观看。", "watch.forward.videoOnly": "仅画面,不带声音", "watch.forward.trackUnavailable": "部分来源未能读取或当前不支持。可以选择其余轨道。", - "watch.forward.selected": "将转发:{video} + {audio}", "watch.forward.confirmTracks": "确认并开始转发", "watch.forward.channels": "{count} 声道", "watch.viewersCount": "已加入观看:{count} 人", "watch.joined": "已加入观看", "watch.noViewers": "还没有其他人加入观看。", "watch.browserSource.title": "选择播放来源", - "watch.browserSource.help": "直接播放由观众各自访问视频来源;通过 App 转发由本机读取视频并使用上传带宽。", "watch.browserSource.skip": "同步网页里的视频", "watch.browserSource.originalHelp": "你和观众都用支持网页播放的 Piik App 打开同一网页。各自从网站加载视频,跟随你的播放器同步。", - "watch.browserSource.selectNamed": "在 Piik 中播放 {name}", "watch.forward.title": "转发原始视频", "watch.forward.upload": "使用本机上传带宽,通过房间连接发送原始视频。", "watch.forward.active": "已开启转发。停止转发会保留网页播放。", @@ -35,8 +32,6 @@ export const zh = { "watch.forward.prepare": "选择要转发的视频", "watch.forward.choose": "选择原始视频资源。确认后开始使用本机上传带宽。", "watch.forward.enableNamed": "转发 {name}", - "watch.forward.shareFile": "分享这个视频", - "watch.forward.shareFileHelp": "房间成员会收到视频链接,可从网站直接播放;从你的 App 接收时会使用你的上传带宽。", "watch.forward.none": "此网页暂未发现可转发的视频资源。", "watch.forward.peer": "从分享者接收", "watch.forward.direct": "从网站直接播放", @@ -88,7 +83,6 @@ export const zh = { "room.chat.export": "导出文字记录(TXT)", "room.chat.purgeHistory": "清空房间记录", "room.chat.confirmPurgeHistory": "永久清空“{name}”的所有消息及附件?已下载的文件仍会保留。", - "room.common.user": "用户", "room.relay.webpage": "此网页", "room.relay.app": "已连接 App", "channel.forwarding.title": "协助转发", @@ -99,7 +93,6 @@ export const zh = { "room.relay.appUnavailable": "暂时无法读取 App 的转发设置。", "room.relay.route": "个", "room.relay.routes": "个", - "room.relay.followDefault": "跟随房间默认", "room.create.appHostedNote": "App 运行时托管这个房间。", "room.create.browserHostedNote": "由此网页托管,关闭网页后房间暂停。", "room.hosting.restoreFailed": "未能重新打开此浏览器托管的房间", @@ -160,7 +153,6 @@ export const zh = { "room.action.remove": "从列表移除", "room.settings.confirmDelete": "删除“{name}”及其聊天记录?已下载的文件保留。若托管端已离线,则仅从列表中移除。", "room.settings.confirmRemove": "从本站房间目录中移除“{name}”?移除后无法从本站进入,房间数据仍保留在托管端。", - "room.settings.device": "本机连接", "room.settings.recordsTitle": "记录与备份", "room.settings.browserStoragePersistent": "浏览器已保护此房间的记录,存储空间不足时不会自动清理。", "room.settings.browserStorageBestEffort": "存储空间不足时,浏览器可能会清理此房间的记录。", @@ -294,12 +286,8 @@ export const zh = { "screen.unplayable": "浏览器无法播放分享画面。", "screen.deliveryRetry": "画面传输失败,正在重试。", "screen.pictureHelp": "画面帮助", - "screen.pictureHelpViewer": "点击“重新连接画面”。如果仍然失败,试试其他网络。", - "screen.pictureHelpPublisher": "请分享者检查本地预览,必要时重新选择分享来源。", - "screen.pictureHelpForwarding": "如果站点运营者提供转发服务,房间管理员可在房间设置中开启“{setting}”。", "screen.connectingPicture": "正在连接画面", "screen.focusNamed": "聚焦 {title}", - "screen.returnToGrid": "返回平铺", "screen.sharingControls": "{title}的分享控制", "screen.stopSharing": "停止分享 {title}", "screen.shareEnded": "{name} 的这路分享已结束", @@ -307,7 +295,6 @@ export const zh = { "screen.availableScreens": "可观看的画面", "screen.availableToWatch": "正在分享", "screen.watch": "观看", - "screen.changeLayout": "切换画面布局", "screen.waitingPicture": "等待画面", "screen.playNamed": "播放 {label}", "screen.directLimit": "直连接收端上限", @@ -355,7 +342,6 @@ export const zh = { "channel.backupControls.roomRestoredWithoutFiles": "房间与聊天记录已恢复,部分文件未能缓存。关闭本页前,请保存仍可读取且需要保留的文件,无需再次恢复。", "channel.attachment.thumbnail": "缩略图", "channel.attachment.loadingOriginalImage": "正在加载原图…", - "channel.attachment.originalLoadFailed": "暂时无法加载原图。", "channel.attachment.cancelDownload": "取消下载", "channel.attachment.savedCopyMissing": "找不到本机保存的文件。", "channel.attachment.revealSavedFailed": "无法在文件资源管理器中显示已保存的文件。", @@ -416,7 +402,6 @@ export const zh = { "channel.inviteQrCode.generationFailed": "无法生成二维码,请复制邀请链接。", "channel.inviteQrCode.saveImage": "保存图片", "channel.inviteQrCode.saveFailed": "图片未能保存,请重试。", - "channel.inviteQrCode.close": "关闭", "channel.joinVoice.voiceJoined": "语音已加入", "channel.mentionSuggestions.mentionSomeone": "提及用户", "channel.mentionSuggestions.users": "用户", @@ -511,13 +496,11 @@ export const zh = { "channel.voiceDock.voiceJoined": "语音已加入", "channel.voiceDock.voiceConnecting": "正在接通语音…", "channel.voiceDock.voiceConnected": "语音已接通", - "channel.voiceDock.openRoom": "打开「{name}」", "channel.invitationLink.copied": "已复制", "channel.invitationLink.copyInvitation": "复制邀请", "channel.invitationLink.copyFailed": "请手动复制上方链接。", "channel.invitationLink.qrCode": "二维码", "channel.previewPage.screenSharing": "屏幕共享", - "channel.previewPage.user": "用户", "channel.previewPage.connected": "站点已连接", "channel.previewPage.connecting": "正在连接", "channel.previewPage.reconnecting": "正在重连", @@ -534,7 +517,6 @@ export const zh = { "channel.previewPage.viewTools": "视图工具", "channel.previewPage.ongoingScreens": "进行中的画面", "channel.previewPage.stillSharing": "仍在分享", - "channel.previewPage.stillWatching": "已加入观看", "channel.previewPage.returnToRoom": "返回 {value}", "channel.previewPage.return": "返回", "channel.previewPage.stopSharingSource": "停止分享 {title}", @@ -586,10 +568,8 @@ export const zh = { "watch.inWindow": "视频使用独立网页窗口播放。", "watch.inWindowSource": "视频在独立网页窗口播放,关闭它会结束同步观看。", "watch.focusWindow": "返回播放窗口", - "watch.inApp": "在 App 观看", "watch.browserFailed": "此网页的视频无法直接在当前浏览器播放。", "watch.sharedControls": "所有人的播放进度", - "watch.localControls": "你的声音与窗口", "watch.seek": "所有人的播放进度", "watch.rate": "所有人的播放速度", "watch.following": "播放进度由分享者控制,音量只影响你自己。", @@ -601,7 +581,6 @@ export const zh = { "watch.live": "直播中", "watch.ended": "已结束", "watch.goLive": "回到直播", - "watch.forward.fromApp": "通过 App 转发", "watch.sourceAccessRequired": "此来源暂时无法准备为同步播放视频。", "watch.liveDelay": "落后直播 {seconds} 秒", "watch.liveRemaining": "距结束 {seconds} 秒", @@ -744,7 +723,6 @@ export const zh = { "remote.leftStick": "左摇杆", "remote.directionPad": "WASD 方向摇杆", "remote.touchHelp": "双指轻点右击,捏合缩放。双指滑动默认滚动;缩放后或展开虚拟鼠标时改为平移画面。", - "remote.resetZoom": "还原画面大小", "remote.key.Escape": "退出键", "remote.key.Tab": "制表键", "remote.key.ArrowLeft": "向左", @@ -857,7 +835,6 @@ export const zh = { "playback.showControls": "显示播控", "playback.overlay": "弹幕", "playback.more": "播放设置", - "playback.pictureFit": "画面显示", "playback.viewControls": "观看选项", "playback.windowControls": "播放器窗口", "playback.changeFit": "切换画面适配", @@ -874,9 +851,6 @@ export const zh = { "playback.fit.contain": "完整显示", "playback.fit.cover": "等比铺满", "playback.fit.fill": "拉伸铺满", - "playback.fitFull": "保留完整画面与原始比例。", - "playback.fitCrop": "保持比例铺满,边缘可能被裁切。", - "playback.fitStretch": "拉伸至播放器大小,画面比例可能改变。", "playback.route.auto": "自动", "playback.route.p2p": "仅 P2P", "playback.route.sfu": "仅 SFU", @@ -916,7 +890,6 @@ export const zh = { "debug.exportFailed": "诊断下载失败,请重试", "brand.home": "Piik 首页", "help.title": "帮助", - "help.hint": "帮助、诊断与版本信息", "help.troubleshooting": "问题排查", "common.roomCode": "房间号", @@ -937,17 +910,13 @@ export const zh = { "common.disable": "关闭{name}", "common.increase": "增大{name}", "common.decrease": "减小{name}", - "host.join.hide": "收起加入房间", "host.advanced.hide": "收起分享设置", - "host.password.settingsHide": "收起密码设置", "host.sourcePicker.audioOn": "分享声音", "host.sourcePicker.audioOff": "停止分享声音", "host.sourcePicker.audioLocked": "切换来源时保持原来的声音分享状态", "common.viewers": "观众", "common.you": "你", "common.host": "房主", - "common.name.viewerDefault": "观众", - "common.name.hostDefault": "房主", "client.launch.title": "打开 Piik", "client.launch.version": "当前版本 {version}", @@ -993,10 +962,6 @@ export const zh = { "client.connect.navigationUnsupported": "此 App 使用浏览器界面,请继续在当前网页使用。", "client.connect.navigationPopupBlocked": "未能打开新窗口。请允许此站点打开新窗口后重试。", "client.connect.approving": "正在等待 App 授权…", - "client.connect.standby": "App 已就绪", - "client.connect.guide": "如何连接站点", - "client.connect.addSite": "打开站点", - "client.connect.addSiteHint": "输入 Piik 站点地址,再确认其 App 使用权限。", "client.bookmarks.title": "收藏的站点", "client.sites.title": "站点管理", "client.sites.hint": "收藏常用站点,也可以在站点详情中管理 App 权限和启动设置。", @@ -1039,8 +1004,6 @@ export const zh = { "client.connect.siteAddress": "站点地址", "client.connect.continue": "继续", "client.connect.openSite": "打开站点", - "client.connect.approveAndOpen": "允许并打开", - "client.connect.standbyHint": "在 Piik 站点右上角点击 App,选择「打开 App 页面」,再确认「允许使用」。", "client.connect.openOnStart": "启动 App 时打开此站点", "client.connect.openOwnedOnStart": "启动 App 时打开我的站点({mode})", "client.connect.manage": "App 已就绪,点击管理。", @@ -1120,29 +1083,14 @@ export const zh = { "client.update.differentBuild": "当前构建与官方发行版不同", "client.update.official": "可获取 Piik 正式发行版", - "gate.title": "站点访问", - "gate.hint": "请输入站点口令", - "gate.password": "站点口令", - "gate.submit": "进入站点", "gate.checking": "正在验证站点访问", - "gate.wrong": "站点口令不正确,请重试", - "gate.unavailable": "暂时无法验证站点访问", - "gate.malformed": "房间号格式不正确", - "gate.malformedHint": "请输入 1000 至 9999 的四位房间号", - "gate.unavailableRoute": "无法访问", "navigation.linkUnavailable": "链接不可用", "navigation.askInvitation": "如需加入房间,请向房主索取新邀请。", "startup.failed": "页面未能加载", "startup.retry": "请刷新页面后重试。", "join.title": "加入房间", - "join.hint": "输入 {site} 的房间号", - "join.submit": "加入", "join.password": "房间密码", - "join.passwordError": "无法加入房间,请重试", - "join.passwordRule": "请输入 1-{max} 个可见字符", - "join.passwordAction": "输入房间密码", - "join.full": "房间已满", "host.title": "{name} 的屏幕", "host.start": "开始分享", @@ -1158,8 +1106,6 @@ export const zh = { "host.commentary.unavailable": "麦克风混音不可用,画面和源声音仍可继续分享。", "host.commentary.description": "将你的声音加入分享画面,无需加入房间语音。", "host.commentary.duplicate": "分享麦克风随画面发给观众,房间语音麦克风发给语音房里的人。若听到回声,可以试着关闭其中一路。", - "host.commentary.failed": "分享麦克风未能开启,请检查权限和所选设备。", - "host.audioInput.stopped": "一项声音输入已停止,画面分享继续。", "host.commentary.device": "分享麦克风", "host.commentary.volume": "分享麦克风音量", "voice.output.permissionHint": "允许此页面使用麦克风后,刷新列表即可显示其他播放设备。", @@ -1177,7 +1123,6 @@ export const zh = { "host.device.refresh": "刷新设备", "host.device.listFailed": "暂时无法获取设备,请刷新重试。", "host.device.permission.microphone": "开启麦克风并允许访问后,可以在这里选择设备。", - "host.microphone.volume": "麦克风音量", "host.microphone.voiceProcessing": "降噪与回声消除", "host.microphone.voiceProcessingHint": "开启后由浏览器降低杂音、消除回声并自动调节音量;输入设备已有语音处理时可关闭。", "interaction.open": "互动", @@ -1195,8 +1140,6 @@ export const zh = { "stats.avgRttHint": "到对端或 SFU 的平均往返时间,连接不重复计数。", "stats.totalBitrateHint": "当前方向各路码率之和。", "stats.avgLossHint": "各路最新上报丢包率的平均值。", - "stats.audioPresent": "已包含", - "stats.audioAbsent": "未包含", "stats.droppedHint": "当前采样期间丢弃的视频帧数。", "stats.inputFpsHint": "交给编码器的视频帧率。", "stats.decodeFps": "解码帧率", @@ -1220,17 +1163,9 @@ export const zh = { "voice.listeningVolume": "总收听音量", "voice.personVolume": "个人音量", "voice.listenPerson": "收听此人", - "voice.deafen": "暂停收听", - "voice.undeafen": "恢复收听", - "voice.deafenHint": "仅暂停你这里的语音播放,麦克风与转发继续。", - "voice.undeafenHint": "恢复房间语音收听,不改变麦克风状态。", "voice.leave.short": "退出", "voice.listening.short": "收听", "voice.leave": "退出语音", - "voice.microphoneOn": "打开麦克风", - "voice.microphoneOff": "关闭麦克风", - "voice.muteForMe": "本地静音", - "voice.unmuteForMe": "恢复声音", "voice.participant": "参与者", "voice.outside": "尚未加入语音", "voice.microphoneInactive": "麦克风已关闭", @@ -1240,7 +1175,6 @@ export const zh = { "voice.cancelMicrophoneRequest": "取消开启麦克风", "voice.bitrate": "房间语音码率", "voice.bitrateHint": "房主统一调整语音上限,实际码率随发言与网络变化。可填写 {min}–{max} kbps。", - "host.sourceAudio.unavailable": "来源声音已停止,画面分享继续。", "voice.noise.enhanced": "增强麦克风降噪", "voice.noise.enhancedHint": "将人声合为单声道处理,并保留浏览器回声消除;关闭后恢复原处理。", "voice.noise.unsupported": "当前音频配置无法启用增强降噪。请关闭此选项使用默认处理;若加入失败,再重新加入语音。", @@ -1248,11 +1182,6 @@ export const zh = { "voice.mode.failed": "此浏览器无法使用按键说话和语音激活,请改用开放麦克风。", "voice.error.microphoneDenied": "未获得麦克风权限,请允许访问后重试。", "voice.error.microphoneUnavailable": "此页面无法使用麦克风,请通过 HTTPS 或本机地址访问。", - "voice.error.microphoneMissing": "没有找到可用的麦克风。", - "voice.error.microphoneFailed": "未能打开麦克风,请重试。", - "voice.error.transport": "语音未能连接,房间仍可使用。请换个网络或浏览器重试。", - "voice.error.rejected": "语音操作未获接受,请重新加入语音后重试。", - "voice.error.closed": "房主尚未开启房间语音。", "interaction.settings": "聊天设置", "interaction.feedbackSounds": "提示与互动声音", "interaction.feedbackSoundsHint": "可分别开启后台消息提醒和投掷音效。", @@ -1340,7 +1269,6 @@ export const zh = { "host.sourcePicker.excludeAudio": "排除应用声音", "host.sourcePicker.refreshApplications": "刷新应用列表", "host.sourcePicker.excludeListFailed": "无法获取应用列表,请刷新重试。", - "host.fail.sourceAudio": "未能更新来源声音,请重试", "host.sourcePicker.excludeNone": "不排除", "host.sourcePicker.excludeMissing": "不在列表中,请重新选择", "host.sourcePicker.excludeAudioChoose": "要让房间语音留在通话里,请选择播放语音的应用窗口。找不到时,先打开该窗口,再刷新列表。", @@ -1352,12 +1280,7 @@ export const zh = { "host.sourcePicker.unsupported": "当前设置无法通过 App 分享画面,请更换编码或使用浏览器分享。", "host.sourcePicker.failed": "无法读取来源列表,请刷新重试。", "native.incompatible": "App 与页面不兼容,请更新 App 并刷新页面。", - "native.fail.browserMedia": "浏览器无法建立媒体连接,请刷新页面重试。", - "native.fail.signaling": "Piik App 信令失败", - "native.fail.receiver": "Piik App 媒体接收失败", "native.fail.requestTimeout": "Piik App 响应超时,请稍后重试。", - "native.fail.invalidResponse": "Piik App 返回的数据无法识别。请更新 App 并刷新页面。", - "native.fail.edgePrepare": "Piik App 未能准备媒体连接。请开启诊断后重试。", "shareHelp.open": "点击状态灯查看排查方法", "shareHelp.guide": "打开问题排查文档", "host.sourcePicker.window": "分享窗口:{title}", @@ -1369,7 +1292,6 @@ export const zh = { "host.sourcePicker.loading": "正在查找分享来源", "host.join": "加入房间", "host.starting": "正在连接", - "host.cancelStart": "取消", "host.live": "分享中", "host.paused": "已暂停", "host.ended": "已停止分享", @@ -1377,7 +1299,6 @@ export const zh = { "host.pause": "暂停分享", "host.resume": "恢复分享", "host.switchSource": "切换来源", - "host.switching": "正在选择", "host.stop": "停止分享", "host.noAudio": "未分享来源声音", "host.localPreviewPaused": "本地预览已暂停,分享仍在继续", @@ -1385,44 +1306,23 @@ export const zh = { "host.previewAutoPause": "自动暂停预览", "host.previewAutoPauseHint": "切换标签页或窗口时暂停本地预览,分享仍继续;副屏观看时可关闭。", "host.pauseNotice": "音视频分享已暂停", - "host.stopNotice": "已停止分享", - "host.roomReplaced": "房间号已更换", "host.roomReplace": "更换房间号", "host.roomReplaceConfirm": "确认更换房间号:当前分享会结束,观众需要重新加入", - "host.terminated.stale": "页面版本已更新,请刷新后重试", - "host.terminated.session": "会话已由另一页面接管,请前往该页继续", - "host.terminated.signal": "服务器连接已终止,请刷新后重试", "host.notice.qualityApplied": "分享设置已应用", - "host.notice.qualitySet": "画质已切换为 {label}", - "host.notice.audioSet": "音频码率上限已设为 {kbps} kbps", - "host.notice.partialApply": "分享设置已更新,但部分观看连接未能应用新参数", - "host.notice.sourceSwitch.ok": "分享来源已切换", - "host.notice.sourceSwitch.partial": "分享来源已切换,但{warning}", "host.name": "昵称", - "host.nameSave": "保存昵称", - "host.nameCancel": "取消编辑昵称", "host.nameEdit": "编辑昵称", - "host.nameError": "昵称格式无效或超过 24 个字符", - "host.nameOffline": "昵称已保存,连接恢复后同步给其他人", "host.invite": "邀请链接", "host.invite.copy": "复制邀请链接", - "host.invite.copyFailed": "无法复制链接,请稍后重试", "host.invite.rotate": "更新邀请链接;使用旧链接的观众需要重新加入", "host.invite.revoke": "撤销邀请链接,并断开通过该链接加入的观众", "host.invite.rotateShort": "更新链接", "host.invite.revokeShort": "撤销链接", - "host.invite.updated": "邀请链接已更新", - "host.invite.revoked": "邀请链接已撤销", - "host.invite.emptyOpen": "暂无邀请链接,仍可凭房间号加入", "host.invite.address": "房间地址", - "host.invite.copyAddress": "复制房间地址", "host.invite.includeCredential": "免密邀请", "host.invite.credentialHint": "收到链接即可加入此房间", "host.invite.credentialRequired": "当前仅限邀请,请开启免密邀请", - "host.invite.emptyPassword": "暂无邀请链接,仍可凭房间号和密码加入", - "host.invite.emptyPrivate": "暂无邀请链接,请先更新链接再邀请他人", "host.policy": "准入方式", "host.policy.open": "公开", @@ -1437,22 +1337,12 @@ export const zh = { "host.policy.setPrivateInvite": "房间已设为私密,仅限邀请加入", "host.policy.setPrivatePassword": "房间已设为私密,可凭邀请或密码加入", "host.password.set": "房间密码已设置", - "host.password.unset": "房间密码未设置", - "host.password.placeholder": "设置后可凭房间号加入", "host.password.setAction": "设置房间密码", - "host.password.changeAction": "更改房间密码", - "host.password.remove": "移除房间密码", "host.password.show": "显示房间密码", "host.password.hide": "隐藏房间密码", - "host.password.saved": "房间密码已设置", - "host.password.updated": "房间密码已更新", - "host.password.removed": "房间密码已移除,仅限邀请加入", - "host.password.rule": "房间密码只需 1-{max} 个可见字符", - "host.accessFailed": "当前无法更新房间设置,请稍后重试", "host.viewers.empty": "暂无观众", - "host.quality": "视频预设", "host.quality.light": "轻量", "host.quality.hd": "高清", "host.quality.highFps": "高帧率", @@ -1541,7 +1431,6 @@ export const zh = { "host.details.hide": "隐藏连接详情", "host.topology": "连接拓扑", "host.topology.show": "显示连接拓扑", - "host.topology.hide": "隐藏连接拓扑", "host.topology.pending": "连接中", "state.signal.connected": "服务器已连接", @@ -1558,7 +1447,6 @@ export const zh = { "state.route.sfu": "服务器中转", "stats.title": "连接数据", - "stats.downstream": "下游接收数据", "stats.more": "详细指标", "stats.group.network": "网络", "stats.group.encoding": "编码", @@ -1600,7 +1488,6 @@ export const zh = { "stats.audioConcealed": "音频补偿", "viewer.title": "{name} 的屏幕", - "viewer.titleFallback": "好友屏幕", "viewer.title.watching": "观看中", "viewer.title.waiting": "等待中", "viewer.reconnect": "重新连接", @@ -1609,7 +1496,6 @@ export const zh = { "viewer.msg.joining": "正在加入房间", "viewer.msg.waitingHost": "等待开始分享", "viewer.msg.preparingP2p": "正在建立 P2P", - "viewer.msg.connectionRetry": "正在重试({current}/{total})", "viewer.msg.preparingSfu": "正在连接服务器中转", "viewer.msg.allocating": "正在分配线路", "viewer.msg.receiving": "正在接收画面", @@ -1627,20 +1513,11 @@ export const zh = { "viewer.msg.invalidInvite": "邀请链接无效或已失效", "viewer.msg.closed": "房间已关闭", "viewer.msg.full": "房间已满", - "viewer.msg.accessFailed": "暂时无法加入房间", - "viewer.hint.accessFailed": "刷新页面后重试,或使用房主发来的邀请链接。", - "viewer.hint.full": "等有空位后再试。", "viewer.msg.stale": "页面版本已更新,请刷新后重试", "viewer.msg.sessionReplaced": "会话已由另一页面接管", "viewer.msg.signalTerminated": "连接已终止,请刷新后重试", "viewer.notice.signalRecovering": "服务器连接正在恢复", "viewer.notice.hostOffline": "房主连接已中断,画面可能停住", - "viewer.hint.denied": "请使用房主发来的邀请链接,或输入房间密码。", - "viewer.hint.notFound": "请确认这是 {site} 的房间号,或打开房主的邀请链接。", - "viewer.hint.closed": "请让房主重新创建房间并发送邀请。", - "viewer.hint.sessionReplaced": "请前往另一页面继续,或刷新本页重新连接。", - "viewer.hint.invite": "请让房主重新发送邀请链接。", - "viewer.hint.generic": "请稍后刷新页面重试。", "mode.language": "界面语言", "mode.more": "更多语言", @@ -1650,77 +1527,25 @@ export const zh = { "theme.dark.short": "暗色", "theme.light.short": "浅色", - "gate.connectFailed": "无法连接站点,请检查网络后重试", - "gate.expired": "站点访问已失效,请重新验证", - "gate.serviceUnavailable": "站点服务暂不可用 ({status}),请稍后重试", "host.notStarted": "尚未开始", - "host.startCancelled": "启动已取消", - "host.switchingSource": "正在切换来源", "host.stageAria": "分享或加入房间", - "host.captureAria": "实际捕获参数", "host.quality.title": "{label} · {mbps} Mbps", "host.audio.title": "{label} · {kbps} kbps 上限", - "host.roomClosed": "房间已关闭", - "host.pause.noTracksResume": "无法恢复分享,请重新选择来源", - "host.pause.signalRecovering": "服务器连接正在恢复,分享仍保持暂停", - "host.pause.noTracksPause": "无法暂停分享,请重新选择来源", - "host.pause.stillPaused": "分享仍保持暂停", - "host.shareEnded": "当前分享已经结束", "host.fail.start": "启动分享失败", - "host.err.createConnection": "创建连接失败", - "host.err.codecUnsupported": "浏览器不支持所需的视频编码,请更新或更换浏览器", - "host.fail.source": "切换分享来源失败", - "host.fail.quality": "应用画质设置失败", - "host.fail.room": "房间操作失败", - "host.err.invalidToken": "分享凭证已失效,请重新创建房间", - "host.err.accessDenied": "当前操作没有权限", - "host.err.alreadyConnected": "此房间已在另一个页面中分享", - "host.err.peerGone": "对应的观看连接已经离开", - "host.err.forbidden": "当前操作不可用", - "host.err.serverError": "服务暂时不可用,请稍后重试", - "host.err.createRoomStatus": "当前无法创建房间 ({status})", - "host.err.roomCapacity": "站点房间号已用满,请稍后重试或使用其他 Piik 站点。", - "host.err.replaceRoomStatus": "当前无法更换房间 ({status})", - "host.err.updateRoomStatus": "当前无法更新房间设置 ({status})", "host.capture.chooseInSystem": "请在系统窗口中选择要共享的画面。", "host.capture.preparingPicture": "正在准备选中的画面…", "host.capture.cancelPreparation": "取消本次准备", "host.capture.cancelPreparationHint": "取消本次准备不会停止已有共享。", "host.capture.noSource": "没有可用的屏幕分享来源", - "host.capture.readFailed": "无法读取所选分享来源,请重新选源", - "host.capture.unavailable": "当前页面无法启动屏幕分享", - "host.capture.inactive": "请回到当前页面,再点击分享并选择来源。", - "host.capture.constraints": "所选来源无法满足当前画面设置。请降低设置或换一个来源。", - "host.notice.reconnecting": "部分观众正在重新连接", - "host.notice.sfuRecovering": "服务器中转的画面来源未切换成功,正在恢复观看连接", - "host.password.inputPlaceholder": "输入密码", "stats.warn.codec": "视频编码为 {codec},预期 H264 或 VP8", "stats.warn.audioCodec": "音频编码为 {codec},预期 Opus", "viewer.msg.joinUnavailable": "暂时无法加入房间", - "viewer.stageAria": "共享画面", - "host.warn.audioUnread": "浏览器未读回音频码率上限", - "host.warn.param.scaleResolutionDownBy": "分辨率缩放", - "host.warn.param.degradationPreference": "质量优先级", - "host.warn.param.scalabilityMode": "伸缩模式", - "host.warn.sfuRecover": "服务器中转{params}失败,已启动自动恢复", - "host.warn.sfuStage.connect": "连接", - "host.warn.sfuStage.source": "分享源", - "host.warn.sfuStage.videoPublish": "视频发布", - "host.warn.sfuStage.senderConfig": "视频参数配置", - "host.warn.sfuStage.audioPublish": "音频发布", - "host.warn.sfuStage.transport": "传输", - "host.fail.sfuAudioParams": "应用服务器中转的音频参数失败", - "client.connect.replace": "将替换 {site},并断开它的 App 连接。", "voice.offline": "已断开连接", "interaction.effects": "显示互动动效", - "host.capture.fpsUnknown": "帧率未知", - "host.capture.codecPending": "编码待定", - "host.capture.hasAudio": "含来源音频", - "host.capture.noAudio": "无来源音频", } as const; export type CopyKey = keyof typeof zh; diff --git a/src/client/pages/ChannelRoomPreview.tsx b/src/client/pages/ChannelRoomPreview.tsx index f210757bf..e1679f9e5 100644 --- a/src/client/pages/ChannelRoomPreview.tsx +++ b/src/client/pages/ChannelRoomPreview.tsx @@ -10,7 +10,7 @@ import { screenVideoSettings } from "../media/quality"; import type { ChannelController } from "../channel/types"; import type { WatchIndexedChoice, WatchMpdChoice } from "../channel/watch-page-media"; import { roomCreationPolicySchema, type ChannelRoom, type RoomCreationPolicy, type WatchActivity } from "../channel/protocol"; -import { WatchPlayer } from "../channel/watch-playback"; +import { WatchPlayer, watchPosition } from "../channel/watch-playback"; import { HTMLVideoMedia, AppPageMedia, type WatchMedia, type WatchMediaState, type WatchMediaEvent } from "../channel/watch-media"; import { useAnchoredPopover } from "../components/living/use-anchored-popover"; import { AppConnectionButton } from "../components/living/AppConnectionButton"; @@ -239,7 +239,7 @@ export function ChannelRoomPreview({ firstUse = false }: { firstUse?: boolean }) let observedAt = openedAt; const read = async (): Promise => { const now = performance.now(), elapsed = ended ? 0 : (now - openedAt) / 1000; - state = { ...state, position: state.position + (state.paused ? 0 : (now - observedAt) / 1000 * state.rate) }; + state = { ...state, position: watchPosition({ ...state, anchorTime: observedAt }, now) }; observedAt = now; return { ...state, buffered: [[sampleProgramStart + elapsed + 90, sampleProgramStart + elapsed + 120]], live: { active: !ended, seekable: [[sampleProgramStart + elapsed, sampleProgramStart + elapsed + 120]], diff --git a/src/client/pages/channel-living.css b/src/client/pages/channel-living.css index 593972e95..efa0cad64 100644 --- a/src/client/pages/channel-living.css +++ b/src/client/pages/channel-living.css @@ -557,9 +557,6 @@ html[data-piik-native-window="integrated"]:not(:has(:fullscreen)) [data-layout=" } [data-layout="living"]:not([data-sidebars="phone"]) .c3-site-home { height: var(--control-dense-size); } -/* In the rail my figure opens my profile, a target of the size of the controls above it. */ -.c3-identity .c3-profile-pawn.lr-btn { --button-size: var(--control-compact-size); } -.c3-identity .c3-profile-pawn.lr-btn > .lr-person { width: 26px; height: 34px; } /* The row ends with what is always there, in every form: this room's standing tools, then the App and More, which are the site's and this device's. A rule parts them from the tools that follow the room's state, and diff --git a/src/client/remote-control/input-route.ts b/src/client/remote-control/input-route.ts index decbeeb5d..c0cd26561 100644 --- a/src/client/remote-control/input-route.ts +++ b/src/client/remote-control/input-route.ts @@ -38,7 +38,9 @@ export class EncryptedInput extends EventTarget implements InputTransport { this.transmit({ id: this.identity.endpointId, epoch: this.epoch, data: btoa(String.fromCharCode(...bytes)) }); }).catch(() => this.close()).finally(() => { this.bufferedAmount -= plain.length; }); } - receive(data: string): void { + /** `data` is whatever a peer put in its frame. Anything but text is dropped before it is counted. */ + receive(data: unknown): void { + if (typeof data !== "string") return; if (this.incomingBase64Chars + data.length > MAX_QUEUED_BASE64_CHARS) { this.close(); return; } this.incomingBase64Chars += data.length; this.inbound = this.inbound.then(async () => { diff --git a/src/client/room-voice/participant-presentation.ts b/src/client/room-voice/participant-presentation.ts index 0df37c89e..26309f7b6 100644 --- a/src/client/room-voice/participant-presentation.ts +++ b/src/client/room-voice/participant-presentation.ts @@ -2,24 +2,6 @@ import type { RoomVoiceState } from "../../shared/protocol"; import type { PawnVoice } from "../components/living/Pawn"; import type { CopyKey } from "../ui/copy"; import type { GlyphName } from "../ui/icons"; -import type { RoomPreferences } from "../lib/room-preferences"; - -export type RoomVoiceError = "microphoneUnavailable" | "microphoneDenied" | "microphoneMissing" | "microphoneFailed" | "transport" | "rejected" | "closed"; -export interface RoomVoiceSnapshot { - peerId: string; - role: "host" | "viewer"; - connected: boolean; - room: RoomVoiceState | null; - capturePending: boolean; - microphone: boolean; - deafened: boolean; - autoplayBlocked: boolean; - muted: ReadonlySet; - error: RoomVoiceError | null; - input: RoomPreferences["voiceInput"]; - listeningVolume: number; - peerVolumes: ReadonlyMap; -} /** One reading of the room's member snapshot for the couch and voice roster. */ export function describeVoiceParticipant(member?: RoomVoiceState["members"][number]): { diff --git a/src/client/styles.css b/src/client/styles.css index b1fc5b3ab..a6bae2151 100644 --- a/src/client/styles.css +++ b/src/client/styles.css @@ -855,20 +855,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } flex: 0 0 auto; margin-left: 0; } -.lr-viewer-action-cluster { - display: inline-flex; - min-width: 0; - align-items: center; - gap: 8px; -} -.lr-viewer-action-separator { - width: 2.5px; - height: 32px; - flex: 0 0 auto; - align-self: center; - border-radius: 2px; - background: var(--wall-2); -} .lr-viewer-self-slot .lr-name-tag { flex: 0 1 auto; width: auto; } .lr-name-hint { min-width: 0; max-width: 100%; } .lr-source-option-hint { min-width: 0; } @@ -879,7 +865,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-invite-field > .lr-invite-hint { flex: 1 1 180px; max-width: none; } .lr-invite-field .lr-invite-url { max-width: none; } .lr-invite-field > .lr-row-group { flex: none; width: auto; } -.lr-spacer { flex: 1; } .lr-divider { width: 2.5px; align-self: stretch; border-radius: 2px; background: var(--wall-2); } .lr-row.is-sub .lr-divider { background: var(--line); } .lr-field-cap { opacity: .68; font-size: 12px; font-weight: 600; } @@ -1045,9 +1030,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-switch[aria-checked="true"]:active::after { transform: translateX(24px) scaleX(1.18); } /* sliders */ -.lr-slider { display: flex; align-items: center; gap: 12px; } -.lr-slider input { flex: 1; accent-color: var(--action); height: 32px; } -.lr-slider output { min-width: 64px; font-family: var(--mono); font-size: 12.5px; text-align: right; } /* Choice tiles share interaction feedback; each surface owns its layout. */ .lr-tiles { display: flex; gap: 10px; flex-wrap: wrap; } @@ -1143,13 +1125,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-welcome-catalog summary { cursor: pointer; width: fit-content; padding-block: 12px; font-weight: 650; } .lr-welcome-catalog ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px 32px; padding-inline-start: 28px; } .lr-welcome-catalog li > span:first-child { display: block; } -.lr-input.lr-name-editor { - flex: 1; - min-width: 0; - width: 0; - height: 40px; - border-radius: 999px; -} .lr-group-name { width: 224px; max-width: 100%; } .lr-group-name > [role="alert"] { flex-basis: 100%; } .lr-group-name > .lr-name-hint { flex: 1; width: 0; } @@ -1361,14 +1336,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } /* ---------- advanced door ---------- */ -.lr-door-body { - display: grid; - gap: 16px; - padding: 16px; - border: 2.5px dashed var(--control-edge); - border-radius: var(--radius); -} -.lr-door { display: grid; } .lr-door-reveal { display: grid; grid-template-rows: 0fr; @@ -1564,7 +1531,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } gap: 20px; } .lr-join-site { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; } -.lr-join-door { color: var(--ink); } .lr-join-go { display: grid; width: 68px; height: 68px; @@ -1632,7 +1598,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } to { opacity: 1; transform: translateY(0); } } [data-comic-reduced-motion="true"] .lr-waiting-caption > span { animation: none; } -.lr-viewer-entry-brand { display: grid; place-items: center; color: var(--ink); } .lr-spin { animation: lr-rotate .9s linear infinite; } @keyframes lr-rotate { to { transform: rotate(360deg); } } @@ -1653,7 +1618,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-client-mode:not(:has(> span)) { grid-template-columns: 1fr; justify-items: center; } .lr-route { padding-inline: 0; } .lr-row { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; } - .lr-row > .lr-spacer, .lr-row > .lr-divider { display: none; } .lr-row-group { width: 100%; gap: 9px; } .lr-viewer-summary-row { flex-direction: row; align-items: center; justify-content: flex-start; } @@ -1667,14 +1631,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-host-identity-slot, .lr-host-diagnostics-slot { width: 100%; } .lr-viewer-actions-slot { flex: 1 1 100%; margin-left: 0; } - .lr-viewer-action-cluster { flex: 1 1 220px; } - .lr-viewer-action-cluster > .lr-btn, - .lr-viewer-action-cluster > .lr-comic-tip-wrap { - flex: 1 1 0; - min-width: 0; - } - .lr-viewer-action-cluster > .lr-comic-tip-wrap .lr-btn { width: 100%; } - .lr-viewer-action-separator { display: none; } .lr-group-actions { display: flex; width: 100%; gap: 8px; min-width: 0; } .lr-host-diagnostics-slot, .lr-viewer-actions-slot { @@ -1695,7 +1651,6 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-row-group > .lr-toggle { flex: 1; } .lr-invite-hint, .lr-invite-url { flex: 0 1 auto; max-width: none; min-height: 44px; } .lr-invite-field { flex: none; width: 100%; } - .lr-door-body { padding: 12px; } .lr-tv-screen.has-entry { aspect-ratio: auto; min-height: 292px; } .lr-tv-screen:has(.lr-source-picker) { aspect-ratio: auto; height: min(520px, 76svh); min-height: 300px; } .lr-tv-big { width: 72px; height: 72px; } @@ -1747,14 +1702,11 @@ body.lr-theater-open .lr-top { visibility: hidden; } .lr-sharing-section .lr-door-group { gap: 8px; } .lr-sharing-section .lr-door-glyph .lr-cap { white-space: normal; } .lr-sharing-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } -.lr-sharing-panel .lr-slider { width: 100%; } -.lr-sharing-panel .lr-slider output { min-width: 9ch; } .lr-sharing-section .lr-tiles { gap: 12px; } .lr-sharing-section .lr-tiles > .lr-comic-tip-wrap { flex: 1; min-width: 0; } .lr-sharing-section .lr-tile { width: 100%; min-width: 0; padding: 12px 8px; gap: 5px; border-radius: 16px; } .lr-sharing-section .lr-tile > svg { height: 30px; } .lr-sharing-section .lr-tile strong { font-size: 14px; font-weight: 650; } -.lr-sharing-section .lr-slider input { width: 100%; min-width: 0; } .lr-sharing-section .lr-row-group { gap: 8px; } .lr-sharing-section .lr-chip { min-height: 40px; padding: 7px 12px; } .lr-sharing-audio-controls { display: grid; gap: 20px; min-width: 0; } diff --git a/src/shared/media-copy-accounting.ts b/src/shared/media-copy-accounting.ts deleted file mode 100644 index 948c9dbd1..000000000 --- a/src/shared/media-copy-accounting.ts +++ /dev/null @@ -1,64 +0,0 @@ -export const DEFAULT_ENDPOINT_MEDIA_COPY_CAPACITY = 2; -export const MAX_ENDPOINT_MEDIA_COPY_CAPACITY = 3; - -export type EndpointMediaCopyPhase = "steady" | "transition"; - -export interface EndpointMediaCopySnapshot { - childPeerIds: readonly string[]; - publicationGeneration?: string | null; - selectedChildPeerIds?: Iterable; -} - -export function countEndpointMediaCopies( - snapshot: EndpointMediaCopySnapshot, -): number { - const childPeerIds = new Set(snapshot.childPeerIds); - const hiddenSelectedChildPeerIds = new Set(); - for (const childPeerId of snapshot.selectedChildPeerIds ?? []) { - if (!childPeerIds.has(childPeerId)) { - hiddenSelectedChildPeerIds.add(childPeerId); - } - } - return ( - snapshot.childPeerIds.length + - (snapshot.publicationGeneration ? 1 : 0) + - hiddenSelectedChildPeerIds.size - ); -} - -export function endpointMediaCopyLimit( - capacity: number, - phase: EndpointMediaCopyPhase, -): number { - assertEndpointMediaCopyCapacity(capacity); - return phase === "steady" - ? capacity - : Math.min(capacity + 1, MAX_ENDPOINT_MEDIA_COPY_CAPACITY); -} - -export function endpointMediaCopyCountFits( - count: number, - capacity: number, - phase: EndpointMediaCopyPhase = "steady", -): boolean { - return ( - Number.isSafeInteger(count) && - count >= 0 && - isEndpointMediaCopyCapacity(capacity) && - count <= endpointMediaCopyLimit(capacity, phase) - ); -} - -export function isEndpointMediaCopyCapacity(capacity: number): boolean { - return ( - Number.isSafeInteger(capacity) && - capacity >= 1 && - capacity <= MAX_ENDPOINT_MEDIA_COPY_CAPACITY - ); -} - -export function assertEndpointMediaCopyCapacity(capacity: number): void { - if (!isEndpointMediaCopyCapacity(capacity)) { - throw new Error("Endpoint media copy capacity must be 1, 2, or 3"); - } -} diff --git a/src/shared/protocol.ts b/src/shared/protocol.ts index 037137631..73f0c5472 100644 --- a/src/shared/protocol.ts +++ b/src/shared/protocol.ts @@ -2,7 +2,6 @@ import { z } from "zod"; import { MAX_CHAT_CODE_POINTS, normalizeChatText, REACTION_IDS, isThrow } from "./room-interactions.js"; import { MIN_AUDIO_BITRATE } from "./core-limits.js"; -export const MAX_VIEWERS_PER_ROOM_LIMIT = 20; export const VIEWER_QUALITY_EVIDENCE_INTERVAL_MS = 2_000; export const PERSISTENT_NATIVE_EDGE_DEGRADED_WINDOWS = 3; @@ -93,13 +92,6 @@ export type ParticipantPresenceEntry = ViewerPresenceEntry | { upstream: { kind: "none" }; }; -export type RoomVoiceCommand = - | { action: "join" } - | { action: "leave" } - | { action: "publish" } - | { action: "unpublish"; publicationId: string } - | { action: "deafen"; deafened: boolean } - | { action: "bitrate"; bitrate: number }; export interface RoomVoiceState { type: "room-voice-state"; bitrate?: number; diff --git a/src/shared/video-codec-evidence.ts b/src/shared/video-codec-evidence.ts index 86532a60d..ee38b9542 100644 --- a/src/shared/video-codec-evidence.ts +++ b/src/shared/video-codec-evidence.ts @@ -108,58 +108,3 @@ export function deriveVideoCodecEvidence( parameters: parameters || null, }; } - -export function isCanonicalVideoCodecEvidence(value: { - codec: string | null; - codecProfile: string | null; - codecParameters: string | null; -}): boolean { - const rule = value.codec - ? VIDEO_CODEC_PARAMETER_RULES[value.codec.toLowerCase()] - : undefined; - if (!rule) { - return value.codecProfile === null && value.codecParameters === null; - } - return ( - canonicalValuesMatch( - value.codecProfile, - rule.profileKey ? [rule.profileKey] : [], - rule.validators, - ) && - canonicalValuesMatch( - value.codecParameters, - rule.parameterKeys, - rule.validators, - ) - ); -} - -function canonicalValuesMatch( - encoded: string | null, - orderedKeys: readonly string[], - validators: Readonly>, -): boolean { - if (encoded === null) { - return true; - } - const segments = encoded.split("; "); - if (segments.length > orderedKeys.length) { - return false; - } - let previousKeyIndex = -1; - for (const segment of segments) { - const separator = segment.indexOf("="); - const key = separator < 1 ? "" : segment.slice(0, separator); - const keyIndex = orderedKeys.indexOf(key); - const candidate = separator < 1 ? "" : segment.slice(separator + 1); - if ( - keyIndex <= previousKeyIndex || - keyIndex < 0 || - !validators[key]?.test(candidate) - ) { - return false; - } - previousKeyIndex = keyIndex; - } - return true; -} diff --git a/tests/app-candidate.test.ts b/tests/app-candidate.test.ts index 4f2960769..b848f7b2c 100644 --- a/tests/app-candidate.test.ts +++ b/tests/app-candidate.test.ts @@ -28,7 +28,8 @@ vi.mock("node:child_process", async (original) => ({ return { status: 0, stdout: "", stderr: "" }; }, })); -vi.mock("../scripts/app-package-targets.mjs", () => ({ +vi.mock("../scripts/app-package-targets.mjs", async (original) => ({ + ...await original(), CLOUDFLARED_VERSION: "fixture", appPackageTarget: () => ({ id: "fixture", nodePlatform: process.platform, nodeArch: process.arch, diff --git a/tests/channel-attachment-retention.test.ts b/tests/channel-attachment-retention.test.ts index e7a7e6bc1..6f417477e 100644 --- a/tests/channel-attachment-retention.test.ts +++ b/tests/channel-attachment-retention.test.ts @@ -445,10 +445,14 @@ test.each(["local", "host"] as const)("clearing the %s cache retires its complet [{ id: key.roomId, available: true, authorized: true, historyLineage: lineage }] as ChannelRoom[], []); } const clear = () => kind === "host" ? files.clearRetainedFor(key.roomId, lineage, selected.messageSeq) : files.clearLocalCache(key.roomId); + command.mockClear(); removeEntry.mockRejectedValueOnce(new DOMException("busy", "NoModificationAllowedError")); await expect(clear()).rejects.toThrow("busy"); + expect(command).toHaveBeenCalledWith({ type: "file_receive", ...key, enabled: false }); + const afterFailure = command.mock.calls.length; removeEntry.mockClear(); await clear(); + expect(command.mock.calls.slice(afterFailure)).toContainEqual([{ type: "file_receive", ...key, enabled: false }]); expect(command).toHaveBeenCalledWith({ type: "file_offer", ...key, sha256: attachment.sha256, available: false }); expect(removeEntry).toHaveBeenCalledExactlyOnceWith(getFileHandle.mock.calls[0][0]); expect(files.originalAvailability(key, attachment, false)).toBeUndefined(); @@ -870,16 +874,18 @@ test.each(["before", "after"])("a new room writer completes a pending download w } finally { controller.abort(); rejectOldReceive(new Error("retired_writer")); files.reset(); vi.unstubAllGlobals(); } }); -test.each(["write", "peer"] as const)("a %s failure reports its cause and removes the partial download", async failure => { +test.each(["write", "peer", "start"] as const)("a %s failure reports its cause and removes the partial download", async failure => { const command = vi.fn(async (_command: ChannelCommand) => {}), files = setup(command); - const abort = vi.fn(async () => {}), removeEntry = vi.fn(async () => {}); + const abort = vi.fn(async () => {}), removeEntry = vi.fn(async () => {}), cancel = vi.fn(() => []); + if (failure === "start") cancel.mockImplementationOnce(() => { throw new Error("cancel_failed"); }); const write = vi.fn(async () => { throw new DOMException("Local quota exhausted", "QuotaExceededError"); }); const getFileHandle = vi.fn(async (_name: string) => ({ createWritable: async () => ({ write, abort }) })); stubTransferStorage({ getFileHandle, removeEntry }); vi.mocked(hosting.loadRoomHosting).mockResolvedValue({ ...await hosting.loadRoomHosting(), FileDelivery: class { - start() { return []; } update() { return []; } cancel() { return []; } next_deadline() {} free() {} + start() { if (failure === "start") throw new Error("file_transfer_interrupted"); return []; } + update() { return []; } cancel = cancel; next_deadline() {} free() {} control() { return [failure === "write" ? { type: "write", key, offset: 0, bytes: Uint8Array.of(1) } : { type: "failed", key, code: "file_transfer_interrupted" }]; } }, @@ -887,9 +893,13 @@ test.each(["write", "peer"] as const)("a %s failure reports its cause and remove try { const code = failure === "write" ? "file_storage_full" : "file_transfer_interrupted"; const rejected = expect(files.download(key, attachment)).rejects.toThrow(code); - await vi.waitFor(() => expect(command).toHaveBeenCalledWith({ type: "file_receive", ...key, enabled: true })); - files.data("source", "control", "result"); + if (failure !== "start") { + await vi.waitFor(() => expect(command).toHaveBeenCalledWith({ type: "file_receive", ...key, enabled: true })); + files.data("source", "control", "result"); + } await rejected; + expect(cancel).toHaveBeenCalledExactlyOnceWith(JSON.stringify(key)); + expect(command.mock.calls.flatMap(([cmd]) => cmd.type === "file_receive" ? [cmd.enabled] : [])).toEqual(failure === "start" ? [] : [true, false]); expect(files.status(key)).toMatchObject({ busy: false, error: code }); const message = failure === "write" ? "channel.attachment.storageFull" : "channel.attachment.transferInterrupted"; for (const fallback of ["channel.attachment.downloadFailed", "channel.attachment.previewFailed"] as const) @@ -900,7 +910,7 @@ test.each(["write", "peer"] as const)("a %s failure reports its cause and remove } finally { files.reset(); vi.unstubAllGlobals(); } }); -test("cancel while waiting for a source permits retry before the old receive command settles", async () => { +test.each([false, true])("cancel while waiting for a source permits retry before the old receive command settles (delivery cancel throws=%s)", async throws => { let rejectOldReceive!: (reason: Error) => void; const oldReceive = new Promise((_, reject) => { rejectOldReceive = reject; }); let starts = 0; @@ -909,6 +919,7 @@ test("cancel while waiting for a source permits retry before the old receive com }); const files = setup(command); const cancel = vi.fn(() => []), removeEntry = vi.fn(async (_name: string) => {}); + if (throws) cancel.mockImplementationOnce(() => { throw new Error("cancel_failed"); }); vi.mocked(hosting.loadRoomHosting).mockResolvedValue({ initializeRuntime: async () => {}, FileDelivery: class { start() { return []; } update() { return []; } next_deadline() { return undefined; } @@ -931,6 +942,8 @@ test("cancel while waiting for a source permits retry before the old receive com files.update("endpoint", scope, [plan], [room], []); expect(files.progress(key)).toMatchObject({ received: 0, state: "waiting-source" }); files.cancelDownload(key); + expect(cancel).toHaveBeenCalledExactlyOnceWith(JSON.stringify(key)); + expect(command).toHaveBeenLastCalledWith({ type: "file_receive", ...key, enabled: false }); expect(files.progress(key)).toBeNull(); const retry = files.download(key, attachment); void retry.catch(() => {}); @@ -998,6 +1011,7 @@ test.each(["cancel", "revoke", "identity switch"])("shared file progress survive await vi.waitFor(() => expect(finishWrite).not.toBe(firstWrite)); first.abort(); await expect(a).rejects.toMatchObject({ name: "AbortError" }); expect(files.progress(key)?.received).toBe(3); expect(cancel).not.toHaveBeenCalled(); + expect(command).not.toHaveBeenCalledWith({ type: "file_receive", ...key, enabled: false }); const otherRoom = { ...room, id: "second", reading: true }; files.update("endpoint", scope, [sourceGone], [{ ...room, reading: false }, otherRoom], []); expect(files.progress(key)).toMatchObject({ received: 3, state: "waiting-source" }); @@ -1041,7 +1055,7 @@ test.each(["cancel", "revoke", "identity switch"])("shared file progress survive else files.update("new-endpoint", { ...scope, userId: "successor" }, [alternate], [room], []); } finally { unsubscribe(); } const retiredCancels = retirement === "identity switch" ? 0 : 1; - if (retirement === "identity switch") { + if (retirement !== "cancel") { expect(command).not.toHaveBeenCalledWith({ type: "file_receive", ...key, enabled: false }); } expect(cancellationSnapshots).toContain(false); diff --git a/tests/channel-conversation-presentation.test.ts b/tests/channel-conversation-presentation.test.ts index 44f62744c..7156582cc 100644 --- a/tests/channel-conversation-presentation.test.ts +++ b/tests/channel-conversation-presentation.test.ts @@ -1,8 +1,10 @@ -import { expect, test } from "vitest"; -import { createElement } from "react"; +import { expect, test, vi } from "vitest"; +import { act, createElement, useLayoutEffect } from "react"; +import { createRoot } from "react-dom/client"; import { renderToStaticMarkup } from "react-dom/server"; import { ChannelConversation as ConversationView } from "../src/client/channel/components/ChannelConversation"; -import type { ChannelMessage } from "../src/client/channel/protocol"; +import type { ChannelMessage, ProfilePage } from "../src/client/channel/protocol"; +import { useProfileDirectory } from "../src/client/channel/use-channel"; import { setCopy } from "../src/client/ui/copy"; function historyMarkup(times: number[]) { @@ -52,3 +54,72 @@ test("prepending history keeps one divider per local day", () => { expect(historyMarkup([first - 30_000, first, first + 30_000]).match(/class="c3-message-date"/g)).toHaveLength(1); expect(historyMarkup([earlier, first, first + 30_000]).match(/class="c3-message-date"/g)).toHaveLength(2); }); + +test("profile pages retry the failed cursor and retire a pending read when the query changes", async () => { + const view = Object.assign(new EventTarget(), { HTMLIFrameElement: class {} }); + const ownerDocument = Object.assign(new EventTarget(), { nodeType: 9, defaultView: view }); + vi.stubGlobal("window", Object.assign(view, { document: ownerDocument })); + vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true); + const root = createRoot(Object.assign(new EventTarget(), { nodeType: 1, tagName: "DIV", ownerDocument }) as unknown as HTMLElement); + let reply!: (page: ProfilePage) => void, reject!: (reason: Error) => void; + const read = vi.fn[0]>(() => new Promise((resolve, fail) => { reply = resolve; reject = fail; })); + let directory!: ReturnType; + const committed = vi.fn(); + function Reader({ query, known }: { query: { query?: string } | null; known?: { id: string }[] }) { + directory = useProfileDirectory(read, query, known); + useLayoutEffect(() => { committed(directory); }); + return null; + } + const render = (query: { query?: string } | null, known?: { id: string }[]) => act(() => root.render(createElement(Reader, { query, known }))); + const load = () => act(() => { void directory.load(); }); + const page = (nextCursor: string | null, ...ids: string[]): ProfilePage => ({ + profiles: ids.map(id => ({ id, name: id, avatar: null, version: "a".repeat(64) })), total: ids.length, nextCursor, + }); + try { + await render({}, [{ id: "live" }]); + await load(); + await act(() => reject(new Error("request_timeout"))); + expect(directory).toMatchObject({ failed: true, loading: false, next: undefined, ids: ["live"] }); + await load(); + await act(() => reply(page("b", "live", "b"))); + await load(); + await act(() => reject(new Error("disconnected"))); + expect(directory).toMatchObject({ failed: true, loading: false, next: "b", ids: ["live", "b"] }); + await load(); + await load(); + expect(read.mock.calls.map(([query]) => query)).toStrictEqual([{}, {}, { after: "b" }, { after: "b" }]); + expect(read.mock.lastCall![1]?.aborted).toBe(false); + expect(directory).toMatchObject({ loading: true, failed: false }); + await act(() => reply(page(null, "b", "c"))); + expect(directory).toMatchObject({ loading: false, failed: false, next: null, ids: ["live", "b", "c"] }); + + await render({ query: "a" }); + await load(); + const late = reply, signal = read.mock.lastCall![1]!; + await render({ query: "ab" }); + expect(signal.aborted).toBe(true); + await load(); + const replacement = read.mock.lastCall!; + await act(() => late(page("old", "a"))); + expect(directory).toMatchObject({ ids: [], next: undefined, loading: true, failed: false }); + await load(); + expect(read.mock.lastCall).toBe(replacement); + expect(replacement[0]).toStrictEqual({ query: "ab" }); + await act(() => reply(page("ab", "ab"))); + expect(directory).toMatchObject({ ids: ["ab"], next: "ab", loading: false }); + await load(); + const closing = read.mock.lastCall!; + expect(closing[0]).toStrictEqual({ query: "ab", after: "ab" }); + committed.mockClear(); + await render(null); + expect(committed.mock.calls[0]?.[0]).toMatchObject({ ids: [], next: undefined, loading: false, failed: false }); + expect(closing[1]?.aborted).toBe(true); + await act(() => reject(new Error("aborted"))); + await load(); + expect(read.mock.lastCall).toBe(closing); + expect(directory).toMatchObject({ ids: [], next: undefined, loading: false, failed: false }); + } finally { + await act(() => root.unmount()); + vi.unstubAllGlobals(); + } +}); diff --git a/tests/channel-message-content.test.ts b/tests/channel-message-content.test.ts index aba06eda1..7533e0d1b 100644 --- a/tests/channel-message-content.test.ts +++ b/tests/channel-message-content.test.ts @@ -82,3 +82,16 @@ test("leading blank lines and indented code preserve literal mentions and invita expect(html).not.toContain(' { + const href = "https://example.test/room.png"; + const html = render(label + "(" + href + ")"); + expect(html).toContain('rel="noopener noreferrer">' + href + ""); + expect(html).not.toContain(" { + const text = "\uE000@Bo"; + const html = render(text, [{ userId: "bo", start: 1, end: 4 }]); + expect(html).toContain('\uE000@Bo'); +}); diff --git a/tests/channel-session.test.ts b/tests/channel-session.test.ts index 7ca3481ad..3be29bcdf 100644 --- a/tests/channel-session.test.ts +++ b/tests/channel-session.test.ts @@ -14278,6 +14278,8 @@ test.each(['withdrawn', 'replaced', 'activity', 'direct viewer'] as const)('watc const direct = socket.sent.findLast(command => command.type === 'join_watch')!; expect(direct).toMatchObject({ id: activity.id, mode: 'direct' }); socket.receive({ type: 'reply', roomId: 'first', requestId: direct.requestId, result: { type: 'watch_ready', serverTime: 1100 } }); + video.readyState = 4; + video.dispatchEvent(new Event("loadeddata")); await switching; expect(session.getSnapshot().watchPlayers.get(activity.id)?.signal.aborted).toBe(false); } @@ -19085,3 +19087,36 @@ test.each(["cancel", "refusal"] as const)("a private borrowed-page preview prese expect(session.getSnapshot().watchPlayers.get(String(old.id))).toBe(oldPlayer); } finally { session.close(); } }); +test("a replacement inherits the confirmed peer while direct media is pending after acknowledgement", async () => { + const { session, socket } = await setup(1000, false); + let readyState = 2; + vi.stubGlobal("document", { createElement: () => Object.assign(new WatchTestVideo(), { readyState }) }); + vi.spyOn(watchMedia, "canReceivePeerWatch").mockReturnValue(true); + vi.spyOn(watchMedia, "createResourceWatchMedia").mockImplementation(() => new HTMLVideoMedia("https://media.test/peer.mp4")); + const base = session.getSnapshot().state!; + const source = { id: "before", roomId: "first", sessionId: "publisher", userId: "other", viewerSessionIds: [], + source: { kind: "media", url: "https://media.test/direct.mp4" }, + byteSource: { sessionId: crypto.randomUUID(), resourceId: crypto.randomUUID(), format: "file" }, + playback: { timeline: "media", position: 0, paused: true, rate: 1, anchorTime: 1000 } }; + const reply = (id: string, mode: string) => { + const join = socket.sent.findLast(c => c.type === "join_watch")!; + expect(join).toMatchObject({ id, mode }); + socket.receive({ type: "reply", roomId: "first", requestId: join.requestId, result: { type: "watch_ready", serverTime: 1000 } }); + }; + try { + socket.receive({ type: "state", state: { ...base, watchActivities: [source] } }); + const joining = session.joinWatch(source.id, "peer"); + reply(source.id, "peer"); + await joining; + socket.receive({ type: "state", state: { ...base, watchActivities: [source], watchSubscriptions: [{ id: source.id, mode: "peer" }] } }); + session.getSnapshot().watchPlayers.get(source.id)!.error = "watch_media_failed"; + readyState = 0; + const switching = session.joinWatch(source.id, "direct").catch(() => {}); + reply(source.id, "direct"); + await new Promise(resolve => setTimeout(resolve, 0)); + const next = { ...source, id: "after", predecessor: { kind: "watch", id: source.id } }; + socket.receive({ type: "state", state: { ...base, watchActivities: [next] } }); + await vi.waitFor(() => expect(socket.sent.findLast(c => c.type === "join_watch")).toMatchObject({ id: next.id, mode: "peer" })); + await switching; + } finally { session.close(); vi.unstubAllGlobals(); } +}); diff --git a/tests/channel-transport.test.ts b/tests/channel-transport.test.ts new file mode 100644 index 000000000..915fe9733 --- /dev/null +++ b/tests/channel-transport.test.ts @@ -0,0 +1,97 @@ +import { afterEach, expect, test, vi } from "vitest"; +import { ChannelTransport } from "../src/client/channel/transport"; + +afterEach(() => { vi.unstubAllGlobals(); vi.restoreAllMocks(); }); + +function track(kind: "audio" | "video"): MediaStreamTrack { + return { kind, readyState: "live", clone: () => track(kind), stop: vi.fn() } as unknown as MediaStreamTrack; +} + +function setup() { + vi.stubGlobal("MediaStream", class { + readonly id = crypto.randomUUID(); + constructor(private tracks: MediaStreamTrack[] = []) {} + getTracks() { return [...this.tracks]; } + addTrack(track: MediaStreamTrack) { this.tracks.push(track); } + removeTrack(track: MediaStreamTrack) { this.tracks = this.tracks.filter(current => current !== track); } + }); + const add = vi.fn((track: MediaStreamTrack, init: RTCRtpTransceiverInit) => ({ + sender: { track, setStreams() {}, async replaceTrack(next: MediaStreamTrack) { this.track = next; }, stream: init.streams![0], getParameters: () => ({ encodings: [] }) }, + receiver: { track: { kind: track.kind } }, currentDirection: "sendrecv", + })); + vi.stubGlobal("RTCPeerConnection", class extends EventTarget { + signalingState = "stable"; + localDescription?: RTCSessionDescriptionInit; + addTransceiver = add; + getTransceivers() { return add.mock.results.map(result => result.value); } + getSenders() { return this.getTransceivers().map(value => value.sender); } + getReceivers() { return this.getTransceivers().map(value => value.receiver); } + removeTrack(sender: { track: MediaStreamTrack | null }) { sender.track = null; } + async setRemoteDescription() {} + async createAnswer() { return { type: "answer", sdp: "answer" }; } + async setLocalDescription(value: RTCSessionDescriptionInit) { this.localDescription = value; } + async createOffer() { throw new DOMException("local offer refused", "OperationError"); } + close() {} + }); + const send = vi.fn(), failed = vi.fn(), outgoingFailed = vi.fn(); + const warning = vi.spyOn(console, "warn").mockImplementation(() => {}); + const transport = new ChannelTransport({ polite: true, iceServers: [], send, receive() {}, connected() {}, roomData() {}, failed, outgoingFailed }); + return { add, send, failed, outgoingFailed, warning, transport }; +} + +// A refused offer names the senders it carried and no others. The screen goes on with what it had while its +// picture is live, and fails as a whole, releasing every sender once, when no picture is left. +test.each([["no picture", false], ["a live picture and its sound", true]] as const)("a refused offer leaves a screen that had %s", async (_, establishedPicture) => { + const { add, send, failed, outgoingFailed, warning, transport } = setup(); + const picture = track("video"), audio = track("audio"); + const source = new MediaStream(establishedPicture ? [picture, audio] : [audio]); + const outputs = new Map([["screen", { kind: "screen" as const, stream: source }]]); + try { + transport.setOutgoing(outputs); + transport.signal({ exchangeId: "established", description: { type: "offer", sdp: "offer" } }); + await vi.waitFor(() => expect(send).toHaveBeenCalledWith(expect.objectContaining({ exchangeId: "established" }))); + const wrapper = add.mock.calls[0][1].streams![0]; + const established = transport.pc.getSenders().filter(sender => sender.track); + + const addition = establishedPicture ? track("audio") : picture; + source.addTrack(addition); + transport.setOutgoing(outputs); + transport.pc.onnegotiationneeded?.(new Event("negotiationneeded")); + await vi.waitFor(() => expect(warning).toHaveBeenCalledWith("Channel local offer failed", { flows: ["screen"] }, expect.any(DOMException))); + + expect(transport.pc.getSenders().filter(sender => sender.track)).toEqual(establishedPicture ? established : []); + expect(wrapper.getTracks()).toEqual(establishedPicture ? [picture, audio] : []); + expect(outgoingFailed.mock.calls).toEqual(establishedPicture ? [] : [["screen"]]); + expect(failed).not.toHaveBeenCalled(); + for (const sourceTrack of source.getTracks()) expect(sourceTrack.stop).not.toHaveBeenCalled(); + expect(transport.setOutgoing(new Map())).toBe(establishedPicture); + } finally { transport.close(); } +}); + +test.each(["attach", "rebind"] as const)("a refused companion %s preserves the picture and other sound", async failure => { + const { add, transport, outgoingFailed } = setup(); + const picture = track("video"), rejected = track("audio"), sibling = track("audio"); + const source = new MediaStream([picture]); + const publish = (id: string) => transport.setOutgoing(new Map([[id, { kind: "screen", stream: source }]])); + try { + if (failure === "rebind") { + source.removeTrack(picture); + source.addTrack(rejected); + source.addTrack(sibling); + publish("old"); + transport.setOutgoing(new Map()); + vi.spyOn(add.mock.results[0].value.sender, "replaceTrack").mockRejectedValueOnce(new Error("slot refused")); + source.addTrack(picture); + publish("screen"); + } else { + publish("screen"); + source.addTrack(rejected); + add.mockImplementationOnce(() => { throw new Error("attach refused"); }); + publish("screen"); + } + const wrapper = add.mock.calls[0][1].streams![0]; + await vi.waitFor(() => expect(wrapper.getTracks()).toEqual(failure === "rebind" ? [sibling, picture] : [picture])); + if (failure === "rebind") expect(add.mock.results[1].value.sender.track).toBe(sibling); + expect(outgoingFailed).not.toHaveBeenCalled(); + } finally { transport.close(); } +}); diff --git a/tests/media-copy-accounting.test.ts b/tests/media-copy-accounting.test.ts deleted file mode 100644 index 0178969a6..000000000 --- a/tests/media-copy-accounting.test.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { describe, expect, it } from "vitest"; - -import { - assertEndpointMediaCopyCapacity, - countEndpointMediaCopies, - endpointMediaCopyCountFits, - endpointMediaCopyLimit, -} from "../src/shared/media-copy-accounting.ts"; - -describe("endpoint media copy accounting", () => { - it("counts children and one Host publication while upstream remains free", () => { - expect( - countEndpointMediaCopies({ - childPeerIds: ["child-a", "child-b"], - }), - ).toBe(2); - expect( - countEndpointMediaCopies({ - childPeerIds: ["child-a", "child-b"], - publicationGeneration: "publication-a", - }), - ).toBe(3); - }); - - it("does not double-count a committed selected transport for the same edge", () => { - expect( - countEndpointMediaCopies({ - childPeerIds: ["child-a"], - selectedChildPeerIds: ["child-a"], - }), - ).toBe(1); - }); - - it("charges each hidden carried selected edge as another copy", () => { - expect( - countEndpointMediaCopies({ - childPeerIds: ["child-a"], - selectedChildPeerIds: ["child-b", "child-b", "child-c"], - }), - ).toBe(3); - }); - - it.each([ - [1, null, ["selected-a"]], - [2, "publication", ["selected-a"]], - [3, "publication", ["selected-a", "selected-b"]], - ] as const)( - "holds hidden selected carries to endpoint cap %i", - (capacity, publicationGeneration, selectedChildPeerIds) => { - const atCapacity = countEndpointMediaCopies({ - childPeerIds: [], - publicationGeneration, - selectedChildPeerIds, - }); - const overCapacity = countEndpointMediaCopies({ - childPeerIds: [], - publicationGeneration, - selectedChildPeerIds: [...selectedChildPeerIds, "selected-overflow"], - }); - - expect(atCapacity).toBe(capacity); - expect(endpointMediaCopyCountFits(atCapacity, capacity)).toBe(true); - expect(endpointMediaCopyCountFits(overCapacity, capacity)).toBe(false); - }, - ); - - it.each([ - [1, 1, 2], - [2, 2, 3], - [3, 3, 3], - ] as const)( - "bounds capacity %i at %i steady and %i during transition", - (capacity, steady, transition) => { - expect(endpointMediaCopyLimit(capacity, "steady")).toBe(steady); - expect(endpointMediaCopyLimit(capacity, "transition")).toBe(transition); - expect( - endpointMediaCopyCountFits(transition, capacity, "transition"), - ).toBe(true); - expect( - endpointMediaCopyCountFits(transition + 1, capacity, "transition"), - ).toBe(false); - }, - ); - - it.each([0, 4, 1.5, Number.NaN])( - "rejects invalid capacity %s", - (capacity) => { - expect(() => assertEndpointMediaCopyCapacity(capacity)).toThrow( - "must be 1, 2, or 3", - ); - }, - ); - - it("returns false instead of throwing for an unavailable runtime capacity", () => { - expect(endpointMediaCopyCountFits(0, 0)).toBe(false); - }); -}); diff --git a/tests/publish-release.test.ts b/tests/publish-release.test.ts index 21cac97c8..f2b7eb605 100644 --- a/tests/publish-release.test.ts +++ b/tests/publish-release.test.ts @@ -1,3 +1,4 @@ +import { serverReleaseNames, SERVER_PACKAGE_TARGETS } from "../scripts/server-package-targets.mjs"; import { createHash, generateKeyPairSync } from "node:crypto"; import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; @@ -26,16 +27,15 @@ const keys = generateKeyPairSync("ed25519"); const publicHex = Buffer.from(keys.publicKey.export({ format: "jwk" }).x!, "base64url").toString("hex"); const pem = keys.privateKey.export({ format: "pem", type: "pkcs8" }).toString(); for (const target of ["server", "server-linux-arm64", "server-windows-amd64", "windows-amd64", "linux-amd64", "linux-arm64", "darwin-arm64", "darwin-amd64", "android-universal"]) { - const server = target.startsWith("server"); - // The Windows Server package ships a ZIP; the Linux Server packages keep tar.gz. - const archive = target === "android-universal" ? "apk" : target === "server-windows-amd64" ? "zip" : server ? "tar.gz" : "zip"; - const artifact = `${target}.${archive}`; + const serverTarget = SERVER_PACKAGE_TARGETS.find(candidate => candidate.id === target); + const server = serverTarget && serverReleaseNames(serverTarget, revision); + const artifact = server?.artifact ?? `piik-app-${target}.${target === "android-universal" ? "apk" : "zip"}`; writeFileSync(join(directory, artifact), target); writeFileSync(join(directory, `${target}.release.json`), JSON.stringify({ schema: 2, version, revision, artifact, artifactSha256: hash(target), - target, ...(server ? { manifest: `${target}.manifest.tsv`, manifestSha256: hash("manifest") } : {}), + target, ...(server ? { manifest: server.manifest, manifestSha256: hash("manifest") } : {}), })); - if (server) writeFileSync(join(directory, `${target}.manifest.tsv`), "manifest"); + if (server) writeFileSync(join(directory, server.manifest), "manifest"); else writeFileSync(join(directory, `${artifact}.sha256`), `${hash(target)} ${artifact}\n`); } afterAll(() => rmSync(directory, { recursive: true, force: true })); @@ -432,7 +432,7 @@ describe("publisher recovery", () => { let draftBody = ""; const initial = await publish([], "absent", "upload", body => { draftBody = body; }); expect(initial.failure).toBe("GitHub upload failed"); - const names = ["windows-amd64.zip", "windows-amd64.release.json", "windows-amd64.zip.sha256"]; + const names = ["piik-app-windows-amd64.zip", "windows-amd64.release.json", "piik-app-windows-amd64.zip.sha256"]; const original = names.map(name => readFileSync(join(directory, name))); const oldDigest = hash(original[0]!); const newBytes = Buffer.from("rebuilt Windows archive at the same source SHA"); diff --git a/tests/release-automation.test.ts b/tests/release-automation.test.ts index 952fb5811..d3cae4aca 100644 --- a/tests/release-automation.test.ts +++ b/tests/release-automation.test.ts @@ -1,3 +1,4 @@ +import { serverReleaseNames, SERVER_PACKAGE_TARGETS } from "../scripts/server-package-targets.mjs"; import { execFileSync, spawnSync } from "node:child_process"; import { createHash } from "node:crypto"; import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; @@ -284,14 +285,14 @@ describe("release automation", () => { const run = () => spawnSync(process.execPath, [publisher, root, version, revision, "--dry-run"], { encoding: "utf8" }); try { for (const target of ["server", "server-linux-arm64", "server-windows-amd64", "windows-amd64", "linux-amd64", "linux-arm64", "darwin-arm64", "darwin-amd64", "android-universal"]) { - const server = target.startsWith("server"); - const archive = target === "android-universal" ? "apk" : target === "server-windows-amd64" ? "zip" : server ? "tar.gz" : "zip"; - const artifact = `${target}.${archive}`; + const serverTarget = SERVER_PACKAGE_TARGETS.find(candidate => candidate.id === target); + const server = serverTarget && serverReleaseNames(serverTarget, revision); + const artifact = server?.artifact ?? `piik-app-${target}.${target === "android-universal" ? "apk" : "zip"}`; writeFileSync(join(root, artifact), target); const descriptor = { schema: 2, version, revision, artifact, artifactSha256: sha(target), - target, ...(server ? { manifest: `${target}.manifest.tsv`, manifestSha256: sha("manifest") } : {}) }; + target, ...(server ? { manifest: server.manifest, manifestSha256: sha("manifest") } : {}) }; writeFileSync(join(root, `${target}.release.json`), JSON.stringify(descriptor)); - if (server) writeFileSync(join(root, `${target}.manifest.tsv`), "manifest"); + if (server) writeFileSync(join(root, server.manifest), "manifest"); else writeFileSync(join(root, `${artifact}.sha256`), `${sha(target)} ${artifact}\n`); } const complete = run(); @@ -303,7 +304,7 @@ describe("release automation", () => { rmSync(androidDescriptor); expect(run().stderr).toContain("every registered Server and App target"); writeFileSync(androidDescriptor, androidMetadata); - const checksum = join(root, "windows-amd64.zip.sha256"); + const checksum = join(root, "piik-app-windows-amd64.zip.sha256"); const originalChecksum = readFileSync(checksum, "utf8"); writeFileSync(checksum, "wrong checksum"); expect(run().stderr).toContain("App checksum file mismatch"); @@ -313,7 +314,7 @@ describe("release automation", () => { writeFileSync(path, JSON.stringify({ ...JSON.parse(original), revision: "b".repeat(40) })); expect(run().stderr).toContain("Release identity mismatch"); writeFileSync(path, original); - writeFileSync(join(root, "windows-amd64.zip"), "changed bytes"); + writeFileSync(join(root, "piik-app-windows-amd64.zip"), "changed bytes"); expect(run().stderr).toContain("checksum mismatch"); } finally { rmSync(root, { recursive: true, force: true }); } }); diff --git a/tests/release-update-index.test.ts b/tests/release-update-index.test.ts index f92e4a646..8d167a0dc 100644 --- a/tests/release-update-index.test.ts +++ b/tests/release-update-index.test.ts @@ -6,7 +6,7 @@ import { join } from "node:path"; import { fileURLToPath } from "node:url"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { APP_PACKAGE_TARGETS, ANDROID_APP_PACKAGE_TARGET } from "../scripts/app-package-targets.mjs"; -import { SERVER_PACKAGE_TARGETS } from "../scripts/server-package-targets.mjs"; +import { serverReleaseNames, SERVER_PACKAGE_TARGETS } from "../scripts/server-package-targets.mjs"; import { readReleaseArtifacts } from "../scripts/release-artifacts.mjs"; import { signUpdateIndex } from "../scripts/release-update-index.mjs"; @@ -24,14 +24,15 @@ beforeEach(() => { vi.stubEnv("PIIK_UPDATE_PUBLIC_KEY", publicHex); root = mkdtempSync(join(tmpdir(), "piik-update-index-")); for (const target of [...SERVER_PACKAGE_TARGETS, ...APP_PACKAGE_TARGETS, ANDROID_APP_PACKAGE_TARGET]) { - const server = SERVER_PACKAGE_TARGETS.some(candidate => candidate.id === target.id); - const artifact = `${target.id}.${target.id === "android-universal" ? "apk" : "zip"}`; + const serverTarget = SERVER_PACKAGE_TARGETS.find(candidate => candidate.id === target.id); + const server = serverTarget && serverReleaseNames(serverTarget, revision); + const artifact = server?.artifact ?? `piik-app-${target.id}.${target.id === "android-universal" ? "apk" : "zip"}`; writeFileSync(join(root, artifact), target.id); writeFileSync(join(root, `${target.id}.release.json`), JSON.stringify({ schema: 2, version, revision, target: target.id, artifact, artifactSha256: sha(target.id), - ...(server ? { manifest: `${target.id}.manifest.tsv`, manifestSha256: sha("manifest") } : {}), + ...(server ? { manifest: server.manifest, manifestSha256: sha("manifest") } : {}), })); - if (server) writeFileSync(join(root, `${target.id}.manifest.tsv`), "manifest"); + if (server) writeFileSync(join(root, server.manifest), "manifest"); else writeFileSync(join(root, `${artifact}.sha256`), `${sha(target.id)} ${artifact}\n`); } }); @@ -72,6 +73,18 @@ describe("signed update index", () => { expect(() => readReleaseArtifacts(root, version, revision, options)).toThrow("must both be present"); }); + it.each([["windows-amd64", "linux-amd64"], ["server", "server-linux-arm64"]])( + "refuses to sign a %s descriptor relabelled as %s", (first, second) => { + for (const [actual, claimed] of [[first, second], [second, first]] as const) { + const path = join(root, `${actual}.release.json`); + const descriptor = JSON.parse(readFileSync(path, "utf8")); + writeFileSync(path, JSON.stringify({ ...descriptor, target: claimed })); + } + expect(() => run()).toThrow("Release artifact name mismatch"); + expect(existsSync(join(root, "signed"))).toBe(false); + }, + ); + it("refuses unsigned updater publication", () => { const result = dryRun(""); expect(result.status).toBe(1); @@ -135,7 +148,7 @@ describe("signed update index", () => { rmSync(descriptor); expect(() => run()).toThrow("every registered Server and App target"); writeFileSync(descriptor, original); - writeFileSync(join(root, "windows-amd64.zip"), "changed bytes"); + writeFileSync(join(root, "piik-app-windows-amd64.zip"), "changed bytes"); expect(() => run()).toThrow("checksum mismatch"); expect(existsSync(join(root, "signed"))).toBe(false); }); diff --git a/tests/remote-input.test.ts b/tests/remote-input.test.ts index dd167efb3..54f9d6e86 100644 --- a/tests/remote-input.test.ts +++ b/tests/remote-input.test.ts @@ -4,6 +4,7 @@ import { picturePoint, rotatePicturePoint, rotatePictureDelta, type VideoRotatio import { INPUT_FRAME_BYTES } from "../src/shared/core-limits"; import { inputFrameFits, matchesRemoteShortcut, remoteInputStateSchema, remoteTextFits } from "../src/client/remote-control/protocol"; import { RemoteGamepad } from "../src/client/remote-control/gamepad"; +import { EncryptedInput } from "../src/client/remote-control/input-route"; it("recognizes only the selected local release chord outside IME composition", () => { const chord = { code: "F9", ctrlKey: true, altKey: true, metaKey: false, shiftKey: false, isComposing: false, @@ -30,6 +31,15 @@ it("admits text by both UTF-8 content and escaped command size", () => { expect(remoteTextFits('"'.repeat(1998) + "a")).toBe(false); }); +it("keeps its inbound budget when a peer's packet carries something that is not text", () => { + const input = new EncryptedInput({ endpointId: "a".repeat(32), secret: "00".repeat(32) }, { sent: 0n }, () => {}); + // Counted as text, an object's missing length made the budget NaN, and no later packet could exceed it. + input.receive({}); + expect(input.readyState).toBe("open"); + input.receive("A".repeat(8193)); + expect(input.readyState).toBe("closed"); +}); + class Channel extends EventTarget { readyState = "open"; bufferedAmount = 0; diff --git a/tests/watch-peer-errors.test.ts b/tests/watch-peer-errors.test.ts index bb84cc18c..680b00dda 100644 --- a/tests/watch-peer-errors.test.ts +++ b/tests/watch-peer-errors.test.ts @@ -125,11 +125,11 @@ test("actual Session explicit peer command retains the admitted root and reader stage.useWatch(activity.id, old); Object.assign(session, { view: { ...view, state: { watchActivities: [activity], publications: [], channel: { rooms: [] } } }, watchBytes: { read }, request }); try { - await session.joinWatch(activity.id, "peer"); - expect(commands).toEqual([{ type: "join_watch", roomId: activity.roomId, id: activity.id, mode: "peer" }]); + const joining = expect(session.joinWatch(activity.id, "peer")).rejects.toThrow("watch_source_unavailable"); + const hls = await attached; + await expect.poll(() => commands).toEqual([{ type: "join_watch", roomId: activity.roomId, id: activity.id, mode: "peer" }]); const player = session.getSnapshot().watchPlayers.get(activity.id)!; expect(player.mode).toBe("peer");expect(player).not.toBe(old); - const hls = await attached; const Loader = hls.config.loader,loader = new Loader(hls.config),failed=vi.fn(); loader.load({ url: `https://watch-media.invalid/${root.resourceId}`, responseType: "arraybuffer", type: LoaderContextType.MANIFEST }, { loadPolicy: { maxTimeToFirstByteMs: 1000, maxLoadTimeMs: 1000 } } as never, { onError: failed, onSuccess: vi.fn(), onTimeout: vi.fn() } as never); @@ -140,6 +140,7 @@ test("actual Session explicit peer command retains the admitted root and reader hls.trigger(Hls.Events.ERROR, { fatal: true, type: Hls.ErrorTypes.NETWORK_ERROR, details: Hls.ErrorDetails.FRAG_LOAD_ERROR, response: failed.mock.calls[0][0] } as never); await expect.poll(() => player.error).toBe("watch_source_unavailable"); + await joining; loader.destroy(); expect(activity.byteSource).toBe(root); expect(old.error).toBe("watch_media_unavailable"); diff --git a/tests/watch-playback.test.ts b/tests/watch-playback.test.ts index 7f540058b..64bc8c18f 100644 --- a/tests/watch-playback.test.ts +++ b/tests/watch-playback.test.ts @@ -114,6 +114,26 @@ test("a player without seek events publishes an observed paused scrub on the exi } finally { player.close(); } }); +test("an owner can publish its first ready sample and measures later movement from the previous rate", async () => { + vi.useFakeTimers(); + const state: WatchMediaState = { position: 0, paused: false, rate: 2, duration: 60, readyState: 1, ended: false, buffered: null }; + const player = new WatchPlayer("room", true, { read: async () => ({ ...state }), patch: vi.fn(), ready: vi.fn(), + listen: () => () => {}, close() {}, seekEvents: false }, vi.fn()); + const publish = vi.fn(); + try { + player.calibrate(0, 0, 0); await player.ready(); player.activate(publish); + state.position = 10; state.readyState = 3; + await vi.advanceTimersByTimeAsync(1000); + expect(publish).toHaveBeenCalledExactlyOnceWith(expect.objectContaining({ position: 10 })); + state.position = 12.25; state.rate = 1; + await vi.advanceTimersByTimeAsync(1000); + expect(publish).toHaveBeenCalledOnce(); + state.position = 13.75; + await vi.advanceTimersByTimeAsync(1000); + expect(publish).toHaveBeenCalledTimes(2); + } finally { player.close(); } +}); + test("an embedded viewer resumes at the current host anchor after a hidden interval", async () => { vi.useFakeTimers();let now=0;vi.spyOn(performance,'now').mockImplementation(()=>now); const state:WatchMediaState={position:10,paused:false,rate:1,duration:120,readyState:3,buffered:null,ended:false}; @@ -181,6 +201,14 @@ test("a local iframe scrub offers explicit resynchronization without periodic se player.update({ timeline: "media", position: 10, paused: false, rate: 1, anchorTime: 6000 }); await player.serialize(async () => {}); expect(state.paused).toBe(false); + player.update({ timeline: "media", position: 10, paused: true, rate: 1, anchorTime: 6000 }); + await player.serialize(async () => {}); + state.position = 12; now += 1000; + await vi.advanceTimersByTimeAsync(1000); + expect(player.blockedReason).toBeNull(); + state.position = 13; now += 1000; + await vi.advanceTimersByTimeAsync(1000); + expect(player.blockedReason).toBe("local-seek"); }finally{player.close();} }); @@ -212,6 +240,9 @@ test("late metadata and manual autoplay retry use the latest domain anchor; soun video.currentTime = 3.2; player.update({ timeline: "media" as const, position: 3, anchorTime: 9100, paused: true, rate: 0.5 }); expect(video.currentTime).toBe(3.2); + player.update({ timeline: "media", position: 3, anchorTime: 10100, paused: false, rate: 2 }); + await player.serialize(async () => {}); + expect(video.currentTime).toBe(3); } finally { player.close(); } expect(video.src).toBe(""); expect(vi.getTimerCount()).toBe(0); @@ -647,6 +678,21 @@ test.each(["pause", "close", "play"])("waits for the selected output before firs } finally { blocker(); release(); complete?.(); media.close(); await choosing; await playbackOutput.choose(""); } }); +test.each([["paused", 10], ["ended", 10], ["waiting", 10], ["playing", 12]] as const)( + "source loss freezes %s playback within its duration", async (mode, position) => { + const clock = vi.spyOn(performance, "now").mockReturnValue(0); + const video = Object.assign(new Video(), { currentTime: 10, duration: 12, readyState: 4, paused: mode === "paused", ended: mode === "ended" }); + vi.stubGlobal("document", { createElement: () => video }); + const player = new WatchPlayer("room", true, new HTMLVideoMedia("https://media.test/video.mp4", "file"), vi.fn()); + try { + await player.ready(); + if (mode === "waiting") video.dispatchEvent(new Event("waiting")); + clock.mockReturnValue(5000); + player.sourceUnavailable(); + expect(player.mediaState).toMatchObject({ position, paused: true }); + } finally { player.close(); } + }); + test.each(['resolve', 'reject'] as const)('source retirement freezes the owned clock across a pending page read (%s)', async completion => { vi.useFakeTimers(); let now = 0, changed: (event: WatchMediaEvent) => void = () => {}; diff --git a/tests/watch-presentation.test.ts b/tests/watch-presentation.test.ts index c4cdfe8bf..8bd93daf1 100644 --- a/tests/watch-presentation.test.ts +++ b/tests/watch-presentation.test.ts @@ -578,6 +578,20 @@ it.each([ expect(html).not.toContain(t("en", "channel.previewPage.reconnecting")); }); +it.each([true, false])("a picture retry is offered only while its room can be reached (available=%s)", available => { + setCopy({ lang: "en" }); + const html = renderToStaticMarkup(createElement(ChannelStage, { companion: "none", theaterMode: [false, vi.fn()], + sources: [{ kind: "screen", id: "picture", userId: "friend", name: "Friend", roomName: "Room", + source: { kind: "screen", name: "Owned picture" }, title: null, owned: false, localSource: false, + subscribed: true, paused: false, audience: [], waitingForInput: false, deliveryFailed: true, available }], + focusedId: null, canSubscribe: true, onFocus() {}, onWatch() {}, onUnwatch() {}, onRetryPicture() {}, async onPause() {}, onStop() {}, + onInputPolicy: async () => {}, onInputDecide: async () => {}, onInputSimultaneous: async () => {}, onInputShortcut: async () => ({ key: 1, available: false }), + })); + const retry = html.match(new RegExp("]*aria-label=\"" + t("en", "screen.retryPicture") + "\"[^>]*>"))?.[0]; + expect(retry).toBeDefined(); + expect(/\sdisabled(=|\s|>)|aria-disabled="true"/.test(retry!)).toBe(!available); +}); + it("offers picture help and stopping, but no retry, while a watched screen waits for an input", () => { setCopy({ lang: "en" }); const render = (waitingForInput: boolean) => renderToStaticMarkup(createElement(ChannelStage, { companion: "none", theaterMode: [false, vi.fn()], diff --git a/vite.config.ts b/vite.config.ts index 5d656fe8d..f74956e48 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -39,6 +39,7 @@ export default defineConfig({ // Local build output includes Browser profiles, not application entries. optimizeDeps: { entries: ["index.html", "site/**/*.html"] }, build: { + manifest: "vite-manifest.json", outDir: "build/channel-web", emptyOutDir: true, }, From 96f8bcfa3bc0af503866ae7110392e91cfe0044b Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Sun, 29 Nov 2026 06:40:29 -0500 Subject: [PATCH 2/4] docs(review): return the integrated playback and client queue --- .agents/handoff/to-claude.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.agents/handoff/to-claude.md b/.agents/handoff/to-claude.md index 07081556b..ae97b38bc 100644 --- a/.agents/handoff/to-claude.md +++ b/.agents/handoff/to-claude.md @@ -1,11 +1,30 @@ # Codex → Claude -Reviewed queue: `d75328e1`. `2ee97233` integrates the source-selection, local -audio, room submission and device-lifetime fixes. Please merge it before editing -their owners. Session remains with me for the reviewed following-record change. -The source-picker and room forms are available for your Escape/Back work. +Reviewed queue: `d75328e1`. Please merge through `531afeea`. `2ee97233` integrates +source selection, local audio, room submission and device lifetimes. `531afeea` +takes the reviewed following record and the other accepted client reductions. +Session, the source-picker and room forms are available for your next review. A finding count is a review inventory, not a product completion rate. +The receiving preference now waits for media readiness and room acknowledgement. +Initial subscription still completes on acknowledgement. In the error-player +replacement path, the pending action waits for readiness; the HLS fixture now +drives its loader concurrently and checks the typed rejection. The complete Web +run had 2,680 passes and that single stale-fixture timeout; after correcting its +event ordering, all 772 combined Session/HLS checks pass. Both TypeScript projects, +the production bundle and its single-entry manifest pass. Final desktop, phone +and launcher rendering checks retain the controls and theme. The combined diff +removes 842 net lines, chiefly unused copy and duplicated presentation owners. + +`531afeea` includes `6d761dc2`, `ff134eaf`, `6b471663`, `6975f712`, `25f32d98`, +`2f920bbd`, `8cb8f43e`, `407e2ca1`, the following-record commits with the readiness +correction, and the single HTML/bootstrap entry. It also fixes empty Markdown +links and mention-marker collisions, and shares package names between packaging +and release validation so a relabelled descriptor is refused before signing. +The new shared Rust/Browser cipher fixture remains separate: production calls +have agreed both ways, but the checked-in Rust fixture reader still needs its +own compilation. MPD projection also remains unmerged. + ## Latest Integration The address form is reachable from candidate selection and private preview From 214da1af34c49d02d783555f04562387006d2a12 Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Sun, 29 Nov 2026 06:47:24 -0500 Subject: [PATCH 3/4] test(input): share browser and native cipher fixtures --- prototype/channel-native/src/input/tests.rs | 10 +++++--- tests/fixtures/input-cipher.json | 9 +++++++ tests/remote-input.test.ts | 26 +++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/input-cipher.json diff --git a/prototype/channel-native/src/input/tests.rs b/prototype/channel-native/src/input/tests.rs index 59b70c247..028717650 100644 --- a/prototype/channel-native/src/input/tests.rs +++ b/prototype/channel-native/src/input/tests.rs @@ -1186,12 +1186,16 @@ fn browser_webcrypto_vector_authenticates_direction_epoch_and_sequence() { // key=00..1f, nonce=20..2b, seq=1, direction=0, ASCII simple UUID epoch. let secret = std::array::from_fn(|i| i as u8); let flow = Uuid::parse_str("0123456789abcdef0123456789abcdef").unwrap(); - let packet = "AAAAAAAAAAEgISIjJCUmJygpKiupGNIJHP04NDgPO6CiOol+MAJ012RUZOuDGCEWCIGW"; + let fixture: serde_json::Value = serde_json::from_str(include_str!( + "../../../../tests/fixtures/input-cipher.json" + )).unwrap(); + let packet = fixture["packet"].as_str().unwrap(); + let ready = serde_json::to_vec(&fixture["state"]).unwrap(); let mut cipher = Cipher::new(&secret); assert!(cipher.open(packet, Uuid::new_v4()).is_err()); assert_eq!(cipher.open(packet, flow).unwrap(), br#"{"type":"sync"}"#); assert!(cipher.open(packet, flow).is_err()); - let state = cipher.seal(br#"{"state":"ready"}"#, flow).unwrap(); + let state = cipher.seal(&ready, flow).unwrap(); let bytes = STANDARD.decode(&state).unwrap(); let plain = Aes256Gcm::new((&secret).into()) .decrypt( @@ -1202,7 +1206,7 @@ fn browser_webcrypto_vector_authenticates_direction_epoch_and_sequence() { }, ) .unwrap(); - assert_eq!(plain, br#"{"state":"ready"}"#); + assert_eq!(plain, ready); assert!( Cipher::new(&secret).open(&state, flow).is_err(), "reflected reply is not controller input" diff --git a/tests/fixtures/input-cipher.json b/tests/fixtures/input-cipher.json new file mode 100644 index 000000000..8948fdb0e --- /dev/null +++ b/tests/fixtures/input-cipher.json @@ -0,0 +1,9 @@ +{ + "packet": "AAAAAAAAAAEgISIjJCUmJygpKiupGNIJHP04NDgPO6CiOol+MAJ012RUZOuDGCEWCIGW", + "reply": "AAAAAAAAAAEOsCyXfyNd0rGAA3xGFvNKMkMtmMlc3xc/yShAT4vT8fQZHkUWXDqmlN0tpY4/SVyfMR357YR2X/INLu/ObL1v/1G9DQBjGR+BS+p4WWwH", + "state": { + "platform": "windows", + "mode": "ask", + "state": "ready" + } +} diff --git a/tests/remote-input.test.ts b/tests/remote-input.test.ts index 54f9d6e86..eb28ba77f 100644 --- a/tests/remote-input.test.ts +++ b/tests/remote-input.test.ts @@ -1,3 +1,4 @@ +import fixture from "./fixtures/input-cipher.json"; import { expect, it, vi } from "vitest"; import { RemoteInputSession } from "../src/client/remote-control/input-session"; import { picturePoint, rotatePicturePoint, rotatePictureDelta, type VideoRotation } from "../src/client/media/video-geometry"; @@ -544,3 +545,28 @@ it.each([ const point = picturePoint(video, inside.x, inside.y); expect(point?.x).toBeCloseTo(.2); expect(point?.y).toBeCloseTo(.5); }); + +it("exchanges sync and ready packets with the Native input cipher", async () => { + const epoch = "0123456789abcdef0123456789abcdef"; + const secret = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"; + const sent = vi.fn(); + const channel = new EncryptedInput({ endpointId: "a".repeat(32), secret }, { sent: 0n }, sent, epoch); + const nonce = vi.spyOn(crypto, "getRandomValues").mockImplementationOnce(bytes => { + (bytes as Uint8Array).set(Array.from({ length: 12 }, (_, i) => 32 + i)); + return bytes; + }); + try { + channel.send('{"type":"sync"}'); + await vi.waitFor(() => expect(sent).toHaveBeenCalledWith({ + id: "a".repeat(32), epoch, data: fixture.packet, + })); + } finally { + nonce.mockRestore(); + } + const message = new Promise(resolve => { + channel.addEventListener("message", event => resolve((event as MessageEvent).data), { once: true }); + }); + // Captured from Native Cipher::seal with the same synthetic key and epoch. + channel.receive(fixture.reply); + expect(remoteInputStateSchema.parse(JSON.parse(await message))).toMatchObject(fixture.state); +}); From 0c8eca7ae21240a696d9a60f98343b6c8b9cbb03 Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Sun, 29 Nov 2026 06:54:13 -0500 Subject: [PATCH 4/4] fix(watch): project only supported playback data into viewer manifests --- .agents/handoff/to-claude.md | 18 ++++- prototype/channel-mpd/README.md | 4 +- prototype/channel-mpd/resolver-entry.js | 99 ++++++++++++++++++++----- prototype/channel-mpd/src/resolver.js | 8 +- prototype/channel-mpd/src/tests.rs | 28 +++++++ 5 files changed, 131 insertions(+), 26 deletions(-) diff --git a/.agents/handoff/to-claude.md b/.agents/handoff/to-claude.md index ae97b38bc..0c7963661 100644 --- a/.agents/handoff/to-claude.md +++ b/.agents/handoff/to-claude.md @@ -21,9 +21,21 @@ removes 842 net lines, chiefly unused copy and duplicated presentation owners. correction, and the single HTML/bootstrap entry. It also fixes empty Markdown links and mention-marker collisions, and shares package names between packaging and release validation so a relabelled descriptor is refused before signing. -The new shared Rust/Browser cipher fixture remains separate: production calls -have agreed both ways, but the checked-in Rust fixture reader still needs its -own compilation. MPD projection also remains unmerged. +`214da1af` integrates the shared Rust/Browser cipher fixture. The new Rust reader +was compiled and run, and production Browser send/receive passed with the shared +packets and a state its parser accepts. + +The Native MPD projection is now integrated too. It generates only selected +clear-VOD playback structure with opaque resource and representation references. +Source comments, informational metadata and events do not reach the viewer. +Required features outside the existing selected audio/video model are reported +unsupported, rather than silently removed. Shaka 5.3.6 loaded all four original +and projected fixtures in Chrome; selected resources, byte ranges, segment times +and five-period continuity were compared. The canonical bundle check and all +nine MPD Cargo tests pass with the actual library rebuilt. This establishes +manifest parsing and resource equivalence; no new site-specific decode result +is claimed. Generated bundles must retain the repository's LF policy when a +temporary standalone test source has no `.gitattributes`. ## Latest Integration diff --git a/prototype/channel-mpd/README.md b/prototype/channel-mpd/README.md index 70dba92ef..ba3da7f88 100644 --- a/prototype/channel-mpd/README.md +++ b/prototype/channel-mpd/README.md @@ -1,4 +1,4 @@ -# Native MPD resources +# Native MPD resources This crate resolves explicitly selected tracks from an immutable, clear static MPD. The approved page owns the input and opaque choice IDs. Public @@ -17,6 +17,8 @@ and stack budgets. The App currently supplies a 64 MiB heap and 1 MiB stack engineering budget; these are not DASH requirements. Encoded fragment limits and 64 KiB read windows belong to the shared media-resource owner. +Viewer manifests contain the selected clear VOD tracks, playback timing and admitted media, initialization and index resources. Required descriptors outside the supported audio/video presentation return an unsupported-manifest result. + From the repository root: ```sh diff --git a/prototype/channel-mpd/resolver-entry.js b/prototype/channel-mpd/resolver-entry.js index b962d7d0d..0cf39c0d2 100644 --- a/prototype/channel-mpd/resolver-entry.js +++ b/prototype/channel-mpd/resolver-entry.js @@ -281,22 +281,85 @@ globalThis.serializeMpd = (xml, uri, indicesJson, bindingsJson) => { if (!children(adaptation, "Representation").length) period.removeChild(adaptation); } - for (const period of children(d.root, "Period")) - for (const name of [ - "BaseURL", - "SegmentBase", - "SegmentTemplate", - "SegmentList", - ]) - for (const n of children(period, name)) period.removeChild(n); - for (const name of [ - "BaseURL", - "Location", - "UTCTiming", - "ContentSteering", - "PatchLocation", - "Metrics", - ]) - for (const n of children(d.root, name)) d.root.removeChild(n); - return new XMLSerializer().serializeToString(d.root); + const ns = "urn:mpeg:dash:schema:mpd:2011"; + const output = d.root.ownerDocument.implementation.createDocument(ns, "MPD", null); + const fields = { + MPD: "mediaPresentationDuration minBufferTime", + Period: "start duration", + AdaptationSet: "contentType mimeType codecs width height frameRate audioSamplingRate lang", + Representation: "mimeType codecs bandwidth width height frameRate audioSamplingRate", + SegmentBase: "indexRange indexRangeExact timescale presentationTimeOffset", + SegmentList: "timescale presentationTimeOffset startNumber duration", + Initialization: "sourceURL range", + SegmentURL: "media mediaRange", + S: "t d r", + }; + const structure = { + MPD: ["Period"], + Period: ["AdaptationSet"], + AdaptationSet: ["Representation"], + Representation: ["BaseURL", "SegmentBase", "SegmentList"], + SegmentBase: ["Initialization"], + SegmentList: ["Initialization", "SegmentTimeline", "SegmentURL"], + SegmentTimeline: ["S"], + }; + const logicalIds = new Map(); + function project(source, dest) { + const name = dest.localName; + for (const prop of children(source, "EssentialProperty")) { + const scheme = prop.getAttribute("schemeIdUri"); + const node = output.createElementNS(ns, "EssentialProperty"); + node.setAttribute("schemeIdUri", scheme); + if (["urn:mpeg:mpegB:cicp:TransferCharacteristics", + "urn:mpeg:mpegB:cicp:ColourPrimaries", + "urn:mpeg:mpegB:cicp:MatrixCoefficients"].includes(scheme)) { + const value = Number(prop.getAttribute("value")); + if (!Number.isSafeInteger(value)) throw Error("unsupported_mpd"); + node.setAttribute("value", String(value)); + } else if (scheme !== "urn:mpeg:dash:ssr:2023") { + throw Error("unsupported_mpd"); + } + dest.appendChild(node); + } + if (name === "AdaptationSet" || name === "Representation") { + for (const channel of children(source, "AudioChannelConfiguration")) { + const scheme = channel.getAttribute("schemeIdUri"); + const value = channel.getAttribute("value"); + let normalized; + if (scheme === "urn:mpeg:dash:outputChannelPositionList:2012") { + normalized = String(value.trim().split(/ +/).length); + } else if (["urn:mpeg:dash:23003:3:audio_channel_configuration:2011", + "urn:dts:dash:audio_channel_configuration:2012", + "urn:mpeg:mpegB:cicp:ChannelConfiguration"].includes(scheme)) { + normalized = parseInt(value, 10).toString(10); + } else if (["tag:dolby.com,2015:dash:audio_channel_configuration:2015", + "tag:dolby.com,2014:dash:audio_channel_configuration:2011", + "urn:dolby:dash:audio_channel_configuration:2011"].includes(scheme)) { + normalized = parseInt(value, 16).toString(16); + } else continue; + if (normalized === "NaN") continue; + const node = output.createElementNS(ns, "AudioChannelConfiguration"); + node.setAttribute("schemeIdUri", scheme === "urn:mpeg:dash:outputChannelPositionList:2012" + ? "urn:mpeg:dash:23003:3:audio_channel_configuration:2011" : scheme); + node.setAttribute("value", normalized); + dest.appendChild(node); + } + } + for (const field of fields[name]?.split(" ") || []) + if (source.hasAttribute(field)) dest.setAttribute(field, source.getAttribute(field)); + if (name === "Representation") { + const id = source.getAttribute("id"); + if (!logicalIds.has(id)) logicalIds.set(id, String(logicalIds.size + 1)); + dest.setAttribute("id", logicalIds.get(id)); + } + if (name === "BaseURL") dest.textContent = source.textContent; + for (const childName of structure[name] || []) + for (const child of children(source, childName)) { + const node = output.createElementNS(ns, childName); + dest.appendChild(node); + project(child, node); + } + } + project(d.root, output.documentElement); + return new XMLSerializer().serializeToString(output.documentElement); }; diff --git a/prototype/channel-mpd/src/resolver.js b/prototype/channel-mpd/src/resolver.js index a86fac5c9..c3b814a75 100644 --- a/prototype/channel-mpd/src/resolver.js +++ b/prototype/channel-mpd/src/resolver.js @@ -1,8 +1,8 @@ -(()=>{var Lu=Object.create;var Nt=Object.defineProperty;var Uu=Object.getOwnPropertyDescriptor;var qu=Object.getOwnPropertyNames;var Mu=Object.getPrototypeOf,Pu=Object.prototype.hasOwnProperty;var K=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(u){throw t=0,u}};var ku=(e,t,u,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of qu(t))!Pu.call(e,n)&&n!==u&&Nt(e,n,{get:()=>t[n],enumerable:!(r=Uu(t,n))||r.enumerable});return e};var De=(e,t,u)=>(u=e!=null?Lu(Mu(e)):{},ku(t||!e||!e.__esModule?Nt(u,"default",{value:e,enumerable:!0}):u,e));var Oe=K((mn,Tt)=>{var he;typeof window<"u"?he=window:typeof global<"u"?he=global:typeof self<"u"?he=self:he={};Tt.exports=he});var ue=K($=>{"use strict";function zu(e,t,u){if(u===void 0&&(u=Array.prototype),e&&typeof u.find=="function")return u.find.call(e,t);for(var r=0;r{var et=ue(),X=et.find,Ae=et.NAMESPACE,re=et.tagNamePattern;function ju(e){return e!==""}function $u(e){return e?e.split(/[\t\n\f\r ]+/).filter(ju):[]}function Yu(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function It(e){if(!e)return[];var t=$u(e);return Object.keys(t.reduce(Yu,{}))}function Wu(e){return function(t){return e&&e.indexOf(t)!==-1}}function ve(e,t){for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(t[u]=e[u])}function k(e,t){var u=e.prototype;if(!(u instanceof t)){let n=function(){};var r=n;n.prototype=t.prototype,n=new n,ve(u,n),e.prototype=u=n}u.constructor!=e&&(typeof e!="function"&&console.error("unknown Class:"+e),u.constructor=e)}var V={},z=V.ELEMENT_NODE=1,ne=V.ATTRIBUTE_NODE=2,ge=V.TEXT_NODE=3,qt=V.CDATA_SECTION_NODE=4,Mt=V.ENTITY_REFERENCE_NODE=5,Zu=V.ENTITY_NODE=6,tt=V.PROCESSING_INSTRUCTION_NODE=7,ut=V.COMMENT_NODE=8,Pt=V.DOCUMENT_NODE=9,kt=V.DOCUMENT_TYPE_NODE=10,Y=V.DOCUMENT_FRAGMENT_NODE=11,Ju=V.NOTATION_NODE=12,L={},x={},An=L.INDEX_SIZE_ERR=(x[1]="Index size error",1),En=L.DOMSTRING_SIZE_ERR=(x[2]="DOMString size error",2),P=L.HIERARCHY_REQUEST_ERR=(x[3]="Hierarchy request error",3),vn=L.WRONG_DOCUMENT_ERR=(x[4]="Wrong document",4),Rt=L.INVALID_CHARACTER_ERR=(x[5]="Invalid character",5),bn=L.NO_DATA_ALLOWED_ERR=(x[6]="No data allowed",6),Cn=L.NO_MODIFICATION_ALLOWED_ERR=(x[7]="No modification allowed",7),Vt=L.NOT_FOUND_ERR=(x[8]="Not found",8),Nn=L.NOT_SUPPORTED_ERR=(x[9]="Not supported",9),Ot=L.INUSE_ATTRIBUTE_ERR=(x[10]="Attribute in use",10),H=L.INVALID_STATE_ERR=(x[11]="Invalid state",11),Tn=L.SYNTAX_ERR=(x[12]="Syntax error",12),Sn=L.INVALID_MODIFICATION_ERR=(x[13]="Invalid modification",13),yn=L.NAMESPACE_ERR=(x[14]="Invalid namespace",14),wn=L.INVALID_ACCESS_ERR=(x[15]="Invalid access",15);function E(e,t){if(t instanceof Error)var u=t;else u=this,Error.call(this,x[e]),this.message=x[e],Error.captureStackTrace&&Error.captureStackTrace(this,E);return u.code=e,t&&(this.message=this.message+": "+t),u}E.prototype=Error.prototype;ve(L,E);function W(){}W.prototype={length:0,item:function(e){return e>=0&&e=0){for(var n=t.length-1;r0},lookupPrefix:function(e){for(var t=this;t;){var u=t._nsMap;if(u){for(var r in u)if(Object.prototype.hasOwnProperty.call(u,r)&&u[r]===e)return r}t=t.nodeType==ne?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var u=t._nsMap;if(u&&Object.prototype.hasOwnProperty.call(u,e))return u[e];t=t.nodeType==ne?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function Xt(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}ve(V,b);ve(V,b.prototype);function Ue(e,t){return F(e,null,{enter:function(u){return t(u)?F.STOP:!0}})===F.STOP}function F(e,t,u){for(var r=[{node:e,context:t,phase:F.ENTER}];r.length>0;){var n=r.pop();if(n.phase===F.ENTER){var o=u.enter(n.node,n.context);if(o===F.STOP)return F.STOP;if(r.push({node:n.node,context:o,phase:F.EXIT}),o==null)continue;for(var i=n.node.lastChild;i;)r.push({node:i,context:o,phase:F.ENTER}),i=i.previousSibling}else u.exit&&u.exit(n.node,n.context)}}F.STOP=Symbol("walkDOM.STOP");F.ENTER=0;F.EXIT=1;function be(){this.ownerDocument=this}function Ku(e,t,u){e&&e._inc++;var r=u.namespaceURI;r===Ae.XMLNS&&(t._nsMap[u.prefix?u.localName:""]=u.value)}function jt(e,t,u,r){e&&e._inc++;var n=u.namespaceURI;n===Ae.XMLNS&&delete t._nsMap[u.prefix?u.localName:""]}function Pe(e,t,u){if(e&&e._inc){e._inc++;var r=t.childNodes;if(u)r[r.length++]=u;else{for(var n=t.firstChild,o=0;n;)r[o++]=n,n=n.nextSibling;r.length=o,delete r[r.length]}}}function $t(e,t){var u=t.previousSibling,r=t.nextSibling;return u?u.nextSibling=r:e.firstChild=r,r?r.previousSibling=u:e.lastChild=u,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Pe(e.ownerDocument,e),t}function er(e){return e&&(e.nodeType===b.DOCUMENT_NODE||e.nodeType===b.DOCUMENT_FRAGMENT_NODE||e.nodeType===b.ELEMENT_NODE)}function tr(e){return e&&(j(e)||nt(e)||Z(e)||e.nodeType===b.DOCUMENT_FRAGMENT_NODE||e.nodeType===b.COMMENT_NODE||e.nodeType===b.PROCESSING_INSTRUCTION_NODE)}function Z(e){return e&&e.nodeType===b.DOCUMENT_TYPE_NODE}function j(e){return e&&e.nodeType===b.ELEMENT_NODE}function nt(e){return e&&e.nodeType===b.TEXT_NODE}function _t(e,t){var u=e.childNodes||[];if(X(u,j)||Z(t))return!1;var r=X(u,Z);return!(t&&r&&u.indexOf(r)>u.indexOf(t))}function Lt(e,t){var u=e.childNodes||[];function r(o){return j(o)&&o!==t}if(X(u,r))return!1;var n=X(u,Z);return!(t&&n&&u.indexOf(n)>u.indexOf(t))}function ur(e,t,u){if(!er(e))throw new E(P,"Unexpected parent node type "+e.nodeType);if(u&&u.parentNode!==e)throw new E(Vt,"child not in parent");if(!tr(t)||Z(t)&&e.nodeType!==b.DOCUMENT_NODE)throw new E(P,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function rr(e,t,u){var r=e.childNodes||[],n=t.childNodes||[];if(t.nodeType===b.DOCUMENT_FRAGMENT_NODE){var o=n.filter(j);if(o.length>1||X(n,nt))throw new E(P,"More than one element or text in fragment");if(o.length===1&&!_t(e,u))throw new E(P,"Element in fragment can not be inserted before doctype")}if(j(t)&&!_t(e,u))throw new E(P,"Only one element can be added and only after doctype");if(Z(t)){if(X(r,Z))throw new E(P,"Only one doctype is allowed");var i=X(r,j);if(u&&r.indexOf(i)1||X(n,nt))throw new E(P,"More than one element or text in fragment");if(o.length===1&&!Lt(e,u))throw new E(P,"Element in fragment can not be inserted before doctype")}if(j(t)&&!Lt(e,u))throw new E(P,"Only one element can be added and only after doctype");if(Z(t)){let a=function(c){return Z(c)&&c!==u};var s=a;if(X(r,a))throw new E(P,"Only one doctype is allowed");var i=X(r,j);if(u&&r.indexOf(i)0&&Ue(u.documentElement,function(n){if(n!==u&&n.nodeType===z){var o=n.getAttribute("class");if(o){var i=e===o;if(!i){var s=It(o);i=t.every(Wu(s))}i&&r.push(n)}}}),r})},createElement:function(e){var t=new ee;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new W;var u=t.attributes=new Le;return u._ownerElement=t,t},createDocumentFragment:function(){var e=new Ve;return e.ownerDocument=this,e.childNodes=new W,e},createTextNode:function(e){var t=new it;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ot;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf("]]>")!==-1)throw new E(Rt,'data contains "]]>"');var t=new at;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var u=new ct;return u.ownerDocument=this,u.tagName=u.nodeName=u.target=e,u.nodeValue=u.data=t,u},createAttribute:function(e){var t=new Me;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!re.test(e))throw new E(Rt,'not a valid xml name "'+e+'"');var t=new st;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var u=new ee,r=t.split(":"),n=u.attributes=new Le;return u.childNodes=new W,u.ownerDocument=this,u.nodeName=t,u.tagName=t,u.namespaceURI=e,r.length==2?(u.prefix=r[0],u.localName=r[1]):u.localName=t,n._ownerElement=u,u},createAttributeNS:function(e,t){var u=new Me,r=t.split(":");return u.ownerDocument=this,u.nodeName=t,u.name=t,u.namespaceURI=e,u.specified=!0,r.length==2?(u.prefix=r[0],u.localName=r[1]):u.localName=t,u}};k(be,b);function ee(){this._nsMap={}}ee.prototype={nodeType:z,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var u=this.ownerDocument.createAttribute(e);u.value=u.nodeValue=""+t,this.setAttributeNode(u)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===Y?this.insertBefore(e,null):nr(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var u=this.getAttributeNodeNS(e,t);u&&this.removeAttributeNode(u)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var u=this.getAttributeNodeNS(e,t);return u&&u.value||""},setAttributeNS:function(e,t,u){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+u,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new ie(this,function(t){var u=[];return Ue(t,function(r){r!==t&&r.nodeType==z&&(e==="*"||r.tagName==e)&&u.push(r)}),u})},getElementsByTagNameNS:function(e,t){return new ie(this,function(u){var r=[];return Ue(u,function(n){n!==u&&n.nodeType===z&&(e==="*"||n.namespaceURI===e)&&(t==="*"||n.localName==t)&&r.push(n)}),r})}};be.prototype.getElementsByTagName=ee.prototype.getElementsByTagName;be.prototype.getElementsByTagNameNS=ee.prototype.getElementsByTagNameNS;k(ee,b);function Me(){}Me.prototype.nodeType=ne;k(Me,b);function Ce(){}Ce.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(x[P])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,u){var r=this.data.substring(0,e),n=this.data.substring(e+t);u=r+u+n,this.nodeValue=this.data=u,this.length=u.length}};k(Ce,b);function it(){}it.prototype={nodeName:"#text",nodeType:ge,splitText:function(e){var t=this.data,u=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(u);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};k(it,Ce);function ot(){}ot.prototype={nodeName:"#comment",nodeType:ut};k(ot,Ce);function at(){}at.prototype={nodeName:"#cdata-section",nodeType:qt};k(at,Ce);function ke(){}ke.prototype.nodeType=kt;k(ke,b);function Wt(){}Wt.prototype.nodeType=Ju;k(Wt,b);function Zt(){}Zt.prototype.nodeType=Zu;k(Zt,b);function st(){}st.prototype.nodeType=Mt;k(st,b);function Ve(){}Ve.prototype.nodeName="#document-fragment";Ve.prototype.nodeType=Y;k(Ve,b);function ct(){}ct.prototype.nodeType=tt;k(ct,b);function Jt(){}Jt.prototype.serializeToString=function(e,t,u,r){return Qt.call(e,t,u,r)};b.prototype.toString=Qt;function Qt(e,t,u){var r=!!u&&!!u.requireWellFormed,n=[],o=this.nodeType==9&&this.documentElement||this,i=o.prefix,s=o.namespaceURI;if(s&&i==null){var i=o.lookupPrefix(s);if(i==null)var a=[{namespace:s,prefix:null}]}return lt(this,n,e,t,a,r),n.join("")}function Ut(e,t,u){var r=e.prefix||"",n=e.namespaceURI;if(!n||r==="xml"&&n===Ae.XML||n===Ae.XMLNS)return!1;for(var o=u.length;o--;){var i=u[o];if(i.prefix===r)return i.namespace!==n}return!0}function _e(e,t,u,r){if(r&&!re.test(t))throw new E(H,'The attribute name "'+t+'" is not a valid XML QName');e.push(" ",t,'="',u.replace(/[<>&"\t\n\r]/g,Xt),'"')}function lt(e,t,u,r,n,o){n||(n=[]),F(e,{ns:n,isHTML:u},{enter:function(i,s){var a=s.ns,c=s.isHTML;if(r)if(i=r(i),i){if(typeof i=="string")return t.push(i),null}else return null;switch(i.nodeType){case z:var l=i.attributes,p=l.length,d=i.tagName;c=Ae.isHTML(i.namespaceURI)||c;var h=d;if(!c&&!i.prefix&&i.namespaceURI){for(var m,f=0;f=0;D--){var N=a[D];if(N.prefix===""&&N.namespace===i.namespaceURI){m=N.namespace;break}}if(m!==i.namespaceURI)for(var D=a.length-1;D>=0;D--){var N=a[D];if(N.namespace===i.namespaceURI){N.prefix&&(h=N.prefix+":"+d);break}}}if(o&&!re.test(h))throw new E(H,'The element name "'+h+'" is not a valid XML QName');t.push("<",h);for(var v=a.slice(),g=0;g"),c&&/^script$/i.test(d)){for(;C;)C.data?t.push(C.data):lt(C,t,c,r,v.slice(),o),C=C.nextSibling;return t.push(""),null}return{ns:v,isHTML:c,tag:h}}else return t.push("/>"),null;case Pt:case Y:return{ns:a.slice(),isHTML:c,tag:null};case ne:return _e(t,i.name,i.value,o),null;case ge:return t.push(i.data.replace(/[<&>]/g,Xt)),null;case qt:if(o&&i.data.indexOf("]]>")!==-1)throw new E(H,'The CDATASection data contains "]]>"');return t.push("/g,"]]]]>"),"]]>"),null;case ut:if(o&&i.data.indexOf("-->")!==-1)throw new E(H,'The comment node data contains "-->"');return t.push(""),null;case kt:if(o){if(!re.test(i.name))throw new E(H,'The doctype name "'+i.name+'" is not a valid XML Name');if(i.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(i.publicId))throw new E(H,"DocumentType publicId is not a valid PubidLiteral");if(i.systemId&&!/^("[^"]*"|'[^']*')$/.test(i.systemId))throw new E(H,"DocumentType systemId is not a valid SystemLiteral");if(i.internalSubset&&i.internalSubset.indexOf("]>")!==-1)throw new E(H,'DocumentType internalSubset contains "]>"')}var S=i.publicId,T=i.systemId;if(t.push("");else if(T&&T!=".")t.push(" SYSTEM ",T,">");else{var de=i.internalSubset;de&&t.push(" [",de,"]"),t.push(">")}return null;case tt:if(o){if(!re.test(i.target)||i.target.indexOf(":")!==-1||i.target.toLowerCase()==="xml")throw new E(H,'The processing instruction target "'+i.target+'" is not a valid XML NCName or is reserved');if(i.data.indexOf("?>")!==-1)throw new E(H,'The ProcessingInstruction data contains "?>"')}return t.push(""),null;case Mt:if(o&&!re.test(i.nodeName))throw new E(H,'The entity reference name "'+i.nodeName+'" is not a valid XML Name');return t.push("&",i.nodeName,";"),null;default:return t.push("??",i.nodeName),null}},exit:function(i,s){s&&s.tag&&t.push("")}})}function ir(e,t,u){var r;return F(t,null,{enter:function(n,o){var i=n.cloneNode(!1);i.ownerDocument=e,i.parentNode=null,o===null?r=i:o.appendChild(i);var s=n.nodeType===ne||u;return s?i:null}}),r}function Kt(e,t,u){var r;return F(t,null,{enter:function(n,o){var i=new n.constructor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var a=n[s];typeof a!="object"&&a!=i[s]&&(i[s]=a)}n.childNodes&&(i.childNodes=new W),i.ownerDocument=e;var c=u;switch(i.nodeType){case z:var l=n.attributes,p=i.attributes=new Le,d=l.length;p._ownerElement=i;for(var h=0;h{"use strict";var tu=ue().freeze;Ne.XML_ENTITIES=tu({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Ne.HTML_ENTITIES=tu({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` -`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Ne.entityMap=Ne.HTML_ENTITIES});var au=K(mt=>{var ye=ue().NAMESPACE,ft=ue().tagNamePattern,oe=0,Q=1,ae=2,Te=3,se=4,ce=5,Se=6,Ge=7;function le(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,le)}le.prototype=new Error;le.prototype.name=le.name;function iu(){}iu.prototype={parse:function(e,t,u){var r=this.domBuilder;r.startDocument(),lr(t,t={}),or(e,t,u,r,this.errorHandler),r.endDocument()}};function or(e,t,u,r,n){function o(w){if(w>65535){w-=65536;var G=55296+(w>>10),_u=56320+(w&1023);return String.fromCharCode(G,_u)}else return String.fromCharCode(w)}function i(w){var G=w.slice(1,-1);return Object.hasOwnProperty.call(u,G)?u[G]:G.charAt(0)==="#"?o(parseInt(G.substr(1).replace("x","0x"))):(n.error("entity not found:"+w),w)}function s(w){if(w>f){var G=e.substring(f,w).replace(/&#?\w+;/g,i);d&&a(f),r.characters(G,0,w-f),f=w}}function a(w,G){for(;w>=l&&(G=p.exec(e));)c=G.index,l=c+G[0].length,d.lineNumber++;d.columnNumber=w-c+1}for(var c=0,l=0,p=/.*(?:\r\n?|\n)|.*$/g,d=r.locator,h=[{currentNSMap:t}],m={},f=0;;){try{var D=e.indexOf("<",f);if(D<0){if(!e.substr(f).match(/^\s*$/)){var N=r.doc,v=N.createTextNode(e.substr(f));N.appendChild(v),r.currentElement=v}return}switch(D>f&&s(D),e.charAt(D+1)){case"/":var T=e.indexOf(">",D+3),g=e.substring(D+2,T).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,"$1"),A=h.pop();T<0?(g=e.substring(D+2).replace(/[\s<].*/,""),n.error("end tag name: "+g+" is not complete:"+A.tagName),T=D+1+g.length):g.match(/\sf?f=T:s(Math.max(D,f)+1)}}function ru(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function ar(e,t,u,r,n,o){function i(h,m,f){u.attributeNames.hasOwnProperty(h)&&o.fatalError("Attribute "+h+" redefined"),u.addValue(h,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),f)}for(var s,a,c=++t,l=oe;;){var p=e.charAt(c);if(l===oe&&p==="<")throw new Error("unexpected < in tag name: "+e.slice(t,c));switch(p){case"=":if(l===Q)s=e.slice(t,c),l=Te;else if(l===ae)l=Te;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(l===Te||l===Q)if(l===Q&&(o.warning('attribute value must after "="'),s=e.slice(t,c)),t=c+1,c=e.indexOf(p,t),c>0)a=e.slice(t,c),i(s,a,t-1),l=ce;else throw new Error("attribute value no end '"+p+"' match");else if(l==se)a=e.slice(t,c),i(s,a,t),o.warning('attribute "'+s+'" missed start quot('+p+")!!"),t=c+1,l=ce;else throw new Error('attribute value must after "="');break;case"/":switch(l){case oe:u.setTagName(e.slice(t,c));case ce:case Se:case Ge:l=Ge,u.closed=!0;case se:case Q:break;case ae:u.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==oe&&u.setTagName(e.slice(t,c)),c;case">":switch(l){case oe:u.setTagName(e.slice(t,c));case ce:case Se:case Ge:break;case se:case Q:a=e.slice(t,c),a.slice(-1)==="/"&&(u.closed=!0,a=a.slice(0,-1));case ae:l===ae&&(a=s),l==se?(o.warning('attribute "'+a+'" missed quot(")!'),i(s,a,t)):((!ye.isHTML(r[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+a+'" missed value!! "'+a+'" instead!!'),i(a,a,t));break;case Te:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case oe:u.setTagName(e.slice(t,c)),l=Se;break;case Q:s=e.slice(t,c),l=ae;break;case se:var a=e.slice(t,c);o.warning('attribute "'+a+'" missed quot(")!!'),i(s,a,t);case ce:l=Se;break}else switch(l){case ae:var d=u.tagName;(!ye.isHTML(r[""])||!s.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),i(s,s,t),t=c,l=Q;break;case ce:o.warning('attribute space is required"'+s+'"!!');case Se:l=Q,t=c;break;case Te:l=se,t=c;break;case Ge:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function nu(e,t,u){for(var r=e.tagName,n=null,p=e.length;p--;){var o=e[p],i=o.qName,s=o.value,d=i.indexOf(":");if(d>0)var a=o.prefix=i.slice(0,d),c=i.slice(d+1),l=a==="xmlns"&&c;else c=i,a=null,l=i==="xmlns"&&"";o.localName=c,l!==!1&&(n==null&&(n={},u=Object.create(u)),u[l]=n[l]=s,o.uri=ye.XMLNS,t.startPrefixMapping(l,s))}for(var p=e.length;p--;){o=e[p];var a=o.prefix;a&&(a==="xml"&&(o.uri=ye.XML),a!=="xmlns"&&(o.uri=u[a||""]))}var d=r.indexOf(":");d>0?(a=e.prefix=r.slice(0,d),c=e.localName=r.slice(d+1)):(a=null,c=e.localName=r);var h=e.uri=u[a||""];if(t.startElement(h,c,r,e),e.closed){if(t.endElement(h,c,r),n)for(a in n)Object.prototype.hasOwnProperty.call(n,a)&&t.endPrefixMapping(a)}else return e.currentNSMap=u,e.localNSMap=n,!0}function sr(e,t,u,r,n){if(/^(?:script|textarea)$/i.test(u)){var o=e.indexOf("",t),i=e.substring(t+1,o);if(/[&<]/.test(i))return/^script$/i.test(u)?(n.characters(i,0,i.length),o):(i=i.replace(/&#?\w+;/g,r),n.characters(i,0,i.length),o)}return t+1}function cr(e,t,u,r){var n=r[u];return n==null&&(n=e.lastIndexOf(""),n",t+4);return o>t?(u.comment(e,t+4,o-t-4),o+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(e.substr(t+3,6)=="CDATA["){var o=e.indexOf("]]>",t+9);return u.startCDATA(),u.characters(e,t+9,o-t-9),u.endCDATA(),o+3}var i=mr(e,t),s=i.length;if(s>1&&/!doctype/i.test(i[0][0])){var a=i[1][0],c=!1,l=!1;s>3&&(/^public$/i.test(i[2][0])?(c=i[3][0],l=s>4&&i[4][0]):/^system$/i.test(i[2][0])&&(l=i[3][0]));var p=i[s-1];return u.startDTD(a,c,l),u.endDTD(),p.index+p[0].length}}return-1}function fr(e,t,u){var r=e.indexOf("?>",t);if(r){var n=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(n){var o=n[0].length;return u.processingInstruction(n[1],n[2]),r+2}else return-1}return-1}function ou(){this.attributeNames={}}ou.prototype={setTagName:function(e){if(!ft.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,u){if(!ft.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:u}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function mr(e,t){var u,r=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=t,n.exec(e);u=n.exec(e);)if(r.push(u),u[1])return r}mt.XMLReader=iu;mt.ParseError=le});var du=K(He=>{var dr=ue(),Dr=pt(),su=uu(),pu=au(),hr=Dr.DOMImplementation,cu=dr.NAMESPACE,gr=pu.ParseError,Ar=pu.XMLReader;function fu(e){return e.replace(/\r[\n\u0085]/g,` +(()=>{var Lu=Object.create;var Tt=Object.defineProperty;var Uu=Object.getOwnPropertyDescriptor;var qu=Object.getOwnPropertyNames;var Mu=Object.getPrototypeOf,Pu=Object.prototype.hasOwnProperty;var re=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(u){throw t=0,u}};var ku=(e,t,u,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of qu(t))!Pu.call(e,n)&&n!==u&&Tt(e,n,{get:()=>t[n],enumerable:!(r=Uu(t,n))||r.enumerable});return e};var Ae=(e,t,u)=>(u=e!=null?Lu(Mu(e)):{},ku(t||!e||!e.__esModule?Tt(u,"default",{value:e,enumerable:!0}):u,e));var xe=re((mn,St)=>{var Ee;typeof window<"u"?Ee=window:typeof global<"u"?Ee=global:typeof self<"u"?Ee=self:Ee={};St.exports=Ee});var oe=re(Z=>{"use strict";function zu(e,t,u){if(u===void 0&&(u=Array.prototype),e&&typeof u.find=="function")return u.find.call(e,t);for(var r=0;r{var ut=oe(),Y=ut.find,be=ut.NAMESPACE,ae=ut.tagNamePattern;function ju(e){return e!==""}function $u(e){return e?e.split(/[\t\n\f\r ]+/).filter(ju):[]}function Yu(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function Rt(e){if(!e)return[];var t=$u(e);return Object.keys(t.reduce(Yu,{}))}function Wu(e){return function(t){return e&&e.indexOf(t)!==-1}}function Ne(e,t){for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(t[u]=e[u])}function G(e,t){var u=e.prototype;if(!(u instanceof t)){let n=function(){};var r=n;n.prototype=t.prototype,n=new n,Ne(u,n),e.prototype=u=n}u.constructor!=e&&(typeof e!="function"&&console.error("unknown Class:"+e),u.constructor=e)}var z={},H=z.ELEMENT_NODE=1,se=z.ATTRIBUTE_NODE=2,ve=z.TEXT_NODE=3,Mt=z.CDATA_SECTION_NODE=4,Pt=z.ENTITY_REFERENCE_NODE=5,Zu=z.ENTITY_NODE=6,rt=z.PROCESSING_INSTRUCTION_NODE=7,nt=z.COMMENT_NODE=8,kt=z.DOCUMENT_NODE=9,Vt=z.DOCUMENT_TYPE_NODE=10,J=z.DOCUMENT_FRAGMENT_NODE=11,Ju=z.NOTATION_NODE=12,q={},x={},An=q.INDEX_SIZE_ERR=(x[1]="Index size error",1),En=q.DOMSTRING_SIZE_ERR=(x[2]="DOMString size error",2),V=q.HIERARCHY_REQUEST_ERR=(x[3]="Hierarchy request error",3),vn=q.WRONG_DOCUMENT_ERR=(x[4]="Wrong document",4),Ot=q.INVALID_CHARACTER_ERR=(x[5]="Invalid character",5),bn=q.NO_DATA_ALLOWED_ERR=(x[6]="No data allowed",6),Cn=q.NO_MODIFICATION_ALLOWED_ERR=(x[7]="No modification allowed",7),Gt=q.NOT_FOUND_ERR=(x[8]="Not found",8),Nn=q.NOT_SUPPORTED_ERR=(x[9]="Not supported",9),Ft=q.INUSE_ATTRIBUTE_ERR=(x[10]="Attribute in use",10),j=q.INVALID_STATE_ERR=(x[11]="Invalid state",11),Tn=q.SYNTAX_ERR=(x[12]="Syntax error",12),Sn=q.INVALID_MODIFICATION_ERR=(x[13]="Invalid modification",13),yn=q.NAMESPACE_ERR=(x[14]="Invalid namespace",14),wn=q.INVALID_ACCESS_ERR=(x[15]="Invalid access",15);function S(e,t){if(t instanceof Error)var u=t;else u=this,Error.call(this,x[e]),this.message=x[e],Error.captureStackTrace&&Error.captureStackTrace(this,S);return u.code=e,t&&(this.message=this.message+": "+t),u}S.prototype=Error.prototype;Ne(q,S);function Q(){}Q.prototype={length:0,item:function(e){return e>=0&&e=0){for(var n=t.length-1;r0},lookupPrefix:function(e){for(var t=this;t;){var u=t._nsMap;if(u){for(var r in u)if(Object.prototype.hasOwnProperty.call(u,r)&&u[r]===e)return r}t=t.nodeType==se?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var u=t._nsMap;if(u&&Object.prototype.hasOwnProperty.call(u,e))return u[e];t=t.nodeType==se?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function jt(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}Ne(z,y);Ne(z,y.prototype);function Pe(e,t){return _(e,null,{enter:function(u){return t(u)?_.STOP:!0}})===_.STOP}function _(e,t,u){for(var r=[{node:e,context:t,phase:_.ENTER}];r.length>0;){var n=r.pop();if(n.phase===_.ENTER){var o=u.enter(n.node,n.context);if(o===_.STOP)return _.STOP;if(r.push({node:n.node,context:o,phase:_.EXIT}),o==null)continue;for(var i=n.node.lastChild;i;)r.push({node:i,context:o,phase:_.ENTER}),i=i.previousSibling}else u.exit&&u.exit(n.node,n.context)}}_.STOP=Symbol("walkDOM.STOP");_.ENTER=0;_.EXIT=1;function Te(){this.ownerDocument=this}function Ku(e,t,u){e&&e._inc++;var r=u.namespaceURI;r===be.XMLNS&&(t._nsMap[u.prefix?u.localName:""]=u.value)}function $t(e,t,u,r){e&&e._inc++;var n=u.namespaceURI;n===be.XMLNS&&delete t._nsMap[u.prefix?u.localName:""]}function Ge(e,t,u){if(e&&e._inc){e._inc++;var r=t.childNodes;if(u)r[r.length++]=u;else{for(var n=t.firstChild,o=0;n;)r[o++]=n,n=n.nextSibling;r.length=o,delete r[r.length]}}}function Yt(e,t){var u=t.previousSibling,r=t.nextSibling;return u?u.nextSibling=r:e.firstChild=r,r?r.previousSibling=u:e.lastChild=u,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Ge(e.ownerDocument,e),t}function er(e){return e&&(e.nodeType===y.DOCUMENT_NODE||e.nodeType===y.DOCUMENT_FRAGMENT_NODE||e.nodeType===y.ELEMENT_NODE)}function tr(e){return e&&(W(e)||ot(e)||K(e)||e.nodeType===y.DOCUMENT_FRAGMENT_NODE||e.nodeType===y.COMMENT_NODE||e.nodeType===y.PROCESSING_INSTRUCTION_NODE)}function K(e){return e&&e.nodeType===y.DOCUMENT_TYPE_NODE}function W(e){return e&&e.nodeType===y.ELEMENT_NODE}function ot(e){return e&&e.nodeType===y.TEXT_NODE}function Lt(e,t){var u=e.childNodes||[];if(Y(u,W)||K(t))return!1;var r=Y(u,K);return!(t&&r&&u.indexOf(r)>u.indexOf(t))}function Ut(e,t){var u=e.childNodes||[];function r(o){return W(o)&&o!==t}if(Y(u,r))return!1;var n=Y(u,K);return!(t&&n&&u.indexOf(n)>u.indexOf(t))}function ur(e,t,u){if(!er(e))throw new S(V,"Unexpected parent node type "+e.nodeType);if(u&&u.parentNode!==e)throw new S(Gt,"child not in parent");if(!tr(t)||K(t)&&e.nodeType!==y.DOCUMENT_NODE)throw new S(V,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function rr(e,t,u){var r=e.childNodes||[],n=t.childNodes||[];if(t.nodeType===y.DOCUMENT_FRAGMENT_NODE){var o=n.filter(W);if(o.length>1||Y(n,ot))throw new S(V,"More than one element or text in fragment");if(o.length===1&&!Lt(e,u))throw new S(V,"Element in fragment can not be inserted before doctype")}if(W(t)&&!Lt(e,u))throw new S(V,"Only one element can be added and only after doctype");if(K(t)){if(Y(r,K))throw new S(V,"Only one doctype is allowed");var i=Y(r,W);if(u&&r.indexOf(i)1||Y(n,ot))throw new S(V,"More than one element or text in fragment");if(o.length===1&&!Ut(e,u))throw new S(V,"Element in fragment can not be inserted before doctype")}if(W(t)&&!Ut(e,u))throw new S(V,"Only one element can be added and only after doctype");if(K(t)){let a=function(c){return K(c)&&c!==u};var s=a;if(Y(r,a))throw new S(V,"Only one doctype is allowed");var i=Y(r,W);if(u&&r.indexOf(i)0&&Pe(u.documentElement,function(n){if(n!==u&&n.nodeType===H){var o=n.getAttribute("class");if(o){var i=e===o;if(!i){var s=Rt(o);i=t.every(Wu(s))}i&&r.push(n)}}}),r})},createElement:function(e){var t=new ne;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new Q;var u=t.attributes=new Me;return u._ownerElement=t,t},createDocumentFragment:function(){var e=new He;return e.ownerDocument=this,e.childNodes=new Q,e},createTextNode:function(e){var t=new at;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new st;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf("]]>")!==-1)throw new S(Ot,'data contains "]]>"');var t=new ct;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var u=new pt;return u.ownerDocument=this,u.tagName=u.nodeName=u.target=e,u.nodeValue=u.data=t,u},createAttribute:function(e){var t=new Ve;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!ae.test(e))throw new S(Ot,'not a valid xml name "'+e+'"');var t=new lt;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var u=new ne,r=t.split(":"),n=u.attributes=new Me;return u.childNodes=new Q,u.ownerDocument=this,u.nodeName=t,u.tagName=t,u.namespaceURI=e,r.length==2?(u.prefix=r[0],u.localName=r[1]):u.localName=t,n._ownerElement=u,u},createAttributeNS:function(e,t){var u=new Ve,r=t.split(":");return u.ownerDocument=this,u.nodeName=t,u.name=t,u.namespaceURI=e,u.specified=!0,r.length==2?(u.prefix=r[0],u.localName=r[1]):u.localName=t,u}};G(Te,y);function ne(){this._nsMap={}}ne.prototype={nodeType:H,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var u=this.ownerDocument.createAttribute(e);u.value=u.nodeValue=""+t,this.setAttributeNode(u)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===J?this.insertBefore(e,null):nr(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var u=this.getAttributeNodeNS(e,t);u&&this.removeAttributeNode(u)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var u=this.getAttributeNodeNS(e,t);return u&&u.value||""},setAttributeNS:function(e,t,u){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+u,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new ce(this,function(t){var u=[];return Pe(t,function(r){r!==t&&r.nodeType==H&&(e==="*"||r.tagName==e)&&u.push(r)}),u})},getElementsByTagNameNS:function(e,t){return new ce(this,function(u){var r=[];return Pe(u,function(n){n!==u&&n.nodeType===H&&(e==="*"||n.namespaceURI===e)&&(t==="*"||n.localName==t)&&r.push(n)}),r})}};Te.prototype.getElementsByTagName=ne.prototype.getElementsByTagName;Te.prototype.getElementsByTagNameNS=ne.prototype.getElementsByTagNameNS;G(ne,y);function Ve(){}Ve.prototype.nodeType=se;G(Ve,y);function Se(){}Se.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(x[V])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,u){var r=this.data.substring(0,e),n=this.data.substring(e+t);u=r+u+n,this.nodeValue=this.data=u,this.length=u.length}};G(Se,y);function at(){}at.prototype={nodeName:"#text",nodeType:ve,splitText:function(e){var t=this.data,u=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(u);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};G(at,Se);function st(){}st.prototype={nodeName:"#comment",nodeType:nt};G(st,Se);function ct(){}ct.prototype={nodeName:"#cdata-section",nodeType:Mt};G(ct,Se);function ze(){}ze.prototype.nodeType=Vt;G(ze,y);function Zt(){}Zt.prototype.nodeType=Ju;G(Zt,y);function Jt(){}Jt.prototype.nodeType=Zu;G(Jt,y);function lt(){}lt.prototype.nodeType=Pt;G(lt,y);function He(){}He.prototype.nodeName="#document-fragment";He.prototype.nodeType=J;G(He,y);function pt(){}pt.prototype.nodeType=rt;G(pt,y);function Qt(){}Qt.prototype.serializeToString=function(e,t,u,r){return Kt.call(e,t,u,r)};y.prototype.toString=Kt;function Kt(e,t,u){var r=!!u&&!!u.requireWellFormed,n=[],o=this.nodeType==9&&this.documentElement||this,i=o.prefix,s=o.namespaceURI;if(s&&i==null){var i=o.lookupPrefix(s);if(i==null)var a=[{namespace:s,prefix:null}]}return ft(this,n,e,t,a,r),n.join("")}function qt(e,t,u){var r=e.prefix||"",n=e.namespaceURI;if(!n||r==="xml"&&n===be.XML||n===be.XMLNS)return!1;for(var o=u.length;o--;){var i=u[o];if(i.prefix===r)return i.namespace!==n}return!0}function qe(e,t,u,r){if(r&&!ae.test(t))throw new S(j,'The attribute name "'+t+'" is not a valid XML QName');e.push(" ",t,'="',u.replace(/[<>&"\t\n\r]/g,jt),'"')}function ft(e,t,u,r,n,o){n||(n=[]),_(e,{ns:n,isHTML:u},{enter:function(i,s){var a=s.ns,c=s.isHTML;if(r)if(i=r(i),i){if(typeof i=="string")return t.push(i),null}else return null;switch(i.nodeType){case H:var l=i.attributes,p=l.length,f=i.tagName;c=be.isHTML(i.namespaceURI)||c;var d=f;if(!c&&!i.prefix&&i.namespaceURI){for(var h,D=0;D=0;g--){var O=a[g];if(O.prefix===""&&O.namespace===i.namespaceURI){h=O.namespace;break}}if(h!==i.namespaceURI)for(var g=a.length-1;g>=0;g--){var O=a[g];if(O.namespace===i.namespaceURI){O.prefix&&(d=O.prefix+":"+f);break}}}if(o&&!ae.test(d))throw new S(j,'The element name "'+d+'" is not a valid XML QName');t.push("<",d);for(var w=a.slice(),N=0;N"),c&&/^script$/i.test(f)){for(;A;)A.data?t.push(A.data):ft(A,t,c,r,w.slice(),o),A=A.nextSibling;return t.push(""),null}return{ns:w,isHTML:c,tag:d}}else return t.push("/>"),null;case kt:case J:return{ns:a.slice(),isHTML:c,tag:null};case se:return qe(t,i.name,i.value,o),null;case ve:return t.push(i.data.replace(/[<&>]/g,jt)),null;case Mt:if(o&&i.data.indexOf("]]>")!==-1)throw new S(j,'The CDATASection data contains "]]>"');return t.push("/g,"]]]]>"),"]]>"),null;case nt:if(o&&i.data.indexOf("-->")!==-1)throw new S(j,'The comment node data contains "-->"');return t.push(""),null;case Vt:if(o){if(!ae.test(i.name))throw new S(j,'The doctype name "'+i.name+'" is not a valid XML Name');if(i.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(i.publicId))throw new S(j,"DocumentType publicId is not a valid PubidLiteral");if(i.systemId&&!/^("[^"]*"|'[^']*')$/.test(i.systemId))throw new S(j,"DocumentType systemId is not a valid SystemLiteral");if(i.internalSubset&&i.internalSubset.indexOf("]>")!==-1)throw new S(j,'DocumentType internalSubset contains "]>"')}var I=i.publicId,C=i.systemId;if(t.push("");else if(C&&C!=".")t.push(" SYSTEM ",C,">");else{var X=i.internalSubset;X&&t.push(" [",X,"]"),t.push(">")}return null;case rt:if(o){if(!ae.test(i.target)||i.target.indexOf(":")!==-1||i.target.toLowerCase()==="xml")throw new S(j,'The processing instruction target "'+i.target+'" is not a valid XML NCName or is reserved');if(i.data.indexOf("?>")!==-1)throw new S(j,'The ProcessingInstruction data contains "?>"')}return t.push(""),null;case Pt:if(o&&!ae.test(i.nodeName))throw new S(j,'The entity reference name "'+i.nodeName+'" is not a valid XML Name');return t.push("&",i.nodeName,";"),null;default:return t.push("??",i.nodeName),null}},exit:function(i,s){s&&s.tag&&t.push("")}})}function ir(e,t,u){var r;return _(t,null,{enter:function(n,o){var i=n.cloneNode(!1);i.ownerDocument=e,i.parentNode=null,o===null?r=i:o.appendChild(i);var s=n.nodeType===se||u;return s?i:null}}),r}function eu(e,t,u){var r;return _(t,null,{enter:function(n,o){var i=new n.constructor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var a=n[s];typeof a!="object"&&a!=i[s]&&(i[s]=a)}n.childNodes&&(i.childNodes=new Q),i.ownerDocument=e;var c=u;switch(i.nodeType){case H:var l=n.attributes,p=i.attributes=new Me,f=l.length;p._ownerElement=i;for(var d=0;d{"use strict";var uu=oe().freeze;ye.XML_ENTITIES=uu({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});ye.HTML_ENTITIES=uu({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});ye.entityMap=ye.HTML_ENTITIES});var su=re(Dt=>{var Ie=oe().NAMESPACE,dt=oe().tagNamePattern,le=0,ue=1,pe=2,we=3,fe=4,me=5,Be=6,Xe=7;function de(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,de)}de.prototype=new Error;de.prototype.name=de.name;function ou(){}ou.prototype={parse:function(e,t,u){var r=this.domBuilder;r.startDocument(),lr(t,t={}),or(e,t,u,r,this.errorHandler),r.endDocument()}};function or(e,t,u,r,n){function o(v){if(v>65535){v-=65536;var U=55296+(v>>10),xu=56320+(v&1023);return String.fromCharCode(U,xu)}else return String.fromCharCode(v)}function i(v){var U=v.slice(1,-1);return Object.hasOwnProperty.call(u,U)?u[U]:U.charAt(0)==="#"?o(parseInt(U.substr(1).replace("x","0x"))):(n.error("entity not found:"+v),v)}function s(v){if(v>D){var U=e.substring(D,v).replace(/&#?\w+;/g,i);f&&a(D),r.characters(U,0,v-D),D=v}}function a(v,U){for(;v>=l&&(U=p.exec(e));)c=U.index,l=c+U[0].length,f.lineNumber++;f.columnNumber=v-c+1}for(var c=0,l=0,p=/.*(?:\r\n?|\n)|.*$/g,f=r.locator,d=[{currentNSMap:t}],h={},D=0;;){try{var g=e.indexOf("<",D);if(g<0){if(!e.substr(D).match(/^\s*$/)){var O=r.doc,w=O.createTextNode(e.substr(D));O.appendChild(w),r.currentElement=w}return}switch(g>D&&s(g),e.charAt(g+1)){case"/":var C=e.indexOf(">",g+3),N=e.substring(g+2,C).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,"$1"),m=d.pop();C<0?(N=e.substring(g+2).replace(/[\s<].*/,""),n.error("end tag name: "+N+" is not complete:"+m.tagName),C=g+1+N.length):N.match(/\sD?D=C:s(Math.max(g,D)+1)}}function nu(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function ar(e,t,u,r,n,o){function i(d,h,D){u.attributeNames.hasOwnProperty(d)&&o.fatalError("Attribute "+d+" redefined"),u.addValue(d,h.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),D)}for(var s,a,c=++t,l=le;;){var p=e.charAt(c);if(l===le&&p==="<")throw new Error("unexpected < in tag name: "+e.slice(t,c));switch(p){case"=":if(l===ue)s=e.slice(t,c),l=we;else if(l===pe)l=we;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(l===we||l===ue)if(l===ue&&(o.warning('attribute value must after "="'),s=e.slice(t,c)),t=c+1,c=e.indexOf(p,t),c>0)a=e.slice(t,c),i(s,a,t-1),l=me;else throw new Error("attribute value no end '"+p+"' match");else if(l==fe)a=e.slice(t,c),i(s,a,t),o.warning('attribute "'+s+'" missed start quot('+p+")!!"),t=c+1,l=me;else throw new Error('attribute value must after "="');break;case"/":switch(l){case le:u.setTagName(e.slice(t,c));case me:case Be:case Xe:l=Xe,u.closed=!0;case fe:case ue:break;case pe:u.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==le&&u.setTagName(e.slice(t,c)),c;case">":switch(l){case le:u.setTagName(e.slice(t,c));case me:case Be:case Xe:break;case fe:case ue:a=e.slice(t,c),a.slice(-1)==="/"&&(u.closed=!0,a=a.slice(0,-1));case pe:l===pe&&(a=s),l==fe?(o.warning('attribute "'+a+'" missed quot(")!'),i(s,a,t)):((!Ie.isHTML(r[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+a+'" missed value!! "'+a+'" instead!!'),i(a,a,t));break;case we:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case le:u.setTagName(e.slice(t,c)),l=Be;break;case ue:s=e.slice(t,c),l=pe;break;case fe:var a=e.slice(t,c);o.warning('attribute "'+a+'" missed quot(")!!'),i(s,a,t);case me:l=Be;break}else switch(l){case pe:var f=u.tagName;(!Ie.isHTML(r[""])||!s.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),i(s,s,t),t=c,l=ue;break;case me:o.warning('attribute space is required"'+s+'"!!');case Be:l=ue,t=c;break;case we:l=fe,t=c;break;case Xe:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function iu(e,t,u){for(var r=e.tagName,n=null,p=e.length;p--;){var o=e[p],i=o.qName,s=o.value,f=i.indexOf(":");if(f>0)var a=o.prefix=i.slice(0,f),c=i.slice(f+1),l=a==="xmlns"&&c;else c=i,a=null,l=i==="xmlns"&&"";o.localName=c,l!==!1&&(n==null&&(n={},u=Object.create(u)),u[l]=n[l]=s,o.uri=Ie.XMLNS,t.startPrefixMapping(l,s))}for(var p=e.length;p--;){o=e[p];var a=o.prefix;a&&(a==="xml"&&(o.uri=Ie.XML),a!=="xmlns"&&(o.uri=u[a||""]))}var f=r.indexOf(":");f>0?(a=e.prefix=r.slice(0,f),c=e.localName=r.slice(f+1)):(a=null,c=e.localName=r);var d=e.uri=u[a||""];if(t.startElement(d,c,r,e),e.closed){if(t.endElement(d,c,r),n)for(a in n)Object.prototype.hasOwnProperty.call(n,a)&&t.endPrefixMapping(a)}else return e.currentNSMap=u,e.localNSMap=n,!0}function sr(e,t,u,r,n){if(/^(?:script|textarea)$/i.test(u)){var o=e.indexOf("",t),i=e.substring(t+1,o);if(/[&<]/.test(i))return/^script$/i.test(u)?(n.characters(i,0,i.length),o):(i=i.replace(/&#?\w+;/g,r),n.characters(i,0,i.length),o)}return t+1}function cr(e,t,u,r){var n=r[u];return n==null&&(n=e.lastIndexOf(""),n",t+4);return o>t?(u.comment(e,t+4,o-t-4),o+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(e.substr(t+3,6)=="CDATA["){var o=e.indexOf("]]>",t+9);return u.startCDATA(),u.characters(e,t+9,o-t-9),u.endCDATA(),o+3}var i=mr(e,t),s=i.length;if(s>1&&/!doctype/i.test(i[0][0])){var a=i[1][0],c=!1,l=!1;s>3&&(/^public$/i.test(i[2][0])?(c=i[3][0],l=s>4&&i[4][0]):/^system$/i.test(i[2][0])&&(l=i[3][0]));var p=i[s-1];return u.startDTD(a,c,l),u.endDTD(),p.index+p[0].length}}return-1}function fr(e,t,u){var r=e.indexOf("?>",t);if(r){var n=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(n){var o=n[0].length;return u.processingInstruction(n[1],n[2]),r+2}else return-1}return-1}function au(){this.attributeNames={}}au.prototype={setTagName:function(e){if(!dt.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,u){if(!dt.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:u}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function mr(e,t){var u,r=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=t,n.exec(e);u=n.exec(e);)if(r.push(u),u[1])return r}Dt.XMLReader=ou;Dt.ParseError=de});var Du=re($e=>{var dr=oe(),Dr=mt(),cu=ru(),fu=su(),hr=Dr.DOMImplementation,lu=dr.NAMESPACE,gr=fu.ParseError,Ar=fu.XMLReader;function mu(e){return e.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` -`)}function mu(e){this.options=e||{locator:{}}}mu.prototype.parseFromString=function(e,t){var u=this.options,r=new Ar,n=u.domBuilder||new we,o=u.errorHandler,i=u.locator,s=u.xmlns||{},a=/\/x?html?$/.test(t),c=a?su.HTML_ENTITIES:su.XML_ENTITIES;i&&n.setDocumentLocator(i),r.errorHandler=Er(o,n,i),r.domBuilder=u.domBuilder||n,a&&(s[""]=cu.HTML),s.xml=s.xml||cu.XML;var l=u.normalizeLineEndings||fu;return e&&typeof e=="string"?r.parse(l(e),s,c):r.errorHandler.error("invalid doc source"),n.doc};function Er(e,t,u){if(!e){if(t instanceof we)return t;e=t}var r={},n=e instanceof Function;u=u||{};function o(i){var s=e[i];!s&&n&&(s=e.length==2?function(a){e(i,a)}:e),r[i]=s&&function(a){s("[xmldom "+i+"] "+a+dt(u))}||function(){}}return o("warning"),o("error"),o("fatalError"),r}function we(){this.cdata=!1}function pe(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}we.prototype={startDocument:function(){this.doc=new hr().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,u,r){var n=this.doc,o=n.createElementNS(e,u||t),i=r.length;ze(this,o),this.currentElement=o,this.locator&&pe(this.locator,o);for(var s=0;s=t+u||t?new java.lang.String(e,t,u)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){we.prototype[e]=function(){return null}});function ze(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}He.__DOMHandler=we;He.normalizeLineEndings=fu;He.DOMParser=mu});var Dt=K(Xe=>{var Du=pt();Xe.DOMImplementation=Du.DOMImplementation;Xe.XMLSerializer=Du.XMLSerializer;Xe.DOMParser=du().DOMParser});var te=De(Oe()),St="https://example.com",Vu=function(t,u){if(/^[a-z]+:/i.test(u))return u;/^data:/.test(t)&&(t=te.default.location&&te.default.location.href||"");var r=/^\/\//.test(t),n=!te.default.location&&!/\/\//i.test(t);t=new te.default.URL(t,te.default.location||St);var o=new URL(u,t);return n?o.href.slice(St.length):r?o.href.slice(o.protocol.length):o.href},Fe=Vu;var M=De(Oe());var yt=function(t,u,r){u.forEach(function(n){for(var o in t.mediaGroups[n])for(var i in t.mediaGroups[n][o]){var s=t.mediaGroups[n][o][i];r(s,n,o,i)}})};var Ze=De(Oe()),Gu=function(t){return Ze.default.atob?Ze.default.atob(t):Buffer.from(t,"base64").toString("binary")};function Je(e){for(var t=Gu(e),u=new Uint8Array(t.length),r=0;r!!e&&typeof e=="object",_=(...e)=>e.reduce((t,u)=>(typeof u!="object"||Object.keys(u).forEach(r=>{Array.isArray(t[r])&&Array.isArray(u[r])?t[r]=t[r].concat(u[r]):hu(t[r])&&hu(u[r])?t[r]=_(t[r],u[r]):t[r]=u[r]}),t),{}),Tu=e=>Object.keys(e).map(t=>e[t]),vr=(e,t)=>{let u=[];for(let r=e;re.reduce((t,u)=>t.concat(u),[]),Su=e=>{if(!e.length)return[];let t=[];for(let u=0;ue.reduce((u,r,n)=>(r[t]&&u.push(n),u),[]),Cr=(e,t)=>Tu(e.reduce((u,r)=>(r.forEach(n=>{u[t(n)]=n}),u),{})),Be={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Ie=({baseUrl:e="",source:t="",range:u="",indexRange:r=""})=>{let n={uri:t,resolvedUri:Fe(e||"",t)};if(u||r){let i=(u||r).split("-"),s=M.default.BigInt?M.default.BigInt(i[0]):parseInt(i[0],10),a=M.default.BigInt?M.default.BigInt(i[1]):parseInt(i[1],10);s{let t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=M.default.BigInt(e.offset)+M.default.BigInt(e.length)-M.default.BigInt(1):t=e.offset+e.length-1,`${e.offset}-${t}`},gu=e=>(e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e),Tr={static(e){let{duration:t,timescale:u=1,sourceDuration:r,periodDuration:n}=e,o=gu(e.endNumber),i=t/u;return typeof o=="number"?{start:0,end:o}:typeof n=="number"?{start:0,end:n/i}:{start:0,end:r/i}},dynamic(e){let{NOW:t,clientOffset:u,availabilityStartTime:r,timescale:n=1,duration:o,periodStart:i=0,minimumUpdatePeriod:s=0,timeShiftBufferDepth:a=1/0}=e,c=gu(e.endNumber),l=(t+u)/1e3,p=r+i,h=l+s-p,m=Math.ceil(h*n/o),f=Math.floor((l-p-a)*n/o),D=Math.floor((l-p)*n/o);return{start:Math.max(0,f),end:typeof c=="number"?c:Math.min(m,D)}}},Sr=e=>t=>{let{duration:u,timescale:r=1,periodStart:n,startNumber:o=1}=e;return{number:o+t,duration:u/r,timeline:n,time:t*u}},gt=e=>{let{type:t,duration:u,timescale:r=1,periodDuration:n,sourceDuration:o}=e,{start:i,end:s}=Tr[t](e),a=vr(i,s).map(Sr(e));if(t==="static"){let c=a.length-1,l=typeof n=="number"?n:o;a[c].duration=l-u/r*c}return a},yu=e=>{let{baseUrl:t,initialization:u={},sourceDuration:r,indexRange:n="",periodStart:o,presentationTime:i,number:s=0,duration:a}=e;if(!t)throw new Error(Be.NO_BASE_URL);let c=Ie({baseUrl:t,source:u.sourceURL,range:u.range}),l=Ie({baseUrl:t,source:t,indexRange:n});if(l.map=c,a){let p=gt(e);p.length&&(l.duration=p[0].duration,l.timeline=p[0].timeline)}else r&&(l.duration=r,l.timeline=o);return l.presentationTime=i||o,l.number=s,[l]},yr=(e,t,u)=>{let r=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,o=e.timeline||0,i=e.sidx.byterange,s=i.offset+i.length,a=t.timescale,c=t.references.filter(D=>D.referenceType!==1),l=[],p=e.endList?"static":"dynamic",d=e.sidx.timeline,h=d,m=e.mediaSequence||0,f;typeof t.firstOffset=="bigint"?f=M.default.BigInt(s)+t.firstOffset:f=s+t.firstOffset;for(let D=0;DCr(e,({timeline:t})=>t).sort((t,u)=>t.timeline>u.timeline?1:-1),Ir=(e,t)=>{for(let u=0;u{let t=[];return yt(e,wr,(u,r,n,o)=>{t=t.concat(u.playlists||[])}),t},Eu=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((u,r)=>{u.number=e.mediaSequence+r})},Rr=({oldPlaylists:e,newPlaylists:t,timelineStarts:u})=>{t.forEach(r=>{r.discontinuitySequence=u.findIndex(function({timeline:a}){return a===r.timeline});let n=Ir(e,r.attributes.NAME);if(!n||r.sidx)return;let o=r.segments[0],i=n.segments.findIndex(function(a){return Math.abs(a.presentationTime-o.presentationTime)n.timeline||n.segments.length&&r.timeline>n.segments[n.segments.length-1].timeline)&&r.discontinuitySequence--;return}n.segments[i].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),Eu({playlist:r,mediaSequence:n.segments[i].number})})},Or=({oldManifest:e,newManifest:t})=>{let u=e.playlists.concat(Au(e)),r=t.playlists.concat(Au(t));return t.timelineStarts=wu([e.timelineStarts,t.timelineStarts]),Rr({oldPlaylists:u,newPlaylists:r,timelineStarts:t.timelineStarts}),t},Fr=e=>e&&e.uri+"-"+Nr(e.byterange),ht=e=>{let t=e.reduce(function(r,n){return r[n.attributes.baseUrl]||(r[n.attributes.baseUrl]=[]),r[n.attributes.baseUrl].push(n),r},{}),u=[];return Object.values(t).forEach(r=>{let n=Tu(r.reduce((o,i)=>{let s=i.attributes.id+(i.attributes.lang||"");return o[s]?(i.segments&&(i.segments[0]&&(i.segments[0].discontinuity=!0),o[s].segments.push(...i.segments)),i.attributes.contentProtection&&(o[s].attributes.contentProtection=i.attributes.contentProtection)):(o[s]=i,o[s].attributes.timelineStarts=[]),o[s].attributes.timelineStarts.push({start:i.attributes.periodStart,timeline:i.attributes.periodStart}),o},{}));u=u.concat(n)}),u.map(r=>(r.discontinuityStarts=br(r.segments||[],"discontinuity"),r))},At=(e,t)=>{let u=Fr(e.sidx),r=u&&t[u]&&t[u].sidx;return r&&yr(e,r,e.sidx.resolvedUri),e},xr=(e,t={})=>{if(!Object.keys(t).length)return e;for(let u in e)e[u]=At(e[u],t);return e},_r=({attributes:e,segments:t,sidx:u,mediaSequence:r,discontinuitySequence:n,discontinuityStarts:o},i)=>{let s={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:o,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),u&&(s.sidx=u),i&&(s.attributes.AUDIO="audio",s.attributes.SUBTITLES="subs"),s},Lr=({attributes:e,segments:t,mediaSequence:u,discontinuityStarts:r,discontinuitySequence:n})=>{typeof t>"u"&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let o={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(o.CODECS=e.codecs);let i={attributes:o,uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:n,mediaSequence:u,segments:t};return e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),i},Ur=(e,t={},u=!1)=>{let r,n=e.reduce((o,i)=>{let s=i.attributes.role&&i.attributes.role.value||"",a=i.attributes.lang||"",c=i.attributes.label||"main";if(a&&!i.attributes.label){let p=s?` (${s})`:"";c=`${i.attributes.lang}${p}`}o[c]||(o[c]={language:a,autoselect:!0,default:s==="main",playlists:[],uri:""});let l=At(_r(i,u),t);return o[c].playlists.push(l),typeof r>"u"&&s==="main"&&(r=i,r.default=!0),o},{});if(!r){let o=Object.keys(n)[0];n[o].default=!0}return n},qr=(e,t={})=>e.reduce((u,r)=>{let n=r.attributes.label||r.attributes.lang||"text",o=r.attributes.lang||"und";return u[n]||(u[n]={language:o,default:!1,autoselect:!1,playlists:[],uri:""}),u[n].playlists.push(At(Lr(r),t)),u},{}),Mr=e=>e.reduce((t,u)=>(u&&u.forEach(r=>{let{channel:n,language:o}=r;t[o]={autoselect:!1,default:!1,instreamId:n,language:o},r.hasOwnProperty("aspectRatio")&&(t[o].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(t[o].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(t[o]["3D"]=r["3D"])}),t),{}),Pr=({attributes:e,segments:t,sidx:u,discontinuityStarts:r})=>{let n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.qualityRanking!==void 0&&(n.attributes.SCORE=1/(e.qualityRanking+1)),e.contentProtection&&(n.contentProtection=e.contentProtection),e.serviceLocation&&(n.attributes.serviceLocation=e.serviceLocation),u&&(n.sidx=u),n},kr=({attributes:e})=>e.mimeType==="video/mp4"||e.mimeType==="video/webm"||e.contentType==="video",Vr=({attributes:e})=>e.mimeType==="audio/mp4"||e.mimeType==="audio/webm"||e.contentType==="audio",Gr=({attributes:e})=>e.mimeType==="text/vtt"||e.contentType==="text",zr=(e,t)=>{e.forEach(u=>{u.mediaSequence=0,u.discontinuitySequence=t.findIndex(function({timeline:r}){return r===u.timeline}),u.segments&&u.segments.forEach((r,n)=>{r.number=n})})},vu=e=>e?Object.keys(e).reduce((t,u)=>{let r=e[u];return t.concat(r.playlists)},[]):[],Bu=({dashPlaylists:e,locations:t,contentSteering:u,sidxMapping:r={},previousManifest:n,eventStream:o})=>{if(!e.length)return{};let{sourceDuration:i,type:s,suggestedPresentationDelay:a,minimumUpdatePeriod:c}=e[0].attributes,l=ht(e.filter(kr)).map(Pr),p=ht(e.filter(Vr)),d=ht(e.filter(Gr)),h=e.map(A=>A.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:i,playlists:xr(l,r)};c>=0&&(m.minimumUpdatePeriod=c*1e3),t&&(m.locations=t),u&&(m.contentSteering=u),s==="dynamic"&&(m.suggestedPresentationDelay=a),o&&o.length>0&&(m.eventStream=o);let f=m.playlists.length===0,D=p.length?Ur(p,r,f):null,N=d.length?qr(d,r):null,v=l.concat(vu(D),vu(N)),g=v.map(({timelineStarts:A})=>A);return m.timelineStarts=wu(g),zr(v,m.timelineStarts),D&&(m.mediaGroups.AUDIO.audio=D),N&&(m.mediaGroups.SUBTITLES.subs=N),h.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=Mr(h)),n?Or({oldManifest:n,newManifest:m}):m},Hr=(e,t,u)=>{let{NOW:r,clientOffset:n,availabilityStartTime:o,timescale:i=1,periodStart:s=0,minimumUpdatePeriod:a=0}=e,c=(r+n)/1e3,l=o+s,d=c+a-l;return Math.ceil((d*i-t)/u)},Iu=(e,t)=>{let{type:u,minimumUpdatePeriod:r=0,media:n="",sourceDuration:o,timescale:i=1,startNumber:s=1,periodStart:a}=e,c=[],l=-1;for(let p=0;pl&&(l=f);let D;if(m<0){let g=p+1;g===t.length?u==="dynamic"&&r>0&&n.indexOf("$Number$")>0?D=Hr(e,l,h):D=(o*i-l)/h:D=(t[g].t-l)/h}else D=m+1;let N=s+c.length+D,v=s+c.length;for(;v(t,u,r,n)=>{if(t==="$$")return"$";if(typeof e[u]>"u")return t;let o=""+e[u];return u==="RepresentationID"||(r?n=parseInt(n,10):n=1,o.length>=n)?o:`${new Array(n-o.length+1).join("0")}${o}`},bu=(e,t)=>e.replace(Xr,jr(t)),$r=(e,t)=>!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?gt(e):Iu(e,t),Yr=(e,t)=>{let u={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=e,n=Ie({baseUrl:e.baseUrl,source:bu(r.sourceURL,u),range:r.range});return $r(e,t).map(i=>{u.Number=i.number,u.Time=i.time;let s=bu(e.media||"",u),a=e.timescale||1,c=e.presentationTimeOffset||0,l=e.periodStart+(i.time-c)/a;return{uri:s,timeline:i.timeline,duration:i.duration,resolvedUri:Fe(e.baseUrl||"",s),map:n,number:i.number,presentationTime:l}})},Wr=(e,t)=>{let{baseUrl:u,initialization:r={}}=e,n=Ie({baseUrl:u,source:r.sourceURL,range:r.range}),o=Ie({baseUrl:u,source:t.media,range:t.mediaRange});return o.map=n,o},Zr=(e,t)=>{let{duration:u,segmentUrls:r=[],periodStart:n}=e;if(!u&&!t||u&&t)throw new Error(Be.SEGMENT_TIME_UNSPECIFIED);let o=r.map(a=>Wr(e,a)),i;return u&&(i=gt(e)),t&&(i=Iu(e,t)),i.map((a,c)=>{if(o[c]){let l=o[c],p=e.timescale||1,d=e.presentationTimeOffset||0;return l.timeline=a.timeline,l.duration=a.duration,l.number=a.number,l.presentationTime=n+(a.time-d)/p,l}}).filter(a=>a)},Jr=({attributes:e,segmentInfo:t})=>{let u,r;t.template?(r=Yr,u=_(e,t.template)):t.base?(r=yu,u=_(e,t.base)):t.list&&(r=Zr,u=_(e,t.list));let n={attributes:e};if(!r)return n;let o=r(u,t.segmentTimeline);if(u.duration){let{duration:i,timescale:s=1}=u;u.duration=i/s}else o.length?u.duration=o.reduce((i,s)=>Math.max(i,Math.ceil(s.duration)),0):u.duration=0;return n.attributes=u,n.segments=o,t.base&&u.indexRange&&(n.sidx=o[0],n.segments=[]),n},Et=e=>e.map(Jr),y=(e,t)=>Su(e.childNodes).filter(({tagName:u})=>u===t),Re=e=>e.textContent.trim(),Qr=e=>parseFloat(e.split("/").reduce((t,u)=>t/u)),fe=e=>{let s=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!s)return 0;let[a,c,l,p,d,h]=s.slice(1);return parseFloat(a||0)*31536e3+parseFloat(c||0)*2592e3+parseFloat(l||0)*86400+parseFloat(p||0)*3600+parseFloat(d||0)*60+parseFloat(h||0)},Kr=e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)),Cu={mediaPresentationDuration(e){return fe(e)},availabilityStartTime(e){return Kr(e)/1e3},minimumUpdatePeriod(e){return fe(e)},suggestedPresentationDelay(e){return fe(e)},type(e){return e},timeShiftBufferDepth(e){return fe(e)},start(e){return fe(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return Qr(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){let t=parseInt(e,10);return isNaN(t)?fe(e):t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},qualityRanking(e){return parseInt(e,10)},qualityranking(e){return parseInt(e,10)},DEFAULT(e){return e}},en={qualityranking:"qualityRanking"},I=e=>e&&e.attributes?Su(e.attributes).reduce((t,u)=>{let r=Cu[u.name]||Cu.DEFAULT,n=en[u.name]||u.name;return t[n]=r(u.value),t},{}):{},tn={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},je=(e,t)=>t.length?me(e.map(function(u){return t.map(function(r){let n=Re(r),o=Fe(u.baseUrl,n),i=_(I(r),{baseUrl:o});return o!==n&&!i.serviceLocation&&u.serviceLocation&&(i.serviceLocation=u.serviceLocation),i})})):e,vt=e=>{let t=y(e,"SegmentTemplate")[0],u=y(e,"SegmentList")[0],r=u&&y(u,"SegmentURL").map(p=>_({tag:"SegmentURL"},I(p))),n=y(e,"SegmentBase")[0],o=u||t,i=o&&y(o,"SegmentTimeline")[0],s=u||n||t,a=s&&y(s,"Initialization")[0],c=t&&I(t);c&&a?c.initialization=a&&I(a):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});let l={template:c,segmentTimeline:i&&y(i,"S").map(p=>I(p)),list:u&&_(I(u),{segmentUrls:r,initialization:I(a)}),base:n&&_(I(n),{initialization:I(a)})};return Object.keys(l).forEach(p=>{l[p]||delete l[p]}),l},un=(e,t,u)=>r=>{let n=y(r,"BaseURL"),o=je(t,n),i=_(e,I(r)),s=vt(r);return o.map(a=>({segmentInfo:_(u,s),attributes:_(i,a)}))},rn=e=>e.reduce((t,u)=>{let r=I(u);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());let n=tn[r.schemeIdUri];if(n){t[n]={attributes:r};let o=y(u,"cenc:pssh")[0];if(o){let i=Re(o);t[n].pssh=i&&Je(i)}}return t},{}),nn=e=>{if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof e.value!="string"?[]:e.value.split(";")).map(u=>{let r,n;return n=u,/^CC\d=/.test(u)?[r,n]=u.split("="):/^CC\d$/.test(u)&&(r=u),{channel:r,language:n}});if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof e.value!="string"?[]:e.value.split(";")).map(u=>{let r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(u)){let[n,o=""]=u.split("=");r.channel=n,r.language=u,o.split(",").forEach(i=>{let[s,a]=i.split(":");s==="lang"?r.language=a:s==="er"?r.easyReader=Number(a):s==="war"?r.aspectRatio=Number(a):s==="3D"&&(r["3D"]=Number(a))})}else r.language=u;return r.channel&&(r.channel="SERVICE"+r.channel),r})},on=e=>me(y(e.node,"EventStream").map(t=>{let u=I(t),r=u.schemeIdUri;return y(t,"Event").map(n=>{let o=I(n),i=o.presentationTime||0,s=u.timescale||1,a=o.duration||0,c=i/s+e.attributes.start;return{schemeIdUri:r,value:u.value,id:o.id,start:c,end:c+a/s,messageData:Re(n)||o.messageData,contentEncoding:u.contentEncoding,presentationTimeOffset:u.presentationTimeOffset||0}})})),an=(e,t,u)=>r=>{let n=I(r),o=je(t,y(r,"BaseURL")),i=y(r,"Role")[0],s={role:I(i)},a=_(e,n,s),c=y(r,"Accessibility")[0],l=nn(I(c));l&&(a=_(a,{captionServices:l}));let p=y(r,"Label")[0];if(p&&p.childNodes.length){let D=p.childNodes[0].nodeValue.trim();a=_(a,{label:D})}let d=rn(y(r,"ContentProtection"));Object.keys(d).length&&(a=_(a,{contentProtection:d}));let h=vt(r),m=y(r,"Representation"),f=_(u,h);return me(m.map(un(a,o,f)))},sn=(e,t)=>(u,r)=>{let n=je(t,y(u.node,"BaseURL")),o=_(e,{periodStart:u.attributes.start});typeof u.attributes.duration=="number"&&(o.periodDuration=u.attributes.duration);let i=y(u.node,"AdaptationSet"),s=vt(u.node);return me(i.map(an(o,n,s)))},cn=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;let u=_({serverURL:Re(e[0])},I(e[0]));return u.queryBeforeStart=u.queryBeforeStart==="true",u},ln=({attributes:e,priorPeriodAttributes:t,mpdType:u})=>typeof e.start=="number"?e.start:t&&typeof t.start=="number"&&typeof t.duration=="number"?t.start+t.duration:!t&&u==="static"?0:null,Ru=(e,t={})=>{let{manifestUri:u="",NOW:r=Date.now(),clientOffset:n=0,eventHandler:o=function(){}}=t,i=y(e,"Period");if(!i.length)throw new Error(Be.INVALID_NUMBER_OF_PERIOD);let s=y(e,"Location"),a=I(e),c=je([{baseUrl:u}],y(e,"BaseURL")),l=y(e,"ContentSteering");a.type=a.type||"static",a.sourceDuration=a.mediaPresentationDuration||0,a.NOW=r,a.clientOffset=n,s.length&&(a.locations=s.map(Re));let p=[];return i.forEach((d,h)=>{let m=I(d),f=p[h-1];m.start=ln({attributes:m,priorPeriodAttributes:f?f.attributes:null,mpdType:a.type}),p.push({node:d,attributes:m})}),{locations:a.locations,contentSteeringInfo:cn(l,o),representationInfo:me(p.map(sn(a,c))),eventStream:me(p.map(on))}},Ou=e=>{if(e==="")throw new Error(Be.DASH_EMPTY_MANIFEST);let t=new Nu.DOMParser,u,r;try{u=t.parseFromString(e,"application/xml"),r=u&&u.documentElement.tagName==="MPD"?u.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(Be.DASH_INVALID_XML);return r};var Fu=De(Dt(),1),U=(e,t)=>Array.from(e.childNodes).filter(u=>u.nodeType===1&&u.localName===t);function bt(e,t){let u=Ou(e);if((u.getAttribute("type")||"static")!=="static"||u.getElementsByTagNameNS("*","ContentProtection").length)throw Error("unsupported_mpd");for(let o of[u,...Array.from(u.getElementsByTagName("*"))])for(let i of Array.from(o.attributes||[]))if(i.namespaceURI==="http://www.w3.org/1999/xlink"&&i.localName==="href")throw Error("external_mpd");let r=0;for(let o of U(u,"Period"))for(let i of U(o,"AdaptationSet"))for(let s of U(i,"Representation"))s.setAttribute("piikSourceNode",String(r++));let n=Ru(u,{manifestUri:t});return{root:u,inherited:n}}var $e=e=>Number.isFinite(e)&&e>0?e:null;function pn(e){let t=e.inherited.representationInfo,u=Bu({dashPlaylists:t.map(o=>({attributes:{...o.attributes},segments:[]}))}),r=[...new Set(t.filter(o=>["video","audio"].includes((o.attributes.mimeType||"").split("/")[0])).map(o=>o.attributes.periodStart))];return[...(u.playlists||[]).map(o=>({p:o,kind:"video",language:""})),...Object.values(u.mediaGroups?.AUDIO||{}).flatMap(o=>Object.values(o).flatMap(i=>i.playlists.map(s=>({p:s,kind:"audio",language:i.language||""}))))].flatMap(({p:o,kind:i,language:s})=>{let a=t.flatMap((d,h)=>{let m=d.attributes;return m.id===o.attributes.NAME&&m.baseUrl===o.resolvedUri&&(m.lang||"")===s&&(m.mimeType||"").split("/")[0]===i?[h]:[]}),c=a.map(d=>t[d].attributes),l=c.map(d=>d.periodStart);if(l.length!==r.length||new Set(l).size!==r.length||r.some(d=>!l.includes(d)))return[];let p=c[0];return c.some(d=>d.mimeType!==p.mimeType||d.codecs!==p.codecs)?[]:[{indices:a,kind:i,label:p.label||p.id||"",mimeType:p.mimeType,codec:p.codecs||"",language:s,role:p.role?.value||"",width:$e(p.width),height:$e(p.height),bandwidth:$e(p.bandwidth),frameRate:$e(p.frameRate)}]})}globalThis.inspectMpd=(e,t)=>JSON.stringify(pn(bt(e,t)));var Ye=e=>e?{url:e.resolvedUri,range:e.byterange??null}:null;globalThis.resolveMpd=(e,t,u)=>{let r=bt(e,t),n=JSON.parse(u),o=n.map(i=>r.inherited.representationInfo[i]);if(o.some(i=>!i))throw Error("invalid_choice");return JSON.stringify(Et(o).map((i,s)=>({index:n[s],mimeType:i.attributes.mimeType,period:i.attributes.periodStart,codecs:i.attributes.codecs||"",indexResource:Ye(i.sidx),indexInit:Ye(i.sidx?.map),segments:i.segments.map(a=>({resource:Ye(a),initialization:Ye(a.map),duration:a.duration,presentationTime:a.presentationTime,timeline:a.timeline}))})))};globalThis.serializeMpd=(e,t,u,r)=>{let n=bt(e,t),o=JSON.parse(u),i=JSON.parse(r),s=n.inherited.representationInfo,a=o.map(m=>s[m]),c=Et(a),l=new Map;for(let m=0;m{let f=i[m];if(typeof f!="string"||!/[0-9a-f-]{36}/.test(f))throw Error("unadmitted_resource");return f},d=(m,f,D,N)=>{let v;for(let g of[f,D,m]){let A=U(g,N)[0];if(A)if(!v)v=A.cloneNode(!0);else{for(let R of Array.from(A.attributes))v.setAttributeNS(R.namespaceURI,R.name,R.value);for(let R of Array.from(A.childNodes).filter(q=>q.nodeType===1)){for(let q of U(v,R.localName))v.removeChild(q);v.appendChild(R.cloneNode(!0))}}}return v},h=(m,f)=>{f?m.setAttribute("range",f.offset+"-"+(f.offset+f.length-1)):m.removeAttribute("range")};for(let m of U(n.root,"Period"))for(let f of U(m,"AdaptationSet")){for(let D of U(f,"Representation")){let N=l.get(D.getAttribute("piikSourceNode"));if(!N){f.removeChild(D);continue}let{info:v,track:g}=N,A=d(D,m,f,"SegmentBase"),R=d(D,m,f,"SegmentTemplate"),q=d(D,m,f,"SegmentList");for(let B of["BaseURL","SegmentBase","SegmentTemplate","SegmentList"])for(let O of U(D,B))D.removeChild(O);if(D.removeAttribute("piikSourceNode"),g.sidx){if(!A)throw Error("missing_index");let B=D.ownerDocument.createElementNS(n.root.namespaceURI,"BaseURL");B.textContent=p(g.sidx.resolvedUri),D.appendChild(B);let O=U(A,"Initialization")[0];O&&g.sidx.map&&(O.setAttribute("sourceURL",p(g.sidx.map.resolvedUri)),h(O,g.sidx.map.byterange)),D.appendChild(A)}else{if(!g.segments.length)throw Error("unsupported_address");let B=R||q;if(!B)throw Error("unsupported_address");let O=D.ownerDocument.createElementNS(n.root.namespaceURI,"SegmentList");for(let S of Array.from(B.attributes))["media","initialization","index","bitstreamSwitching"].includes(S.name)||O.setAttributeNS(S.namespaceURI,S.name,S.value);for(let S of U(B,"SegmentTimeline"))O.appendChild(S.cloneNode(!0));let C=g.segments[0].map;if(C){let S=D.ownerDocument.createElementNS(n.root.namespaceURI,"Initialization");S.setAttribute("sourceURL",p(C.resolvedUri)),h(S,C.byterange),O.appendChild(S)}for(let S of g.segments){if(C&&S.map?.resolvedUri!==C.resolvedUri)throw Error("changing_init");let T=D.ownerDocument.createElementNS(n.root.namespaceURI,"SegmentURL");T.setAttribute("media",p(S.resolvedUri)),S.byterange&&T.setAttribute("mediaRange",S.byterange.offset+"-"+(S.byterange.offset+S.byterange.length-1)),O.appendChild(T)}D.appendChild(O)}}for(let D of["BaseURL","SegmentBase","SegmentTemplate","SegmentList"])for(let N of U(f,D))f.removeChild(N);U(f,"Representation").length||m.removeChild(f)}for(let m of U(n.root,"Period"))for(let f of["BaseURL","SegmentBase","SegmentTemplate","SegmentList"])for(let D of U(m,f))m.removeChild(D);for(let m of["BaseURL","Location","UTCTiming","ContentSteering","PatchLocation","Metrics"])for(let f of U(n.root,m))n.root.removeChild(f);return new Fu.XMLSerializer().serializeToString(n.root)};})(); +`)}function du(e){this.options=e||{locator:{}}}du.prototype.parseFromString=function(e,t){var u=this.options,r=new Ar,n=u.domBuilder||new Re,o=u.errorHandler,i=u.locator,s=u.xmlns||{},a=/\/x?html?$/.test(t),c=a?cu.HTML_ENTITIES:cu.XML_ENTITIES;i&&n.setDocumentLocator(i),r.errorHandler=Er(o,n,i),r.domBuilder=u.domBuilder||n,a&&(s[""]=lu.HTML),s.xml=s.xml||lu.XML;var l=u.normalizeLineEndings||mu;return e&&typeof e=="string"?r.parse(l(e),s,c):r.errorHandler.error("invalid doc source"),n.doc};function Er(e,t,u){if(!e){if(t instanceof Re)return t;e=t}var r={},n=e instanceof Function;u=u||{};function o(i){var s=e[i];!s&&n&&(s=e.length==2?function(a){e(i,a)}:e),r[i]=s&&function(a){s("[xmldom "+i+"] "+a+ht(u))}||function(){}}return o("warning"),o("error"),o("fatalError"),r}function Re(){this.cdata=!1}function De(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}Re.prototype={startDocument:function(){this.doc=new hr().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,u,r){var n=this.doc,o=n.createElementNS(e,u||t),i=r.length;je(this,o),this.currentElement=o,this.locator&&De(this.locator,o);for(var s=0;s=t+u||t?new java.lang.String(e,t,u)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Re.prototype[e]=function(){return null}});function je(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}$e.__DOMHandler=Re;$e.normalizeLineEndings=mu;$e.DOMParser=du});var gt=re(Ye=>{var hu=mt();Ye.DOMImplementation=hu.DOMImplementation;Ye.XMLSerializer=hu.XMLSerializer;Ye.DOMParser=Du().DOMParser});var ie=Ae(xe()),yt="https://example.com",Vu=function(t,u){if(/^[a-z]+:/i.test(u))return u;/^data:/.test(t)&&(t=ie.default.location&&ie.default.location.href||"");var r=/^\/\//.test(t),n=!ie.default.location&&!/\/\//i.test(t);t=new ie.default.URL(t,ie.default.location||yt);var o=new URL(u,t);return n?o.href.slice(yt.length):r?o.href.slice(o.protocol.length):o.href},Le=Vu;var k=Ae(xe());var wt=function(t,u,r){u.forEach(function(n){for(var o in t.mediaGroups[n])for(var i in t.mediaGroups[n][o]){var s=t.mediaGroups[n][o][i];r(s,n,o,i)}})};var Qe=Ae(xe()),Gu=function(t){return Qe.default.atob?Qe.default.atob(t):Buffer.from(t,"base64").toString("binary")};function Ke(e){for(var t=Gu(e),u=new Uint8Array(t.length),r=0;r!!e&&typeof e=="object",L=(...e)=>e.reduce((t,u)=>(typeof u!="object"||Object.keys(u).forEach(r=>{Array.isArray(t[r])&&Array.isArray(u[r])?t[r]=t[r].concat(u[r]):gu(t[r])&&gu(u[r])?t[r]=L(t[r],u[r]):t[r]=u[r]}),t),{}),Su=e=>Object.keys(e).map(t=>e[t]),vr=(e,t)=>{let u=[];for(let r=e;re.reduce((t,u)=>t.concat(u),[]),yu=e=>{if(!e.length)return[];let t=[];for(let u=0;ue.reduce((u,r,n)=>(r[t]&&u.push(n),u),[]),Cr=(e,t)=>Su(e.reduce((u,r)=>(r.forEach(n=>{u[t(n)]=n}),u),{})),Oe={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Fe=({baseUrl:e="",source:t="",range:u="",indexRange:r=""})=>{let n={uri:t,resolvedUri:Le(e||"",t)};if(u||r){let i=(u||r).split("-"),s=k.default.BigInt?k.default.BigInt(i[0]):parseInt(i[0],10),a=k.default.BigInt?k.default.BigInt(i[1]):parseInt(i[1],10);s{let t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=k.default.BigInt(e.offset)+k.default.BigInt(e.length)-k.default.BigInt(1):t=e.offset+e.length-1,`${e.offset}-${t}`},Au=e=>(e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e),Tr={static(e){let{duration:t,timescale:u=1,sourceDuration:r,periodDuration:n}=e,o=Au(e.endNumber),i=t/u;return typeof o=="number"?{start:0,end:o}:typeof n=="number"?{start:0,end:n/i}:{start:0,end:r/i}},dynamic(e){let{NOW:t,clientOffset:u,availabilityStartTime:r,timescale:n=1,duration:o,periodStart:i=0,minimumUpdatePeriod:s=0,timeShiftBufferDepth:a=1/0}=e,c=Au(e.endNumber),l=(t+u)/1e3,p=r+i,d=l+s-p,h=Math.ceil(d*n/o),D=Math.floor((l-p-a)*n/o),g=Math.floor((l-p)*n/o);return{start:Math.max(0,D),end:typeof c=="number"?c:Math.min(h,g)}}},Sr=e=>t=>{let{duration:u,timescale:r=1,periodStart:n,startNumber:o=1}=e;return{number:o+t,duration:u/r,timeline:n,time:t*u}},Et=e=>{let{type:t,duration:u,timescale:r=1,periodDuration:n,sourceDuration:o}=e,{start:i,end:s}=Tr[t](e),a=vr(i,s).map(Sr(e));if(t==="static"){let c=a.length-1,l=typeof n=="number"?n:o;a[c].duration=l-u/r*c}return a},wu=e=>{let{baseUrl:t,initialization:u={},sourceDuration:r,indexRange:n="",periodStart:o,presentationTime:i,number:s=0,duration:a}=e;if(!t)throw new Error(Oe.NO_BASE_URL);let c=Fe({baseUrl:t,source:u.sourceURL,range:u.range}),l=Fe({baseUrl:t,source:t,indexRange:n});if(l.map=c,a){let p=Et(e);p.length&&(l.duration=p[0].duration,l.timeline=p[0].timeline)}else r&&(l.duration=r,l.timeline=o);return l.presentationTime=i||o,l.number=s,[l]},yr=(e,t,u)=>{let r=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,o=e.timeline||0,i=e.sidx.byterange,s=i.offset+i.length,a=t.timescale,c=t.references.filter(g=>g.referenceType!==1),l=[],p=e.endList?"static":"dynamic",f=e.sidx.timeline,d=f,h=e.mediaSequence||0,D;typeof t.firstOffset=="bigint"?D=k.default.BigInt(s)+t.firstOffset:D=s+t.firstOffset;for(let g=0;gCr(e,({timeline:t})=>t).sort((t,u)=>t.timeline>u.timeline?1:-1),Ir=(e,t)=>{for(let u=0;u{let t=[];return wt(e,wr,(u,r,n,o)=>{t=t.concat(u.playlists||[])}),t},vu=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((u,r)=>{u.number=e.mediaSequence+r})},Rr=({oldPlaylists:e,newPlaylists:t,timelineStarts:u})=>{t.forEach(r=>{r.discontinuitySequence=u.findIndex(function({timeline:a}){return a===r.timeline});let n=Ir(e,r.attributes.NAME);if(!n||r.sidx)return;let o=r.segments[0],i=n.segments.findIndex(function(a){return Math.abs(a.presentationTime-o.presentationTime)n.timeline||n.segments.length&&r.timeline>n.segments[n.segments.length-1].timeline)&&r.discontinuitySequence--;return}n.segments[i].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),vu({playlist:r,mediaSequence:n.segments[i].number})})},Or=({oldManifest:e,newManifest:t})=>{let u=e.playlists.concat(Eu(e)),r=t.playlists.concat(Eu(t));return t.timelineStarts=Bu([e.timelineStarts,t.timelineStarts]),Rr({oldPlaylists:u,newPlaylists:r,timelineStarts:t.timelineStarts}),t},Fr=e=>e&&e.uri+"-"+Nr(e.byterange),At=e=>{let t=e.reduce(function(r,n){return r[n.attributes.baseUrl]||(r[n.attributes.baseUrl]=[]),r[n.attributes.baseUrl].push(n),r},{}),u=[];return Object.values(t).forEach(r=>{let n=Su(r.reduce((o,i)=>{let s=i.attributes.id+(i.attributes.lang||"");return o[s]?(i.segments&&(i.segments[0]&&(i.segments[0].discontinuity=!0),o[s].segments.push(...i.segments)),i.attributes.contentProtection&&(o[s].attributes.contentProtection=i.attributes.contentProtection)):(o[s]=i,o[s].attributes.timelineStarts=[]),o[s].attributes.timelineStarts.push({start:i.attributes.periodStart,timeline:i.attributes.periodStart}),o},{}));u=u.concat(n)}),u.map(r=>(r.discontinuityStarts=br(r.segments||[],"discontinuity"),r))},vt=(e,t)=>{let u=Fr(e.sidx),r=u&&t[u]&&t[u].sidx;return r&&yr(e,r,e.sidx.resolvedUri),e},_r=(e,t={})=>{if(!Object.keys(t).length)return e;for(let u in e)e[u]=vt(e[u],t);return e},xr=({attributes:e,segments:t,sidx:u,mediaSequence:r,discontinuitySequence:n,discontinuityStarts:o},i)=>{let s={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:o,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),u&&(s.sidx=u),i&&(s.attributes.AUDIO="audio",s.attributes.SUBTITLES="subs"),s},Lr=({attributes:e,segments:t,mediaSequence:u,discontinuityStarts:r,discontinuitySequence:n})=>{typeof t>"u"&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let o={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(o.CODECS=e.codecs);let i={attributes:o,uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:n,mediaSequence:u,segments:t};return e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),i},Ur=(e,t={},u=!1)=>{let r,n=e.reduce((o,i)=>{let s=i.attributes.role&&i.attributes.role.value||"",a=i.attributes.lang||"",c=i.attributes.label||"main";if(a&&!i.attributes.label){let p=s?` (${s})`:"";c=`${i.attributes.lang}${p}`}o[c]||(o[c]={language:a,autoselect:!0,default:s==="main",playlists:[],uri:""});let l=vt(xr(i,u),t);return o[c].playlists.push(l),typeof r>"u"&&s==="main"&&(r=i,r.default=!0),o},{});if(!r){let o=Object.keys(n)[0];n[o].default=!0}return n},qr=(e,t={})=>e.reduce((u,r)=>{let n=r.attributes.label||r.attributes.lang||"text",o=r.attributes.lang||"und";return u[n]||(u[n]={language:o,default:!1,autoselect:!1,playlists:[],uri:""}),u[n].playlists.push(vt(Lr(r),t)),u},{}),Mr=e=>e.reduce((t,u)=>(u&&u.forEach(r=>{let{channel:n,language:o}=r;t[o]={autoselect:!1,default:!1,instreamId:n,language:o},r.hasOwnProperty("aspectRatio")&&(t[o].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(t[o].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(t[o]["3D"]=r["3D"])}),t),{}),Pr=({attributes:e,segments:t,sidx:u,discontinuityStarts:r})=>{let n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.qualityRanking!==void 0&&(n.attributes.SCORE=1/(e.qualityRanking+1)),e.contentProtection&&(n.contentProtection=e.contentProtection),e.serviceLocation&&(n.attributes.serviceLocation=e.serviceLocation),u&&(n.sidx=u),n},kr=({attributes:e})=>e.mimeType==="video/mp4"||e.mimeType==="video/webm"||e.contentType==="video",Vr=({attributes:e})=>e.mimeType==="audio/mp4"||e.mimeType==="audio/webm"||e.contentType==="audio",Gr=({attributes:e})=>e.mimeType==="text/vtt"||e.contentType==="text",zr=(e,t)=>{e.forEach(u=>{u.mediaSequence=0,u.discontinuitySequence=t.findIndex(function({timeline:r}){return r===u.timeline}),u.segments&&u.segments.forEach((r,n)=>{r.number=n})})},bu=e=>e?Object.keys(e).reduce((t,u)=>{let r=e[u];return t.concat(r.playlists)},[]):[],Iu=({dashPlaylists:e,locations:t,contentSteering:u,sidxMapping:r={},previousManifest:n,eventStream:o})=>{if(!e.length)return{};let{sourceDuration:i,type:s,suggestedPresentationDelay:a,minimumUpdatePeriod:c}=e[0].attributes,l=At(e.filter(kr)).map(Pr),p=At(e.filter(Vr)),f=At(e.filter(Gr)),d=e.map(m=>m.attributes.captionServices).filter(Boolean),h={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:i,playlists:_r(l,r)};c>=0&&(h.minimumUpdatePeriod=c*1e3),t&&(h.locations=t),u&&(h.contentSteering=u),s==="dynamic"&&(h.suggestedPresentationDelay=a),o&&o.length>0&&(h.eventStream=o);let D=h.playlists.length===0,g=p.length?Ur(p,r,D):null,O=f.length?qr(f,r):null,w=l.concat(bu(g),bu(O)),N=w.map(({timelineStarts:m})=>m);return h.timelineStarts=Bu(N),zr(w,h.timelineStarts),g&&(h.mediaGroups.AUDIO.audio=g),O&&(h.mediaGroups.SUBTITLES.subs=O),d.length&&(h.mediaGroups["CLOSED-CAPTIONS"].cc=Mr(d)),n?Or({oldManifest:n,newManifest:h}):h},Hr=(e,t,u)=>{let{NOW:r,clientOffset:n,availabilityStartTime:o,timescale:i=1,periodStart:s=0,minimumUpdatePeriod:a=0}=e,c=(r+n)/1e3,l=o+s,f=c+a-l;return Math.ceil((f*i-t)/u)},Ru=(e,t)=>{let{type:u,minimumUpdatePeriod:r=0,media:n="",sourceDuration:o,timescale:i=1,startNumber:s=1,periodStart:a}=e,c=[],l=-1;for(let p=0;pl&&(l=D);let g;if(h<0){let N=p+1;N===t.length?u==="dynamic"&&r>0&&n.indexOf("$Number$")>0?g=Hr(e,l,d):g=(o*i-l)/d:g=(t[N].t-l)/d}else g=h+1;let O=s+c.length+g,w=s+c.length;for(;w(t,u,r,n)=>{if(t==="$$")return"$";if(typeof e[u]>"u")return t;let o=""+e[u];return u==="RepresentationID"||(r?n=parseInt(n,10):n=1,o.length>=n)?o:`${new Array(n-o.length+1).join("0")}${o}`},Cu=(e,t)=>e.replace(Xr,jr(t)),$r=(e,t)=>!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?Et(e):Ru(e,t),Yr=(e,t)=>{let u={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=e,n=Fe({baseUrl:e.baseUrl,source:Cu(r.sourceURL,u),range:r.range});return $r(e,t).map(i=>{u.Number=i.number,u.Time=i.time;let s=Cu(e.media||"",u),a=e.timescale||1,c=e.presentationTimeOffset||0,l=e.periodStart+(i.time-c)/a;return{uri:s,timeline:i.timeline,duration:i.duration,resolvedUri:Le(e.baseUrl||"",s),map:n,number:i.number,presentationTime:l}})},Wr=(e,t)=>{let{baseUrl:u,initialization:r={}}=e,n=Fe({baseUrl:u,source:r.sourceURL,range:r.range}),o=Fe({baseUrl:u,source:t.media,range:t.mediaRange});return o.map=n,o},Zr=(e,t)=>{let{duration:u,segmentUrls:r=[],periodStart:n}=e;if(!u&&!t||u&&t)throw new Error(Oe.SEGMENT_TIME_UNSPECIFIED);let o=r.map(a=>Wr(e,a)),i;return u&&(i=Et(e)),t&&(i=Ru(e,t)),i.map((a,c)=>{if(o[c]){let l=o[c],p=e.timescale||1,f=e.presentationTimeOffset||0;return l.timeline=a.timeline,l.duration=a.duration,l.number=a.number,l.presentationTime=n+(a.time-f)/p,l}}).filter(a=>a)},Jr=({attributes:e,segmentInfo:t})=>{let u,r;t.template?(r=Yr,u=L(e,t.template)):t.base?(r=wu,u=L(e,t.base)):t.list&&(r=Zr,u=L(e,t.list));let n={attributes:e};if(!r)return n;let o=r(u,t.segmentTimeline);if(u.duration){let{duration:i,timescale:s=1}=u;u.duration=i/s}else o.length?u.duration=o.reduce((i,s)=>Math.max(i,Math.ceil(s.duration)),0):u.duration=0;return n.attributes=u,n.segments=o,t.base&&u.indexRange&&(n.sidx=o[0],n.segments=[]),n},bt=e=>e.map(Jr),R=(e,t)=>yu(e.childNodes).filter(({tagName:u})=>u===t),_e=e=>e.textContent.trim(),Qr=e=>parseFloat(e.split("/").reduce((t,u)=>t/u)),he=e=>{let s=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!s)return 0;let[a,c,l,p,f,d]=s.slice(1);return parseFloat(a||0)*31536e3+parseFloat(c||0)*2592e3+parseFloat(l||0)*86400+parseFloat(p||0)*3600+parseFloat(f||0)*60+parseFloat(d||0)},Kr=e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)),Nu={mediaPresentationDuration(e){return he(e)},availabilityStartTime(e){return Kr(e)/1e3},minimumUpdatePeriod(e){return he(e)},suggestedPresentationDelay(e){return he(e)},type(e){return e},timeShiftBufferDepth(e){return he(e)},start(e){return he(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return Qr(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){let t=parseInt(e,10);return isNaN(t)?he(e):t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},qualityRanking(e){return parseInt(e,10)},qualityranking(e){return parseInt(e,10)},DEFAULT(e){return e}},en={qualityranking:"qualityRanking"},F=e=>e&&e.attributes?yu(e.attributes).reduce((t,u)=>{let r=Nu[u.name]||Nu.DEFAULT,n=en[u.name]||u.name;return t[n]=r(u.value),t},{}):{},tn={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},We=(e,t)=>t.length?ge(e.map(function(u){return t.map(function(r){let n=_e(r),o=Le(u.baseUrl,n),i=L(F(r),{baseUrl:o});return o!==n&&!i.serviceLocation&&u.serviceLocation&&(i.serviceLocation=u.serviceLocation),i})})):e,Ct=e=>{let t=R(e,"SegmentTemplate")[0],u=R(e,"SegmentList")[0],r=u&&R(u,"SegmentURL").map(p=>L({tag:"SegmentURL"},F(p))),n=R(e,"SegmentBase")[0],o=u||t,i=o&&R(o,"SegmentTimeline")[0],s=u||n||t,a=s&&R(s,"Initialization")[0],c=t&&F(t);c&&a?c.initialization=a&&F(a):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});let l={template:c,segmentTimeline:i&&R(i,"S").map(p=>F(p)),list:u&&L(F(u),{segmentUrls:r,initialization:F(a)}),base:n&&L(F(n),{initialization:F(a)})};return Object.keys(l).forEach(p=>{l[p]||delete l[p]}),l},un=(e,t,u)=>r=>{let n=R(r,"BaseURL"),o=We(t,n),i=L(e,F(r)),s=Ct(r);return o.map(a=>({segmentInfo:L(u,s),attributes:L(i,a)}))},rn=e=>e.reduce((t,u)=>{let r=F(u);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());let n=tn[r.schemeIdUri];if(n){t[n]={attributes:r};let o=R(u,"cenc:pssh")[0];if(o){let i=_e(o);t[n].pssh=i&&Ke(i)}}return t},{}),nn=e=>{if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof e.value!="string"?[]:e.value.split(";")).map(u=>{let r,n;return n=u,/^CC\d=/.test(u)?[r,n]=u.split("="):/^CC\d$/.test(u)&&(r=u),{channel:r,language:n}});if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof e.value!="string"?[]:e.value.split(";")).map(u=>{let r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(u)){let[n,o=""]=u.split("=");r.channel=n,r.language=u,o.split(",").forEach(i=>{let[s,a]=i.split(":");s==="lang"?r.language=a:s==="er"?r.easyReader=Number(a):s==="war"?r.aspectRatio=Number(a):s==="3D"&&(r["3D"]=Number(a))})}else r.language=u;return r.channel&&(r.channel="SERVICE"+r.channel),r})},on=e=>ge(R(e.node,"EventStream").map(t=>{let u=F(t),r=u.schemeIdUri;return R(t,"Event").map(n=>{let o=F(n),i=o.presentationTime||0,s=u.timescale||1,a=o.duration||0,c=i/s+e.attributes.start;return{schemeIdUri:r,value:u.value,id:o.id,start:c,end:c+a/s,messageData:_e(n)||o.messageData,contentEncoding:u.contentEncoding,presentationTimeOffset:u.presentationTimeOffset||0}})})),an=(e,t,u)=>r=>{let n=F(r),o=We(t,R(r,"BaseURL")),i=R(r,"Role")[0],s={role:F(i)},a=L(e,n,s),c=R(r,"Accessibility")[0],l=nn(F(c));l&&(a=L(a,{captionServices:l}));let p=R(r,"Label")[0];if(p&&p.childNodes.length){let g=p.childNodes[0].nodeValue.trim();a=L(a,{label:g})}let f=rn(R(r,"ContentProtection"));Object.keys(f).length&&(a=L(a,{contentProtection:f}));let d=Ct(r),h=R(r,"Representation"),D=L(u,d);return ge(h.map(un(a,o,D)))},sn=(e,t)=>(u,r)=>{let n=We(t,R(u.node,"BaseURL")),o=L(e,{periodStart:u.attributes.start});typeof u.attributes.duration=="number"&&(o.periodDuration=u.attributes.duration);let i=R(u.node,"AdaptationSet"),s=Ct(u.node);return ge(i.map(an(o,n,s)))},cn=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;let u=L({serverURL:_e(e[0])},F(e[0]));return u.queryBeforeStart=u.queryBeforeStart==="true",u},ln=({attributes:e,priorPeriodAttributes:t,mpdType:u})=>typeof e.start=="number"?e.start:t&&typeof t.start=="number"&&typeof t.duration=="number"?t.start+t.duration:!t&&u==="static"?0:null,Ou=(e,t={})=>{let{manifestUri:u="",NOW:r=Date.now(),clientOffset:n=0,eventHandler:o=function(){}}=t,i=R(e,"Period");if(!i.length)throw new Error(Oe.INVALID_NUMBER_OF_PERIOD);let s=R(e,"Location"),a=F(e),c=We([{baseUrl:u}],R(e,"BaseURL")),l=R(e,"ContentSteering");a.type=a.type||"static",a.sourceDuration=a.mediaPresentationDuration||0,a.NOW=r,a.clientOffset=n,s.length&&(a.locations=s.map(_e));let p=[];return i.forEach((f,d)=>{let h=F(f),D=p[d-1];h.start=ln({attributes:h,priorPeriodAttributes:D?D.attributes:null,mpdType:a.type}),p.push({node:f,attributes:h})}),{locations:a.locations,contentSteeringInfo:cn(l,o),representationInfo:ge(p.map(sn(a,c))),eventStream:ge(p.map(on))}},Fu=e=>{if(e==="")throw new Error(Oe.DASH_EMPTY_MANIFEST);let t=new Tu.DOMParser,u,r;try{u=t.parseFromString(e,"application/xml"),r=u&&u.documentElement.tagName==="MPD"?u.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(Oe.DASH_INVALID_XML);return r};var _u=Ae(gt(),1),M=(e,t)=>Array.from(e.childNodes).filter(u=>u.nodeType===1&&u.localName===t);function Nt(e,t){let u=Fu(e);if((u.getAttribute("type")||"static")!=="static"||u.getElementsByTagNameNS("*","ContentProtection").length)throw Error("unsupported_mpd");for(let o of[u,...Array.from(u.getElementsByTagName("*"))])for(let i of Array.from(o.attributes||[]))if(i.namespaceURI==="http://www.w3.org/1999/xlink"&&i.localName==="href")throw Error("external_mpd");let r=0;for(let o of M(u,"Period"))for(let i of M(o,"AdaptationSet"))for(let s of M(i,"Representation"))s.setAttribute("piikSourceNode",String(r++));let n=Ou(u,{manifestUri:t});return{root:u,inherited:n}}var Ze=e=>Number.isFinite(e)&&e>0?e:null;function pn(e){let t=e.inherited.representationInfo,u=Iu({dashPlaylists:t.map(o=>({attributes:{...o.attributes},segments:[]}))}),r=[...new Set(t.filter(o=>["video","audio"].includes((o.attributes.mimeType||"").split("/")[0])).map(o=>o.attributes.periodStart))];return[...(u.playlists||[]).map(o=>({p:o,kind:"video",language:""})),...Object.values(u.mediaGroups?.AUDIO||{}).flatMap(o=>Object.values(o).flatMap(i=>i.playlists.map(s=>({p:s,kind:"audio",language:i.language||""}))))].flatMap(({p:o,kind:i,language:s})=>{let a=t.flatMap((f,d)=>{let h=f.attributes;return h.id===o.attributes.NAME&&h.baseUrl===o.resolvedUri&&(h.lang||"")===s&&(h.mimeType||"").split("/")[0]===i?[d]:[]}),c=a.map(f=>t[f].attributes),l=c.map(f=>f.periodStart);if(l.length!==r.length||new Set(l).size!==r.length||r.some(f=>!l.includes(f)))return[];let p=c[0];return c.some(f=>f.mimeType!==p.mimeType||f.codecs!==p.codecs)?[]:[{indices:a,kind:i,label:p.label||p.id||"",mimeType:p.mimeType,codec:p.codecs||"",language:s,role:p.role?.value||"",width:Ze(p.width),height:Ze(p.height),bandwidth:Ze(p.bandwidth),frameRate:Ze(p.frameRate)}]})}globalThis.inspectMpd=(e,t)=>JSON.stringify(pn(Nt(e,t)));var Je=e=>e?{url:e.resolvedUri,range:e.byterange??null}:null;globalThis.resolveMpd=(e,t,u)=>{let r=Nt(e,t),n=JSON.parse(u),o=n.map(i=>r.inherited.representationInfo[i]);if(o.some(i=>!i))throw Error("invalid_choice");return JSON.stringify(bt(o).map((i,s)=>({index:n[s],mimeType:i.attributes.mimeType,period:i.attributes.periodStart,codecs:i.attributes.codecs||"",indexResource:Je(i.sidx),indexInit:Je(i.sidx?.map),segments:i.segments.map(a=>({resource:Je(a),initialization:Je(a.map),duration:a.duration,presentationTime:a.presentationTime,timeline:a.timeline}))})))};globalThis.serializeMpd=(e,t,u,r)=>{let n=Nt(e,t),o=JSON.parse(u),i=JSON.parse(r),s=n.inherited.representationInfo,a=o.map(m=>s[m]),c=bt(a),l=new Map;for(let m=0;m{let E=i[m];if(typeof E!="string"||!/[0-9a-f-]{36}/.test(E))throw Error("unadmitted_resource");return E},f=(m,E,b,T)=>{let B;for(let A of[E,b,m]){let I=M(A,T)[0];if(I)if(!B)B=I.cloneNode(!0);else{for(let C of Array.from(I.attributes))B.setAttributeNS(C.namespaceURI,C.name,C.value);for(let C of Array.from(I.childNodes).filter(X=>X.nodeType===1)){for(let X of M(B,C.localName))B.removeChild(X);B.appendChild(C.cloneNode(!0))}}}return B},d=(m,E)=>{E?m.setAttribute("range",E.offset+"-"+(E.offset+E.length-1)):m.removeAttribute("range")};for(let m of M(n.root,"Period"))for(let E of M(m,"AdaptationSet")){for(let b of M(E,"Representation")){let T=l.get(b.getAttribute("piikSourceNode"));if(!T){E.removeChild(b);continue}let{info:B,track:A}=T,I=f(b,m,E,"SegmentBase"),C=f(b,m,E,"SegmentTemplate"),X=f(b,m,E,"SegmentList");for(let $ of["BaseURL","SegmentBase","SegmentTemplate","SegmentList"])for(let P of M(b,$))b.removeChild(P);if(b.removeAttribute("piikSourceNode"),A.sidx){if(!I)throw Error("missing_index");let $=b.ownerDocument.createElementNS(n.root.namespaceURI,"BaseURL");$.textContent=p(A.sidx.resolvedUri),b.appendChild($);let P=M(I,"Initialization")[0];P&&A.sidx.map&&(P.setAttribute("sourceURL",p(A.sidx.map.resolvedUri)),d(P,A.sidx.map.byterange)),b.appendChild(I)}else{if(!A.segments.length)throw Error("unsupported_address");let $=C||X;if(!$)throw Error("unsupported_address");let P=b.ownerDocument.createElementNS(n.root.namespaceURI,"SegmentList");for(let v of Array.from($.attributes))["media","initialization","index","bitstreamSwitching"].includes(v.name)||P.setAttributeNS(v.namespaceURI,v.name,v.value);for(let v of M($,"SegmentTimeline"))P.appendChild(v.cloneNode(!0));let te=A.segments[0].map;if(te){let v=b.ownerDocument.createElementNS(n.root.namespaceURI,"Initialization");v.setAttribute("sourceURL",p(te.resolvedUri)),d(v,te.byterange),P.appendChild(v)}for(let v of A.segments){if(te&&v.map?.resolvedUri!==te.resolvedUri)throw Error("changing_init");let U=b.ownerDocument.createElementNS(n.root.namespaceURI,"SegmentURL");U.setAttribute("media",p(v.resolvedUri)),v.byterange&&U.setAttribute("mediaRange",v.byterange.offset+"-"+(v.byterange.offset+v.byterange.length-1)),P.appendChild(U)}b.appendChild(P)}}for(let b of["BaseURL","SegmentBase","SegmentTemplate","SegmentList"])for(let T of M(E,b))E.removeChild(T);M(E,"Representation").length||m.removeChild(E)}let h="urn:mpeg:dash:schema:mpd:2011",D=n.root.ownerDocument.implementation.createDocument(h,"MPD",null),g={MPD:"mediaPresentationDuration minBufferTime",Period:"start duration",AdaptationSet:"contentType mimeType codecs width height frameRate audioSamplingRate lang",Representation:"mimeType codecs bandwidth width height frameRate audioSamplingRate",SegmentBase:"indexRange indexRangeExact timescale presentationTimeOffset",SegmentList:"timescale presentationTimeOffset startNumber duration",Initialization:"sourceURL range",SegmentURL:"media mediaRange",S:"t d r"},O={MPD:["Period"],Period:["AdaptationSet"],AdaptationSet:["Representation"],Representation:["BaseURL","SegmentBase","SegmentList"],SegmentBase:["Initialization"],SegmentList:["Initialization","SegmentTimeline","SegmentURL"],SegmentTimeline:["S"]},w=new Map;function N(m,E){let b=E.localName;for(let T of M(m,"EssentialProperty")){let B=T.getAttribute("schemeIdUri"),A=D.createElementNS(h,"EssentialProperty");if(A.setAttribute("schemeIdUri",B),["urn:mpeg:mpegB:cicp:TransferCharacteristics","urn:mpeg:mpegB:cicp:ColourPrimaries","urn:mpeg:mpegB:cicp:MatrixCoefficients"].includes(B)){let I=Number(T.getAttribute("value"));if(!Number.isSafeInteger(I))throw Error("unsupported_mpd");A.setAttribute("value",String(I))}else if(B!=="urn:mpeg:dash:ssr:2023")throw Error("unsupported_mpd");E.appendChild(A)}if(b==="AdaptationSet"||b==="Representation")for(let T of M(m,"AudioChannelConfiguration")){let B=T.getAttribute("schemeIdUri"),A=T.getAttribute("value"),I;if(B==="urn:mpeg:dash:outputChannelPositionList:2012")I=String(A.trim().split(/ +/).length);else if(["urn:mpeg:dash:23003:3:audio_channel_configuration:2011","urn:dts:dash:audio_channel_configuration:2012","urn:mpeg:mpegB:cicp:ChannelConfiguration"].includes(B))I=parseInt(A,10).toString(10);else if(["tag:dolby.com,2015:dash:audio_channel_configuration:2015","tag:dolby.com,2014:dash:audio_channel_configuration:2011","urn:dolby:dash:audio_channel_configuration:2011"].includes(B))I=parseInt(A,16).toString(16);else continue;if(I==="NaN")continue;let C=D.createElementNS(h,"AudioChannelConfiguration");C.setAttribute("schemeIdUri",B==="urn:mpeg:dash:outputChannelPositionList:2012"?"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":B),C.setAttribute("value",I),E.appendChild(C)}for(let T of g[b]?.split(" ")||[])m.hasAttribute(T)&&E.setAttribute(T,m.getAttribute(T));if(b==="Representation"){let T=m.getAttribute("id");w.has(T)||w.set(T,String(w.size+1)),E.setAttribute("id",w.get(T))}b==="BaseURL"&&(E.textContent=m.textContent);for(let T of O[b]||[])for(let B of M(m,T)){let A=D.createElementNS(h,T);E.appendChild(A),N(B,A)}}return N(n.root,D.documentElement),new _u.XMLSerializer().serializeToString(D.documentElement)};})(); /*! Bundled license information: mpd-parser/dist/mpd-parser.es.js: diff --git a/prototype/channel-mpd/src/tests.rs b/prototype/channel-mpd/src/tests.rs index b1c17219b..adae3f3a9 100644 --- a/prototype/channel-mpd/src/tests.rs +++ b/prototype/channel-mpd/src/tests.rs @@ -170,3 +170,31 @@ fn static_mpd_without_a_complete_track_is_unsupported() { ); assert_eq!(result.err().unwrap().to_string(), "watch_mpd_unsupported"); } + +#[test] +fn viewer_manifest_projects_playback_metadata() { + let fixture = include_str!("../fixtures/clear-multiperiod.mpd"); + let serialize = |extra: &str| { + let xml = fixture.replacen("fixture-titlefixture-extension"#).unwrap(); + for marker in [ + "fixture-note", + "fixture-title", + "urn:fixture:event", + "fixture-extension", + ] { + assert!(!output.contains(marker)); + } + assert!(serialize(r#""#).is_err()); +}